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

Functions for ball of points computation. More...

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

Go to the source code of this file.

Functions

int MMG5_boulevolp (MMG5_pMesh mesh, MMG5_int start, int ip, int64_t *list)
 Given a vertex and a tetrahedron, find all tetrahedra in the ball of this vertex.
 
int MMG3D_findEdge (MMG5_pMesh mesh, MMG5_pTetra pt, MMG5_int k, MMG5_int na, MMG5_int nb, int error, int8_t *mmgWarn, int8_t *ia)
 
static void MMG3D_compute_tangent (MMG5_pMesh mesh, int nump, int ip0, int ip1, double t[3])
 
int MMG5_boulenm (MMG5_pMesh mesh, MMG5_int start, int ip, int iface, double n[3], double t[3])
 
int MMG5_boulenmInt (MMG5_pMesh mesh, MMG5_int start, int ip, double t[3])
 
int MMG5_boulernm (MMG5_pMesh mesh, MMG5_Hash *hash, MMG5_int start, int ip, MMG5_int *ng, MMG5_int *nr, MMG5_int *nm)
 
int MMG5_boulesurfvolp (MMG5_pMesh mesh, MMG5_int start, int ip, int iface, int64_t *listv, int *ilistv, MMG5_int *lists, int *ilists, int isnm)
 
int MMG5_boulesurfvolpNom (MMG5_pMesh mesh, MMG5_int start, int ip, int iface, int64_t *listv, int *ilistv, MMG5_int *lists, int *ilists, MMG5_int *refmin, MMG5_int *refplus, int isnm)
 
int MMG5_bouletrid (MMG5_pMesh mesh, MMG5_int start, int iface, int ip, int *il1, MMG5_int *l1, int *il2, MMG5_int *l2, MMG5_int *ip0, MMG5_int *ip1)
 
static int MMG3D_settag_oneDir (MMG5_pMesh mesh, MMG5_int start, MMG5_int na, MMG5_int nb, uint16_t tag, int edg, MMG5_int piv, MMG5_int adj)
 
int MMG5_settag (MMG5_pMesh mesh, MMG5_int start, int ia, uint16_t tag, int edg)
 
static int MMG3D_deltag_oneDir (MMG5_pMesh mesh, MMG5_int start, MMG5_int na, MMG5_int nb, uint16_t tag, MMG5_int piv, MMG5_int adj)
 
int MMG5_deltag (MMG5_pMesh mesh, MMG5_int start, int ia, uint16_t tag)
 
int MMG5_coquil (MMG5_pMesh mesh, MMG5_int start, int ia, int64_t *list, int8_t *isbdy)
 
int MMG5_srcbdy (MMG5_pMesh mesh, MMG5_int start, int ia)
 
void MMG5_coquilFaceErrorMessage (MMG5_pMesh mesh, MMG5_int k1, MMG5_int k2)
 
int MMG3D_coquilFaceFirstLoop (MMG5_pMesh mesh, MMG5_int start, MMG5_int na, MMG5_int nb, int8_t iface, int8_t ia, int64_t *list, int *ilist, MMG5_int *it1, MMG5_int *it2, MMG5_int *piv, MMG5_int *adj, int8_t *hasadja, int *nbdy, int silent)
 
void MMG3D_coquilFaceSecondLoopInit (MMG5_pMesh mesh, MMG5_int piv, int8_t *iface, int8_t *ia, int64_t *list, int *ilist, MMG5_int *it1, MMG5_int *pradj, MMG5_int *adj)
 
int MMG5_coquilface (MMG5_pMesh mesh, MMG5_int start, int8_t iface, int ia, int64_t *list, MMG5_int *it1, MMG5_int *it2, int silent)
 
int16_t MMG5_coquilTravel (MMG5_pMesh mesh, MMG5_int na, MMG5_int nb, MMG5_int *adj, MMG5_int *piv, int8_t *iface, int8_t *i)
 
int16_t MMG5_openCoquilTravel (MMG5_pMesh mesh, MMG5_int na, MMG5_int nb, MMG5_int *adj, MMG5_int *piv, int8_t *iface, int8_t *i)
 

Variables

MMG5_Info info
 

Detailed Description

Functions for ball of points computation.

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 boulep_3d.c.

Function Documentation

◆ MMG3D_compute_tangent()

static void MMG3D_compute_tangent ( MMG5_pMesh  mesh,
int  nump,
int  ip0,
int  ip1,
double  t[3] 
)
inlinestatic

