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

API headers and documentation for the mmg3d library, for volumetric meshes in 3D. More...

#include "mmg/common/libmmgtypes.h"
#include "mmg/mmg3d/mmg3d_export.h"
Include dependency graph for libmmg3d.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MMG3D_LMAX   10240
 

Enumerations

enum  MMG3D_Param {
  MMG3D_IPARAM_verbose , MMG3D_IPARAM_mem , MMG3D_IPARAM_debug , MMG3D_IPARAM_angle ,
  MMG3D_IPARAM_iso , MMG3D_IPARAM_isosurf , MMG3D_IPARAM_nofem , MMG3D_IPARAM_opnbdy ,
  MMG3D_IPARAM_lag , MMG3D_IPARAM_optim , MMG3D_IPARAM_optimLES , MMG3D_IPARAM_noinsert ,
  MMG3D_IPARAM_noswap , MMG3D_IPARAM_nomove , MMG3D_IPARAM_nosurf , MMG3D_IPARAM_nreg ,
  MMG3D_IPARAM_xreg , MMG3D_IPARAM_numberOfLocalParam , MMG3D_IPARAM_numberOfLSBaseReferences , MMG3D_IPARAM_numberOfMat ,
  MMG3D_IPARAM_numsubdomain , MMG3D_IPARAM_renum , MMG3D_IPARAM_anisosize , MMG3D_IPARAM_octree ,
  MMG3D_IPARAM_nosizreq , MMG3D_IPARAM_isoref , MMG3D_DPARAM_angleDetection , MMG3D_DPARAM_hmin ,
  MMG3D_DPARAM_hmax , MMG3D_DPARAM_hsiz , MMG3D_DPARAM_hausd , MMG3D_DPARAM_hgrad ,
  MMG3D_DPARAM_hgradreq , MMG3D_DPARAM_ls , MMG3D_DPARAM_xreg , MMG3D_DPARAM_rmc ,
  MMG3D_PARAM_size
}
 Input parameters for the mmg library. More...
 

Functions

LIBMMG3D_EXPORT int MMG3D_Init_mesh (const int starter,...)
 Initialize a mesh structure and optionally the associated solution and metric structures.
 
LIBMMG3D_EXPORT void MMG3D_Init_fileNames (MMG5_pMesh mesh, MMG5_pSol sol)
 Initialize file names to their default values.
 
LIBMMG3D_EXPORT void MMG3D_Init_parameters (MMG5_pMesh mesh)
 Initialize parameters to their default values.
 
LIBMMG3D_EXPORT int MMG3D_Set_inputMeshName (MMG5_pMesh mesh, const char *meshin)
 Set the name of input mesh.
 
LIBMMG3D_EXPORT int MMG3D_Set_outputMeshName (MMG5_pMesh mesh, const char *meshout)
 Set the name of output mesh file.
 
LIBMMG3D_EXPORT int MMG3D_Set_inputSolName (MMG5_pMesh mesh, MMG5_pSol sol, const char *solin)
 Set the name of input solution file.
 
LIBMMG3D_EXPORT int MMG3D_Set_outputSolName (MMG5_pMesh mesh, MMG5_pSol sol, const char *solout)
 Set the name of the output solution file.
 
LIBMMG3D_EXPORT int MMG3D_Set_inputParamName (MMG5_pMesh mesh, const char *fparamin)
 Set the name of the input parameter file.
 
LIBMMG3D_EXPORT int MMG3D_Set_solSize (MMG5_pMesh mesh, MMG5_pSol sol, int typEntity, MMG5_int np, int typSol)
 Initialize a solution field.
 
LIBMMG3D_EXPORT int MMG3D_Set_solsAtVerticesSize (MMG5_pMesh mesh, MMG5_pSol *sol, int nsols, MMG5_int nentities, int *typSol)
 Initialize an array of solution values defined at vertices.
 
LIBMMG3D_EXPORT int MMG3D_Set_meshSize (MMG5_pMesh mesh, MMG5_int np, MMG5_int ne, MMG5_int nprism, MMG5_int nt, MMG5_int nquad, MMG5_int na)
 Set the number of vertices, tetrahedra, prisms, triangles, quadrilaterals, and edges of a mesh.
 
LIBMMG3D_EXPORT int MMG3D_Set_vertex (MMG5_pMesh mesh, double c0, double c1, double c2, MMG5_int ref, MMG5_int pos)
 Set the coordinates of a single vertex.
 
LIBMMG3D_EXPORT int MMG3D_Set_vertices (MMG5_pMesh mesh, double *vertices, MMG5_int *refs)
 Set all vertex coordinates and references in a mesh structure.
 
LIBMMG3D_EXPORT int MMG3D_Set_tetrahedron (MMG5_pMesh mesh, MMG5_int v0, MMG5_int v1, MMG5_int v2, MMG5_int v3, MMG5_int ref, MMG5_int pos)
 set a single tetrahedron's vertices
 
LIBMMG3D_EXPORT int MMG3D_Set_tetrahedra (MMG5_pMesh mesh, MMG5_int *tetra, MMG5_int *refs)
 Set the vertices and references of all tetrahedra in a mesh structure.
 
LIBMMG3D_EXPORT int MMG3D_Set_prism (MMG5_pMesh mesh, MMG5_int v0, MMG5_int v1, MMG5_int v2, MMG5_int v3, MMG5_int v4, MMG5_int v5, MMG5_int ref, MMG5_int pos)
 Set the vertices and reference of a single prism in a mesh.
 
LIBMMG3D_EXPORT int MMG3D_Set_prisms (MMG5_pMesh mesh, MMG5_int *prisms, MMG5_int *refs)
 Set the vertices and references of all prisms in a mesh.
 
LIBMMG3D_EXPORT int MMG3D_Set_triangle (MMG5_pMesh mesh, MMG5_int v0, MMG5_int v1, MMG5_int v2, MMG5_int ref, MMG5_int pos)
 Set the vertices and reference of a single triangle in a mesh.
 
LIBMMG3D_EXPORT int MMG3D_Set_triangles (MMG5_pMesh mesh, MMG5_int *tria, MMG5_int *refs)
 Set the vertices and references of all triangles in a mesh.
 
LIBMMG3D_EXPORT int MMG3D_Set_quadrilateral (MMG5_pMesh mesh, MMG5_int v0, MMG5_int v1, MMG5_int v2, MMG5_int v3, MMG5_int ref, MMG5_int pos)
 Set the vertices and reference of a single quadrilateral in a mesh.
 
LIBMMG3D_EXPORT int MMG3D_Set_quadrilaterals (MMG5_pMesh mesh, MMG5_int *quads, MMG5_int *refs)
 Set the vertices and references of all quadrilaterals in a mesh.
 
LIBMMG3D_EXPORT int MMG3D_Set_edge (MMG5_pMesh mesh, MMG5_int v0, MMG5_int v1, MMG5_int ref, MMG5_int pos)
 Set the vertices and reference of a single edge in a mesh.
 
LIBMMG3D_EXPORT int MMG3D_Set_corner (MMG5_pMesh mesh, MMG5_int k)
 Assign the "corner" attribute to a vertex.
 
LIBMMG3D_EXPORT int MMG3D_Unset_corner (MMG5_pMesh mesh, MMG5_int k)
 Remove the "corner" attribute from a vertex.
 
LIBMMG3D_EXPORT int MMG3D_Set_requiredVertex (MMG5_pMesh mesh, MMG5_int k)
 Assign the "required" attribute to a vertex.
 
LIBMMG3D_EXPORT int MMG3D_Unset_requiredVertex (MMG5_pMesh mesh, MMG5_int k)
 Remove required attribute from a vertex.
 
LIBMMG3D_EXPORT int MMG3D_Set_requiredTetrahedron (MMG5_pMesh mesh, MMG5_int k)
 Assign the "required" attribute to a tetrahedron.
 
LIBMMG3D_EXPORT int MMG3D_Unset_requiredTetrahedron (MMG5_pMesh mesh, MMG5_int k)
 Remove the "required" attribute from a tetrahedron.
 
LIBMMG3D_EXPORT int MMG3D_Set_requiredTetrahedra (MMG5_pMesh mesh, MMG5_int *reqIdx, MMG5_int nreq)
 Assign the "required" attribute to multiple tetrahedra.
 
LIBMMG3D_EXPORT int MMG3D_Unset_requiredTetrahedra (MMG5_pMesh mesh, MMG5_int *reqIdx, MMG5_int nreq)
 Remove the "required" attribute from multiple tetrahedra.
 
LIBMMG3D_EXPORT int MMG3D_Set_requiredTriangle (MMG5_pMesh mesh, MMG5_int k)
 Assign the "required" attribute to a single triangle.
 
LIBMMG3D_EXPORT int MMG3D_Unset_requiredTriangle (MMG5_pMesh mesh, MMG5_int k)
 Remove the "required" attribute from a single triangle.
 
LIBMMG3D_EXPORT int MMG3D_Set_requiredTriangles (MMG5_pMesh mesh, MMG5_int *reqIdx, MMG5_int nreq)
 Assign the "required" attribute to multiple triangles.
 
LIBMMG3D_EXPORT int MMG3D_Unset_requiredTriangles (MMG5_pMesh mesh, MMG5_int *reqIdx, MMG5_int nreq)
 Remove the "required" attribute from multiple triangles.
 
LIBMMG3D_EXPORT int MMG3D_Set_parallelTriangle (MMG5_pMesh mesh, MMG5_int k)
 Assign the "parallel" attribute to a single triangle.
 
LIBMMG3D_EXPORT int MMG3D_Unset_parallelTriangle (MMG5_pMesh mesh, MMG5_int k)
 Remove the "parallel" attribute from a single triangle.
 
LIBMMG3D_EXPORT int MMG3D_Set_parallelTriangles (MMG5_pMesh mesh, MMG5_int *parIdx, MMG5_int npar)
 Assign the "parallel" attribute to multiple triangles.
 
LIBMMG3D_EXPORT int MMG3D_Unset_parallelTriangles (MMG5_pMesh mesh, MMG5_int *parIdx, MMG5_int npar)
 Remove the "parallel" attribute from multiple triangles.
 
LIBMMG3D_EXPORT int MMG3D_Set_ridge (MMG5_pMesh mesh, MMG5_int k)
 Assign the "ridge" attribute to a single edge.
 
LIBMMG3D_EXPORT int MMG3D_Unset_ridge (MMG5_pMesh mesh, MMG5_int k)
 Remove the "ridge" attribute from a single edge.
 
LIBMMG3D_EXPORT int MMG3D_Set_requiredEdge (MMG5_pMesh mesh, MMG5_int k)
 Assign the "required" attribute to a single edge.
 
LIBMMG3D_EXPORT int MMG3D_Unset_requiredEdge (MMG5_pMesh mesh, MMG5_int k)
 Remove the "required" attribute from a single edge.
 
LIBMMG3D_EXPORT int MMG3D_Set_normalAtVertex (MMG5_pMesh mesh, MMG5_int k, double n0, double n1, double n2)
 Set the normal orientation at a single vertex.
 
LIBMMG3D_EXPORT int MMG3D_Set_scalarSol (MMG5_pSol met, double s, MMG5_int pos)
 Set a single element of a scalar solution structure.
 
LIBMMG3D_EXPORT int MMG3D_Set_scalarSols (MMG5_pSol met, double *s)
 Set the values of all elements of a scalar solution structure.
 
LIBMMG3D_EXPORT int MMG3D_Set_vectorSol (MMG5_pSol met, double vx, double vy, double vz, MMG5_int pos)
 Set a single element of a vector solution structure.
 
LIBMMG3D_EXPORT int MMG3D_Set_vectorSols (MMG5_pSol met, double *sols)
 Set all elements of a vector solution structure.
 
LIBMMG3D_EXPORT int MMG3D_Set_tensorSol (MMG5_pSol met, double m11, double m12, double m13, double m22, double m23, double m33, MMG5_int pos)
 Set a single element of a tensor solution structure.
 
LIBMMG3D_EXPORT int MMG3D_Set_tensorSols (MMG5_pSol met, double *sols)
 Set all elements of a tensor solution structure.
 
LIBMMG3D_EXPORT int MMG3D_Set_ithSol_inSolsAtVertices (MMG5_pSol sol, int i, double *s, MMG5_int pos)
 Set a single element of one out of multiple solution fields that are defined on vertices.
 
LIBMMG3D_EXPORT int MMG3D_Set_ithSols_inSolsAtVertices (MMG5_pSol sol, int i, double *s)
 Set all elements of one out of multiple solution fields that are defined on vertices.
 
LIBMMG3D_EXPORT void MMG3D_Set_handGivenMesh (MMG5_pMesh mesh)
 Finish providing mesh data without using the API functions.
 
LIBMMG3D_EXPORT int MMG3D_Chk_meshData (MMG5_pMesh mesh, MMG5_pSol met)
 Check if the number of given entities match with mesh and sol size.
 
LIBMMG3D_EXPORT int MMG3D_Set_iparameter (MMG5_pMesh mesh, MMG5_pSol sol, int iparam, MMG5_int val)
 set an integer parameter of the remesher
 
LIBMMG3D_EXPORT int MMG3D_Set_dparameter (MMG5_pMesh mesh, MMG5_pSol sol, int dparam, double val)
 set a real-valued parameter of the remesher
 
LIBMMG3D_EXPORT int MMG3D_Set_localParameter (MMG5_pMesh mesh, MMG5_pSol sol, int typ, MMG5_int ref, double hmin, double hmax, double hausd)
 set a local parameter
 
LIBMMG3D_EXPORT int MMG3D_Set_multiMat (MMG5_pMesh mesh, MMG5_pSol sol, MMG5_int ref, int split, MMG5_int rmin, MMG5_int rplus)
 Set the reference mapping for the elements of reference ref in level-set discretization mode.
 
LIBMMG3D_EXPORT int MMG3D_Set_lsBaseReference (MMG5_pMesh mesh, MMG5_pSol sol, MMG5_int br)
 Set a new level-set base reference.
 
LIBMMG3D_EXPORT int MMG3D_Get_meshSize (MMG5_pMesh mesh, MMG5_int *np, MMG5_int *ne, MMG5_int *nprism, MMG5_int *nt, MMG5_int *nquad, MMG5_int *na)
 Get the number of vertices, tetrahedra, prisms, triangles, quadrilaterals and edges of the mesh.
 
LIBMMG3D_EXPORT int MMG3D_Get_solSize (MMG5_pMesh mesh, MMG5_pSol sol, int *typEntity, MMG5_int *np, int *typSol)
 Get the number of elements, dimension, and type of a solution structure.
 
LIBMMG3D_EXPORT int MMG3D_Get_solsAtVerticesSize (MMG5_pMesh mesh, MMG5_pSol *sol, int *nsols, MMG5_int *nentities, int *typSol)
 Get the number of elements, type, and dimensions of several solutions defined on vertices.
 
LIBMMG3D_EXPORT int MMG3D_Get_vertex (MMG5_pMesh mesh, double *c0, double *c1, double *c2, MMG5_int *ref, int *isCorner, int *isRequired)
 Get the coordinates c0, c1,c2 and reference ref of the next vertex of mesh.
 
LIBMMG3D_EXPORT int MMG3D_GetByIdx_vertex (MMG5_pMesh mesh, double *c0, double *c1, double *c2, MMG5_int *ref, int *isCorner, int *isRequired, MMG5_int idx)
 Get the coordinates and reference of a specific vertex in the mesh.
 
LIBMMG3D_EXPORT int MMG3D_Get_vertices (MMG5_pMesh mesh, double *vertices, MMG5_int *refs, int *areCorners, int *areRequired)
 Get the coordinates and references of all vertices in the mesh.
 
LIBMMG3D_EXPORT int MMG3D_Get_tetrahedron (MMG5_pMesh mesh, MMG5_int *v0, MMG5_int *v1, MMG5_int *v2, MMG5_int *v3, MMG5_int *ref, int *isRequired)
 Get the vertices and reference of the next tetrahedron in the mesh.
 
LIBMMG3D_EXPORT int MMG3D_Get_tetrahedra (MMG5_pMesh mesh, MMG5_int *tetra, MMG5_int *refs, int *areRequired)
 Get the vertices and reference of all tetrahedra in the mesh.
 
LIBMMG3D_EXPORT int MMG3D_Get_prism (MMG5_pMesh mesh, MMG5_int *v0, MMG5_int *v1, MMG5_int *v2, MMG5_int *v3, MMG5_int *v4, MMG5_int *v5, MMG5_int *ref, int *isRequired)
 Get the vertices and reference of the next prism in the mesh.
 
LIBMMG3D_EXPORT int MMG3D_Get_prisms (MMG5_pMesh mesh, MMG5_int *prisms, MMG5_int *refs, int *areRequired)
 Get the vertices and references of all prisms in the mesh.
 
LIBMMG3D_EXPORT int MMG3D_Get_triangle (MMG5_pMesh mesh, MMG5_int *v0, MMG5_int *v1, MMG5_int *v2, MMG5_int *ref, int *isRequired)
 Get the vertices and reference of the next triangle in the mesh.
 
LIBMMG3D_EXPORT int MMG3D_Get_triangles (MMG5_pMesh mesh, MMG5_int *tria, MMG5_int *refs, int *areRequired)
 Get the vertices and references of all triangles in the mesh.
 
LIBMMG3D_EXPORT int MMG3D_Get_quadrilateral (MMG5_pMesh mesh, MMG5_int *v0, MMG5_int *v1, MMG5_int *v2, MMG5_int *v3, MMG5_int *ref, int *isRequired)
 Get the vertices and reference of the next quadrilateral of the mesh.
 
LIBMMG3D_EXPORT int MMG3D_Get_quadrilaterals (MMG5_pMesh mesh, MMG5_int *quads, MMG5_int *refs, int *areRequired)
 Get the vertices and references of all quadrilaterals of the mesh.
 
LIBMMG3D_EXPORT int MMG3D_Get_edge (MMG5_pMesh mesh, MMG5_int *e0, MMG5_int *e1, MMG5_int *ref, int *isRidge, int *isRequired)
 Get the vertices and reference of the next edge in the mesh.
 
LIBMMG3D_EXPORT int MMG3D_Set_edges (MMG5_pMesh mesh, MMG5_int *edges, MMG5_int *refs)
 Set the vertices and references of all edges in a mesh.
 
LIBMMG3D_EXPORT int MMG3D_Get_edges (MMG5_pMesh mesh, MMG5_int *edges, MMG5_int *refs, int *areRidges, int *areRequired)
 Get the vertices and references of all edges in a mesh.
 
LIBMMG3D_EXPORT int MMG3D_Get_normalAtVertex (MMG5_pMesh mesh, MMG5_int k, double *n0, double *n1, double *n2)
 Get the normal orientation at a single mesh vertex.
 
LIBMMG3D_EXPORT double MMG3D_Get_tetrahedronQuality (MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k)
 Get the quality measure of a single tetrahedron in the mesh.
 
LIBMMG3D_EXPORT int MMG3D_Get_scalarSol (MMG5_pSol met, double *s)
 Get the next element of a scalar solution structure defined at vertices.
 
LIBMMG3D_EXPORT int MMG3D_Get_scalarSols (MMG5_pSol met, double *s)
 Get all elements of a scalar solution structure defined at vertices.
 
LIBMMG3D_EXPORT int MMG3D_Get_vectorSol (MMG5_pSol met, double *vx, double *vy, double *vz)
 Get the next element of a vector solution structure.
 
LIBMMG3D_EXPORT int MMG3D_Get_vectorSols (MMG5_pSol met, double *sols)
 Get all elements of a vector solution structure.
 
LIBMMG3D_EXPORT int MMG3D_Get_tensorSol (MMG5_pSol met, double *m11, double *m12, double *m13, double *m22, double *m23, double *m33)
 Get the next element of a tensor solution structure.
 
LIBMMG3D_EXPORT int MMG3D_Get_tensorSols (MMG5_pSol met, double *sols)
 Get all elements of a tensor solution field.
 
LIBMMG3D_EXPORT int MMG3D_Get_ithSol_inSolsAtVertices (MMG5_pSol sol, int i, double *s, MMG5_int pos)
 Get one out of several solutions at a specific vertex.
 
LIBMMG3D_EXPORT int MMG3D_Get_ithSols_inSolsAtVertices (MMG5_pSol sol, int i, double *s)
 Get one out of several solutions at all vertices in the mesh.
 
LIBMMG3D_EXPORT int MMG3D_Get_iparameter (MMG5_pMesh mesh, MMG5_int iparam)
 Get the value of an integer parameter of the remesher.
 
LIBMMG3D_EXPORT int MMG3D_Add_tetrahedron (MMG5_pMesh mesh, MMG5_int v0, MMG5_int v1, MMG5_int v2, MMG5_int v3, MMG5_int ref)
 Add a tetrahedron to the mesh.
 
LIBMMG3D_EXPORT MMG5_int MMG3D_Add_vertex (MMG5_pMesh mesh, double c0, double c1, double c2, MMG5_int ref)
 Add a vertex to the mesh.
 
LIBMMG3D_EXPORT int MMG3D_loadMesh (MMG5_pMesh mesh, const char *filename)
 Load a mesh (in .mesh/.mesb format) from file.
 
