**mmg3d#

Description#

This command is used to remesh and optimize a Zebulon tetrahedral mesh by means of MMG3D remeshing library. MMG3D is part of the open source (LGPL license) MMG platform and interfaced with Zebulon through it’s C language API.

Note that only linear elements are handled by mmg3d. A combination of the quad_to_lin (before mmg3d) and lin_to_quad commands (after) may then be used. Yet, the command quad_to_lin may degrade the initial mesh and, when lin_to_quad is used, the quadratic nodes are not projected on the geometry.

Syntax#

We distinguish two types of syntaxes: specific to the mmg tools (mmg3d, mmgs, mmg2d) and necessary for preserving FEM requiered mesh entities. Note that the description of the first type follows the online documentation of the mmg software (https://www.mmgtools.org/mmg-remesher-try-mmg/mmg-remesher-options). The description of the second type is given on page and will not be discussed here.

**mmg3d \(~\,\) *min_size hmin \(~\,\) *max_size hmax \(~\,\) [ *verbose int-value ] \(~\,\) [ *hgrad double-val ] \(~\,\) [ *hgradreq double-val ] \(~\,\) [ *hausd double-val ] \(~\,\) [ *angle_detection degree ] \(~\,\) [ *nodetection  ] \(~\,\) [ *nosurf ] \(~\,\) [ *noinsert ] \(~\,\) [ *nomove  ] \(~\,\) [ *noswap  ] \(~\,\) [ *octree  ] \(~\,\) [ *local_parameters local_set local_min local_max local_hausd ] \(~\,\) *metric [default/scalar/from_function/from_file/uniform_from_field ] \(~\,~\,\) [ metric_options ] \(~\,\) [ *preserve_elsets elsets-names ] \(~\,\) [ *preserve_elsets_start_with elsets-start-with-names ] \(~\,\) [ *preserve_bsets bsets-names ] \(~\,\) [ *preserve_bsets_start_with bsets-start-with-names ] \(~\,\) [ *freeze_elsets elsets-names ] \(~\,\) [ *freeze_elsets_start_with elsets-start-with-names ] \(~\,\) [ *freeze_bsets bsets-names ] \(~\,\) [ *freeze_bsets_start_with bsets-start-with-names ] \(~\,\) [ *freeze_nsets nsets-names ] \(~\,\) [ *freeze_nsets_start_with nsets-start-with-names ] \(~\,\) [ *freeze_fasets_geom fasets-names ] \(~\,\) [ *freeze_fasets_geom_start_with fasets-start-with-names ] \(~\,\) [ *ridges lisets-names ] \(~\,\) [ *ridges_start_with lisets-start-with-names ] \(~\,\) [ *corners nsets-names ] \(~\,\) [ *corners_start_with nsets-start-with-names ] \(~\,\) [ *output_mmg_files ]

*min_size

imposes minimal edge size.

*max_size

imposes maximal edge size.

*verbose

prints detailed informations about the remeshing process. Takes integer values between -1 and 5, -1 being tottally mute. The default value is 1.

*hgrad

sets a gradation value that controls the ratio between two adjacent edges ( \(\frac{1}{hgrad}\leq\frac{e_1}{e_2}\leq hgrad\) for two adjacent edges \(e_1\) and \(e_2\)). By default, the gradation value equals 1.105171.

*hgradreq

metric gradation along required edges to avoid very bad qualities when the prescribed metric doesn’t match with the size of the required entity: Note that you will be impacted if you use the -nosurf option, required edges / triangles / tetrahedra and/or parallelTriangles (library mode only). When set to -1, the option is disabled.

*hausd

controls the boundary approximation: it imposes the maximal distance between the piecewise linear representation of the boundary and the reconstructed ideal boundary. Thus, a low Hausdorff parameter leads to a refinement of the high curvature areas. The default value is set to 0.01, which is suitable for an object of size 1 in each direction.

*angle_detection

used to modify the value for the sharp angle detection. By default it is set to \(45^\circ\). This means that a sharp angle is detected at the interface of two boundary elements when the angle between their outward normals is greater than \(45^\circ\). The edge or node between these normals are set as a ridge or corner.

*nodetection

when set, it forbids the sharp angle detection.

*nosurf

when used, it freezes the surfaces of all element groups. No surface modification is allowed.

*noinsert

when used, it forbids nodes insertion in the new mesh generation process.

*nomove

when used, it forbids point relocation.

*noswap

when used, it forbids edge flipping in the new mesh generation process.

*octree

is used by mmg3d to partition the mesh vertices and thus, to speed up the vertices insertions. Before inserting a point, mmg seeks the octree cell to which the new point will belong and checks if it is not too close from another point of this cell or of one of the neighbouring cells. By default, an octree cell may contain at most 64 vertices.

*local_parameters

as the name suggests, it allows a local definition of the minimum, maximum and Hausdorff parameters on one boundary set (bset) or element set (elset).

*output_mmg_files

when set, it creates the input and output meshes and metrics in mmg native format (.mesh and .sol).

Example#

****mesher
 ***mesh
  **open hole_toy
  **mmg3d
   *min_size  .01
   *max_size  2.
   *verbose   6
   *freeze_elsets eset_overlap
   *preserve_elsets_start_with eset
   *freeze_bsets left
   *preserve_bsets right front
   *corners_start_with corn
   *metric scalar
    value 0.15
   *hgrad 1.25
   *hausd 0.005
   *output_mmg_files
  **output hole_toy_remeshed.geof
****return