Mmg
Simplicial remeshers (mesh adaptation, isovalue discretization, lagrangian movement)
Macros | Functions | Variables
libmmg2d_private.h File Reference
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <math.h>
#include <string.h>
#include <signal.h>
#include <ctype.h>
#include <float.h>
#include "libmmgcommon_private.h"
Include dependency graph for libmmg2d_private.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define M_MAX(a, b)   (((a) > (b)) ? (a) : (b))
 
#define M_MIN(a, b)   (((a) < (b)) ? (a) : (b))
 
#define M_LAMBDA   0.34
 
#define M_MU   0.33
 
#define MMG2D_EPSD   1.e-10
 
#define MMG2D_EPSA   1.e-12
 
#define MMG2D_PRECI   1.
 
#define MMG2D_SIZE   0.75
 
#define MMG2D_ALPHA   0.28867513459
 
#define MMG2D_ALPHAD   3.464101615137755 /* 6.0 / sqrt(3.0) */
 
#define MMG2D_BADKAL   0.2
 
#define MMG2D_NULKAL   1.e-6
 
#define MMG2D_ANGCORN   -1.e-6
 
#define MMG2D_SHORTMAX   0x7fff
 
#define MMG2D_LLONG   2.0
 
#define MMG2D_LSHRT   0.3
 
#define MMG2D_LOPTL   1.4
 
#define MMG2D_LOPTS   0.71
 
#define MMG2D_NPMAX   50000
 
#define MMG2D_NEDMAX   100000
 
#define MMG2D_NEMAX   100000
 
#define MMG2D_RETURN_AND_FREE(mesh, met, ls, disp, val)
 
#define MMG2D_POINT_REALLOC(mesh, sol, ip, wantedGap, law, o, tag)
 
#define MMG2D_TRIA_REALLOC(mesh, jel, wantedGap, law)
 

Functions

static void MMG2D_excfun (int sigid)
 
MMG5_int MMG2D_newPt (MMG5_pMesh mesh, double c[2], int16_t tag)
 
void MMG2D_delPt (MMG5_pMesh mesh, MMG5_int ip)
 
void MMG5_delEdge (MMG5_pMesh mesh, MMG5_int iel)
 
MMG5_int MMG2D_newElt (MMG5_pMesh mesh)
 
int MMG2D_delElt (MMG5_pMesh mesh, MMG5_int iel)
 
int MMG2D_zaldy (MMG5_pMesh mesh)
 
size_t MMG5_memSize (void)
 
int MMG2D_memOption (MMG5_pMesh mesh)
 
int MMG2D_setMeshSize_alloc (MMG5_pMesh)
 
int MMG2D_pack (MMG5_pMesh, MMG5_pSol, MMG5_pSol)
 
int MMG2D_outqua (MMG5_pMesh, MMG5_pSol)
 
int MMG2D_mmg2d1 (MMG5_pMesh, MMG5_pSol)
 
int MMG2D_Init_mesh_var (va_list argptr)
 
int MMG2D_Free_all_var (va_list argptr)
 
int MMG2D_Free_structures_var (va_list argptr)
 
int MMG2D_Free_names_var (va_list argptr)
 
int MMG2D_mmg2d2 (MMG5_pMesh, MMG5_pSol)
 
int MMG2D_mmg2d6 (MMG5_pMesh, MMG5_pSol, MMG5_pSol)
 
int MMG2D_mmg2d9 (MMG5_pMesh, MMG5_pSol, MMG5_pSol, MMG5_int **)
 
int MMG2D_swapdelone (MMG5_pMesh, MMG5_pSol, MMG5_int, int8_t, double, MMG5_int *)
 
int MMG5_mmg2dChkmsh (MMG5_pMesh, int, MMG5_int)
 
int MMG2D_2dMeshCheck (MMG5_pMesh mesh)
 
int MMG2D_boulep (MMG5_pMesh, MMG5_int, int, MMG5_int *)
 
int MMG2D_prilen (MMG5_pMesh, MMG5_pSol)
 
int MMG2D_coorbary (MMG5_pMesh, MMG5_pTria, double c[2], double *, double *, double *)
 
MMG5_int MMG2D_isInTriangle (MMG5_pMesh, MMG5_int, double c[2])
 
int MMG2D_cutEdge (MMG5_pMesh, MMG5_pTria, MMG5_pPoint, MMG5_pPoint)
 
int MMG2D_cutEdgeTriangle (MMG5_pMesh, MMG5_int, MMG5_int, MMG5_int)
 
MMG5_int MMG2D_findTria (MMG5_pMesh, MMG5_int)
 
int MMG2D_locateEdge (MMG5_pMesh, MMG5_int, MMG5_int, MMG5_int *, MMG5_int *)
 
int MMG2D_bdryenforcement (MMG5_pMesh, MMG5_pSol)
 
int MMG2D_settagtriangles (MMG5_pMesh, MMG5_pSol)
 
MMG5_int MMG2D_findtrianglestate (MMG5_pMesh, MMG5_int, MMG5_int, MMG5_int, MMG5_int, MMG5_int, MMG5_int)
 
int MMG2D_baseBdry (MMG5_pMesh mesh)
 
int MMG2D_cavity (MMG5_pMesh, MMG5_pSol, MMG5_int, MMG5_int *)
 
int MMG2D_delone (MMG5_pMesh, MMG5_pSol, MMG5_int, MMG5_int *, int)
 
int MMG2D_cenrad_iso (MMG5_pMesh, double *, double *, double *)
 
double MMG2D_caltri_iso_3pt (double *a, double *b, double *c)
 
int MMG2D_hashTria (MMG5_pMesh)
 
int MMG2D_hashQuad (MMG5_pMesh mesh)
 
int MMG2D_cuttri (MMG5_pMesh, MMG5_pSol, MMG5_pSol)
 
int MMG2D_split1_sim (MMG5_pMesh, MMG5_pSol, MMG5_int, MMG5_int vx[3])
 
int MMG2D_split2_sim (MMG5_pMesh, MMG5_pSol, MMG5_int, MMG5_int vx[3])
 
int MMG2D_split3_sim (MMG5_pMesh, MMG5_pSol, MMG5_int, MMG5_int vx[3])
 
int MMG2D_split1 (MMG5_pMesh, MMG5_pSol, MMG5_int, MMG5_int vx[3])
 
int MMG2D_split2 (MMG5_pMesh, MMG5_pSol, MMG5_int, MMG5_int vx[3])
 
int MMG2D_split3 (MMG5_pMesh, MMG5_pSol, MMG5_int, MMG5_int vx[3])
 
int MMG2D_splitbar (MMG5_pMesh, MMG5_int, MMG5_int)
 
int MMG2D_assignEdge (MMG5_pMesh)
 
int MMG2D_bdryEdge (MMG5_pMesh)
 
int MMG2D_setadj (MMG5_pMesh, int8_t)
 
int MMG2D_singul (MMG5_pMesh, MMG5_int)
 
int MMG2D_analys (MMG5_pMesh)
 
int MMG2D_norver (MMG5_pMesh, MMG5_int)
 
int MMG2D_regnor (MMG5_pMesh)
 
int MMG2D_regver (MMG5_pMesh)
 
int MMG2D_boulen (MMG5_pMesh, MMG5_int, int8_t, MMG5_int *, MMG5_int *, double *)
 
int MMG2D_mmg2d1n (MMG5_pMesh, MMG5_pSol)
 
int MMG2D_anatri (MMG5_pMesh, MMG5_pSol, int8_t)
 
int MMG2D_adptri (MMG5_pMesh, MMG5_pSol)
 
int MMG2D_defsiz_iso (MMG5_pMesh, MMG5_pSol)
 
int MMG2D_defsiz_ani (MMG5_pMesh, MMG5_pSol)
 
int MMG2D_defmetbdy_2d (MMG5_pMesh, MMG5_pSol, MMG5_int, int8_t)
 
int MMG2D_defaultmet_2d (MMG5_pMesh, MMG5_pSol, MMG5_int, int8_t)
 
MMG5_int MMG2D_grad2met_ani (MMG5_pMesh, MMG5_pSol, MMG5_pTria, MMG5_int, MMG5_int)
 
int MMG2D_grad2metreq_ani (MMG5_pMesh, MMG5_pSol, MMG5_pTria, MMG5_int, MMG5_int)
 
int MMG2D_gradsiz_ani (MMG5_pMesh, MMG5_pSol)
 
int MMG2D_gradsizreq_ani (MMG5_pMesh, MMG5_pSol)
 
MMG5_int MMG2D_anaelt (MMG5_pMesh, MMG5_pSol, int)
 
MMG5_int MMG2D_colelt (MMG5_pMesh, MMG5_pSol, int)
 
MMG5_int MMG2D_swpmsh (MMG5_pMesh, MMG5_pSol, int)
 
double MMG2D_lencurv_iso (MMG5_pMesh, MMG5_pSol, MMG5_int, MMG5_int)
 
double MMG2D_lencurv_ani (MMG5_pMesh, MMG5_pSol, MMG5_int, MMG5_int)
 
int MMG2D_chkedg (MMG5_pMesh, MMG5_int)
 
int MMG2D_bezierCurv (MMG5_pMesh, MMG5_int, int8_t, double, double *, double *)
 
int MMG2D_dichoto (MMG5_pMesh, MMG5_pSol, MMG5_int, MMG5_int *)
 
double MMG2D_quickcal (MMG5_pMesh, MMG5_pTria)
 
int MMG2D_chkcol (MMG5_pMesh, MMG5_pSol, MMG5_int, int8_t, MMG5_int *, int8_t)
 
int MMG2D_colver (MMG5_pMesh, int, MMG5_int *)
 
int MMG2D_colver3 (MMG5_pMesh, MMG5_int *)
 
int MMG2D_colver2 (MMG5_pMesh, MMG5_int *)
 
int MMG2D_boulet (MMG5_pMesh, MMG5_int, int8_t, MMG5_int *)
 
int MMG2D_bouleendp (MMG5_pMesh, MMG5_int, int8_t, MMG5_int *, MMG5_int *, MMG5_int *)
 
int MMG2D_savemesh_db (MMG5_pMesh, char *, int8_t)
 
int MMG2D_savemet_db (MMG5_pMesh, MMG5_pSol, char *, int8_t)
 
int MMG2D_chkswp (MMG5_pMesh, MMG5_pSol, MMG5_int, int8_t, int8_t)
 
int MMG2D_swapar (MMG5_pMesh, MMG5_int, int8_t)
 
int MMG5_interpmet22 (MMG5_pMesh, double *, double *, double, double *)
 
int MMG2D_intmet_iso (MMG5_pMesh, MMG5_pSol, MMG5_int, int8_t, MMG5_int, double)
 
int MMG2D_intmet_ani (MMG5_pMesh, MMG5_pSol, MMG5_int, int8_t, MMG5_int, double)
 
MMG5_int MMG2D_adpspl (MMG5_pMesh, MMG5_pSol)
 
int MMG2D_adpcol (MMG5_pMesh, MMG5_pSol)
 
MMG5_int MMG2D_movtri (MMG5_pMesh, MMG5_pSol, int, int8_t)
 
MMG5_int MMG2D_chkspl (MMG5_pMesh, MMG5_pSol, MMG5_int, int8_t)
 
int MMG2D_split1b (MMG5_pMesh, MMG5_int, int8_t, MMG5_int)
 
int MMG2D_movedgpt (MMG5_pMesh, MMG5_pSol, int, MMG5_int *, int8_t)
 
int MMG2D_movintpt (MMG5_pMesh, MMG5_pSol, int, MMG5_int *, int8_t)
 
int MMG2D_movintpt_ani (MMG5_pMesh, MMG5_pSol, int, MMG5_int *, int8_t)
 
int MMG2D_savenor_db (MMG5_pMesh, char *, int8_t)
 
int MMG2D_savedisp_db (MMG5_pMesh mesh, MMG5_pSol, char *, int8_t)
 
int MMG2D_velextLS (MMG5_pMesh, MMG5_pSol)
 
void MMG2D_keep_only1Subdomain (MMG5_pMesh mesh, int nsd)
 
MMG5_int MMG2D_indElt (MMG5_pMesh mesh, MMG5_int kel)
 
MMG5_int MMG2D_indPt (MMG5_pMesh mesh, MMG5_int kp)
 
int MMG2D_freeLocalPar (MMG5_pMesh)
 
int MMG2D_doSol_ani (MMG5_pMesh mesh, MMG5_pSol sol)
 
int MMG2D_doSol_iso (MMG5_pMesh mesh, MMG5_pSol sol)
 
double long_ani (double *ca, double *cb, double *ma, double *mb)
 
double long_iso (double *ca, double *cb, double *ma, double *mb)
 
double MMG2D_caltri_ani (MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pTria)
 
double MMG2D_caltri_iso (MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pTria)
 
int interp_ani (double *, double *, double *, double)
 
int interp_iso (double *, double *, double *, double)
 
int lissmet_iso (MMG5_pMesh mesh, MMG5_pSol sol)
 
int lissmet_ani (MMG5_pMesh mesh, MMG5_pSol sol)
 
int MMG2D_sum_reqEdgeLengthsAtPoint (MMG5_pMesh, MMG5_pSol, MMG5_pTria, int8_t)
 
int MMG2D_set_metricAtPointsOnReqEdges (MMG5_pMesh, MMG5_pSol, int8_t)
 

Variables

static const uint8_t MMG2D_idir_q [4][2] = { {0,1},{0,3},{1,2},{2,3} }
 idir[i]: vertices of edge i for a quad More...
 
static const int MMG2D_iare [3][2] = {{1,2},{2,0},{0,1}}
 
static const unsigned int MMG2D_idir [5] = {0,1,2,0,1}
 

Macro Definition Documentation

◆ M_LAMBDA

#define M_LAMBDA   0.34

Definition at line 48 of file libmmg2d_private.h.

◆ M_MAX

#define M_MAX (   a,
 
)    (((a) > (b)) ? (a) : (b))

Definition at line 45 of file libmmg2d_private.h.

◆ M_MIN

#define M_MIN (   a,
 
)    (((a) < (b)) ? (a) : (b))

Definition at line 46 of file libmmg2d_private.h.

◆ M_MU

#define M_MU   0.33

Definition at line 49 of file libmmg2d_private.h.

◆ MMG2D_ALPHA

#define MMG2D_ALPHA   0.28867513459

Definition at line 56 of file libmmg2d_private.h.

◆ MMG2D_ALPHAD

#define MMG2D_ALPHAD   3.464101615137755 /* 6.0 / sqrt(3.0) */

Definition at line 57 of file libmmg2d_private.h.

◆ MMG2D_ANGCORN

#define MMG2D_ANGCORN   -1.e-6

Definition at line 60 of file libmmg2d_private.h.

◆ MMG2D_BADKAL

#define MMG2D_BADKAL   0.2

Definition at line 58 of file libmmg2d_private.h.

◆ MMG2D_EPSA

#define MMG2D_EPSA   1.e-12

Definition at line 52 of file libmmg2d_private.h.

◆ MMG2D_EPSD

#define MMG2D_EPSD   1.e-10

Definition at line 51 of file libmmg2d_private.h.

◆ MMG2D_LLONG

#define MMG2D_LLONG   2.0

Definition at line 63 of file libmmg2d_private.h.

◆ MMG2D_LOPTL

#define MMG2D_LOPTL   1.4

