Many points covered in this FAQ are illustrated via Python scripts. Remember that the Python API is almost 100% identical to the C++ one, with the rules listed here.
Projection, interpolation, remapping
Take a look at the getting started section and the Tutorial - MEDCoupling/MEDLoader in Python.
Take a look at Terminology - Meshes, fields, interpolation
Take a look at The MED constellation: MEDCoupling, MEDLoader, MED file, etc ...
Use the PARAVIS module of SALOME to visualize your MED file. The following dedicated fitlers have been written specifically for MED files: Extract group, Extract cell types, ELNO Mesh, ELNO Points, ELNO Surface.
Take a look at Terminology - Meshes, fields, interpolation
Take a look at Array indexing and numbering
When converting a structured mesh to unstructured one, or when storing a field onto a structured mesh, the numbering convention detailed in MEDCoupling::MEDCouplingStructuredMesh::buildUnstructured() is used.
TODO
Check that the environment variables PYTHONPATH and LD_LIBRARY_PATH (PATH under Windows) are correctly set. If you have a full SALOME installation, use the 'shell' command that will automatically set up everything as it should be:
With a custom installation you may want to set the variable manually:
Take a look at this example: Standard build of an unstructured mesh from scratch
Take a look at this example: Standard build of a tensor field on cells with no time attached
For starter, take a look at the basic MEDLoader API.
Use the methods MEDCouplingUMesh::checkConsistencyLight() or MEDCouplingUMesh::checkConsistency()
Take a look at Reading a mesh. and Writing a mesh..
Use the method MEDCouplingCMesh::buildUnstructured()
This the job of the interpolation algorithms in the MED library. For starters, take a look at the general introduction on interpolation. Also this simple example gives a good first illustration. Finally, if you are intereseted in parallel projection (C++ only!), you should take a look at the DEC.
The documentation for non P0 field (i.e. non cell-based fields) is still an on-going work, but for the P0->P0 case, this page gives a good overview.
Yes. Please:
Re-compile in debug mode (with CMAKE_BUILD_TYPE=Debug
), and use either valgrind or gdb to spot the place where the segfault happens. The most common source of mistake is some memory mis-allocation and/or deallocation. With this respect using the auto pointer class MCAuto can be of great help.