Mmg
Simplicial remeshers (mesh adaptation, isovalue discretization, lagrangian movement)
Functions | Variables
mmg3d2.c File Reference

Create implicit surface in mesh. More...

#include "libmmg3d.h"
#include "libmmg3d_private.h"
#include "mmg3dexterns_private.h"
Include dependency graph for mmg3d2.c:

Go to the source code of this file.

Functions

static double MMG3D_vfrac_1vertex (MMG5_pPoint ppt[4], int8_t i0, double v[4], int8_t part_opp)
 
double MMG3D_vfrac (MMG5_pMesh mesh, MMG5_pSol sol, MMG5_int k, int pm)
 
int MMG3D_resetRef_ls (MMG5_pMesh mesh)
 
static int MMG5_invsl (double A[3][3], double b[3], double r[3])
 
static int MMG3D_ismaniball (MMG5_pMesh mesh, MMG5_pSol sol, MMG5_int k, int indp)
 
int MMG3D_snpval_ls (MMG5_pMesh mesh, MMG5_pSol sol)
 
int MMG3D_rmc (MMG5_pMesh mesh, MMG5_pSol sol)
 
int MMG3D_cuttet_ls (MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pSol met)
 
int MMG3D_setref_ls (MMG5_pMesh mesh, MMG5_pSol sol)
 
int MMG3D_update_xtetra (MMG5_pMesh mesh)
 
int MMG3D_chkmaniball (MMG5_pMesh mesh, MMG5_int start, int8_t ip)
 
int MMG3D_chkmani (MMG5_pMesh mesh)
 
int MMG3D_chkmani2 (MMG5_pMesh mesh, MMG5_pSol sol)
 
int MMG3D_chkmanicoll (MMG5_pMesh mesh, MMG5_int k, int iface, int iedg, MMG5_int ndepmin, MMG5_int ndepplus, MMG5_int refmin, MMG5_int refplus, int8_t isminp, int8_t isplp)
 
int MMG3D_mmg3d2 (MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pSol met)
 

Variables

int8_t ddb
 

Detailed Description

Create implicit surface in mesh.

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

Definition in file mmg3d2.c.

Function Documentation

◆ MMG3D_chkmani()

int MMG3D_chkmani ( MMG5_pMesh  mesh)

Check whether implicit surface enclosed in volume is orientable

First test : check whether a tetra has 4 boundary faces

Second test : Check whether configuration is manifold in each ball

Definition at line 1527 of file mmg3d2.c.

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

◆ MMG3D_chkmani2()

int MMG3D_chkmani2 ( MMG5_pMesh  mesh,
MMG5_pSol  sol 
)
Parameters
meshpointer toward the mesh structure
solpointer toward the metric
Returns
1 if success, 0 otherwise.

Check whether implicit surface enclosed in volume is orientable (perform an additionnal test w.r.t. MMG3D_chkmani)

First test : assure no tetra has its 4 vertices on implicit boundary

Second test : check whether configuration is manifold in each ball

Definition at line 1601 of file mmg3d2.c.

Here is the call graph for this function:

◆ MMG3D_chkmaniball()

int MMG3D_chkmaniball ( MMG5_pMesh  mesh,
MMG5_int  start,
int8_t  ip 
)
Parameters
meshpointer toward the mesh
startindex of the starting tetra
ippoint index
Returns
1 if success, 0 if fail

Check whether implicit surface is orientable in ball of point ip in tet iel ; Beware : may return 0 when implicit boundary is tangent to outer boundary

Definition at line 1419 of file mmg3d2.c.

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

◆ MMG3D_chkmanicoll()

int MMG3D_chkmanicoll ( MMG5_pMesh  mesh,
MMG5_int  k,
int  iface,
int  iedg,
MMG5_int  ndepmin,
MMG5_int  ndepplus,
MMG5_int  refmin,
MMG5_int  refplus,
int8_t  isminp,
int8_t  isplp 
)
Parameters
meshpointer toward the mesh structure.
kindex of element in which we collapse.
ifaceface through wich we perform the collapse
iedgedge to collapse
ndepminindex of an elt with ref refmin and outside the shell of edge.
ndepplusndex of an elt with ref refplus and outside the shell of edge.
refminreference of one of the two subdomains in presence
refplusreference of the other subdomain in presence
isminp1 if we have found a tetra with ref refmin
isplp1 if we have found a tetra with ref refplus
Returns
0 if we create a non manifold situation, 1 otherwise

Check whether collapse of point np to nq does not create a non manifold situation at nq ndepmin, ndepplus = tetra of ref minus, plus in ball of np, not in shell of (np,nq).

First step : pile up tetras of future ball of nq, crossing through the shell of (np,nq), as long as they have same ref as ndepmin list[l] <= 0 if element of ball of np, >= 0, if element of ball of nq

Second step : same process, starting with a tetra of different reference, in the ball of np

Definition at line 1672 of file mmg3d2.c.

Here is the caller graph for this function:

◆ MMG3D_cuttet_ls()

