Mmg
Simplicial remeshers (mesh adaptation, isovalue discretization, lagrangian movement)
Macros | Functions
hash_2d.c File Reference
#include "libmmg2d_private.h"
Include dependency graph for hash_2d.c:

Go to the source code of this file.

Macros

#define KTA   7
 
#define KTB   11
 

Functions

int MMG2D_hashTria (MMG5_pMesh mesh)
 
int MMG2D_hashQuad (MMG5_pMesh mesh)
 
int MMG2D_assignEdge (MMG5_pMesh mesh)
 
int MMG2D_bdryEdge (MMG5_pMesh mesh)
 
int MMG2D_pack (MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pSol met)
 

Macro Definition Documentation

◆ KTA

#define KTA   7

Definition at line 25 of file hash_2d.c.

◆ KTB

#define KTB   11

Definition at line 26 of file hash_2d.c.

Function Documentation

◆ MMG2D_assignEdge()

int MMG2D_assignEdge ( MMG5_pMesh  mesh)
Parameters
meshpointer toward the mesh
Returns
0 if fail, 1 otherwise

Transfer some input edge data to the corresponding triangles fields

The cleaning of required tags inside triangles has been initially added by commit da4b099c. It probably followed the report of a bug arising when several library functions are successively called without cleaning the mesh structure but on december 2022 I am not able to reproduce this bug. Due to tags cleaning, input required edges are lost in ls discretization mode (see issue #171). The metRidtyp field (previsouly not used in 2D) is now used to mark if MMG2D_assignEdge function is called for the first time inside the library and if we have to clean triangle tags (in order to fix issue #171 without breaking again the initial fix).

Definition at line 331 of file hash_2d.c.

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

◆ MMG2D_bdryEdge()

int MMG2D_bdryEdge ( MMG5_pMesh  mesh)
Parameters
meshpointer toward the mesh
Returns
1 if success, 0 if fail

Create the edges in the mesh from the information stored in the triangles, or by identifying the different components of the mesh.

Remarks
Possible extension needed to take into account constrained edges
Call in debug mode only

Definition at line 446 of file hash_2d.c.

◆ MMG2D_hashQuad()

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

Create full table of adjacency for quadrangles (quad $ <-> $ quad adjacencies and quad $ -> $ tri adjacencies): 1) if the edge $ i1 $ of quad $ k1 $ is adja to quad $ k2 $ through edge $ i2 $, $
adja[4*(k1-1)+1+i1] = 4*k2+i2 $. 2) if the edge $ i1 $ of quad $ k1
$ is adja to tria $ k2 $ through edge $ i2 $, $
adja[4*(k1-1)+1+i1] = -(3*k2+i2) $.

Step 1: Fill adjacendies between quadrangles

Step 2: Fill adjacencies between quadrangles and triangles

Definition at line 150 of file hash_2d.c.

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

◆ MMG2D_hashTria()

int MMG2D_hashTria ( MMG5_pMesh  mesh)
Parameters
meshpointer toward the mesh
Returns
1 if success, 0 if fail

Create adjacency relations between the triangles dein the mesh

Definition at line 35 of file hash_2d.c.

Here is the caller graph for this function:

◆ MMG2D_pack()

int MMG2D_pack ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
MMG5_pSol  met 
)
Parameters
meshpointer toward the mesh structure.
solpointer toward a solution structure.
metpointer toward a solution structure.
Returns
0 if memory problem (uncomplete mesh), 1 otherwise.

Pack the mesh and metric and create explicitly all the mesh structures (edges).

Recreate adjacencies if need be

Pack vertex indices

Count the number of edges in the mesh

Count edges stored in triangles

Count edges stored in quadrangles

Pack edges

Pack triangles

Pack quadrangles

Pack solutions (metric map, displacement, ...)

Pack vertices

Reset ppt->tmp field

Reset garbage collector

Definition at line 527 of file hash_2d.c.

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