Attached you can find the interface code (files MED_mesh.h and MED_mesh_implementation.cpp) with a working example that uses it.
I don't know if this is much better from what you've already built. The code is raw, no
exception interception from MED, etc. .. you'll see. But it can be used for to import several mesh types from Salome.
In order to build the example do the following:
1) Install the latest Salome. The attached interface is built with Make and gcc (it uses GCC specific hash table, it can be easily replaced with hash table from, say MS Visual C++) under Ubuntu 64-bit.
2) Copy env_products.sh script from your Salome to the build directory of the interface
3) Check the Make file, regarding the LIBS that are used to build Getfem programs, you might have something different than me.
4) Inspect the CFLAGS in Make, if you're using 64 bit system, then leave the flag -DPCLINUX62, if you're using 32 bit, replace this
flag with -DPCLINUX
5) run: ./build.sh (it's a simple make run that initialized all the Salome environments first)
the build will produce a program that is called finite_strain. It imports a simple mesh from MED file QuadTriaModel.med, looking like a simple beam. It is clamped on the sides and a distributed load is gradually applied at the bottom. If you run the program via run.sh script (you'll see that it first initializes Salome environment) it produces the results as .vtk files and a med result file: disp.med.
If you want to use the MED interface in your code just read the public section of the MED_mesh class in MED_mesh.h, it should be easy to understand. But I would appreciate if you try it on all sorts of elements, supported in Salome.
2011/6/12 Christof Baeuerle <address@hidden>
thank you very much for your reply. Yes it would be interesting in
collaborating on this. I only developed an in initial draft version of a
MED interface based on the MEDMEM tutorial. It would be great if you
could send me your code.
Am Sonntag, den 12.06.2011, 09:56 +0200 schrieb Andriy Andreykiv:
> Dear Christof,
> I'd like to say that I've built and have been using a Salome-Getfem
> interface for a while.
> More specifically I can read MED files with Salome meshes with
> boundary and node groups that are imported into equivalent getfem mesh
> The interface is in C++ created based in MEDMED tutorial, available in
> Salome documentation.
> It is supposed to work with all Salome generated elements, but it yet
> has to be checked for
> each element, as node numbering in Salome and getfem is sometimes
> So far I checked that it works with linear and quadratic trias, linear
> and linear tets in 3D. You can also write solution fields into the
> MED file from Getfem,
> but only as DOF in the nodes, hence not yet into the Gauss points
> (the way to postrocess
> stresses and strains in Salome).
> If you or anybody else is interested in collaborating on this, I could
> send you my code.
> Best regards,
> Andriy Andreykiv
Getfem-users mailing list