Definition at line 65 of file libmmg2d_private.h.

◆ MMG2D_LOPTS

#define MMG2D_LOPTS   0.71

Definition at line 66 of file libmmg2d_private.h.

◆ MMG2D_LSHRT

#define MMG2D_LSHRT   0.3

Definition at line 64 of file libmmg2d_private.h.

◆ MMG2D_NEDMAX

#define MMG2D_NEDMAX   100000

Definition at line 69 of file libmmg2d_private.h.

◆ MMG2D_NEMAX

#define MMG2D_NEMAX   100000

Definition at line 70 of file libmmg2d_private.h.

◆ MMG2D_NPMAX

#define MMG2D_NPMAX   50000

Definition at line 68 of file libmmg2d_private.h.

◆ MMG2D_NULKAL

#define MMG2D_NULKAL   1.e-6

Definition at line 59 of file libmmg2d_private.h.

◆ MMG2D_POINT_REALLOC

#define MMG2D_POINT_REALLOC (   mesh,
  sol,
  ip,
  wantedGap,
  law,
  o,
  tag 
)
Value:
do \
{ \
MMG5_int klink; \
\
assert ( mesh && mesh->point ); \
MMG5_TAB_RECALLOC(mesh,mesh->point,mesh->npmax,wantedGap,MMG5_Point, \
"larger point table",law); \
\
mesh->npnil = mesh->np+1; \
for (klink=mesh->npnil; klink<mesh->npmax-1; klink++) \
mesh->point[klink].tmp = klink+1; \
\
/* solution */ \
if ( sol ) { \
if ( sol->m ) { \
MMG5_ADD_MEM(mesh,(sol->size*(mesh->npmax-sol->npmax))*sizeof(double), \
"larger solution",law); \
MMG5_SAFE_REALLOC(sol->m,sol->size*(sol->npmax+1), \
sol->size*(mesh->npmax+1), \
double,"larger solution",law); \
} \
} \
\
/* We try again to add the point */ \
ip = MMG2D_newPt(mesh,o,tag); \
if ( !ip ) {law;} \
}while(0)
MMG5_pMesh MMG5_pSol * sol
MMG5_pMesh * mesh
MMG5_int MMG2D_newPt(MMG5_pMesh mesh, double c[2], int16_t tag)
Definition: zaldy_2d.c:38
MMG5_pPoint point
Definition: libmmgtypes.h:641
MMG5_int npmax
Definition: libmmgtypes.h:612
MMG5_int np
Definition: libmmgtypes.h:612
MMG5_int npnil
Definition: libmmgtypes.h:621
Structure to store points of a MMG mesh.
Definition: libmmgtypes.h:270
MMG5_int tmp
Definition: libmmgtypes.h:280

Reallocation of point table and sol table and creation of point ip with coordinates o and tag tag

Definition at line 117 of file libmmg2d_private.h.

◆ MMG2D_PRECI

#define MMG2D_PRECI   1.

Definition at line 54 of file libmmg2d_private.h.

◆ MMG2D_RETURN_AND_FREE

#define MMG2D_RETURN_AND_FREE (   mesh,
  met,
  ls,
  disp,
  val 
)
Value:
do \
{ \
MMG5_ARG_end) ) { \
return MMG5_LOWFAILURE; \
} \
return val; \
}while(0)
int MMG2D_Free_all(const int starter,...)
#define MMG5_ARG_ppMesh
Definition: libmmgtypes.h:96
#define MMG5_ARG_end
Definition: libmmgtypes.h:173
#define MMG5_ARG_ppLs
Definition: libmmgtypes.h:106
#define MMG5_LOWFAILURE
Definition: libmmgtypes.h:51
#define MMG5_ARG_ppDisp
Definition: libmmgtypes.h:126
#define MMG5_ARG_start
Definition: libmmgtypes.h:87
#define MMG5_ARG_ppMet
Definition: libmmgtypes.h:116

Free allocated pointers of mesh and sol structure and return value val

Definition at line 76 of file libmmg2d_private.h.

◆ MMG2D_SHORTMAX

#define MMG2D_SHORTMAX   0x7fff

Definition at line 61 of file libmmg2d_private.h.

◆ MMG2D_SIZE

#define MMG2D_SIZE   0.75

Definition at line 55 of file libmmg2d_private.h.

◆ MMG2D_TRIA_REALLOC

#define MMG2D_TRIA_REALLOC (   mesh,
  jel,
  wantedGap,
  law 
)

Reallocation of tria table and creation of tria jel

Definition at line 148 of file libmmg2d_private.h.

Function Documentation

◆ interp_ani()

int interp_ani ( double *  ,
double *  ,
double *  ,
double   
)

◆ interp_iso()

int interp_iso ( double *  ,
double *  ,
double *  ,
double   
)

◆ lissmet_ani()

int lissmet_ani ( MMG5_pMesh  mesh,
MMG5_pSol  sol 
)
Parameters
meshpointer toward the mesh
solpointer toward the metric
Returns
0 if fail, 1 if success

Anisotropic gradation (h-gradation procedure). See: [1]. The Hc-correction method is used (gradation with respect to H-shock measure). Skip edges with a required extremity (treated in lissmetreq_ani).

Definition at line 47 of file lissmet_2d.c.

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

◆ lissmet_iso()

int lissmet_iso ( MMG5_pMesh  mesh,
MMG5_pSol  sol 
)

◆ long_ani()

double long_ani ( double *  ca,
double *  cb,
double *  ma,
double *  mb 
)

Definition at line 47 of file length_2d.c.

◆ long_iso()

double long_iso ( double *  ca,
double *  cb,
double *  ma,
double *  mb 
)

Definition at line 27 of file length_2d.c.

◆ MMG2D_2dMeshCheck()

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

Check mesh data for a Msh mesh : mark the vertices as used if no triangles in the mesh (mesh generation) and check that all z-componants are 0.

Definition at line 674 of file inout_2d.c.

Here is the caller graph for this function:

◆ MMG2D_adpcol()

int MMG2D_adpcol ( MMG5_pMesh  mesh,
MMG5_pSol  met 
)

Definition at line 696 of file mmg2d1.c.

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

◆ MMG2D_adpspl()

MMG5_int MMG2D_adpspl ( MMG5_pMesh  mesh,
MMG5_pSol  met 
)
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
Returns
-1 if failed or number of new points.

Analysis and splitting routine for edges in the final step of the algorithm; edges are only splitted on a one-by-one basis

Definition at line 640 of file mmg2d1.c.

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

◆ MMG2D_adptri()

int MMG2D_adptri ( MMG5_pMesh  mesh,
MMG5_pSol  met 
)

Definition at line 550 of file mmg2d1.c.

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

◆ MMG2D_anaelt()

MMG5_int MMG2D_anaelt ( MMG5_pMesh  mesh,
MMG5_pSol  met,
int  typchk 
)

Definition at line 111 of file mmg2d1.c.

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

◆ MMG2D_analys()

int MMG2D_analys ( MMG5_pMesh  mesh)

preprocessing stage: mesh analysis

Warning
possible time improvment here: in lssurf mode, the second call of MMG2D_setadj only adds BDY tag to points that have been inserted by the level-set splitting (the rest of the job of setadj has alredy be done by the first call).

Definition at line 1010 of file analys_2d.c.

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

◆ MMG2D_anatri()

int MMG2D_anatri ( MMG5_pMesh  mesh,
MMG5_pSol  met,
int8_t  typchk 
)

Definition at line 40 of file mmg2d1.c.

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

◆ 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_baseBdry()

int MMG2D_baseBdry ( MMG5_pMesh  mesh)

◆ 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_bdryenforcement()

int MMG2D_bdryenforcement ( MMG5_pMesh  mesh,
MMG5_pSol  sol 
)
Parameters
meshpointer toward the mesh structure.
solpointer toward the sol structure.
Returns
0 if fail, 1 otherwise.

