mmgs
tools.c File Reference

Various tools for the mmg applications. More...

#include "mmgcommon.h"
Include dependency graph for tools.c:

Functions

int _MMG5_devangle (double *n1, double *n2, double crit)
 
int _MMG5_nonUnitNorPts (MMG5_pMesh mesh, int ip1, int ip2, int ip3, double *n)
 
double _MMG5_nonorsurf (MMG5_pMesh mesh, MMG5_pTria pt)
 
int _MMG5_norpts (MMG5_pMesh mesh, int ip1, int ip2, int ip3, double *n)
 
int _MMG5_nortri (MMG5_pMesh mesh, MMG5_pTria pt, double *n)
 
int _MMG5_rmtr (double r[3][3], double m[6], double mr[6])
 
int _MMG5_rotmatrix (double n[3], double r[3][3])
 
int _MMG5_invmat (double *m, double *mi)
 
int _MMG5_invmatg (double m[9], double mi[9])
 
int _MMG5_sys33sym (double a[6], double b[3], double r[3])
 
void _MMG5_printTria (MMG5_pMesh mesh, char *fileName)
 
long long _MMG5_memSize (void)
 
int _MMG5_Alloc_inode (MMG5_pMesh mesh, _MMG5_iNode **node)
 
int _MMG5_Add_inode (MMG5_pMesh mesh, _MMG5_iNode **liLi, int val)
 
void _MMG5_Free_ilinkedList (MMG5_pMesh mesh, _MMG5_iNode *liLi)
 
int _MMG5_Alloc_dnode (MMG5_pMesh mesh, _MMG5_dNode **node)
 
int _MMG5_Add_dnode (MMG5_pMesh mesh, _MMG5_dNode **liLi, int k, double val)
 
void _MMG5_Free_dlinkedList (MMG5_pMesh mesh, _MMG5_dNode *liLi)
 
double _MMG5_det3pt1vec (double c0[3], double c1[3], double c2[3], double v[3])
 
double _MMG5_det4pt (double c0[3], double c1[3], double c2[3], double c3[3])
 
double _MMG5_orvol (MMG5_pPoint point, int *v)
 
double MMG2_quickarea (double a[2], double b[2], double c[2])
 

Detailed Description

Various tools for the mmg applications.

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

Function Documentation

◆ _MMG5_Add_dnode()

int _MMG5_Add_dnode ( MMG5_pMesh  mesh,
_MMG5_dNode **  liLi,
int  k,
double  val 
)
inline
Parameters
meshpointer toward the mesh structure (for count of used memory).
liLipointer toward the address of the root of the linked list.
kinteger value to add to the linked list.
valreal value to add to the linked list.
Returns
1 if the node is inserted, 0 if the node is not inserted, -1 if fail.

Add a node with integer value k and real value val to a sorted linked list with unique entries.

Remarks
as the linked list had unique entries, we don't insert a node if it exists.
Here is the call graph for this function:

◆ _MMG5_Add_inode()

int _MMG5_Add_inode ( MMG5_pMesh  mesh,
_MMG5_iNode **  liLi,
int  val 
)
inline
Parameters
meshpointer toward the mesh structure (for count of used memory).
liLipointer toward the address of the root of the linked list.
valvalue to add to the linked list.
Returns
1 if the node is inserted, 0 if the node is not inserted, -1 if fail.

Add a node with value val to a sorted linked list with unique entries.

Remarks
as the linked list had unique entries, we don't insert a node if it exists.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _MMG5_Alloc_dnode()

int _MMG5_Alloc_dnode ( MMG5_pMesh  mesh,
_MMG5_dNode **  node 
)
inline
Parameters
meshpointer toward the mesh structure (for count of used memory).
nodepointer toward a _MMG5_dNode (cell for linked list)
Returns
1 if we can alloc the node node, 0 otherwise.

Node allocation.

Here is the caller graph for this function:

◆ _MMG5_Alloc_inode()

int _MMG5_Alloc_inode ( MMG5_pMesh  mesh,
_MMG5_iNode **  node 
)
inline
Parameters
meshpointer toward the mesh structure (for count of used memory).
nodepointer toward a _MMG5_iNode (cell for linked list)
Returns
1 if we can alloc the node node, 0 otherwise.

Node allocation.

Here is the caller graph for this function:

◆ _MMG5_det3pt1vec()

double _MMG5_det3pt1vec ( double  c0[3],
double  c1[3],
double  c2[3],
double  v[3] 
)
inline

Compute 3 * 3 determinant : det(c1-c0,c2-c0,v)

Here is the caller graph for this function:

◆ _MMG5_det4pt()

double _MMG5_det4pt ( double  c0[3],
double  c1[3],
double  c2[3],
double  c3[3] 
)
inline

Compute 3 * 3 determinant : det(c1-c0,c2-c0,c3-c0)

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

◆ _MMG5_devangle()

