Mmg
Simplicial remeshers (mesh adaptation, isovalue discretization, lagrangian movement)
Macros | Functions
libmmgcommon_private.h File Reference
#include <stdarg.h>
#include "libmmgtypes.h"
#include "chrono_private.h"
#include "mmg_core_export_private.h"
Include dependency graph for libmmgcommon_private.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MMG5_VOLFRAC   1.e-5
 API header for the common part of the MMG libraries. More...
 

Functions

LIBMMG_CORE_EXPORT void MMG5_Init_fileNames (MMG5_pMesh mesh, MMG5_pSol sol)
 
LIBMMG_CORE_EXPORT void() MMG5_Init_parameters (MMG5_pMesh mesh)
 
LIBMMG_CORE_EXPORT int MMG5_Set_inputMeshName (MMG5_pMesh mesh, const char *meshin)
 
LIBMMG_CORE_EXPORT int MMG5_Set_outputMeshName (MMG5_pMesh mesh, const char *meshout)
 
LIBMMG_CORE_EXPORT int MMG5_Set_inputSolName (MMG5_pMesh mesh, MMG5_pSol sol, const char *solin)
 
LIBMMG_CORE_EXPORT int MMG5_Set_outputSolName (MMG5_pMesh mesh, MMG5_pSol sol, const char *solout)
 
LIBMMG_CORE_EXPORT int MMG5_scaleMesh (MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol ls)
 
LIBMMG_CORE_EXPORT int MMG5_unscaleMesh (MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol ls)
 
LIBMMG_CORE_EXPORT void MMG5_Set_constantSize (MMG5_pMesh mesh, MMG5_pSol met, double hsiz)
 
LIBMMG_CORE_EXPORT int MMG5_Set_multiMat (MMG5_pMesh mesh, MMG5_pSol sol, MMG5_int ref, int split, MMG5_int rin, MMG5_int rex)
 
LIBMMG_CORE_EXPORT int MMG5_Set_lsBaseReference (MMG5_pMesh mesh, MMG5_pSol sol, MMG5_int br)
 
LIBMMG_CORE_EXPORT void MMG5_Free_structures (MMG5_pMesh mesh, MMG5_pSol sol)
 
LIBMMG_CORE_EXPORT void MMG5_mmgFree_names (MMG5_pMesh mesh, MMG5_pSol met)
 
LIBMMG_CORE_EXPORT int MMG5_Set_defaultTruncatureSizes (MMG5_pMesh mesh, int8_t sethmin, int8_t sethmax)
 
LIBMMG_CORE_EXPORT int MMG5_Compute_constantSize (MMG5_pMesh mesh, MMG5_pSol met, double *hsize)
 
const char * MMG5_Get_tagName (int tag)
 
LIBMMG_CORE_EXPORT int MMG5_Free_allSols (MMG5_pMesh mesh, MMG5_pSol *sol)
 
LIBMMG_CORE_EXPORT int MMG5_saveNode (MMG5_pMesh mesh, const char *filename)
 
LIBMMG_CORE_EXPORT int MMG5_saveEdge (MMG5_pMesh mesh, const char *filename, const char *ext)
 
LIBMMG_CORE_EXPORT char * MMG5_Get_basename (char *path)
 
LIBMMG_CORE_EXPORT int MMG5_Get_format (char *ptr, int fmt)
 
LIBMMG_CORE_EXPORT char * MMG5_Get_filenameExt (char *filename)
 
LIBMMG_CORE_EXPORT char * MMG5_Get_path (char *path)
 
LIBMMG_CORE_EXPORT char * MMG5_Remove_ext (char *path, char *ext)
 
LIBMMG_CORE_EXPORT const char * MMG5_Get_formatName (enum MMG5_Format fmt)
 
LIBMMG_CORE_EXPORT const char * MMG5_Get_entitiesName (enum MMG5_entities ent)
 
LIBMMG_CORE_EXPORT const char * MMG5_Get_typeName (enum MMG5_type typ)
 
