You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Jon Alm Erikson noticed that vector equations are broken with sweep. His code
rom fipy import *
m = Grid1D(nx=100, Lx=1.)
v = CellVariable(mesh=m, hasOld=True, value=[[0.5], [0.5]],
elementshape=(2,))
v.constrain([[0], [1]], m.facesLeft)
v.constrain([[1], [0]], m.facesRight)
eqn = TransientTerm([[1, 0],
[0, 1]]) == DiffusionTerm([[[0.01, -1],
[1, 0.01]]])
vi = Viewer((v[0], v[1]), datamax=1., datamin=0.)
for t in range(100):
v.updateOld()
res = 1
while res > 1e-6:
res = eqn.sweep(var=v, dt=1e-3)
vi.plot()
gave a TypeError
Traceback (most recent call last):
...
File "/home/wd15/git/fipy/fipy/solvers/solver.py", line 141, in _calcResidualVector
Lx = self.matrix * numerix.array(self.var)
File "/home/wd15/git/fipy/fipy/matrices/pysparseMatrix.py", line 327, in __mul__
return _PysparseMatrixFromShape.__mul__(self, other)
File "/home/wd15/git/fipy/fipy/matrices/pysparseMatrix.py", line 169, in __mul__
raise TypeError
TypeError
#CommitTicketReference repository="fipy" revision="2f015d7d9acd1953462a93a52e03c18303c8e2a6"
BUG: Fix issue with vector equations when sweeping.
The fix flattens variable arrays which can have the wrong shape when
calculating the residual. The variable arrays are 2D for vector
equations.
Addresses issue #401
The following changes since commit c668e0f16ba4477a354c3f298b56e0cac620404f:
Merge branch 'develop' into ticket658-sweep_breaks_vector_equations (2013-10-25 18:51:39 -0400)
are available in the git repository at:
ssh://git@code.matforge.org/nist/fipy.git ticket658-sweep_breaks_vector_equations
for you to fetch changes up to c668e0f16ba4477a354c3f298b56e0cac620404f:
Merge branch 'develop' into ticket658-sweep_breaks_vector_equations (2013-10-25 18:51:39 -0400)
Jon Alm Erikson noticed that vector equations are broken with
sweep
. His codegave a
TypeError
See http://thread.gmane.org/gmane.comp.python.fipy/3246/focus=3250.
Imported from trac ticket #658, created by wd15 on 10-25-2013 at 18:27, last modified: 01-17-2014 at 12:06
The text was updated successfully, but these errors were encountered: