mmg3d
mmg3d1.c File Reference

Perform volume and surface mesh adaptation with pattern splitting. More...

Include dependency graph for mmg3d1.c:

Functions

void MMG5_tet2tri (MMG5_pMesh mesh, int k, int8_t ie, MMG5_Tria *ptt)
 
int MMG3D_dichoto (MMG5_pMesh mesh, MMG5_pSol met, int k, int *vx)
 
int MMG3D_dichoto1b (MMG5_pMesh mesh, MMG5_pSol met, int *list, int ret, int ip)
 
int8_t MMG5_chkedg (MMG5_pMesh mesh, MMG5_Tria *pt, int8_t ori, double hmax, double hausd, int locPar)
 
int MMG5_swpmsh (MMG5_pMesh mesh, MMG5_pSol met, MMG3D_pPROctree PROctree, int typchk)
 
int MMG5_swptet (MMG5_pMesh mesh, MMG5_pSol met, double crit, double declic, MMG3D_pPROctree PROctree, int typchk, int testmark)
 
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, int testmark)
 
static int MMG5_coltet (MMG5_pMesh mesh, MMG5_pSol met, int8_t typchk)
 
static int MMG3D_delPatternPts (MMG5_pMesh mesh, MMG5_Hash hash)
 
static int MMG5_anatetv (MMG5_pMesh mesh, MMG5_pSol met, int8_t typchk)
 
static int MMG3D_storeGeom (MMG5_pPoint ppt, MMG5_pxPoint pxp, double no[3])
 
int MMG3D_splsurfedge (MMG5_pMesh mesh, MMG5_pSol met, 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, int k, MMG5_pTetra pt, MMG5_pxTetra pxt, int8_t i, MMG5_pTria ptt, int8_t typchk)
 
static int MMG3D_anatets_ani (MMG5_pMesh mesh, MMG5_pSol met, int8_t typchk)
 
static int MMG3D_anatets_iso (MMG5_pMesh mesh, MMG5_pSol met, int8_t typchk)
 
static int MMG3D_anatet4_sim (MMG5_pMesh mesh, MMG5_pSol met, int k, int8_t metRidTyp, int *ifac, int *conf0, int *adj, int *conf1)
 
static int MMG5_anatet4 (MMG5_pMesh mesh, MMG5_pSol met, int *nf, int8_t typchk)
 
static int MMG5_anatet4rid (MMG5_pMesh mesh, MMG5_pSol met, int *nf, int8_t typchk)
 
int MMG5_anatet (MMG5_pMesh mesh, MMG5_pSol met, int8_t typchk, int patternMode)
 

Variables

int8_t ddb
 
static int(* MMG3D_anatets )(MMG5_pMesh mesh, MMG5_pSol met, int8_t typchk)
 

Detailed Description

Perform volume and surface mesh adaptation with pattern splitting.

Author
Charles Dapogny (UPMC)
Cécile Dobrzynski (Bx INP/Inria/UBordeaux)
Pascal Frey (UPMC)
Algiane Froehly (Inria/UBordeaux)
Version
5

Perform volume and surface mesh adaptation with pattern splitting (PATTERN preprocessor flag set to ON).

Function Documentation

◆ MMG3D_anatet4_sim()

static int MMG3D_anatet4_sim ( MMG5_pMesh  mesh,
MMG5_pSol  met,
int  k,
int8_t  metRidTyp,
int *  ifac,
int *  conf0,
int *  adj,
int *  conf1 
)
static
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
kindex of the tetrahedron with multiple boundary faces (to be swapped)
metRidTypmetric storage (classic or special)
ifacface of the tetra k that give the best results for the swap23
conf0detected configuration for the swap23 of the tetra k
adjneighbour of the tetra k through the face ifac (4*k1+ifac1)
conf1detected configuration for the swap23 of the tetra adj/4
Returns
0 if failed (too bad quality), the type of operator that creates the best worst quality otherwise (1 if split4bar, 2 if swap23).

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG3D_anatets_ani()

static int MMG3D_anatets_ani ( MMG5_pMesh  mesh,
MMG5_pSol  met,
int8_t  typchk 
)
static
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
typchktype of checking permformed for edge length (hmax or MMG3D_LLONG criterion).
Returns
-1 if failed.
number of new points.

