1 Data optimization for numerical codes
2 =====================================
6 Renumbering to improve locality
7 -------------------------------
9 A mesher (like SMESH) often generates a scattered cell distribution in output unstructured mesh.
10 So a common task for simulation codes is the reordering for a better locality.
12 medcoupling can do that simply by doing
14 .. literalinclude:: ../../../src/MEDCoupling_Swig/UsersGuideExamplesTest.py
15 :start-after: UG_Optimization_0
16 :end-before: UG_Optimization_0
18 .. figure:: ../images/medrenumber.png
21 Numbering by MEFISTO mesher (to the left) and the same mesh after renumbering (to the right)
23 RenumberingFactory method creates a renumbering algorithm of a specified type: either "Boost" or "Metis".
25 Partitionning for multi procs
26 -----------------------------
28 For simulation codes following the SPMD paradigm, the partitionning is a key step.
29 medcoupling can perform this partition. Here is an example of partitioning mesh *m* into 4 parts and retrieving the first part:
31 .. literalinclude:: ../../../src/MEDCoupling_Swig/UsersGuideExamplesTest.py
32 :start-after: UG_Optimization_1
33 :end-before: UG_Optimization_1
35 .. figure:: ../images/partition.png
38 A whole mesh *m* (to the left) and one fourth of it *part0* (to the right) got using the above code
40 It's then possible to add a layer or more of cells.
42 .. literalinclude:: ../../../src/MEDCoupling_Swig/UsersGuideExamplesTest.py
43 :start-after: UG_Optimization_2
44 :end-before: UG_Optimization_2
46 .. figure:: ../images/partition_with_layer.png
49 *part0* (to the left) and *part0_with_layer* (to the right)