I just started using fipy and have a problem with the 1d grids concat
function (I'm trying to make the grid denser around "interesting" points):
when I attempt to conatenate a dilated 1d grid I get an error. In 2d
zheerror does not appear. an example session in appended below.
is this a bug or do I miss a point?
does anyone have a suggestion on how to build an irregular 1d grid?
thanks
ruedi
import fipy
fipy.Grid1D(nx=10)
UniformGrid1D(dx = 1.0, nx = 10)
fipy.Grid1D(nx=10)+(fipy.Grid1D(nx=10)+10)
Traceback (most recent call last):
File "<interactive input>", line 1, in ?
File "C:\Python24\Lib\site-packages\fipy\meshes\numMesh\mesh.py", line 77,
in __add__
return self._concatenate(other, smallNumber = 1e-15)
File "C:\Python24\Lib\site-packages\fipy\meshes\numMesh\uniformGrid1D.py",
line 104, in _concatenate
return self._getConcatenableMesh()._concatenate(other = other,
smallNumber = smallNumber)
File "C:\Python24\Lib\site-packages\fipy\meshes\numMesh\mesh1D.py", line
91, in _concatenate
return Mesh1D(**self._getAddedMeshValues(other, smallNumber))
File "C:\Python24\Lib\site-packages\fipy\meshes\numMesh\mesh.py", line
219, in _getAddedMeshValues
for item in currFace:
TypeError: iteration over non-sequence
fipy.Grid2D(nx=10, ny=10)
UniformGrid2D(dx = 1.0, dy = 1.0, nx = 10, ny = 10)
fipy.Grid1D(nx=10)+(fipy.Grid1D(nx=10)+(10,))
Traceback (most recent call last):
File "<interactive input>", line 1, in ?
File "C:\Python24\Lib\site-packages\fipy\meshes\numMesh\mesh.py", line 77,
in __add__
return self._concatenate(other, smallNumber = 1e-15)
File "C:\Python24\Lib\site-packages\fipy\meshes\numMesh\uniformGrid1D.py",
line 104, in _concatenate
return self._getConcatenableMesh()._concatenate(other = other,
smallNumber = smallNumber)
File "C:\Python24\Lib\site-packages\fipy\meshes\numMesh\mesh1D.py", line
91, in _concatenate
return Mesh1D(**self._getAddedMeshValues(other, smallNumber))
File "C:\Python24\Lib\site-packages\fipy\meshes\numMesh\mesh.py", line
219, in _getAddedMeshValues
for item in currFace:
TypeError: iteration over non-sequence
fipy.Grid2D(nx=10, ny=10)+(fipy.Grid2D(nx=10, ny=10)+(10,0) )
Mesh2D()
fipy.Grid2D(nx=10, ny=10)+(fipy.Grid2D(nx=10, ny=10, dx=0.5)+(10,0) )
Mesh2D()
( fipy.Grid2D(nx=10, ny=10)+(fipy.Grid2D(nx=10, ny=10, dx=0.5)+(10,0)
) ).getCellCenters()
array([[ 0.5 , 0.5 ],
[ 1.5 , 0.5 ],
[ 2.5 , 0.5 ],
[ 3.5 , 0.5 ],
[ 4.5 , 0.5 ],
[ 5.5 , 0.5 ],
..