Split surface edges on geometric criterion.

Split only the longest edge

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG3D_anatets_iso()

static int MMG3D_anatets_iso ( MMG5_pMesh  mesh,
MMG5_pSol  met,
int8_t  typchk 
)
static
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
typchktype of checking permformed for edge length (hmax or MMG3D_LLONG criterion).
Returns
-1 if failed.
number of new points.

Analyze tetra and split on geometric criterion.

  1. analysis of boundary elements
  2. check if split by adjacent; besides, a triangle may have been splitted and not its adjacent (thus, the associated n2 may not exist) : update this normal if need be

Edge analysis

  1. Simulate splitting and delete points leading to invalid configurations
  2. splitting
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG3D_chkbdyface()

static int MMG3D_chkbdyface ( MMG5_pMesh  mesh,
MMG5_pSol  met,
int  k,
MMG5_pTetra  pt,
MMG5_pxTetra  pxt,
int8_t  i,
MMG5_pTria  ptt,
int8_t  typchk 
)
static
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
kindex of tetra thath we check
ptpointer toward the tetra that we check
pxtpointer toward the xtetra that we check
iindex of the face in k that we check
pttpointer toward the virtual triangle build from the face \i of k.
typchktype of checking permformed for edge length (hmax or MMG3D_LLONG criterion).
Returns
1 if success, 0 if fail.

Mark edges to split on geometric criterion (mark stored in pt->flag)

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG3D_delPatternPts()

static int MMG3D_delPatternPts ( MMG5_pMesh  mesh,
MMG5_Hash  hash 
)
inlinestatic
Parameters
meshpointer toward the mesh structure.
hashpointer toward the hash table of edges.
Returns
0 if failed, 1 if success

Delete the points inserted by pattern if the pattern step fail.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG3D_dichoto()

int MMG3D_dichoto ( MMG5_pMesh  mesh,
MMG5_pSol  met,
int  k,
int *  vx 
)
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
ktetrahedron index.
vxpointer toward table of edges to split.
Returns
1 if success, 0 if fail.

Find acceptable position for splitting.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG3D_dichoto1b()

int MMG3D_dichoto1b ( MMG5_pMesh  mesh,
MMG5_pSol  met,
int *  list,
int  ret,
int  ip 
)
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
listpointer toward the shell of edge.
retdouble of the number of tetrahedra in the shell.
ipnew point index.
Returns
1 if success
0 if fail due to a very bad quality
2 if fail due to a sharp angle creation

Find acceptable position for MMG5_split1b, passing the shell of considered edge, starting from o point.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG3D_splsurfedge()

int MMG3D_splsurfedge ( MMG5_pMesh  mesh,
MMG5_pSol  met,
int  k,
MMG5_pTetra  pt,
MMG5_pxTetra  pxt,
int8_t  imax,
int8_t  typchk,
int8_t  chkRidTet,
int *  warn 
)
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
kindex of the tetra to split.
pttetra to split
pxtassociated xtetra
imaxindex of the edge to split to split
typchktype of check
chkRidTetcheck for ridge metric
*warnwarn is set to 1 if we don't have enough memory to complete mesh.
Returns
-1 if fail, 0 if we can't split but the upper loop may continue, 1 if the edge is splitted, 2 if we can't split due to lack of memory

Split a surface edge using split1b

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG3D_storeGeom()

static int MMG3D_storeGeom ( MMG5_pPoint  ppt,
MMG5_pxPoint  pxp,
double  no[3] 
)
inlinestatic
Parameters
pptpointer toward the point that we update
pxppoint toward the oot xpoint
nonormal at ppt
Returns
0 if failed, 1 if success.

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.

Here is the caller graph for this function:

◆ MMG5_anatet()

int MMG5_anatet ( MMG5_pMesh  mesh,
MMG5_pSol  met,
int8_t  typchk,
int  patternMode 
)
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
typchktype of checking for edges length.
patternModeflag to say if we perform vertex insertion by patterns or by delaunay kernel.
Returns
0 if fail, number of new points otherwise.

Analyze tetrahedra and split if needed.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG5_anatet4()