Definition at line 149 of file boulep_3d.c.

Here is the caller graph for this function:

◆ MMG3D_coquilFaceFirstLoop()

int MMG3D_coquilFaceFirstLoop ( MMG5_pMesh  mesh,
MMG5_int  start,
MMG5_int  na,
MMG5_int  nb,
int8_t  iface,
int8_t  ia,
int64_t *  list,
int *  ilist,
MMG5_int *  it1,
MMG5_int *  it2,
MMG5_int *  piv,
MMG5_int *  adj,
int8_t *  hasadja,
int *  nbdy,
int  silent 
)
Parameters
meshpointer to the mesh structure.
startindex of the starting tetrahedron.
naglobal index of the 1st extremity of the edge whose shell is computed
nbglobal index of the 2d extremity of the edge whose shell is computed
ifaceindex of the face from which we come.
iaindex of edge whose shell is computed (in tetra).
listpointer to the list of tetra in the shell (to fill).
ilistpointer to the number of tetra in the shell (to fill).
it1pointer to the index of the 1st boundary face sharing ia
it2pointer to the index of the 2d boundary face sharing ia (to fill).
adjpointer to the adjacent to treat in the shell (to update)
hasadjapointer to 0 if we don't have adja through iface, 1 otherwise (to fill)
nbdypointer to the number of boundaries found minus 1 (to update)
silentif 1, print error message for more than 2 boundary triangles in the shell
Returns
-1 if fail, 1 otherwise

Travel in the shell of the edge until meeting the first tetra or reaching a tetra without adjacent. Fill it2 and list.

Definition at line 1689 of file boulep_3d.c.

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

◆ MMG3D_coquilFaceSecondLoopInit()

void MMG3D_coquilFaceSecondLoopInit ( MMG5_pMesh  mesh,
MMG5_int  piv,
int8_t *  iface,
int8_t *  ia,
int64_t *  list,
int *  ilist,
MMG5_int *  it1,
MMG5_int *  pradj,
MMG5_int *  adj 
)
Parameters
meshpointer to the mesh structure.
pivglobal index of the pivot.
ifaceindex of the face from which we come.
iindex of edge whose shell is computed (in tetra).
listpointer to the list of tetra in the shell (to fill).
ilistpointer to the number of tetra in the shell (to fill).
it1pointer to the index of the 1st boundary face sharing ia
pradjpointer to the first tetra of the shell (to fill).
adjpointer to the adjacent to treat in the shell (to update)

Initialize the travel in the shell of the edge in reverse direction than in the coquilFaceFirstLoop function.

Definition at line 1790 of file boulep_3d.c.

Here is the caller graph for this function:

◆ MMG3D_deltag_oneDir()

static int MMG3D_deltag_oneDir ( MMG5_pMesh  mesh,
MMG5_int  start,
MMG5_int  na,
MMG5_int  nb,
uint16_t  tag,
MMG5_int  piv,
MMG5_int  adj 
)
inlinestatic
Parameters
meshpointer to the mesh
starttetra from which we start to travel
naedge vertex
nbedge vertex
tagnew edge tag
pivglobal index of the pivot to set the sense of travel
adjindex of adjacent tetra for the travel
Returns
-1 if fail, start if shell has been completely travelled, 0 otherwise

Remove the tag tag of edge ia in tetra start by travelling its shell in one direction (given by the pivot piv).

Definition at line 1300 of file boulep_3d.c.

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

◆ MMG3D_findEdge()

int MMG3D_findEdge ( MMG5_pMesh  mesh,
MMG5_pTetra  pt,
MMG5_int  k,
MMG5_int  na,
MMG5_int  nb,
int  error,
int8_t *  mmgWarn,
int8_t *  ia 
)
Parameters
meshpointer to the mesh structure.
ptpointer to the working tetra
kindex of the tetra pt.
naindex of the first extermity of the seeking edge.
nbindex of the second extermity of the seeking edge.
error1 if we want to print an error message, 0 for a warning.
mmgWarnstatic variable to print warning only once (not used if error==1)
iapointer to the edge index (to fill).
Returns
0 if fail, 1 if success.

Find the local index of the edge ia in the tetra pt of index k;

Definition at line 116 of file boulep_3d.c.

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

◆ MMG3D_settag_oneDir()

