mmg2d
mmgcommon.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/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 #ifndef _MMGCOMMON_H
25 #define _MMGCOMMON_H
26 
27 #include <assert.h>
28 #include <stdlib.h>
29 #include <stdio.h>
30 #include <limits.h>
31 #include <string.h>
32 #include <signal.h>
33 #include <ctype.h>
34 #include <float.h>
35 #include <math.h>
36 #include <complex.h>
37 
38 #define POSIX
39 #define GNU
40 
41 #if (defined(__APPLE__) && defined(__MACH__))
42 #include <sys/sysctl.h>
43 #elif defined(__unix__) || defined(__unix) || defined(unix)
44 #include <unistd.h>
45 #elif defined(_WIN16) || defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(__TOS_WIN__) || defined(__WINDOWS__)
46 #ifndef GNU
47 #define _WIN32_WINNT 0x0500
48 #endif
49 
50 #include <windows.h>
51 #endif
52 
53 
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
58 #include "eigenv.h"
59 #include "libmmgcommon.h"
60 
61 #define MG_VER "5.3.13"
62 #define MG_REL "Oct. 2, 2018"
63 #define MG_CPY "Copyright (c) IMB-LJLL, 2004-"
64 #define MG_STR "&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"
65 
67 #define MG_SMSGN(a,b) (((double)(a)*(double)(b) > (0.0)) ? (1) : (0))
68 
70 #define _MMG5_BOXSIZE 500
71 
73 #define _MMG5_MEMMAX 800
74 
75 /* Domain refs in iso mode */
76 #define MG_PLUS 2
77 #define MG_MINUS 3
78 
79 /* numerical accuracy */
80 #define _MMG5_ANGEDG 0.707106781186548 /*0.573576436351046 */
81 #define _MMG5_ANGLIM -0.999999
82 #define _MMG5_ATHIRD 0.333333333333333
83 
84 #define _MMG5_EPSD 1.e-30
85 #define _MMG5_EPSD2 1.0e-200
86 #define _MMG5_EPS 1.e-06
87 #define _MMG5_EPSOK 1.e-15
88 #define _MMG5_NULKAL 1.e-30
89 
90 #define _MMG5_SQR32 0.866025403784439
91 
92 #ifndef M_PI
93 #define M_PI 3.14159265358979323846
94 #define M_PI_2 1.57079632679489661923
95 #endif
96 
97 #define A64TH 0.015625
98 #define A16TH 0.0625
99 #define A32TH 0.03125
100 
101 #define _MMG5_MEMMIN 38
103 /* Macros */
104 #define MG_MAX(a,b) (((a) > (b)) ? (a) : (b))
105 #define MG_MIN(a,b) (((a) < (b)) ? (a) : (b))
106 
107 /* tags */
108 #define MG_NOTAG (0)
109 #define MG_REF (1 << 0)
110 #define MG_GEO (1 << 1)
111 #define MG_REQ (1 << 2)
112 #define MG_NOM (1 << 3)
113 #define MG_BDY (1 << 4)
114 #define MG_CRN (1 << 5)
115 #define MG_NOSURF (1 << 6)
116 #define MG_OPNBDY (1 << 7)
117 #define MG_PARBDY (1 << 13)
118 #define MG_NUL (1 << 14)
120 /* binary tags for local parameters */
121 #define MG_Vert (1 << 0 )
122 #define MG_Tria (1 << 1 )
123 #define MG_Tetra (1 << 2 )
125 #define MG_VOK(ppt) (ppt && ((ppt)->tag < MG_NUL))
126 #define MG_EOK(pt) (pt && ((pt)->v[0] > 0))
128 #define MG_EDG(tag) ((tag & MG_GEO) || (tag & MG_REF))
129 #define MG_SIN(tag) ((tag & MG_CRN) || (tag & MG_REQ))
131 #define MG_SET(flag,bit) ((flag) |= (1 << (bit)))
132 #define MG_CLR(flag,bit) ((flag) &= ~(1 << (bit)))
133 #define MG_GET(flag,bit) ((flag) & (1 << (bit)))
135 #define _MMG5_KA 7
136 #define _MMG5_KB 11
141 #define _LIBMMG5_RETURN(mesh,met,val)do \
142  { \
143  signal(SIGABRT,SIG_DFL); \
144  signal(SIGFPE,SIG_DFL); \
145  signal(SIGILL,SIG_DFL); \
146  signal(SIGSEGV,SIG_DFL); \
147  signal(SIGTERM,SIG_DFL); \
148  signal(SIGINT,SIG_DFL); \
149  mesh->npi = mesh->np; \
150  mesh->nti = mesh->nt; \
151  mesh->nai = mesh->na; \
152  mesh->nei = mesh->ne; \
153  met->npi = met->np; \
154  return(val); \
155  }while(0)
156 
157 /* Macros for memory management */
160 #define _MMG5_CHK_MEM(mesh,size,string,law) do \
161  { \
162  if ( ((mesh)->memCur) > ((mesh)->memMax) || \
163  ((mesh)->memCur < 0 )) { \
164  fprintf(stderr," ## Error:"); \
165  fprintf(stderr," unable to allocate %s.\n",string); \
166  fprintf(stderr," ## Check the mesh size or "); \
167  fprintf(stderr,"increase maximal authorized memory with the -m option.\n"); \
168  (mesh)->memCur -= (long long)(size); \
169  law; \
170  } \
171  }while(0)
172 
175 #define _MMG5_DEL_MEM(mesh,ptr,size) do \
176  { \
177  (mesh)->memCur -= (long long)(size); \
178  free(ptr); \
179  ptr = NULL; \
180  }while(0)
181 
184 #define _MMG5_ADD_MEM(mesh,size,message,law) do \
185  { \
186  (mesh)->memCur += (long long)(size); \
187  _MMG5_CHK_MEM(mesh,size,message,law); \
188  }while(0)
189 
191 #define _MMG5_SAFE_FREE(ptr) do \
192  { \
193  free(ptr); \
194  ptr = NULL; \
195  }while(0)
196 
198 #define _MMG5_SAFE_CALLOC(ptr,size,type,retval) do \
199  { \
200  ptr = (type *)calloc((size),sizeof(type)); \
201  if ( !ptr ) { \
202  perror(" ## Memory problem: calloc"); \
203  return retval; \
204  } \
205  }while(0)
206 
208 #define _MMG5_SAFE_MALLOC(ptr,size,type,retval) do \
209  { \
210  ptr = (type *)malloc((size)*sizeof(type)); \
211  if ( !ptr ) { \
212  perror(" ## Memory problem: malloc"); \
213  return retval; \
214  } \
215  }while(0)
216 
218 #define _MMG5_SAFE_REALLOC(ptr,size,type,message,retval) do \
219  { \
220  type* tmp; \
221  tmp = (type *)realloc((ptr),(size)*sizeof(type)); \
222  if ( !tmp ) { \
223  _MMG5_SAFE_FREE(ptr); \
224  perror(" ## Memory problem: realloc"); \
225  return retval; \
226  } \
227  \
228  (ptr) = tmp; \
229  }while(0)
230 
232 #define _MMG5_SAFE_RECALLOC(ptr,prevSize,newSize,type,message,retval) do \
233  { \
234  type* tmp; \
235  \
236  tmp = (type *)realloc((ptr),(newSize)*sizeof(type)); \
237  if ( !tmp ) { \
238  _MMG5_SAFE_FREE(ptr); \
239  perror(" ## Memory problem: realloc"); \
240  return retval; \
241  } \
242  \
243  (ptr) = tmp; \
244  \
245  if ( newSize > prevSize ) { \
246  memset(&((ptr)[prevSize]),0,((newSize)-(prevSize))*sizeof(type)); \
247  } \
248  }while(0)
249 
253 #define _MMG5_TAB_RECALLOC(mesh,ptr,initSize,wantedGap,type,message,law,retval) do \
254  { \
255  int gap; \
256  \
257  if ( (mesh->memMax-mesh->memCur) < \
258  (long long) (wantedGap*initSize*sizeof(type)) ) { \
259  gap = (int)((mesh->memMax-mesh->memCur)/sizeof(type)); \
260  if(gap<1) { \
261  fprintf(stderr," ## Error:"); \
262  fprintf(stderr," unable to allocate %s.\n",message); \
263  fprintf(stderr," ## Check the mesh size or "); \
264  fprintf(stderr,"increase maximal authorized memory with the -m option.\n"); \
265  law; \
266  } \
267  } \
268  else \
269  gap = (int)(wantedGap*initSize); \
270  \
271  _MMG5_ADD_MEM(mesh,gap*sizeof(type),message,law); \
272  _MMG5_SAFE_RECALLOC((ptr),initSize+1,initSize+gap+1,type,message,retval); \
273  initSize = initSize+gap; \
274  }while(0);
275 
277 #define _MMG5_INCREASE_MEM_MESSAGE() do \
278  { \
279  printf(" ## Check the mesh size or increase maximal"); \
280  printf(" authorized memory with the -m option.\n"); \
281  } while(0)
282 
283 #define _MMG5_SAFELL2LCAST(longlongval) (((longlongval) > (LONG_MAX)) ? 0 : ((long)(longlongval)))
284 #define _MMG5_SAFELL2ICAST(longlongval) (((longlongval) > (INT_MAX)) ? 0 : ((int)(longlongval)))
285 
286 
288 #ifdef USE_SCOTCH
289 
290 static inline
291 void _MMG5_warnScotch(MMG5_pMesh mesh) {
292  if ( mesh->info.imprim > 4 || mesh->info.ddebug ) {
293  if ( mesh->info.mem >= 0 ) {
294  fprintf(stdout," ## Warning: we will overflow the memory asked with \"-m\"");
295  fprintf(stdout," option during Scotch call.\n" );
296  }
297  }
298 }
299 #endif
300 
306 static inline
307 void _MMG5_excfun(int sigid) {
308  fprintf(stdout,"\n Unexpected error:"); fflush(stdout);
309  switch(sigid) {
310  case SIGABRT:
311  fprintf(stdout," *** potential lack of memory.\n"); break;
312  case SIGFPE:
313  fprintf(stdout," *** Floating-point exception\n"); break;
314  case SIGILL:
315  fprintf(stdout," *** Illegal instruction\n"); break;
316  case SIGSEGV:
317  fprintf(stdout," *** Segmentation fault\n"); break;
318  case SIGTERM:
319  case SIGINT:
320  fprintf(stdout," *** Program killed\n"); break;
321  }
322  exit(EXIT_FAILURE);
323 }
324 
325 /* Macro for fortran function generation */
339 #define FORTRAN_NAME(nu,nl,pl,pc) \
340  void nu pl; \
341  void nl pl \
342  { nu pc; } \
343  void nl##_ pl \
344  { nu pc; } \
345  void nl##__ pl \
346  { nu pc; } \
347  void nu pl
348 
361 #define FORTRAN_VARIADIC(nu,nl,pl,body) \
362  void nu pl \
363  { body } \
364  void nl pl \
365  { body } \
366  void nl##_ pl \
367  { body } \
368  void nl##__ pl \
369  { body } \
370 
371 
372 /* Global variables */
373  static const unsigned char _MMG5_inxt2[6] = {1,2,0,1,2};
374 static const unsigned char _MMG5_iprv2[3] = {2,0,1};
376 /* Private structures */
383 typedef struct {
384  double b[10][3];
385  double n[6][3];
386  double t[6][3];
387  MMG5_pPoint p[3];
388 } _MMG5_Bezier;
390 
395 typedef struct {
396  int a,b,nxt;
397  int k;
398  int s;
399 } _MMG5_hedge;
400 
406 typedef struct {
407  int siz,max,nxt;
409 } _MMG5_Hash;
410 
411 
416 typedef struct _MMG5_iNode_s {
417  int val;
419 } _MMG5_iNode;
420 
425 typedef struct _MMG5_dNode_s {
426  int k;
427  double val;
429 } _MMG5_dNode;
430 
431 
432 /* Functions declarations */
433  extern double _MMG5_det3pt1vec(double c0[3],double c1[3],double c2[3],double v[3]);
434  extern double _MMG5_det4pt(double c0[3],double c1[3],double c2[3],double c3[3]);
435  int _MMG5_devangle(double* n1, double *n2, double crit);
436  extern double _MMG5_orvol(MMG5_pPoint point,int *v);
437  extern int _MMG5_Add_inode( MMG5_pMesh mesh, _MMG5_iNode **liLi, int val );
438  extern int _MMG5_Alloc_inode( MMG5_pMesh mesh, _MMG5_iNode **node );
439  extern int _MMG5_Add_dnode( MMG5_pMesh mesh, _MMG5_dNode **liLi, int, double);
440  extern int _MMG5_Alloc_dnode( MMG5_pMesh mesh, _MMG5_dNode **node );
441  extern void _MMG5_bezierEdge(MMG5_pMesh, int, int, double*, double*, char,double*);
442  int _MMG5_buildridmet(MMG5_pMesh,MMG5_pSol,int,double,double,double,double*);
443  extern int _MMG5_buildridmetfic(MMG5_pMesh,double*,double*,double,double,double,double*);
444  int _MMG5_buildridmetnor(MMG5_pMesh, MMG5_pSol, int,double*, double*);
445  int _MMG5_paratmet(double c0[3],double n0[3],double m[6],double c1[3],double n1[3],double mt[6]);
446  extern int _MMG5_rmtr(double r[3][3],double m[6], double mr[6]);
448  int _MMG5_boulec(MMG5_pMesh, int*, int, int i,double *tt);
449  int _MMG5_boulen(MMG5_pMesh, int*, int, int i,double *nn);
450  int _MMG5_bouler(MMG5_pMesh, int*, int, int i,int *,int *,int *, int*, int);
452  extern double _MMG5_caltri_ani(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTria ptt);
453  extern double _MMG5_caltri_iso(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTria ptt);
454  void _MMG5_defUninitSize(MMG5_pMesh mesh,MMG5_pSol met, char ismet);
455  void _MMG5_displayHisto(MMG5_pMesh,int, double*, int, int, double, int, int,
456  double,int, double*, int*,char);
457  int _MMG5_minQualCheck ( int iel, double minqual, double alpha );
459  _MMG5_Bezier*,double r[3][3],double gv[2]);
460  void _MMG5_fillDefmetregSys( int, MMG5_pPoint, int, _MMG5_Bezier,double r[3][3],
461  double *, double *, double *, double *);
462  extern void _MMG5_Free_ilinkedList( MMG5_pMesh mesh, _MMG5_iNode *liLi );
463  extern void _MMG5_Free_dlinkedList( MMG5_pMesh mesh, _MMG5_dNode *liLi );
465  int _MMG5_hashEdge(MMG5_pMesh mesh,_MMG5_Hash *hash,int a,int b,int k);
466  int _MMG5_hashUpdate(_MMG5_Hash *hash,int a,int b,int k);
467  int _MMG5_hashGet(_MMG5_Hash *hash,int a,int b);
468  int _MMG5_hashNew(MMG5_pMesh mesh, _MMG5_Hash *hash,int hsiz,int hmax);
469  int _MMG5_intmetsavedir(MMG5_pMesh mesh, double *m,double *n,double *mr);
470  int _MMG5_intridmet(MMG5_pMesh,MMG5_pSol,int,int,double,double*,double*);
471  int _MMG5_mmgIntmet33_ani(double*,double*,double*,double);
472  int _MMG5_mmgIntextmet(MMG5_pMesh,MMG5_pSol,int,double *,double *);
473  long long _MMG5_memSize(void);
475  int _MMG5_mmgHashTria(MMG5_pMesh mesh, int *adja, _MMG5_Hash*, int chkISO);
477  void _MMG5_mmgUsage(char *prog);
478  extern int _MMG5_nonUnitNorPts(MMG5_pMesh,int,int,int,double*);
479  extern double _MMG5_nonorsurf(MMG5_pMesh mesh,MMG5_pTria pt);
480  extern int _MMG5_norpts(MMG5_pMesh,int,int,int,double *);
481  extern int _MMG5_nortri(MMG5_pMesh mesh,MMG5_pTria pt,double *n);
482  void _MMG5_printTria(MMG5_pMesh mesh,char* fileName);
483  extern int _MMG5_rotmatrix(double n[3],double r[3][3]);
484  int _MMG5_invmat(double *m,double *mi);
485  int _MMG5_invmatg(double m[9],double mi[9]);
486  double _MMG5_ridSizeInNormalDir(MMG5_pMesh,int,double*,_MMG5_pBezier,double,double);
487  double _MMG5_ridSizeInTangentDir(MMG5_pMesh, MMG5_pPoint,int,int*,double,double);
490  int _MMG5_solveDefmetregSys( MMG5_pMesh, double r[3][3], double *, double *,
491  double *, double *, double, double, double);
492  int _MMG5_solveDefmetrefSys( MMG5_pMesh,MMG5_pPoint,int*, double r[3][3],
493  double *, double *, double *, double *,
494  double, double, double);
496  double _MMG5_surftri33_ani(MMG5_pMesh,MMG5_pTria,double*,double*,double*);
498  extern int _MMG5_sys33sym(double a[6], double b[3], double r[3]);
500  int _MMG5_interpreg_ani(MMG5_pMesh,MMG5_pSol,MMG5_pTria,char,double,double *mr);
501  int _MMG5_interp_iso(double *ma,double *mb,double *mp,double t);
502  int _MMG5_intersecmet22(MMG5_pMesh mesh, double *m,double *n,double *mr);
505  double MMG2_quickarea(double a[2],double b[2],double c[2]);
506 
507  int MMG5_loadMshMesh_part1(MMG5_pMesh mesh,const char *filename,
508  FILE **inm,long *posNodes, long *posElts,
509  long **posNodeData, int *bin, int *iswp,
510  int *nelts,int *nsols);
511 
513  const long posNodes,const long posElts,
514  const long *posNodeData,const int bin,const int iswp,
515  const int nelts);
516 int MMG5_saveMshMesh(MMG5_pMesh,MMG5_pSol*,const char*,const int);
517 int MMG5_loadSolHeader(const char*,int,FILE**,int*,int*,int*,int*,
518  int*,int*,int**,long*,int);
519 int MMG5_chkMetricType(MMG5_pMesh mesh,int *type, FILE *inm);
520 void MMG5_readFloatSol3D(MMG5_pSol,FILE*,int,int,int);
521 void MMG5_readDoubleSol3D(MMG5_pSol,FILE*,int,int,int);
522 int MMG5_saveSolHeader( MMG5_pMesh,const char*,FILE**,int,int*,int,
523  int,int,int*,int*);
524 void MMG5_writeDoubleSol3D(MMG5_pMesh,MMG5_pSol,FILE*,int,int,int);
527 void MMG5_chooseOutputFormat(MMG5_pMesh mesh, int *msh);
528 
529 /* function pointers */
530 int (*_MMG5_chkmsh)(MMG5_pMesh,int,int);
532 double (*_MMG5_lenSurfEdg)(MMG5_pMesh mesh,MMG5_pSol sol ,int ,int, char );
533 
534 /* useful functions to debug */
535 int (*_MMG5_indElt)(MMG5_pMesh mesh,int kel);
536 int (*_MMG5_indPt)(MMG5_pMesh mesh,int kp);
537 
538 #ifdef USE_SCOTCH
539 int (*_MMG5_renumbering)(int vertBoxNbr, MMG5_pMesh mesh, MMG5_pSol sol);
540 #endif
541 
542 void _MMG5_Set_commonFunc();
543 
544 #ifdef __cplusplus
545 }
546 #endif
547 
548 #endif
int _MMG5_buildridmetnor(MMG5_pMesh, MMG5_pSol, int, double *, double *)
double _MMG5_caltri33_ani(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTria pt)
Definition: quality.c:47
int _MMG5_nortri(MMG5_pMesh mesh, MMG5_pTria pt, double *n)
Definition: tools.c:155
int MMG5_loadSolHeader(const char *, int, FILE **, int *, int *, int *, int *, int *, int *, int **, long *, int)
Definition: inout.c:1942
double _MMG5_orvol(MMG5_pPoint point, int *v)
Definition: tools.c:677
! MMG5_pPoint point
Definition: libmmgtypesf.h:555
! int a
Definition: libmmgtypesf.h:275
Used to hash edges (memory economy compared to MMG5_hgeom).
Definition: mmgcommon.h:395
int _MMG5_elementWeight(MMG5_pMesh, MMG5_pSol, MMG5_pTria, MMG5_pPoint, _MMG5_Bezier *, double r[3][3], double gv[2])
Definition: anisomovpt.c:53
Definition: mmgcommon.h:425
! double max[3]
Definition: libmmgtypesf.h:484
int _MMG5_hashNew(MMG5_pMesh mesh, _MMG5_Hash *hash, int hsiz, int hmax)
Definition: hash.c:321
int _MMG5_buildridmet(MMG5_pMesh, MMG5_pSol, int, double, double, double, double *)
! double * m
Definition: libmmgtypesf.h:585
int _MMG5_paratmet(double c0[3], double n0[3], double m[6], double c1[3], double n1[3], double mt[6])
Definition: mettools.c:653
int(* _MMG5_bezierCP)(MMG5_pMesh, MMG5_Tria *, _MMG5_pBezier, char)
Definition: mmgcommon.h:531
int _MMG5_interp_iso(double *ma, double *mb, double *mp, double t)
Definition: intmet.c:607
int(* _MMG5_indPt)(MMG5_pMesh mesh, int kp)
Definition: mmgcommon.h:536
int(* _MMG5_chkmsh)(MMG5_pMesh, int, int)
Definition: mmgcommon.h:530
double val
Definition: mmgcommon.h:427
! double c[3]
Definition: libmmgtypesf.h:244
void MMG5_printMetStats(MMG5_pMesh mesh, MMG5_pSol met)
Definition: inout.c:2374
int _MMG5_boulen(MMG5_pMesh, int *, int, int i, double *nn)
Definition: boulep.c:50
double _MMG5_caltri_iso(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTria ptt)
Definition: quality.c:195
int k
Definition: mmgcommon.h:426
int k
Definition: mmgcommon.h:397
Definition: libmmgtypes.h:526
! int nsols
Definition: libmmgtypesf.h:532
int _MMG5_invmat(double *m, double *mi)
Definition: tools.c:242
struct _MMG5_dNode_s * nxt
Definition: mmgcommon.h:428
void _MMG5_mmgDefaultValues(MMG5_pMesh mesh)
Definition: mmg.c:80
int siz
Definition: mmgcommon.h:407
void _MMG5_mmgInit_parameters(MMG5_pMesh mesh)
int nxt
Definition: mmgcommon.h:396
int _MMG5_Alloc_dnode(MMG5_pMesh mesh, _MMG5_dNode **node)
Definition: tools.c:555
int _MMG5_norpts(MMG5_pMesh, int, int, int, double *)
Definition: tools.c:129
Cell for linked list of integer value.
int MMG5_saveMshMesh(MMG5_pMesh, MMG5_pSol *, const char *, const int)
Definition: inout.c:1486
int MMG5_loadMshMesh_part2(MMG5_pMesh mesh, MMG5_pSol *sol, FILE **inm, const long posNodes, const long posElts, const long *posNodeData, const int bin, const int iswp, const int nelts)
Definition: inout.c:488
int _MMG5_Alloc_inode(MMG5_pMesh mesh, _MMG5_iNode **node)
Definition: tools.c:457
! int type
Definition: libmmgtypesf.h:529
int _MMG5_bouler(MMG5_pMesh, int *, int, int i, int *, int *, int *, int *, int)
Definition: boulep.c:214
double _MMG5_det3pt1vec(double c0[3], double c1[3], double c2[3], double v[3])
Definition: tools.c:646
int _MMG5_hashGet(_MMG5_Hash *hash, int a, int b)
Definition: hash.c:291
int _MMG5_sys33sym(double a[6], double b[3], double r[3])
Definition: tools.c:336
int _MMG5_hashEdge(MMG5_pMesh mesh, _MMG5_Hash *hash, int a, int b, int k)
Definition: hash.c:204
int _MMG5_Add_inode(MMG5_pMesh mesh, _MMG5_iNode **liLi, int val)
Definition: tools.c:480
int MMG5_loadMshMesh_part1(MMG5_pMesh mesh, const char *filename, FILE **inm, long *posNodes, long *posElts, long **posNodeData, int *bin, int *iswp, int *nelts, int *nsols)
Definition: inout.c:241
void _MMG5_fillDefmetregSys(int, MMG5_pPoint, int, _MMG5_Bezier, double r[3][3], double *, double *, double *, double *)
int _MMG5_writeLocalParamAtTri(MMG5_pMesh, _MMG5_iNode *, FILE *)
Definition: mmg.c:170
double _MMG5_surftri_ani(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTria ptt)
Definition: anisosiz.c:122
MMG5_pMesh MMG5_pSol * sol
Definition: API_functionsf_2d.c:63
MMG5_pMesh * mesh
Definition: API_functionsf_2d.c:63
long long _MMG5_memSize(void)
Definition: tools.c:418
double _MMG5_ridSizeInNormalDir(MMG5_pMesh, int, double *, _MMG5_pBezier, double, double)
void MMG5_readFloatSol3D(MMG5_pSol, FILE *, int, int, int)
Definition: inout.c:2080
struct _MMG5_iNode_s * nxt
Definition: mmgcommon.h:418
struct _MMG5_iNode_s _MMG5_iNode
double _MMG5_det4pt(double c0[3], double c1[3], double c2[3], double c3[3])
Definition: tools.c:658
int _MMG5_nonUnitNorPts(MMG5_pMesh, int, int, int, double *)
Definition: tools.c:73
Cell for linked list of double value.
static const unsigned char _MMG5_inxt2[6]
Definition: mmgcommon.h:373
Structure to store points of a MMG mesh.
Definition: libmmgtypes.h:205
char ddebug
Definition: libmmgtypes.h:443
void _MMG5_Set_commonFunc()
void _MMG5_mmgUsage(char *prog)
Definition: mmg.c:44
Definition: mmgcommon.h:416
! int nxt
Definition: libmmgtypesf.h:508
void _MMG5_Free_dlinkedList(MMG5_pMesh mesh, _MMG5_dNode *liLi)
Definition: tools.c:633
int _MMG5_intmetsavedir(MMG5_pMesh mesh, double *m, double *n, double *mr)
Definition: mettools.c:86
int _MMG5_rotmatrix(double n[3], double r[3][3])
Definition: tools.c:196
MMG5_Mesh * MMG5_pMesh
Definition: libmmgtypes.h:520
int _MMG5_scaleMesh(MMG5_pMesh mesh, MMG5_pSol met)
Definition: scalem.c:89
static void _MMG5_excfun(int sigid)
Definition: mmgcommon.h:307
void MMG5_readDoubleSol3D(MMG5_pSol, FILE *, int, int, int)
Definition: inout.c:2126
void MMG5_chooseOutputFormat(MMG5_pMesh mesh, int *msh)
Definition: mmg.c:194
int _MMG5_countLocalParamAtTri(MMG5_pMesh, _MMG5_iNode **)
Definition: mmg.c:125
_MMG5_hedge * item
Definition: mmgcommon.h:408
int _MMG5_interpreg_ani(MMG5_pMesh, MMG5_pSol, MMG5_pTria, char, double, double *mr)
int MMG5_chkMetricType(MMG5_pMesh mesh, int *type, FILE *inm)
Definition: inout.c:2342
void MMG5_printSolStats(MMG5_pMesh mesh, MMG5_pSol *sol)
Definition: inout.c:2392
char imprim
Definition: libmmgtypes.h:443
int mem
Definition: libmmgtypes.h:437
int _MMG5_devangle(double *n1, double *n2, double crit)
Definition: tools.c:49
! int * adja
Definition: libmmgtypesf.h:543
int MMG5_saveSolHeader(MMG5_pMesh, const char *, FILE **, int, int *, int, int, int, int *, int *)
Definition: inout.c:2230
MMG mesh structure.
Definition: libmmgtypes.h:473
int _MMG5_solveDefmetregSys(MMG5_pMesh, double r[3][3], double *, double *, double *, double *, double, double, double)
void _MMG5_printTria(MMG5_pMesh mesh, char *fileName)
Definition: tools.c:391
_MMG5_Bezier * _MMG5_pBezier
Definition: mmgcommon.h:389
! double n2[3]
Definition: libmmgtypesf.h:264
API header for the common part of the MMG libraries.
int val
Definition: mmgcommon.h:417
Identic as MMG5_HGeom but use _MMG5_hedge to store edges instead of MMG5_hgeom (memory economy)...
Definition: mmgcommon.h:406
void _MMG5_bezierEdge(MMG5_pMesh, int, int, double *, double *, char, double *)
void _MMG5_defUninitSize(MMG5_pMesh mesh, MMG5_pSol met, char ismet)
Definition: anisosiz.c:224
int _MMG5_intridmet(MMG5_pMesh, MMG5_pSol, int, int, double, double *, double *)
int _MMG5_scotchCall(MMG5_pMesh mesh, MMG5_pSol sol)
Definition: librnbg.c:192
double _MMG5_surftri33_ani(MMG5_pMesh, MMG5_pTria, double *, double *, double *)
static const unsigned char _MMG5_iprv2[3]
Definition: mmgcommon.h:374
! double hmax
Definition: libmmgtypesf.h:231
Definition: mmgcommon.h:383
void _MMG5_Free_ilinkedList(MMG5_pMesh mesh, _MMG5_iNode *liLi)
Definition: tools.c:533
int s
Definition: mmgcommon.h:398
int _MMG5_mmgHashTria(MMG5_pMesh mesh, int *adja, _MMG5_Hash *, int chkISO)
Definition: hash.c:50
void _MMG5_displayHisto(MMG5_pMesh, int, double *, int, int, double, int, int, double, int, double *, int *, char)
Definition: quality.c:248
double(* _MMG5_lenSurfEdg)(MMG5_pMesh mesh, MMG5_pSol sol, int, int, char)
Definition: mmgcommon.h:532
struct _MMG5_dNode_s _MMG5_dNode
! double n[3]
Definition: libmmgtypesf.h:245
int _MMG5_rmtr(double r[3][3], double m[6], double mr[6])
Definition: tools.c:162
! int b
Definition: libmmgtypesf.h:275
! double n1[3]
Definition: libmmgtypesf.h:264
double _MMG5_ridSizeInTangentDir(MMG5_pMesh, MMG5_pPoint, int, int *, double, double)
Definition: anisosiz.c:722
int _MMG5_minQualCheck(int iel, double minqual, double alpha)
Definition: quality.c:306
void MMG5_writeDoubleSol3D(MMG5_pMesh, MMG5_pSol, FILE *, int, int, int)
Definition: inout.c:2174
double _MMG5_nonorsurf(MMG5_pMesh mesh, MMG5_pTria pt)
Definition: tools.c:106
int _MMG5_mmgIntextmet(MMG5_pMesh, MMG5_pSol, int, double *, double *)
! int v[3]
Definition: libmmgtypesf.h:304
int _MMG5_solveDefmetrefSys(MMG5_pMesh, MMG5_pPoint, int *, double r[3][3], double *, double *, double *, double *, double, double, double)
int _MMG5_hashUpdate(_MMG5_Hash *hash, int a, int b, int k)
Definition: hash.c:258
double _MMG5_caltri_ani(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTria ptt)
Definition: quality.c:115
Definition: libmmgtypes.h:261
int _MMG5_Add_dnode(MMG5_pMesh mesh, _MMG5_dNode **liLi, int, double)
Definition: tools.c:580
int(* _MMG5_indElt)(MMG5_pMesh mesh, int kel)
Definition: mmgcommon.h:535
int _MMG5_intersecmet22(MMG5_pMesh mesh, double *m, double *n, double *mr)
Definition: mettools.c:237
int _MMG5_buildridmetfic(MMG5_pMesh, double *, double *, double, double, double, double *)
double _MMG5_surftri_iso(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTria ptt)
Definition: isosiz.c:42
int _MMG5_mmgIntmet33_ani(double *, double *, double *, double)
Definition: intmet.c:178
int _MMG5_grad2metSurf(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTria pt, int i)
Definition: anisosiz.c:904
MMG5_Info info
Definition: libmmgtypes.h:515
! double hsiz
Definition: libmmgtypesf.h:484
double MMG2_quickarea(double a[2], double b[2], double c[2])
Definition: tools.c:697
int _MMG5_invmatg(double m[9], double mi[9])
Definition: tools.c:293
int _MMG5_boulec(MMG5_pMesh, int *, int, int i, double *tt)
Definition: boulep.c:126
int _MMG5_boundingBox(MMG5_pMesh mesh)
Definition: scalem.c:45
int _MMG5_unscaleMesh(MMG5_pMesh mesh, MMG5_pSol met)
Definition: scalem.c:261