This is an old revision of the document!
This page describes how to use the tools dedicated to mesh adaptation using the Mmg remeshing library (http://www.mmgtools.org/).
Using the remeshing solver require to install Mmg and provide the direction to the header files and library using the CMake arguments “MMG_INCLUDE_DIR” and “MMG_LIBRARY”:
cmake -DMMG_INCLUDE_DIR=/path/to/MmgInstallDir/include \ -DMMG_LIBRARY=/path/to/MmgInstallDir/lib/libmmg.a
Examples can be found under the test directories “MMG2D_Aniso1”, “MMG2D_Aniso2” and “MMG2D_Iso”. These tests have the label elmerice-fast and can be executed alone using
ctest -L mmg
The metric M , used to define the element size, derives from a geometric error estimate based on an upper bound for the interpolation error of a continuous field to piecewise linear elements (Frey and Alauzet, 2005).
For a variable v, M depends on the eigenvalues and eigenvector matrix R of the hessian matrix of v, H (i.e. small elements are required where the curvature is the highest):
with and
where
Computing second derivatives in linear elements in not straightforward. Following Buscaglia and Dari (1997), this is done in two steps:
Sometimes it can be desirable to use several variables to compute the metric, if we want, for example, to capture with the same mesh different physical phenomena represented by different variables.
The intersection of two metrics M_1 and M_2 is given by (Alauzet et al., 2007):
with the matrix where the columns are the normalised eigenvectors , of and .
Nodal values of are computed using the MMG2D_MetricIntersect Solver.
The mesh adaptation step is performed using the Mmg 2D library.
The MMG2DSolver Solver pass the mesh topology and required (isotropic or anisotropc) metric to the library then create the new mesh structure from the adapted mesh returned by the library.