static int MMG3D_settag_oneDir ( MMG5_pMesh  mesh,
MMG5_int  start,
MMG5_int  na,
MMG5_int  nb,
uint16_t  tag,
int  edg,
MMG5_int  piv,
MMG5_int  adj 
)
inlinestatic
Parameters
meshpointer to the mesh
starttetra from which we start to travel
naedge vertex
nbedge vertex
tagnew edge tag
edgnew edge ref
pivglobal index of the pivot to set the sense of travel
adjindex of adjacent tetra for the travel
Returns
-1 if fail, start if shell has been completely travelled, 0 otherwise

Set tag and ref of the edge na nb from tetra start by traveling its shell in one direction (given by the pivot piv).

Definition at line 1178 of file boulep_3d.c.

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

◆ MMG5_boulenm()

int MMG5_boulenm ( MMG5_pMesh  mesh,
MMG5_int  start,
int  ip,
int  iface,
double  n[3],
double  t[3] 
)
Parameters
meshpointer to the mesh structure.
starttetra index.
ippoint index.
ifaceface index.
ncomputed normal vector.
tcomputed tangent vector.
Returns
0 if point is singular, 1 otherwise.

Define normal and tangent vectors at a non manifold point (ip in start, supported by face iface), enumerating its (outer)surfacic ball.

Definition at line 199 of file boulep_3d.c.

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

◆ MMG5_boulenmInt()

int MMG5_boulenmInt ( MMG5_pMesh  mesh,
MMG5_int  start,
int  ip,
double  t[3] 
)
Parameters
meshpointer to the mesh structure.
starttetra index.
ippoint index.
tcomputed tangent vector.
Returns
0 when more than two NOM points are attached to ip, 1 if sucess.

Travel the ball of the internal non manifold point ip in tetra start and calculate the tangent vector to the underlying curve.

Remarks
we are not able to compute tangent along non-manifold points for edge-connected meshes. In this case the point doesn't have xpoint nor tangent or normal.

Definition at line 345 of file boulep_3d.c.

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

◆ MMG5_boulernm()

int MMG5_boulernm ( MMG5_pMesh  mesh,
MMG5_Hash hash,
MMG5_int  start,
int  ip,
MMG5_int *  ng,
MMG5_int *  nr,
MMG5_int *  nm 
)
Parameters
meshpointer to the mesh structure.
hashpointer to an allocated hash table.
startindex of the starting tetrahedra.
iplocal index of the point in the tetrahedra start.
ngpointer to the number of ridges.
nrpointer to the number of reference edges.
nmpointer to the number of non-manifold edges.
Returns
ns the number of special edges passing through ip, -1 if fail.

Count the numer of ridges and reference edges incident to the vertex ip when ip is non-manifold.

Definition at line 458 of file boulep_3d.c.

Here is the call graph for this function:

◆ MMG5_boulesurfvolp()

int MMG5_boulesurfvolp ( MMG5_pMesh  mesh,
MMG5_int  start,
int  ip,
int  iface,
int64_t *  listv,
int *  ilistv,
MMG5_int *  lists,
int *  ilists,
int  isnm 
)
Parameters
meshpointer to the mesh structure.
startindex of the starting tetra.
ipindex in start of the looked point.
ifaceindex in start of the starting face.
listvpointer to the computed volumic ball.
ilistvpointer to the computed volumic ball size.
listspointer to the computed surfacic ball.
ilistspointer to the computed surfacic ball size.
isnm1 if ip is non-manifold, 0 otherwise.
Returns
-1 if fail, 1 otherwise.

Compute the volumic ball of a SURFACE point p, as well as its surfacic ball, starting from tetra start, with point ip, and face if in tetra volumic ball:

  • listv[k] = 4* tet index + index of point surfacic ball.
  • lists[k] = 4* tet index + index of boundary face.
Warning
Don't work for a non-manifold point if start has an adjacent through iface (for example : a non-manifold subdomain). Thus, if ip is non-manifold, must be called only if start has no adjacent through iface.

Definition at line 610 of file boulep_3d.c.

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

◆ MMG5_boulesurfvolpNom()