Check if all edges exist in the mesh and if not force them.

Now treat the missing edges

Definition at line 34 of file enforcement_2d.c.

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

◆ MMG2D_bezierCurv()

int MMG2D_bezierCurv ( MMG5_pMesh  mesh,
MMG5_int  k,
int8_t  i,
double  s,
double *  o,
double *  no 
)

Definition at line 185 of file bezier_2d.c.

Here is the caller graph for this function:

◆ MMG2D_bouleendp()

int MMG2D_bouleendp ( MMG5_pMesh  mesh,
MMG5_int  start,
int8_t  ip,
MMG5_int *  ip1,
MMG5_int *  ip2,
MMG5_int *  list 
)
Parameters
meshpointer toward the mesh structure.
startindex of triangle to start.
ipindex of point for wich we compute the ball.
Returns
1 if success, 0 if fail.

Find the two endpoints of the boundary curves joining ip, fill ip1 and ip2 with their indices and list neighbouring triangles

Definition at line 231 of file boulep_2d.c.

Here is the caller graph for this function:

◆ MMG2D_boulen()

int MMG2D_boulen ( MMG5_pMesh  mesh,
MMG5_int  start,
int8_t  ip,
MMG5_int *  pleft,
MMG5_int *  pright,
double *  nn 
)
Parameters
meshpointer toward the mesh
startindex of the first tria
iplocal index of the point on which we work in tria start
pleftindex of the left point of ip along the geom edge (local index of the point inside a triangle)
prightindex of the right point of ip along the geom edge (local index of the point inside a triangle)
nncomputed normal at ip
Returns
0 if fail, 1 if success

Travel the ball of point ip in triangle start, which is assumed to lie either on the external or on an internal boundary of the mesh, and return the normal vector convention: the normal vector is oriented from the half ball it starts with towards its exterior return pright = 3*kk+ii, where kk = last triangle in the first travel, and ii = local index of ip in kk pleft = 3*kk+ii, where kk = last triangle in the second travel, and ii = local index of ip in kk.

Definition at line 115 of file boulep_2d.c.

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

◆ MMG2D_boulep()

int MMG2D_boulep ( MMG5_pMesh  mesh,
MMG5_int  ifirst,
int  iploc,
MMG5_int *  list 
)

Definition at line 36 of file boulep_2d.c.

Here is the caller graph for this function:

◆ MMG2D_boulet()

int MMG2D_boulet ( MMG5_pMesh  ,
MMG5_int  ,
int8_t  ,
MMG5_int *   
)

◆ MMG2D_caltri_ani()

double MMG2D_caltri_ani ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
MMG5_pTria  pt 
)

Definition at line 121 of file quality_2d.c.

Here is the caller graph for this function:

◆ MMG2D_caltri_iso()

double MMG2D_caltri_iso ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_pTria  pt 
)
Parameters
pointertoward the mesh
pointertoward the metric (for compatibility with aniso interface)
ptpointer toward the tria
Returns
non-normalized quality if success, 0 if triangle is null or inverted.

Compute quality of the triangle pt when the supplied metric is isotropic; return 0 in the case that the triangle has inverted orientation.

Definition at line 107 of file quality_2d.c.

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

◆ MMG2D_caltri_iso_3pt()

double MMG2D_caltri_iso_3pt ( double *  a,
double *  b,
double *  c 
)
Parameters
acoordinates of first vertex of tria
bcoordinates of second vertex of tria
ccoordinates of third vertex of tria
Returns
non-normalized quality if success, 0 if triangle is null or inverted.

Compute quality of a triangle from the datum of its 3 vertices.

Definition at line 68 of file quality_2d.c.

Here is the caller graph for this function:

◆ MMG2D_cavity()

int MMG2D_cavity ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
MMG5_int  ip,
MMG5_int *  list 
)

Create the cavity point ip, starting from triangle list[0]; Return a negative value for ilist if one of the triangles of the cavity is required

Definition at line 149 of file delone_2d.c.

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

◆ MMG2D_cenrad_iso()

int MMG2D_cenrad_iso ( MMG5_pMesh  mesh,
double *  ct,
double *  c,
double *  rad 
)
Parameters
meshPointer toward the mesh structure.
*ctcoordinates of vertices of the element.
*ccenter of circumscribing circle to the element.
*radradius of circumscribing circle to the element.
Returns
0 if failed, 1 otherwise.

Compute radius and center of circumscribing circle to the element.

Definition at line 42 of file cenrad_2d.c.

Here is the caller graph for this function:

◆ MMG2D_chkcol()

int MMG2D_chkcol ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_int  k,
int8_t  i,
MMG5_int *  list,
int8_t  typchk 
)
Parameters
meshpointer toward the mesh
metpointer toward the metric
ktriangle index
ilocal index of the edge that we want to test in the triangle k
listedge's shell (to fill)
typchktype eof check to perform.
Returns
1 if we must collapse, 0 otherwise

Check whether the validity and the geometry of the mesh are preserved when collapsing edge i (p1->p2)

Definition at line 42 of file colver_2d.c.

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

◆ MMG2D_chkedg()

int MMG2D_chkedg ( MMG5_pMesh  mesh,
MMG5_int  k 
)

Definition at line 28 of file bezier_2d.c.

Here is the caller graph for this function:

◆ MMG2D_chkspl()

MMG5_int MMG2D_chkspl ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_int  k,
int8_t  i 
)
Parameters
meshpointer toward the mesh
metpointer toward the metric
ktriangle index
ilocal index of the edge to split
Returns
1 if we can split, 0 if not, -1 if fail.

Check whether splitting of edge i in tria k is possible and return the newly created point; possibly perform a dichotomy to find the latest valid position for the point.

Definition at line 51 of file split_2d.c.

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

◆ MMG2D_chkswp()

int MMG2D_chkswp ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_int  k,
int8_t  i,
int8_t  typchk 
)

Definition at line 128 of file swapar_2d.c.

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

◆ MMG2D_colelt()

MMG5_int MMG2D_colelt ( MMG5_pMesh  mesh,
MMG5_pSol  met,
int  typchk 
)

Definition at line 437 of file mmg2d1.c.

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

◆ MMG2D_colver()

int MMG2D_colver ( MMG5_pMesh  mesh,
int  ilist,
MMG5_int *  list 
)

Definition at line 273 of file colver_2d.c.

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

◆ MMG2D_colver2()

int MMG2D_colver2 ( MMG5_pMesh  mesh,
MMG5_int *  list 
)

Definition at line 421 of file colver_2d.c.

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

◆ MMG2D_colver3()

int MMG2D_colver3 ( MMG5_pMesh  mesh,
MMG5_int *  list 
)

Definition at line 359 of file colver_2d.c.

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

◆ MMG2D_coorbary()

int MMG2D_coorbary ( MMG5_pMesh  mesh,
MMG5_pTria  pt,
double  c[2],
double *  det,
double *  l1,
double *  l2 
)

Definition at line 37 of file locate_2d.c.

Here is the caller graph for this function:

◆ MMG2D_cutEdge()

int MMG2D_cutEdge ( MMG5_pMesh  mesh,
MMG5_pTria  pt,
MMG5_pPoint  ppa,
MMG5_pPoint  ppb 
)

Definition at line 90 of file locate_2d.c.

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

◆ MMG2D_cutEdgeTriangle()

int MMG2D_cutEdgeTriangle ( MMG5_pMesh  mesh,
MMG5_int  k,
MMG5_int  ia,
MMG5_int  ib 
)

Definition at line 129 of file locate_2d.c.

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

◆ MMG2D_cuttri()

int MMG2D_cuttri ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
MMG5_pSol  met 
)
Parameters
meshpointer toward the mesh
solpointer toward the level-set
metpointer toward a metric (non-mandatory)
Returns
1 if success, 0 otherwise

