sfepy/sfepy — Issue #94: improve gmv support
Author: rc
Created: 2012-01-30 10:26:00+00:00
State: open

The attached patch makes it work with the newest libmesh, but it will fail
with previous versions, so don't push it in yet. Here is how to convert set
of gmv files (that libmesh outputs) into a set of .pos files, that gmsh can
process:

from sfepy.geom.meshutils import mesh

m = mesh()
for i in range(1, 16):
scalars = \
m.readGMV("/home/ondrej/repos/libmesh/examples/ex18/out.gmv.%03i" % i)
m.writescalarspos3("b%03i.pos" % i, scalars)

it'd be cool if sfepy could import all those different input formats and
output them to any other format.

Note that in the gmv file above, there is both mesh and a scalar field on
it. Both is converted to the pos file.

Migrated from http://code.google.com/p/sfepy/issues/detail?id=92

earlier comments

robert.cimrman said, at 2009-06-01T09:43:46.000Z:

Thank you. Yes, that would be cool. What is missing is to add write() to all the
MeshIO classes. It should be easy by following the meshes used for tests. What about
adding an issue and labeling it for beginners?

As for this patch, shall I wait till you polish it? What are your plans? I do not
care much about old libmesh versions, as there was no previous support in sfepy.

ondrej.certik said, at 2009-06-01T14:09:32.000Z:

I would like to have something, that we can use in femhub with hermes too.

My mesh() class above is a mess, it's just a stub to get started, but it should be
put into some nice classes in sfepy and those classes should preferably work with
hermes too.