Dear all,

I found this snippet in the mail list:
from fipy import *
>     >>> mesh1 = Grid2D(nx=6, ny=2) + (-3.0, 6.0)
>     >>> mesh2 = Grid2D(nx=2, ny=6)
>     >>> mesh = mesh1 + mesh2
>     >>> print mesh.getCellCenters()

but when I run it,  it says

File "test2.py", line 4, in <module>
    mesh = mesh1 + mesh2
  File "fipy/meshes/numMesh/mesh.py", line 74, in __add__
    return self._concatenate(other, smallNumber = 1e-15)
  File /fipy/meshes/numMesh/uniformGrid2D.py", line 106, in _concatenate
    return self._getConcatenableMesh()._concatenate(other = other,
smallNumber = smallNumber)
  File "/fipy/meshes/numMesh/uniformGrid2D.py", line 101, in
_getConcatenableMesh
    return Mesh2D(vertexCoords = self.getVertexCoords(),
  File "/fipy/meshes/numMesh/uniformGrid2D.py", line 252, in getVertexCoords
    return self._createVertices() + self.origin
ValueError: shape mismatch: objects cannot be broadcast to a single shape

Any help is appreciated. My project is to add two cylinders together
(one small one attached with one big one), is it possible to do this
and is it possible to use a non-uniform girds for the big one and in
the same time be able to merge the two meshes?

Thanks for the great job and any advice would be helpful....

Best,
Tim

Reply via email to