int _MMG5_devangle ( double *  n1,
double *  n2,
double  crit 
)
Parameters
n1first normal
n2second normal
Returns
1 if success, 0 if fail

Check if the angle between n1 and n2 is larger than the ridge criterion. If yes, return 1, 0 otherwise (ridge creation).

◆ _MMG5_Free_dlinkedList()

void _MMG5_Free_dlinkedList ( MMG5_pMesh  mesh,
_MMG5_dNode liLi 
)
inline
Parameters
meshpointer toward the mesh structure (for count of used memory).
liLipointer toward the root of the linked list.

Free the memory used by the linked list whose root is liLi.

◆ _MMG5_Free_ilinkedList()

void _MMG5_Free_ilinkedList ( MMG5_pMesh  mesh,
_MMG5_iNode liLi 
)
inline
Parameters
meshpointer toward the mesh structure (for count of used memory).
liLipointer toward the root of the linked list.

Free the memory used by the linked list whose root is liLi.

Here is the caller graph for this function:

◆ _MMG5_invmat()

int _MMG5_invmat ( double *  m,
double *  mi 
)
Parameters
mpointer toward a 3x3 symetric matrix
mipointer toward the computed 3x3 matrix.

Invert m (3x3 symetric matrix) and store the result on mi

◆ _MMG5_invmatg()

int _MMG5_invmatg ( double  m[9],
double  mi[9] 
)
Parameters
minitial matrix.
miinverted matrix.

Invert 3x3 non-symmetric matrix.

Here is the caller graph for this function:

◆ _MMG5_memSize()

long long _MMG5_memSize ( void  )
Returns
the available memory size of the computer.

Compute the available memory size of the computer.

Here is the caller graph for this function:

◆ _MMG5_nonorsurf()

double _MMG5_nonorsurf ( MMG5_pMesh  mesh,
MMG5_pTria  pt 
)
inline
Parameters
meshpointer toward the mesh stucture.
pttriangle for which we compute the surface.
Returns
the computed surface

Compute non-oriented surface area of a triangle.

Here is the call graph for this function:

◆ _MMG5_nonUnitNorPts()

int _MMG5_nonUnitNorPts ( MMG5_pMesh  mesh,
int  ip1,
int  ip2,
int  ip3,
double *  n 
)
inline
Parameters
meshpointer toward the mesh stucture.
ip1first point of face.
ip2second point of face.
ip3third point of face.
npointer to store the computed normal.
Returns
1

Compute non-normalized face normal given three points on the surface.

Here is the caller graph for this function:

◆ _MMG5_norpts()

int _MMG5_norpts ( MMG5_pMesh  mesh,
int  ip1,
int  ip2,
int  ip3,
double *  n 
)
inline
Parameters
meshpointer toward the mesh stucture.
ip1first point of face.
ip2second point of face.
ip3third point of face.
npointer to store the computed normal.
Returns
1 if success, 0 otherwise.

Compute normalized face normal given three points on the surface.

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

◆ _MMG5_nortri()

int _MMG5_nortri ( MMG5_pMesh  mesh,
MMG5_pTria  pt,
double *  n 
)
inline
Parameters
meshpointer toward the mesh stucture.
ptpointer toward the triangle structure.
npointer to store the computed normal.
Returns
1

Compute triangle normal.

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

◆ _MMG5_orvol()

double _MMG5_orvol ( MMG5_pPoint  point,
int *  v 
)
inline
Parameters
pointPointer toward the points array
vpointer toward the point indices
Returns
the oriented volume of tetra

Compute oriented volume of a tetrahedron

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

◆ _MMG5_printTria()

void _MMG5_printTria ( MMG5_pMesh  mesh,
char *  fileName 
)
Parameters
meshpointer toward the mesh structure.
fileNamepointer toward the file name.

Debug function (not use in clean code): write mesh->tria structure in file.

◆ _MMG5_rmtr()

int _MMG5_rmtr ( double  r[3][3],
double  m[6],
double  mr[6] 
)
inline
Here is the caller graph for this function:

◆ _MMG5_rotmatrix()

int _MMG5_rotmatrix ( double  n[3],
double  r[3][3] 
)
inline
Parameters
npointer toward the vector that we want to send on the third vector of canonical basis.
rcomputed rotation matrix.

Compute rotation matrix that sends vector n to the third vector of canonical basis.

Here is the caller graph for this function:

◆ _MMG5_sys33sym()

int _MMG5_sys33sym ( double  a[6],
double  b[3],
double  r[3] 
)
inline
Parameters
amatrix to invert.
blast member.
rvector of unknowns.
Returns
0 if fail, 1 otherwise.

Solve $ 3\times 3$ symmetric system $ A . r = b $.

Here is the caller graph for this function:

◆ MMG2_quickarea()

double MMG2_quickarea ( double  a[2],
double  b[2],
double  c[2] 
)
Parameters
apoint coordinates
bpoint coor
cpoint coor

Compute tria area.

Here is the caller graph for this function: