Mmg
Simplicial remeshers (mesh adaptation, isovalue discretization, lagrangian movement)
|
Go to the source code of this file.
int MMG5_chkmaniball | ( | MMG5_pMesh | mesh, |
MMG5_int | start, | ||
int8_t | istart | ||
) |
mesh | pointer to the mesh structure. |
start | index of starting tria. |
istart | local index of point that we check (in tria start) |
Check whether the ball of vertex i in tria start is manifold;
Step 1: Travel while another part of the implicit boundary is not met
Normal or multi-material mode: check for change in triangle references
Input reference preservation mode (mmgs –keep-ref option): Check if we cross an isoref edge
Step 2: Check why the loop has ended
a./ Case where a boundary is hit: travel in the other sense from start, and make sure that a boundary is hit too
Ball is manifold if tested point is connected to two external edges
b./ General case: go on travelling until another implicit boundary is met
Ball is non-manifold if at least 3 boundary segments meeting at p
Definition at line 1304 of file mmg2.c.
int MMG5_chkmanimesh | ( | MMG5_pMesh | mesh | ) |
mesh | pointer to the mesh. |
Check whether the resulting two subdomains occupying mesh are manifold.
First check: check whether one triangle in the mesh has 3 boundary faces
Second check: check whether the configuration is manifold in the ball of each point; each vertex on the implicit boundary is caught in such a way that i1 inxt[i1] is one edge of the implicit boundary
Definition at line 1424 of file mmg2.c.
int MMG5_getStartRef | ( | MMG5_pMesh | mesh, |
MMG5_int | ref, | ||
MMG5_int * | pref | ||
) |
mesh | pointer to the mesh |
ref | final reference for which we are searching the initial one |
pref | pointer to the reference of the parent material. |
Retrieve the starting domain reference (parent material) associated to the split reference ref. Allow the call in non-multimaterial mode.
Definition at line 213 of file mmg2.c.
|
static |
pim | multimaterials inverse data table. |
key | material key in the inverse data table. |
Check if a material reference already exists in the material lookup table.
Definition at line 98 of file mmg2.c.
|
static |
k | index of the material. |
attr | the attribute of the material (nosplit/split/plus/minus). |
Compute the material entry in the inverse data table, storing the index of the parent material and the attribute of the child material.
Definition at line 58 of file mmg2.c.
|
static |
pim | multimaterials inverse data table. |
ref | reference of the material.. |
k | index of the material in the direct table. |
Raise an error if trying to overwrite a reference entry in the material lookup table.
Definition at line 111 of file mmg2.c.
|
static |
mesh | pointer to the mesh structure. |
pim | multimaterials inverse data table. |
ref | material reference. |
Get attribute of the child material (nosplit/split/plus/minus) from lookup table.
Definition at line 84 of file mmg2.c.
|
static |
|
static |
mesh | pointer to the mesh structure. |
pim | multimaterials inverse data table. |
ref | material reference. |
pref | pointer to the parent material reference. |
Get reference of the parent material in multimaterial mode.
Definition at line 177 of file mmg2.c.
|
static |
|
static |
|
static |
mesh | pointer to the mesh structure. |
pim | multimaterials inverse data table. |
k | index of the material in the input table. |
Set materials lookup table entry.
Store the dosplit attribute of the parent material
Store the child material sign with the parent material index (in the lookup table). 1) 0 is a legit material index, so store the parent as 4*(k+1). 2) If a child material has the same reference as the parent, this effectively overwrites the result of the previous instruction. 3) No different child materials are allowed to have the same reference, and this must have already been checked.
Definition at line 129 of file mmg2.c.
|
inlinestatic |
int MMG5_isLevelSet | ( | MMG5_pMesh | mesh, |
MMG5_int | ref0, | ||
MMG5_int | ref1 | ||
) |
mesh | pointer to the mesh structure. |
ref0 | reference of the first tetrahedron sharing the face. |
ref1 | reference of the second tetrahedron sharing the face.. |
Identify whether a face is on the discrete level set or not.
Definition at line 472 of file mmg2.c.
int MMG5_ismaniball | ( | MMG5_pMesh | mesh, |
MMG5_pSol | sol, | ||
MMG5_int | start, | ||
int8_t | istart | ||
) |
mesh | pointer to the mesh structure. |
sol | pointer to the level-set values. |
start | index of the starting tria |
istart | local index (inside the tria start) of the vertex that we check. |
Check whether snapping the value of vertex istart of start to 0 exactly leads to a non manifold situation.
Definition at line 623 of file mmg2.c.
int MMG5_isNotSplit | ( | MMG5_pMesh | mesh, |
MMG5_int | ref | ||
) |
mesh | pointer to the mesh structure. |
ref | initial reference. |
Identify whether an entity with reference ref should not be split.
Definition at line 448 of file mmg2.c.
int MMG5_isSplit | ( | MMG5_pMesh | mesh, |
MMG5_int | ref, | ||
MMG5_int * | refint, | ||
MMG5_int * | refext | ||
) |
mesh | pointer to the mesh structure. |
ref | initial reference. |
refint | internal reference after ls discretization. |
refext | external reference after ls discretization. |
Identify whether an entity with reference ref should be split, and the labels of the resulting entities.
Definition at line 412 of file mmg2.c.
int MMG5_MultiMat_init | ( | MMG5_pMesh | mesh | ) |
mesh | pointer to the mesh structure. |
Initialize handling of multimaterial mode.
An indexed table of materials has been provided by the MMG5_Mat datatype in the form:
0 | dospl_0 | ref_0 | rin_0 | rex_0 ... | ... | ... | ... | k | dospl_k | ref_k | rin_k | rex_k ... | ... | ... | ... | n-1 | dospl_{n-1} | ref_{n-1} | rin_{n-1} | rex_{n-1}
where dospl is the split/preserve attribute of the material, and rin,rex are its child materials (if dospl). Viceversa, ref is the parent material for rin,rex.
Here a lookup table for material references is built through trivial hashing for all references (both parent and child materials) with the key:
key = ref - ref_min, ref_min = min_{k = 0,n-1} (ref_k, rin_k, rex_k)
For all references, it is important to store
Since dospl = 0 or 1, MG_PLUS = 2, and MG_MINUS = 3
we can store the attribute as dospl (for the parent material) or MG_MINUS/ MG_PLUS (for the child materials), with its value ranging between 0 and 3.
A convenient entry to store both the index and the attribute in the lookup table is thus:
entry = 4*(index+1) + attribute
leading to a lookup table in the form (the key ordering is only an example):
... | ... ref_k | 4*(k+1)+dospl_k ... | ... rin_k | 4*(k+1)+MG_MINUS ... | ... rex_k | 4*(k+1)+MG_PLUS ... | ...
where the index and the attribute of the material can be retrieved as
index = entry / 4 -1 attribute = entry % 4
What if two materials have the same reference?
Why child materials should be different?
Definition at line 326 of file mmg2.c.
int MMG5_resetRef_ls | ( | MMG5_pMesh | mesh | ) |
int MMG5_rmc | ( | MMG5_pMesh | mesh, |
MMG5_pSol | sol | ||
) |
mesh | pointer to the mesh |
sol | pointer to the level-set |
Removal of small parasitic components (bubbles of material, etc) with volume less than mesh->info.rmc * volume of the mesh.
Definition at line 912 of file mmg2.c.
int MMG5_setref_ls | ( | MMG5_pMesh | mesh, |
MMG5_pSol | sol | ||
) |
int MMG5_snpval_ls | ( | MMG5_pMesh | mesh, |
MMG5_pSol | sol | ||
) |
mesh | pointer to the mesh structure. |
sol | pointer to the level-set function. |
Snap values of the level set function very close to 0 to exactly 0, and prevent nonmanifold patterns from being generated.
Definition at line 503 of file mmg2.c.
|
inlinestatic |
mesh | pointer to the mesh structure |
sol | pointer to the ls function |
k | index of the triangle |
pm | 1 for computation of positive subdomain, -1 for negative one |
Calculate the area of the positive (if pm == 1) or negative (if pm == -1) subdomain inside triangle k defined by the ls function in sol
Definition at line 775 of file mmg2.c.
|
inlinestatic |
mesh | pointer to the mesh structure. |
ip0 | First vertex of the triangle |
ip1 | Second vertex of the triangle |
ip2 | Third vertex of the triangle |
Calculate the area of a triangle given by its vertices
Definition at line 748 of file mmg2.c.