Mmg
Simplicial remeshers (mesh adaptation, isovalue discretization, lagrangian movement)
libmmgtypes.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
33#include <stdint.h>
34#include <stdarg.h>
35#include <stddef.h>
36
37#include "mmg/common/mmgcmakedefines.h"
38#include "mmg/common/mmgversion.h"
39
40#ifndef _LIBMMGTYPES_H
41#define _LIBMMGTYPES_H
42
49#define MMG5_SUCCESS 0
57#define MMG5_LOWFAILURE 1
65#define MMG5_STRONGFAILURE 2
66
71#define MG_ISO 10
72
77#define MG_PLUS 2
82#define MG_MINUS 3
83
93#define MMG5_ARG_start 1
102#define MMG5_ARG_ppMesh 2
112#define MMG5_ARG_ppLs 3
122#define MMG5_ARG_ppMet 4
132#define MMG5_ARG_ppDisp 5
142#define MMG5_ARG_ppSols 6
151#define MMG5_ARG_pMesh 7
160#define MMG5_ARG_pMet 8
169#define MMG5_ARG_pDisp 9
179#define MMG5_ARG_end 10
180
187#define MMG5_NSOLS_MAX 100
188
195#define MMG5_FILENAME_LEN_MAX 255
196
203#define MMG5_MMAT_NoSplit 0
204
211#define MMG5_MMAT_Split 1
212
223
234};
235
253
263typedef struct {
264 double hmin;
265 double hmax;
266 double hausd;
267 MMG5_int ref;
268 int8_t elt;
270
276typedef struct {
277 double c[3];
278 double n[3];
281#ifdef USE_POINTMAP
282 MMG5_int src;
283#endif
284 MMG5_int ref;
285 MMG5_int xp;
286 MMG5_int tmp;
288 MMG5_int flag;
289 MMG5_int s;
290 uint16_t tag;
292 int8_t tagdel;
293} MMG5_Point;
295
300typedef struct {
301 double n1[3],n2[3];
303 int8_t nnor; /* By default 0; 1 if no normal available (internal NOM point) */
306
311typedef struct {
312 MMG5_int a,b;
313 MMG5_int ref;
314 MMG5_int base;
316 uint16_t tag;
317} MMG5_Edge;
319
338typedef struct {
339 double qual; /*Quality of the triangle*/
340 MMG5_int v[3];
341 MMG5_int ref;
342 MMG5_int base;
343 MMG5_int cc;
345 MMG5_int edg[3];
347 MMG5_int flag;
348 uint16_t tag[3];
350 } MMG5_Tria;
352
353
372typedef struct {
373 MMG5_int v[4];
374 MMG5_int ref;
375 MMG5_int base;
376 MMG5_int edg[4];
378 uint16_t tag[4];
380} MMG5_Quad;
382
383
407typedef struct {
408 double qual;
409 MMG5_int v[4];
410 MMG5_int ref;
411 MMG5_int base;
412 MMG5_int mark;
413 MMG5_int xt;
416 MMG5_int flag;
417 uint16_t tag;
418} MMG5_Tetra;
420
425typedef struct {
426 MMG5_int ref[4];
428 MMG5_int edg[6];
430 uint16_t ftag[4];
432 uint16_t tag[6];
434 int8_t ori;
439
469typedef struct {
470 MMG5_int v[6];
471 MMG5_int ref;
472 MMG5_int base;
473 MMG5_int flag;
474 MMG5_int xpr;
476 uint8_t tag;
477} MMG5_Prism;
479
484typedef struct {
485 MMG5_int ref[5];
487 MMG5_int edg[9];
491 uint16_t ftag[5];
493 uint16_t tag[9];
497
502typedef struct {
503 int8_t dospl;
504 MMG5_int ref,rin,rex;
505} MMG5_Mat;
507
512typedef struct {
513 MMG5_int offset;
514 MMG5_int size;
515 int *lookup;
518
523typedef struct {
525 double dhd,hmin,hmax,hsiz,hgrad,hgradreq,hausd;
526 double min[3],max[3],delta,ls,lxreg,rmc;
527 MMG5_int *br;
528 MMG5_int isoref;
529 MMG5_int nsd;
530 int mem,npar,npari;
531 int nbr,nbri;
532 int opnbdy;
533 int renum;
535 int nmati,nmat;
536 int imprim;
537 int8_t nreg;
538 int8_t xreg;
539 int8_t ddebug;
540 int8_t badkal;
541 int8_t iso;
542 int8_t isosurf;
543 int8_t setfem;
546 int8_t fem;
547 int8_t lag;
548 int8_t parTyp;
551 int8_t sethmin;
552 int8_t sethmax;
553 uint8_t ani, optim, optimLES, noinsert, noswap, nomove, nosurf, nosizreq;
554 uint8_t metRidTyp;
555 char *fparam;
564} MMG5_Info;
565
570typedef struct {
571 MMG5_int a;
572 MMG5_int b;
573 MMG5_int ref;
574 MMG5_int nxt;
575 uint16_t tag;
576} MMG5_hgeom;
577
582typedef struct {
584 MMG5_int siz,max,nxt;
585} MMG5_HGeom;
586
587
592typedef struct {
593 MMG5_int a,b,nxt;
594 MMG5_int k;
595 MMG5_int s;
596} MMG5_hedge;
597
603typedef struct {
604 MMG5_int siz,max,nxt;
606} MMG5_Hash;
607
613typedef struct {
614 size_t memMax;
615 size_t memCur;
616 double gap;
617 int ver;
618 int dim;
619 int type;
620 MMG5_int npi,nti,nai,nei,np,na,nt,ne,npmax,namax,ntmax,nemax,xpmax,xtmax;
621 MMG5_int nquad,nprism;
622 int nsols;
623 MMG5_int nc1;
624 MMG5_int base;
626 MMG5_int mark;
628 MMG5_int xp,xt,xpr;
629 MMG5_int npnil;
630 MMG5_int nenil;
631 MMG5_int nanil;
632 MMG5_int *adja;
636 MMG5_int *adjt;
640 MMG5_int *adjapr;
644 MMG5_int *adjq;
648 int *ipar;
660 char *namein;
661 char *nameout;
663} MMG5_Mesh;
665
671typedef struct {
672 int ver; /* Version of the solution file */
673 int dim; /* Dimension of the solution file*/
674 MMG5_int np; /* Number of points of the solution */
675 MMG5_int npmax; /* Maximum number of points */
676 MMG5_int npi; /* Temporary number of points (internal use only) */
677 int size; /* Number of solutions per entity */
678 int type; /* Type of the solution (scalar, vectorial or tensorial) */
679 int entities; /* Type of the solution (scalar, vectorial of tensorial) */
680 double *m;
681 double umin,umax;
682 char *namein;
683 char *nameout;
684} MMG5_Sol;
686
687#endif
MMG5_Par * MMG5_pPar
Definition: libmmgtypes.h:269
MMG5_Tria * MMG5_pTria
Definition: libmmgtypes.h:351
MMG5_Edge * MMG5_pEdge
Definition: libmmgtypes.h:318
MMG5_Quad * MMG5_pQuad
Definition: libmmgtypes.h:381
MMG5_type
Type of solutions.
Definition: libmmgtypes.h:217
@ MMG5_Vector
Definition: libmmgtypes.h:220
@ MMG5_Tensor
Definition: libmmgtypes.h:221
@ MMG5_Scalar
Definition: libmmgtypes.h:219
@ MMG5_Notype
Definition: libmmgtypes.h:218
MMG5_xPrism * MMG5_pxPrism
Definition: libmmgtypes.h:496
MMG5_Format
Type of supported file format.
Definition: libmmgtypes.h:240
@ MMG5_FMT_MeditBinary
Definition: libmmgtypes.h:242
@ MMG5_FMT_Tetgen
Definition: libmmgtypes.h:250
@ MMG5_FMT_VtkVtk
Definition: libmmgtypes.h:249
@ MMG5_FMT_GmshBinary
Definition: libmmgtypes.h:244
@ MMG5_FMT_VtkPvtp
Definition: libmmgtypes.h:245
@ MMG5_FMT_Unknown
Definition: libmmgtypes.h:251
@ MMG5_FMT_GmshASCII
Definition: libmmgtypes.h:243
@ MMG5_FMT_MeditASCII
Definition: libmmgtypes.h:241
@ MMG5_FMT_VtkVtp
Definition: libmmgtypes.h:248
@ MMG5_FMT_VtkPvtu
Definition: libmmgtypes.h:246
@ MMG5_FMT_VtkVtu
Definition: libmmgtypes.h:247
MMG5_Sol * MMG5_pSol
Definition: libmmgtypes.h:685
MMG5_InvMat * MMG5_pInvMat
Definition: libmmgtypes.h:517
MMG5_Point * MMG5_pPoint
Definition: libmmgtypes.h:294
MMG5_Mat * MMG5_pMat
Definition: libmmgtypes.h:506
MMG5_Mesh * MMG5_pMesh
Definition: libmmgtypes.h:664
MMG5_xTetra * MMG5_pxTetra
Definition: libmmgtypes.h:438
MMG5_Tetra * MMG5_pTetra
Definition: libmmgtypes.h:419
MMG5_entities
Identifies the types of mesh entities.
Definition: libmmgtypes.h:228
@ MMG5_Noentity
Definition: libmmgtypes.h:229
@ MMG5_Vertex
Definition: libmmgtypes.h:230
@ MMG5_Tetrahedron
Definition: libmmgtypes.h:233
@ MMG5_Edg
Definition: libmmgtypes.h:231
@ MMG5_Triangle
Definition: libmmgtypes.h:232
MMG5_Prism * MMG5_pPrism
Definition: libmmgtypes.h:478
MMG5_xPoint * MMG5_pxPoint
Definition: libmmgtypes.h:305
Structure to store edges of am MMG mesh.
Definition: libmmgtypes.h:311
MMG5_int base
Definition: libmmgtypes.h:314
uint16_t tag
Definition: libmmgtypes.h:316
MMG5_int ref
Definition: libmmgtypes.h:313
MMG5_int a
Definition: libmmgtypes.h:312
Hash table to store geometric edges.
Definition: libmmgtypes.h:582
MMG5_int max
Definition: libmmgtypes.h:584
MMG5_hgeom * geom
Definition: libmmgtypes.h:583
Identic as MMG5_HGeom but use MMG5_hedge to store edges instead of MMG5_hgeom (memory economy).
Definition: libmmgtypes.h:603
MMG5_int max
Definition: libmmgtypes.h:604
MMG5_hedge * item
Definition: libmmgtypes.h:605
Structure to store input parameters of the job.
Definition: libmmgtypes.h:523
int8_t iso
Definition: libmmgtypes.h:541
int8_t parTyp
Definition: libmmgtypes.h:548
int8_t ddebug
Definition: libmmgtypes.h:539
double delta
Definition: libmmgtypes.h:526
int8_t isosurf
Definition: libmmgtypes.h:542
int8_t sethmin
Definition: libmmgtypes.h:551
MMG5_int * br
Definition: libmmgtypes.h:527
uint8_t ani
Definition: libmmgtypes.h:553
int8_t setfem
Definition: libmmgtypes.h:543
MMG5_pMat mat
Definition: libmmgtypes.h:562
int8_t badkal
Definition: libmmgtypes.h:540
MMG5_int isoref
Definition: libmmgtypes.h:528
uint8_t metRidTyp
Definition: libmmgtypes.h:554
int PROctree
Definition: libmmgtypes.h:534
int8_t lag
Definition: libmmgtypes.h:547
MMG5_int nsd
Definition: libmmgtypes.h:529
MMG5_InvMat invmat
Definition: libmmgtypes.h:563
char * fparam
Definition: libmmgtypes.h:555
int8_t sethmax
Definition: libmmgtypes.h:552
MMG5_pPar par
Definition: libmmgtypes.h:524
double dhd
Definition: libmmgtypes.h:525
int8_t xreg
Definition: libmmgtypes.h:538
int8_t nreg
Definition: libmmgtypes.h:537
int8_t fem
Definition: libmmgtypes.h:546
To store lookup table for references in the mesh (useful in LS mode)
Definition: libmmgtypes.h:512
MMG5_int offset
Definition: libmmgtypes.h:513
MMG5_int size
Definition: libmmgtypes.h:514
int * lookup
Definition: libmmgtypes.h:515
To store user-defined references in the mesh (useful in LS mode)
Definition: libmmgtypes.h:502
MMG5_int ref
Definition: libmmgtypes.h:504
int8_t dospl
Definition: libmmgtypes.h:503
MMG mesh structure.
Definition: libmmgtypes.h:613
size_t memCur
Definition: libmmgtypes.h:615
MMG5_pQuad quadra
Definition: libmmgtypes.h:656
MMG5_int nc1
Definition: libmmgtypes.h:623
MMG5_Info info
Definition: libmmgtypes.h:659
MMG5_int * adjapr
Definition: libmmgtypes.h:640
MMG5_pPoint point
Definition: libmmgtypes.h:649
char * nameout
Definition: libmmgtypes.h:661
int * ipar
Definition: libmmgtypes.h:648
MMG5_int mark
Definition: libmmgtypes.h:626
MMG5_int * adja
Definition: libmmgtypes.h:632
MMG5_pPrism prism
Definition: libmmgtypes.h:653
size_t memMax
Definition: libmmgtypes.h:614
MMG5_pxPoint xpoint
Definition: libmmgtypes.h:650
MMG5_int nenil
Definition: libmmgtypes.h:630
MMG5_HGeom htab
Definition: libmmgtypes.h:658
MMG5_int * adjq
Definition: libmmgtypes.h:644
MMG5_int xp
Definition: libmmgtypes.h:628
double gap
Definition: libmmgtypes.h:616
MMG5_int base
Definition: libmmgtypes.h:624
MMG5_pTetra tetra
Definition: libmmgtypes.h:651
MMG5_pxPrism xprism
Definition: libmmgtypes.h:654
MMG5_pTria tria
Definition: libmmgtypes.h:655
MMG5_pEdge edge
Definition: libmmgtypes.h:657
MMG5_int nanil
Definition: libmmgtypes.h:631
MMG5_pxTetra xtetra
Definition: libmmgtypes.h:652
MMG5_int nprism
Definition: libmmgtypes.h:621
MMG5_int na
Definition: libmmgtypes.h:620
MMG5_int npnil
Definition: libmmgtypes.h:629
char * namein
Definition: libmmgtypes.h:660
MMG5_int * adjt
Definition: libmmgtypes.h:636
Local parameters for a specific entity and reference.
Definition: libmmgtypes.h:263
double hmin
Definition: libmmgtypes.h:264
double hmax
Definition: libmmgtypes.h:265
double hausd
Definition: libmmgtypes.h:266
MMG5_int ref
Definition: libmmgtypes.h:267
int8_t elt
Definition: libmmgtypes.h:268
Structure to store vertices of an MMG mesh.
Definition: libmmgtypes.h:276
int8_t tagdel
Definition: libmmgtypes.h:292
MMG5_int tmp
Definition: libmmgtypes.h:286
uint16_t tag
Definition: libmmgtypes.h:290
MMG5_int xp
Definition: libmmgtypes.h:285
MMG5_int s
Definition: libmmgtypes.h:289
MMG5_int ref
Definition: libmmgtypes.h:284
MMG5_int flag
Definition: libmmgtypes.h:288
Structure to store prsim of a MMG mesh.
Definition: libmmgtypes.h:469
uint8_t tag
Definition: libmmgtypes.h:476
MMG5_int ref
Definition: libmmgtypes.h:471
MMG5_int flag
Definition: libmmgtypes.h:473
MMG5_int base
Definition: libmmgtypes.h:472
MMG5_int xpr
Definition: libmmgtypes.h:474
Structure to store quadrangles of an MMG mesh.
Definition: libmmgtypes.h:372
MMG5_int ref
Definition: libmmgtypes.h:374
MMG5_int base
Definition: libmmgtypes.h:375
MMG5_int npi
Definition: libmmgtypes.h:676
int entities
Definition: libmmgtypes.h:679
char * nameout
Definition: libmmgtypes.h:683
MMG5_int npmax
Definition: libmmgtypes.h:675
char * namein
Definition: libmmgtypes.h:682
double * m
Definition: libmmgtypes.h:680
double umax
Definition: libmmgtypes.h:681
MMG5_int np
Definition: libmmgtypes.h:674
Structure to store tetrahedra of an MMG mesh.
Definition: libmmgtypes.h:407
MMG5_int base
Definition: libmmgtypes.h:411
MMG5_int xt
Definition: libmmgtypes.h:413
MMG5_int flag
Definition: libmmgtypes.h:416
MMG5_int ref
Definition: libmmgtypes.h:410
MMG5_int mark
Definition: libmmgtypes.h:412
uint16_t tag
Definition: libmmgtypes.h:417
double qual
Definition: libmmgtypes.h:408
Structure to store triangles of a MMG mesh.
Definition: libmmgtypes.h:338
double qual
Definition: libmmgtypes.h:339
MMG5_int ref
Definition: libmmgtypes.h:341
MMG5_int flag
Definition: libmmgtypes.h:347
MMG5_int base
Definition: libmmgtypes.h:342
MMG5_int cc
Definition: libmmgtypes.h:343
Used to hash edges (memory economy compared to MMG5_hgeom).
Definition: libmmgtypes.h:592
MMG5_int s
Definition: libmmgtypes.h:595
MMG5_int a
Definition: libmmgtypes.h:593
MMG5_int k
Definition: libmmgtypes.h:594
Cell of the hash table of geometric edges.
Definition: libmmgtypes.h:570
MMG5_int ref
Definition: libmmgtypes.h:573
MMG5_int b
Definition: libmmgtypes.h:572
MMG5_int nxt
Definition: libmmgtypes.h:574
MMG5_int a
Definition: libmmgtypes.h:571
uint16_t tag
Definition: libmmgtypes.h:575
Structure to store surface vertices of an MMG mesh.
Definition: libmmgtypes.h:300
int8_t nnor
Definition: libmmgtypes.h:303
Structure to store the surface prism of a MMG mesh.
Definition: libmmgtypes.h:484
Structure to store additional information for the surface tetrahedra of an MMG mesh.
Definition: libmmgtypes.h:425
int8_t ori
Definition: libmmgtypes.h:434