Effective discretization of the 0 level set encoded in sol in the mesh. Only the boundary part of the domain is discretized if mesh->info.isosurf is 1.

Definition at line 48 of file mmg2d6.c.

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

◆ MMG2D_defaultmet_2d()

int MMG2D_defaultmet_2d ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_int  k,
int8_t  i 
)
Parameters
meshpointer toward the mesh
metpointer toward the metric
kelt index
ivertex index in triangle k
Returns
0 if fail, 1 if success

Impose default metric (isotropic, with size hmax) at vertex i in triangle k (don't take into account the local parameters). Set the point flag to 1 to be able to truncate it with the local params later.

Definition at line 51 of file anisosiz_2d.c.

Here is the caller graph for this function:

◆ MMG2D_defmetbdy_2d()

int MMG2D_defmetbdy_2d ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_int  k,
int8_t  i 
)
Parameters
meshpointer toward the mesh
metpointer toward the metric
kindex of the tria in which we work
iindex of the point on which we want to compute the metric
Returns
1 if success, 0 if fail

Calculate anisotropic metric tensor at (boundary) vertex i in triangle k on account of geometric approximation of the corresponding curve (taking into account the local parameters). Set the point flag to 2 to ignore it whem imposing the local parameters later.

Definition at line 86 of file anisosiz_2d.c.

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

◆ MMG2D_defsiz_ani()

int MMG2D_defsiz_ani ( MMG5_pMesh  mesh,
MMG5_pSol  met 
)
Parameters
meshpointer toward the mesh
metpointer toward the metric
Returns
0 if fail, 1 if success

Definition of an anisotropic metric tensor field based on the geometry of the domain; this tensor field is intersected by a user-defined tensor field

Step 1: Set metric at points belonging to a required edge: compute the metric as the mean of the length of the required eges passing through the point

For points with flag 1 (metrec computed by defaultmet_2d), truncation by the local parameters

Definition at line 363 of file anisosiz_2d.c.

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

◆ MMG2D_defsiz_iso()

int MMG2D_defsiz_iso ( MMG5_pMesh  mesh,
MMG5_pSol  met 
)
Parameters
meshpointer toward the mesh
metpointer toward the metric
Returns
0 if fail, 1 otherwise

New version for the definition of a size map; takes into account the curvature of the external and internal curves present in the mesh

1) Size at internal points

Step 1: Set metric at points belonging to a required edge: compute the metric as the mean of the length of the required eges passing through the point

Step 2: size at non required internal points

Step 3: Minimum size feature imposed by the boundary edges

If local parameters are provided: size truncation on the entire mesh

Definition at line 133 of file isosiz_2d.c.

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

◆ MMG2D_delElt()

int MMG2D_delElt ( MMG5_pMesh  mesh,
MMG5_int  iel 
)

Definition at line 105 of file zaldy_2d.c.

Here is the caller graph for this function:

◆ MMG2D_delone()

int MMG2D_delone ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
MMG5_int  ip,
MMG5_int *  list,
int  ilist 
)
Parameters
meshpointer toward the mesh
solpointer toward the solution (metric) structure
ipindex of point to insert
listCavity of the point ip.
ilistnumber of trias in the cavity of ip.
Returns
0 if the point can't be inserted, -1 if lack of memory, 1 if success.

Insertion in point ip in the cavity described by list.

Definition at line 251 of file delone_2d.c.

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

◆ MMG2D_delPt()

void MMG2D_delPt ( MMG5_pMesh  mesh,
MMG5_int  ip 
)

Definition at line 57 of file zaldy_2d.c.

Here is the caller graph for this function:

◆ MMG2D_dichoto()

int MMG2D_dichoto ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_int  k,
MMG5_int *  vx 
)
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
kelement index.
vxpointer toward table of edges to split.
Returns
1.

Find acceptable position for splitting.

Definition at line 360 of file mmg2d1.c.

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

◆ MMG2D_doSol_ani()

int MMG2D_doSol_ani ( MMG5_pMesh  mesh,
MMG5_pSol  sol 
)
Parameters
meshpointer toward the mesh structure
solpointer toward the sol structure
Returns
1 if success

Compute anisotropic unit size map using statistical concept of length distribution tensors (formula 5 of [2]).

Definition at line 175 of file solmap_2d.c.

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

◆ MMG2D_doSol_iso()

int MMG2D_doSol_iso ( MMG5_pMesh  mesh,
MMG5_pSol  sol 
)
Parameters
meshpointer toward the mesh structure
solpointer 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.

Definition at line 97 of file solmap_2d.c.

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

◆ MMG2D_excfun()

static void MMG2D_excfun ( int  sigid)
inlinestatic
Parameters
sigidsignal number.

Signal handling: specify error messages depending from catched signal.

Definition at line 94 of file libmmg2d_private.h.

Here is the caller graph for this function:

◆ MMG2D_findTria()

MMG5_int MMG2D_findTria ( MMG5_pMesh  mesh,
MMG5_int  ip 
)
Parameters
meshpointer toward mesh
ippoint index
Returns
index of one elt containing k or 0 (if no elt is found)

Return the index of one triangle containing k.

Definition at line 221 of file locate_2d.c.

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

◆ MMG2D_findtrianglestate()

MMG5_int MMG2D_findtrianglestate ( MMG5_pMesh  mesh,
MMG5_int  k,
MMG5_int  ip1,
MMG5_int  ip2,
MMG5_int  ip3,
MMG5_int  ip4,
MMG5_int  base 
)

Definition at line 133 of file mmg2d2.c.

Here is the caller graph for this function:

◆ MMG2D_Free_all_var()

int MMG2D_Free_all_var ( va_list  argptr)
Parameters
argptrlist of the mmg structures that must be deallocated. Each structure must follow one of the MMG5_ARG preprocessor variable that allow to identify it.

argptr contains at least a pointer toward a MMG5_pMesh structure (that will contain the mesh and identified by the MMG5_ARG_ppMesh keyword)

To call the MMG2D_mmg2dlib function, you must also provide a pointer toward a MMG5_pSol structure (that will contain the ouput metric (and the input one, if provided) and identified by the MMG5_ARG_ppMet keyword).

To call the MMG2D_mmg2dls function, you must also provide a pointer toward a MMG5_pSol structure (that will contain the level-set function and identified by the MMG5_ARG_ppLs keyword).

To call the MMG2D_mmg2dmov library, you must also provide a pointer toward a MMG5_pSol structure storing the displacement (and identified by the MMG5_ARG_ppDisp keyword).

Returns
0 if fail, 1 if success

Internal function for deallocations before return (taking a va_list as argument).

Remarks
we pass the structures by reference in order to have argument compatibility between the library call from a Fortran code and a C code.

Definition at line 259 of file variadic_2d.c.

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

◆ MMG2D_Free_names_var()

int MMG2D_Free_names_var ( va_list  argptr)
Parameters
argptrlist of the mmg structures for whose we want to deallocate the name. Each structure must follow one of the MMG5_ARG* preprocessor variable that allow to identify it. argptr contains at least a pointer toward a MMG5_pMesh structure (that will contain the mesh and identified by the MMG5_ARG_ppMesh keyword) and a pointer toward a MMG5_pSol structure (that will contain the ouput metric (and the input one, if provided) and identified by the MMG5_ARG_ppMet keyword).

Internal function for name deallocations before return (taking a va_list as argument).

Returns
0 if fail, 1 if success
Remarks
we pass the structures by reference in order to have argument compatibility between the library call from a Fortran code and a C code.

Definition at line 483 of file variadic_2d.c.

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

◆ MMG2D_Free_structures_var()

