mmgs
libmmgs_tools.c File Reference

Tools functions for the mmgs library. More...

#include "mmgs.h"
#include "inlined_functions.h"
Include dependency graph for libmmgs_tools.c:

Functions

void MMGS_setfunc (MMG5_pMesh mesh, MMG5_pSol met)
 
int MMGS_usage (char *prog)
 
int MMGS_defaultValues (MMG5_pMesh mesh)
 
int MMGS_parsar (int argc, char *argv[], MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol sol)
 
int MMGS_freeLocalPar (MMG5_pMesh mesh)
 
int MMGS_stockOptions (MMG5_pMesh mesh, MMG5_Info *info)
 
void MMGS_destockOptions (MMG5_pMesh mesh, MMG5_Info *info)
 
int MMGS_Get_numberOfNonBdyEdges (MMG5_pMesh mesh, int *nb_edges)
 
int MMGS_Get_nonBdyEdge (MMG5_pMesh mesh, int *e0, int *e1, int *ref, int idx)
 
int MMGS_Get_adjaTri (MMG5_pMesh mesh, int kel, int listri[3])
 Return adjacent elements of a triangle. More...
 
int MMGS_Get_adjaVerticesFast (MMG5_pMesh mesh, int ip, int start, int lispoi[MMGS_LMAX])
 Return adjacent elements of a triangle. More...
 
int MMGS_doSol (MMG5_pMesh mesh, MMG5_pSol met)
 
int MMGS_Set_constantSize (MMG5_pMesh mesh, MMG5_pSol met)
 
int MMGS_Compute_eigenv (double m[6], double lambda[3], double vp[3][3])
 
void MMGS_Free_solutions (MMG5_pMesh mesh, MMG5_pSol sol)
 

Detailed Description

Tools functions for the mmgs library.

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

◆ MMGS_Compute_eigenv()

int MMGS_Compute_eigenv ( double  m[6],
double  lambda[3],
double  vp[3][3] 
)
Parameters
mupper part of a symetric matric diagonalizable in |R
lambdaarray of the metric eigenvalues
vparray of the metric eigenvectors
Returns
the order of the eigenvalues

Compute the real eigenvalues and eigenvectors of a symetric matrice m whose upper part is provided (m11, m12, m13, m22, m23, m33 in this order). lambda[0] is the eigenvalue associated to the eigenvector ( v[0][0], v[0,1], v[0,2] ) in C and to the eigenvector v(1,:) in fortran lambda[1] is the eigenvalue associated to the eigenvector ( v[1][0], v[1,1], v[1,2] ) in C and to the eigenvector v(2,:) in fortran lambda[2] is the eigenvalue associated to the eigenvector ( v[2][0], v[2,1], v[2,2] ) in C and to the eigenvector v(3,:) in fortran

Remarks
Fortran interface:

SUBROUTINE MMGS_COMPUTE_EIGENV(m,lambda,vp,retval)
REAL(KIND=8), INTENT(IN) :: m(*)
REAL(KIND=8), INTENT(OUT) :: lambda(*),vp(*)
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

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

◆ MMGS_defaultValues()

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

Print the default parameters values.

Remarks
Fortran interface:

SUBROUTINE MMGS_DEFAULTVALUES(mesh,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

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

◆ MMGS_destockOptions()

void MMGS_destockOptions ( MMG5_pMesh  mesh,
MMG5_Info info 
)
Parameters
meshpointer toward the mesh structure.
infopointer toward the info structure.

Recover the info structure stored in the mesh structure.

Remarks
Fortran interface:

SUBROUTINE MMGS_DESTOCKOPTIONS(mesh,info)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,info
END SUBROUTINE

Here is the caller graph for this function:

◆ MMGS_doSol()

int MMGS_doSol ( MMG5_pMesh  mesh,
MMG5_pSol  met 
)
Parameters
meshpointer toward the mesh structure
metpointer toward the sol structure
Returns
1 if success

Compute isotropic size map according to the mean of the length of the edges passing through a point.

Remarks
Fortran interface:

SUBROUTINE MMGS_DOSOL(mesh,met,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,met
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

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

◆ MMGS_Free_solutions()

void MMGS_Free_solutions ( MMG5_pMesh  mesh,
MMG5_pSol  sol 
)
Parameters
meshpointer toward the mesh structure
solpointer toward the solution structure

Free the solution.

Remarks
Fortran interface:

SUBROUTINE MMGS_FREE_SOLUTIONS(mesh,sol)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol
END SUBROUTINE

Here is the caller graph for this function:

◆ MMGS_freeLocalPar()

int MMGS_freeLocalPar ( MMG5_pMesh  mesh)

◆ MMGS_Get_adjaTri()

int MMGS_Get_adjaTri ( MMG5_pMesh  mesh,
int  kel,
int  listri[3] 
)

Return adjacent elements of a triangle.

Parameters
meshpointer toward the mesh structure.
keltriangle index.
listripointer toward the table of the indices of the three adjacent triangles of the elt kel (the index is 0 if there is no adjacent).
Returns
1.

Find the indices of the 3 adjacent elements of triangle kel. $v_i = 0$ if the $i^{th}$ face has no adjacent element (so we are on a boundary face).

Remarks
Fortran interface:

SUBROUTINE MMGS_GET_ADJATRI(mesh,kel,listri,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh
INTEGER, INTENT(IN) :: kel
INTEGER, DIMENSION(3), INTENT(OUT) :: listri
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

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

◆ MMGS_Get_adjaVerticesFast()

int MMGS_Get_adjaVerticesFast ( MMG5_pMesh  mesh,
int  ip,
int  start,
int  lispoi[MMGS_LMAX] 
)

Return adjacent elements of a triangle.

Parameters
meshpointer toward the mesh structure.
ipvertex index.
startindex of a triangle holding ip.
lispoipointer toward an array of size MMGS_LMAX that will contain the indices of adjacent vertices to the vertex ip.
Returns
nbpoi the number of adjacent points if success, 0 if fail.

Find the indices of the adjacent vertices of the vertex ip of the triangle start.

Remarks
Fortran interface:

SUBROUTINE MMGS_GET_ADJAVERTICESFAST(mesh,ip,start,lispoi,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh
INTEGER, INTENT(IN) :: ip,start
INTEGER, DIMENSION(MMGS_LMAX), INTENT(OUT) :: lispoi
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Here is the caller graph for this function:

◆ MMGS_Get_nonBdyEdge()

int MMGS_Get_nonBdyEdge ( MMG5_pMesh  mesh,
int *  e0,
int *  e1,
int *  ref,
int  idx 
)
Parameters
meshpointer toward the mesh structure.
e0pointer toward the first extremity of the edge.
e1pointer toward the second extremity of the edge.
refpointer toward the edge reference.
idxindex of the non boundary edge to get (between 1 and nb_edges)
Returns
0 if failed, 1 otherwise.

Get extremities e0, e1 and reference ref of the idx^th non boundary edge (for DG methods for example). An edge is boundary if it is located at the interface of 2 domains witch different references, if it belongs to one triangle only or if it is a singular edge (ridge or required).

Remarks
Fortran interface:

SUBROUTINE MMGS_GET_NONBDYEDGE(mesh,e0,e1,ref,idx,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER, INTENT(OUT) :: e0,e1
INTEGER :: ref
INTEGER, INTENT(IN) :: idx
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

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

◆ MMGS_Get_numberOfNonBdyEdges()

int MMGS_Get_numberOfNonBdyEdges ( MMG5_pMesh  mesh,
int *  nb_edges 
)
Parameters
meshpointer toward the mesh structure.
nb_edgespointer toward the number of non boundary edges.
Returns
0 if failed, 1 otherwise.

Get the number of non boundary edges (for DG methods for example). An edge is boundary if it is located at the interface of 2 domains with different references, if it belongs to one triangle only or if it is a singular edge (ridge or required). Append these edges to the list of edge.

Warning
reallocate the edge array and append the internal edges. This may modify the behaviour of other functions.
Remarks
Fortran interface:

SUBROUTINE MMGS_GET_NUMBEROFNONBDYEDGES(mesh,nb_edges,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER, INTENT(OUT) :: nb_edges
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

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

◆ MMGS_parsar()

int MMGS_parsar ( int  argc,
char *  argv[],
MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_pSol  sol 
)
Parameters
argcnumber of command line arguments.
argvcommand line arguments.
meshpointer toward the mesh structure.
metpointer toward the sol structure.
solpointer toward a level-set or displacement
Returns
1.

Store command line arguments.

Remarks
no matching fortran function.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMGS_Set_constantSize()

int MMGS_Set_constantSize ( MMG5_pMesh  mesh,
MMG5_pSol  met 
)
Parameters
meshpointer toward the mesh structure
metpointer toward the sol structure
Returns
1 if success

Compute constant size map according to mesh->info.hsiz, mesh->info.hmin and mesh->info.hmax. Update this 3 value if not compatible.

Remarks
Fortran interface:

SUBROUTINE MMGS_SET_CONSTANTSIZE(mesh,met,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,met
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

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

◆ MMGS_setfunc()

void MMGS_setfunc ( MMG5_pMesh  mesh,
MMG5_pSol  met 
)

To associate function pointers without calling MMGS_mmgslib

Parameters
meshpointer toward the mesh structure (unused).
metpointer toward the sol structure (unused).

Set function pointers for caltet, lenedg, defsiz and gradsiz.

Remarks
Fortran interface:

SUBROUTINE MMGS_SETFUNC(mesh,met)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,met
END SUBROUTINE

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

◆ MMGS_stockOptions()

int MMGS_stockOptions ( MMG5_pMesh  mesh,
MMG5_Info info 
)
Parameters
meshpointer toward the mesh structure.
infopointer toward the info structure.
Returns
1.

Store the info structure in the mesh structure.

Remarks
Fortran interface:

SUBROUTINE MMGS_STOCKOPTIONS(mesh,info,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,info
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

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

◆ MMGS_usage()

int MMGS_usage ( char *  prog)
Parameters
progpointer toward the program name.

Print help for mmgs options.

Remarks
Fortran interface:

SUBROUTINE MMGS_USAGE(prog,strlen0,retval)
CHARACTER(LEN=*), INTENT(IN) :: prog
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

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