static int MMG5_anatet4 ( MMG5_pMesh  mesh,
MMG5_pSol  met,
int *  nf,
int8_t  typchk 
)
static
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
nfnumber of swap performed.
typchktype of checking permformed.
Returns
-1 if failed, number of new points otherwise.

Split tetra into 4 when more than 1 boundary face or if 4 boundary vertices.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG5_anatet4rid()

static int MMG5_anatet4rid ( MMG5_pMesh  mesh,
MMG5_pSol  met,
int *  nf,
int8_t  typchk 
)
static
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
nfnumber of swap performed.
typchktype of checking permformed.
Returns
-1 if failed, number of new points otherwise.

Split tetra into 4 when its 4 points are ridge points.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG5_anatetv()

static int MMG5_anatetv ( MMG5_pMesh  mesh,
MMG5_pSol  met,
int8_t  typchk 
)
static
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
typchktype of checking permformed for edge length (hmax or MMG3D_LLONG criterion).
Returns
-1 if failed.
number of new points.

Analyze volume tetra and split if needed.

  1. analysis
  2. Set flags and split internal edges
  3. check and split
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG5_chkedg()

int8_t MMG5_chkedg ( MMG5_pMesh  mesh,
MMG5_Tria pt,
int8_t  ori,
double  hmax,
double  hausd,
int  locPar 
)
Parameters
meshpointer toward the mesh structure.
ptpointer toward the triangle.
oriorientation of the triangle (1 for direct orientation, 0 otherwise).
hmaxmaximal edge length.
hausdmaximal hausdorff distance.
locPar1 if hmax and hausd are locals parameters.
Returns
-1 if error
edges of the triangle pt that need to be split.

Find edges of (virtual) triangle pt that need to be split with respect to the Hausdorff criterion.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG5_coltet()

static int MMG5_coltet ( MMG5_pMesh  mesh,
MMG5_pSol  met,
int8_t  typchk 
)
static
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
typchktype of checking permformed for edge length (hmin or LSHORT criterion).
Returns
-1 if failed, number of collapsed points otherwise.

Attempt to collapse small edges.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG5_movtet()

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,
int  testmark 
)
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
PROctreepointer toward the PROctree structure.
clickSurftriangle quality threshold under which we want to move
clickVoltetra quality threshold under which we want to move
moveVolinternal move
improveSurfforbid surface degradation during the move
improveVolSurfforbid volume degradation during the surfacic move
improveVolforbid volume degradation during the move
maxitmaximum number of iteration
testmarkall the tets with a mark less than testmark will not be treated.
Returns
-1 if failed, number of moved points otherwise.

Analyze tetrahedra and move points so as to make mesh more uniform.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG5_swpmsh()

int MMG5_swpmsh ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG3D_pPROctree  PROctree,
int  typchk 
)
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
PROctreepointer toward the PROctree structure (only for delaunay).
typchktype of checking permformed for edge length (hmin or LSHORT criterion).
Returns
-1 if failed and swap number otherwise.

Search for boundary edges that could be swapped for geometric approximation.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG5_swptet()

int MMG5_swptet ( MMG5_pMesh  mesh,
MMG5_pSol  met,
double  crit,
double  declic,
MMG3D_pPROctree  PROctree,
int  typchk,
int  testmark 
)
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
critcoefficient of quality improvment.
PROctreepointer toward the PROctree structure in delaunay mode and toward the NULL pointer otherwise
typchktype of checking permformed for edge length (hmin or LSHORT criterion)
testmarkall the tets with a mark less than testmark will not be treated.
Returns
-1 if fail, the number of swap otherwise.

Internal edge flipping.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG5_tet2tri()

void MMG5_tet2tri ( MMG5_pMesh  mesh,
int  k,
int8_t  ie,
MMG5_Tria ptt 
)
Parameters
meshpointer toward the mesh structure.
ktetrahedron index.
ieface index of tetrahedron.
pttpointer toward the output triangle.

Set triangle corresponding to face ie of tetra k.

Here is the caller graph for this function:

Variable Documentation

◆ ddb

int8_t ddb
extern

◆ MMG3D_anatets

int(* MMG3D_anatets) (MMG5_pMesh mesh, MMG5_pSol met, int8_t typchk) ( MMG5_pMesh  mesh,
MMG5_pSol  met,
int8_t  typchk 
)
static