LIBMMG_CORE_EXPORT int MMG5_Clean_isoEdges (MMG5_pMesh mesh)
 

Macro Definition Documentation

◆ MMG5_VOLFRAC

#define MMG5_VOLFRAC   1.e-5

API header for the common part of the MMG libraries.

Author
Algiane Froehly (Inria/UBordeaux)
Version
5
Date
01 2014
Warning
To keep the genheader working, don't break line between the enum name and the opening brace (it creates errors under windows)

Definition at line 49 of file libmmgcommon_private.h.

Function Documentation

◆ MMG5_Clean_isoEdges()

LIBMMG_CORE_EXPORT int MMG5_Clean_isoEdges ( MMG5_pMesh  mesh)
Parameters
meshpointer toward mesh
Returns
1 if successful, 0 otherwise

Clean non-ridge edges belonging to isosurface.

Parameters
meshpointer toward mesh
return1 if successful, 0 if fail

Clean edges belonging to isosurf, except for ridges.

Deletion of edges that belong to isosurf

Definition at line 365 of file libtools.c.

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

◆ MMG5_Compute_constantSize()

LIBMMG_CORE_EXPORT int MMG5_Compute_constantSize ( MMG5_pMesh  mesh,
MMG5_pSol  met,
double *  hsize 
)
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric.
hsizcomputed constant size to impose.
Returns
1 if success, 0 if fail

Compute the constant size to impose according to hmin and hmax and store it in hsiz. Fill hmin and hamx if they are not setted by the user.

Definition at line 572 of file API_functions.c.

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

◆ MMG5_Free_allSols()

LIBMMG_CORE_EXPORT int MMG5_Free_allSols ( MMG5_pMesh  mesh,
MMG5_pSol sol 
)
Parameters
meshpointer toward the mesh structure.
solpointer toward an array of solution structure (that stores solution fields).
Returns
1

Deallocation of an array of solution fields

Definition at line 440 of file API_functions.c.

Here is the caller graph for this function:

◆ MMG5_Free_structures()

LIBMMG_CORE_EXPORT void MMG5_Free_structures ( MMG5_pMesh  mesh,
MMG5_pSol  sol 
)
Parameters
meshpointer toward the mesh structure.
solpointer toward the sol structure.

Structures unallocation before return (common structures between all codes).

Definition at line 462 of file API_functions.c.

Here is the caller graph for this function:

◆ MMG5_Get_basename()

LIBMMG_CORE_EXPORT char * MMG5_Get_basename ( char *  path)
Parameters
pathstring containing a filename and its path
Returns
a pointer toward the allocated string that contains the file basename.

Extract basename from a path (allocate a string to store it).

Definition at line 632 of file API_functions.c.

Here is the caller graph for this function:

◆ MMG5_Get_entitiesName()

LIBMMG_CORE_EXPORT const char * MMG5_Get_entitiesName ( enum MMG5_entities  ent)
Parameters
entMMG5_entities enum
Returns
the name of the enum field

Print the name associated to the ent value in the MMG5_entities enum.

Definition at line 642 of file API_functions.c.

Here is the caller graph for this function:

◆ MMG5_Get_filenameExt()

LIBMMG_CORE_EXPORT char * MMG5_Get_filenameExt ( char *  filename)
Parameters
filenamestring containing a filename
Returns
pointer toward the filename extension or toward the end of the string if no extension have been founded

Get the extension of the filename string. Do not consider '.o' as an extension.

Definition at line 856 of file API_functions.c.

Here is the caller graph for this function:

◆ MMG5_Get_format()

LIBMMG_CORE_EXPORT int MMG5_Get_format ( char *  ptr,
int  fmt 
)
Parameters
ptrpointer toward the file extension (dot included)
fmtdefault file format.
Returns
and index associated to the file format detected from the extension.

Get the wanted file format from the mesh extension. If fmt is provided, it is used as default file format (ptr==NULL), otherwise, the default file format is the medit one.

