Trying to "solve" an integer CellVariable should raise an error
#128
Comments
|
Previously reported as #133 Trac comment by guyer on 06-26-2008 at 16:32 |
|
Warning raised in r2829 Trac comment by guyer on 11-20-2008 at 15:57 |
|
As reported in http://thread.gmane.org/gmane.comp.python.fipy/2826/focus=2838, coupled equations produce weird results if the solution variables hold integers. This should have been addressed by this ticket, and is for single equations, but coupled equations don't raise a warning, e.g., import fipy as fp
mesh = fp.Grid1D(nx=10)
v1 = fp.CellVariable(mesh=mesh, value=1, hasOld=True)
v2 = fp.CellVariable(mesh=mesh, value=1., hasOld=True)
eq1 = fp.TransientTerm(var=v1) h2. fp.DiffusionTerm(var=v1)
eq2 = fp.TransientTerm(var=v2) fp.DiffusionTerm(var=v2)
(eq1 & eq2).solve(dt=1.)Trac comment by guyer on 12-12-2012 at 15:05 |
|
In 5441732: Trac comment by Jonathan E. Guyer guyer@nist.gov on 06-12-2013 at 14:14 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Declaring
produces confusing error messages deep in PySparse that result from
varholding integers ("value=0" instead of "value=0.").One option is to chance the default type for
CellVariable, since integer arrays are probably only useful for FiPy's internal purposes.Perhaps better to leave the semantics of "0" vs. "0." to Python and NumPy to sort out and simply raise an error (or warning?) if an attempt is made to "solve" an integer
CellVariable, since that is not meaningful.Imported from trac ticket #143, created by guyer on 05-27-2008 at 12:53, last modified: 06-12-2013 at 14:14
The text was updated successfully, but these errors were encountered: