mmg3d
hash_3d.c File Reference

Functions for hash tables management and tetrahedra packing. More...

#include "mmg3d.h"
Include dependency graph for hash_3d.c:

Macros

#define _MMG5_KC   13
 

Functions

static int _MMG5_paktet (MMG5_pMesh mesh)
 
static int _MMG5_hashFace (MMG5_pMesh mesh, _MMG5_Hash *hash, int ia, int ib, int ic, int k)
 
static int _MMG5_hashGetFace (_MMG5_Hash *hash, int ia, int ib, int ic)
 
int MMG3D_hashTetra (MMG5_pMesh mesh, int pack)
 
int MMG3D_hashPrism (MMG5_pMesh mesh)
 
static int _MMG5_setEdgeNmTag (MMG5_pMesh mesh, _MMG5_Hash *hash)
 
static int _MMG5_setVertexNmTag (MMG5_pMesh mesh)
 
int _MMG5_setNmTag (MMG5_pMesh mesh, _MMG5_Hash *hash)
 
int _MMG3D_hashTria (MMG5_pMesh mesh, _MMG5_Hash *hash)
 
int _MMG5_hashPop (_MMG5_Hash *hash, int a, int b)
 
int _MMG5_hTag (MMG5_HGeom *hash, int a, int b, int ref, int16_t tag)
 
int _MMG5_hPop (MMG5_HGeom *hash, int a, int b, int *ref, int16_t *tag)
 
int _MMG5_hGet (MMG5_HGeom *hash, int a, int b, int *ref, int16_t *tag)
 
int _MMG5_hEdge (MMG5_pMesh mesh, MMG5_HGeom *hash, int a, int b, int ref, int16_t tag)
 
int _MMG5_hNew (MMG5_pMesh mesh, MMG5_HGeom *hash, int hsiz, int hmax)
 
int _MMG5_hGeom (MMG5_pMesh mesh)
 
static int _MMG5_bdryTria (MMG5_pMesh mesh, int ntmesh)
 
int _MMG5_chkBdryTria (MMG5_pMesh mesh)
 
int _MMG5_bdrySet (MMG5_pMesh mesh)
 
int _MMG5_bdryUpdate (MMG5_pMesh mesh)
 
int _MMG5_bdryPerm (MMG5_pMesh mesh)
 

Variables

char ddb
 

Detailed Description

Functions for hash tables management and tetrahedra packing.

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

Macro Definition Documentation

◆ _MMG5_KC

#define _MMG5_KC   13

Function Documentation

◆ _MMG3D_hashTria()

int _MMG3D_hashTria ( MMG5_pMesh  mesh,
_MMG5_Hash hash 
)
Parameters
meshpointer toward the mesh structure.
hashEdges hash table.
Returns
1 if success, 0 if failed.

Create surface adjacency table. Allocate the edge hash table hash but don't free it.

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

◆ _MMG5_bdryPerm()

int _MMG5_bdryPerm ( MMG5_pMesh  mesh)
Parameters
meshpointer toward the mesh structure.
Returns
0 if failed, 1 otherwise.

Make orientation of triangles compatible with tetra faces.

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

◆ _MMG5_bdrySet()

int _MMG5_bdrySet ( MMG5_pMesh  mesh)
Parameters
meshpointer toward the mesh structure.
Returns
0 if failed, 1 if success.

Set the triangles references to the tetrahedra faces and edges.

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

◆ _MMG5_bdryTria()

static int _MMG5_bdryTria ( MMG5_pMesh  mesh,
int  ntmesh 
)
inlinestatic
Parameters
meshpointer to the mesh structure.
ntmeshnumber of boundary tria found in the mesh.
Returns
0 if failed, 1 otherwise.

Identify boundary triangles.

Remarks
mesh->xtetra is not allocated when _MMG5_bdryTria is called by _MMG3D_analys but it is allocated when called by packMesh.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _MMG5_bdryUpdate()

int _MMG5_bdryUpdate ( MMG5_pMesh  mesh)

Update tag and refs of tetra edges. If tetra is required, set the faces/edges to required

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

◆ _MMG5_chkBdryTria()

int _MMG5_chkBdryTria ( MMG5_pMesh  mesh)
Parameters
meshpointer toward the mesh structure.
Returns
1 if success, 0 otherwise.

Check the matching between actual and given number of faces in the mesh: Count the number of faces in mesh and compare this number to the number of given triangles. If the founded number exceed the given one, add the missing boundary triangles. Do nothing otherwise.

Step 1: scan the mesh and count the boundaries

Step 2: detect the extra boundaries (that will be ignored) provided by the user
Step 3: add the missing boundary triangles or, if the mesh contains prisms, set to required the triangles at interface betwen prisms and tet

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

◆ _MMG5_hashFace()

static int _MMG5_hashFace ( MMG5_pMesh  mesh,
_MMG5_Hash hash,
int  ia,
int  ib,
int  ic,
int  k 
)
static
Parameters
meshpointer toward the mesh.
hashpointer toward the hash table to fill.
iafirst vertex of face to hash.
ibsecond vertex of face to hash.
icthird vertex of face to hash.
kindex of face to hash.
Returns
0 if fail, -1 if the face is newly hashed, index of the first face hashed if another face with same vertices exist.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _MMG5_hashGetFace()

static int _MMG5_hashGetFace ( _MMG5_Hash hash,
int  ia,
int  ib,
int  ic 
)
static

return index of triangle ia ib ic

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

◆ _MMG5_hashPop()

int _MMG5_hashPop ( _MMG5_Hash hash,
int  a,
int  b 
)

remove edge from hash table

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

◆ _MMG5_hEdge()

int _MMG5_hEdge ( MMG5_pMesh  mesh,
MMG5_HGeom hash,
int  a,
int  b,
int  ref,
int16_t  tag 
)

store edge on geometry

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

◆ _MMG5_hGeom()

int _MMG5_hGeom ( MMG5_pMesh  mesh)
Parameters
meshpointer toward he mesh structure.
Returns
0 if failed, 1 otherwise

Build hashtable for initial mesh edges.

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

◆ _MMG5_hGet()

int _MMG5_hGet ( MMG5_HGeom hash,
int  a,
int  b,
int *  ref,
int16_t *  tag 
)

get ref and tag to edge on geometry

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

◆ _MMG5_hNew()

int _MMG5_hNew ( MMG5_pMesh  mesh,
MMG5_HGeom hash,
int  hsiz,
int  hmax 
)

to store edge on geometry

Here is the caller graph for this function:

◆ _MMG5_hPop()

int _MMG5_hPop ( MMG5_HGeom hash,
int  a,
int  b,
int *  ref,
int16_t *  tag 
)

remove edge from hash table

Here is the call graph for this function:

◆ _MMG5_hTag()

int _MMG5_hTag ( MMG5_HGeom hash,
int  a,
int  b,
int  ref,
int16_t  tag 
)

set tag to edge on geometry

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

◆ _MMG5_paktet()

static int _MMG5_paktet ( MMG5_pMesh  mesh)
static
Parameters
meshpointer toward the mesh structure.
Returns
1 if success, 0 if fail

tetra packing.

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

◆ _MMG5_setEdgeNmTag()

static int _MMG5_setEdgeNmTag ( MMG5_pMesh  mesh,
_MMG5_Hash hash 
)
inlinestatic
Parameters
meshpointer towar the mesh structure.
hashedges hash table.
Returns
1 if success, 0 if failed.

Set non-manifold tag at extremities of a non-manifold edge. Check if a non-manifold edge is at the interface of several distinct domains (thus we can't travel from a domain through another one by adjacency) and in this case, mark the edge and its extremities as required. Free the edge hash table hash if success.

Warning
if fail, the edge hash table hash is not freed.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _MMG5_setNmTag()

int _MMG5_setNmTag ( MMG5_pMesh  mesh,
_MMG5_Hash hash 
)
Parameters
meshpointer towar the mesh structure.
hashedges hash table.
Returns
1 if success, 0 if failed.

Set tags to non-manifold edges and vertices. Not done before because we need the MMG5_xTetra table.

Warning
if fail, the edge hash table hash is not freed.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _MMG5_setVertexNmTag()

static int _MMG5_setVertexNmTag ( MMG5_pMesh  mesh)
inlinestatic
Parameters
meshpointer toward the mesh structure.
Returns
1 if success, 0 if fail. Seek the non-required non-manifold points and try to analyse whether they are corner or required.
Remarks
We don't know how to travel through the shell of a non-manifold point by triangle adjacency. Thus the work done here can't be performed in the _MMG5_singul function.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG3D_hashPrism()

int MMG3D_hashPrism ( MMG5_pMesh  mesh)
Parameters
meshpointer toward the mesh structure.
Returns
0 if failed, 1 otherwise.

Create table of adjacency for prisms.

Warning
check the hashtable efficiency
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG3D_hashTetra()

int MMG3D_hashTetra ( MMG5_pMesh  mesh,
int  pack 
)
Parameters
meshpointer toward the mesh structure.
packwe pack the mesh at function begining if $pack=1$.
Returns
0 if failed, 1 otherwise.

Create table of adjacency. Set pack variable to 0 for a compact mesh and to 1 for a mesh that need to be packed.

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

Variable Documentation

◆ ddb

char ddb