Mmg
Simplicial remeshers (mesh adaptation, isovalue discretization, lagrangian movement)
libmmg3d.h
Go to the documentation of this file.
1/* ===========================================================================
2** This file is part of the mmg software package for the tetrahedral
3** mesh modification.
4** Copyright (c) Bx INP/CNRS/Inria/UBordeaux/UPMC, 2004-
5**
6** mmg is free software: you can redistribute it and/or modify it
7** under the terms of the GNU Lesser General Public License as published
8** by the Free Software Foundation, either version 3 of the License, or
9** (at your option) any later version.
10**
11** mmg is distributed in the hope that it will be useful, but WITHOUT
12** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13** FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14** License for more details.
15**
16** You should have received a copy of the GNU Lesser General Public
17** License and of the GNU General Public License along with mmg (in
18** files COPYING.LESSER and COPYING). If not, see
19** <http://www.gnu.org/licenses/>. Please read their terms carefully and
20** use this copy of the mmg distribution only if you accept them.
21** ===========================================================================
22*/
23
24/*
25 * This file defines the C and Fortran headers of the mmg3d API, and
26 * their Doxygen documentation.
27 *
28 * NOTES FOR DEVELOPERS:
29 *
30 * - The Fortran headers are generated from comment lines that start with '* >'.
31 * They must match the C declarations.
32 *
33 * - We cannot handle enum types in the Fortran version so enums are replaced
34 * by ints in both versions.
35 *
36 * - To keep the genheader program working, don't break line between an enum
37 * name and the opening brace (it creates errors under windows)
38 *
39 * - Since Mmg version 5,
40 * -- data structures and parameters that are common between mmg3d, mmg2d
41 * and mmgs use the MMG5_ prefix;
42 * -- API functions should have an MMG3D_, MMG2D_, or MMGS_ prefix,
43 * depending on the library; and
44 * -- some MMG5_ API functions exists but they are common to the
45 * three libraries.
46 *
47 */
48
117#ifndef MMG3DLIB_H
118#define MMG3DLIB_H
119
120#ifdef __cplusplus
121extern "C" {
122#endif
123
124#include "mmg/common/libmmgtypes.h"
125#include "mmg/mmg3d/mmg3d_export.h"
126
130#define MMG3D_LMAX 10240
131
181};
182
183/*--------------------------- function headers ---------------------------*/
184/* Initialization functions */
185/* init structures */
224 LIBMMG3D_EXPORT int MMG3D_Init_mesh(const int starter,...);
225
241
256
257/* init file names */
275
293
312 const char* solin);
313
332 const char* solout);
333
351
352
353/* init structure sizes */
379 MMG5_int np, int typSol);
380
405 MMG5_int nentities, int *typSol);
406
431 LIBMMG3D_EXPORT int MMG3D_Set_meshSize(MMG5_pMesh mesh,MMG5_int np,MMG5_int ne,MMG5_int nprism,
432 MMG5_int nt,MMG5_int nquad,MMG5_int na);
433
434/* init structure data */
457 LIBMMG3D_EXPORT int MMG3D_Set_vertex(MMG5_pMesh mesh, double c0, double c1,
458 double c2, MMG5_int ref,MMG5_int pos);
459
484 LIBMMG3D_EXPORT int MMG3D_Set_vertices(MMG5_pMesh mesh, double *vertices,MMG5_int *refs);
485
511 LIBMMG3D_EXPORT int MMG3D_Set_tetrahedron(MMG5_pMesh mesh, MMG5_int v0, MMG5_int v1,
512 MMG5_int v2, MMG5_int v3, MMG5_int ref, MMG5_int pos);
513
539 MMG5_int *refs);
540
566 LIBMMG3D_EXPORT int MMG3D_Set_prism(MMG5_pMesh mesh, MMG5_int v0, MMG5_int v1,
567 MMG5_int v2, MMG5_int v3, MMG5_int v4, MMG5_int v5, MMG5_int ref, MMG5_int pos);
568
593 LIBMMG3D_EXPORT int MMG3D_Set_prisms(MMG5_pMesh mesh, MMG5_int *prisms,
594 MMG5_int *refs);
595
618 LIBMMG3D_EXPORT int MMG3D_Set_triangle(MMG5_pMesh mesh, MMG5_int v0, MMG5_int v1,
619 MMG5_int v2, MMG5_int ref,MMG5_int pos);
620
644 LIBMMG3D_EXPORT int MMG3D_Set_triangles(MMG5_pMesh mesh, MMG5_int *tria, MMG5_int *refs);
645
669 LIBMMG3D_EXPORT int MMG3D_Set_quadrilateral(MMG5_pMesh mesh, MMG5_int v0, MMG5_int v1,
670 MMG5_int v2, MMG5_int v3, MMG5_int ref,MMG5_int pos);
671
693 LIBMMG3D_EXPORT int MMG3D_Set_quadrilaterals(MMG5_pMesh mesh, MMG5_int *quads, MMG5_int *refs);
694
716 LIBMMG3D_EXPORT int MMG3D_Set_edge(MMG5_pMesh mesh, MMG5_int v0, MMG5_int v1, MMG5_int ref,MMG5_int pos);
717
737
757
777
796
815
835
855 LIBMMG3D_EXPORT int MMG3D_Set_requiredTetrahedra(MMG5_pMesh mesh, MMG5_int *reqIdx, MMG5_int nreq);
856
877 LIBMMG3D_EXPORT int MMG3D_Unset_requiredTetrahedra(MMG5_pMesh mesh, MMG5_int *reqIdx, MMG5_int nreq);
878
897
916
934 LIBMMG3D_EXPORT int MMG3D_Set_requiredTriangles(MMG5_pMesh mesh, MMG5_int *reqIdx, MMG5_int nreq);
935
953 LIBMMG3D_EXPORT int MMG3D_Unset_requiredTriangles(MMG5_pMesh mesh, MMG5_int *reqIdx, MMG5_int nreq);
954
974
994
1015 LIBMMG3D_EXPORT int MMG3D_Set_parallelTriangles(MMG5_pMesh mesh, MMG5_int *parIdx, MMG5_int npar);
1016
1037 LIBMMG3D_EXPORT int MMG3D_Unset_parallelTriangles(MMG5_pMesh mesh, MMG5_int *parIdx, MMG5_int npar);
1038
1058
1077
1096
1115
1138 LIBMMG3D_EXPORT int MMG3D_Set_normalAtVertex(MMG5_pMesh mesh, MMG5_int k, double n0, double n1,
1139 double n2) ;
1140
1161 LIBMMG3D_EXPORT int MMG3D_Set_scalarSol(MMG5_pSol met, double s,MMG5_int pos);
1162
1182
1205 LIBMMG3D_EXPORT int MMG3D_Set_vectorSol(MMG5_pSol met, double vx,double vy, double vz,
1206 MMG5_int pos);
1207
1226 LIBMMG3D_EXPORT int MMG3D_Set_vectorSols(MMG5_pSol met, double *sols);
1227
1253 LIBMMG3D_EXPORT int MMG3D_Set_tensorSol(MMG5_pSol met, double m11,double m12, double m13,
1254 double m22,double m23, double m33, MMG5_int pos);
1255
1274 LIBMMG3D_EXPORT int MMG3D_Set_tensorSols(MMG5_pSol met, double *sols);
1275
1300 LIBMMG3D_EXPORT int MMG3D_Set_ithSol_inSolsAtVertices(MMG5_pSol sol,int i, double* s,MMG5_int pos);
1301
1326
1343
1344/* check init */
1363
1364/* functions to set parameters
1365 *
1366 * NOTE iparam and dparam are int rather than enum MMG3D_Param because
1367 * genheader cannot handle enums in function arguments; i.e. the Fortran
1368 * API will break.
1369 */
1370
1394 MMG5_int val);
1395
1419 double val);
1447 MMG5_int ref,double hmin,double hmax,double hausd);
1448
1474 LIBMMG3D_EXPORT int MMG3D_Set_multiMat(MMG5_pMesh mesh, MMG5_pSol sol,MMG5_int ref,int split,
1475 MMG5_int rmin, MMG5_int rplus);
1476
1499
1500
1523 LIBMMG3D_EXPORT int MMG3D_Get_meshSize(MMG5_pMesh mesh, MMG5_int* np, MMG5_int* ne,MMG5_int *nprism, MMG5_int* nt,
1524 MMG5_int* nquad, MMG5_int* na);
1525
1548 MMG5_int* np,int* typSol);
1549
1573 MMG5_int* nentities,int* typSol);
1574
1608 LIBMMG3D_EXPORT int MMG3D_Get_vertex(MMG5_pMesh mesh, double* c0, double* c1, double* c2,
1609 MMG5_int* ref,int* isCorner, int* isRequired);
1610
1637 LIBMMG3D_EXPORT int MMG3D_GetByIdx_vertex(MMG5_pMesh mesh, double* c0, double* c1, double* c2, MMG5_int* ref,
1638 int* isCorner, int* isRequired,MMG5_int idx);
1639
1669 LIBMMG3D_EXPORT int MMG3D_Get_vertices(MMG5_pMesh mesh, double* vertices, MMG5_int* refs,
1670 int* areCorners, int* areRequired);
1671
1701 LIBMMG3D_EXPORT int MMG3D_Get_tetrahedron(MMG5_pMesh mesh, MMG5_int* v0, MMG5_int* v1, MMG5_int* v2,
1702 MMG5_int* v3,MMG5_int* ref, int* isRequired);
1703
1730 LIBMMG3D_EXPORT int MMG3D_Get_tetrahedra(MMG5_pMesh mesh, MMG5_int* tetra,MMG5_int* refs,
1731 int* areRequired);
1732
1764 LIBMMG3D_EXPORT int MMG3D_Get_prism(MMG5_pMesh mesh, MMG5_int* v0, MMG5_int* v1, MMG5_int* v2,
1765 MMG5_int* v3,MMG5_int* v4,MMG5_int* v5,MMG5_int* ref, int* isRequired);
1766
1793 LIBMMG3D_EXPORT int MMG3D_Get_prisms(MMG5_pMesh mesh, MMG5_int* prisms,MMG5_int* refs,
1794 int* areRequired);
1795
1822 LIBMMG3D_EXPORT int MMG3D_Get_triangle(MMG5_pMesh mesh, MMG5_int* v0, MMG5_int* v1, MMG5_int* v2, MMG5_int* ref,
1823 int* isRequired);
1824
1850 LIBMMG3D_EXPORT int MMG3D_Get_triangles(MMG5_pMesh mesh, MMG5_int* tria, MMG5_int* refs,
1851 int* areRequired);
1852
1879 LIBMMG3D_EXPORT int MMG3D_Get_quadrilateral(MMG5_pMesh mesh, MMG5_int* v0, MMG5_int* v1, MMG5_int* v2,MMG5_int* v3,
1880 MMG5_int* ref, int* isRequired);
1881
1907 LIBMMG3D_EXPORT int MMG3D_Get_quadrilaterals(MMG5_pMesh mesh, MMG5_int* quads, MMG5_int* refs,
1908 int* areRequired);
1909
1936 LIBMMG3D_EXPORT int MMG3D_Get_edge(MMG5_pMesh mesh, MMG5_int* e0, MMG5_int* e1, MMG5_int* ref,
1937 int* isRidge, int* isRequired);
1938
1957 LIBMMG3D_EXPORT int MMG3D_Set_edges(MMG5_pMesh mesh, MMG5_int *edges, MMG5_int* refs);
1958
1980 LIBMMG3D_EXPORT int MMG3D_Get_edges(MMG5_pMesh mesh,MMG5_int *edges,MMG5_int* refs,
1981 int *areRidges,int *areRequired);
1982
2005 LIBMMG3D_EXPORT int MMG3D_Get_normalAtVertex(MMG5_pMesh mesh, MMG5_int k, double *n0, double *n1,
2006 double *n2) ;
2007
2032
2053 LIBMMG3D_EXPORT int MMG3D_Get_scalarSol(MMG5_pSol met, double* s);
2054
2072
2095 LIBMMG3D_EXPORT int MMG3D_Get_vectorSol(MMG5_pSol met, double* vx, double* vy, double* vz);
2096
2115 LIBMMG3D_EXPORT int MMG3D_Get_vectorSols(MMG5_pSol met, double* sols);
2116
2143 LIBMMG3D_EXPORT int MMG3D_Get_tensorSol(MMG5_pSol met, double *m11,double *m12, double *m13,
2144 double *m22,double *m23, double *m33);
2145
2162 LIBMMG3D_EXPORT int MMG3D_Get_tensorSols(MMG5_pSol met, double *sols);
2163
2189 LIBMMG3D_EXPORT int MMG3D_Get_ithSol_inSolsAtVertices(MMG5_pSol sol,int i, double* s,MMG5_int pos);
2190
2215
2235
2260 LIBMMG3D_EXPORT int MMG3D_Add_tetrahedron(MMG5_pMesh mesh, MMG5_int v0, MMG5_int v1,
2261 MMG5_int v2, MMG5_int v3, MMG5_int ref);
2262
2287 LIBMMG3D_EXPORT MMG5_int MMG3D_Add_vertex(MMG5_pMesh mesh, double c0, double c1,
2288 double c2, MMG5_int ref);
2289
2290/* input/output functions */
2312
2337
2364
2390
2417
2443
2467
2489
2507
2529
2553
2574
2595
2616
2637
2657
2675
2699
2720
2739
2758
2774
2775/* deallocations */
2807 LIBMMG3D_EXPORT int MMG3D_Free_all(const int starter,...);
2808
2843
2875 LIBMMG3D_EXPORT int MMG3D_Free_names(const int starter,...);
2876
2877/* library */
2895
2918
2938
2954
2968 LIBMMG3D_EXPORT int MMG3D_parsar(int argc,char *argv[],MMG5_pMesh mesh,MMG5_pSol met,MMG5_pSol sol);
2969
2989
3004 LIBMMG3D_EXPORT int MMG3D_usage(char *prog);
3005
3021
3035
3062 double lmin, double lmax, MMG5_int *eltab,int8_t metRidTyp);
3063
3086 LIBMMG3D_EXPORT void MMG3D_searchqua(MMG5_pMesh mesh, MMG5_pSol met, double critmin,
3087 MMG5_int *eltab,int8_t metRidTyp);
3088
3118 double lmax,MMG5_int *eltab,int8_t metRidTyp);
3119
3143 LIBMMG3D_EXPORT int MMG3D_Get_adjaTet(MMG5_pMesh mesh,MMG5_int kel, MMG5_int listet[4]);
3144
3167 LIBMMG3D_EXPORT extern double (*MMG3D_lenedgCoor)(double *ca,double *cb,double *sa,double *sb);
3168
3188
3205
3225
3244
3245
3261
3287
3314 LIBMMG3D_EXPORT int MMG3D_Get_nonBdyTriangle(MMG5_pMesh mesh, MMG5_int* v0, MMG5_int* v1, MMG5_int* v2, MMG5_int* ref, MMG5_int idx);
3315
3342 LIBMMG3D_EXPORT int MMG3D_Get_tetFromTria(MMG5_pMesh mesh, MMG5_int ktri, MMG5_int *ktet, int *iface);
3343
3371 LIBMMG3D_EXPORT int MMG3D_Get_tetsFromTria(MMG5_pMesh mesh, MMG5_int ktri, MMG5_int ktet[2], int iface[2]);
3372
3402 LIBMMG3D_EXPORT int MMG3D_Compute_eigenv(double m[6],double lambda[3],double vp[3][3]);
3403
3419
3433
3434
3440#ifdef __cplusplus
3441}
3442#endif
3443
3444#endif
const int starter
MMG5_pMesh MMG5_pSol * sol
MMG5_pMesh char * meshin
MMG5_pMesh * mesh
MMG5_pMesh char * filename
MMG5_Info info
LIBMMG3D_EXPORT int MMG3D_Get_vectorSols(MMG5_pSol met, double *sols)
Get all elements of a vector solution structure.
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_saveMesh(MMG5_pMesh mesh, const char *filename)
Save a mesh in .mesh/.meshb format.
Definition: inout_3d.c:1273
LIBMMG3D_EXPORT int MMG3D_Unset_requiredEdge(MMG5_pMesh mesh, MMG5_int k)
Remove the "required" attribute from a single edge.
LIBMMG3D_EXPORT int MMG3D_Get_tensorSols(MMG5_pSol met, double *sols)
Get all elements of a tensor solution field.
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_outputSolName(MMG5_pMesh mesh, MMG5_pSol sol, const char *solout)
Set the name of the output solution file.
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_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 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_Set_parallelTriangles(MMG5_pMesh mesh, MMG5_int *parIdx, MMG5_int npar)
Assign the "parallel" attribute to multiple triangles.
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_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_Free_structures(const int starter,...)
Structure deallocations before return.
LIBMMG3D_EXPORT double(* MMG3D_lenedgCoor)(double *ca, double *cb, double *sa, double *sb)
Compute the length of an edge according to the size prescription.
Definition: mmg3dexterns.c:10
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_Clean_isoSurf(MMG5_pMesh mesh)
Clean data (triangles and edges) linked to isosurface.
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_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_Init_mesh(const int starter,...)
Initialize a mesh structure and optionally the associated solution and metric structures.
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_Set_requiredVertex(MMG5_pMesh mesh, MMG5_int k)
Assign the "required" attribute to a vertex.
LIBMMG3D_EXPORT int MMG3D_Set_corner(MMG5_pMesh mesh, MMG5_int k)
Assign the "corner" attribute to a vertex.
LIBMMG3D_EXPORT int MMG3D_parsop(MMG5_pMesh mesh, MMG5_pSol met)
Read a file containing Local parameters (.mmg3d extension)
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_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_requiredTetrahedra(MMG5_pMesh mesh, MMG5_int *reqIdx, MMG5_int nreq)
Assign the "required" attribute to multiple tetrahedra.
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_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_dparameter(MMG5_pMesh mesh, MMG5_pSol sol, int dparam, double val)
set a real-valued parameter of the remesher
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.
Definition: inout_3d.c:1132
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_Set_inputParamName(MMG5_pMesh mesh, const char *fparamin)
Set the name of the input parameter file.
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_Set_ridge(MMG5_pMesh mesh, MMG5_int k)
Assign the "ridge" attribute to a single 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.
LIBMMG3D_EXPORT int MMG3D_switch_metricStorage(MMG5_pMesh mesh, MMG5_pSol met)
Swap the m22 and m23 values of the metric.
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_Set_vectorSols(MMG5_pSol met, double *sols)
Set all elements of a vector solution 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_hashTetra(MMG5_pMesh mesh, int pack)
Create array of adjacency.
Definition: hash_3d.c:122
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.
Definition: inout_3d.c:2138
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_scalarSol(MMG5_pSol met, double s, MMG5_int pos)
Set a single element of a scalar solution structure.
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_Unset_requiredTetrahedra(MMG5_pMesh mesh, MMG5_int *reqIdx, MMG5_int nreq)
Remove the "required" attribute from multiple tetrahedra.
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_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_Get_iparameter(MMG5_pMesh mesh, MMG5_int iparam)
Get the value of an integer parameter of the remesher.
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 void MMG3D_destockOptions(MMG5_pMesh mesh, MMG5_Info *info)
Recover the info structure stored in the mesh structure.
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_Unset_parallelTriangles(MMG5_pMesh mesh, MMG5_int *parIdx, MMG5_int npar)
Remove the "parallel" attribute from multiple triangles.
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 int MMG3D_mmg3dls(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pSol met)
Main "program" for the level-set discretization library.
Definition: libmmg3d.c:1192
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.
Definition: mmg3dexterns.c:11
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_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_saveTetgenMesh(MMG5_pMesh, const char *)
Save data in Tetgen's Triangle format.
Definition: inout_3d.c:2658
LIBMMG3D_EXPORT int MMG3D_Set_parallelTriangle(MMG5_pMesh mesh, MMG5_int k)
Assign the "parallel" attribute to a single triangle.
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 void MMG3D_Init_fileNames(MMG5_pMesh mesh, MMG5_pSol sol)
Initialize file names to their default values.
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_Set_solSize(MMG5_pMesh mesh, MMG5_pSol sol, int typEntity, MMG5_int np, int typSol)
Initialize a solution field.
LIBMMG3D_EXPORT int MMG3D_Set_requiredTriangle(MMG5_pMesh mesh, MMG5_int k)
Assign the "required" attribute to a single triangle.
LIBMMG3D_EXPORT void MMG3D_Set_handGivenMesh(MMG5_pMesh mesh)
Finish providing mesh data without using the API functions.
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.
Definition: inout_3d.c:2133
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 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_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_Set_requiredEdge(MMG5_pMesh mesh, MMG5_int k)
Assign the "required" attribute to a single edge.
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_Unset_parallelTriangle(MMG5_pMesh mesh, MMG5_int k)
Remove the "parallel" attribute from a single triangle.
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_mmg3dmov(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol disp)
Main program for the rigid-body movement library.
Definition: libmmg3d.c:1475
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_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_Unset_requiredTetrahedron(MMG5_pMesh mesh, MMG5_int k)
Remove the "required" attribute from a tetrahedron.
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_Get_numberOfNonBdyTriangles(MMG5_pMesh mesh, MMG5_int *nb_tria)
Get the number of non-boundary triangles.
LIBMMG3D_EXPORT int MMG3D_mmg3dlib(MMG5_pMesh mesh, MMG5_pSol met)
Main "program" for the mesh adaptation library.
Definition: libmmg3d.c:975
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_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_Set_scalarSols(MMG5_pSol met, double *s)
Set the values of all elements of a scalar solution structure.
LIBMMG3D_EXPORT int MMG3D_saveSol(MMG5_pMesh mesh, MMG5_pSol met, const char *filename)
Write isotropic or anisotropic metric.
Definition: inout_3d.c:2314
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 void MMG3D_Set_commonFunc(void)
Definition: libmmg3d.c:1745
LIBMMG3D_EXPORT int MMG3D_Set_requiredTetrahedron(MMG5_pMesh mesh, MMG5_int k)
Assign the "required" attribute to a tetrahedron.
LIBMMG3D_EXPORT int MMG3D_parsar(int argc, char *argv[], MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol sol)
Store command-line arguments.
MMG3D_Param
Input parameters for the mmg library.
Definition: libmmg3d.h:143
@ MMG3D_DPARAM_hmin
Definition: libmmg3d.h:171
@ MMG3D_IPARAM_debug
Definition: libmmg3d.h:146
@ MMG3D_IPARAM_numberOfLocalParam
Definition: libmmg3d.h:161
@ MMG3D_IPARAM_isoref
Definition: libmmg3d.h:169
@ MMG3D_IPARAM_noswap
Definition: libmmg3d.h:156
@ MMG3D_IPARAM_opnbdy
Definition: libmmg3d.h:151
@ MMG3D_DPARAM_angleDetection
Definition: libmmg3d.h:170
@ MMG3D_DPARAM_hsiz
Definition: libmmg3d.h:173
@ MMG3D_IPARAM_isosurf
Definition: libmmg3d.h:149
@ MMG3D_DPARAM_hausd
Definition: libmmg3d.h:174
@ MMG3D_IPARAM_nosurf
Definition: libmmg3d.h:158
@ MMG3D_IPARAM_anisosize
Definition: libmmg3d.h:166
@ MMG3D_IPARAM_nomove
Definition: libmmg3d.h:157
@ MMG3D_IPARAM_renum
Definition: libmmg3d.h:165
@ MMG3D_DPARAM_hgrad
Definition: libmmg3d.h:175
@ MMG3D_IPARAM_nosizreq
Definition: libmmg3d.h:168
@ MMG3D_DPARAM_rmc
Definition: libmmg3d.h:179
@ MMG3D_IPARAM_angle
Definition: libmmg3d.h:147
@ MMG3D_IPARAM_noinsert
Definition: libmmg3d.h:155
@ MMG3D_DPARAM_ls
Definition: libmmg3d.h:177
@ MMG3D_DPARAM_hgradreq
Definition: libmmg3d.h:176
@ MMG3D_IPARAM_xreg
Definition: libmmg3d.h:160
@ MMG3D_PARAM_size
Definition: libmmg3d.h:180
@ MMG3D_DPARAM_hmax
Definition: libmmg3d.h:172
@ MMG3D_IPARAM_numsubdomain
Definition: libmmg3d.h:164
@ MMG3D_IPARAM_lag
Definition: libmmg3d.h:152
@ MMG3D_IPARAM_nreg
Definition: libmmg3d.h:159
@ MMG3D_IPARAM_numberOfMat
Definition: libmmg3d.h:163
@ MMG3D_IPARAM_verbose
Definition: libmmg3d.h:144
@ MMG3D_DPARAM_xreg
Definition: libmmg3d.h:178
@ MMG3D_IPARAM_numberOfLSBaseReferences
Definition: libmmg3d.h:162
@ MMG3D_IPARAM_optimLES
Definition: libmmg3d.h:154
@ MMG3D_IPARAM_optim
Definition: libmmg3d.h:153
@ MMG3D_IPARAM_iso
Definition: libmmg3d.h:148
@ MMG3D_IPARAM_octree
Definition: libmmg3d.h:167
@ MMG3D_IPARAM_nofem
Definition: libmmg3d.h:150
@ MMG3D_IPARAM_mem
Definition: libmmg3d.h:145
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_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.
Definition: inoutcpp_3d.cpp:74
LIBMMG3D_EXPORT int MMG3D_Free_all(const int starter,...)
Deallocations before return.
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_loadSol(MMG5_pMesh mesh, MMG5_pSol met, const char *filename)
Load a metric field (or other solution).
Definition: inout_3d.c:2143
LIBMMG3D_EXPORT int MMG3D_saveAllSols(MMG5_pMesh mesh, MMG5_pSol *sol, const char *filename)
Save 1 or more solutions in medit solution file format.
Definition: inout_3d.c:2352
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.
Definition: inout_3d.c:1063
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_scalarSol(MMG5_pSol met, double *s)
Get the next element of a scalar solution structure defined at vertices.
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 void MMG3D_setfunc(MMG5_pMesh mesh, MMG5_pSol met)
Set function pointers for caltet, lenedg, lenedgCoor defsiz, gradsiz... depending if the metric that ...
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 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_Set_outputMeshName(MMG5_pMesh mesh, const char *meshout)
Set the name of output mesh file.
LIBMMG3D_EXPORT int MMG3D_loadMesh(MMG5_pMesh mesh, const char *filename)
Load a mesh (in .mesh/.mesb format) from file.
Definition: inout_3d.c:1049
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 void MMG3D_Free_solutions(MMG5_pMesh mesh, MMG5_pSol sol)
Free the solution structure of a given mesh.
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_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 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_adjaTet(MMG5_pMesh mesh, MMG5_int kel, MMG5_int listet[4])
Return adjacent elements of a tetrahedron.
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 void MMG3D_Init_parameters(MMG5_pMesh mesh)
Initialize parameters to their default values.
LIBMMG3D_EXPORT int MMG3D_Set_tensorSols(MMG5_pSol met, double *sols)
Set all elements of a tensor solution structure.
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_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_loadGenericMesh(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol sol, const char *filename)
Read mesh data in a format determined by the filename extension.
Definition: inout_3d.c:1190
LIBMMG3D_EXPORT int MMG3D_Set_inputMeshName(MMG5_pMesh mesh, const char *meshin)
Set the name of input mesh.
LIBMMG3D_EXPORT int MMG3D_Unset_requiredTriangle(MMG5_pMesh mesh, MMG5_int k)
Remove the "required" attribute from a single triangle.
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.
Definition: inout_3d.c:2216
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_requiredVertex(MMG5_pMesh mesh, MMG5_int k)
Remove required attribute from a vertex.
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_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...
LIBMMG3D_EXPORT int MMG3D_stockOptions(MMG5_pMesh mesh, MMG5_Info *info)
Store the info structure in the mesh structure.
LIBMMG3D_EXPORT int MMG3D_defaultValues(MMG5_pMesh mesh)
Print the default parameters values.
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_Unset_corner(MMG5_pMesh mesh, MMG5_int k)
Remove the "corner" attribute from a 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_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_Free_allSols(MMG5_pMesh mesh, MMG5_pSol *sol)
Deallocate an array of solution fields.
LIBMMG3D_EXPORT int MMG3D_Free_names(const int starter,...)
Structure deallocations before return.
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_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_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_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_usage(char *prog)
Print help for mmg3d options.
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_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_saveGenericMesh(MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
Save mesh data in a file whose format depends on the filename extension.
Definition: inout_3d.c:2062
#define LIBMMG3D_EXPORT
Definition: mmg3d_export.h:31
Structure to store input parameters of the job.
Definition: libmmgtypes.h:523
MMG mesh structure.
Definition: libmmgtypes.h:613