I inserted a print statement just before the location of the error in:
/usr/local/lib/python2.7/dist-packages/FiPy-3.0_dev5303-py2.7.egg/fipy/terms/abstractConvectionTerm.py
adding the following print statement before line 188 apparently makes the
script run to completion rather than crashing on the second iteration:
ids = self._reshapeIDs(var, numerix.arange(mesh.numberOfCells))
L.addAt(numerix.array(self.constraintL).ravel(), ids.ravel(),
ids.swapaxes(0,1).ravel())
print ''DEBUG', self.constraintB.value.shape # <-- added line
b += numerix.reshape(self.constraintB.value,
ids.shape).sum(0).ravel()
printing something else (which does not list the .shape attribute) does not
"fix" it (e.g., printing the .dtype attribute).
I have no Idea what this actually means for my problem, but I thought I
would report it.
On Thu, Mar 14, 2013 at 2:09 PM, Jonathan Guyer <[email protected]> wrote:
> Thanks for the report. I see the same error, but I don't understand it
> (and can't seem to debug it).
>
> I created http://matforge.org/fipy/ticket/513 to track the issue.
>
>
>
> On Mar 14, 2013, at 1:13 AM, Kristopher Kuhlman wrote:
>
> > Greetings FiPy list,
> >
> > I am trying to make a 1D transient convection/diffusion problem,
> involving flow towards a source at the center of a cylindrical domain. I
> started working with a linear 1D mesh, then converted to
> CylindricalMesh1D, and I get errors related to the convection term.
> >
> > I have reduced my problem to the following script, which runs fine when
> using the Grid1D, but hangs up with CylindricalGrid1D with the error listed
> after the script. If I take out the convection term, the remaining
> transient diffusion problem works fine with the cylindrical grid. Different
> types of convection terms behave the same.
> >
> > I am using numpy 1.6.1 on a recent Kubuntu system. Any help or comments
> regarding what I am doing wrong are appreciated.
> >
> > Thanks,
> >
> > Kris
> >
> > ----
> >
> > from fipy import *
> > L = 10.0
> > nx = 100
> > dx = L/nx
> >
> > #m = Grid1D(nx=nx, dx=dx) # works with this
> grid
> > m = CylindricalGrid1D(nx=nx, dx=dx, origin=(0.1,)) # fails with this grid
> >
> > c0 = numerix.zeros(nx, 'd')
> > c0[40:60] = 1.0
> >
> > cf = CellVariable(name="$c_f$", mesh=m, value=c0)
> > cf.constrain(0.0, m.facesLeft)
> > cf.faceGrad.constrain([0.0,], m.facesRight)
> >
> > CeqF = (TransientTerm(1.0,var=cf) == DiffusionTerm(1.0,var=cf) -
> > ExponentialConvectionTerm((-1.0,),var=cf))
> >
> > Cviewer = Viewer(vars=(cf),datamax=1.0,datamin=-0.05)
> > Cviewer.plot()
> >
> > timeStep = 3.0E-2
> > for j in range(300):
> > CeqF.solve(dt=timeStep)
> > Cviewer.plot()
> >
> > ------
> >
> > $ python test-case2.py
> > Traceback (most recent call last):
> > File "test-case2.py", line 28, in <module>
> > CeqF.solve(dt=timeStep)
> > File
> "/usr/local/lib/python2.7/dist-packages/FiPy-3.0_dev5303-py2.7.egg/fipy/terms/term.py",
> line 209, in solve
> > solver = self._prepareLinearSystem(var, solver, boundaryConditions,
> dt)
> > File
> "/usr/local/lib/python2.7/dist-packages/FiPy-3.0_dev5303-py2.7.egg/fipy/terms/term.py",
> line 171, in _prepareLinearSystem
> > buildExplicitIfOther=self._buildExplcitIfOther)
> > File
> "/usr/local/lib/python2.7/dist-packages/FiPy-3.0_dev5303-py2.7.egg/fipy/terms/binaryTerm.py",
> line 68, in _buildAndAddMatrices
> > buildExplicitIfOther=buildExplicitIfOther)
> > File
> "/usr/local/lib/python2.7/dist-packages/FiPy-3.0_dev5303-py2.7.egg/fipy/terms/binaryTerm.py",
> line 68, in _buildAndAddMatrices
> > buildExplicitIfOther=buildExplicitIfOther)
> > File
> "/usr/local/lib/python2.7/dist-packages/FiPy-3.0_dev5303-py2.7.egg/fipy/terms/unaryTerm.py",
> line 97, in _buildAndAddMatrices
> > diffusionGeomCoeff=diffusionGeomCoeff)
> > File
> "/usr/local/lib/python2.7/dist-packages/FiPy-3.0_dev5303-py2.7.egg/fipy/terms/abstractConvectionTerm.py",
> line 188, in _buildMatrix
> > b += numerix.reshape(self.constraintB.value,
> ids.shape).sum(0).ravel()
> > AttributeError: 'NotImplementedType' object has no attribute 'sum'
> >
> > <ATT00001.c>
>
>
> _______________________________________________
> fipy mailing list
> [email protected]
> http://www.ctcms.nist.gov/fipy
> [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
>
_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
[ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]