int MMG5_boulesurfvolpNom ( MMG5_pMesh  mesh,
MMG5_int  start,
int  ip,
int  iface,
int64_t *  listv,
int *  ilistv,
MMG5_int *  lists,
int *  ilists,
MMG5_int *  refmin,
MMG5_int *  refplus,
int  isnm 
)
Parameters
meshpointer to the mesh structure.
startindex of the starting tetrahedron.
ipindex in start of the desired vertex.
ifaceindex in start of the starting face.
listvpointer to the computed volumic ball.
ilistvpointer to the computed volumic ball size.
listspointer to the computed surfacic ball.
ilistspointer to the computed surfacic ball size.
refminreturn the reference of one of the two subdomains in presence
refplusreturn the reference of the other subdomain in presence
isnmis the vertex non-manifold?
Returns
1 if succesful, a negative value if the ball cannot be computed: -1 if a surface ball had too many elements, -2 if there are more than two references around, -3 if an edge cannot be found, and -4 if a volume ball had too many elements. Among these, -1, -3 and -4 can be taken as a sign that further remeshing is not possible, while -2 just mean the job could not be done.

Compute the volumic ball of a SURFACE point p, as well as its surfacic ball, starting from tetra start, with point ip, and face if in the volumic ball. listv[k] = 4*number of tet + index of point surfacic ball. lists[k] = 4*number of tet + index of face.

Warning
Doesn't work for a non-manifold point if start has an adjacent through iface (for example: a non-manifold subdomain). Thus, if ip is non-manifold, must be called only if start has no adjacent through iface.

Definition at line 780 of file boulep_3d.c.

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

◆ MMG5_bouletrid()

