fipy
fipy copied to clipboard
mesh dimensioning is completely inconsistent
Grid2D
and UniformGrid2D
handle dimensions completely differently. Compare
>>> mesh = Grid2D(nx=3, dx=Variable("1 mum"), ny=1, dy=Variable("1 mum"))
>>> mesh.getCellVolumes()
array([ 1., 1., 1.])
>>> mesh.getCellCenters()
array([[ 0.5, 1.5, 2.5],
[ 0.5, 0.5, 0.5]])
to
>>> mesh = Grid2D(dx=3 * [Variable("1 mum")], dy=[Variable("1 mum")])
>>> mesh.getCellVolumes()
PhysicalField(array([ 1., 1., 1.]),'mum**2')
>>> mesh.getCellCenters()
PhysicalField(array([[ 0.5, 1.5, 2.5],
[ 0.5, 0.5, 0.5]]),'mum')
Imported from trac ticket #188, created by guyer on 04-26-2009 at 08:17, last modified: 12-11-2011 at 23:26