Mmg
Simplicial remeshers (mesh adaptation, isovalue discretization, lagrangian movement)
Macros | Functions
libmmg3d.c File Reference

Most of the API functions of the MMG3D library. More...

#include "libmmg3d.h"
#include "inlined_functions_3d_private.h"
#include "mmg3dexterns_private.h"
#include "mmgexterns_private.h"
Include dependency graph for libmmg3d.c:

Go to the source code of this file.

Macros

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

Functions

void MMG3D_Free_topoTables (MMG5_pMesh mesh)
 
MMG5_int MMG3D_bdryBuild (MMG5_pMesh mesh)
 
int MMG3D_mark_packedPoints (MMG5_pMesh mesh, MMG5_int *np, MMG5_int *nc)
 
int MMG3D_pack_tetraAndAdja (MMG5_pMesh mesh)
 
int MMG3D_pack_tetra (MMG5_pMesh mesh)
 
int MMG3D_pack_prismsAndQuads (MMG5_pMesh mesh)
 
int MMG3D_pack_sol (MMG5_pMesh mesh, MMG5_pSol sol)
 
int MMG3D_pack_pointArray (MMG5_pMesh mesh)
 
int MMG3D_update_eltsVertices (MMG5_pMesh mesh)
 
MMG5_int MMG3D_pack_points (MMG5_pMesh mesh)
 
void MMG3D_unset_reqBoundaries (MMG5_pMesh mesh)
 
int MMG3D_packMesh (MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pSol met)
 
int MMG3D_mmg3dlib (MMG5_pMesh mesh, MMG5_pSol met)
 Main "program" for the mesh adaptation library.
 
int MMG3D_mmg3dls (MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pSol umet)
 Main "program" for the level-set discretization library.
 
int MMG3D_mmg3dmov (MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol disp)
 Main program for the rigid-body movement library.
 
void MMG3D_Set_commonFunc (void)
 

Detailed Description

Most of the API functions of the MMG3D library.

Author
Charles Dapogny (UPMC)
Cécile Dobrzynski (Bx INP/Inria/UBordeaux)
Pascal Frey (UPMC)
Algiane Froehly (Inria/UBordeaux)
Version
5
Date
01 2014
Warning
Use the MMG3D_ prefix: MMG5_ prefix will became obsolete soon...
Todo:
documentation doxygen

Private API functions for MMG3D library: incompatible functions with the main binary.

Definition in file libmmg3d.c.

Macro Definition Documentation

◆ MMG5_RETURN_AND_PACK

#define MMG5_RETURN_AND_PACK (   mesh,
  met,
  sol,
  val 
)
Value:
do \
{ \
if ( !MMG3D_packMesh(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; } \
} \
_LIBMMG5_RETURN(mesh,met,sol,val); \
}while(0)
MMG5_pMesh MMG5_pSol * sol
MMG5_pMesh * mesh
int MMG3D_packMesh(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pSol met)
Definition: libmmg3d.c:905
#define MMG5_STRONGFAILURE
Definition: libmmgtypes.h:65
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 51 of file libmmg3d.c.

Function Documentation

◆ MMG3D_bdryBuild()

MMG5_int MMG3D_bdryBuild ( MMG5_pMesh  mesh)
Parameters
meshpointer to the mesh structure (unused).
Returns
-1 if fail, the number of detected ridges otherwise

Create the boundary entities of the mesh (triangles and edges).

Warning
mesh must be packed and hashed

Definition at line 99 of file libmmg3d.c.

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

◆ MMG3D_Free_topoTables()

void MMG3D_Free_topoTables ( MMG5_pMesh  mesh)

Free adja, xtetra and xpoint tables

Definition at line 67 of file libmmg3d.c.

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

◆ MMG3D_mark_packedPoints()

int MMG3D_mark_packedPoints ( MMG5_pMesh  mesh,
MMG5_int *  np,
MMG5_int *  nc 
)
Parameters
meshpointer to the mesh structure (unused).
nppointer to the number of packed points
ncpointer to the number of packed corners
Returns
1 if success, 0 if fail.

Count the number of packed points and store the packed point index in tmp. Preserve numbering order.

Definition at line 541 of file libmmg3d.c.

Here is the caller graph for this function:

◆ MMG3D_mmg3dlib()

int MMG3D_mmg3dlib ( MMG5_pMesh  mesh,
MMG5_pSol  met 
)

Main "program" for the mesh adaptation library.