int MMG5_bouletrid ( MMG5_pMesh  mesh,
MMG5_int  start,
int  iface,
int  ip,
int *  il1,
MMG5_int *  l1,
int *  il2,
MMG5_int *  l2,
MMG5_int *  ip0,
MMG5_int *  ip1 
)
Parameters
meshpointer to the mesh structure.
startindex of the starting tetrahedron.
ipindex of the looked ridge point.
ifaceindex in start of the starting face.
il1pointer to the first ball size.
l1pointer to the first computed ball (associated to n_1's side).
il2pointer to the second ball size.
l2pointer to the second computed ball (associated to n_2's side).
ip0index of the first extremity of the ridge.
ip1index of the second extremity of the ridge.
Returns
0 if fail, 1 otherwise.

Computation of the two surface balls of a ridge point: the list l1 is associated to the normal of face iface. ip0 and ip1 are the indices of the 2 ending point of the ridge. Both lists are returned enumerated in direct order.

Definition at line 960 of file boulep_3d.c.

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

◆ MMG5_boulevolp()

int MMG5_boulevolp ( MMG5_pMesh  mesh,
MMG5_int  start,
int  ip,
int64_t *  list 
)

Given a vertex and a tetrahedron, find all tetrahedra in the ball of this vertex.

Parameters
meshpointer to the mesh structure.
startindex of the starting tetrahedra.
iplocal index of the point in the tetrahedra start.
listpointer to the list of the tetra in the volumic ball of ip.
Returns
0 if fail and the number of the tetra in the ball otherwise.

Fill the volumic ball (i.e. filled with tetrahedra) of point ip in tetra start. Results are stored in the form \(4*kel + jel\), kel = number of tetrahedra, jel = local index of p within kel.

Definition at line 57 of file boulep_3d.c.

Here is the caller graph for this function:

◆ MMG5_coquil()

int MMG5_coquil ( MMG5_pMesh  mesh,
MMG5_int  start,
int  ia,
int64_t *  list,
int8_t *  isbdy 
)
Parameters
meshpointer to the mesh structure
startindex of the starting tetra
iaindex of the edge
listlist of tetra sharing the edge ia
isbdy1 if edge is bdy, 0 otherwise (note that at interface of 2 domains the edge shell of a bdy edge can be closed)
Returns
2*ilist if shell is closed, 2*ilist +1 otherwise, 0 if one of the tet of the shell is required, -1 if fail.

Find all tets sharing edge ia of tetra start.

Definition at line 1406 of file boulep_3d.c.

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

◆ MMG5_coquilface()

int MMG5_coquilface ( MMG5_pMesh  mesh,
MMG5_int  start,
int8_t  iface,
int  ia,
int64_t *  list,
MMG5_int *  it1,
MMG5_int *  it2,
int  silent 
)
Parameters
meshpointer to the mesh structure.
startindex of the starting tetrahedron.
ifaceindex of the boundary face from which we come.
iaindex of edge whose shell is computed (in tetra).
listpointer to the list of tetra in the shell (to fill).
it1pointer to the index of the first boundary face sharing ia (to fill).
it2pointer to the index of the second boundary face sharing ia (to fill).
silentif 1, print error message for more than 2 boundary triangles in the shell
Returns
-1 if fail, \(2*ilist\) if shell is closed, \(2*ilist+1\) otherwise.

Find all tets sharing edge ia of tetra start, and stores boundary faces when met. \( it1 \) and \( it2 = 6*iel + iface\), iel = index of tetra, iface = index of face in tetra.

Warning
Don't work if ia has only one boundary face in its shell.

Definition at line 1846 of file boulep_3d.c.

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

◆ MMG5_coquilFaceErrorMessage()

void MMG5_coquilFaceErrorMessage ( MMG5_pMesh  mesh,
MMG5_int  k1,
MMG5_int  k2 
)
Parameters
meshpointer to the mesh structure.
k1should contain a tetra index.
k2should contain a tetra index different from k2.

Print an error message if MMG5_coquilFace detect a boundary topology problem.

Definition at line 1616 of file boulep_3d.c.

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

◆ MMG5_coquilTravel()

int16_t MMG5_coquilTravel ( MMG5_pMesh  mesh,
MMG5_int  na,
MMG5_int  nb,
MMG5_int *  adj,
MMG5_int *  piv,
int8_t *  iface,
int8_t *  i 
)
Parameters
meshpointer to the mesh structure.
naglobal index of edge extremity.
nbglobal index of edge extremity.
adjstarting tetrahedron at the begining and finish tet at the end.
pivglobal index of the vertex opposite to the travelling face (updated for the finish tet at the end).
ifaceprevious traveling face of the tet (suspected to be boundary), updated.
ilocal index of the edge \([na,nb]\) in tet adj.
Returns
the tag of the face iface of the tetra adj, 0 if the tetra is not boundary, -1 if fail.

Travel around the edge \([na,nb]\) from tetra adj and through the face piv.

Definition at line 1962 of file boulep_3d.c.

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

◆ MMG5_deltag()

int MMG5_deltag ( MMG5_pMesh  mesh,
MMG5_int  start,
int  ia,
uint16_t  tag 
)
Parameters
meshpointer to the mesh structure
startindex of the starting tetra
iaindex of the edge in tetra start that we want to modify
tagtag to remove
Returns
1 if success, 0 otherwise.

Remove the tag tag of edge ia in tetra start by travelling its shell.

Definition at line 1347 of file boulep_3d.c.

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

◆ MMG5_openCoquilTravel()

int16_t MMG5_openCoquilTravel ( MMG5_pMesh  mesh,
MMG5_int  na,
MMG5_int  nb,
MMG5_int *  adj,
MMG5_int *  piv,
int8_t *  iface,
int8_t *  i 
)
Parameters
meshpointer to the mesh structure.
naglobal index of edge extremity.
nbglobal index of edge extremity.
adjstarting tetrahedron at the begining and finish tet at the end.
pivglobal index of the vertex opposite to the travelling face (updated for the finish tet at the end).
ifacetraveling face of the tet (suspected to be boundary), updated.
ilocal index of the edge \([na,nb]\) in tet adj.
Returns
1 if success, 0 if fail.

Travel around the edge \([na,nb]\) from tetra adj and through the face piv. The shell of the edge is open and the tetra adj has no neighbour through the face iface.

Definition at line 2014 of file boulep_3d.c.

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

◆ MMG5_settag()

int MMG5_settag ( MMG5_pMesh  mesh,
MMG5_int  start,
int  ia,
uint16_t  tag,
int  edg 
)
Parameters
meshpointer to the mesh structure
starttetra from which we start
ialocal index of the edge in start
tagtag to set
edgedge reference to set
Returns
1 if success, 0 if fail.

Set tag tag and ref edg of edge ia (if need be) in tetra start by travelling its shell.

Definition at line 1234 of file boulep_3d.c.

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

◆ MMG5_srcbdy()

int MMG5_srcbdy ( MMG5_pMesh  mesh,
MMG5_int  start,
int  ia 
)
Parameters
meshpointer to the mesh structure.
startstarting tetra.
ialocal edge index in tetra start.
Returns
1 if the edge ia in start is boundary, 0 otherwise, -1 if fail.

Identify whether edge ia in start is a boundary edge by unfolding its shell.

Definition at line 1557 of file boulep_3d.c.

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

Variable Documentation

◆ info

MMG5_Info info
extern