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

C API functions definitions for MMG library. More...

#include "mmgcommon_private.h"
Include dependency graph for API_functions.c:

Go to the source code of this file.

Functions

void MMG5_Init_parameters (MMG5_pMesh mesh)
 
void MMG5_Init_fileNames (MMG5_pMesh mesh, MMG5_pSol sol)
 
int MMG5_Set_inputMeshName (MMG5_pMesh mesh, const char *meshin)
 
int MMG5_Set_inputSolName (MMG5_pMesh mesh, MMG5_pSol sol, const char *solin)
 
int MMG5_Set_outputMeshName (MMG5_pMesh mesh, const char *meshout)
 
int MMG5_Set_outputSolName (MMG5_pMesh mesh, MMG5_pSol sol, const char *solout)
 
void MMG5_Set_constantSize (MMG5_pMesh mesh, MMG5_pSol met, double hsiz)
 
int MMG5_Free_allSols (MMG5_pMesh mesh, MMG5_pSol *sol)
 
void MMG5_Free_structures (MMG5_pMesh mesh, MMG5_pSol sol)
 
void MMG5_mmgFree_names (MMG5_pMesh mesh, MMG5_pSol met)
 
int MMG5_Set_defaultTruncatureSizes (MMG5_pMesh mesh, int8_t sethmin, int8_t sethmax)
 
int MMG5_Compute_constantSize (MMG5_pMesh mesh, MMG5_pSol met, double *hsiz)
 
char * MMG5_Get_basename (char *path)
 
const char * MMG5_Get_entitiesName (enum MMG5_entities ent)
 
const char * MMG5_Get_typeName (enum MMG5_type typ)
 
const char * MMG5_Get_tagName (int tag)
 
int MMG5_Get_format (char *ptr, int fmt)
 
const char * MMG5_Get_formatName (enum MMG5_Format fmt)
 
char * MMG5_Get_filenameExt (char *filename)
 
char * MMG5_Get_path (char *path)
 
char * MMG5_Remove_ext (char *path, char *ext)
 

Detailed Description

C API functions definitions for MMG library.

Author
Charles Dapogny (UPMC)
Cécile Dobrzynski (Bx INP/Inria/UBordeaux)
Pascal Frey (UPMC)
Algiane Froehly (Inria/UBordeaux)
Version
5
Date
03 2014
Note
This file contains some internal functions for the API, see the common/libmmgcommon_private.h, mmgs/libmmgs.h and mmg3d/libmmg3d.h header files for the documentation of all the usefull user's API functions.

C API for MMG library.

Definition in file API_functions.c.

Function Documentation

◆ MMG5_Compute_constantSize()

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

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

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

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

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

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

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

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

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

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

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.

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

void MMG5_Init_parameters ( MMG5_pMesh  mesh)
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.

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

◆ MMG5_mmgFree_names()

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.

Definition at line 511 of file API_functions.c.

Here is the caller graph for this function:

◆ MMG5_Remove_ext()

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_Set_constantSize()

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

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

int MMG5_Set_inputMeshName ( MMG5_pMesh  mesh,
const char *  meshin 
)
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()

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 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_outputMeshName()

int MMG5_Set_outputMeshName ( MMG5_pMesh  mesh,
const char *  meshout 
)
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()

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.

Definition at line 348 of file API_functions.c.

Here is the caller graph for this function: