The mmg applications may need the use of a parameter file to enable some specific feature.
By default, mmg3d reads a DEFAULT.mmg3d or a <meshname>.mmg3d parameter file, mmgs a DEFAULT.mmgs or a <meshname>.mmgs one and mmg2d a DEFAULT.mmg2d or a <meshname>.mmg2d parameter file (where <meshname> is the name of the input mesh without extension).
The used file format is the same for the 3 applications (see the examples below).
Local parameters assignment
You can use the parameter file to associate local Hausdorff, minimal edge size and maximal edge size to boundary references.
Note that a boundary reference refers to an integer value (a color) associated to a boundary element.
Example of local parameter assignment:
Parameters
3
38 Triangles 1.8 2.2 0.01
36 Triangles 0.098 0.12 0.1
37 Triangles 4.8 5.2 1
After the keyword “parameters”, give the number of boundary references over which you want to impose local parameters (3 in our example).
Then, for each reference, give : the reference , the type of elements on which you want to apply the parameters (for now, we just handle with the “Triangles” elements for mmgs and mmg3d and the “edges” one for mmg2d), the value of the minimal edge size, the value of the maximal one and the value of the Hausdorff parameter.
In our example, we impose:
- a minimal edge size of 1.8, a maximal one of 2.2 and a Hausdorff parameter of 0.01 over all the boundary triangles of reference 38;
- a minimal edge size of 0.098, a maximal one of 0.12 and a Hausdorff parameter of 0.1 over all the boundary triangles of reference 36;
- a minimal edge size of 4.8, a maximal one of 5.2 and a Hausdorff parameter of 1 over all the boundary triangles of reference 37;
Note that the local parameters overwrite the global ones.
Using the API, you can set the same local parameters than in the previous example with the following calls (C):
Other examples are available in the library examples of Mmg:
- https://raw.githubusercontent.com/MmgTools/mmg/master/libexamples/mmg3d/adaptation_example2/main.c
- https://raw.githubusercontent.com/MmgTools/mmg/master/libexamples/mmgs/adaptation_example1/main.c
Multi material mode in level-set discretization mode
You can also use the parameter file to preserve input references while discretizing an isovalue. In this case, the parameter file allows to provide the material mapping between an initial material and the materials in which it will be splitted.
Note that a material corrsponds to a Mmg reference, i.e. an integer value (a color) associated to an element.
Example of materials mapping:
LSReferences
5
12 nosplit
14 3 2
8 21 22
0 23 24
4 25 26
It means that we have 5 input references (materials) and:
- the input domain of reference 12 will not be splitted;
- the input domain of reference 14 will be splitted into domains 3 and 2;
- the input domain of reference 8 will be splitted into domains 21 and 22;
- the input domain of reference 0 will be splitted into domains 23 and 24;
- the input domain of reference 4 will be splitted into domains 25 and 26.
An example of use of parameter file for multi-material mode is provided in the mmg2d examples.
Using the API, you can set the same material mapping than in the previous example with the following calls (C):