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

Go to the source code of this file.

Macros

#define MMG2D_RETURN_AND_PACK(mesh, met, sol, val)
 

Functions

void MMG2D_Set_commonFunc (void)
 Set common function pointers between mmgs and mmg2d to the matching mmg2d functions.
 
int MMG2D_mmg2dlib (MMG5_pMesh mesh, MMG5_pSol met)
 Main "program" for the mesh adaptation library.
 
static int MMG2D_restart (MMG5_pMesh mesh)
 
int MMG2D_mmg2dmesh (MMG5_pMesh mesh, MMG5_pSol met)
 Main "program" for the mesh generation library.
 
int MMG2D_mmg2dls (MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pSol umet)
 Main "program" for the level-set discretization library.
 
int MMG2D_mmg2dmov (MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol disp)
 Main "program" for the rigid-body movement library.
 

Macro Definition Documentation

◆ MMG2D_RETURN_AND_PACK

#define MMG2D_RETURN_AND_PACK (   mesh,
  met,
  sol,
  val 
)
Value:
do \
{ \
if ( !MMG2D_pack(mesh,met,sol) ) { \
mesh->npi = mesh->np; \
mesh->nti = mesh->nt; \
mesh->nai = mesh->na; \
mesh->nei = mesh->ne; \
mesh->xt = 0; \
if ( met ) { met->npi = met->np; } \
if ( sol ) { sol->npi = sol->np; } \
return MMG5_LOWFAILURE; \
} \
_LIBMMG5_RETURN(mesh,met,sol,val); \
}while(0)
MMG5_pMesh MMG5_pSol * sol
MMG5_pMesh * mesh
int MMG2D_pack(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pSol met)
Definition: hash_2d.c:530
#define MMG5_LOWFAILURE
Definition: libmmgtypes.h:57
MMG5_int xt
Definition: libmmgtypes.h:628
MMG5_int ne
Definition: libmmgtypes.h:620
MMG5_int nei
Definition: libmmgtypes.h:620
MMG5_int nt
Definition: libmmgtypes.h:620
MMG5_int np
Definition: libmmgtypes.h:620
MMG5_int nti
Definition: libmmgtypes.h:620
MMG5_int npi
Definition: libmmgtypes.h:620
MMG5_int nai
Definition: libmmgtypes.h:620
MMG5_int na
Definition: libmmgtypes.h:620

Pack the mesh mesh and its associated metric met and/or solution sol and return val.

Definition at line 33 of file libmmg2d.c.

Function Documentation

◆ MMG2D_mmg2dlib()

int MMG2D_mmg2dlib ( MMG5_pMesh  mesh,
MMG5_pSol  sol 
)

Main "program" for the mesh adaptation library.

Parameters
meshpointer to the mesh structure.
solpointer to a sol structure (metric).
Returns
MMG5_SUCCESS if successful, MMG5_LOWFAILURE in case there is a failure but a conform mesh is returned and MMG5_STRONGFAILURE if there is a failure and we can't save the mesh.

This function adapts a given mesh, trying to improve the quality, under the given metric and parameters.

Remarks
Fortran interface:

‍ SUBROUTINE MMG2D_MMG2DLIB(mesh,sol,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 63 of file libmmg2d.c.

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

◆ MMG2D_mmg2dls()

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

Main "program" for the level-set discretization library.

Parameters
meshpointer to the mesh structure.
solpointer to a sol structure (level-set function).
metpointer to a sol structure (metric).
Returns
MMG5_SUCCESS if successful, MMG5_LOWFAILURE if there is a failure but a conform mesh is saved and MMG5_STRONGFAILURE if there is a failure and we can't save the mesh.

This is the main program for the level-set discretization library. If a metric met is provided, it is used to adapt the mesh.

Remarks
Fortran interface:

‍ SUBROUTINE MMG2D_MMG2DLS(mesh,sol,met,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol
MMG5_DATA_PTR_T :: met
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 524 of file libmmg2d.c.

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

◆ MMG2D_mmg2dmesh()

int MMG2D_mmg2dmesh ( MMG5_pMesh  mesh,
MMG5_pSol  sol 
)

Main "program" for the mesh generation library.

Parameters
meshpointer to the mesh structure.
solpointer to a sol structure (metric).
Returns
MMG5_SUCCESS if successful, MMG5_LOWFAILURE if there is a failure but a conform mesh is returned and MMG5_STRONGFAILURE if there is a failure and we can't save the mesh.

FIXME: This function creates a triangular mesh from a given polygon, right?

Remarks
Fortran interface:

‍ SUBROUTINE MMG2D_MMG2DMESH(mesh,sol,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 305 of file libmmg2d.c.

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

◆ MMG2D_mmg2dmov()

int MMG2D_mmg2dmov ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_pSol  disp 
)

Main "program" for the rigid-body movement library.

Parameters
meshpointer to the mesh structure.
solpointer to a sol structure (displacement).
disppointer to a sol (displacement for the lagrangian motion mode) structure.
Returns
MMG5_SUCCESS if success, MMG5_LOWFAILURE if there is a failure but a conform mesh is saved and MMG5_STRONGFAILURE if there is a failure and we can't save the mesh.
Remarks
Fortran interface:

‍ SUBROUTINE MMG2D_MMG2DMOV(mesh,sol,disp,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol,disp
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 820 of file libmmg2d.c.

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

◆ MMG2D_restart()

static int MMG2D_restart ( MMG5_pMesh  mesh)
inlinestatic
Parameters
meshpointer to the mesh structure.
Returns
0 if fail (lack of memory), 1 otherwise.

Clean the mesh structure when we just call the MMG2D_Free_Triangles and MMG2D_Free_Edges functions between 2 call of the MMG2D_mmg2dmesh function:

  • Allocate the tria and edge structures if needed;
  • Reset the tags at vertices.

If needed, reallocate the missing structures

Definition at line 274 of file libmmg2d.c.

Here is the caller graph for this function:

◆ MMG2D_Set_commonFunc()

void MMG2D_Set_commonFunc ( void  )

Set common function pointers between mmgs and mmg2d to the matching mmg2d functions.

Set common pointer functions between mmgs and mmg2d to the matching mmg2d functions.

Definition at line 52 of file libmmg2d.c.

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