Mmg
Simplicial remeshers (mesh adaptation, isovalue discretization, lagrangian movement)
|
Perform volume and surface mesh adaptation with pattern splitting. More...
#include "libmmg3d.h"
#include "inlined_functions_3d_private.h"
#include "mmgexterns_private.h"
#include "mmg3dexterns_private.h"
Go to the source code of this file.
Functions | |
void | MMG3D_set_geom (MMG5_pMesh mesh, MMG5_pPoint ppt, uint16_t tag, MMG5_int nmref, MMG5_int edgref, double no1[3], double no2[3], double to[3]) |
void | MMG5_tet2tri (MMG5_pMesh mesh, MMG5_int k, int8_t ie, MMG5_Tria *ptt) |
int | MMG3D_dichoto (MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int *vx) |
int | MMG3D_dichoto1b (MMG5_pMesh mesh, MMG5_pSol met, int64_t *list, int ret, MMG5_int ip) |
int8_t | MMG5_chkedg (MMG5_pMesh mesh, MMG5_Tria *pt, int8_t ori, double hmax, double hausd, int locPar) |
MMG5_int | MMG5_swpmsh (MMG5_pMesh mesh, MMG5_pSol met, MMG3D_pPROctree PROctree, int typchk) |
MMG5_int | MMG5_swptet (MMG5_pMesh mesh, MMG5_pSol met, double crit, double declic, MMG3D_pPROctree PROctree, int typchk, MMG5_int testmark) |
MMG5_int | MMG5_movtet (MMG5_pMesh mesh, MMG5_pSol met, MMG3D_pPROctree PROctree, double clickSurf, double clickVol, int moveVol, int improveSurf, int improveVolSurf, int improveVol, int maxit, MMG5_int testmark) |
static MMG5_int | MMG5_coltet (MMG5_pMesh mesh, MMG5_pSol met, int8_t typchk) |
int | MMG3D_adpcoledg (MMG5_pMesh mesh, MMG5_pSol met, MMG3D_pPROctree *PROctree, MMG5_int k, int8_t imin, double lmin, MMG5_int *nc) |
static int | MMG3D_delPatternPts (MMG5_pMesh mesh, MMG5_Hash hash) |
static MMG5_int | MMG5_anatetv (MMG5_pMesh mesh, MMG5_pSol met, int8_t typchk) |
static int | MMG3D_update_rid_geom (MMG5_pPoint ppt, MMG5_pxPoint pxp, double no[3]) |
int | MMG3D_normalAndTangent_at_sinRidge (MMG5_pMesh mesh, MMG5_int k, int i, int j, double no1[3], double no2[3], double to[3]) |
int8_t | MMG3D_build_bezierEdge (MMG5_pMesh mesh, MMG5_int k, int8_t imax, int8_t i, int8_t j, MMG5_pxTetra pxt, MMG5_int ip1, MMG5_int ip2, MMG5_pPoint p0, MMG5_pPoint p1, MMG5_int *ref, uint16_t *tag, double o[3], double to[3], double no1[3], double no2[3], int64_t *list, int *ilist) |
void | MMG3D_find_bdyface_from_edge (MMG5_pMesh mesh, MMG5_pTetra pt, int8_t ied, int8_t *i, int8_t *j, int8_t *i1, int8_t *i2, MMG5_int *ip1, MMG5_int *ip2, MMG5_pPoint *p0, MMG5_pPoint *p1) |
int | MMG3D_splsurfedge (MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_pTetra pt, MMG5_pxTetra pxt, int8_t imax, int8_t typchk, int8_t chkRidTet, int *warn) |
static int | MMG3D_chkbdyface (MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_pTetra pt, MMG5_pxTetra pxt, int8_t i, MMG5_pTria ptt, int8_t typchk) |
static MMG5_int | MMG3D_anatets_ani (MMG5_pMesh mesh, MMG5_pSol met, int8_t typchk) |
static MMG5_int | MMG3D_anatets_iso (MMG5_pMesh mesh, MMG5_pSol met, int8_t typchk) |
static int | MMG3D_anatet4_sim (MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, int8_t metRidTyp, int *ifac, int *conf0, MMG5_int *adj, int *conf1) |
static MMG5_int | MMG5_anatet4 (MMG5_pMesh mesh, MMG5_pSol met, MMG5_int *nf, int8_t typchk) |
static MMG5_int | MMG5_anatet4rid (MMG5_pMesh mesh, MMG5_pSol met, MMG5_int *nf, int8_t typchk) |
int | MMG5_anatet (MMG5_pMesh mesh, MMG5_pSol met, int8_t typchk, int patternMode) |
Variables | |
int8_t | ddb |
static MMG5_int(* | MMG3D_anatets )(MMG5_pMesh mesh, MMG5_pSol met, int8_t typchk) |
Perform volume and surface mesh adaptation with pattern splitting.
Perform volume and surface mesh adaptation with pattern splitting (MMG_PATTERN preprocessor flag set to ON).
Definition in file mmg3d1.c.
int MMG3D_adpcoledg | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met, | ||
MMG3D_pPROctree * | PROctree, | ||
MMG5_int | k, | ||
int8_t | imin, | ||
double | lmin, | ||
MMG5_int * | nc | ||
) |
mesh | pointer to the mesh structure. |
met | pointer to the metric structure. |
PROctree | pointer to the PROctree structure. |
k | index of tetra in which we work. |
imin | index in k of edge that we consider for collapse. |
lmin | length of edge imin. |
nc | pointer to count of collapses (has to be updated) |
Try to collapse edge imin it too small.
Compute edge shell
Collapse
Definition at line 1210 of file mmg3d1.c.
|
static |
mesh | pointer to the mesh structure. |
met | pointer to the metric structure. |
k | index of the tetrahedron with multiple boundary faces (to be swapped) |
metRidTyp | metric storage (classic or special) |
ifac | face of the tetra k that give the best results for the swap23 |
conf0 | detected configuration for the swap23 of the tetra k |
adj | neighbour of the tetra k through the face ifac (4*k1+ifac1) |
conf1 | detected configuration for the swap23 of the tetra adj/4 |
Simulation of the swap23 and of the split at its barycenter of a tetra when more than 1 boundary face. The quality of the worst created element is computed for both operators and we return the identifier of the operator that give the best results. If the swap23 is choosen, we fill the needed info to perform it (index of the face and tetra that are choosen to swap) and configuration of both tetra.
Step 1: test the split4bar
Step 2: test the swap23
Neighbouring element with which we will try to swap
Do not choose a config that creates a tetra with more than 2 bdries
Test volume of the 3 created tets
Definition at line 2755 of file mmg3d1.c.
|
static |
mesh | pointer to the mesh structure. |
met | pointer to the metric structure. |
typchk | type of checking permformed for edge length (hmax or MMG3D_LLONG criterion). |
Split surface edges on geometric criterion.
Split only the longest edge
Definition at line 2190 of file mmg3d1.c.
|
static |
mesh | pointer to the mesh structure. |
met | pointer to the metric structure. |
typchk | type of checking permformed for edge length (hmax or MMG3D_LLONG criterion). |
Analyze tetra and split on geometric criterion.
Edge analysis
Definition at line 2290 of file mmg3d1.c.
int8_t MMG3D_build_bezierEdge | ( | MMG5_pMesh | mesh, |
MMG5_int | k, | ||
int8_t | imax, | ||
int8_t | i, | ||
int8_t | j, | ||
MMG5_pxTetra | pxt, | ||
MMG5_int | ip1, | ||
MMG5_int | ip2, | ||
MMG5_pPoint | p0, | ||
MMG5_pPoint | p1, | ||
MMG5_int * | ref, | ||
uint16_t * | tag, | ||
double | o[3], | ||
double | to[3], | ||
double | no1[3], | ||
double | no2[3], | ||
int64_t * | list, | ||
int * | ilist | ||
) |
mesh | pointer to mesh |
k | index of input tetra |
imax | index of edge in tetra k |
i | index of boundary face of tetra from which we will work |
j | index of edge in face i |
pxt | boundary tetra associated to k |
ip1 | first vertex of edge i |
ip2 | second vertex of edge i |
p0 | point ip1 |
p1 | point ip2 |
ref | edge ref (to fill) |
tag | edge tag (to fill) |
o | coordinates of new point along bezier edge (to fill) |
to | tangent at new point o (to fill if needed) |
no1 | first normal at new point o (to fill if needed) |
no2 | second normal at new point (to fill if needed) |
list | pointer to edge shell (to fill) |
ilist | 2x edge shell size (+1 for a bdy edge) |
Build Bezier edge from the boundary face of a boundary tetra and compute position and feature of new point along this edge.
a/ computation of bezier edge
Definition at line 1780 of file mmg3d1.c.
|
static |
mesh | pointer to the mesh structure. |
met | pointer to the metric structure. |
k | index of tetra thath we check |
pt | pointer to the tetra that we check |
pxt | pointer to the xtetra that we check |
i | index of the face in k that we check |
ptt | pointer to the virtual triangle build from the face \i of k. |
typchk | type of checking permformed for edge length (hmax or MMG3D_LLONG criterion). |
Mark edges to split on geometric criterion (mark stored in pt->flag)
Definition at line 2082 of file mmg3d1.c.
|
inlinestatic |
mesh | pointer to the mesh structure. |
hash | pointer to the hash table of edges. |
Delete the points inserted by pattern if the pattern step fail.
Definition at line 1319 of file mmg3d1.c.
int MMG3D_dichoto | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met, | ||
MMG5_int | k, | ||
MMG5_int * | vx | ||
) |
mesh | pointer to the mesh structure. |
met | pointer to the metric structure. |
k | tetrahedron index. |
vx | pointer to table of edges to split. |
Find acceptable position for splitting.
Definition at line 140 of file mmg3d1.c.
int MMG3D_dichoto1b | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met, | ||
int64_t * | list, | ||
int | ret, | ||
MMG5_int | ip | ||
) |
mesh | pointer to the mesh structure. |
met | pointer to the metric structure. |
list | pointer to the shell of edge. |
ret | double of the number of tetrahedra in the shell. |
ip | new point index. |
Find acceptable position for MMG5_split1b, passing the shell of considered edge, starting from o point.
Definition at line 293 of file mmg3d1.c.
void MMG3D_find_bdyface_from_edge | ( | MMG5_pMesh | mesh, |
MMG5_pTetra | pt, | ||
int8_t | ied, | ||
int8_t * | i, | ||
int8_t * | j, | ||
int8_t * | i1, | ||
int8_t * | i2, | ||
MMG5_int * | ip1, | ||
MMG5_int * | ip2, | ||
MMG5_pPoint * | p0, | ||
MMG5_pPoint * | p1 | ||
) |
mesh | pointer to mesh |
pt | pointer to tetra on which we work |
ied | index in tetra pt of edge on which we work |
i | index of a face of pt that contains ied. If possible we choose a boundary face with suitable orientation (to fill) |
j | local index of edge ied in face i (to fill) |
i1 | local index in tetra pt of first extremity of edge ied (to fill) |
i2 | local index in tetra pt of second extremity of edge ied (to fill) |
ip1 | global index first extremity of edge ied (to fill) |
ip2 | global index in tetra pt of second extremity of edge ied (to fill) |
p0 | pointer to first extremity of edge ied (to fill) |
p1 | pointer to second extremity of edge ied (to fill) |
Search a face from wich we car reach edge ied. If a boundary face with good orientation exists it is choosed prior to another face, otherwise, if possible, we choose a boundary face. Fill data needed to work on edge.
An edge can be at the interface of a boundary face with good orientation and of another one with bad orientation: ensure to treat the edge from the suitable face
Definition at line 1898 of file mmg3d1.c.
int MMG3D_normalAndTangent_at_sinRidge | ( | MMG5_pMesh | mesh, |
MMG5_int | k, | ||
int | i, | ||
int | j, | ||
double | no1[3], | ||
double | no2[3], | ||
double | to[3] | ||
) |
mesh | pointer to the mesh structure. |
k | index of the tetra to split. |
i | index of (boundary) face in which we work. |
j | local index in face i of the ridge. |
pt | tetra to split |
no1 | first normal at new ridge point (to fill) |
no2 | second normal at new ridge point (to fill) |
to | tangent ar new ridge point (to fill) |
Compute normals and tangent at new ridge point.
Definition at line 1684 of file mmg3d1.c.
void MMG3D_set_geom | ( | MMG5_pMesh | mesh, |
MMG5_pPoint | ppt, | ||
uint16_t | tag, | ||
MMG5_int | nmref, | ||
MMG5_int | edgref, | ||
double | no1[3], | ||
double | no2[3], | ||
double | to[3] | ||
) |
mesh | pointer to mesh |
ppt | pointer to point whose geom data have to be updated |
tag | point tag |
nmref | ref that has to be setted at point ppt if point is non-manifold |
edgref | ref that has to be setted at point ppt if point is manifold (edg ref) |
no1 | normal that has to be setted at point ppt (if needed) |
no2 | normal that has to be setted at point ppt (if needed) |
to | tangent that has to be setted at point ppt (if needed) |
Set geometric info (ref, tag, normals and tangent) at point ppt.
Definition at line 59 of file mmg3d1.c.
int MMG3D_splsurfedge | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met, | ||
MMG5_int | k, | ||
MMG5_pTetra | pt, | ||
MMG5_pxTetra | pxt, | ||
int8_t | imax, | ||
int8_t | typchk, | ||
int8_t | chkRidTet, | ||
int * | warn | ||
) |
mesh | pointer to the mesh structure. |
met | pointer to the metric structure. |
k | index of the tetra to split. |
pt | tetra to split |
pxt | associated xtetra |
imax | index of the edge to split to split |
typchk | type of check |
chkRidTet | check for ridge metric |
*warn | warn is set to 1 if we don't have enough memory to complete mesh. |
Split a surface edge using split1b
Definition at line 1957 of file mmg3d1.c.
|
inlinestatic |
ppt | pointer to the point that we update |
pxp | point toward the oot xpoint |
no | normal at ppt |
Starting from a point for which the normal pxp->n1 is already stored, store no in pxp->n2, compute the tangent with respect to this two normals and store it in ppt->n.
Definition at line 1631 of file mmg3d1.c.
int MMG5_anatet | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met, | ||
int8_t | typchk, | ||
int | patternMode | ||
) |
mesh | pointer to the mesh structure. |
met | pointer to the metric structure. |
typchk | type of checking for edges length. |
patternMode | flag to say if we perform vertex insertion by patterns or by delaunay kernel. |
Analyze tetrahedra and split if needed.
Definition at line 3159 of file mmg3d1.c.
|
static |
mesh | pointer to the mesh structure. |
met | pointer to the metric structure. |
nf | number of swap performed. |
typchk | type of checking permformed. |
Split tetra into 4 when more than 1 boundary face or if 4 boundary vertices.
Definition at line 3029 of file mmg3d1.c.
|
static |
mesh | pointer to the mesh structure. |
met | pointer to the metric structure. |
nf | number of swap performed. |
typchk | type of checking permformed. |
Split tetra into 4 when its 4 points are ridge points.
Definition at line 3114 of file mmg3d1.c.
|
static |
mesh | pointer to the mesh structure. |
met | pointer to the metric structure. |
typchk | type of checking permformed for edge length (hmax or MMG3D_LLONG criterion). |
Analyze volume tetra and split if needed.
Definition at line 1363 of file mmg3d1.c.
int8_t MMG5_chkedg | ( | MMG5_pMesh | mesh, |
MMG5_Tria * | pt, | ||
int8_t | ori, | ||
double | hmax, | ||
double | hausd, | ||
int | locPar | ||
) |
mesh | pointer to the mesh structure. |
pt | pointer to the triangle. |
ori | orientation of the triangle (1 for direct orientation, 0 otherwise). |
hmax | maximal edge length. |
hausd | maximal hausdorff distance. |
locPar | 1 if hmax and hausd are locals parameters. |
Find edges of (virtual) triangle pt that need to be split with respect to the Hausdorff criterion.
Definition at line 363 of file mmg3d1.c.
|
static |
mesh | pointer to the mesh structure. |
met | pointer to the metric structure. |
typchk | type of checking permformed for edge length (hmin or LSHORT criterion). |
Attempt to collapse short edges.
Definition at line 892 of file mmg3d1.c.
MMG5_int MMG5_movtet | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met, | ||
MMG3D_pPROctree | PROctree, | ||
double | clickSurf, | ||
double | clickVol, | ||
int | moveVol, | ||
int | improveSurf, | ||
int | improveVolSurf, | ||
int | improveVol, | ||
int | maxit, | ||
MMG5_int | testmark | ||
) |
mesh | pointer to the mesh structure. |
met | pointer to the metric structure. |
PROctree | pointer to the PROctree structure. |
clickSurf | triangle quality threshold under which we want to move |
clickVol | tetra quality threshold under which we want to move |
moveVol | internal move |
improveSurf | forbid surface degradation during the move |
improveVolSurf | forbid volume degradation during the surfacic move |
improveVol | forbid volume degradation during the move |
maxit | maximum number of iteration |
testmark | all the tets with a mark less than testmark will not be treated. |
Analyze tetrahedra and move points so as to make mesh more uniform.
Definition at line 736 of file mmg3d1.c.
MMG5_int MMG5_swpmsh | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met, | ||
MMG3D_pPROctree | PROctree, | ||
int | typchk | ||
) |
mesh | pointer to the mesh structure. |
met | pointer to the metric structure. |
PROctree | pointer to the PROctree structure (only for delaunay). |
typchk | type of checking permformed for edge length (hmin or LSHORT criterion). |
Search for boundary edges that could be swapped for geometric approximation.
Definition at line 598 of file mmg3d1.c.
MMG5_int MMG5_swptet | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met, | ||
double | crit, | ||
double | declic, | ||
MMG3D_pPROctree | PROctree, | ||
int | typchk, | ||
MMG5_int | testmark | ||
) |
mesh | pointer to the mesh structure. |
met | pointer to the metric structure. |
crit | coefficient of quality improvment. |
PROctree | pointer to the PROctree structure in delaunay mode and toward the NULL pointer otherwise |
typchk | type of checking permformed for edge length (hmin or LSHORT criterion) |
testmark | all the tets with a mark less than testmark will not be treated. |
Internal edge flipping.
Definition at line 672 of file mmg3d1.c.
void MMG5_tet2tri | ( | MMG5_pMesh | mesh, |
MMG5_int | k, | ||
int8_t | ie, | ||
MMG5_Tria * | ptt | ||
) |
|
extern |
Definition at line 42 of file mmg3d1_delone.c.
|
static |