LIBMMG3D_EXPORT int MMG3D_loadMshMesh (MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
 Load a mesh and possibly a solution in .msh format from file.
 
LIBMMG3D_EXPORT int MMG3D_loadVtuMesh (MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol sol, const char *filename)
 Load a mesh and possibly a solution in VTU (VTK) format from file.
 
LIBMMG3D_EXPORT int MMG3D_loadVtuMesh_and_allData (MMG5_pMesh mesh, MMG5_pSol *sol, const char *filename)
 Load a mesh and multiple solutions in VTU (VTK) format from file.
 
LIBMMG3D_EXPORT int MMG3D_loadVtkMesh (MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol sol, const char *filename)
 Load a mesh and possibly a solution from a file in VTK format.
 
LIBMMG3D_EXPORT int MMG3D_loadVtkMesh_and_allData (MMG5_pMesh mesh, MMG5_pSol *sol, const char *filename)
 Load a mesh and multiple solutions from a file in VTK format.
 
LIBMMG3D_EXPORT int MMG3D_loadMshMesh_and_allData (MMG5_pMesh mesh, MMG5_pSol *sol, const char *filename)
 Load a mesh and all data from a file in MSH format.
 
LIBMMG3D_EXPORT int MMG3D_loadGenericMesh (MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol sol, const char *filename)
 Read mesh data in a format determined by the filename extension.
 
LIBMMG3D_EXPORT int MMG3D_saveMesh (MMG5_pMesh mesh, const char *filename)
 Save a mesh in .mesh/.meshb format.
 
LIBMMG3D_EXPORT int MMG3D_saveMshMesh (MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
 Save a mesh in MSH format, ascii or binary depending on the filename extension.
 
LIBMMG3D_EXPORT int MMG3D_saveMshMesh_and_allData (MMG5_pMesh mesh, MMG5_pSol *sol, const char *filename)
 Save a mesh and data in MSH format, ascii or binary depending on the filename extension.
 
LIBMMG3D_EXPORT int MMG3D_saveVtkMesh (MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
 Save a mesh and optionally one solution in VTK format.
 
LIBMMG3D_EXPORT int MMG3D_saveVtkMesh_and_allData (MMG5_pMesh mesh, MMG5_pSol *sol, const char *filename)
 Save a mesh and multiple data fields in VTK format.
 
LIBMMG3D_EXPORT int MMG3D_saveVtuMesh (MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
 Save a mesh and optionally one data field in VTU format.
 
LIBMMG3D_EXPORT int MMG3D_saveVtuMesh_and_allData (MMG5_pMesh mesh, MMG5_pSol *sol, const char *filename)
 Save a mesh and multiple data fields in VTU format.
 
LIBMMG3D_EXPORT int MMG3D_saveTetgenMesh (MMG5_pMesh, const char *)
 Save data in Tetgen's Triangle format.
 
LIBMMG3D_EXPORT int MMG3D_saveGenericMesh (MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
 Save mesh data in a file whose format depends on the filename extension.
 
LIBMMG3D_EXPORT int MMG3D_loadSol (MMG5_pMesh mesh, MMG5_pSol met, const char *filename)
 Load a metric field (or other solution).
 
LIBMMG3D_EXPORT int MMG3D_loadAllSols (MMG5_pMesh mesh, MMG5_pSol *sol, const char *filename)
 Load one or more solutions in a solution file in medit file format.
 
LIBMMG3D_EXPORT int MMG3D_saveSol (MMG5_pMesh mesh, MMG5_pSol met, const char *filename)
 Write isotropic or anisotropic metric.
 
LIBMMG3D_EXPORT int MMG3D_saveAllSols (MMG5_pMesh mesh, MMG5_pSol *sol, const char *filename)
 Save 1 or more solutions in medit solution file format.
 
LIBMMG3D_EXPORT int MMG3D_Free_allSols (MMG5_pMesh mesh, MMG5_pSol *sol)
 Deallocate an array of solution fields.
 
LIBMMG3D_EXPORT int MMG3D_Free_all (const int starter,...)
 Deallocations before return.
 
LIBMMG3D_EXPORT int MMG3D_Free_structures (const int starter,...)
 Structure deallocations before return.
 
LIBMMG3D_EXPORT int MMG3D_Free_names (const int starter,...)
 Structure deallocations before return.
 
LIBMMG3D_EXPORT int MMG3D_mmg3dlib (MMG5_pMesh mesh, MMG5_pSol met)
 Main "program" for the mesh adaptation library.
 
LIBMMG3D_EXPORT int MMG3D_mmg3dls (MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pSol met)
 Main "program" for the level-set discretization library.
 
LIBMMG3D_EXPORT int MMG3D_mmg3dmov (MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol disp)
 Main program for the rigid-body movement library.
 
LIBMMG3D_EXPORT int MMG3D_defaultValues (MMG5_pMesh mesh)
 Print the default parameters values.
 
LIBMMG3D_EXPORT int MMG3D_parsar (int argc, char *argv[], MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol sol)
 Store command-line arguments.
 
LIBMMG3D_EXPORT int MMG3D_parsop (MMG5_pMesh mesh, MMG5_pSol met)
 Read a file containing Local parameters (.mmg3d extension)
 
LIBMMG3D_EXPORT int MMG3D_usage (char *prog)
 Print help for mmg3d options.
 
LIBMMG3D_EXPORT int MMG3D_stockOptions (MMG5_pMesh mesh, MMG5_Info *info)
 Store the info structure in the mesh structure.
 
LIBMMG3D_EXPORT void MMG3D_destockOptions (MMG5_pMesh mesh, MMG5_Info *info)
 Recover the info structure stored in the mesh structure.
 
LIBMMG3D_EXPORT int MMG3D_mmg3dcheck (MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol sol, double critmin, double lmin, double lmax, MMG5_int *eltab, int8_t metRidTyp)
 Search invalid elements (in term of quality or edge length) in a mesh.
 
LIBMMG3D_EXPORT void MMG3D_searchqua (MMG5_pMesh mesh, MMG5_pSol met, double critmin, MMG5_int *eltab, int8_t metRidTyp)
 List bad elements.
 
LIBMMG3D_EXPORT int MMG3D_searchlen (MMG5_pMesh mesh, MMG5_pSol met, double lmin, double lmax, MMG5_int *eltab, int8_t metRidTyp)
 List edges that are too short or too long.
 
LIBMMG3D_EXPORT int MMG3D_Get_adjaTet (MMG5_pMesh mesh, MMG5_int kel, MMG5_int listet[4])
 Return adjacent elements of a tetrahedron.
 
LIBMMG3D_EXPORT int MMG3D_hashTetra (MMG5_pMesh mesh, int pack)
 Create array of adjacency.
 
LIBMMG3D_EXPORT int MMG3D_Set_constantSize (MMG5_pMesh mesh, MMG5_pSol met)
 Compute a constant size map according to the hsiz, hmin and hmax parameters.
 
LIBMMG3D_EXPORT int MMG3D_switch_metricStorage (MMG5_pMesh mesh, MMG5_pSol met)
 Swap the m22 and m23 values of the metric.
 
LIBMMG3D_EXPORT void MMG3D_setfunc (MMG5_pMesh mesh, MMG5_pSol met)
 Set function pointers for caltet, lenedg, lenedgCoor defsiz, gradsiz... depending if the metric that was read is anisotropic or isotropic.
 
LIBMMG3D_EXPORT int MMG3D_Get_numberOfNonBdyTriangles (MMG5_pMesh mesh, MMG5_int *nb_tria)
 Get the number of non-boundary triangles.
 
LIBMMG3D_EXPORT int MMG3D_Get_nonBdyTriangle (MMG5_pMesh mesh, MMG5_int *v0, MMG5_int *v1, MMG5_int *v2, MMG5_int *ref, MMG5_int idx)
 Get vertices and reference of a non-boundary triangle.
 
LIBMMG3D_EXPORT int MMG3D_Get_tetFromTria (MMG5_pMesh mesh, MMG5_int ktri, MMG5_int *ktet, int *iface)
 Get a tetrahedron given one of its triangles and the index by which it refers to this triangle (DEPRECATED).
 
LIBMMG3D_EXPORT int MMG3D_Get_tetsFromTria (MMG5_pMesh mesh, MMG5_int ktri, MMG5_int ktet[2], int iface[2])
 Get two tetrahedra given a triangle and face indices.
 
LIBMMG3D_EXPORT int MMG3D_Compute_eigenv (double m[6], double lambda[3], double vp[3][3])
 Compute the real eigenvalues and eigenvectors of a symmetric matrix.
 
LIBMMG3D_EXPORT int MMG3D_Clean_isoSurf (MMG5_pMesh mesh)
 Clean data (triangles and edges) linked to isosurface.
 
LIBMMG3D_EXPORT void MMG3D_Free_solutions (MMG5_pMesh mesh, MMG5_pSol sol)
 Free the solution structure of a given mesh.
 
LIBMMG3D_EXPORT void MMG3D_Set_commonFunc (void)
 

Variables

LIBMMG3D_EXPORT double(* MMG3D_lenedgCoor )(double *ca, double *cb, double *sa, double *sb)
 Compute the length of an edge according to the size prescription.
 
LIBMMG3D_EXPORT int(* MMG3D_doSol )(MMG5_pMesh mesh, MMG5_pSol met)
 Compute isotropic size map according to the mean of the length of the edges passing through a vertex.
 

Detailed Description

API headers and documentation for the mmg3d library, for volumetric meshes in 3D.

Author
Algiane Froehly (Inria/UBordeaux)
Version
5
Date
01 2014

These are the API functions for the mmg3d library. These functions allow to load and save meshes and data defined on meshes; add, extract, or modify mesh data; and to call the library functions that perform remeshing, level-set discretization, and Lagrangian motion.

Meshes are here defined in terms of vertices and three-dimensional objects: tetrahedra and prisms. Optionally lower-dimensional entities can be present: triangles, quadrilaterals and edges. All of these entities can have a reference: an integer value that can serve as a group identifier. In addition mesh entities can have attributes such as "ridge" or "required".

Data defined on meshes can be for example functions that are meant for level-set discretization, metric tensors that will govern edge lengths, and vector fields governing lagrangian motion. These data can be scalar, vector, or (symmetric) tensor-valued; and there can be more than one data item associated with a mesh entity. These data are often referred to as solutions.

Three of the functions here are referred to as "programs", because they perform the tasks for which Mmg is meant: remeshing, level-set discretization and Lagrangian motion. The other functions merely serve to load and save data and to perform pre- and post-processing. These programs actually behave much like independent programs: they send diagnostic output to stdout and in rare cases they may call the exit() function.

Examples

A very simple example code for mesh adaptation with automatic parsing of .mesh files

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <float.h>
// if the header file is in the "include" directory
// #include "libmmg3d.h"
// if the header file is in "include/mmg/mmg3d"
#include "mmg/mmg3d/libmmg3d.h"
int main(int argc,char *argv[]) {
MMG5_pMesh mmgMesh;
MMG5_pSol mmgSol;
int ier;
char *filename, *fileout;
fprintf(stdout," -- TEST MMG3DLIB \n");
if ( argc != 3 ) {
printf(" Usage: %s filein fileout \n",argv[0]);
return(1);
}
/* Name and path of the mesh file */
filename = (char *) calloc(strlen(argv[1]) + 1, sizeof(char));
if ( filename == NULL ) {
perror(" ## Memory problem: calloc");
exit(EXIT_FAILURE);
}
strcpy(filename,argv[1]);
fileout = (char *) calloc(strlen(argv[2]) + 1, sizeof(char));
if ( fileout == NULL ) {
perror(" ## Memory problem: calloc");
exit(EXIT_FAILURE);
}
strcpy(fileout,argv[2]);
/* args of InitMesh:
* MMG5_ARG_start: we start to give the args of a variadic func
* MMG5_ARG_ppMesh: next arg will be a pointer over a MMG5_pMesh
* &mmgMesh: pointer toward your MMG5_pMesh (that store your mesh)
* MMG5_ARG_ppMet: next arg will be a pointer over a MMG5_pSol storing a metric
* &mmgSol: pointer toward your MMG5_pSol (that store your metric) */
mmgMesh = NULL;
mmgSol = NULL;
MMG5_ARG_ppMesh,&mmgMesh,MMG5_ARG_ppMet,&mmgSol,
if ( MMG3D_loadMesh(mmgMesh,filename) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_loadSol(mmgMesh,mmgSol,filename) != 1 )
exit(EXIT_FAILURE);
if ( MMG3D_Chk_meshData(mmgMesh,mmgSol) != 1 ) exit(EXIT_FAILURE);
ier = MMG3D_mmg3dlib(mmgMesh,mmgSol);
if ( ier == MMG5_STRONGFAILURE ) {
fprintf(stdout,"BAD ENDING OF MMG3DLIB: UNABLE TO SAVE MESH\n");
return(ier);
} else if ( ier == MMG5_LOWFAILURE )
fprintf(stdout,"BAD ENDING OF MMG3DLIB\n");
if ( MMG3D_saveMesh(mmgMesh,fileout) != 1 ) {
fprintf(stdout,"UNABLE TO SAVE MESH\n");
}
if ( MMG3D_saveSol(mmgMesh,mmgSol,fileout) != 1 ) {
fprintf(stdout,"UNABLE TO SAVE SOL\n");
return(MMG5_LOWFAILURE);
}
MMG5_ARG_ppMesh,&mmgMesh,MMG5_ARG_ppMet,&mmgSol,
free(filename);
filename = NULL;
free(fileout);
fileout = NULL;
return(ier);
}
int MMG3D_Init_mesh(const int starter,...)
Initialize a mesh structure and optionally the associated solution and metric structures.
int MMG3D_Chk_meshData(MMG5_pMesh mesh, MMG5_pSol met)
Check if the number of given entities match with mesh and sol size.
int MMG3D_Free_all(const int starter,...)
Deallocations before return.
int ier
MMG5_pMesh char * filename
program main
Example for using mmglib (basic use)
Definition: main.F90:6
int MMG3D_saveMesh(MMG5_pMesh mesh, const char *filename)
Save a mesh in .mesh/.meshb format.
Definition: inout_3d.c:1273
int MMG3D_loadSol(MMG5_pMesh mesh, MMG5_pSol met, const char *filename)
Load a metric field (or other solution).
Definition: inout_3d.c:2143
int MMG3D_loadMesh(MMG5_pMesh mesh, const char *filename)
Load a mesh (in .mesh/.mesb format) from file.
Definition: inout_3d.c:1049
int MMG3D_saveSol(MMG5_pMesh mesh, MMG5_pSol met, const char *filename)
Write isotropic or anisotropic metric.
Definition: inout_3d.c:2314
int MMG3D_mmg3dlib(MMG5_pMesh mesh, MMG5_pSol met)
Main "program" for the mesh adaptation library.
Definition: libmmg3d.c:975
#define MMG5_ARG_ppMesh
Definition: libmmgtypes.h:102
#define MMG5_ARG_end
Definition: libmmgtypes.h:179
#define MMG5_STRONGFAILURE
Definition: libmmgtypes.h:65
#define MMG5_LOWFAILURE
Definition: libmmgtypes.h:57
#define MMG5_ARG_start
Definition: libmmgtypes.h:93
#define MMG5_ARG_ppMet
Definition: libmmgtypes.h:122
MMG mesh structure.
Definition: libmmgtypes.h:613

Mesh adaptation example in which get/set functions are used to provide input to the library and to extract the output mesh.

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <float.h>
// if the header file is in the "include" directory
// #include "libmmg3d.h"
// if the header file is in "include/mmg/mmg3d"
#include "mmg/mmg3d/libmmg3d.h"
#define MAX0(a,b) (((a) > (b)) ? (a) : (b))
#define MAX4(a,b,c,d) (((MAX0(a,b)) > (MAX0(c,d))) ? (MAX0(a,b)) : (MAX0(c,d)))
int main(int argc,char *argv[]) {
MMG5_pMesh mmgMesh;
MMG5_pSol mmgSol;
int ier;
/* To save final mesh in a file */
FILE* inm;
/* To manually recover the mesh */
MMG5_int k,np,ne,nt,na,nc,nr,nreq,ref,Tetra[4],Tria[3],Edge[2];
MMG5_int ktet[2];
int typEntity, typSol,iface[2];
int *corner, *required, *ridge;
double Point[3],Sol;
char *fileout, *solout;
fprintf(stdout," -- TEST MMG3DLIB \n");
if ( argc != 2 ) {
printf(" Usage: %s fileout\n",argv[0]);
return(1);
}
/* Name and path of the mesh file */
fileout = (char *) calloc(strlen(argv[1]) + 6, sizeof(char));
if ( fileout == NULL ) {
perror(" ## Memory problem: calloc");
exit(EXIT_FAILURE);
}
strcpy(fileout,argv[1]);
strcat(fileout,".mesh");
solout = (char *) calloc(strlen(argv[1]) + 5, sizeof(char));
if ( solout == NULL ) {
perror(" ## Memory problem: calloc");
exit(EXIT_FAILURE);
}
strcpy(solout,argv[1]);
strcat(solout,".sol");
/* args of InitMesh:
* MMG5_ARG_start: we start to give the args of a variadic func
* MMG5_ARG_ppMesh: next arg will be a pointer over a MMG5_pMesh
* &mmgMesh: pointer toward your MMG5_pMesh (that store your mesh)
* MMG5_ARG_ppMet: next arg will be a pointer over a MMG5_pSol storing a metric
* &mmgSol: pointer toward your MMG5_pSol (that store your metric) */
mmgMesh = NULL;
mmgSol = NULL;
MMG5_ARG_ppMesh,&mmgMesh,MMG5_ARG_ppMet,&mmgSol,
if ( MMG3D_Set_meshSize(mmgMesh,12,12,0,20,0,0) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_vertex(mmgMesh,0 ,0 ,0 ,0, 1) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_vertex(mmgMesh,0.5,0 ,0 ,0, 2) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_vertex(mmgMesh,0.5,0 ,1 ,0, 3) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_vertex(mmgMesh,0 ,0 ,1 ,0, 4) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_vertex(mmgMesh,0 ,1 ,0 ,0, 5) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_vertex(mmgMesh,0.5,1 ,0 ,0, 6) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_vertex(mmgMesh,0.5,1 ,1 ,0, 7) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_vertex(mmgMesh,0 ,1 ,1 ,0, 8) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_vertex(mmgMesh,1 ,0 ,0 ,0, 9) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_vertex(mmgMesh,1 ,1 ,0 ,0, 10) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_vertex(mmgMesh,1 ,0 ,1 ,0, 11) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_vertex(mmgMesh,1 ,1 ,1 ,0, 12) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_tetrahedron(mmgMesh, 1, 4, 2, 8,1, 1) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_tetrahedron(mmgMesh, 8, 3, 2, 7,1, 2) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_tetrahedron(mmgMesh, 5, 2, 6, 8,1, 3) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_tetrahedron(mmgMesh, 5, 8, 1, 2,1, 4) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_tetrahedron(mmgMesh, 7, 2, 8, 6,1, 5) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_tetrahedron(mmgMesh, 2, 4, 3, 8,1, 6) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_tetrahedron(mmgMesh, 9, 2, 3, 7,2, 7) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_tetrahedron(mmgMesh, 7, 11, 9, 12,2, 8) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_tetrahedron(mmgMesh, 6, 9, 10, 7,2, 9) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_tetrahedron(mmgMesh, 6, 7, 2, 9,2,10) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_tetrahedron(mmgMesh, 12, 9, 7, 10,2,11) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_tetrahedron(mmgMesh, 9, 3, 11, 7,2,12) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_triangle(mmgMesh, 1, 4, 8, 3, 1) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_triangle(mmgMesh, 1, 2, 4, 3, 2) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_triangle(mmgMesh, 8, 3, 7, 3, 3) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_triangle(mmgMesh, 5, 8, 6, 3, 4) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_triangle(mmgMesh, 5, 6, 2, 3, 5) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_triangle(mmgMesh, 5, 2, 1, 3, 6) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_triangle(mmgMesh, 5, 1, 8, 3, 7) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_triangle(mmgMesh, 7, 6, 8, 3, 8) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_triangle(mmgMesh, 4, 3, 8, 3, 9) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_triangle(mmgMesh, 2, 3, 4, 3,10) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_triangle(mmgMesh, 9, 3, 2, 4,11) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_triangle(mmgMesh, 11, 9, 12, 4,12) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_triangle(mmgMesh, 7, 11, 12, 4,13) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_triangle(mmgMesh, 6, 7, 10, 4,14) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_triangle(mmgMesh, 6, 10, 9, 4,15) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_triangle(mmgMesh, 6, 9, 2, 4,16) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_triangle(mmgMesh, 12, 10, 7, 4,17) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_triangle(mmgMesh, 12, 9, 10, 4,18) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_triangle(mmgMesh, 3, 11, 7, 4,19) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_triangle(mmgMesh, 9, 11, 3, 4,20) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_solSize(mmgMesh,mmgSol,MMG5_Vertex,12,MMG5_Scalar) != 1 )
exit(EXIT_FAILURE);
for(k=1 ; k<=12 ; k++) {
if ( MMG3D_Set_scalarSol(mmgSol,0.5,k) != 1 ) exit(EXIT_FAILURE);
}
if ( MMG3D_Chk_meshData(mmgMesh,mmgSol) != 1 ) exit(EXIT_FAILURE);
ier = MMG3D_mmg3dlib(mmgMesh,mmgSol);
if ( ier == MMG5_STRONGFAILURE ) {
fprintf(stdout,"BAD ENDING OF MMG3DLIB: UNABLE TO SAVE MESH\n");
return(ier);
} else if ( ier == MMG5_LOWFAILURE )
fprintf(stdout,"BAD ENDING OF MMG3DLIB\n");
if( !(inm = fopen(fileout,"w")) ) {
fprintf(stderr," ** UNABLE TO OPEN OUTPUT MESH FILE.\n");
exit(EXIT_FAILURE);
}
fprintf(inm,"MeshVersionFormatted 2\n");
fprintf(inm,"\nDimension 3\n");
if ( MMG3D_Get_meshSize(mmgMesh,&np,&ne,NULL,&nt,NULL,&na) !=1 ) exit(EXIT_FAILURE);
/* Table to know if a vertex is corner */
corner = (int*)calloc(np+1,sizeof(int));
if ( !corner ) {
perror(" ## Memory problem: calloc");
exit(EXIT_FAILURE);
}
/* Table to know if a vertex/tetra/tria/edge is required */
required = (int*)calloc(MAX4(np,ne,nt,na)+1 ,sizeof(int));
if ( !required ) {
perror(" ## Memory problem: calloc");
exit(EXIT_FAILURE);
}
/* Table to know if an edge delimits a sharp angle */
ridge = (int*)calloc(na+1 ,sizeof(int));
if ( !ridge ) {
perror(" ## Memory problem: calloc");
exit(EXIT_FAILURE);
}
nreq = 0; nc = 0;
fprintf(inm,"\nVertices\n%"MMG5_PRId"\n",np);
for(k=1; k<=np; k++) {
if ( MMG3D_Get_vertex(mmgMesh,&(Point[0]),&(Point[1]),&(Point[2]),
&ref,&(corner[k]),&(required[k])) != 1 )
exit(EXIT_FAILURE);
fprintf(inm,"%.15lg %.15lg %.15lg %"MMG5_PRId" \n",Point[0],Point[1],Point[2],ref);
if ( corner[k] ) nc++;
if ( required[k] ) nreq++;
}
fprintf(inm,"\nCorners\n%"MMG5_PRId"\n",nc);
for(k=1; k<=np; k++) {
if ( corner[k] ) fprintf(inm,"%"MMG5_PRId" \n",k);
}
fprintf(inm,"\nRequiredVertices\n%"MMG5_PRId"\n",nreq);
for(k=1; k<=np; k++) {
if ( required[k] ) fprintf(inm,"%"MMG5_PRId" \n",k);
}
free(corner);
corner = NULL;
nreq = 0;
fprintf(inm,"\nTriangles\n%"MMG5_PRId"\n",nt);
for(k=1; k<=nt; k++) {
if ( MMG3D_Get_triangle(mmgMesh,&(Tria[0]),&(Tria[1]),&(Tria[2]),
&ref,&(required[k])) != 1 )
exit(EXIT_FAILURE);
fprintf(inm,"%"MMG5_PRId" %"MMG5_PRId" %"MMG5_PRId" %"MMG5_PRId" \n",Tria[0],Tria[1],Tria[2],ref);
if ( required[k] ) nreq++;
}
fprintf(inm,"\nRequiredTriangles\n%"MMG5_PRId"\n",nreq);
for(k=1; k<=nt; k++) {
if ( required[k] ) fprintf(inm,"%"MMG5_PRId" \n",k);
}
/* Facultative step : if you want to know with which tetrahedra a triangle is
* connected */
for(k=1; k<=nt; k++) {
ktet[0] = ktet[1] = 0;
iface[0] = iface[1] = 0;
if (! MMG3D_Get_tetFromTria(mmgMesh,k,ktet,iface) ) {
printf("Get tet from tria fail.\n");
return 0;
}
printf("Tria %"MMG5_PRId" is connected with tet %"MMG5_PRId" "
"(face %d) and %"MMG5_PRId" (face %d) \n",
k,ktet[0],iface[0],ktet[1],iface[1]);
}
nreq = 0;nr = 0;
fprintf(inm,"\nEdges\n%"MMG5_PRId"\n",na);
for(k=1; k<=na; k++) {
if ( MMG3D_Get_edge(mmgMesh,&(Edge[0]),&(Edge[1]),&ref,
&(ridge[k]),&(required[k])) != 1 ) exit(EXIT_FAILURE);
fprintf(inm,"%"MMG5_PRId" %"MMG5_PRId" %"MMG5_PRId" \n",Edge[0],Edge[1],ref);
if ( ridge[k] ) nr++;
if ( required[k] ) nreq++;
}
fprintf(inm,"\nRequiredEdges\n%"MMG5_PRId"\n",nreq);
for(k=1; k<=na; k++) {
if ( required[k] ) fprintf(inm,"%"MMG5_PRId" \n",k);
}
fprintf(inm,"\nRidges\n%"MMG5_PRId"\n",nr);
for(k=1; k<=na; k++) {
if ( ridge[k] ) fprintf(inm,"%"MMG5_PRId" \n",k);
}
nreq = 0;
fprintf(inm,"\nTetrahedra\n%"MMG5_PRId"\n",ne);
for(k=1; k<=ne; k++) {
if ( MMG3D_Get_tetrahedron(mmgMesh,&(Tetra[0]),&(Tetra[1]),&(Tetra[2]),&(Tetra[3]),
&ref,&(required[k])) != 1 ) exit(EXIT_FAILURE);
fprintf(inm,"%"MMG5_PRId" %"MMG5_PRId" %"MMG5_PRId" %"MMG5_PRId" %"MMG5_PRId" \n",
Tetra[0],Tetra[1],Tetra[2],Tetra[3],ref);
if ( required[k] ) nreq++;
}
fprintf(inm,"\nRequiredTetrahedra\n%"MMG5_PRId"\n",nreq);
for(k=1; k<=ne; k++) {
if ( required[k] ) fprintf(inm,"%"MMG5_PRId" \n",k);
}
fprintf(inm,"\nEnd\n");
fclose(inm);
free(required);
required = NULL;
free(ridge);
ridge = NULL;
if( !(inm = fopen(solout,"w")) ) {
fprintf(stderr," ** UNABLE TO OPEN OUTPUT FILE.\n");
exit(EXIT_FAILURE);
}
fprintf(inm,"MeshVersionFormatted 2\n");
fprintf(inm,"\nDimension 3\n");
if ( MMG3D_Get_solSize(mmgMesh,mmgSol,&typEntity,&np,&typSol) != 1 )
exit(EXIT_FAILURE);
if ( ( typEntity != MMG5_Vertex ) || ( typSol != MMG5_Scalar ) )
exit(EXIT_FAILURE);
fprintf(inm,"\nSolAtVertices\n%"MMG5_PRId"\n",np);
fprintf(inm,"1 1 \n\n");
for(k=1; k<=np; k++) {
if ( MMG3D_Get_scalarSol(mmgSol,&Sol) != 1 ) exit(EXIT_FAILURE);
fprintf(inm,"%.15lg \n",Sol);
}
fprintf(inm,"\nEnd\n");
fclose(inm);
MMG5_ARG_ppMesh,&mmgMesh,MMG5_ARG_ppMet,&mmgSol,
free(fileout);
fileout = NULL;
free(solout);
solout = NULL;
return(ier);
}
int MMG3D_Get_edge(MMG5_pMesh mesh, MMG5_int *e0, MMG5_int *e1, MMG5_int *ref, int *isRidge, int *isRequired)
Get the vertices and reference of the next edge in the mesh.
int MMG3D_Get_triangle(MMG5_pMesh mesh, MMG5_int *v0, MMG5_int *v1, MMG5_int *v2, MMG5_int *ref, int *isRequired)
Get the vertices and reference of the next triangle in the mesh.
int MMG3D_Set_tetrahedron(MMG5_pMesh mesh, MMG5_int v0, MMG5_int v1, MMG5_int v2, MMG5_int v3, MMG5_int ref, MMG5_int pos)
set a single tetrahedron's vertices
int MMG3D_Set_triangle(MMG5_pMesh mesh, MMG5_int v0, MMG5_int v1, MMG5_int v2, MMG5_int ref, MMG5_int pos)
Set the vertices and reference of a single triangle in a mesh.
int MMG3D_Get_tetrahedron(MMG5_pMesh mesh, MMG5_int *v0, MMG5_int *v1, MMG5_int *v2, MMG5_int *v3, MMG5_int *ref, int *isRequired)
Get the vertices and reference of the next tetrahedron in the mesh.
int MMG3D_Get_solSize(MMG5_pMesh mesh, MMG5_pSol sol, int *typEntity, MMG5_int *np, int *typSol)
Get the number of elements, dimension, and type of a solution structure.
int MMG3D_Set_scalarSol(MMG5_pSol met, double s, MMG5_int pos)
Set a single element of a scalar solution structure.
int MMG3D_Get_vertex(MMG5_pMesh mesh, double *c0, double *c1, double *c2, MMG5_int *ref, int *isCorner, int *isRequired)
Get the coordinates c0, c1,c2 and reference ref of the next vertex of mesh.
int MMG3D_Set_vertex(MMG5_pMesh mesh, double c0, double c1, double c2, MMG5_int ref, MMG5_int pos)
Set the coordinates of a single vertex.
int MMG3D_Get_scalarSol(MMG5_pSol met, double *s)
Get the next element of a scalar solution structure defined at vertices.
int MMG3D_Get_meshSize(MMG5_pMesh mesh, MMG5_int *np, MMG5_int *ne, MMG5_int *nprism, MMG5_int *nt, MMG5_int *nquad, MMG5_int *na)
Get the number of vertices, tetrahedra, prisms, triangles, quadrilaterals and edges of the mesh.
int MMG3D_Set_meshSize(MMG5_pMesh mesh, MMG5_int np, MMG5_int ne, MMG5_int nprism, MMG5_int nt, MMG5_int nquad, MMG5_int na)
Set the number of vertices, tetrahedra, prisms, triangles, quadrilaterals, and edges of a mesh.
int MMG3D_Set_solSize(MMG5_pMesh mesh, MMG5_pSol sol, int typEntity, MMG5_int np, int typSol)
Initialize a solution field.
#define MAX4(a, b, c, d)
Definition: main.c:25
LIBMMG3D_EXPORT int MMG3D_Get_tetFromTria(MMG5_pMesh mesh, MMG5_int ktri, MMG5_int *ktet, int *iface)
Get a tetrahedron given one of its triangles and the index by which it refers to this triangle (DEPRE...
@ MMG5_Scalar
Definition: libmmgtypes.h:219
@ MMG5_Vertex
Definition: libmmgtypes.h:230

Fortran example.

PROGRAM main
IMPLICIT NONE
! if the header file is in the "include" directory
! #include "libmmg3df.h"
! if the header file is in "include/mmg/mmg3d"
#include "mmg/mmg3d/libmmg3df.h"
mmg5_data_ptr_t :: mmgmesh
mmg5_data_ptr_t :: mmgsol
INTEGER :: ier,argc
CHARACTER(len=300) :: exec_name,filename,fileout
WRITE(*,*) " -- TEST MMG3DLIB"
argc = command_argument_count();
CALL get_command_argument(0, exec_name)
IF ( argc /=2 ) THEN
print*," Usage: ",trim(exec_name)," input_file_name output_filename"
CALL exit(1);
ENDIF
! Name and path of the mesh file
CALL get_command_argument(1, filename)
CALL get_command_argument(2, fileout)
mmgmesh = 0
mmgsol = 0
CALL mmg3d_init_mesh(mmg5_arg_start, &
mmg5_arg_ppmesh,mmgmesh,mmg5_arg_ppmet,mmgsol, &
mmg5_arg_end)
CALL mmg3d_loadmesh(mmgmesh,trim(adjustl(filename)),&
len(trim(adjustl(filename))),ier)
IF ( ier == 0 ) CALL exit(102)
CALL mmg3d_loadsol(mmgmesh,mmgsol,trim(adjustl(filename)),&
len(trim(adjustl(filename))),ier)
IF ( ier /= 1 ) THEN
CALL exit(104)
ENDIF
CALL mmg3d_chk_meshdata(mmgmesh,mmgsol,ier)
IF ( ier /= 1 ) CALL exit(105)
CALL mmg3d_mmg3dlib(mmgmesh,mmgsol,ier)
IF ( ier == mmg5_strongfailure ) THEN
print*,"BAD ENDING OF MMG3DLIB: UNABLE TO SAVE MESH"
stop 2
ELSE IF ( ier == mmg5_lowfailure ) THEN
print*,"BAD ENDING OF MMG3DLIB"
ENDIF
CALL mmg3d_savemesh(mmgmesh,trim(adjustl(fileout)),&
len(trim(adjustl(fileout))),ier)
IF ( ier /= 1 ) THEN
CALL exit(106)
ENDIF
CALL mmg3d_savesol(mmgmesh,mmgsol,trim(adjustl(fileout)),&
len(trim(adjustl(fileout))),ier)
IF ( ier /= 1 ) THEN
CALL exit(107)
ENDIF
CALL mmg3d_free_all(mmg5_arg_start, &
mmg5_arg_ppmesh,mmgmesh,mmg5_arg_ppmet,mmgsol, &
mmg5_arg_end)
END PROGRAM main
int main(int argc, char *argv[])
Definition: mmg2d.c:275

Another Fortran example.

!!> @author
PROGRAM main
IMPLICIT NONE
! if the header file is in the "include" directory
! #include "libmmg3df.h"
! if the header file is in "include/mmg/mmg3d"
#include "mmg/mmg3d/libmmg3df.h"
mmg5_data_ptr_t :: mmgmesh
mmg5_data_ptr_t :: mmgsol
INTEGER :: ier,argc
CHARACTER(len=300) :: exec_name,fileout
INTEGER :: inm=10
INTEGER(MMG5F_INT):: k, np, ne, nt, na, nc, nr, nreq, ref
INTEGER(MMG5F_INT):: Tetra(4), Tria(3), Edge(2)
INTEGER :: typEntity, typSol
DOUBLE PRECISION :: Point(3),Sol
INTEGER, DIMENSION(:), ALLOCATABLE :: corner, required, ridge
CHARACTER(LEN=31) :: FMT="(E14.8,1X,E14.8,1X,E14.8,1X,I3)"
INTEGER(MMG5F_INT),DIMENSION(2) :: ktet
INTEGER,DIMENSION(2) :: iface
INTEGER,PARAMETER :: immg = mmg5f_int
print*," -- TEST MMG3DLIB"
argc = command_argument_count();
CALL get_command_argument(0, exec_name)
IF ( argc /=1 ) THEN
print*," Usage: ",trim(exec_name)," output_filename"
CALL exit(1);
ENDIF
! Name and path of the mesh file
CALL get_command_argument(1, fileout)
mmgmesh = 0
mmgsol = 0
CALL mmg3d_init_mesh(mmg5_arg_start, &
mmg5_arg_ppmesh,mmgmesh,mmg5_arg_ppmet,mmgsol, &
mmg5_arg_end)
CALL mmg3d_set_iparameter(mmgmesh,mmgsol,mmg3d_iparam_verbose,5_immg,ier)
np = 12
ne = 12
nt = 20
CALL mmg3d_set_meshsize(mmgmesh,np,ne,0_immg,nt,0_immg,0_immg,ier)
IF ( ier /= 1 ) CALL exit(101)
CALL mmg3d_set_vertex(mmgmesh, 0.0d0, 0.0d0, 0.0d0, 0_immg, 1_immg,ier)
IF ( ier /= 1 ) CALL exit(102)
CALL mmg3d_set_vertex(mmgmesh, 0.5d0, 0.0d0, 0.0d0, 0_immg, 2_immg,ier)
IF ( ier /= 1 ) CALL exit(102)
CALL mmg3d_set_vertex(mmgmesh, 0.5d0, 0.0d0, 1.0d0, 0_immg, 3_immg,ier)
IF ( ier /= 1 ) CALL exit(102)
CALL mmg3d_set_vertex(mmgmesh, 0.0d0, 0.0d0, 1.0d0, 0_immg, 4_immg,ier)
IF ( ier /= 1 ) CALL exit(102)
CALL mmg3d_set_vertex(mmgmesh, 0.0d0, 1.0d0, 0.0d0, 0_immg, 5_immg,ier)
IF ( ier /= 1 ) CALL exit(102)
CALL mmg3d_set_vertex(mmgmesh, 0.5d0, 1.0d0, 0.0d0, 0_immg, 6_immg,ier)
IF ( ier /= 1 ) CALL exit(102)
CALL mmg3d_set_vertex(mmgmesh, 0.5d0, 1.0d0, 1.0d0, 0_immg, 7_immg,ier)
IF ( ier /= 1 ) CALL exit(102)
CALL mmg3d_set_vertex(mmgmesh, 0.0d0, 1.0d0, 1.0d0, 0_immg, 8_immg,ier)
IF ( ier /= 1 ) CALL exit(102)
CALL mmg3d_set_vertex(mmgmesh, 1.0d0, 0.0d0, 0.0d0, 0_immg, 9_immg,ier)
IF ( ier /= 1 ) CALL exit(102)
CALL mmg3d_set_vertex(mmgmesh, 1.0d0, 1.0d0, 0.0d0, 0_immg, 10_immg,ier)
IF ( ier /= 1 ) CALL exit(102)
CALL mmg3d_set_vertex(mmgmesh, 1.0d0, 0.0d0, 1.0d0, 0_immg, 11_immg,ier)
IF ( ier /= 1 ) CALL exit(102)
CALL mmg3d_set_vertex(mmgmesh, 1.0d0, 1.0d0, 1.0d0, 0_immg, 12_immg,ier)
IF ( ier /= 1 ) CALL exit(102)
ref = 1
CALL mmg3d_set_tetrahedron(mmgmesh, 1_immg, 4_immg, 2_immg, 8_immg,ref, 1_immg,ier)
IF ( ier /= 1 ) CALL exit(103)
CALL mmg3d_set_tetrahedron(mmgmesh, 8_immg, 3_immg, 2_immg, 7_immg,ref, 2_immg,ier)
IF ( ier /= 1 ) CALL exit(103)
CALL mmg3d_set_tetrahedron(mmgmesh, 5_immg, 2_immg, 6_immg, 8_immg,ref, 3_immg,ier)
IF ( ier /= 1 ) CALL exit(103)
CALL mmg3d_set_tetrahedron(mmgmesh, 5_immg, 8_immg, 1_immg, 2_immg,ref, 4_immg,ier)
IF ( ier /= 1 ) CALL exit(103)
CALL mmg3d_set_tetrahedron(mmgmesh, 7_immg, 2_immg, 8_immg, 6_immg,ref, 5_immg,ier)
IF ( ier /= 1 ) CALL exit(103)
CALL mmg3d_set_tetrahedron(mmgmesh, 2_immg, 4_immg, 3_immg, 8_immg,ref, 6_immg,ier)
IF ( ier /= 1 ) CALL exit(103)
ref = 2
CALL mmg3d_set_tetrahedron(mmgmesh, 9_immg, 2_immg, 3_immg, 7_immg,ref, 7_immg,ier)
IF ( ier /= 1 ) CALL exit(103)
CALL mmg3d_set_tetrahedron(mmgmesh, 7_immg, 11_immg, 9_immg, 12_immg,ref, 8_immg,ier)
IF ( ier /= 1 ) CALL exit(103)
CALL mmg3d_set_tetrahedron(mmgmesh, 6_immg, 9_immg,10_immg, 7_immg,ref, 9_immg,ier)
IF ( ier /= 1 ) CALL exit(103)
CALL mmg3d_set_tetrahedron(mmgmesh, 6_immg, 7_immg, 2_immg, 9_immg,ref,10_immg,ier)
IF ( ier /= 1 ) CALL exit(103)
CALL mmg3d_set_tetrahedron(mmgmesh, 12_immg, 9_immg, 7_immg, 10_immg,ref,11_immg,ier)
IF ( ier /= 1 ) CALL exit(103)
CALL mmg3d_set_tetrahedron(mmgmesh, 9_immg, 3_immg,11_immg, 7_immg,ref,12_immg,ier)
IF ( ier /= 1 ) CALL exit(103)
ref = 3
CALL mmg3d_set_triangle(mmgmesh, 1_immg, 4_immg, 8_immg, ref, 1_immg,ier)
IF ( ier /= 1 ) CALL exit(104)
CALL mmg3d_set_triangle(mmgmesh, 1_immg, 2_immg, 4_immg, ref, 2_immg,ier)
IF ( ier /= 1 ) CALL exit(104)
CALL mmg3d_set_triangle(mmgmesh, 8_immg, 3_immg, 7_immg, ref, 3_immg,ier)
IF ( ier /= 1 ) CALL exit(104)
CALL mmg3d_set_triangle(mmgmesh, 5_immg, 8_immg, 6_immg, ref, 4_immg,ier)
IF ( ier /= 1 ) CALL exit(104)
CALL mmg3d_set_triangle(mmgmesh, 5_immg, 6_immg, 2_immg, ref, 5_immg,ier)
IF ( ier /= 1 ) CALL exit(104)
CALL mmg3d_set_triangle(mmgmesh, 5_immg, 2_immg, 1_immg, ref, 6_immg,ier)
IF ( ier /= 1 ) CALL exit(104)
CALL mmg3d_set_triangle(mmgmesh, 5_immg, 1_immg, 8_immg, ref, 7_immg,ier)
IF ( ier /= 1 ) CALL exit(104)
CALL mmg3d_set_triangle(mmgmesh, 7_immg, 6_immg, 8_immg, ref, 8_immg,ier)
IF ( ier /= 1 ) CALL exit(104)
CALL mmg3d_set_triangle(mmgmesh, 4_immg, 3_immg, 8_immg, ref, 9_immg,ier)
IF ( ier /= 1 ) CALL exit(104)
CALL mmg3d_set_triangle(mmgmesh, 2_immg, 3_immg, 4_immg, ref,10_immg,ier)
IF ( ier /= 1 ) CALL exit(104)
ref = 4
CALL mmg3d_set_triangle(mmgmesh, 9_immg, 3_immg, 2_immg, ref,11_immg,ier)
IF ( ier /= 1 ) CALL exit(104)
CALL mmg3d_set_triangle(mmgmesh, 11_immg, 9_immg,12_immg, ref,12_immg,ier)
IF ( ier /= 1 ) CALL exit(104)
CALL mmg3d_set_triangle(mmgmesh, 7_immg, 11_immg,12_immg, ref,13_immg,ier)
IF ( ier /= 1 ) CALL exit(104)
CALL mmg3d_set_triangle(mmgmesh, 6_immg, 7_immg,10_immg, ref,14_immg,ier)
IF ( ier /= 1 ) CALL exit(104)
CALL mmg3d_set_triangle(mmgmesh, 6_immg, 10_immg, 9_immg, ref,15_immg,ier)
IF ( ier /= 1 ) CALL exit(104)
CALL mmg3d_set_triangle(mmgmesh, 6_immg, 9_immg, 2_immg, ref,16_immg,ier)
IF ( ier /= 1 ) CALL exit(104)
CALL mmg3d_set_triangle(mmgmesh, 12_immg, 10_immg, 7_immg, ref,17_immg,ier)
IF ( ier /= 1 ) CALL exit(104)
CALL mmg3d_set_triangle(mmgmesh, 12_immg, 9_immg,10_immg, ref,18_immg,ier)
IF ( ier /= 1 ) CALL exit(104)
CALL mmg3d_set_triangle(mmgmesh, 3_immg, 11_immg, 7_immg, ref,19_immg,ier)
IF ( ier /= 1 ) CALL exit(104)
CALL mmg3d_set_triangle(mmgmesh, 9_immg, 11_immg, 3_immg, ref,20_immg,ier)
IF ( ier /= 1 ) CALL exit(104)
np = 12
CALL mmg3d_set_solsize(mmgmesh,mmgsol,mmg5_vertex,np,mmg5_scalar,ier)
IF ( ier /= 1 ) CALL exit(105)
DO k=1,12
CALL mmg3d_set_scalarsol(mmgsol,0.5d0,k,ier)
IF ( ier /= 1 ) CALL exit(106)
ENDDO
CALL mmg3d_chk_meshdata(mmgmesh,mmgsol,ier)
IF ( ier /= 1 ) CALL exit(107)
CALL mmg3d_mmg3dlib(mmgmesh,mmgsol,ier)
IF ( ier == mmg5_strongfailure ) THEN
print*,"BAD ENDING OF MMG3DLIB: UNABLE TO SAVE MESH"
stop mmg5_strongfailure
ELSE IF ( ier == mmg5_lowfailure ) THEN
print*,"BAD ENDING OF MMG3DLIB"
ENDIF
OPEN(unit=inm,file=trim(adjustl(fileout))//".mesh",form="formatted",status="replace")
WRITE(inm,*) "MeshVersionFormatted 2"
WRITE(inm,*) "Dimension 3"
CALL mmg3d_get_meshsize(mmgmesh,np,ne,%val(0_immg),nt,%val(0_immg),na,ier)
IF ( ier /= 1 ) CALL exit(108)
! Table to know if a vertex is corner
ALLOCATE(corner(np))
! Table to know if a vertex/tetra/tria/edge is required
ALLOCATE(required(max(max(np,ne),max(nt,na))))
! Table to know if a coponant is corner and/or required
ALLOCATE(ridge(na))
nreq = 0; nc = 0
WRITE(inm,*)
WRITE(inm,*) "Vertices"
WRITE(inm,*) np
DO k=1, np
CALL mmg3d_get_vertex(mmgmesh,point(1),point(2),point(3),&
ref,corner(k),required(k),ier)
IF ( ier /= 1 ) CALL exit(109)
WRITE(inm,fmt) point(1),point(2),point(3),ref
IF ( corner(k)/=0 ) nc=nc+1
IF ( required(k)/=0 ) nreq=nreq+1
ENDDO
WRITE(inm,*)
WRITE(inm,*) "Corners"
WRITE(inm,*) nc
DO k=1, np
IF ( corner(k)/=0 ) WRITE(inm,*) k
ENDDO
WRITE(inm,*)
WRITE(inm,*) "RequiredVertices"
WRITE(inm,*) nreq
DO k=1,np
IF ( required(k)/=0 ) WRITE(inm,*) k
ENDDO
WRITE(inm,*)
DEALLOCATE(corner)
nreq = 0;
WRITE(inm,*) "Triangles"
WRITE(inm,*) nt
DO k=1,nt
CALL mmg3d_get_triangle(mmgmesh,tria(1),tria(2),tria(3),ref,required(k),ier)
IF ( ier /= 1 ) CALL exit(110)
WRITE(inm,*) tria(1),tria(2),tria(3),ref
IF ( required(k)/=0 ) nreq=nreq+1;
ENDDO
WRITE(inm,*)
WRITE(inm,*) "RequiredTriangles"
WRITE(inm,*) nreq
DO k=1,nt
IF ( required(k)/=0 ) WRITE(inm,*) k
ENDDO
WRITE(inm,*)
nreq = 0;nr = 0;
WRITE(inm,*) "Edges"
WRITE(inm,*) na
DO k=1,na
CALL mmg3d_get_edge(mmgmesh,edge(1),edge(2),ref,ridge(k),required(k),ier)
IF ( ier /= 1 ) CALL exit(111)
WRITE(inm,*) edge(1),edge(2),ref
IF ( ridge(k)/=0 ) nr = nr+1
IF ( required(k)/=0 ) nreq = nreq+1
ENDDO
WRITE(inm,*)
WRITE(inm,*) "RequiredEdges"
WRITE(inm,*) nreq
DO k=1,na
IF ( required(k) /=0 ) WRITE(inm,*) k
ENDDO
WRITE(inm,*)
WRITE(inm,*) "Ridges"
WRITE(inm,*) nr
DO k=1,na
IF ( ridge(k) /=0 ) WRITE(inm,*) k
ENDDO
WRITE(inm,*)
nreq = 0;
WRITE(inm,*) "Tetrahedra"
WRITE(inm,*) ne
DO k=1,ne
CALL mmg3d_get_tetrahedron(mmgmesh,tetra(1),tetra(2),tetra(3),tetra(4),&
ref,required(k),ier)
IF ( ier /= 1 ) CALL exit(112)
WRITE(inm,*) tetra(1),tetra(2),tetra(3),tetra(4),ref
IF ( required(k) /= 0 ) nreq = nreq+1
ENDDO
WRITE(inm,*)
WRITE(inm,*) "RequiredTetrahedra"
WRITE(inm,*) nreq
DO k=1,ne
IF ( required(k) /= 0 ) WRITE(inm,*) k
ENDDO
WRITE(inm,*) "End"
CLOSE(inm)
DEALLOCATE(required)
DEALLOCATE(ridge)
OPEN(unit=inm,file=trim(adjustl(fileout))//".sol",form="formatted",status="replace")
WRITE(inm,*) "MeshVersionFormatted 2"
WRITE(inm,*) "Dimension 3"
WRITE(inm,*)
CALL mmg3d_get_solsize(mmgmesh,mmgsol,typentity,np,typsol,ier)
IF ( ier /= 1 ) CALL exit(113)
IF ( ( typentity /= mmg5_vertex ) .OR. ( typsol /= mmg5_scalar ) ) THEN
CALL exit(114);
ENDIF
WRITE(inm,*) "SolAtVertices"
WRITE(inm,*) np
WRITE(inm,*) "1 1"
WRITE(inm,*)
DO k=1,np
CALL mmg3d_get_scalarsol(mmgsol,sol,ier)
IF ( ier /= 1 ) CALL exit(115)
WRITE(inm,*) sol
ENDDO
WRITE(inm,*)
WRITE(inm,*) "End"
CLOSE(inm)
CALL mmg3d_free_all(mmg5_arg_start, &
mmg5_arg_ppmesh,mmgmesh,mmg5_arg_ppmet,mmgsol, &
mmg5_arg_end)
END PROGRAM main

Mesh adaptation example.

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <float.h>
// if the header file is in the "include" directory
// #include "libmmg3d.h"
// if the header file is in "include/mmg/mmg3d"
#include "mmg/mmg3d/libmmg3d.h"
int main(int argc,char *argv[]) {
MMG5_pMesh mmgMesh;
MMG5_pSol mmgSol;
int ier,k;
char *outname;
fprintf(stdout," -- TEST MMG3DLIB \n");
if ( argc != 2 ) {
printf(" Usage: %s fileout \n",argv[0]);
return(1);
}
/* Name and path of the mesh files */
outname = (char *) calloc(strlen(argv[1]) + 1, sizeof(char));
if ( outname == NULL ) {
perror(" ## Memory problem: calloc");
exit(EXIT_FAILURE);
}
strcpy(outname,argv[1]);
/* args of InitMesh:
* MMG5_ARG_start: we start to give the args of a variadic func
* MMG5_ARG_ppMesh: next arg will be a pointer over a MMG5_pMesh
* &mmgMesh: pointer to your MMG5_pMesh (that stores your mesh)
* MMG5_ARG_ppMet: next arg will be a pointer over a MMG5_pSol storing a metric
* &mmgSol: pointer to your MMG5_pSol (that stores your metric) */
mmgMesh = NULL;
mmgSol = NULL;
MMG5_ARG_ppMesh,&mmgMesh,MMG5_ARG_ppMet,&mmgSol,
if ( MMG3D_Set_meshSize(mmgMesh,12,12,0,20,0,0) != 1 ) exit(EXIT_FAILURE);
mmgMesh->point[1].c[0] = 0.; mmgMesh->point[1].c[1] = 0.; mmgMesh->point[1].c[2] = 0.; mmgMesh->point[1].ref = 0;
/* or with the api function :
if ( MMG3D_Set_vertex(mmgMesh,0 ,0 ,0 ,0, 1) != 1 ) exit(EXIT_FAILURE); */
mmgMesh->point[2].c[0] = 0.5; mmgMesh->point[2].c[1] = 0; mmgMesh->point[2].c[2] = 0; mmgMesh->point[2].ref = 0;
mmgMesh->point[3].c[0] = 0.5; mmgMesh->point[3].c[1] = 0; mmgMesh->point[3].c[2] = 1; mmgMesh->point[3].ref = 0;
mmgMesh->point[4].c[0] = 0; mmgMesh->point[4].c[1] = 0; mmgMesh->point[4].c[2] = 1; mmgMesh->point[4].ref = 0;
mmgMesh->point[5].c[0] = 0; mmgMesh->point[5].c[1] = 1; mmgMesh->point[5].c[2] = 0; mmgMesh->point[5].ref = 0;
mmgMesh->point[6].c[0] = 0.5; mmgMesh->point[6].c[1] = 1; mmgMesh->point[6].c[2] = 0; mmgMesh->point[6].ref = 0;
mmgMesh->point[7].c[0] = 0.5; mmgMesh->point[7].c[1] = 1; mmgMesh->point[7].c[2] = 1; mmgMesh->point[7].ref = 0;
mmgMesh->point[8].c[0] = 0; mmgMesh->point[8].c[1] = 1; mmgMesh->point[8].c[2] = 1; mmgMesh->point[8].ref = 0;
mmgMesh->point[9].c[0] = 1; mmgMesh->point[9].c[1] = 0; mmgMesh->point[9].c[2] = 0; mmgMesh->point[9].ref = 0;
mmgMesh->point[10].c[0] = 1; mmgMesh->point[10].c[1] = 1; mmgMesh->point[10].c[2] = 0; mmgMesh->point[10].ref = 0;
mmgMesh->point[11].c[0] = 1; mmgMesh->point[11].c[1] = 0; mmgMesh->point[11].c[2] = 1; mmgMesh->point[11].ref = 0;
mmgMesh->point[12].c[0] = 1; mmgMesh->point[12].c[1] = 1; mmgMesh->point[12].c[2] = 1; mmgMesh->point[12].ref = 0;
/*tetra*/
mmgMesh->tetra[1].v[0] = 1; mmgMesh->tetra[1].v[1] = 2; mmgMesh->tetra[1].v[2] = 4; mmgMesh->tetra[1].v[3] = 8; mmgMesh->tetra[1].ref = 1;
/* or with the api function :
if ( MMG3D_Set_tetrahedra(mmgMesh,1 ,2 ,4 ,8, 1) != 1 ) exit(EXIT_FAILURE); */
mmgMesh->tetra[2].v[0] = 8; mmgMesh->tetra[2].v[1] = 3; mmgMesh->tetra[2].v[2] = 2; mmgMesh->tetra[2].v[3] = 7; mmgMesh->tetra[2].ref = 1;
mmgMesh->tetra[3].v[0] = 2; mmgMesh->tetra[3].v[1] = 5; mmgMesh->tetra[3].v[2] = 6; mmgMesh->tetra[3].v[3] = 8; mmgMesh->tetra[3].ref = 1;
mmgMesh->tetra[4].v[0] = 8; mmgMesh->tetra[4].v[1] = 5; mmgMesh->tetra[4].v[2] = 1; mmgMesh->tetra[4].v[3] = 2; mmgMesh->tetra[4].ref = 1;
mmgMesh->tetra[5].v[0] = 2; mmgMesh->tetra[5].v[1] = 7; mmgMesh->tetra[5].v[2] = 8; mmgMesh->tetra[5].v[3] = 6; mmgMesh->tetra[5].ref = 1;
mmgMesh->tetra[6].v[0] = 2; mmgMesh->tetra[6].v[1] = 4; mmgMesh->tetra[6].v[2] = 3; mmgMesh->tetra[6].v[3] = 8; mmgMesh->tetra[6].ref = 1;
mmgMesh->tetra[7].v[0] = 2; mmgMesh->tetra[7].v[1] = 9; mmgMesh->tetra[7].v[2] = 3; mmgMesh->tetra[7].v[3] = 7; mmgMesh->tetra[7].ref = 2;
mmgMesh->tetra[8].v[0] = 7; mmgMesh->tetra[8].v[1] = 11; mmgMesh->tetra[8].v[2] = 9; mmgMesh->tetra[8].v[3] = 12; mmgMesh->tetra[8].ref = 2;
mmgMesh->tetra[9].v[0] = 9; mmgMesh->tetra[9].v[1] = 6; mmgMesh->tetra[9].v[2] = 10; mmgMesh->tetra[9].v[3] = 7; mmgMesh->tetra[9].ref = 2;
mmgMesh->tetra[10].v[0] = 7; mmgMesh->tetra[10].v[1] = 6; mmgMesh->tetra[10].v[2] = 2; mmgMesh->tetra[10].v[3] = 9; mmgMesh->tetra[10].ref = 2;
mmgMesh->tetra[11].v[0] = 9; mmgMesh->tetra[11].v[1] = 12; mmgMesh->tetra[11].v[2] = 7; mmgMesh->tetra[11].v[3] = 10; mmgMesh->tetra[11].ref = 2;
mmgMesh->tetra[12].v[0] = 9; mmgMesh->tetra[12].v[1] = 3; mmgMesh->tetra[12].v[2] = 11; mmgMesh->tetra[12].v[3] = 7; mmgMesh->tetra[12].ref = 2;
if ( MMG3D_Set_solSize(mmgMesh,mmgSol,MMG5_Vertex,12,MMG5_Scalar) != 1 )
exit(EXIT_FAILURE);
for(k=1 ; k<=12 ; k++) {
mmgSol->m[k] = 0.5;
/* or with the api function :
if ( MMG3D_Set_scalarSol(mmgSol,0.5,k) != 1 ) exit(EXIT_FAILURE); */
}
if ( MMG3D_Chk_meshData(mmgMesh,mmgSol) != 1 ) exit(EXIT_FAILURE);
// WARNING: the MMG3D_mmg3dlib function returns 1 if success, 0 if fail.
// The MMG3D4 library was working opposite.
ier = MMG3D_mmg3dlib(mmgMesh,mmgSol);
if ( ier == MMG5_STRONGFAILURE ) {
fprintf(stdout,"BAD ENDING OF MMG3DLIB: UNABLE TO SAVE MESH\n");
return(ier);
} else if ( ier == MMG5_LOWFAILURE )
fprintf(stdout,"BAD ENDING OF MMG3DLIB\n");
if ( MMG3D_saveMesh(mmgMesh,outname) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_saveSol(mmgMesh,mmgSol,outname) !=1 ) exit(EXIT_FAILURE);
MMG5_ARG_ppMesh,&mmgMesh,MMG5_ARG_ppMet,&mmgSol,
free(outname);
outname = NULL;
return(ier);
}
void MMG3D_Set_handGivenMesh(MMG5_pMesh mesh)
Finish providing mesh data without using the API functions.
MMG5_pPoint point
Definition: libmmgtypes.h:649
MMG5_pTetra tetra
Definition: libmmgtypes.h:651
double c[3]
Definition: libmmgtypes.h:277
MMG5_int ref
Definition: libmmgtypes.h:284
double * m
Definition: libmmgtypes.h:680
MMG5_int v[4]
Definition: libmmgtypes.h:409
MMG5_int ref
Definition: libmmgtypes.h:410

Another mesh adaptation example.

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <float.h>
// if the header file is in the "include" directory
// #include "libmmg3d.h"
// if the header file is in "include/mmg/mmg3d"
#include "mmg/mmg3d/libmmg3d.h"
int main(int argc,char *argv[]) {
MMG5_pMesh mmgMesh;
MMG5_pSol mmgSol;
int k,ier;
char *inname, *outname1, *outname2;
fprintf(stdout," -- TEST MMG3DLIB \n");
if ( argc != 4 ) {
printf(" Usage: %s filein fileout1 filout2 \n",argv[0]);
return(1);
}
/* Name and path of the mesh files */
inname = (char *) calloc(strlen(argv[1]) + 1, sizeof(char));
if ( inname == NULL ) {
perror(" ## Memory problem: calloc");
exit(EXIT_FAILURE);
}
strcpy(inname,argv[1]);
outname1 = (char *) calloc(strlen(argv[2]) + 1, sizeof(char));
if ( outname1 == NULL ) {
perror(" ## Memory problem: calloc");
exit(EXIT_FAILURE);
}
strcpy(outname1,argv[2]);
outname2 = (char *) calloc(strlen(argv[3]) + 1, sizeof(char));
if ( outname2 == NULL ) {
perror(" ## Memory problem: calloc");
exit(EXIT_FAILURE);
}
strcpy(outname2,argv[3]);
/* args of InitMesh:
* MMG5_ARG_start: we start to give the args of a variadic func
* MMG5_ARG_ppMesh: next arg will be a pointer over a MMG5_pMesh
* &mmgMesh: pointer to your MMG5_pMesh (that stores your mesh)
* MMG5_ARG_ppMet: next arg will be a pointer over a MMG5_pSol storing a metric
* &mmgSol: pointer to your MMG5_pSol (that stores your metric) */
mmgMesh = NULL;
mmgSol = NULL;
MMG5_ARG_ppMesh,&mmgMesh,MMG5_ARG_ppMet,&mmgSol,
if ( MMG3D_loadMesh(mmgMesh,inname) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_loadSol(mmgMesh,mmgSol,inname) != 1 )
exit(EXIT_FAILURE);
if ( MMG3D_Chk_meshData(mmgMesh,mmgSol) != 1 ) exit(EXIT_FAILURE);
/* debug mode ON (default value = OFF) */
if ( MMG3D_Set_iparameter(mmgMesh,mmgSol,MMG3D_IPARAM_debug, 1) != 1 )
exit(EXIT_FAILURE);
/* maximal memory size (default value = 50/100*ram) */
if ( MMG3D_Set_iparameter(mmgMesh,mmgSol,MMG3D_IPARAM_mem, 600) != 1 )
exit(EXIT_FAILURE);
/* Maximal mesh size (default FLT_MAX)*/
if ( MMG3D_Set_dparameter(mmgMesh,mmgSol,MMG3D_DPARAM_hmax,40) != 1 )
exit(EXIT_FAILURE);
/* Minimal mesh size (default 0)*/
if ( MMG3D_Set_dparameter(mmgMesh,mmgSol,MMG3D_DPARAM_hmin,0.001) != 1 )
exit(EXIT_FAILURE);
/* Global hausdorff value (default value = 0.01) applied on the whole boundary */
if ( MMG3D_Set_dparameter(mmgMesh,mmgSol,MMG3D_DPARAM_hausd, 0.1) != 1 )
exit(EXIT_FAILURE);
/* Gradation control*/
if ( MMG3D_Set_dparameter(mmgMesh,mmgSol,MMG3D_DPARAM_hgrad, 2) != 1 )
exit(EXIT_FAILURE);
ier = MMG3D_mmg3dlib(mmgMesh,mmgSol);
if ( ier == MMG5_STRONGFAILURE ) {
fprintf(stdout,"BAD ENDING OF MMG3DLIB: UNABLE TO SAVE MESH\n");
return(ier);
} else if ( ier == MMG5_LOWFAILURE )
fprintf(stdout,"BAD ENDING OF MMG3DLIB\n");
/* (Not mandatory) Automatically save the mesh */
MMG3D_saveMesh(mmgMesh,outname1);
if ( MMG3D_saveSol(mmgMesh,mmgSol,outname1) != 1 )
exit(EXIT_FAILURE);
/* We add different local hausdorff numbers on boundary componants (this
local values are used instead of the global hausdorff number) */
/* verbosity (default value = 4)*/
if ( MMG3D_Set_iparameter(mmgMesh,mmgSol,MMG3D_IPARAM_verbose, 4) != 1 )
exit(EXIT_FAILURE);
if ( MMG3D_Set_iparameter(mmgMesh,mmgSol,MMG3D_IPARAM_mem, 1000) != 1 )
exit(EXIT_FAILURE);
if ( MMG3D_Set_iparameter(mmgMesh,mmgSol,MMG3D_IPARAM_debug, 0) != 1 )
exit(EXIT_FAILURE);
/* use 2 local hausdorff numbers on ref 36 (hausd = 0.01) and 38 (hausd = 1) */
exit(EXIT_FAILURE);
/* Be careful if you change the hausdorff number (or gradation value)
between 2 run: the information of the previous hausdorff number
(resp. gradation) is contained in the metric computed during
the previous run.
Then, you can not grow up the hausdorff value (resp. gradation) without
resetting this metric (but you can decrease this value). */
if ( MMG3D_Set_localParameter(mmgMesh,mmgSol,MMG5_Triangle,36,0.00001,40.,0.01) != 1 )
exit(EXIT_FAILURE);
if ( MMG3D_Set_localParameter(mmgMesh,mmgSol,MMG5_Triangle,38,0.00001,40.,1) != 1 )
exit(EXIT_FAILURE);
ier = MMG3D_mmg3dlib(mmgMesh,mmgSol);
if ( ier == MMG5_STRONGFAILURE ) {
fprintf(stdout,"BAD ENDING OF MMG3DLIB: UNABLE TO SAVE MESH\n");
return(ier);
} else if ( ier == MMG5_LOWFAILURE )
fprintf(stdout,"BAD ENDING OF MMG3DLIB\n");
/* New metric to see the effect of the local hausdorff number on triangles
of ref 38: constant and of size 10 */
for ( k=1; k<=mmgSol->np; k++ ) {
if ( MMG3D_Set_scalarSol(mmgSol,10,k) != 1 ) exit(EXIT_FAILURE);
}
ier = MMG3D_mmg3dlib(mmgMesh,mmgSol);
if ( ier == MMG5_STRONGFAILURE ) {
fprintf(stdout,"BAD ENDING OF MMG3DLIB: UNABLE TO SAVE MESH\n");
return(ier);
} else if ( ier == MMG5_LOWFAILURE )
fprintf(stdout,"BAD ENDING OF MMG3DLIB\n");
/* 7) Automatically save the mesh */
if ( MMG3D_saveMesh(mmgMesh,outname2) != 1 )
exit(EXIT_FAILURE);
/* 8) Automatically save the solution */
if ( MMG3D_saveSol(mmgMesh,mmgSol,outname2) != 1 )
exit(EXIT_FAILURE);
/* 9) free the MMG3D5 structures */
MMG5_ARG_ppMesh,&mmgMesh,MMG5_ARG_ppMet,&mmgSol,
free(inname);
inname = NULL;
free(outname1);
outname1 = NULL;
free(outname2);
outname2 = NULL;
return(ier);
}
int MMG3D_Set_dparameter(MMG5_pMesh mesh, MMG5_pSol sol, int dparam, double val)
set a real-valued parameter of the remesher
int MMG3D_Set_localParameter(MMG5_pMesh mesh, MMG5_pSol sol, int typ, MMG5_int ref, double hmin, double hmax, double hausd)
set a local parameter
int MMG3D_Set_iparameter(MMG5_pMesh mesh, MMG5_pSol sol, int iparam, MMG5_int val)
set an integer parameter of the remesher
@ MMG3D_DPARAM_hmin
Definition: libmmg3d.h:171
@ MMG3D_IPARAM_debug
Definition: libmmg3d.h:146
@ MMG3D_IPARAM_numberOfLocalParam
Definition: libmmg3d.h:161
@ MMG3D_DPARAM_hausd
Definition: libmmg3d.h:174
@ MMG3D_DPARAM_hgrad
Definition: libmmg3d.h:175
@ MMG3D_DPARAM_hmax
Definition: libmmg3d.h:172
@ MMG3D_IPARAM_verbose
Definition: libmmg3d.h:144
@ MMG3D_IPARAM_mem
Definition: libmmg3d.h:145
@ MMG5_Triangle
Definition: libmmgtypes.h:232
MMG5_int np
Definition: libmmgtypes.h:674

Isosurface discretization example (with metric)

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <float.h>
// if the header file is in the "include" directory
// #include "libmmg3d.h"
// if the header file is in "include/mmg/mmg3d"
#include "mmg/mmg3d/libmmg3d.h"
int main(int argc,char *argv[]) {
MMG5_pMesh mmgMesh;
MMG5_pSol mmgLs,mmgMet;
MMG5_int np,k;
int ier;
char *inname,*outname,*lsname;
fprintf(stdout," -- TEST MMG3DLS \n");
if ( argc != 4 ) {
printf(" Usage: %s meshfile lsfile fileout\n",argv[0]);
return(1);
}
/* Name and path of the mesh files */
inname = (char *) calloc(strlen(argv[1]) + 1, sizeof(char));
if ( inname == NULL ) {
perror(" ## Memory problem: calloc");
exit(EXIT_FAILURE);
}
strcpy(inname,argv[1]);
lsname = (char *) calloc(strlen(argv[2]) + 1, sizeof(char));
if ( lsname == NULL ) {
perror(" ## Memory problem: calloc");
exit(EXIT_FAILURE);
}
strcpy(lsname,argv[2]);
outname = (char *) calloc(strlen(argv[3]) + 1, sizeof(char));
if ( outname == NULL ) {
perror(" ## Memory problem: calloc");
exit(EXIT_FAILURE);
}
strcpy(outname,argv[3]);
/* args of InitMesh:
* MMG5_ARG_start: we start to give the args of a variadic func
* MMG5_ARG_ppMesh: next arg will be a pointer to an MMG5_pMesh
* &mmgMesh: pointer to your MMG5_pMesh (that stores your mesh)
* MMG5_ARG_ppLs: next arg will be a pointer to an MMG5_pSol storing a level-set
* &mmgLs: pointer to your MMG5_pSol (that stores your level-set)
* MMG5_ARG_ppMet: next arg will be a pointer to an MMG5_pSol that will
* store the input metric
* &mmgMet: pointer to your MMG5_pSol (that will store the input metric) */
mmgMesh = NULL;
mmgLs = NULL;
mmgMet = NULL;
MMG5_ARG_ppMesh,&mmgMesh,MMG5_ARG_ppLs,&mmgLs,
MMG5_ARG_ppMet,&mmgMet,
/* Ask for level set discretization: note that it is important to do this step
* here because in iso mode, some filters are applied at mesh loading */
if ( MMG3D_Set_iparameter(mmgMesh,mmgLs,MMG3D_IPARAM_iso, 1) != 1 )
exit(EXIT_FAILURE);
if ( MMG3D_loadMesh(mmgMesh,inname) != 1 ) exit(EXIT_FAILURE);
if ( MMG3D_loadSol(mmgMesh,mmgLs,lsname) != 1 )
exit(EXIT_FAILURE);
/* Manually for example */
if ( MMG3D_Get_meshSize(mmgMesh,&np,NULL,NULL,NULL,NULL,NULL) !=1 ) exit(EXIT_FAILURE);
if ( MMG3D_Set_solSize(mmgMesh,mmgMet,MMG5_Vertex,np,MMG5_Tensor) != 1 )
exit(EXIT_FAILURE);
for(k=1 ; k<=np ; k++) {
/* the Metric is constant over the mesh and follows the canonical
* directions: it is given by the tensor (10000,0,100) */
if ( MMG3D_Set_tensorSol(mmgMet,10,0,0,1,0,1,k) != 1 ) exit(EXIT_FAILURE);
}
if ( MMG3D_Chk_meshData(mmgMesh,mmgLs) != 1 ) exit(EXIT_FAILURE);
ier = MMG3D_mmg3dls(mmgMesh,mmgLs,mmgMet);
if ( ier == MMG5_STRONGFAILURE ) {
fprintf(stdout,"BAD ENDING OF MMG3DLS: UNABLE TO SAVE MESH\n");
return(ier);
} else if ( ier == MMG5_LOWFAILURE )
fprintf(stdout,"BAD ENDING OF MMG3DLS\n");
/* (Not mandatory) Automatically save the mesh */
if ( MMG3D_saveMesh(mmgMesh,outname) != 1 )
exit(EXIT_FAILURE);
/* (Not mandatory) Automatically save the output metric */
if ( MMG3D_saveSol(mmgMesh,mmgMet,outname) != 1 )
exit(EXIT_FAILURE);
/* 9) free the MMG3D5 structures */
MMG5_ARG_ppMesh,&mmgMesh,MMG5_ARG_ppLs,&mmgLs,
MMG5_ARG_ppMet,&mmgMet,
free(inname);
inname = NULL;
free(outname);
outname = NULL;
free(lsname);
lsname = NULL;
return(ier);
}
int MMG3D_Set_tensorSol(MMG5_pSol met, double m11, double m12, double m13, double m22, double m23, double m33, MMG5_int pos)
Set a single element of a tensor solution structure.
int MMG3D_mmg3dls(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pSol umet)
Main "program" for the level-set discretization library.
Definition: libmmg3d.c:1192
@ MMG3D_IPARAM_iso
Definition: libmmg3d.h:148
#define MMG5_ARG_ppLs
Definition: libmmgtypes.h:112
@ MMG5_Tensor
Definition: libmmgtypes.h:221

Lagrangian motion example.

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <float.h>
// if the header file is in the "include" directory
// #include "libmmg3d.h"
// if the header file is in "include/mmg/mmg3d"
#include "mmg/mmg3d/libmmg3d.h"
int main(int argc,char *argv[]) {
MMG5_pMesh mmgMesh;
MMG5_pSol mmgMetric, mmgDisp;
int ier;
char *inname, *outname;
fprintf(stdout, " -- TEST MMG3DMOV \n");
if ( argc != 3 ) {
printf(" Usage: %s filein fileout \n", argv[0]);
return(1);
}
/* Name and path of the mesh files */
inname = (char *) calloc(strlen(argv[1]) + 1, sizeof(char));
if ( inname == NULL ) {
perror(" ## Memory problem: calloc");
exit(EXIT_FAILURE);
}
strcpy(inname,argv[1]);
outname = (char *) calloc(strlen(argv[2]) + 1, sizeof(char));
if ( outname == NULL ) {
perror(" ## Memory problem: calloc");
exit(EXIT_FAILURE);
}
strcpy(outname,argv[2]);
/* args of InitMesh:
* MMG5_ARG_start: we start to give the args of a variadic function
* MMG5_ARG_ppMesh: next arg will be a pointer to an MMG5_pMesh
* &mmgMesh: pointer to your MMG5_pMesh (that stores your mesh)
* MMG5_ARG_ppMet: next arg will be a pointer to MMG5_pSol storing a metric
* &mmgMetric: pointer to an MMG5_pSol that stores your metric field
* MMG5_ARG_ppDisp: next arg will be a pointer to MMG5_pSol storing a displacement
* &mmgDisp: pointer to an MMG5_pSol that stores your displacement field
* In this example the metric field is not used but it must be provided
* to MMG3D_mmg3dmov() and therefore it must be initialized; it cannot
* remain a NULL pointer. */
mmgMesh = NULL;
mmgMetric = NULL;
mmgDisp = NULL;
MMG5_ARG_ppMesh, &mmgMesh,
MMG5_ARG_ppMet, &mmgMetric,
MMG5_ARG_ppDisp, &mmgDisp,
if ( MMG3D_loadMesh(mmgMesh, inname) != 1 ) exit(EXIT_FAILURE);
/* Ask for lagrangian motion (mode 1) */
if ( MMG3D_Set_iparameter(mmgMesh, mmgDisp, MMG3D_IPARAM_lag, 1) != 1 )
exit(EXIT_FAILURE);
if ( MMG3D_loadSol(mmgMesh, mmgDisp, inname) != 1 )
exit(EXIT_FAILURE);
if ( MMG3D_Chk_meshData(mmgMesh, mmgDisp) != 1 ) exit(EXIT_FAILURE);
/* debug mode ON (default value = OFF) */
if ( MMG3D_Set_iparameter(mmgMesh, mmgDisp, MMG3D_IPARAM_debug, 1) != 1 )
exit(EXIT_FAILURE);
ier = MMG3D_mmg3dmov(mmgMesh, mmgMetric, mmgDisp);
if ( ier == MMG5_STRONGFAILURE ) {
fprintf(stdout,"BAD ENDING OF MMG3DMOV: UNABLE TO SAVE MESH\n");
return(ier);
} else if ( ier == MMG5_LOWFAILURE )
fprintf(stdout,"BAD ENDING OF MMG3DMOV\n");
/* (Not mandatory) Automatically save the mesh */
if ( MMG3D_saveMesh(mmgMesh, outname) != 1 )
exit(EXIT_FAILURE);
/* 9) free the MMG3D5 structures */
MMG5_ARG_ppMesh, &mmgMesh,
MMG5_ARG_ppMet, &mmgMetric,
MMG5_ARG_ppDisp, &mmgDisp,
free(inname);
inname = NULL;
free(outname);
outname = NULL;
return(ier);
}
int MMG3D_mmg3dmov(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol disp)
Main program for the rigid-body movement library.
Definition: libmmg3d.c:1475
@ MMG3D_IPARAM_lag
Definition: libmmg3d.h:152
#define MMG5_ARG_ppDisp
Definition: libmmgtypes.h:132

Definition in file libmmg3d.h.

Macro Definition Documentation

◆ MMG3D_LMAX

#define MMG3D_LMAX   10240

Maximum array size when storing adjacent vertices (or ball) of a vertex.

Definition at line 130 of file libmmg3d.h.

Enumeration Type Documentation

◆ MMG3D_Param

Input parameters for the mmg library.

These are the input parameters for the mmg3d library functions. Options prefixed by MMG3D_IPARAM require integer values and options prefixed by MMG3D_DPARAM require real values. They can be set with the MMG3D_Set_iparameter and MMG3D_Set_dparameter functions, respectively.

Enumerator
MMG3D_IPARAM_verbose 

[-1..10], Level of verbosity

MMG3D_IPARAM_mem 

[n/-1], Max memory size in MB or keep the default value

MMG3D_IPARAM_debug 

[1/0], Turn on/off debug mode

MMG3D_IPARAM_angle 

[1/0], Turn on/off angle detection

MMG3D_IPARAM_iso 

[1/0], Enable level-set discretization (volume and surfaces)

MMG3D_IPARAM_isosurf 

[1/0], Enable level-set discretization on the surfaces only

MMG3D_IPARAM_nofem 

[1/0], Do not attempt to make the mesh suitable for finite-element computations

MMG3D_IPARAM_opnbdy 

[1/0], Preserve triangles at interface of 2 domains with the same reference

MMG3D_IPARAM_lag 

[-1/0/1/2], Enable Lagrangian motion

MMG3D_IPARAM_optim 

[1/0], Optimize mesh keeping its initial edge sizes

MMG3D_IPARAM_optimLES 

[1/0], Strong mesh optimization for LES computations

MMG3D_IPARAM_noinsert 

[1/0], Avoid/allow vertex insertion

MMG3D_IPARAM_noswap 

[1/0], Avoid/allow edge or face flipping

MMG3D_IPARAM_nomove 

[1/0], Avoid/allow vertex relocation

MMG3D_IPARAM_nosurf 

[1/0], Avoid/allow surface modifications

MMG3D_IPARAM_nreg 

[0/1], Enable regularization of normals

MMG3D_IPARAM_xreg 

[0/1], Enable boundary regularization by moving vertices

MMG3D_IPARAM_numberOfLocalParam 

[n], Number of local parameters (which will be set with MMG3D_Set_localParameter)

MMG3D_IPARAM_numberOfLSBaseReferences 

[n], Number of base references for bubble removal (requires MMG3D_DPARAM_rmc)

MMG3D_IPARAM_numberOfMat 

[n], Number of materials in level-set mode

MMG3D_IPARAM_numsubdomain 

[0/n], Save only the subdomain (reference) n (0==all subdomains)

MMG3D_IPARAM_renum 

[1/0], Turn on/off renumbering with Scotch

MMG3D_IPARAM_anisosize 

[1/0], Turn on/off anisotropic metric creation when no metric is provided

MMG3D_IPARAM_octree 

[n], Max number of vertices per PROctree cell (DELAUNAY)

MMG3D_IPARAM_nosizreq 

[0/1], Allow/avoid overwriting of sizes at required vertices (advanced usage)

MMG3D_IPARAM_isoref 

[0/n], Isosurface boundary material reference

MMG3D_DPARAM_angleDetection 

[val], Value for angle detection (degrees)

MMG3D_DPARAM_hmin 

[val], Minimal edge length

MMG3D_DPARAM_hmax 

[val], Maximal edge length

MMG3D_DPARAM_hsiz 

[val], Constant edge length

MMG3D_DPARAM_hausd 

[val], Global Hausdorff distance (on all boundaries in the mesh)

MMG3D_DPARAM_hgrad 

[val], Gradation

MMG3D_DPARAM_hgradreq 

[val], Gradation on required entites (advanced usage)

MMG3D_DPARAM_ls 

[val], Function value where the level set is to be discretized

MMG3D_DPARAM_xreg 

[val], Relaxation parameter for boundary regularization (0<val<1)

MMG3D_DPARAM_rmc 

[-1/val], Remove small disconnected components in level-set mode

MMG3D_PARAM_size 

[n], Number of parameters

Definition at line 143 of file libmmg3d.h.

Function Documentation

◆ MMG3D_Add_tetrahedron()

LIBMMG3D_EXPORT int MMG3D_Add_tetrahedron ( MMG5_pMesh  mesh,
MMG5_int  v0,
MMG5_int  v1,
MMG5_int  v2,
MMG5_int  v3,
MMG5_int  ref 
)

Add a tetrahedron to the mesh.

Parameters
meshpointer to the mesh structure.
v0first vertex of tetrahedron.
v1second vertex of tetrahedron.
v2third vertex of tetrahedron.
v3fourth vertex of tetrahedron.
reftetrahedron reference.

This function adds a tetrahedron with vertices v0, v1, v2, v3 and reference ref at the first available position of the mesh.

Returns
0 if unable to create the tetrahedron, the unit-offset index of the new tet if it has strictly positive volume, a negative index if it has a zero or negative volume.
Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_ADD_TETRAHEDRON(mesh,v0,v1,v2,v3,ref,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(IN):: v0,v1,v2,v3,ref
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 2007 of file API_functions_3d.c.

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

◆ MMG3D_Add_vertex()

LIBMMG3D_EXPORT MMG5_int MMG3D_Add_vertex ( MMG5_pMesh  mesh,
double  c0,
double  c1,
double  c2,
MMG5_int  ref 
)

Add a vertex to the mesh.

Parameters
meshpointer to the mesh structure.
c0x coor of the new vertex
c1y coor of the new vertex
c2z coor of the new vertex
refvertex reference.
Returns
0 if unable to create the vertex, the index of the new vertex otherwise.

This function adds a vertex with coordinates c0 c1 c2 and reference ref at the first available position of the mesh.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_ADD_VERTEX(mesh,c0,c1,c2,ref,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
REAL(KIND=8), INTENT(IN) :: c0,c1,c2
INTEGER(MMG5F_INT), INTENT(IN) :: ref
INTEGER(MMG5F_INT), INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 2081 of file API_functions_3d.c.

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

◆ MMG3D_Chk_meshData()

LIBMMG3D_EXPORT int MMG3D_Chk_meshData ( MMG5_pMesh  mesh,
MMG5_pSol  met 
)

Check if the number of given entities match with mesh and sol size.

Parameters
meshpointer to the mesh structure.
metpointer to the sol structure.
Returns
0 if failed, 1 otherwise.

Check if the number of given entities match with mesh and sol size (not mandatory) and check mesh datas.

Remarks
Fortran interface:

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

Definition at line 1883 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Clean_isoSurf()

LIBMMG3D_EXPORT int MMG3D_Clean_isoSurf ( MMG5_pMesh  mesh)

Clean data (triangles and edges) linked to isosurface.

Parameters
meshpointer to the mesh structure
Returns
1 if successful, 0 otherwise.
Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_CLEAN_ISOSURF(mesh,retval)
MMG5_DATA_PTR_T, INTENT(IN) :: mesh
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Step 1: a. deletion of triangles that belong to isosurf

Step 2: deletion of edges that belong to isosurf

Definition at line 1777 of file libmmg3d_tools.c.

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

◆ MMG3D_Compute_eigenv()

LIBMMG3D_EXPORT int MMG3D_Compute_eigenv ( double  m[6],
double  lambda[3],
double  vp[3][3] 
)

Compute the real eigenvalues and eigenvectors of a symmetric matrix.

Parameters
mupper part of a symmetric matrix diagonalizable in |R
lambdaarray of the metric eigenvalues
vparray of the metric eigenvectors
Returns
the order of the eigenvalues

Compute the real eigenvalues and eigenvectors of a symmetric matrix m whose upper part is provided (m11, m12, m13, m22, m23, m33 in this order).

lambda[0] is the eigenvalue associated to the eigenvector ( v[0][0], v[0,1], v[0,2] ) in C and to the eigenvector v(1,:) in fortran

lambda[1] is the eigenvalue associated to the eigenvector ( v[1][0], v[1,1], v[1,2] ) in C and to the eigenvector v(2,:) in fortran

lambda[2] is the eigenvalue associated to the eigenvector ( v[2][0], v[2,1], v[2,2] ) in C and to the eigenvector v(3,:) in fortran

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_COMPUTE_EIGENV(m,lambda,vp,retval)
REAL(KIND=8), INTENT(IN) :: m(*)
REAL(KIND=8), INTENT(OUT) :: lambda(*),vp(*)
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1744 of file libmmg3d_tools.c.

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

◆ MMG3D_defaultValues()

LIBMMG3D_EXPORT int MMG3D_defaultValues ( MMG5_pMesh  mesh)

Print the default parameters values.

Tools for the library

Parameters
meshpointer to the mesh structure.
Returns
0 if fail, 1 if success.
Remarks
Fortran interface:

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

Definition at line 205 of file libmmg3d_tools.c.

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

◆ MMG3D_destockOptions()

LIBMMG3D_EXPORT void MMG3D_destockOptions ( MMG5_pMesh  mesh,
MMG5_Info info 
)

Recover the info structure stored in the mesh structure.

Parameters
meshpointer to the mesh structure.
infopointer to the info structure.
Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_DESTOCKOPTIONS(mesh,info)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,info
END SUBROUTINE

Definition at line 1190 of file libmmg3d_tools.c.

Here is the caller graph for this function:

◆ MMG3D_Free_all()

LIBMMG3D_EXPORT int MMG3D_Free_all ( const int  starter,
  ... 
)

Deallocations before return.

Parameters
starterdummy argument used to initialize the variadic argument list.
...variadic arguments that depend on the library function that you have call.

For the MMG3D_mmg3dlib function, you need to call the MMG3D_Init_mesh function with the following arguments : MMG3D_Init_mesh(MMG5_ARG_start,MMG5_ARG_ppMesh, &your_mesh, MMG5_ARG_ppMet,&your_metric,MMG5_ARG_end).

For the MMG3D_mmg3dls function, you need to call the MMG3D_Init_mesh function with the following arguments : MMG3D_Init_mesh(MMG5_ARG_start,MMG5_ARG_ppMesh, &your_mesh, MMG5_ARG_ppLs, &your_level_set,MMG5_ARG_end).

For the MMG3D_mmg3dmov function, you must call : MMG3D_Init_mesh(MMG5_ARG_start,MMG5_ARG_ppMesh, &your_mesh, MMG5_ARG_ppMet,&empty_metric,MMG5_ARG_ppDisp, &your_displacement, MMG5_ARG_end).

Returns
1 if success, 0 if fail
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.
no Fortran interface to allow variadic args.

Definition at line 2547 of file API_functions_3d.c.

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

◆ MMG3D_Free_allSols()

LIBMMG3D_EXPORT int MMG3D_Free_allSols ( MMG5_pMesh  mesh,
MMG5_pSol sol 
)

Deallocate an array of solution fields.

Parameters
meshpointer to the mesh structure.
solpointer to an array of solution structure (that stores solution fields).
Returns
1
Remarks
Fortran interface:

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

Definition at line 2542 of file API_functions_3d.c.

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

◆ MMG3D_Free_names()

LIBMMG3D_EXPORT int MMG3D_Free_names ( const int  starter,
  ... 
)

Structure deallocations before return.

Parameters
starterdummy argument used to initialize the variadic argument list.
...variadic arguments that depend on the library function that you have call.

For the MMG3D_mmg3dlib function, you need to call the MMG3D_Init_mesh function with the following arguments : MMG3D_Init_mesh(MMG5_ARG_start,MMG5_ARG_ppMesh, &your_mesh, MMG5_ARG_ppMet,&your_metric,MMG5_ARG_end).

For the MMG3D_mmg3dls function, you need to call the MMG3D_Init_mesh function with the following arguments : MMG3D_Init_mesh(MMG5_ARG_start,MMG5_ARG_ppMesh, &your_mesh, MMG5_ARG_ppLs, &your_level_set,MMG5_ARG_end).

For the MMG3D_mmg3dmov function, you must call : MMG3D_Init_mesh(MMG5_ARG_start,MMG5_ARG_ppMesh, &your_mesh, MMG5_ARG_ppMet,&empty_metric,MMG5_ARG_ppDisp, &your_displacement, MMG5_ARG_end).

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.
No fortran interface to allow variadic arguments.

Definition at line 2575 of file API_functions_3d.c.

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

◆ MMG3D_Free_solutions()

LIBMMG3D_EXPORT void MMG3D_Free_solutions ( MMG5_pMesh  mesh,
MMG5_pSol  sol 
)

Free the solution structure of a given mesh.

Parameters
meshpointer to the mesh structure
solpointer to the solution structure
Remarks
Fortran interface:

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

Definition at line 1750 of file libmmg3d_tools.c.

Here is the caller graph for this function:

◆ MMG3D_Free_structures()

LIBMMG3D_EXPORT int MMG3D_Free_structures ( const int  starter,
  ... 
)

Structure deallocations before return.

Parameters
starterdummy argument used to initialize the variadic argument list.
...variadic arguments that depend on the library function that you have call.

For the MMG3D_mmg3dlib function, you need to call the MMG3D_Init_mesh function with the following arguments : MMG3D_Init_mesh(MMG5_ARG_start,MMG5_ARG_ppMesh, &your_mesh, MMG5_ARG_ppMet,&your_metric,MMG5_ARG_end).

For the MMG3D_mmg3dls function, you need to call the MMG3D_Init_mesh function with the following arguments : MMG3D_Init_mesh(MMG5_ARG_start,MMG5_ARG_ppMesh, &your_mesh, MMG5_ARG_ppLs, &your_level_set,MMG5_ARG_end).

For the MMG3D_mmg3dmov function, you must call : MMG3D_Init_mesh(MMG5_ARG_start,MMG5_ARG_ppMesh, &your_mesh, MMG5_ARG_ppMet,&empty_metric,MMG5_ARG_ppDisp, &your_displacement, MMG5_ARG_end).

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.
No fortran interface to allow variadic arguments.
no Fortran interface to allow variadic args.

Definition at line 2561 of file API_functions_3d.c.

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

◆ MMG3D_Get_adjaTet()

LIBMMG3D_EXPORT int MMG3D_Get_adjaTet ( MMG5_pMesh  mesh,
MMG5_int  kel,
MMG5_int  listet[4] 
)

Return adjacent elements of a tetrahedron.

Utils

Parameters
meshpointer to the mesh structure.
keltetrahedron index.
listetpointer to the array of the 4 tetra adjacent to kel. (the index is 0 if there is no adjacent)
Returns
1.

Find the indices of the 4 adjacent elements of tetrahedron kel. \(listet[i] = 0\) if the \(i^{th}\) face has no adjacent element (so we are on a boundary face).

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_GET_ADJATET(mesh,kel,listet,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(IN) :: kel
INTEGER(MMG5F_INT), DIMENSION(4), INTENT(OUT) :: listet
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 148 of file libmmg3d_tools.c.

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

◆ MMG3D_Get_edge()

LIBMMG3D_EXPORT int MMG3D_Get_edge ( MMG5_pMesh  mesh,
MMG5_int *  e0,
MMG5_int *  e1,
MMG5_int *  ref,
int *  isRidge,
int *  isRequired 
)

Get the vertices and reference of the next edge in the mesh.

Parameters
meshpointer to the mesh structure.
e0pointer to the first extremity of the edge.
e1pointer to the second extremity of the edge.
refpointer to the edge reference.
isRidgepointer to the flag saying if the edge is ridge.
isRequiredpointer to the flag saying if the edge is required.
Returns
0 if failed, 1 otherwise.

This function retrieves the extremities e0, e1 and reference ref of next edge of mesh. It is meant to be called in a loop over all edges. When it has been called as many times as there are edges in the mesh, the internal edge counter will be reset.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_GET_EDGE(mesh,e0,e1,ref,isRidge,isRequired,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(OUT) :: e0,e1
INTEGER(MMG5F_INT) :: ref
INTEGER :: isRidge,isRequired
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1130 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Get_edges()

LIBMMG3D_EXPORT int MMG3D_Get_edges ( MMG5_pMesh  mesh,
MMG5_int *  edges,
MMG5_int *  refs,
int *  areRidges,
int *  areRequired 
)

Get the vertices and references of all edges in a mesh.

Parameters
meshpointer to the mesh structure.
edgespointer to the array of edges. The vertices of the \(i^{th}\) edge are stored in edges[(i-1)*2] and edges[(i-1)*2+1].
refsedges references. refs[i-1] is the ref of the \(i^{th}\) edge.
areRidges1 if the edge is a ridge, 0 otherwise.
areRequired1 if the edge is required, 0 otherwise.
Returns
0 if failed, 1 otherwise.
Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_GET_EDGES(mesh,edges,refs,areRidges,areRequired,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(IN) :: edges(*)
INTEGER(MMG5F_INT), INTENT(OUT):: refs(*)
INTEGER, INTENT(OUT) :: areRequired(*),areRidges(*)
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1193 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Get_iparameter()

LIBMMG3D_EXPORT int MMG3D_Get_iparameter ( MMG5_pMesh  mesh,
MMG5_int  iparam 
)

Get the value of an integer parameter of the remesher.

Parameters
meshpointer to the mesh structure.
iparaminteger parameter to get (see MMG3D_Param for a list of parameters that can be set).
Returns
The value of integer parameter.

Get the value of integer parameter iparam.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_GET_IPARAMETER(mesh,iparam,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(IN):: iparam
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 2297 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Get_ithSol_inSolsAtVertices()

LIBMMG3D_EXPORT int MMG3D_Get_ithSol_inSolsAtVertices ( MMG5_pSol  sol,
int  i,
double *  s,
MMG5_int  pos 
)

Get one out of several solutions at a specific vertex.

Parameters
solpointer to the array of solutions
iposition of the solution field that we want to get.
ssolution(s) at mesh vertex pos. The required size of this array depends on the type of solution.
posindex of the vertex on which we get the solution.
Returns
0 if failed, 1 otherwise.

Get values of the ith field of the solution array at vertex pos. (pos from 1 to nb_vertices included and i from 1 to nb_sols). The type of solution is inferred from sol.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_GET_ITHSOL_INSOLSATVERTICES(sol,i,s,pos,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: sol
INTEGER, INTENT(IN) :: i
INTEGER(MMG5F_INT), INTENT(IN) :: pos
REAL(KIND=8), DIMENSION(*),INTENT(OUT) :: s
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1781 of file API_functions_3d.c.

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

◆ MMG3D_Get_ithSols_inSolsAtVertices()

LIBMMG3D_EXPORT int MMG3D_Get_ithSols_inSolsAtVertices ( MMG5_pSol  sol,
int  i,
double *  s 
)

Get one out of several solutions at all vertices in the mesh.

Parameters
solpointer to the array of solutions
iposition of the solution field that we want to get.
sarray of the solutions at mesh vertices. The solution at vertex k is given by s[k-1] for a scalar sol, s[3*(k-1)]@3 for a vectorial solution and s[6*(k-1)]@6 for a tensor solution.
Returns
0 if failed, 1 otherwise.

This function retrieves the values of the solution at the ith field of the solution array (i from 1 to nb_sols).

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_GET_ITHSOLS_INSOLSATVERTICES(sol,i,s,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: sol
INTEGER, INTENT(IN) :: i
REAL(KIND=8), DIMENSION(*),INTENT(OUT) :: s
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1839 of file API_functions_3d.c.

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

◆ MMG3D_Get_meshSize()

LIBMMG3D_EXPORT int MMG3D_Get_meshSize ( MMG5_pMesh  mesh,
MMG5_int *  np,
MMG5_int *  ne,
MMG5_int *  nprism,
MMG5_int *  nt,
MMG5_int *  nquad,
MMG5_int *  na 
)

Get the number of vertices, tetrahedra, prisms, triangles, quadrilaterals and edges of the mesh.

recover data

Parameters
meshpointer to the mesh structure.
nppointer to the number of vertices.
nepointer to the number of tetrahedra.
nprismpointer to the number of prisms.
ntpointer to the number of triangles.
nquadpointer to the number of quads.
napointer to the number of edges.
Returns
1.
Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_GET_MESHSIZE(mesh,np,ne,nprism,nt,nquad,na,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT) :: np,ne,nprism,nt,nquad,na
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 343 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Get_nonBdyTriangle()

LIBMMG3D_EXPORT int MMG3D_Get_nonBdyTriangle ( MMG5_pMesh  mesh,
MMG5_int *  v0,
MMG5_int *  v1,
MMG5_int *  v2,
MMG5_int *  ref,
MMG5_int  idx 
)

Get vertices and reference of a non-boundary triangle.

Parameters
meshpointer to the mesh structure.
v0pointer to the firts vertex of the triangle
v1pointer to the second vertex of the triangle.
v2pointer to the third vertex of the triangle.
refpointer to the triangle reference.
idxindex of the non-boundary triangle to get (between 1 and nb_tria)
Returns
0 if failed, 1 otherwise.

Get vertices and reference ref of the idx^th non-boundary triangle (for DG methods for example). A tria is boundary if it is located at the interface of 2 domains with different references or if it belongs to one tetra only.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_GET_NONBDYTRIANGLE(mesh,v0,v1,v2,ref,idx,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(OUT):: v0,v1,v2
INTEGER(MMG5F_INT) :: ref
INTEGER(MMG5F_INT), INTENT(IN) :: idx
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1131 of file libmmg3d_tools.c.

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

◆ MMG3D_Get_normalAtVertex()

LIBMMG3D_EXPORT int MMG3D_Get_normalAtVertex ( MMG5_pMesh  mesh,
MMG5_int  k,
double *  n0,
double *  n1,
double *  n2 
)

Get the normal orientation at a single mesh vertex.

Parameters
meshpointer to the mesh structure.
kvertex index
n0x componant of the normal at vertex k.
n1y componant of the normal at vertex k.
n2z componant of the normal at vertex k.
Returns
1 if success.

This function retrieves the normal (n0,n1,n2) at vertex k.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_GET_NORMALATVERTEX(mesh,k,n0,n1,n2,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(IN):: k
REAL(KIND=8) :: n0,n1,n2
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1392 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Get_numberOfNonBdyTriangles()

LIBMMG3D_EXPORT int MMG3D_Get_numberOfNonBdyTriangles ( MMG5_pMesh  mesh,
MMG5_int *  nb_tria 
)

Get the number of non-boundary triangles.

Parameters
meshpointer to the mesh structure.
nb_triapointer to the number of non-boundary triangles.
Returns
0 if failed, 1 otherwise.

Get the number of non-boundary triangles (for DG methods for example). A triangle is boundary if it is located at the interface of 2 domains with different references or if it belongs to one tetra only. Append these triangles to the list of triangles.

Warning
reallocates the triangle array and appends the internal triangles. This may modify the behaviour of other functions.
Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_GET_NUMBEROFNONBDYTRIANGLESS(mesh,nb_tria,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(OUT) :: nb_tria
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

First step: Mesh analysis to detect the tetra/prisms boundary faces and to store the info in the xtetra/xprisms structures

Second step: Count the number of non boundary faces

Third step: Append the non boundary edges to the boundary edges array

Definition at line 916 of file libmmg3d_tools.c.

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

◆ MMG3D_Get_prism()

LIBMMG3D_EXPORT int MMG3D_Get_prism ( MMG5_pMesh  mesh,
MMG5_int *  v0,
MMG5_int *  v1,
MMG5_int *  v2,
MMG5_int *  v3,
MMG5_int *  v4,
MMG5_int *  v5,
MMG5_int *  ref,
int *  isRequired 
)

Get the vertices and reference of the next prism in the mesh.

Parameters
meshpointer to the mesh structure.
v0pointer to the first vertex of prism.
v1pointer to the second vertex of prism.
v2pointer to the third vertex of prism.
v3pointer to the fourth vertex of prism.
v4pointer to the fifth vertex of prism.
v5pointer to the sixth vertex of prism.
refpointer to the prism reference.
isRequiredpointer to the flag saying if prism is required.
Returns
0 if failed, 1 otherwise.

This function retrieves the vertices v0, v1, v2, v3, v4, v5 and reference ref of the next prism of mesh. It is meant to be called in a loop over all prisms. When it has been called as many times as there are prisms, the internal loop counter will be reset.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_GET_PRISM(mesh,v0,v1,v2,v3,v4,v5,ref,isRequired,&
retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(OUT) :: v0,v1,v2,v3,v4,v5
INTEGER(MMG5F_INT) :: ref
INTEGER :: isRequired
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 757 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Get_prisms()

LIBMMG3D_EXPORT int MMG3D_Get_prisms ( MMG5_pMesh  mesh,
MMG5_int *  prisms,
MMG5_int *  refs,
int *  areRequired 
)

Get the vertices and references of all prisms in the mesh.

Parameters
meshpointer to the mesh structure.
prismspointer to the array where the vertices are to be stored Vertices of the \(i^{th}\) prism are stored in prisms[(i-1)*6] to prisms[(i-1)*6+5].
refspointer to the array of the prism references. The reference of the \(i^{th}\) prism is stored in refs[i-1].
areRequiredpointer to the array of the flags saying if the prisms are required. areRequired[i-1]=1 if the \(i^{th}\) prism is required.
Returns
0 if failed, 1 otherwise.
Remarks
Fortran interface: (commentated in order to allow to pass %val(0) instead of the refs, areCorners or areRequired arrays)

‍! SUBROUTINE MMG3D_GET_PRISMS(mesh,prisms,refs,areRequired,&
! retval)
! MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
! INTEGER(MMG5F_INT), DIMENSION(*),INTENT(OUT) :: prisms
! INTEGER(MMG5F_INT), DIMENSION(*) :: refs
! INTEGER, DIMENSION(*) :: areRequired
! INTEGER, INTENT(OUT) :: retval
! END SUBROUTINE

Definition at line 833 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Get_quadrilateral()

LIBMMG3D_EXPORT int MMG3D_Get_quadrilateral ( MMG5_pMesh  mesh,
MMG5_int *  v0,
MMG5_int *  v1,
MMG5_int *  v2,
MMG5_int *  v3,
MMG5_int *  ref,
int *  isRequired 
)

Get the vertices and reference of the next quadrilateral of the mesh.

Parameters
meshpointer to the mesh structure.
v0pointer to the first vertex of quadrilateral.
v1pointer to the second vertex of quadrilateral.
v2pointer to the third vertex of quadrilateral.
v3pointer to the fourth vertex of quadrilateral.
refpointer to the quadrilateral reference.
isRequiredpointer to the flag saying if quadrilateral is required.
Returns
0 if failed, 1 otherwise.

Get the vertices v0,v1,v2,v3 and reference ref of the next quadrilateral of mesh. This function is meant to be called in a loop over all quadrilaterals. When it has been called as many times as there are quadrilaterals, the internal loop counter will be reset.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_GET_QUADRILATERAL(mesh,v0,v1,v2,v3,ref,isRequired,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(OUT) :: v0,v1,v2,v3,ref
INTEGER :: isRequired
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1009 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Get_quadrilaterals()

LIBMMG3D_EXPORT int MMG3D_Get_quadrilaterals ( MMG5_pMesh  mesh,
MMG5_int *  quads,
MMG5_int *  refs,
int *  areRequired 
)

Get the vertices and references of all quadrilaterals of the mesh.

Parameters
meshpointer to the mesh structure.
quadspointer to the array where the vertices will be stored. Vertices of the \(i^{th}\) quadrilateral are stored in quads[(i-1)*4] to quads[(i-1)*4+3].
refspointer to the array of the quadrilaterals references. refs[i-1] is the ref of the \(i^{th}\) quadrilateral.
areRequiredpointer to array of the flags saying if quadrilaterals are required. areRequired[i-1]=1 if the \(i^{th}\) quadrilateral is required.
Returns
0 if failed, 1 otherwise.
Remarks
Fortran interface: (Commentated in order to allow to pass %val(0) instead of the refs or areRequired arrays)

‍! SUBROUTINE MMG3D_GET_QUADRILATERALS(mesh,quads,refs,areRequired,retval)
! MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
! INTEGER(MMG5F_INT), DIMENSION(*),INTENT(OUT) :: quads
! INTEGER(MMG5F_INT), DIMENSION(*) :: refs
! INTEGER, DIMENSION(*) :: areRequired
! INTEGER, INTENT(OUT) :: retval
! END SUBROUTINE

Definition at line 1072 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Get_scalarSol()

LIBMMG3D_EXPORT int MMG3D_Get_scalarSol ( MMG5_pSol  met,
double *  s 
)

Get the next element of a scalar solution structure defined at vertices.

Parameters
metpointer to the sol structure.
spointer to the scalar solution value.
Returns
0 if failed, 1 otherwise.

This function retrieves the solution s of the next vertex of mesh. It is meant to be called in a loop over all vertices. When it has been called as many times as there are vertices in the mesh, the internal loop counter will be reset.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_GET_SCALARSOL(met,s,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: met
REAL(KIND=8), INTENT(OUT) :: s
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1468 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Get_scalarSols()

LIBMMG3D_EXPORT int MMG3D_Get_scalarSols ( MMG5_pSol  met,
double *  s 
)

Get all elements of a scalar solution structure defined at vertices.

Parameters
metpointer to the sol structure.
sarray of the scalar solutions at mesh vertices. The solution at vertex i will be stored in s[i-1].
Returns
0 if failed, 1 otherwise.
Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_GET_SCALARSOLS(met,s,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: met
REAL(KIND=8), DIMENSION(*),INTENT(OUT) :: s
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1515 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Get_solsAtVerticesSize()

LIBMMG3D_EXPORT int MMG3D_Get_solsAtVerticesSize ( MMG5_pMesh  mesh,
MMG5_pSol sol,
int *  nsols,
MMG5_int *  nentities,
int *  typSol 
)

Get the number of elements, type, and dimensions of several solutions defined on vertices.

Parameters
meshpointer to the mesh structure.
solpointer to an array of sol structure.
nsolspointer to the number of solutions per entity.
nentitiespointer to the number of solutions.
typSolarray of size MMG5_NSOLS_MAX to store type of each solution (scalar, vectorial, ..., see MMG5_type for possible values).
Returns
1.
Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_GET_SOLSATVERTICESSIZE(mesh,sol,nsols,nentities,typSol,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh,sol
INTEGER :: nsols
INTEGER(MMG5F_INT) :: nentities
INTEGER :: typSol(*)
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 314 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Get_solSize()

LIBMMG3D_EXPORT int MMG3D_Get_solSize ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
int *  typEntity,
MMG5_int *  np,
int *  typSol 
)

Get the number of elements, dimension, and type of a solution structure.

Parameters
meshpointer to the mesh structure.
solpointer to the sol structure.
typEntitypointer to the type of entities to which solutions are applied (see MMG5_entities for possible values)
nppointer to the number of solutions.
typSolpointer to the type of the solutions (scalar, vectorial, ..., see MMG5_type for possible values)
Returns
1.
Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_GET_SOLSIZE(mesh,sol,typEntity,np,typSol,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh,sol
INTEGER :: typEntity,typSol
INTEGER(MMG5F_INT) :: np
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 290 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Get_tensorSol()

LIBMMG3D_EXPORT int MMG3D_Get_tensorSol ( MMG5_pSol  met,
double *  m11,
double *  m12,
double *  m13,
double *  m22,
double *  m23,
double *  m33 
)

Get the next element of a tensor solution structure.

Parameters
metpointer to the sol structure.
m11pointer to the position (1,1) in the solution tensor.
m12pointer to the position (1,2) in the solution tensor.
m13pointer to the position (1,3) in the solution tensor.
m22pointer to the position (2,2) in the solution tensor.
m23pointer to the position (2,3) in the solution tensor.
m33pointer to the position (3,3) in the solution tensor.
Returns
0 if failed, 1 otherwise.

This function retrieves the next element \((m_{11},m_{12},m_{13},m_{22},m_{23},m_{33})\) of a tensor-valued solution field. It is meant to be called in a loop over all vertices. When it has been called as many times as there are elements in the solution, the internal loop counter will be reset.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_GET_TENSORSOL(met,m11,m12,m13,m22,m23,m33,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: met
REAL(KIND=8), INTENT(OUT) :: m11,m12,m13,m22,m23,m33
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1673 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Get_tensorSols()

LIBMMG3D_EXPORT int MMG3D_Get_tensorSols ( MMG5_pSol  met,
double *  sols 
)

Get all elements of a tensor solution field.

Parameters
metpointer to the sol structure.
solsarray of the solutions at mesh vertices. The solution at vertex i will be stored in sols[6*(i-1)] to sols[6*(i-1)+5].
Returns
0 if failed, 1 otherwise.
Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_GET_TENSORSOLS(met,sols,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: met
REAL(KIND=8), DIMENSION(*), INTENT(OUT) :: sols
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1735 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Get_tetFromTria()

LIBMMG3D_EXPORT int MMG3D_Get_tetFromTria ( MMG5_pMesh  mesh,
MMG5_int  ktri,
MMG5_int *  ktet,
int *  iface 
)

Get a tetrahedron given one of its triangles and the index by which it refers to this triangle (DEPRECATED).

Parameters
meshpointer to the mesh structure.
ktriindex of the boundary triangle.
ktetpointer to an integer that will contains the tetra index.
ifacepointer to the triangle in ktet.
Returns
0 if fail, 1 otherwise

Fill ktet by the index of a tetrahedron to which belongs a boundary triangle and iface by the index of the triangle in the tetra.

Warning
will be deprecated in release 5.5
Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_GET_TETFROMTRIA(mesh,ktri,ktet,iface,retval)
MMG5_DATA_PTR_T, INTENT(IN) :: mesh
INTEGER(MMG5F_INT), INTENT(IN) :: ktri
INTEGER(MMG5F_INT), INTENT(OUT) :: ktet
INTEGER, INTENT(OUT) :: iface
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1323 of file libmmg3d_tools.c.

Here is the caller graph for this function:

◆ MMG3D_Get_tetrahedra()

LIBMMG3D_EXPORT int MMG3D_Get_tetrahedra ( MMG5_pMesh  mesh,
MMG5_int *  tetra,
MMG5_int *  refs,
int *  areRequired 
)

Get the vertices and reference of all tetrahedra in the mesh.

Parameters
meshpointer to the mesh structure.
tetrapointer to the array where the vertices are to be stored. Vertices of the \(i^{th}\) tetra are stored in tetra[(i-1)*4] to tetra[(i-1)*4+3]
refspointer to the array of the tetrahedron references. References of the \(i^{th}\) tetra is stored in refs[i-1].
areRequiredpointer to the array of the flags saying if the tetrahedra are required. areRequired[i-1]=1 if the \(i^{th}\) tetrahedron is required.
Returns
0 if failed, 1 otherwise.
Remarks
Fortran interface: (commentated in order to allow to pass %val(0) instead of the refs, areCorners or areRequired arrays)

‍! SUBROUTINE MMG3D_GET_TETRAHEDRA(mesh,tetra,refs,areRequired,&
! retval)
! MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
! INTEGER(MMG5F_INT), DIMENSION(*),INTENT(OUT) :: tetra
! INTEGER(MMG5F_INT), DIMENSION(*) :: refs
! INTEGER, DIMENSION(*) :: areRequired
! INTEGER, INTENT(OUT) :: retval
! END SUBROUTINE

Definition at line 693 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Get_tetrahedron()

LIBMMG3D_EXPORT int MMG3D_Get_tetrahedron ( MMG5_pMesh  mesh,
MMG5_int *  v0,
MMG5_int *  v1,
MMG5_int *  v2,
MMG5_int *  v3,
MMG5_int *  ref,
int *  isRequired 
)

Get the vertices and reference of the next tetrahedron in the mesh.

Parameters
meshpointer to the mesh structure.
v0pointer to the first vertex of tetrahedron.
v1pointer to the second vertex of tetrahedron.
v2pointer to the third vertex of tetrahedron.
v3pointer to the fourth vertex of tetrahedron.
refpointer to the tetrahedron reference.
isRequiredpointer to the flag saying if tetrahedron is required.
Returns
0 if failed, 1 otherwise.

This function retrieves the vertices v0, v1, v2, v3 and reference ref of the next tetrahedron of mesh. It is meant to be called in a loop over all tetrahedra. When it has been called as many times as there are tetrahedra, the internal loop counter will be reset.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_GET_TETRAHEDRON(mesh,v0,v1,v2,v3,ref,isRequired,&
retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(OUT):: v0,v1,v2,v3
INTEGER(MMG5F_INT) :: ref
INTEGER :: isRequired
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 593 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Get_tetrahedronQuality()

LIBMMG3D_EXPORT double MMG3D_Get_tetrahedronQuality ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_int  k 
)

Get the quality measure of a single tetrahedron in the mesh.

Parameters
meshpointer to the mesh structure.
metpointer to the metric structure (may be NULL for an isotropic metric).
kindex of the tetrahedron for which we want to get the quality (from 1 to the number of tetrahedra included)
Returns
the computed quality or 0 in case of failure.

This function returns the quality measure of tetrahedron k. Quality values range from 0 (degenerate) to 1 (best attainable). The function returns 0 if the tetrahedron is flat or has a negative volume, and also if k is out of range. In the latter case it will also print a diagnostic message to standard output.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_GET_TETRAHEDRONQUALITY(mesh,met,k,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh,met
INTEGER(MMG5F_INT), INTENT(IN):: k
REAL(KIND=8), INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1402 of file API_functions_3d.c.

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

◆ MMG3D_Get_tetsFromTria()

LIBMMG3D_EXPORT int MMG3D_Get_tetsFromTria ( MMG5_pMesh  mesh,
MMG5_int  ktri,
MMG5_int  ktet[2],
int  iface[2] 
)

Get two tetrahedra given a triangle and face indices.

Parameters
meshpointer to the mesh structure.
ktriindex of the boundary triangle.
ktetarray of size 2 that will contain the indices of the tetra (filled by the function).
ifacepointer to an array of size 2 that will contains the indices of the faces of the tetras ktet[i] that corresponds to the boundary tria ktri.
Returns
0 if fail, 1 otherwise

Fill ktet by the indices of the tetrahedra that have a boundary triangle and iface by the indices of the faces of the tetras that correspond to the triangle. Fill ktet[1] and iface[1] by 0 if the triangle belongs to 1 tetrahedron only.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_GET_TETSFROMTRIA(mesh,ktri,ktet,iface,retval)
MMG5_DATA_PTR_T, INTENT(IN) :: mesh
INTEGER(MMG5F_INT), INTENT(IN) :: ktri
INTEGER(MMG5F_INT), DIMENSION(2), INTENT(OUT):: ktet
INTEGER, DIMENSION(2), INTENT(OUT) :: iface
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1342 of file libmmg3d_tools.c.

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

◆ MMG3D_Get_triangle()

LIBMMG3D_EXPORT int MMG3D_Get_triangle ( MMG5_pMesh  mesh,
MMG5_int *  v0,
MMG5_int *  v1,
MMG5_int *  v2,
MMG5_int *  ref,
int *  isRequired 
)

Get the vertices and reference of the next triangle in the mesh.

Parameters
meshpointer to the mesh structure.
v0pointer to the first vertex of triangle.
v1pointer to the second vertex of triangle.
v2pointer to the third vertex of triangle.
refpointer to the triangle reference.
isRequiredpointer to the flag saying if triangle is required.
Returns
0 if failed, 1 otherwise.

This function retrieves the vertices v0, v1, v2, and reference ref of the next triangle of mesh. It is meant to be called in a loop over all triangles. When it has been called as many times as there are triangles, the internal loop counter will be reset.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_GET_TRIANGLE(mesh,v0,v1,v2,ref,isRequired,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(OUT) :: v0,v1,v2
INTEGER(MMG5F_INT) :: ref
INTEGER :: isRequired
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 896 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Get_triangles()

LIBMMG3D_EXPORT int MMG3D_Get_triangles ( MMG5_pMesh  mesh,
MMG5_int *  tria,
MMG5_int *  refs,
int *  areRequired 
)

Get the vertices and references of all triangles in the mesh.

Parameters
meshpointer to the mesh structure.
triapointer to the array where the vertices are to be stored Vertices of the \(i^{th}\) triangle are stored in tria[(i-1)*3] to tria[(i-1)*3+2].
refspointer to the array where the references are to be stored. refs[i-1] is the reference of the \(i^{th}\) triangle.
areRequiredpointer to array of the flags saying if triangles are required. areRequired[i-1]=1 if the \(i^{th}\) tria is required.
Returns
0 if failed, 1 otherwise.
Remarks
Fortran interface: (Commentated in order to allow to pass %val(0) instead of the refs or areRequired arrays)

‍! SUBROUTINE MMG3D_GET_TRIANGLES(mesh,tria,refs,areRequired,retval)
! MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
! INTEGER(MMG5F_INT), DIMENSION(*),INTENT(OUT) :: tria
! INTEGER(MMG5F_INT), DIMENSION(*) :: refs
! INTEGER, DIMENSION(*) :: areRequired
! INTEGER, INTENT(OUT) :: retval
! END SUBROUTINE

Definition at line 956 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Get_vectorSol()

LIBMMG3D_EXPORT int MMG3D_Get_vectorSol ( MMG5_pSol  met,
double *  vx,
double *  vy,
double *  vz 
)

Get the next element of a vector solution structure.

Parameters
metpointer to the sol structure.
vxx value of the vectorial solution.
vyy value of the vectorial solution.
vzz value of the vectorial solution.
Returns
0 if failed, 1 otherwise.

This function retrieves the next vector-valued element \((v_x,v_y,vz)\) of the solution. It is meant to be called in a loop over all elements. When it has been called as many times as there are elements in the solution, the internal loop counter will be reset.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_GET_VECTORSOL(met,vx,vy,vz,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: met
REAL(KIND=8), INTENT(OUT) :: vx,vy,vz
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1561 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Get_vectorSols()

LIBMMG3D_EXPORT int MMG3D_Get_vectorSols ( MMG5_pSol  met,
double *  sols 
)

Get all elements of a vector solution structure.

Parameters
metpointer to the sol structure.
solsarray of the solutions at mesh vertices. sols[3*(i-1)]@3 is the solution at vertex i.
Returns
0 if failed, 1 otherwise.

Get vectorial solutions at mesh vertices

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_GET_VECTORSOLS(met,sols,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: met
REAL(KIND=8), DIMENSION(*),INTENT(OUT) :: sols
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1616 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Get_vertex()

LIBMMG3D_EXPORT int MMG3D_Get_vertex ( MMG5_pMesh  mesh,
double *  c0,
double *  c1,
double *  c2,
MMG5_int *  ref,
int *  isCorner,
int *  isRequired 
)

Get the coordinates c0, c1,c2 and reference ref of the next vertex of mesh.

Parameters
meshpointer to the mesh structure.
c0pointer to the coordinate of the vertex along the first dimension.
c1pointer to the coordinate of the vertex along the second dimension.
c2pointer to the coordinate of the vertex along the third dimension.
refpointer to the vertex reference.
isCornerpointer to the flag saying if vertex is corner.
isRequiredpointer to the flag saying if vertex is required.
Returns
1.

This function retrieves the coordinates c0, c1,c2 and reference ref of the next vertex of a mesh. It is meant to be used in a loop over all vertices. When this function has been called as many times as there are vertices, the internal loop counter will be reset. To obtain data for a specific vertex, the MMG3D_GetByIdx_vertex function can be used instead.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_GET_VERTEX(mesh,c0,c1,c2,ref,isCorner,isRequired, &
retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
REAL(KIND=8), INTENT(OUT) :: c0,c1,c2
INTEGER(MMG5F_INT) :: ref
INTEGER :: isCorner,isRequired
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 398 of file API_functions_3d.c.

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

◆ MMG3D_Get_vertices()

LIBMMG3D_EXPORT int MMG3D_Get_vertices ( MMG5_pMesh  mesh,
double *  vertices,
MMG5_int *  refs,
int *  areCorners,
int *  areRequired 
)

Get the coordinates and references of all vertices in the mesh.

Parameters
meshpointer to the mesh structure.
verticespointer to the array of coordinates. The coordinates of the \(i^{th}\) vertex are stored in vertices[(i-1)*3]@3.
refspointer to the array of the vertex references. The ref of the \(i^th\) vertex is stored in refs[i-1].
areCornerspointer to the array of the flags saying if vertices are corners. areCorners[i-1]=1 if the \(i^{th}\) vertex is corner.
areRequiredpointer to the array of flags saying if vertices are required. areRequired[i-1]=1 if the \(i^{th}\) vertex is required.
Returns
1.
Remarks
Fortran interface: (commentated in order to allow to pass %val(0) instead of the refs, areCorners or areRequired arrays)

‍! SUBROUTINE MMG3D_GET_VERTICES(mesh,vertices,refs,areCorners,&
! areRequired,retval)
! MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
! REAL(KIND=8),DIMENSION(*), INTENT(OUT) :: vertices
! INTEGER(MMG5F_INT), DIMENSION(*) :: refs
! INTEGER, DIMENSION(*) :: areCorners,areRequired
! INTEGER, INTENT(OUT) :: retval
! END SUBROUTINE

Definition at line 485 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_GetByIdx_vertex()

LIBMMG3D_EXPORT int MMG3D_GetByIdx_vertex ( MMG5_pMesh  mesh,
double *  c0,
double *  c1,
double *  c2,
MMG5_int *  ref,
int *  isCorner,
int *  isRequired,
MMG5_int  idx 
)

Get the coordinates and reference of a specific vertex in the mesh.

Parameters
meshpointer to the mesh structure.
c0pointer to the coordinate of the vertex along the first dimension.
c1pointer to the coordinate of the vertex along the second dimension.
c2pointer to the coordinate of the vertex along the third dimension.
refpointer to the vertex reference.
isCornerpointer to the flag saying if vertex is corner.
isRequiredpointer to the flag saying if vertex is required.
idxindex of vertex to get.
Returns
1.

Get coordinates c0, c1, c2 and reference ref of vertex idx of mesh.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_GETBYIDX_VERTEX(mesh,c0,c1,c2,ref,isCorner,isRequired,idx,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
REAL(KIND=8), INTENT(OUT) :: c0,c1,c2
INTEGER(MMG5F_INT) :: ref,idx
INTEGER :: isCorner,isRequired
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 425 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_hashTetra()

LIBMMG3D_EXPORT int MMG3D_hashTetra ( MMG5_pMesh  mesh,
int  pack 
)

Create array of adjacency.

Parameters
meshpointer to the mesh structure.
packwe pack the mesh at function begining if \(pack=1\).
Returns
0 if failed, 1 otherwise.

Create array of adjacency. Set pack variable to 0 for a compact mesh and to 1 for a mesh that need to be packed.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_HASHTETRA(mesh,pack,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh
INTEGER, INTENT(IN) :: pack
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Parameters
meshpointer to the mesh structure.
packwe pack the mesh at function begining if \(pack=1\).
Returns
0 if failed, 1 otherwise.

Create table of adjacency. Set pack variable to 0 for a compact mesh and to 1 for a mesh that need to be packed.

Definition at line 122 of file hash_3d.c.

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

◆ MMG3D_Init_fileNames()

LIBMMG3D_EXPORT void MMG3D_Init_fileNames ( MMG5_pMesh  mesh,
MMG5_pSol  sol 
)

Initialize file names to their default values.

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

This function initializes all file names to their default values.

Remarks
Fortran interface:

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

Definition at line 58 of file API_functions_3d.c.

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

◆ MMG3D_Init_mesh()

LIBMMG3D_EXPORT int MMG3D_Init_mesh ( const int  starter,
  ... 
)

Initialize a mesh structure and optionally the associated solution and metric structures.

Parameters
starterdummy argument used to initialize the variadic argument list
...variadic arguments that depend on the library function that you want to call.

For the MMG3D_mmg3dlib function, you need to call the MMG3D_Init_mesh function with the following arguments : MMG3D_Init_mesh(MMG5_ARG_start,MMG5_ARG_ppMesh, &your_mesh, MMG5_ARG_ppMet MMG5_ARG_ppMet, &your_metric,MMG5_ARG_end).

For the MMG3D_mmg3dls function, you need to call the MMG3D_Init_mesh function with the following arguments : MMG3D_Init_mesh(MMG5_ARG_start,MMG5_ARG_ppMesh, &your_mesh, MMG5_ARG_ppLs, &your_level_set,MMG5_ARG_end).

For the MMG3D_mmg3dmov function, you must call : MMG3D_Init_mesh(MMG5_ARG_start,MMG5_ARG_ppMesh, &your_mesh, MMG5_ARG_ppMet,&empty_metric,MMG5_ARG_ppDisp, &your_displacement, MMG5_ARG_end).

Here, your_mesh is a MMG5_pMesh, your_metric your_level_set and your_displacement are MMG5_pSol.

Returns
1 on success, 0 on failure

This function allocates and initializes MMG structures. All structures of types MMG5_pMesh and MMG5_pSol that will be given as arguments to Mmg functions must be initialized with this function.

Remarks
No fortran interface to allow variadic arguments.
Warning
detected bugs:
  • some vertices along open boundaries end up with a normal (while they should not)

Definition at line 46 of file API_functions_3d.c.

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

◆ MMG3D_Init_parameters()

LIBMMG3D_EXPORT void MMG3D_Init_parameters ( MMG5_pMesh  mesh)

Initialize parameters to their default values.

Parameters
meshpointer to the mesh structure.

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

Remarks
Fortran interface:

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

Definition at line 87 of file API_functions_3d.c.

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

◆ MMG3D_loadAllSols()

LIBMMG3D_EXPORT int MMG3D_loadAllSols ( MMG5_pMesh  mesh,
MMG5_pSol sol,
const char *  filename 
)

Load one or more solutions in a solution file in medit file format.

Parameters
meshpointer to the mesh structure.
solpointer to the solutions array
filenamename of file.
Returns
0 if file is not found, -1 if fail for another reason (insufficient memory, file format...), 1 if successful.
Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_LOADALLSOLS(mesh,sol,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Read the file header

Sol tab allocation

Definition at line 2216 of file inout_3d.c.

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

◆ MMG3D_loadGenericMesh()

LIBMMG3D_EXPORT int MMG3D_loadGenericMesh ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_pSol  sol,
const char *  filename 
)

Read mesh data in a format determined by the filename extension.

Parameters
meshpointer to the mesh structure.
metpointer to the metric structure or the NULL pointer.
solpointer to the level-set structure or the NULL pointer.
filenamename of file.
Returns
0 if file is not found, -1 if fail for another reason (insufficient memory, file format...), 1 if success.
Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_LOADGENERICMESH(mesh,met,sol,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,met,sol
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1190 of file inout_3d.c.

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

◆ MMG3D_loadMesh()

LIBMMG3D_EXPORT int MMG3D_loadMesh ( MMG5_pMesh  mesh,
const char *  filename 
)

Load a mesh (in .mesh/.mesb format) from file.

Parameters
meshpointer to the mesh structure.
filenamename of the file.
Returns
0 if file is not found, -1 if fail for another reason (insufficient memory, file format...), 1 if success.

Read mesh data.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_LOADMESH(mesh,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Parameters
meshpointer to the mesh structure.
filenamename of file.
Returns
0 if the file is not found, -1 if we detect mismatch parameters or we fail, 1 otherwise.

Read mesh data.

Definition at line 1049 of file inout_3d.c.

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

◆ MMG3D_loadMshMesh()

LIBMMG3D_EXPORT int MMG3D_loadMshMesh ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
const char *  filename 
)

Load a mesh and possibly a solution in .msh format from file.

Parameters
meshpointer to the mesh structure.
solpointer to the solution structure.
filenamename of file.
Returns
0 if file is not found, -1 if fail for another reason (insufficient memory, file format...), 1 if success.

This function reads a mesh and 0 or 1 data fields in MSH file format (.msh extension). We read only low-order vertices, edges, triangles, quadrangles, tetrahedra and prisms.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_LOADMSHMESH(mesh,sol,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1063 of file inout_3d.c.

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

◆ MMG3D_loadMshMesh_and_allData()

LIBMMG3D_EXPORT int MMG3D_loadMshMesh_and_allData ( MMG5_pMesh  mesh,
MMG5_pSol sol,
const char *  filename 
)

Load a mesh and all data from a file in MSH format.

Parameters
meshpointer to the mesh structure.
solpointer to a list of solution structures.
filenamename of file.
Returns
0 if file is not found, -1 if fail for another reason (insufficient memory, file format...), 1 if success.

Read mesh and a list of data in MSH file format (.msh extension). We read only low-order vertices, edges, tria, quadra, tetra and prisms.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_LOADMSHMESH_AND_ALLDATA(mesh,sol,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1132 of file inout_3d.c.

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

◆ MMG3D_loadSol()

LIBMMG3D_EXPORT int MMG3D_loadSol ( MMG5_pMesh  mesh,
MMG5_pSol  met,
const char *  filename 
)

Load a metric field (or other solution).

Parameters
meshpointer to the mesh structure.
metpointer to the sol structure.
filenamename of file.
Returns
0 if file is not found, -1 if fail for another reason (insufficient memory, file format...), 1 if successful.

Load metric field. The solution file must contains only 1 solution: the metric

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_LOADSOL(mesh,met,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,met
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Read the file header

Definition at line 2143 of file inout_3d.c.

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

◆ MMG3D_loadVtkMesh()

LIBMMG3D_EXPORT int MMG3D_loadVtkMesh ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_pSol  sol,
const char *  filename 
)

Load a mesh and possibly a solution from a file in VTK format.

Parameters
meshpointer to the mesh structure.
metpointer to the metric structure or the NULL pointer.
solpointer to the level-set structure or the NULL pointer.
filenamename of file.
Returns
0 if file is not found, -1 if fail for another reason (insufficient memory, file format...), 1 if success.

This function reads a mesh and 0 or 1 data fields in VTK file format (.vtu extension). We read only low-order vertices, edges, tria, quadra, tetra and prisms. Point and cell references must be stored in PointData or CellData whose names contain the "medit:ref" keyword.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_LOADVTKMESH(mesh,met,sol,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,met,sol
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 153 of file inoutcpp_3d.cpp.

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

◆ MMG3D_loadVtkMesh_and_allData()

LIBMMG3D_EXPORT int MMG3D_loadVtkMesh_and_allData ( MMG5_pMesh  mesh,
MMG5_pSol sol,
const char *  filename 
)

Load a mesh and multiple solutions from a file in VTK format.

Parameters
meshpointer to the mesh structure.
solpointer to the solution structure.
filenamename of file.
Returns
0 if file is not found, -1 if fail for another reason (insufficient memory, file format...), 1 if success.

Read mesh and a list of data in VTK file format (.vtu extension). We read only low-order vertices, edges, tria, quadra, tetra and prisms. Point and cell references must be stored in PointData or CellData whose names contains the "medit:ref" keyword.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_LOADVTKMESH_AND_ALLDATA(mesh,sol,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 196 of file inoutcpp_3d.cpp.

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

◆ MMG3D_loadVtuMesh()

LIBMMG3D_EXPORT int MMG3D_loadVtuMesh ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_pSol  sol,
const char *  filename 
)

Load a mesh and possibly a solution in VTU (VTK) format from file.

Parameters
meshpointer to the mesh structure.
metpointer to the metric structure or the NULL pointer.
solpointer to the level-set structure or the NULL pointer.
filenamename of file.
Returns
0 if file is not found, -1 if fail for another reason (insufficient memory, file format...), 1 if success.

This function reads a mesh and 0 or 1 data field in VTU (VTK) file format (.vtu extension). We read only low-order vertices, edges, tria, quadra, tetra and prisms. Point and cell references must be stored in PointData or CellData whose names contain the "medit:ref" keyword.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_LOADVTUMESH(mesh,met,sol,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,met,sol
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 74 of file inoutcpp_3d.cpp.

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

◆ MMG3D_loadVtuMesh_and_allData()

LIBMMG3D_EXPORT int MMG3D_loadVtuMesh_and_allData ( MMG5_pMesh  mesh,
MMG5_pSol sol,
const char *  filename 
)

Load a mesh and multiple solutions in VTU (VTK) format from file.

Parameters
meshpointer to the mesh structure.
solpointer to the solution structure.
filenamename of file.
Returns
0 if file is not found, -1 if fail for another reason (insufficient memory, file format...), 1 if success.

This functionreads a mesh and a list of data in VTU file format (.vtu extension). We read only low-order vertices, edges, tria, quadra, tetra and prisms. Point and cell references must be stored in PointData or CellData whose names contains the "medit:ref" keyword.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_LOADVTUMESH_AND_ALLDATA(mesh,sol,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 117 of file inoutcpp_3d.cpp.

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

◆ MMG3D_mmg3dcheck()

LIBMMG3D_EXPORT int MMG3D_mmg3dcheck ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_pSol  sol,
double  critmin,
double  lmin,
double  lmax,
MMG5_int *  eltab,
int8_t  metRidTyp 
)

Search invalid elements (in term of quality or edge length) in a mesh.

Checks

Parameters
meshpointer to the mesh structure.
metpointer to the sol structure (metric).
solpointer to the sol structure (ls or displacement).
critminminimum quality for elements.
lminminimum edge length.
lmaxmaximum ede length.
eltabarray of invalid elements.
metRidTypType of storage of ridges metrics: 0 for classic storage (before the MMG5_defsiz call), 1 for special storage (after this call).
Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_MMG3DCHECK(mesh,met,sol,critmin,lmin,lmax,eltab,&
metridtyp,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,met,sol
REAL(KIND=8), INTENT(IN) :: critmin,lmin,lmax
INTEGER(MMG5F_INT),DIMENSION(*), INTENT(OUT) :: eltab
INTEGER, INTENT(IN) :: metridtyp
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

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

Definition at line 1196 of file libmmg3d_tools.c.

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

◆ MMG3D_mmg3dlib()

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

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

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

LIBMMG3D_EXPORT int MMG3D_parsar ( int  argc,
char *  argv[],
MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_pSol  sol 
)

Store command-line arguments.

Parameters
argcnumber of command line arguments.
argvcommand line arguments.
meshpointer to the mesh structure.
metpointer to a metric
solpointer to a level-set or displacement
Returns
1 if we want to run Mmg after, 0 if not or if fail.
Remarks
no matching fortran function.

Definition at line 660 of file libmmg3d_tools.c.

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

◆ MMG3D_parsop()

LIBMMG3D_EXPORT int MMG3D_parsop ( MMG5_pMesh  mesh,
MMG5_pSol  met 
)

Read a file containing Local parameters (.mmg3d extension)

Parameters
meshpointer to the mesh structure.
metpointer to the sol structure.
Returns
1.

Read local parameters file. This file must have the same name as the mesh with the .mmg3d extension or must be named DEFAULT.mmg3d.

Remarks
Fortran interface:

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

Definition at line 768 of file libmmg3d_tools.c.

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

◆ MMG3D_saveAllSols()

LIBMMG3D_EXPORT int MMG3D_saveAllSols ( MMG5_pMesh  mesh,
MMG5_pSol sol,
const char *  filename 
)

Save 1 or more solutions in medit solution file format.

Parameters
meshpointer to the mesh structure.
solpointer to the solutions array
filenamename of the solution file.
Returns
0 or -1 if fail, 1 otherwise.
Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SAVEALLSOLS(mesh,sol,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 2352 of file inout_3d.c.

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

◆ MMG3D_saveGenericMesh()

LIBMMG3D_EXPORT int MMG3D_saveGenericMesh ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
const char *  filename 
)

Save mesh data in a file whose format depends on the filename extension.

Parameters
meshpointer to the mesh structure.
filenamename of file.
Returns
0 if failed, 1 otherwise.
Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SAVEGENERICMESH(mesh,sol,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 2062 of file inout_3d.c.

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

◆ MMG3D_saveMesh()

LIBMMG3D_EXPORT int MMG3D_saveMesh ( MMG5_pMesh  mesh,
const char *  filename 
)

Save a mesh in .mesh/.meshb format.

Parameters
meshpointer to the mesh structure.
filenamepointer to the name of file.
Returns
0 if failed, 1 otherwise.
Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SAVEMESH(mesh,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Parameters
meshpointer to the mesh structure.
filenamepointer to the name of file.
Returns
0 if failed, 1 otherwise.

Save mesh data.

Warning
you must call the MMG3D_packMesh function before saving your mesh.

Definition at line 1273 of file inout_3d.c.

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

◆ MMG3D_saveMshMesh()

LIBMMG3D_EXPORT int MMG3D_saveMshMesh ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
const char *  filename 
)

Save a mesh in MSH format, ascii or binary depending on the filename extension.

Parameters
meshpointer to the mesh structure.
solpointer to the solution structure.
filenamename of file.
Returns
0 if failed, 1 otherwise.

Write mesh and 0 or 1 data in MSH file format (.msh extension). Write binary file for .mshb extension and ASCII for .msh one.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SAVEMSHMESH(mesh,sol,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 2133 of file inout_3d.c.

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

◆ MMG3D_saveMshMesh_and_allData()

LIBMMG3D_EXPORT int MMG3D_saveMshMesh_and_allData ( MMG5_pMesh  mesh,
MMG5_pSol sol,
const char *  filename 
)

Save a mesh and data in MSH format, ascii or binary depending on the filename extension.

Parameters
meshpointer to the mesh structure.
solpointer to the solution structure.
filenamename of file.
Returns
0 if failed, 1 otherwise.

Write mesh and a list of data fields (that are considered as solutions and not metrics, thus, we do nothing over the ridge vertices) in MSH file format (.msh extension). Save file in ASCII format for .msh extension, in binary format for .mshb one.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SAVEMSHMESH_AND_ALLDATA(mesh,sol,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 2138 of file inout_3d.c.

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

◆ MMG3D_saveSol()

LIBMMG3D_EXPORT int MMG3D_saveSol ( MMG5_pMesh  mesh,
MMG5_pSol  met,
const char *  filename 
)

Write isotropic or anisotropic metric.

Parameters
meshpointer to the mesh structure.
metpointer to the sol structure.
filenamename of file.
Returns
0 if failed, 1 otherwise.
Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SAVESOL(mesh,met,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,met
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 2314 of file inout_3d.c.

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

◆ MMG3D_saveTetgenMesh()

LIBMMG3D_EXPORT int MMG3D_saveTetgenMesh ( MMG5_pMesh  mesh,
const char *  filename 
)

Save data in Tetgen's Triangle format.

Parameters
meshpointer to the mesh structure.
filenamename of the readed file.
Returns
0 or -1 if fail, 1 otherwise.

Save mesh data in Triangle (or equivalent to Tetgen in 3D) file format.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SAVETETGENMESH(mesh,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 2658 of file inout_3d.c.

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

◆ MMG3D_saveVtkMesh()

LIBMMG3D_EXPORT int MMG3D_saveVtkMesh ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
const char *  filename 
)

Save a mesh and optionally one solution in VTK format.

Parameters
meshpointer to the mesh structure.
solpointer to the solution structure.
filenamename of file.
Returns
0 if failed, 1 otherwise.

Write mesh and 0 or 1 data in Vtk file format (.vtk extension).

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SAVEVTKMESH(mesh,sol,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 266 of file inoutcpp_3d.cpp.

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

◆ MMG3D_saveVtkMesh_and_allData()

LIBMMG3D_EXPORT int MMG3D_saveVtkMesh_and_allData ( MMG5_pMesh  mesh,
MMG5_pSol sol,
const char *  filename 
)

Save a mesh and multiple data fields in VTK format.

Parameters
meshpointer to the mesh structure.
solpointer to the solution structure.
filenamename of file.
Returns
0 if failed, 1 otherwise.

Write mesh and a list of data fields in Vtk file format (.vtk extension).

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SAVEVTKMESH_AND_ALLDATA(mesh,sol,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 281 of file inoutcpp_3d.cpp.

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

◆ MMG3D_saveVtuMesh()

LIBMMG3D_EXPORT int MMG3D_saveVtuMesh ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
const char *  filename 
)

Save a mesh and optionally one data field in VTU format.

Parameters
meshpointer to the mesh structure.
solpointer to the solution structure.
filenamename of file.
Returns
0 if failed, 1 otherwise.

Write mesh and 0 or 1 data in vtu Vtk file format (.vtu extension).

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SAVEVTUMESH(mesh,sol,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 232 of file inoutcpp_3d.cpp.

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

◆ MMG3D_saveVtuMesh_and_allData()

LIBMMG3D_EXPORT int MMG3D_saveVtuMesh_and_allData ( MMG5_pMesh  mesh,
MMG5_pSol sol,
const char *  filename 
)

Save a mesh and multiple data fields in VTU format.

Parameters
meshpointer to the mesh structure.
solpointer to the solution structure.
filenamename of file.
Returns
0 if failed, 1 otherwise.

Write mesh and a list of data fields in vtu Vtk file format (.vtu extension).

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SAVEVTUMESH_AND_ALLDATA(mesh,sol,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 246 of file inoutcpp_3d.cpp.

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

◆ MMG3D_searchlen()

LIBMMG3D_EXPORT int MMG3D_searchlen ( MMG5_pMesh  mesh,
MMG5_pSol  met,
double  lmin,
double  lmax,
MMG5_int *  eltab,
int8_t  metRidTyp 
)

List edges that are too short or too long.

Parameters
meshpointer to the mesh structure.
metpointer to the sol structure.
lminminimum edge length.
lmaxmaximum ede length.
eltabarray of invalid elements.
metRidTypType of storage of ridges metrics: 0 for classic storage (before the MMG5_defsiz call), 1 for special storage (after this call).
Returns
1 if success, 0 otherwise.

Store in eltab elements which have edge lengths shorter than lmin or longer than lmax, eltab is allocated and could contain mesh->ne elements.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SEARCHLEN(mesh,met,lmin,lmax,eltab,metridtyp,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,met
REAL(KIND=8), INTENT(IN) :: lmin,lmax
INTEGER(MMG5F_INT),DIMENSION(*), INTENT(OUT) :: eltab
INTEGER, INTENT(IN) :: metridtyp
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1387 of file libmmg3d_tools.c.

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

◆ MMG3D_searchqua()

LIBMMG3D_EXPORT void MMG3D_searchqua ( MMG5_pMesh  mesh,
MMG5_pSol  met,
double  critmin,
MMG5_int *  eltab,
int8_t  metRidTyp 
)

List bad elements.

Parameters
meshpointer to the mesh structure.
metpointer to the sol structure.
critminminimum quality for elements.
eltabpointer to the array of invalid elements.
metRidTypType of storage of ridges metrics: 0 for classic storage (before the MMG5_defsiz call), 1 for special storage (after this call).

Store elements which have worse quality than critmin in eltab, eltab is allocated and could contain mesh->ne elements.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SEARCHQUA(mesh,met,critmin,eltab,metridtyp)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,met
REAL(KIND=8), INTENT(IN) :: critmin
INTEGER(MMG5F_INT),DIMENSION(*), INTENT(OUT) :: eltab
INTEGER, INTENT(IN) :: metridtyp
END SUBROUTINE

Definition at line 1295 of file libmmg3d_tools.c.

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

◆ MMG3D_Set_commonFunc()

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

LIBMMG3D_EXPORT int MMG3D_Set_constantSize ( MMG5_pMesh  mesh,
MMG5_pSol  met 
)

Compute a constant size map according to the hsiz, hmin and hmax parameters.

Parameters
meshpointer to the mesh structure
metpointer to the sol structure
Returns
1 if success

This function computes a constant size map according to mesh->info.hsiz, mesh->info.hmin and mesh->info.hmax. It updates these 3 values if not compatible.

Remarks
Fortran interface:

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

Definition at line 1699 of file libmmg3d_tools.c.

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

◆ MMG3D_Set_corner()

LIBMMG3D_EXPORT int MMG3D_Set_corner ( MMG5_pMesh  mesh,
MMG5_int  k 
)

Assign the "corner" attribute to a vertex.

Parameters
meshpointer to the mesh structure.
kvertex index.
Returns
1.

Set the "corner" attribute at vertex k. This affects how the vertex is treated during remeshing.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_CORNER(mesh,k,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(IN):: k
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1223 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Set_dparameter()

LIBMMG3D_EXPORT int MMG3D_Set_dparameter ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
int  dparam,
double  val 
)

set a real-valued parameter of the remesher

Parameters
meshpointer to the mesh structure.
solpointer to the sol structure (unused).
dparamdouble parameter to set (see MMG3D_Param for a list of parameters that can be set).
valvalue of the parameter.
Returns
0 if failed, 1 otherwise.

This function sets the double parameter dparam to value val.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_DPARAMETER(mesh,sol,dparam,val,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
MMG5_DATA_PTR_T :: sol
INTEGER, INTENT(IN) :: dparam
REAL(KIND=8), INTENT(IN) :: val
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 2364 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Set_edge()

LIBMMG3D_EXPORT int MMG3D_Set_edge ( MMG5_pMesh  mesh,
MMG5_int  v0,
MMG5_int  v1,
MMG5_int  ref,
MMG5_int  pos 
)

Set the vertices and reference of a single edge in a mesh.

Parameters
meshpointer to the mesh structure.
v0first extremity of the edge.
v1second extremity of the edge.
refedge reference.
posedge position in the mesh.
Returns
0 if failed, 1 otherwise.

Set edges of extremities v0, v1 and reference ref at position pos in mesh structure (from 1 to nb_edges included)

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_EDGE(mesh,v0,v1,ref,pos,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(IN):: v0,v1,ref,pos
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1098 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Set_edges()

LIBMMG3D_EXPORT int MMG3D_Set_edges ( MMG5_pMesh  mesh,
MMG5_int *  edges,
MMG5_int *  refs 
)

Set the vertices and references of all edges in a mesh.

Parameters
meshpointer to the mesh structure.
edgespointer to the array of edges. The vertices of the \(i^{th}\) edge should be given in edges[(i-1)*2] and edges[(i-1)*2+1].
refsedges references. refs[i-1] is the ref of the \(i^{th}\) edge.
Returns
0 if failed, 1 otherwise.
Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_EDGES(mesh,edges,refs,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(IN) :: edges(*)
INTEGER(MMG5F_INT), INTENT(IN) :: refs(*)
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1176 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Set_handGivenMesh()

LIBMMG3D_EXPORT void MMG3D_Set_handGivenMesh ( MMG5_pMesh  mesh)

Finish providing mesh data without using the API functions.

Parameters
meshpointer to the mesh structure.

To mark as ended a mesh given without using the API functions (for example, mesh given by mesh->point[i] = 0 ...). This function performs verifications, e.g. to make sure that all tetrahedra are consistently oriented.

Remarks
Fortran interface:

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

Definition at line 1867 of file API_functions_3d.c.

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

◆ MMG3D_Set_inputMeshName()

LIBMMG3D_EXPORT int MMG3D_Set_inputMeshName ( MMG5_pMesh  mesh,
const char *  meshin 
)

Set the name of input mesh.

Parameters
meshpointer to the mesh structure.
meshininput mesh name.
Returns
1.
Remarks
Fortran interface:

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

Definition at line 65 of file API_functions_3d.c.

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

◆ MMG3D_Set_inputParamName()

LIBMMG3D_EXPORT int MMG3D_Set_inputParamName ( MMG5_pMesh  mesh,
const char *  fparamin 
)

Set the name of the input parameter file.

Parameters
meshpointer to the mesh structure.
fparaminname of the input parameter file.
Returns
1.
Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_INPUTPARAMNAME(mesh,fparamin,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh
CHARACTER(LEN=*), INTENT(IN) :: fparamin
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 74 of file API_functions_3d.c.

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

◆ MMG3D_Set_inputSolName()

LIBMMG3D_EXPORT int MMG3D_Set_inputSolName ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
const char *  solin 
)

Set the name of input solution file.

Parameters
meshpointer to the mesh structure.
solpointer to the sol structure.
solinname of the input solution file.
Returns
1.
Remarks
Fortran interface:

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

Definition at line 70 of file API_functions_3d.c.

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

◆ MMG3D_Set_iparameter()

LIBMMG3D_EXPORT int MMG3D_Set_iparameter ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
int  iparam,
MMG5_int  val 
)

set an integer parameter of the remesher

Parameters
meshpointer to the mesh structure.
solpointer to the sol structure (unused).
iparaminteger parameter to set (see MMG3D_Param for a list of parameters that can be set).
valvalue for the parameter.
Returns
0 if failed, 1 otherwise.

This function sets the integer parameter iparam to value val.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_IPARAMETER(mesh,sol,iparam,val,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
MMG5_DATA_PTR_T :: sol
INTEGER, INTENT(IN) :: iparam
INTEGER(MMG5F_INT), INTENT(IN) :: val
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 2113 of file API_functions_3d.c.

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

◆ MMG3D_Set_ithSol_inSolsAtVertices()

LIBMMG3D_EXPORT int MMG3D_Set_ithSol_inSolsAtVertices ( MMG5_pSol  sol,
int  i,
double *  s,
MMG5_int  pos 
)

Set a single element of one out of multiple solution fields that are defined on vertices.

Parameters
solpointer to the array of solutions
iposition of the solution field that we want to set.
ssolution(s) at mesh vertex pos.
posindex of the vertex on which we set the solution.
Returns
0 if failed, 1 otherwise.

Set values of the solution at the ith field of the solution array and at position pos (pos from 1 to nb_vertices included and i from 1 to nb_sols).

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_ITHSOL_INSOLSATVERTICES(sol,i,s,pos,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: sol
INTEGER, INTENT(IN) :: i
INTEGER(MMG5F_INT), INTENT(IN) :: pos
REAL(KIND=8), DIMENSION(*),INTENT(OUT) :: s
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1754 of file API_functions_3d.c.

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

◆ MMG3D_Set_ithSols_inSolsAtVertices()

LIBMMG3D_EXPORT int MMG3D_Set_ithSols_inSolsAtVertices ( MMG5_pSol  sol,
int  i,
double *  s 
)

Set all elements of one out of multiple solution fields that are defined on vertices.

Parameters
solpointer to the array of solutions
iposition of the solution field that we want to set.
sarray of the solutions at mesh vertices. The solution at vertex k is given by s[k-1] for a scalar sol, s[3*(k-1)]@3 for a vectorial solution and s[6*(k-1)]@6 for a tensor solution.
Returns
0 if failed, 1 otherwise.

Set values of the ith field of the solution array by array (i from 1 to nb_sols).

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_ITHSOLS_INSOLSATVERTICES(sol,i,s,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: sol
INTEGER, INTENT(IN) :: i
REAL(KIND=8), DIMENSION(*),INTENT(OUT) :: s
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1811 of file API_functions_3d.c.

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

◆ MMG3D_Set_localParameter()

LIBMMG3D_EXPORT int MMG3D_Set_localParameter ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
int  typ,
MMG5_int  ref,
double  hmin,
double  hmax,
double  hausd 
)

set a local parameter

Parameters
meshpointer to the mesh structure
solpointer to the sol structure
typtype of entity (triangle, edge,...)
refreference of the entity
hminminimal edge size
hmaxmaximal edge size
hausdHausdorff distance
Returns
0 if failed, 1 otherwise.

Set local parameters: set the Hausdorff distance, minimum edge length, and maximum edge length for all entities of type typ and reference ref.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_LOCALPARAMETER(mesh,sol,typ,ref,&
hmin,hmax,hausd,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh,sol
INTEGER, INTENT(IN) :: typ
INTEGER(MMG5F_INT), INTENT(IN):: ref
REAL(KIND=8), INTENT(IN) :: hmin,hmax,hausd
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 2444 of file API_functions_3d.c.

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

◆ MMG3D_Set_lsBaseReference()

LIBMMG3D_EXPORT int MMG3D_Set_lsBaseReference ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
MMG5_int  br 
)

Set a new level-set base reference.

Parameters
meshpointer to the mesh structure.
solpointer to 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 domains can be attached. All implicit volumes that are not attached to listed base references are deleted as spurious volumes by the rmc option.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_LSBASEREFERENCE(mesh,sol,br,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh,sol
INTEGER(MMG5F_INT) :: br
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 2537 of file API_functions_3d.c.

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

◆ MMG3D_Set_meshSize()

LIBMMG3D_EXPORT int MMG3D_Set_meshSize ( MMG5_pMesh  mesh,
MMG5_int  np,
MMG5_int  ne,
MMG5_int  nprism,
MMG5_int  nt,
MMG5_int  nquad,
MMG5_int  na 
)

Set the number of vertices, tetrahedra, prisms, triangles, quadrilaterals, and edges of a mesh.

Parameters
meshpointer to the mesh structure.
npnumber of vertices.
nenumber of tetrahedra.
nprismnumber of prisms.
ntnumber of triangles.
nquadnumber of quads.
nanumber of edges.
Returns
0 if failed, 1 otherwise.

This function sets the number of vertices, tetrahedra, prisms, triangles, quadrilaterals and edges of the mesh and allocates the associated arrays. If called again, it will reset the whole mesh to reallocate it at the new size

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_MESHSIZE(mesh,np,ne,nprism,nt,nquad,na,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT) :: np,ne,nprism,nt,nquad,na
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 264 of file API_functions_3d.c.

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

◆ MMG3D_Set_multiMat()

LIBMMG3D_EXPORT int MMG3D_Set_multiMat ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
MMG5_int  ref,
int  split,
MMG5_int  rmin,
MMG5_int  rplus 
)

Set the reference mapping for the elements of reference ref in level-set discretization mode.

Parameters
meshpointer to the mesh structure
solpointer to the sol structure
refinput tetrahedron reference
splitMMG5_MMAT_NoSplit if the entity must not be splitted, MMG5_MMAT_Split otherwise
rminreference for the negative side after LS discretization
rplusreference for the positive side after LS discretization
Returns
0 if failed, 1 otherwise.
Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_MULTIMAT(mesh,sol,ref,split,rmin,rplus,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh,sol
INTEGER, INTENT(IN) :: split
INTEGER(MMG5F_INT), INTENT(IN):: ref,rmin,rplus
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

With this function you can determine which references will be given to the tetrahedra on both sides of the level set, after discretization. Negative and positive here refer to volumes where the function is smaller or larger, respectively, than the isovalue of the level set.

Definition at line 2533 of file API_functions_3d.c.

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

◆ MMG3D_Set_normalAtVertex()

LIBMMG3D_EXPORT int MMG3D_Set_normalAtVertex ( MMG5_pMesh  mesh,
MMG5_int  k,
double  n0,
double  n1,
double  n2 
)

Set the normal orientation at a single vertex.

Parameters
meshpointer to the mesh structure.
kvertex index
n0x componant of the normal at vertex k.
n1y componant of the normal at vertex k.
n2z componant of the normal at vertex k.
Returns
1 if success.

Set normal (n0,n1,n2) at vertex k.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_NORMALATVERTEX(mesh,k,n0,n1,n2,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(IN):: k
REAL(KIND=8), INTENT(IN) :: n0,n1,n2
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1380 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Set_outputMeshName()

LIBMMG3D_EXPORT int MMG3D_Set_outputMeshName ( MMG5_pMesh  mesh,
const char *  meshout 
)

Set the name of output mesh file.

Parameters
meshpointer to the mesh structure.
meshoutname of the output mesh file.
Returns
1.
Remarks
Fortran interface:

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

Definition at line 78 of file API_functions_3d.c.

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

◆ MMG3D_Set_outputSolName()

LIBMMG3D_EXPORT int MMG3D_Set_outputSolName ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
const char *  solout 
)

Set the name of the output solution file.

Parameters
meshpointer to the mesh structure.
solpointer to the sol structure.
soloutname of the output solution file.
Returns
0 if failed, 1 otherwise.
Remarks
Fortran interface:

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

Definition at line 83 of file API_functions_3d.c.

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

◆ MMG3D_Set_parallelTriangle()

LIBMMG3D_EXPORT int MMG3D_Set_parallelTriangle ( MMG5_pMesh  mesh,
MMG5_int  k 
)

Assign the "parallel" attribute to a single triangle.

Parameters
meshpointer to the mesh structure.
ktriangle index.
Returns
1.

Set triangle k as parallel (triangle at the interface between two processors, ie, this triangle is required). (k from 1 to nb_tria included).

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_PARALLELTRIANGLE(mesh,k,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(IN):: k
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1318 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Set_parallelTriangles()

LIBMMG3D_EXPORT int MMG3D_Set_parallelTriangles ( MMG5_pMesh  mesh,
MMG5_int *  parIdx,
MMG5_int  npar 
)

Assign the "parallel" attribute to multiple triangles.

Parameters
meshpointer to the mesh structure
parIdxarray of indices of triangles
nparnumber of triangles
Returns
1.

Set the parallel triangles (triangles at the interface between processors, i.e. these triangles are required).

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_PARALLELTRIANGLES(mesh,parIdx,npar,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), DIMENSION(*),INTENT(IN) :: parIdx
INTEGER(MMG5F_INT), INTENT(IN) :: npar
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1334 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Set_prism()

LIBMMG3D_EXPORT int MMG3D_Set_prism ( MMG5_pMesh  mesh,
MMG5_int  v0,
MMG5_int  v1,
MMG5_int  v2,
MMG5_int  v3,
MMG5_int  v4,
MMG5_int  v5,
MMG5_int  ref,
MMG5_int  pos 
)

Set the vertices and reference of a single prism in a mesh.

Parameters
meshpointer to the mesh structure.
v0first vertex of prism.
v1second vertex of prism.
v2third vertex of prism.
v3fourth vertex of prism.
v4fifth vertex of prism.
v5sixth vertex of prism.
refprism reference.
posprism position in the mesh.
Returns
0 if failed, 1 otherwise.

This function sets the six vertices v0, v1,v2,v3,v4,v5 and reference ref for the prism at position pos in the mesh structure (from 1 to nb_prisms included).

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_PRISM(mesh,v0,v1,v2,v3,v4,v5,ref,pos,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(IN):: v0,v1,v2,v3,v4,v5,ref,pos
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 717 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Set_prisms()

LIBMMG3D_EXPORT int MMG3D_Set_prisms ( MMG5_pMesh  mesh,
MMG5_int *  prisms,
MMG5_int *  refs 
)

Set the vertices and references of all prisms in a mesh.

Parameters
meshpointer to the mesh structure.
prismsvertices of the prisms of the mesh Vertices of the \(i^{th}\) prism are stored in prism[(i-1)*6] to prism[(i-1)*6+5] included.
refsarray of the prisms references. The references of the \(i^{th}\) prism is stored in refs[i-1].
Returns
0 if failed, 1 otherwise.

This function sets the vertices and references of all prisms in a mesh.

Remarks
Fortran interface: (commentated in order to allow to pass %val(0) instead of the refs array)

‍! SUBROUTINE MMG3D_SET_PRISMS(mesh,prisms,refs,retval)
! MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
! INTEGER(MMG5F_INT), DIMENSION(*), INTENT(IN) :: prisms
! INTEGER(MMG5F_INT), DIMENSION(*), INTENT(IN) :: refs
! INTEGER, INTENT(OUT) :: retval
! END SUBROUTINE

Definition at line 803 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Set_quadrilateral()

LIBMMG3D_EXPORT int MMG3D_Set_quadrilateral ( MMG5_pMesh  mesh,
MMG5_int  v0,
MMG5_int  v1,
MMG5_int  v2,
MMG5_int  v3,
MMG5_int  ref,
MMG5_int  pos 
)

Set the vertices and reference of a single quadrilateral in a mesh.

Parameters
meshpointer to the mesh structure.
v0first vertex of quadrilateral.
v1second vertex of quadrilateral.
v2third vertex of quadrilateral.
v3fourth vertex of quadrilateral.
refquadrilateral reference.
posquadrilateral position in the mesh.
Returns
0 if failed, 1 otherwise.

Set a quadrilateral of vertices v0, v1, v2, v3 and reference ref at position pos in mesh structure (from 1 to nb_quadrangles included).

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_QUADRILATERAL(mesh,v0,v1,v2,v3,ref,pos,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(IN):: v0,v1,v2,v3,ref,pos
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 981 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Set_quadrilaterals()

LIBMMG3D_EXPORT int MMG3D_Set_quadrilaterals ( MMG5_pMesh  mesh,
MMG5_int *  quads,
MMG5_int *  refs 
)

Set the vertices and references of all quadrilaterals in a mesh.

Parameters
meshpointer to the mesh structure.
quadspointer to the array of the quads vertices Vertices of the \(i^{th}\) quadra are stored in quads[(i-1)*3]@3.
refspointer to the array of the quadrilateral references. refs[i-1] is the ref of the \(i^{th}\) quadra.
Returns
0 if failed, 1 otherwise.
Remarks
Fortran interface: (commentated in order to allow to pass %val(0) instead of the refs array)

‍! SUBROUTINE MMG3D_SET_QUADRILATERALS(mesh,quads,refs,retval)
! MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
! INTEGER(MMG5F_INT),DIMENSION(*), INTENT(IN) :: quads
! INTEGER(MMG5F_INT),DIMENSION(*), INTENT(IN) :: refs
! INTEGER, INTENT(OUT) :: retval
! END SUBROUTINE

Definition at line 1054 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Set_requiredEdge()

LIBMMG3D_EXPORT int MMG3D_Set_requiredEdge ( MMG5_pMesh  mesh,
MMG5_int  k 
)

Assign the "required" attribute to a single edge.

Parameters
meshpointer to the mesh structure.
kedge index.
Returns
1.

Set edge k as required.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_REQUIREDEDGE(mesh,k,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(IN):: k
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1368 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Set_requiredTetrahedra()

LIBMMG3D_EXPORT int MMG3D_Set_requiredTetrahedra ( MMG5_pMesh  mesh,
MMG5_int *  reqIdx,
MMG5_int  nreq 
)

Assign the "required" attribute to multiple tetrahedra.

Parameters
meshpointer to the mesh structure.
reqIdxarray of the indices of the required elements.
nreqnumber of required elements
Returns
1.

Determine which tetrahedra have the "required" attribute.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_REQUIREDTETRAHEDRA(mesh,reqIdx,nreq,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), DIMENSION(*),INTENT(IN) :: reqIdx
INTEGER(MMG5F_INT), INTENT(IN) :: nreq
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1260 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Set_requiredTetrahedron()

LIBMMG3D_EXPORT int MMG3D_Set_requiredTetrahedron ( MMG5_pMesh  mesh,
MMG5_int  k 
)

Assign the "required" attribute to a tetrahedron.

Parameters
meshpointer to the mesh structure.
kelement index.
Returns
1.

Set element k as required (k from 1 to nb_tetra included).

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_REQUIREDTETRAHEDRON(mesh,k,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(IN):: k
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1248 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Set_requiredTriangle()

LIBMMG3D_EXPORT int MMG3D_Set_requiredTriangle ( MMG5_pMesh  mesh,
MMG5_int  k 
)

Assign the "required" attribute to a single triangle.

Parameters
meshpointer to the mesh structure.
ktriangle index.
Returns
1.

Set triangle k as required (k from 1 to nb_tria included).

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_REQUIREDTRIANGLE(mesh,k,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(IN):: k
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1280 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Set_requiredTriangles()

LIBMMG3D_EXPORT int MMG3D_Set_requiredTriangles ( MMG5_pMesh  mesh,
MMG5_int *  reqIdx,
MMG5_int  nreq 
)

Assign the "required" attribute to multiple triangles.

Parameters
meshpointer to the mesh structure.
reqIdxarray of the indices of the required triangles.
nreqnumber of required triangles
Returns
1.
Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_REQUIREDTRIANGLES(mesh,reqIdx,nreq,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), DIMENSION(*),INTENT(IN) :: reqIdx
INTEGER(MMG5F_INT), INTENT(IN) :: nreq
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1296 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Set_requiredVertex()

LIBMMG3D_EXPORT int MMG3D_Set_requiredVertex ( MMG5_pMesh  mesh,
MMG5_int  k 
)

Assign the "required" attribute to a vertex.

Parameters
meshpointer to the mesh structure.
kvertex index.
Returns
1.

Set vertex k as required (k from 1 to nb_vertices included). This prevents the remesher from moving the vertex.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_REQUIREDVERTEX(mesh,k,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(IN):: k
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1235 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Set_ridge()

LIBMMG3D_EXPORT int MMG3D_Set_ridge ( MMG5_pMesh  mesh,
MMG5_int  k 
)

Assign the "ridge" attribute to a single edge.

Parameters
meshpointer to the mesh structure.
kedge index.
Returns
1.

Set the "ridge" attribute at edge k. This affects how the remesher treats the edge and the adjacent triangles or tetrahedra.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_RIDGE(mesh,k,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(IN):: k
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1356 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Set_scalarSol()

LIBMMG3D_EXPORT int MMG3D_Set_scalarSol ( MMG5_pSol  met,
double  s,
MMG5_int  pos 
)

Set a single element of a scalar solution structure.

Parameters
metpointer to the sol structure.
ssolution scalar value.
posposition of the solution in the mesh.
Returns
0 if failed, 1 otherwise.

Set scalar value s at position pos in solution structure (pos from 1 to nb_vertices included).

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_SCALARSOL(met,s,pos,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: met
REAL(KIND=8), INTENT(IN) :: s
INTEGER(MMG5F_INT), INTENT(IN):: pos
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1434 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Set_scalarSols()

LIBMMG3D_EXPORT int MMG3D_Set_scalarSols ( MMG5_pSol  met,
double *  s 
)

Set the values of all elements of a scalar solution structure.

Parameters
metpointer to the sol structure.
sarray of the scalar solutions values. s[i-1] is the solution at vertex i.
Returns
0 if failed, 1 otherwise.

Set scalar solutions at mesh vertices.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_SCALARSOLS(met,s,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: met
REAL(KIND=8),DIMENSION(*), INTENT(IN) :: s
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1498 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Set_solsAtVerticesSize()

LIBMMG3D_EXPORT int MMG3D_Set_solsAtVerticesSize ( MMG5_pMesh  mesh,
MMG5_pSol sol,
int  nsols,
MMG5_int  nentities,
int *  typSol 
)

Initialize an array of solution values defined at vertices.

Parameters
meshpointer to the mesh structure.
solpointer to an allocatable sol structure.
nsolsnumber of solutions per entity
nentitiesnumber of vertices
typSolArray of size nsols listing the type of the solutions (scalar, vectorial, ..., see MMG5_type for possible values).
Returns
0 if failed, 1 otherwise.

Initialize a solution field defined at vertices: set dimension, types and number of data values. (not used by Mmg itself).

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_SOLSATVERTICESSIZE(mesh,sol,nsols,nentities,typSol,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh,sol
INTEGER, INTENT(IN) :: nsols
INTEGER(MMG5F_INT), INTENT(IN):: nentities
INTEGER, INTENT(IN) :: typSol(*)
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Sol tab allocation

Definition at line 161 of file API_functions_3d.c.

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

◆ MMG3D_Set_solSize()

LIBMMG3D_EXPORT int MMG3D_Set_solSize ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
int  typEntity,
MMG5_int  np,
int  typSol 
)

Initialize a solution field.

Parameters
meshpointer to the mesh structure.
solpointer to the sol structure.
typEntitytype of entities on which the solution is defined (vertices, triangles, ...). See MMG5_entities for the defined entity types. Currently only MMG5_Vertex is supported.
npnumber of solutions.
typSoltype of solution (scalar, vectorial, ..., see MMG5_type for possible values).
Returns
0 if failed, 1 otherwise.

Initialize a solution field: set dimension, types and number of data. To use to initialize a metric, a level-set or a displacement field.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_SOLSIZE(mesh,sol,typEntity,np,typSol,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh,sol
INTEGER(MMG5F_INT), INTENT(IN):: np
INTEGER, INTENT(IN) :: typEntity,typSol
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 116 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Set_tensorSol()

LIBMMG3D_EXPORT int MMG3D_Set_tensorSol ( MMG5_pSol  met,
double  m11,
double  m12,
double  m13,
double  m22,
double  m23,
double  m33,
MMG5_int  pos 
)

Set a single element of a tensor solution structure.

Parameters
metpointer to the sol structure.
m11value of the tensorial solution at position (1,1) in the tensor
m12value of the tensorial solution at position (1,2) in the tensor
m13value of the tensorial solution at position (1,3) in the tensor
m22value of the tensorial solution at position (2,2) in the tensor
m23value of the tensorial solution at position (2,3) in the tensor
m33value of the tensorial solution at position (3,3) in the tensor
posposition of the solution in the mesh (begin to 1).
Returns
0 if failed, 1 otherwise.

Set tensorial values at position pos in solution structure. (pos from 1 to nb_vertices included).

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_TENSORSOL(met,m11,m12,m13,m22,m23,m33,pos,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: met
REAL(KIND=8), INTENT(IN) :: m11,m12,m13,m22,m23,m33
INTEGER(MMG5F_INT), INTENT(IN):: pos
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1631 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Set_tensorSols()

LIBMMG3D_EXPORT int MMG3D_Set_tensorSols ( MMG5_pSol  met,
double *  sols 
)

Set all elements of a tensor solution structure.

Parameters
metpointer to the sol structure.
solsarray of the tensorial solutions. sols[6*(i-1)]@6 is the solution at vertex i
Returns
0 if failed, 1 otherwise.

Set tensorial values by array.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_TENSORSOLS(met,sols,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: met
REAL(KIND=8),DIMENSION(*), INTENT(IN) :: sols
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1709 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Set_tetrahedra()

LIBMMG3D_EXPORT int MMG3D_Set_tetrahedra ( MMG5_pMesh  mesh,
MMG5_int *  tetra,
MMG5_int *  refs 
)

Set the vertices and references of all tetrahedra in a mesh structure.

Parameters
meshpointer to the mesh structure.
tetravertices of the tetras of the mesh given. The vertices of the \(i^{th}\) tetrahedron are given by tetra[(i-1)*4] to tetra[(i-1)*4+3] included.
refsarray of the tetrahedra references. The references of the \(i^{th}\) tetrahedron is given by refs[i-1].
Returns
0 if failed, 1 otherwise.

This function sets the vertices and references of all tetrahedra in a mesh.

Remarks
Fortran interface: (commentated in order to allow to pass %val(0) instead of the refs array)

‍! SUBROUTINE MMG3D_SET_TETRAHEDRA(mesh,tetra,refs,retval)
! MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
! INTEGER(MMG5F_INT), DIMENSION(*), INTENT(IN) :: tetra
! INTEGER(MMG5F_INT), DIMENSION(*), INTENT(IN) :: refs
! INTEGER, INTENT(OUT) :: retval
! END SUBROUTINE

Definition at line 635 of file API_functions_3d.c.

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

◆ MMG3D_Set_tetrahedron()

LIBMMG3D_EXPORT int MMG3D_Set_tetrahedron ( MMG5_pMesh  mesh,
MMG5_int  v0,
MMG5_int  v1,
MMG5_int  v2,
MMG5_int  v3,
MMG5_int  ref,
MMG5_int  pos 
)

set a single tetrahedron's vertices

Parameters
meshpointer to the mesh structure.
v0first vertex of tetrahedron.
v1second vertex of tetrahedron.
v2third vertex of tetrahedron.
v3fourth vertex of tetrahedron.
reftetrahedron reference.
postetrahedron position in the mesh.
Returns
0 if failed, 1 otherwise.

Assign the vertices v0, v1,v2,v3 and reference ref to the tetrahedron at position pos in the mesh structure. pos ranges from 1 to nb_tetra included.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_TETRAHEDRON(mesh,v0,v1,v2,v3,ref,pos,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(IN):: v0,v1,v2,v3,pos
INTEGER(MMG5F_INT), INTENT(IN):: ref
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 521 of file API_functions_3d.c.

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

◆ MMG3D_Set_triangle()

LIBMMG3D_EXPORT int MMG3D_Set_triangle ( MMG5_pMesh  mesh,
MMG5_int  v0,
MMG5_int  v1,
MMG5_int  v2,
MMG5_int  ref,
MMG5_int  pos 
)

Set the vertices and reference of a single triangle in a mesh.

Parameters
meshpointer to the mesh structure.
v0first vertex of triangle.
v1second vertex of triangle.
v2third vertex of triangle.
reftriangle reference.
postriangle position in the mesh.
Returns
0 if failed, 1 otherwise.

This function defines a triangle of vertices v0, v1, v2 and reference ref at position pos in mesh structure (from 1 to nb_triangle included).

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_TRIANGLE(mesh,v0,v1,v2,ref,pos,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(IN) :: v0,v1,v2,ref,pos
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 862 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Set_triangles()

LIBMMG3D_EXPORT int MMG3D_Set_triangles ( MMG5_pMesh  mesh,
MMG5_int *  tria,
MMG5_int *  refs 
)

Set the vertices and references of all triangles in a mesh.

Parameters
meshpointer to the mesh structure.
triapointer to the array of the tria vertices Vertices of the \(i^{th}\) tria are stored in tria[(i-1)*3]@3.
refspointer to the array of the triangle references. refs[i-1] is the ref of the \(i^{th}\) tria.
Returns
0 if failed, 1 otherwise.

This function sets the vertices and references of all triangles in a mesh.

Remarks
Fortran interface: (commentated in order to allow to pass %val(0) instead of the refs array)

‍! SUBROUTINE MMG3D_SET_TRIANGLES(mesh,tria,refs,retval)
! MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
! INTEGER(MMG5F_INT),DIMENSION(*), INTENT(IN) :: tria
! INTEGER(MMG5F_INT),DIMENSION(*), INTENT(IN) :: refs
! INTEGER, INTENT(OUT) :: retval
! END SUBROUTINE

Definition at line 938 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Set_vectorSol()

LIBMMG3D_EXPORT int MMG3D_Set_vectorSol ( MMG5_pSol  met,
double  vx,
double  vy,
double  vz,
MMG5_int  pos 
)

Set a single element of a vector solution structure.

Parameters
metpointer to the sol structure.
vxx value of the vectorial solution.
vyy value of the vectorial solution.
vzz value of the vectorial solution.
posposition of the solution in the mesh (begin to 1).
Returns
0 if failed, 1 otherwise.

Set vectorial value \((v_x,v_y,v_z)\) at position pos in solution structure. (pos from 1 to nb_vertices included).

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_VECTORSOL(met,vx,vy,vz,pos,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: met
REAL(KIND=8), INTENT(IN) :: vx,vy,vz
INTEGER(MMG5F_INT), INTENT(IN):: pos
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1524 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Set_vectorSols()

LIBMMG3D_EXPORT int MMG3D_Set_vectorSols ( MMG5_pSol  met,
double *  sols 
)

Set all elements of a vector solution structure.

Parameters
metpointer to the sol structure.
solsarray of the vectorial solutions sols[3*(i-1)]@3 is the solution at vertex i
Returns
0 if failed, 1 otherwise.

Set vectorial solutions at mesh vertices

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_VECTORSOLS(met,sols,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: met
REAL(KIND=8),DIMENSION(*), INTENT(IN) :: sols
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1593 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Set_vertex()

LIBMMG3D_EXPORT int MMG3D_Set_vertex ( MMG5_pMesh  mesh,
double  c0,
double  c1,
double  c2,
MMG5_int  ref,
MMG5_int  pos 
)

Set the coordinates of a single vertex.

Parameters
meshpointer to the mesh structure.
c0coordinate of the vertex along the first dimension.
c1coordinate of the vertex along the second dimension.
c2coordinate of the vertex along the third dimension.
refvertex reference.
posposition of the vertex in the mesh.
Returns
1.

This function sets the coordinates of a vertex c0, c1,c2 and reference ref at position pos in mesh structure (from 1 to nb_vertices included).

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_SET_VERTEX(mesh,c0,c1,c2,ref,pos,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
REAL(KIND=8), INTENT(IN) :: c0,c1,c2
INTEGER(MMG5F_INT), INTENT(IN):: ref,pos
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 362 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Set_vertices()

LIBMMG3D_EXPORT int MMG3D_Set_vertices ( MMG5_pMesh  mesh,
double *  vertices,
MMG5_int *  refs 
)

Set all vertex coordinates and references in a mesh structure.

Parameters
meshpointer to the mesh structure.
verticesarray of vertex coordinates in the order \([x_1, y_1, z_1, x_2, \ldots, z_N]\) where \(N\) is the number of vertices in the mesh.
refsarray of vertex references. The reference of vertex \(i\) is stored in refs[ \(i-1\)].
Returns
1.

This function sets the coordinates and references of all vertices in a mesh structure. The number of vertices in the mesh must have been set before.

Remarks
Fortran interface: (commentated in order to allow to pass %val(0) instead of the refs array)

‍! SUBROUTINE MMG3D_SET_VERTICES(mesh,vertices,refs,retval)
! MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
! REAL(KIND=8), INTENT(IN) :: vertices(*)
! INTEGER(MMG5F_INT),INTENT(IN) :: refs(*)
! INTEGER, INTENT(OUT) :: retval
! END SUBROUTINE

Definition at line 458 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_setfunc()

LIBMMG3D_EXPORT void MMG3D_setfunc ( MMG5_pMesh  mesh,
MMG5_pSol  met 
)

Set function pointers for caltet, lenedg, lenedgCoor defsiz, gradsiz... depending if the metric that was read is anisotropic or isotropic.

To associate function pointers without calling MMG3D_mmg3dlib

Parameters
meshpointer to the mesh structure (unused).
metpointer to the sol structure (unused).
Remarks
Fortran interface:

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

Definition at line 48 of file libmmg3d_tools.c.

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

◆ MMG3D_stockOptions()

LIBMMG3D_EXPORT int MMG3D_stockOptions ( MMG5_pMesh  mesh,
MMG5_Info info 
)

Store the info structure in the mesh structure.

Parameters
meshpointer to the mesh structure.
infopointer to the info structure.
Returns
1.
Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_STOCKOPTIONS(mesh,info,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,info
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1177 of file libmmg3d_tools.c.

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

◆ MMG3D_switch_metricStorage()

LIBMMG3D_EXPORT int MMG3D_switch_metricStorage ( MMG5_pMesh  mesh,
MMG5_pSol  met 
)

Swap the m22 and m23 values of the metric.

Parameters
meshpointer to the mesh structure
metpointer to the sol structure
Returns
1 if success

Switch the m22 and m23 value of the metric to allow to pass from the API storage to the medit storage.

Remarks
Fortran interface:

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

Definition at line 1727 of file libmmg3d_tools.c.

Here is the caller graph for this function:

◆ MMG3D_Unset_corner()

LIBMMG3D_EXPORT int MMG3D_Unset_corner ( MMG5_pMesh  mesh,
MMG5_int  k 
)

Remove the "corner" attribute from a vertex.

Parameters
meshpointer to the mesh structure.
kvertex index.
Returns
1.

Remove corner attribute from vertex k (from 1 to the number of vertices included).

Remarks
Fortran interface

‍ SUBROUTINE MMG3D_UNSET_CORNER(mesh,k,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(IN):: k
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1229 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Unset_parallelTriangle()

LIBMMG3D_EXPORT int MMG3D_Unset_parallelTriangle ( MMG5_pMesh  mesh,
MMG5_int  k 
)

Remove the "parallel" attribute from a single triangle.

Parameters
meshpointer to the mesh structure.
ktriangle index.
Returns
1.

Remove parallel attribute from triangle k (i.e. triangles aren't preserved anymore). (k from 1 to nb_tria included).

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_UNSET_PARALLELTRIANGLE(mesh,k,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(IN):: k
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1326 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Unset_parallelTriangles()

LIBMMG3D_EXPORT int MMG3D_Unset_parallelTriangles ( MMG5_pMesh  mesh,
MMG5_int *  parIdx,
MMG5_int  npar 
)

Remove the "parallel" attribute from multiple triangles.

Parameters
meshpointer to the mesh structure.
parIdxarray of the indices of triangles
nparnumber of triangles
Returns
1.

Remove parallel attributes from triangles (i.e. triangles aren't preserved anymore).

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_UNSET_PARALLELTRIANGLES(mesh,parIdx,npar,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), DIMENSION(*),INTENT(IN) :: parIdx
INTEGER(MMG5F_INT), INTENT(IN) :: npar
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1345 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Unset_requiredEdge()

LIBMMG3D_EXPORT int MMG3D_Unset_requiredEdge ( MMG5_pMesh  mesh,
MMG5_int  k 
)

Remove the "required" attribute from a single edge.

Parameters
meshpointer to the mesh structure.
kedge index.
Returns
1.

Remove required attribute from edge k.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_UNSET_REQUIREDEDGE(mesh,k,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(IN):: k
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1374 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Unset_requiredTetrahedra()

LIBMMG3D_EXPORT int MMG3D_Unset_requiredTetrahedra ( MMG5_pMesh  mesh,
MMG5_int *  reqIdx,
MMG5_int  nreq 
)

Remove the "required" attribute from multiple tetrahedra.

Parameters
meshpointer to the mesh structure.
reqIdxarray of the indices of the required elements.
nreqnumber of required elements
Returns
1.

Remove required attribute from a list of Tetra whose indices are contained in array reqIdx.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_UNSET_REQUIREDTETRAHEDRA(mesh,reqIdx,nreq,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), DIMENSION(*),INTENT(IN) :: reqIdx
INTEGER(MMG5F_INT), INTENT(IN) :: nreq
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1270 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Unset_requiredTetrahedron()

LIBMMG3D_EXPORT int MMG3D_Unset_requiredTetrahedron ( MMG5_pMesh  mesh,
MMG5_int  k 
)

Remove the "required" attribute from a tetrahedron.

Parameters
meshpointer to the mesh structure.
kelement index.
Returns
1.

Remove required attribute from element k (k from 1 to nb_tetra included).

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_UNSET_REQUIREDTETRAHEDRON(mesh,k,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(IN):: k
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1254 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Unset_requiredTriangle()

LIBMMG3D_EXPORT int MMG3D_Unset_requiredTriangle ( MMG5_pMesh  mesh,
MMG5_int  k 
)

Remove the "required" attribute from a single triangle.

Parameters
meshpointer to the mesh structure.
ktriangle index.
Returns
1.

Remove required attribute from triangle k.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_UNSET_REQUIREDTRIANGLE(mesh,k,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(IN):: k
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1288 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Unset_requiredTriangles()

LIBMMG3D_EXPORT int MMG3D_Unset_requiredTriangles ( MMG5_pMesh  mesh,
MMG5_int *  reqIdx,
MMG5_int  nreq 
)

Remove the "required" attribute from multiple triangles.

Parameters
meshpointer to the mesh structure.
reqIdxarray of the indices of the required trias.
nreqnumber of required trias
Returns
1.
Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_UNSET_REQUIREDTRIANGLES(mesh,reqIdx,nreq,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), DIMENSION(*),INTENT(IN) :: reqIdx
INTEGER(MMG5F_INT), INTENT(IN) :: nreq
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1307 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Unset_requiredVertex()

LIBMMG3D_EXPORT int MMG3D_Unset_requiredVertex ( MMG5_pMesh  mesh,
MMG5_int  k 
)

Remove required attribute from a vertex.

Parameters
meshpointer to the mesh structure.
kvertex index.
Returns
1.

This function removes the required attribute from vertex k.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_UNSET_REQUIREDVERTEX(mesh,k,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(IN):: k
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1242 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_Unset_ridge()

LIBMMG3D_EXPORT int MMG3D_Unset_ridge ( MMG5_pMesh  mesh,
MMG5_int  k 
)

Remove the "ridge" attribute from a single edge.

Parameters
meshpointer to the mesh structure.
kedge index.
Returns
1.

Remove ridge attribute at edge k.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_UNSET_RIDGE(mesh,k,retval)
MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh
INTEGER(MMG5F_INT), INTENT(IN):: k
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 1362 of file API_functions_3d.c.

Here is the caller graph for this function:

◆ MMG3D_usage()

LIBMMG3D_EXPORT int MMG3D_usage ( char *  prog)

Print help for mmg3d options.

Parameters
progpointer to the program name.
return1 if success, 0 if fail.
Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_USAGE(prog,strlen0,retval)
CHARACTER(LEN=*), INTENT(IN) :: prog
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 165 of file libmmg3d_tools.c.

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

Variable Documentation

◆ MMG3D_doSol

LIBMMG3D_EXPORT int(* MMG3D_doSol) (MMG5_pMesh mesh, MMG5_pSol met) ( MMG5_pMesh  mesh,
MMG5_pSol  met 
)
extern

Compute isotropic size map according to the mean of the length of the edges passing through a vertex.

Parameters
meshpointer to the mesh structure
metpointer to the sol structure
Returns
1 if success
Remarks
Fortran interface:

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

Definition at line 11 of file mmg3dexterns.c.

◆ MMG3D_lenedgCoor

LIBMMG3D_EXPORT double(* MMG3D_lenedgCoor) (double *ca, double *cb, double *sa, double *sb) ( double *  ca,
double *  cb,
double *  sa,
double *  sb 
)
extern

Compute the length of an edge according to the size prescription.

Parameters
capointer to the coordinates of the first edge's extremity.
cbpointer to the coordinates of the second edge's extremity.
mapointer to the metric associated to the first edge's extremity.
mbpointer to the metric associated to the second edge's extremity.
Returns
edge length.

Compute the length of edge \([ca,cb]\) (with ca and cb coordinates of edge endpoints) according to the size prescription.

Remarks
Fortran interface:

‍ SUBROUTINE MMG3D_LENEDGCOOR(ca,cb,sa,sb,retval)
REAL(KIND=8), INTENT(IN) :: ca,cb,sa,sb
REAL(KIND=8), INTENT(OUT) :: retval
END SUBROUTINE

Definition at line 10 of file mmg3dexterns.c.