int MMG2D_Free_structures_var ( va_list  argptr)
Parameters
argptrlist of the mmg structures that must be deallocated. Each structure must follow one of the MMG5_ARG* preprocessor variable that allow to identify it. argptr contains at least a pointer toward a MMG5_pMesh structure (that will contain the mesh and identified by the MMG5_ARG_ppMesh keyword) and a pointer toward a MMG5_pSol structure (that will contain the ouput metric (and the input one, if provided) and identified by the MMG5_ARG_ppMet keyword).

To call the MMG2D_mmg2dls function, you must also provide a pointer toward a MMG5_pSol structure (that will contain the level-set function and identified by the MMG5_ARG_ppLs keyword).

To call the MMG2D_mmg2dmov library, you must also provide a pointer toward a MMG5_pSol structure storing the displacement (and identified by the MMG5_ARG_ppDisp keyword).

Returns
1 if success, 0 if fail

Internal function for structures deallocations before return (taking a va_list as argument).

Remarks
we pass the structures by reference in order to have argument compatibility between the library call from a Fortran code and a C code.

Definition at line 368 of file variadic_2d.c.

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

◆ MMG2D_freeLocalPar()

int MMG2D_freeLocalPar ( MMG5_pMesh  mesh)

Definition at line 629 of file libmmg2d_tools.c.

◆ MMG2D_grad2met_ani()

MMG5_int MMG2D_grad2met_ani ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_pTria  pt,
MMG5_int  np1,
MMG5_int  np2 
)
Parameters
meshpointer toward the mesh
metpointer toward the metric
ptpointer toward the processed triangle.
np1first edge extremity (global index)
np2second edge extremity (global index)
Returns
0 if fail or we don't need to modify the sizes. ier, where (ier & 1) if metric of ip1 is altered, and (ier & 2) if metric of ip2 is altered.

Perform simultaneous reduction of metrics at ip1 points and ip2, and truncate characteristic sizes so that the difference between two corresponding sizes respect the maximal gradation.

Ref : https://www.rocq.inria.fr/gamma/Frederic.Alauzet/cours/cea2010_V2.pdf

Definition at line 537 of file anisosiz_2d.c.

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

◆ MMG2D_grad2metreq_ani()

int MMG2D_grad2metreq_ani ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_pTria  pt,
MMG5_int  npmaster,
MMG5_int  npslave 
)
Parameters
meshpointer toward the mesh
metpointer toward the metric
ptpointer toward the processed tria.
npmasteredge extremity that cannot be modified
npslaveedge extremity to modify to respect the gradation.
Returns
0 if fail or we don't need to update the size of ipslave, 1 if its size has been updated.

Perform simultaneous reduction of metrics at npmaster points and npslave, and modify the characteristic size of npslave so that the difference between the two sizes respect the maximal gradation

Ref : https://www.rocq.inria.fr/gamma/Frederic.Alauzet/cours/cea2010_V2.pdf

Definition at line 600 of file anisosiz_2d.c.

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

◆ MMG2D_gradsiz_ani()

int MMG2D_gradsiz_ani ( MMG5_pMesh  ,
MMG5_pSol   
)

◆ MMG2D_gradsizreq_ani()

int MMG2D_gradsizreq_ani ( MMG5_pMesh  ,
MMG5_pSol   
)

◆ 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_indElt()

MMG5_int MMG2D_indElt ( MMG5_pMesh  mesh,
MMG5_int  kel 
)
Parameters
meshpointer toward the mesh structure.
kelindex of the element in the unpacked mesh
Returns
0 if fail, index of the element in packed numerotation otherwise.

find the element index in packed numerotation

Definition at line 46 of file tools_2d.c.

Here is the caller graph for this function:

◆ MMG2D_indPt()

MMG5_int MMG2D_indPt ( MMG5_pMesh  mesh,
MMG5_int  kp 
)
Parameters
meshpointer toward the mesh structure.
kpindex of the point in the unpacked mesh
Returns
0 if fail, index of the point in packed numerotation otherwise.

find the point index in packed numerotation

Definition at line 70 of file tools_2d.c.

Here is the caller graph for this function:

◆ MMG2D_Init_mesh_var()

int MMG2D_Init_mesh_var ( va_list  argptr)
Parameters
argptrlist of the mmg structures that must be initialized. Each structure must follow one of the MMG5_ARG* preprocessor variable that allow to identify it.

argptr contains at least a pointer toward a MMG5_pMesh structure (that will contain the mesh and identified by the MMG5_ARG_ppMesh keyword)

To call the MMG2D_mmg2dlib function, you must also provide a pointer toward a MMG5_pSol structure (that will contain the ouput metric (and the input one, if provided) and identified by the MMG5_ARG_ppMet keyword).

To call the MMG2D_mmg2dls function, you must also provide a pointer toward a MMG5_pSol structure (that will contain the level-set function and identified by the MMG5_ARG_ppLs keyword).

To call the MMG2D_mmg2dmov library, you must also provide a pointer toward a MMG5_pSol structure storing the displacement (and identified by the MMG5_ARG_ppDisp keyword).

Returns
0 if fail, 1 otherwise

Internal function for structure allocations (taking a va_list argument).

Definition at line 176 of file variadic_2d.c.

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

◆ MMG2D_intmet_ani()

int MMG2D_intmet_ani ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_int  k,
int8_t  i,
MMG5_int  ip,
double  s 
)

Definition at line 209 of file intmet_2d.c.

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

◆ MMG2D_intmet_iso()

int MMG2D_intmet_iso ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_int  k,
int8_t  i,
MMG5_int  ip,
double  s 
)

Definition at line 38 of file intmet_2d.c.

Here is the caller graph for this function:

◆ MMG2D_isInTriangle()

MMG5_int MMG2D_isInTriangle ( MMG5_pMesh  mesh,
MMG5_int  k,
double  c[2] 
)

Check whether c lies in triangle k; return k if so, 0 otherwise

Definition at line 69 of file locate_2d.c.

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

◆ MMG2D_keep_only1Subdomain()

void MMG2D_keep_only1Subdomain ( MMG5_pMesh  mesh,
int  nsd 
)
Parameters
meshpointer toward the mesh structure.
nsdindex of subdomain to keep.

Keep only subdomain of index nsd and remove other subdomains.

Definition at line 92 of file tools_2d.c.

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

◆ MMG2D_lencurv_ani()

double MMG2D_lencurv_ani ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_int  ip1,
MMG5_int  ip2 
)

Definition at line 82 of file length_2d.c.

Here is the caller graph for this function:

◆ MMG2D_lencurv_iso()

double MMG2D_lencurv_iso ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_int  ip1,
MMG5_int  ip2 
)

Calculate length of a curve in the considered isotropic metric

Definition at line 63 of file length_2d.c.

Here is the caller graph for this function:

◆ MMG2D_locateEdge()

int MMG2D_locateEdge ( MMG5_pMesh  mesh,
MMG5_int  ia,
MMG5_int  ib,
MMG5_int *  kdep,
MMG5_int *  list 
)
Parameters
meshpointer toward the mesh
iaindex of first extremity of the edge
ibindex of second extremity of the edge
kdeppointer toward the index of the first element intersecting the edge
listpointer toward the list of elts intersected by the edge
Returns
4 if the edge exist in the mesh, 0 if fail, ??? otherwise

Calculate the list of all the triangles intersected by edge (ia,ib), starting from kdep = one triangle in the ball of ia; list starts at index 0 (and ends at index lon-1). It stores 3*k + iare, where k is an intersected tria and iare is an intersected edge.

prod1, prod2 and prod3 allow to localize the edge regarding the tria:

  • if all are >0, the edge doesn't cross the tria (same sign for all areas)
  • if 2 are negative and 1 is positive, the edge intersect 2 triangle edges
  • if 2 are 0, the edge pass through 1 of the tria vertices
  • if 3 are 0, the edge coincide with 1 of the tria edges

