On Mar 13, 2012, at 3:24 PM, Andreas Hasenkopf wrote:

> gmsh supports several formats for data import. Among those VTK,

Interesting. Is that documented... anywhere? The only Gmsh formats that I know 
about are at http://geuz.org/gmsh/doc/texinfo/gmsh.html#File-formats.

> but due
> to the fact that fipy does not calculate values for some cells and faces
> (unsupported cell-shape, e.g. hexagon??) gmsh aborts with error messages
> when I try to import the data.

Gmsh insists that the Vtk file contain hexagons even if the mesh doesn't? Or 
are you generating a mesh with hexagons in it? Can you send me a mesh that's 
causing you problems?

Regardless, the Gmsh I/O routines have been completely revamped in the next 
release and I expect this should work better with either Vtk or native Gmsh 
output files.

> Mayavi reads the data without complaint
> and leaves the "empty" cells empty in the display.
> But in order to work with the VTK file I have to manually replace the
> decimal limiter symbol.

The thing is to figure out why tvtk/Vtk is localizing the file in a way that 
Mayavi and Gmsh can't read. I could see that Gmsh might be statically linking 
its Vtk library, but I can't imagine why mayavi and tvtk wouldn't be symmetric. 
mayavi should be *using* tvtk for this.

> By the way, as I have noticed it is possible to convert the values of a
> CellVariable on a mesh created with fipy into a numpy array. Is there a
> way to do the same when the mesh is more complicated and created with gmsh?

.getValue() on a CellVariable returns a numpy array, but not in an order that 
is meaningful without the topology and geometry defined by the mesh. You 
should, however be able to interpolate the values onto a grid by passing an 
array of coordinates to the __call__ method, e.g.,

vals = var(coords)


_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to