- Timestamp:
- 06/19/2008 06:02:50 PM (7 months ago)
- Location:
- trunk
- Files:
-
- 2 modified
-
examples/convection/robin.py (modified) (1 diff)
-
fipy/terms/term.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/convection/robin.py
r2574 r2605 122 122 123 123 >>> res = 1e+10 124 >>> while res > 1e- 3:124 >>> while res > 1e-5: 125 125 ... res = eq.sweep(var=C, boundaryConditions=BCs) 126 126 ... if __name__ == '__main__': -
trunk/fipy/terms/term.py
r2573 r2605 83 83 def _calcResidual(self, var, matrix, RHSvector): 84 84 85 return abs(self._calcResidualVector(var, matrix, RHSvector)).max() 85 L2norm = numerix.sqrt(numerix.sum(self._calcResidualVector(var, matrix, RHSvector)**2)) 86 RHSL2norm = numerix.sqrt(numerix.sum(RHSvector**2)) 87 88 if RHSL2norm == 0: 89 return L2norm 90 else: 91 return L2norm / RHSL2norm 92 93 ## return abs(self._calcResidualVector(var, matrix, RHSvector)).max() 86 94 87 95 def __buildMatrix(self, var, SparseMatrix, boundaryConditions, dt):
FiPy: A Finite Volume PDE Solver Using Python