ia-ib intersect 2 triangle edges => 2 products are <0, 1 is >0

Definition at line 329 of file locate_2d.c.

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

◆ MMG2D_memOption()

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

memory repartition for the -m option

Definition at line 233 of file zaldy_2d.c.

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

◆ MMG2D_mmg2d1()

int MMG2D_mmg2d1 ( MMG5_pMesh  ,
MMG5_pSol   
)

◆ MMG2D_mmg2d1n()

int MMG2D_mmg2d1n ( MMG5_pMesh  mesh,
MMG5_pSol  met 
)
Parameters
meshpointer toward the mesh structure.
solpointer toward the sol structure.
Returns
1 if success, 0 if strongly fail.

Mesh adaptation – new version of mmg2d1.c

Definition at line 819 of file mmg2d1.c.

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

◆ MMG2D_mmg2d2()

int MMG2D_mmg2d2 ( MMG5_pMesh  mesh,
MMG5_pSol  sol 
)
Parameters
meshpointer toward the mesh structure.
solpointer toward the sol structure.
Returns
0 if fail, 1 if success.

Mesh triangulation.

Definition at line 508 of file mmg2d2.c.

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

◆ MMG2D_mmg2d6()

int MMG2D_mmg2d6 ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
MMG5_pSol  met 
)

Definition at line 204 of file mmg2d6.c.

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

◆ MMG2D_mmg2d9()

int MMG2D_mmg2d9 ( MMG5_pMesh  mesh,
MMG5_pSol  disp,
MMG5_pSol  met,
MMG5_int **  invalidTrias 
)
Parameters
meshmesh structure
dispdisplacement structure
metmetric structure
invalidTriasarray to store the list of invalid tria if we are unable to move
Returns
0 if fail, 1 if success to move, the opposite of the number of non valid trias if we can't move (-ninvalidTrias).

Lagrangian node displacement and meshing. Code for options: info.lag >= 0 -> displacement, info.lag > 0 -> displacement+remeshing with swap and moves info.lag > 1 -> displacement+remeshing with split+collapse+swap+move

Definition at line 459 of file mmg2d9.c.

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

◆ MMG2D_movedgpt()

int MMG2D_movedgpt ( MMG5_pMesh  mesh,
MMG5_pSol  met,
int  ilist,
MMG5_int *  list,
int8_t  improve 
)
Parameters
meshpointer toward the mesh
metpointer toward the metric structure.
listpointer toward the ball of the point.
ilistsize of the ball.
improveforce the new minimum element quality to be greater or equal than 0.9 of the old minimum element quality.
Returns
0 if we can't move the point (or if we fail), 1 if we can.

Relocate boundary vertex whose ball is passed; routine works both in the isotropic and anisotropic case

Definition at line 53 of file movpt_2d.c.

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

◆ MMG2D_movintpt()

int MMG2D_movintpt ( MMG5_pMesh  mesh,
MMG5_pSol  met,
int  ilist,
MMG5_int *  list,
int8_t  improve 
)
Parameters
meshpointer toward the mesh
metpointer toward the metric structure.
listpointer toward the ball of the point.
ilistsize of the ball.
improveforce the new minimum element quality to be greater or equal than 0.9 of the old minimum element quality.
Returns
0 if we can't move the point (or if we fail), 1 if we can.

Relocate internal vertex whose ball is passed.

Definition at line 213 of file movpt_2d.c.

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

◆ MMG2D_movintpt_ani()

int MMG2D_movintpt_ani ( MMG5_pMesh  mesh,
MMG5_pSol  met,
int  ilist,
MMG5_int *  list,
int8_t  improve 
)

Definition at line 38 of file anisomovpt_2d.c.

Here is the caller graph for this function:

◆ MMG2D_movtri()

MMG5_int MMG2D_movtri ( MMG5_pMesh  mesh,
MMG5_pSol  met,
int  maxit,
int8_t  improve 
)

Definition at line 755 of file mmg2d1.c.

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

◆ MMG2D_newElt()

MMG5_int MMG2D_newElt ( MMG5_pMesh  mesh)

Definition at line 85 of file zaldy_2d.c.

Here is the caller graph for this function:

◆ MMG2D_newPt()

MMG5_int MMG2D_newPt ( MMG5_pMesh  mesh,
double  c[2],
int16_t  tag 
)

Definition at line 38 of file zaldy_2d.c.

Here is the caller graph for this function:

◆ MMG2D_norver()

int MMG2D_norver ( MMG5_pMesh  mesh,
MMG5_int  ref 
)
Parameters
meshpointer toward the mesh structure
refreference of the boundary to analyze (analyze all the boundaries if MMG5_UNSET)
Returns
1 if success, 0 if fail.

Calculate normal vectors at vertices of the mesh.

Mark the points that we don't want to analyze

Definition at line 410 of file analys_2d.c.

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

◆ MMG2D_outqua()

int MMG2D_outqua ( MMG5_pMesh  mesh,
MMG5_pSol  met 
)
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
Returns
0 if the worst element has a nul quality, 1 otherwise.

Print histogram of mesh qualities.

Definition at line 183 of file quality_2d.c.

Here is the call graph for this function:
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:

◆ MMG2D_prilen()

int MMG2D_prilen ( MMG5_pMesh  mesh,
MMG5_pSol  sol 
)

Definition at line 125 of file length_2d.c.

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

◆ MMG2D_quickcal()

double MMG2D_quickcal ( MMG5_pMesh  mesh,
MMG5_pTria  pt 
)
Parameters
meshpointer toward the mesh
ptpointer toward the tria
Returns
the oriented area of the triangle.

Compute oriented area of tria pt

Definition at line 46 of file quality_2d.c.

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

◆ MMG2D_regnor()

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

Regularize normal vectors at boundary non singular edges with a Laplacian / antilaplacian smoothing

Definition at line 515 of file analys_2d.c.

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

◆ MMG2D_regver()

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

Regularize vertices coordinates at boundary non singular edges with a Laplacian / antilaplacian smoothing

Definition at line 849 of file analys_2d.c.

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

◆ MMG2D_savedisp_db()

int MMG2D_savedisp_db ( MMG5_pMesh  mesh,
MMG5_pSol  disp,
char *  filename,
int8_t  pack 
)

Definition at line 1984 of file inout_2d.c.

◆ MMG2D_savemesh_db()

int MMG2D_savemesh_db ( MMG5_pMesh  mesh,
char *  filename,
int8_t  pack 
)

Definition at line 1776 of file inout_2d.c.

◆ MMG2D_savemet_db()

int MMG2D_savemet_db ( MMG5_pMesh  mesh,
MMG5_pSol  met,
char *  filename,
int8_t  pack 
)

Definition at line 1869 of file inout_2d.c.

◆ MMG2D_savenor_db()

int MMG2D_savenor_db ( MMG5_pMesh  mesh,
char *  filename,
int8_t  pack 
)

Definition at line 1929 of file inout_2d.c.

◆ MMG2D_set_metricAtPointsOnReqEdges()

int MMG2D_set_metricAtPointsOnReqEdges ( MMG5_pMesh  mesh,
MMG5_pSol  met,
int8_t  ismet 
)
Parameters
meshpointer toward the mesh
metpointer toward the metric
ismet1 if user provided metric
Returns
0 if fail, 1 otherwise

Compute the metric at points on required edges as the mean of the lengths of the required eges to which belongs the point. The processeed points are marked with flag 3.

Definition at line 77 of file isosiz_2d.c.

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

◆ MMG2D_setadj()

int MMG2D_setadj ( MMG5_pMesh  mesh,
int8_t  init_cc 
)
Parameters
meshpointer toward the mesh
init_cc1 if we need to reinitialized cc field of tria because setadj has already been called (isosurf mode)
Returns
1 if success, 0 if fail