int MMG3D_cuttet_ls ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
MMG5_pSol  met 
)
Parameters
meshpointer toward the mesh structure.
solpointer toward the level-set values.
metpointer toward a metric (non-mandatory).
Returns
1 if success, 0 otherwise.

Proceed to discretization of the implicit function carried by sol into mesh, once values of sol have been snapped/checked

Definition at line 1025 of file mmg3d2.c.

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

◆ MMG3D_ismaniball()

static int MMG3D_ismaniball ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
MMG5_int  k,
int  indp 
)
static
Parameters
meshpointer toward the mesh structure.
solpointer toward the level-set values.
kindex of the starting tetra.
indplocal index (inside the tria k) of the vertex that we check.
Returns
1 if success, 0 if fail

Check whether snapping the value of vertex indp to 0 exactly leads to a non manifold situation.

Warning
: we assume that the triangle start has vertex istart with value 0 and the other two with changing values.

Definition at line 408 of file mmg3d2.c.

Here is the caller graph for this function:

◆ MMG3D_mmg3d2()

int MMG3D_mmg3d2 ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
MMG5_pSol  met 
)
Parameters
meshpointer toward the mesh structure.
solpointer toward the level-set.
metpointer toward a metric (optionnal).
Returns
0 if fail, 1 otherwise.

Create implicit surface in mesh.

Definition at line 2208 of file mmg3d2.c.

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

◆ MMG3D_resetRef_ls()

int MMG3D_resetRef_ls ( MMG5_pMesh  mesh)
Parameters
meshpointer toward the mesh.

Reset mesh->info.isoref vertex and tetra references to 0.

Warning
to improve: for now, entities linked to the old ls (corners,required points, normals/tangents, triangles and edges) are deleted in loadMesh. It would be better to analyze wich entities must be keeped and which one must be deleted depending on the split/nosplit infos.

Definition at line 313 of file mmg3d2.c.

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

◆ MMG3D_rmc()

int MMG3D_rmc ( MMG5_pMesh  mesh,
MMG5_pSol  sol 
)
Parameters
meshpointer toward the mesh
solpointer toward the level-set
Returns
1 if success, 0 otherwise

Removal of small parasitic components (bubbles of material, etc) with volume less than mesh->info.rmc (default VOLFRAC) * volume of the mesh.

Definition at line 777 of file mmg3d2.c.

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

◆ MMG3D_setref_ls()

int MMG3D_setref_ls ( MMG5_pMesh  mesh,
MMG5_pSol  sol 
)
Parameters
meshpointer toward the mesh structure.
solpointer toward the level-set values.
Returns
1.

Set references to tets according to the sign of the level set function.

Definition at line 1256 of file mmg3d2.c.

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

◆ MMG3D_snpval_ls()

int MMG3D_snpval_ls ( MMG5_pMesh  mesh,
MMG5_pSol  sol 
)
Parameters
meshpointer toward the mesh structure.
solpointer toward the level-set function.
Returns
1 if success, 0 if fail.

Snap values of the level set function very close to 0 to exactly 0, and prevent nonmanifold patterns from being generated.

Definition at line 669 of file mmg3d2.c.

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

◆ MMG3D_update_xtetra()

int MMG3D_update_xtetra ( MMG5_pMesh  mesh)
Parameters
meshpointer toward the mesh structure.
Returns
1 if success, 0 if the xtetra array can't be reallocated.

Update the xtetra array to store the new bdy faces created by the isosurface discretization.

Definition at line 1309 of file mmg3d2.c.

Here is the caller graph for this function:

◆ MMG3D_vfrac()

double MMG3D_vfrac ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
MMG5_int  k,
int  pm 
)
Parameters
meshpointer toward the mesh structure
solpointer toward the ls function
kindex of the triangle
Returns
volfrac

Calculate the area of the positive (if pm == 1) or negative (if pm == -1) subdomain inside tetra k defined by the ls function in sol

Checks for debug mode

Definition at line 107 of file mmg3d2.c.

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

◆ MMG3D_vfrac_1vertex()

static double MMG3D_vfrac_1vertex ( MMG5_pPoint  ppt[4],
int8_t  i0,
double  v[4],
int8_t  part_opp 
)
inlinestatic
Parameters
pptarray of points containing the tetra vertices
i0local index of the vertex that has a sign different to the other vertices.
part_opp0 if we want to compute the area containing the vertex i0, 1 if we want the area that do not contains i0.
Returns
the computed area (multiplied by 6) if sucess or 0.0 if fail.

Compute the area (x6) defined by the level-set inside the tetra with vertices ppt. This tetra must be splitted by the level-set such has it has exactly 1 vertex (the vertex i0) with sign opposite to the other vertices. If part_opp == 0, we compte the area that contains i0, otherwise we compute the complementary area.

Definition at line 58 of file mmg3d2.c.

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

◆ MMG5_invsl()

static int MMG5_invsl ( double  A[3][3],
double  b[3],
double  r[3] 
)
inlinestatic
Remarks
Not used.

solve 3*3 non symmetric system Ar = b

Definition at line 364 of file mmg3d2.c.

Variable Documentation

◆ ddb

int8_t ddb
extern

Definition at line 42 of file mmg3d1_delone.c.