Interfacing between FreeFEM and FEniCS/Dolfin

Dear FreeFEM gurus,
for debugging purposes, I want to export a 2D flow field (base flow for linear stability analysis) from FF++ to FEniCS, together with the mesh.
The mesh is created from an edp file, the flow field contains velocity and temperature data.
Does anyone have a recipe for how to export/import that into FEniCS?

Here are some inconclusive ideas:
FEniCS accepts hdf5 for data, and xml or xdmf for a mesh. Maybe other formats are also supported, these are the ones that I know about. A work-around for the mesh alone could be via an msh file, as long as it is the same as what would be created by gmsh.

Thank you for any help you can give us…
Lutz

Well, FEniCS is embedded in Python, so you can export whatever you want from FreeFEM, as long as you have the appropriate loader in Python?
Also, for meshes, I’m quite confident they support Gmsh meshes, which FreeFEM does as well.
Two small remarks:

  1. there is a DMPlex interface, which is how PETSc handles unstructured meshes. It can load/save .hdf5 and various other files formats, but the interface is rather basic right now, feel free to contribute;
  2. if you want to validate results from linear stability analysis, you can use either this code in 2D, or that one in 3D.

Thank you for these links, and the hint to DMPlex. In the end, we will not try the port to Fenics, because that seems to be cumbersome. We’ll stay inside FreeFEM and use the examples to make SLEPc work for us.

If you have trouble with SLEPc, do not hesitate to ask some more questions. It works in sequential and in parallel (unlike ARPACK, which is only sequential).