Parameters
meshpointer to the mesh structure.
metpointer to the sol (metric) structure.
Returns
MMG5_SUCCESS if success, MMG5_LOWFAILURE if fail but a conform mesh is saved or MMG5_STRONGFAILURE if fail and we can't save the mesh.
Remarks
Fortran interface:

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

In debug mode, check that all structures are allocated

Free topologic tables (adja, xpoint, xtetra) resulting from a previous run

Definition at line 975 of file libmmg3d.c.

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

◆ MMG3D_mmg3dls()

int MMG3D_mmg3dls ( 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 the sol (level-set) structure.
metpointer to a sol structure (metric), optional.
Returns
MMG5_SUCCESS if success, MMG5_LOWFAILURE if fail but a conform mesh is saved or MMG5_STRONGFAILURE if fail and we can't save the mesh.

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

Remarks
Fortran interface:

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

In debug mode, check that all structures are allocated

Free topologic tables (adja, xpoint, xtetra) resulting from a previous run

Definition at line 1192 of file libmmg3d.c.

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

◆ MMG3D_mmg3dmov()

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

Main program for the rigid-body movement library.

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

‍ SUBROUTINE MMG3D_MMG3DMOV(mesh,met,disp,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,met,disp
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

In debug mode, check that all structures are allocated

Free topologic tables (adja, xpoint, xtetra) resulting from a previous run

Definition at line 1475 of file libmmg3d.c.

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

◆ MMG3D_pack_pointArray()

int MMG3D_pack_pointArray ( MMG5_pMesh  mesh)
Parameters
meshpointer to the mesh structure (unused).
Returns
the number of corners if success, -1 otherwise

Pack a sparse point array. Preserve numbering order.

Definition at line 749 of file libmmg3d.c.

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

◆ MMG3D_pack_points()

MMG5_int MMG3D_pack_points ( MMG5_pMesh  mesh)
Parameters
meshpointer to the mesh structure (unused).
Returns
the number of corners if success, -1 otherwise

Pack a sparse point array and update the element vertices according to their new indices.

Store in tmp the pack index of each point and count the corner

Update the element vertices indices

Pack the point array

Definition at line 853 of file libmmg3d.c.

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

◆ MMG3D_pack_prismsAndQuads()

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

Pack prisms and quads. Preserve numbering order.

Definition at line 667 of file libmmg3d.c.

Here is the caller graph for this function:

◆ MMG3D_pack_sol()

int MMG3D_pack_sol ( MMG5_pMesh  mesh,
MMG5_pSol  sol 
)
Parameters
meshpointer to the mesh structure (unused).
metpointer to the solution (metric or level-set) structure.
Returns
1 if success, 0 if fail.

Pack a sparse solution structure. Preserve numbering order.

Definition at line 713 of file libmmg3d.c.

Here is the caller graph for this function:

◆ MMG3D_pack_tetra()

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

Pack the sparse tetra. Doesn't pack the adjacency array. Preserve numbering order.

Definition at line 627 of file libmmg3d.c.

Here is the caller graph for this function:

◆ MMG3D_pack_tetraAndAdja()

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

Pack the sparse tetra and the associated adja array. Preserve numbering order.

Definition at line 572 of file libmmg3d.c.

Here is the caller graph for this function:

◆ MMG3D_packMesh()

int MMG3D_packMesh ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
MMG5_pSol  met 
)
Parameters
meshpointer to the mesh structure (unused).
solpointer to a solution structure.
metpointer to a solution structure.
Returns
1 if success, 0 if fail or if we are unable to build triangles.

Pack the sparse mesh and create triangles and edges before getting out of library

Definition at line 905 of file libmmg3d.c.

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

◆ MMG3D_Set_commonFunc()

void MMG3D_Set_commonFunc ( void  )

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

Definition at line 1745 of file libmmg3d.c.

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

◆ MMG3D_unset_reqBoundaries()

void MMG3D_unset_reqBoundaries ( MMG5_pMesh  mesh)
Parameters
meshpointer towarad the mesh structure.

Set all boundary triangles to required and add a tag to detect that they are not realy required.

Definition at line 875 of file libmmg3d.c.

Here is the caller graph for this function:

◆ MMG3D_update_eltsVertices()

int MMG3D_update_eltsVertices ( MMG5_pMesh  mesh)
Parameters
meshpointer to the mesh structure (unused).
Returns
1 if success, 0 otherwise

Update the element vertices indices with the pack point index stored in the tmp field of the points.

Definition at line 807 of file libmmg3d.c.

Here is the caller graph for this function: