5. Data optimization for numerical codes

5.1. Renumbering to improve locality

A mesher (like SMESH) often generates a scattered cell distribution in output unstructured mesh. So a common task for simulation codes is the reordering for a better locality.

medcoupling can do that simply by doing


Numbering by MEFISTO mesher (to the left) and the same mesh after renumbering (to the right)

RenumberingFactory method creates a renumbering algorithm of a specified type: either “Boost” or “Metis”.

5.2. Partitionning for multi procs

For simulation codes following the SPMD paradigm, the partitionning is a key step. medcoupling can perform this partition. Here is an example of partitioning mesh m into 4 parts and retrieving the first part:


A whole mesh m (to the left) and one fourth of it part0 (to the right) got using the above code

It’s then possible to add a layer or more of cells.


part0 (to the left) and part0_with_layer (to the right)