Definition at line 760 of file API_functions.c.

Here is the caller graph for this function:

◆ MMG5_Get_formatName()

LIBMMG_CORE_EXPORT const char * MMG5_Get_formatName ( enum MMG5_Format  fmt)
Parameters
fmtfile format.
Returns
The name of the file format in a string.

Print the name of the file format associated to fmt.

Definition at line 808 of file API_functions.c.

Here is the caller graph for this function:

◆ MMG5_Get_path()

LIBMMG_CORE_EXPORT char * MMG5_Get_path ( char *  path)
Parameters
pathstring containing a filename and its path
Returns
a pointer toward the path allocated here

Remove filename from a path and return the path in a newly allocated string.

Definition at line 883 of file API_functions.c.

Here is the call graph for this function:

◆ MMG5_Get_tagName()

const char * MMG5_Get_tagName ( int  tag)
Parameters
taginput entity tag
Returns
the list of the flags contained in tag

Print the name associated to the typ value in the MMG5_type enum.

Warning
for debug purpose, no thread safe.

Definition at line 686 of file API_functions.c.

Here is the caller graph for this function:

◆ MMG5_Get_typeName()

LIBMMG_CORE_EXPORT const char * MMG5_Get_typeName ( enum MMG5_type  typ)
Parameters
typMMG5_type enum
Returns
the name of the enum field

Print the name associated to the typ value in the MMG5_type enum.

Definition at line 665 of file API_functions.c.

Here is the caller graph for this function:

◆ MMG5_Init_fileNames()

LIBMMG_CORE_EXPORT void MMG5_Init_fileNames ( MMG5_pMesh  mesh,
MMG5_pSol  sol 
)
Parameters
meshpointer toward the mesh structure.
solpointer toward the sol structure.

Initialize file names to their default values.

Remarks
Fortran interface:

‍ SUBROUTINE MMG5_INIT_FILENAMES(mesh,sol)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh,sol
END SUBROUTINE

Parameters
meshpointer toward the mesh structure.
solpointer toward the sol structure.

Initialize file names to their default values.

Definition at line 128 of file API_functions.c.

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

◆ MMG5_Init_parameters()

LIBMMG_CORE_EXPORT void() MMG5_Init_parameters ( MMG5_pMesh  mesh)
Parameters
meshpointer toward the mesh structure.

Initialization of the input parameters (stored in the Info structure).

Remarks
Fortran interface:

‍ SUBROUTINE MMG5_INIT_PARAMETERS(mesh)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
END SUBROUTINE

Parameters
meshpointer toward the mesh structure.

Initialization of the input parameters.

MMG3D_IPARAM_lag is used by mmg3d only but need to be negative in the scaleMesh function

Definition at line 51 of file API_functions.c.

◆ MMG5_mmgFree_names()

LIBMMG_CORE_EXPORT void MMG5_mmgFree_names ( MMG5_pMesh  mesh,
MMG5_pSol  met 
)
Parameters
meshpointer toward the mesh structure.
metpointer toward the sol structure.

File name deallocations before return.

Remarks
Fortran interface:

‍ SUBROUTINE MMG5_SETMMGFREE_NAMES(mesh,met)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,met
END SUBROUTINE

Parameters
meshpointer toward the mesh structure.
metpointer toward the sol structure.

File name deallocations before return.

Definition at line 511 of file API_functions.c.

Here is the caller graph for this function:

◆ MMG5_Remove_ext()

LIBMMG_CORE_EXPORT char * MMG5_Remove_ext ( char *  path,
char *  ext 
)
Parameters
pathpath from which we want to remove the extension.
Returns
allocated string or NULL if the allocation fail.

Allocate a new string and copy path without extension in it.

Definition at line 918 of file API_functions.c.

Here is the call graph for this function:

◆ MMG5_saveEdge()

LIBMMG_CORE_EXPORT int MMG5_saveEdge ( MMG5_pMesh  mesh,
const char *  filename,
const char *  ext 
)
Parameters
meshpointer toward the mesh structure.
filenamename of file.
extfile extension (.poly or .edge)
Returns
1 if success, 0 if fail.

Save edge list at .edge file format (Tetgen/Triangle).

Definition at line 2816 of file inout.c.

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

◆ MMG5_saveNode()

LIBMMG_CORE_EXPORT int MMG5_saveNode ( MMG5_pMesh  mesh,
const char *  filename 
)
Parameters
meshpointer toward the mesh structure.
filenamename of file.
Returns
1 if success, 0 if fail.

Save node list at .node file format (Tetgen/Triangle).

Definition at line 2741 of file inout.c.

Here is the caller graph for this function:

◆ MMG5_scaleMesh()

LIBMMG_CORE_EXPORT int MMG5_scaleMesh ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_pSol  sol 
)
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
lspointer toward a solution structure (level-set or displacement).
Returns
1 if success, 0 if fail (computed bounding box too small or one af the anisotropic input metric is not valid).

Scale the mesh and the size informations between 0 and 1. Compute a default value for the hmin/hmax parameters if needed.

Remarks
Fortran interface:

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

Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
solpointer toward a solution structure (level-set or displacement).
Returns
1 if success, 0 if fail (computed bounding box too small or one af the anisotropic input metric is not valid).

Scale the mesh and the size informations between 0 and 1. Compute a default value for the hmin/hmax parameters if needed.

Definition at line 649 of file scalem.c.

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

◆ MMG5_Set_constantSize()

LIBMMG_CORE_EXPORT void MMG5_Set_constantSize ( MMG5_pMesh  mesh,
MMG5_pSol  met,
double  hsiz 
)
Parameters
meshpointer toward the mesh structure.
metpointer toward the sol structure.
hsizwanted edge size

fill the metric field with the size hsiz

\Remark not for extern users.

Definition at line 395 of file API_functions.c.

Here is the caller graph for this function:

◆ MMG5_Set_defaultTruncatureSizes()

LIBMMG_CORE_EXPORT int MMG5_Set_defaultTruncatureSizes ( MMG5_pMesh  mesh,
int8_t  sethmin,
int8_t  sethmax 
)
inline
Parameters
meshpointer toward the mesh structure.
sethmin1 if hmin is already setted (>0.)
sethmax1 if hmax is already setted (>0.)
Returns
1 if success, 0 if we detect mismatch parameters

Set default values for hmin and hmax from the bounding box.

\Remark not for extern users.

Definition at line 535 of file API_functions.c.

Here is the caller graph for this function:

◆ MMG5_Set_inputMeshName()

LIBMMG_CORE_EXPORT int MMG5_Set_inputMeshName ( MMG5_pMesh  mesh,
const char *  meshin 
)
Parameters
meshpointer toward the mesh structure.
meshininput mesh name.
Returns
1.

Set the name of input mesh.

Remarks
Fortran interface:

‍ SUBROUTINE MMG5_SET_INPUTMESHNAME(mesh,meshin,strlen,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh
CHARACTER(LEN=*), INTENT(IN) :: meshin
INTEGER, INTENT(IN) :: strlen
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Parameters
meshpointer toward the mesh structure.
meshininput mesh name.
Returns
1 if success, 0 if fail

Set the name of input mesh.

Definition at line 149 of file API_functions.c.

Here is the caller graph for this function:

◆ MMG5_Set_inputSolName()

LIBMMG_CORE_EXPORT int MMG5_Set_inputSolName ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
const char *  solin 
)
Parameters
meshpointer toward the mesh structure.
solpointer toward the sol structure.
solinname of the input solution file.
Returns
1.

Set the name of input solution file.

Remarks
Fortran interface:

