- Timestamp:
- 08/21/2008 12:35:40 PM (5 months ago)
- Location:
- trunk/fipy
- Files:
-
- 4 modified
-
terms/implicitSourceTerm.py (modified) (2 diffs)
-
terms/test.py (modified) (1 diff)
-
tools/numerix.py (modified) (1 diff)
-
variables/variable.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/fipy/terms/implicitSourceTerm.py
r2228 r2726 58 58 """ 59 59 def _calcCoeffVectors(self, var, equation=None): 60 """ 61 Test for a bug due to the sign operator not being updating 62 correctly. 63 64 >>> from fipy import * 65 >>> m = Grid1D(nx=1) 66 >>> v = CellVariable(mesh=m, value=1.) 67 >>> eq = TransientTerm() == ImplicitSourceTerm(v) 68 >>> eq.solve(v) 69 >>> print v 70 [ 2.] 71 >>> v.setValue(-1.) 72 >>> eq.solve(v) 73 >>> print v 74 [-0.5] 75 76 """ 77 60 78 coeff = self._getGeomCoeff(var.getMesh()) 61 79 from fipy.tools.numerix import sign … … 67 85 'new value': numerix.zeros(var.getMesh().getNumberOfCells(), 'd') 68 86 } 87 88 def _test(): 89 import doctest 90 return doctest.testmod() 91 92 if __name__ == "__main__": 93 _test() -
trunk/fipy/terms/test.py
r2443 r2726 57 57 'equation', 58 58 'upwindConvectionTerm', 59 'collectedDiffusionTerm' 59 'collectedDiffusionTerm', 60 'implicitSourceTerm' 60 61 ), base = __name__) 61 62 -
trunk/fipy/tools/numerix.py
r2590 r2726 834 834 return umath.ceil(arr) 835 835 836 837 def sign(arr): 838 if _isPhysical(arr): 839 return arr.sign() 840 elif type(arr) is type(array((0))): 841 return NUMERIX.sign(arr) 842 else: 843 return umath.sign(arr) 844 836 845 def exp(arr): 837 846 r""" -
trunk/fipy/variables/variable.py
r2581 r2726 1194 1194 def ceil(self): 1195 1195 return self._UnaryOperatorVariable(lambda a: numerix.ceil(a)) 1196 1197 def sign(self): 1198 return self._UnaryOperatorVariable(lambda a: numerix.sign(a), canInline=False) 1196 1199 1197 1200 def conjugate(self):
FiPy: A Finite Volume PDE Solver Using Python