I am working in a code to coupling code_aster (http://www.code-aster.org/) and LIGGGHTS.
Do to this, I compiled LIGGGHTS with the libraries that make possible LIGGGHTS work with meshes in med (Modélisation et Echange de Données - http://www.code-aster.org/spip.php?article275) format.
I share all the work here in hope that can be useful to someone.
The main objective are to keep track of the ID's of the elements in the LIGGGHTS study, dump the information in CSV and MED files and use this mesh MED (where the ID's were controlled) and the CSV ( Relating the ID's with the results field) to run a code_aster study.
This compressed file has all code I have developed until now: https://mega.nz/#!R51kARAY!Qfkt22UOViUVLVOwx4maU0vtWOpZngt3ogmuwwpTaDE
To install the code you should extract the file inside LIGGGHTS source and type # make yes_med. This will compile the HDF5 and MED libraries, copy the files dump_mesh_med.cpp, dump_mesh_med.h, input_mesh_tri.cpp and input_mesh_tri.h to src folder and put flags in Makefile.package to make tool be able to find these libraries during compilation process.
To import meshes in the MED format you just need to import mesh using mesh/surface command. For example:
fix cad0 all mesh/surface/stress file cad0.med type 2 heal auto_remove_duplicates scale 1e-3 move 0.0 0.0 0.0 reference_point 0.0 0.0 0.0 stress on wear finnie
To dump the mesh you need to use a command like this:
dump dump0 all mesh/med 1000 post/cad.med stresscomponents stress id .wear vel owner area cad0
This will generate the mesh file cad.med in the post folder and 2 files of CSV format where are stored the forces (I modified the dump process to export forces instead tension) average in one and components in another. The MED format is monolithic, i.e. all the information will generate in a single file.
To read cad.med file you should download SALOME (http://www.salome-platform.org/downloads/current-version) and use PARAVIS (a paraview modified version). To read the CSV files you can use LIBREOFICCE, for example.
The coupling process work well, but I faced a problem. When using the move/mesh command the ID's become mixed. I don't know exactly why this happen but I suspect that the move/mesh read all mesh in each iteration. This behavior is very problematic because the mesh in the MED format is store only on the first dump and, because of this, the elements ID's cannot change during the run. After the first dump, only the results are stored. I need to solve. Any help would be appreciate.
The coupling process could be done using the fields store in the MED file (without using the CSV files). code_aster has some commands to perform this, but I do not developed this for now.
Developed in Debian 8. Kernel 3.16.0-4-amd64. LIGGGHTS-PUBLIC 3.7. code_aster 13.4. MED library 3.2.0. HDF library 184.108.40.206.
This is it.
I thank all the LIGGGHTS community. and specially to richti83 that pointed the direction to develop this work.