‍ SUBROUTINE MMG5_SET_INPUTSOLNAME(mesh,sol,solin,strlen,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol
CHARACTER(LEN=*), INTENT(IN) :: solin
INTEGER, INTENT(IN) :: strlen
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Parameters
meshpointer toward the mesh structure.
solpointer toward the sol structure.
solinname of the input solution file.
Returns
1 if success, 0 if fail

Set the name of input solution file.

Definition at line 185 of file API_functions.c.

Here is the caller graph for this function:

◆ MMG5_Set_lsBaseReference()

LIBMMG_CORE_EXPORT int MMG5_Set_lsBaseReference ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
MMG5_int  br 
)
Parameters
meshpointer toward the mesh structure.
solpointer toward the sol structure.
brnew level-set base reference.
Returns
0 if failed, 1 otherwise.

Set a new level-set base reference of ref br in ls discretization mode. Base references are boundary conditions to which implicit domain can be attached. All implicit volumes that are not attached to listed based references are deleted as spurious volumes by the rmc option.

Definition at line 174 of file libtools.c.

Here is the caller graph for this function:

◆ MMG5_Set_multiMat()

LIBMMG_CORE_EXPORT int MMG5_Set_multiMat ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
MMG5_int  ref,
int  split,
MMG5_int  rin,
MMG5_int  rex 
)
Parameters
meshpointer toward the mesh structure.
solpointer toward the sol structure.
refinput tetra reference.
splitMMG5_MMAT_NoSplit if the entity must not be splitted, MMG5_MMAT_Split otherwise
rininternal reference after ls discretization
rexexternal reference after ls discretization
Returns
0 if failed, 1 otherwise.

Set the reference mapping for the elements of ref ref in ls discretization mode.

Definition at line 102 of file libtools.c.

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

◆ MMG5_Set_outputMeshName()

LIBMMG_CORE_EXPORT int MMG5_Set_outputMeshName ( MMG5_pMesh  mesh,
const char *  meshout 
)
Parameters
meshpointer toward the mesh structure.
meshoutname of the output mesh file.
Returns
1.

Set the name of output mesh file.

Remarks
Fortran interface:

‍ SUBROUTINE MMG5_SET_OUTPUTMESHNAME(mesh,meshout,strlen,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh
CHARACTER(LEN=*), INTENT(IN) :: meshout
INTEGER, INTENT(IN) :: strlen
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Parameters
meshpointer toward the mesh structure.
meshoutname of the output mesh file.
Returns
1 if success, 0 if fail.

Set the name of output mesh file.

Definition at line 233 of file API_functions.c.

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

◆ MMG5_Set_outputSolName()

LIBMMG_CORE_EXPORT int MMG5_Set_outputSolName ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
const char *  solout 
)
Parameters
meshpointer toward the mesh structure.
solpointer toward the sol structure.
soloutname of the output solution file.
Returns
0 if failed, 1 otherwise.

Set the name of output solution file.

Remarks
Fortran interface:

‍ SUBROUTINE MMG5_SET_OUTPUTSOLNAME(mesh,sol,solout,strlen,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol
CHARACTER(LEN=*), INTENT(IN) :: solout
INTEGER, INTENT(IN) :: strlen
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Parameters
meshpointer toward the mesh structure.
solpointer toward the sol structure.
soloutname of the output solution file.
Returns
0 if failed, 1 otherwise.

Set the name of output solution file.

Definition at line 348 of file API_functions.c.

Here is the caller graph for this function:

◆ MMG5_unscaleMesh()

LIBMMG_CORE_EXPORT int MMG5_unscaleMesh ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_pSol  sol 
)
Parameters
meshpointer toward the mesh structure.
metpointer toward a metric.
solpointer toward a solution structure (level-set or displacement).
Returns
1.

Unscale the mesh and the size informations to their initial sizes.

Remarks
Fortran interface:

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

Parameters
meshpointer toward the mesh structure.
metpointer toward a metric.
solpointer toward a solution structure (level-set or displacement).
Returns
1.

Unscale the mesh and the size informations to their initial sizes.

Definition at line 689 of file scalem.c.

Here is the caller graph for this function: