mmg3d
|
#include "mmgcommon.h"
Functions | |
static int | MMG5_InvMat_key (MMG5_pInvMat pim, int ref) |
static void | MMG5_InvMat_set (MMG5_pMesh mesh, MMG5_pInvMat pim, int k) |
static int | MMG5_InvMat_getIndex (MMG5_pInvMat pim, int ref) |
static int | MMG5_InvMat_getAttrib (MMG5_pInvMat pim, int ref) |
static int | MMG5_InvMat_getParent (MMG5_pMesh mesh, MMG5_pInvMat pim, int ref, int *pref) |
int | MMG5_getStartRef (MMG5_pMesh mesh, int ref, int *pref) |
static void | MMG5_InvMat_print (MMG5_pMesh mesh, MMG5_pInvMat pim) |
int | MMG5_MultiMat_init (MMG5_pMesh mesh) |
int | MMG5_isSplit (MMG5_pMesh mesh, int ref, int *refint, int *refext) |
int | MMG5_isNotSplit (MMG5_pMesh mesh, int ref) |
int | MMG5_isLevelSet (MMG5_pMesh mesh, int ref0, int ref1) |
int MMG5_getStartRef | ( | MMG5_pMesh | mesh, |
int | ref, | ||
int * | pref | ||
) |
mesh | pointer toward 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.
|
static |
mesh | pointer toward the mesh structure. |
pim | multimaterials inverse data table. |
ref | material reference. |
|
static |
pim | multimaterials inverse data table. |
ref | material reference. |
Get index of the material from lookup table.
|
static |
mesh | pointer toward 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.
|
static |
pim | multimaterials inverse data table. |
ref | material reference. |
Compute key for the material in the hash table.
|
static |
mesh | pointer toward the mesh structure. |
pim | multimaterials inverse data table. |
Print materials lookup table.
|
static |
mesh | pointer toward 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.
int MMG5_isLevelSet | ( | MMG5_pMesh | mesh, |
int | ref0, | ||
int | ref1 | ||
) |
mesh | pointer toward 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.
int MMG5_isNotSplit | ( | MMG5_pMesh | mesh, |
int | ref | ||
) |
mesh | pointer toward the mesh structure. |
ref | initial reference. |
Identify whether an entity with reference ref should not be split.
int MMG5_isSplit | ( | MMG5_pMesh | mesh, |
int | ref, | ||
int * | refint, | ||
int * | refext | ||
) |
mesh | pointer toward the mesh structure. |
ref | initial reference. |
refint | internal reference after ls discretization. |
refint | internal reference after ls discretization. |
Identify whether an entity with reference ref should be split, and the labels of the resulting entities.
int MMG5_MultiMat_init | ( | MMG5_pMesh | mesh | ) |
mesh | pointer toward 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?