Set tags GEO, BDY and REF to triangles and points by traveling the mesh; count number of subdomains or connected components

Step 1: Tags setting from triangles analysis

Step 2: Mark the edges at interface between tria and quads as nosurf and required

Definition at line 50 of file analys_2d.c.

Here is the caller graph for this function:

◆ MMG2D_setMeshSize_alloc()

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

Allocation of the array fields of the mesh.

Definition at line 252 of file zaldy_2d.c.

Here is the caller graph for this function:

◆ MMG2D_settagtriangles()

int MMG2D_settagtriangles ( MMG5_pMesh  mesh,
MMG5_pSol  sol 
)

Definition at line 100 of file mmg2d2.c.

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

◆ MMG2D_singul()

int MMG2D_singul ( MMG5_pMesh  mesh,
MMG5_int  ref 
)
Parameters
meshpointer toward the mesh structure
refreference of the boundary to analyze (analyze all the boundaries if MMG5_UNSET)
Returns
1 if success, 0 if fail.

Identify singularities in the mesh.

Mark the points that we don't want to analyze

Singularity identification

Definition at line 276 of file analys_2d.c.

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

◆ MMG2D_split1()

int MMG2D_split1 ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
MMG5_int  k,
MMG5_int  vx[3] 
)
Parameters
meshpointer toward the mesh
solpointer toward the metric
ktriangle index
vxlist of new point indices for each edge
Returns
0 if fail, 1 if success

Split 1 edge of triangle k

Definition at line 390 of file split_2d.c.

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

◆ MMG2D_split1_sim()

int MMG2D_split1_sim ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
MMG5_int  k,
MMG5_int  vx[3] 
)
Parameters
meshpointer toward the mesh
solpointer toward the metric
ktriangle index
vxlist of new point indices for each edge
Returns
0 if fail, 1 if success

Simulate the split of one edge in triangle k

Definition at line 345 of file split_2d.c.

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

◆ MMG2D_split1b()

int MMG2D_split1b ( MMG5_pMesh  mesh,
MMG5_int  k,
int8_t  i,
MMG5_int  ip 
)

\parma mesh pointer toward the mesh

Parameters
kindex of the tria to split
ilocal index of the edge to split
ipglobal index of the new point
Returns
1 if success, 0 if fail

Effective splitting of edge i in tria k: point ip is introduced and the adjacency structure in the mesh is preserved

Definition at line 244 of file split_2d.c.

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

◆ MMG2D_split2()

int MMG2D_split2 ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
MMG5_int  k,
MMG5_int  vx[3] 
)
Parameters
meshpointer toward the mesh
solpointer toward the metric
ktriangle index
vxlist of new point indices for each edge
Returns
0 if fail, 1 if success

Split 2 edges of triangle k

Definition at line 505 of file split_2d.c.

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

◆ MMG2D_split2_sim()

int MMG2D_split2_sim ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
MMG5_int  k,
MMG5_int  vx[3] 
)
Parameters
meshpointer toward the mesh
solpointer toward the metric
ktriangle index
vxlist of new point indices for each edge
Returns
0 if fail, 1 if success

Simulate the split of two edges in triangle k

Definition at line 456 of file split_2d.c.

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

◆ MMG2D_split3()

int MMG2D_split3 ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
MMG5_int  k,
MMG5_int  vx[3] 
)
Parameters
meshpointer toward the mesh
solpointer toward the metric
ktriangle index
vxlist of new point indices for each edge
Returns
0 if fail, 1 if success

Split the three edges of triangle k

Definition at line 630 of file split_2d.c.

Here is the call graph for this function:

◆ MMG2D_split3_sim()

int MMG2D_split3_sim ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
MMG5_int  k,
MMG5_int  vx[3] 
)
Parameters
meshpointer toward the mesh
solpointer toward the metric
ktriangle index
vxlist of new point indices for each edge
Returns
0 if fail, 1 if success

Simulate the split of three edges in triangle k

Definition at line 592 of file split_2d.c.

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

◆ MMG2D_splitbar()

int MMG2D_splitbar ( MMG5_pMesh  mesh,
MMG5_int  k,
MMG5_int  ip 
)
Parameters
meshpointer toward the mesh
kindex of the tria to split
ipglobal index of the new point
Returns
1 if success, 0 if fail

Insert the point ip inside the tria k

Definition at line 721 of file split_2d.c.

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

◆ MMG2D_sum_reqEdgeLengthsAtPoint()

int MMG2D_sum_reqEdgeLengthsAtPoint ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_pTria  pt,
int8_t  i 
)
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
pttetra to process.
iindex of the edge of the tetra pt that we process.
Returns
1 if success, 0 if fail.

Compute the euclidean length of the edge i of the tria pt, add this length to the metric of the edge extremities and increment the count of times we have processed this extremities.

Definition at line 52 of file isosiz_2d.c.

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

◆ MMG2D_swapar()

int MMG2D_swapar ( MMG5_pMesh  mesh,
MMG5_int  k,
int8_t  i 
)

Definition at line 221 of file swapar_2d.c.

Here is the caller graph for this function:

◆ MMG2D_swapdelone()

int MMG2D_swapdelone ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
MMG5_int  k,
int8_t  i,
double  crit,
MMG5_int *  list 
)

Definition at line 39 of file swapar_2d.c.

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

◆ MMG2D_swpmsh()

MMG5_int MMG2D_swpmsh ( MMG5_pMesh  mesh,
MMG5_pSol  met,
int  typchk 
)

Definition at line 514 of file mmg2d1.c.

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

◆ MMG2D_velextLS()

int MMG2D_velextLS ( MMG5_pMesh  mesh,
MMG5_pSol  disp 
)

Extension of the displacement at the nodes of edges tagged MMG5_DISPREF

Definition at line 340 of file velextls_2d.c.

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

◆ MMG2D_zaldy()

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

allocate main structure

Definition at line 303 of file zaldy_2d.c.

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

◆ MMG5_delEdge()

void MMG5_delEdge ( MMG5_pMesh  mesh,
MMG5_int  iel 
)

Definition at line 70 of file zaldy_2d.c.

Here is the caller graph for this function:

◆ MMG5_interpmet22()

int MMG5_interpmet22 ( MMG5_pMesh  mesh,
double *  m,
double *  n,
double  s,
double *  mr 
)

Definition at line 54 of file intmet_2d.c.

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

◆ MMG5_memSize()

size_t MMG5_memSize ( void  )
Returns
the available memory size of the computer.

Compute the available memory size of the computer.

Definition at line 852 of file tools.c.

◆ MMG5_mmg2dChkmsh()

int MMG5_mmg2dChkmsh ( MMG5_pMesh  mesh,
int  severe,
MMG5_int  base 
)
Parameters
meshpointer toward the mesh structure.
severelevel of performed check
base1 if we want to test opnbdy edge tags (consistent only after analysis)
Returns
0 if fail, 1 if success.

Check the mesh validity

Check adjacency relationships

Check consistency between tags of edges and vertices

Check consistency between edge tags and triangle refs

Check consistency between REF, GEO and BDY tags between edges and points

Checks on vertices

Definition at line 36 of file chkmsh_2d.c.

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

Variable Documentation

◆ MMG2D_iare

const int MMG2D_iare[3][2] = {{1,2},{2,0},{0,1}}
static

Definition at line 112 of file libmmg2d_private.h.

◆ MMG2D_idir

const unsigned int MMG2D_idir[5] = {0,1,2,0,1}
static

Definition at line 113 of file libmmg2d_private.h.

◆ MMG2D_idir_q

const uint8_t MMG2D_idir_q[4][2] = { {0,1},{0,3},{1,2},{2,3} }
static

idir[i]: vertices of edge i for a quad

Definition at line 73 of file libmmg2d_private.h.