Mmg
Simplicial remeshers (mesh adaptation, isovalue discretization, lagrangian movement)
API_functions_s.c
Go to the documentation of this file.
1/* =============================================================================
2** This file is part of the mmg software package for the triangular
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
40#include "libmmgs_private.h"
41#include "libmmgs.h"
42
43int MMGS_Init_mesh(const int starter,...) {
44 va_list argptr;
45 int ier;
46
48
50
52
53 return ier;
54}
55
57 ) {
58
60 return;
61}
62
64
66}
67
69 return MMG5_Set_inputSolName(mesh,sol,solin);
70}
71
72int MMGS_Set_outputMeshName(MMG5_pMesh mesh, const char* meshout) {
73
74 return MMG5_Set_outputMeshName(mesh,meshout);
75}
76
78 return MMG5_Set_outputSolName(mesh,sol,solout);
79}
81
82 /* Init common parameters for mmgs and mmgs. */
84 /* [0/1], Turn off/on the renumbering using SCOTCH; */
85 mesh->info.renum = 0;
86
87}
88
89int MMGS_Set_solSize(MMG5_pMesh mesh, MMG5_pSol sol, int typEntity, MMG5_int np, int typSol) {
90
91 if ( ( (mesh->info.imprim > 5) || mesh->info.ddebug ) && sol->m )
92 fprintf(stderr,"\n ## Warning: %s: old solution deletion.\n",__func__);
93
94 if ( typEntity != MMG5_Vertex ) {
95 fprintf(stderr,"\n ## Error: %s: mmgs need a solution imposed on vertices.\n",
96 __func__);
97 return 0;
98 }
99
100 sol->type = typSol;
101
102 if ( typSol == MMG5_Scalar ) {
103 sol->size = 1;
104 }
105 else if ( typSol == MMG5_Vector ) {
106 sol->size = 3;
107 }
108 else if ( typSol == MMG5_Tensor ) {
109 sol->size = 6;
110 /* User will provide its own metric: classical storage at ridges */
111 mesh->info.metRidTyp = 0;
112 }
113 else {
114 fprintf(stderr,"\n ## Error: %s: type of solution not yet implemented.\n",
115 __func__);
116 return 0;
117 }
118
119 sol->dim = 3;
120
121 if ( np ) {
122 sol->np = np;
123 sol->npi = np;
124 if ( sol->m )
126
127 sol->npmax = mesh->npmax;
128 MMG5_ADD_MEM(mesh,(sol->size*(sol->npmax+1))*sizeof(double),"initial solution",
129 fprintf(stderr," Exit program.\n");
130 return 0);
131 MMG5_SAFE_CALLOC(sol->m,(sol->size*(sol->npmax+1)),double,return 0);
132 }
133 return 1;
134}
135
137 MMG5_int nentities, int *typSol) {
138 MMG5_pSol psl;
139 char data[18];
140 int j;
141
142 if ( ( (mesh->info.imprim > 5) || mesh->info.ddebug ) && mesh->nsols ) {
143 if ( *sol ) {
144 fprintf(stderr,"\n ## Warning: %s: old solutions array deletion.\n",
145 __func__);
147 }
148 }
149
151 mesh->nsols = nsols;
152
153 MMG5_ADD_MEM(mesh,nsols*sizeof(MMG5_Sol),"solutions array",
154 return 0);
155 MMG5_SAFE_CALLOC(*sol,nsols,MMG5_Sol,return 0);
156
157 for ( j=0; j<nsols; ++j ) {
158 psl = *sol + j;
159 psl->ver = 2;
160
161 /* Give an arbitrary name to the solution */
162 sprintf(data,"sol_%d",j);
163 if ( !MMGS_Set_inputSolName(mesh,psl,data) ) {
164 return 0;
165 }
166 /* Give an arbitrary name to the solution */
167 sprintf(data,"sol_%d.o",j);
168 if ( !MMGS_Set_outputSolName(mesh,psl,data) ) {
169 return 0;
170 }
171
172 if ( !MMGS_Set_solSize(mesh,psl,MMG5_Vertex,mesh->np,typSol[j]) ) {
173 fprintf(stderr,"\n ## Error: %s: unable to set the size of the"
174 " solution num %d.\n",__func__,j);
175 return 0;
176 }
177 }
178 return 1;
179}
180
181int MMGS_Set_meshSize(MMG5_pMesh mesh, MMG5_int np, MMG5_int nt, MMG5_int na) {
182
183 if ( ( (mesh->info.imprim > 5) || mesh->info.ddebug ) &&
184 ( mesh->point || mesh->tria || mesh->edge) )
185 fprintf(stderr,"\n ## Warning: %s: old mesh deletion.\n",__func__);
186
187 mesh->np = np;
188 mesh->nt = nt;
189 mesh->na = na;
190 mesh->npi = mesh->np;
191 mesh->nti = mesh->nt;
192 mesh->nai = mesh->na;
193
194 if ( !np || !nt ) {
195 fprintf(stderr," ** MISSING DATA:\n");
196 fprintf(stderr," Your mesh must contains at least points and triangles.\n");
197 return 0;
198 }
199
200 if ( mesh->point )
202 if ( mesh->tria )
204 if ( mesh->edge )
206
207 /*tester si -m defini : renvoie 0 si pas ok et met la taille min dans info.mem */
208 if( mesh->info.mem > 0) {
209 if ( mesh->npmax < mesh->np || mesh->ntmax < mesh->nt) {
210 if ( !MMGS_memOption(mesh) ) return 0;
211 } else if(mesh->info.mem < 39) {
212 fprintf(stderr,"\n ## Error: %s: not enough memory %d\n",
213 __func__,mesh->info.mem);
214 return 0;
215 }
216 } else {
217 if ( !MMGS_memOption(mesh) ) return 0;
218 }
219
220 /* Mesh allocation and linkage */
221 if ( !MMGS_setMeshSize_alloc( mesh ) ) return 0;
222
223 return 1;
224}
225
226int MMGS_Get_solSize(MMG5_pMesh mesh, MMG5_pSol sol, int* typEntity, MMG5_int* np, int* typSol) {
227
228 if ( typEntity != NULL )
229 *typEntity = MMG5_Vertex;
230
231 if ( typSol != NULL ) {
232 if ( sol->size == 1 )
233 *typSol = MMG5_Scalar;
234 else if ( sol->size == 3 )
235 *typSol = MMG5_Vector;
236 else if ( sol->size == 6 )
237 *typSol = MMG5_Tensor;
238 else
239 *typSol = MMG5_Notype;
240 }
241
242 assert( (!sol->np) || (sol->np == mesh->np));
243
244 if ( np != NULL )
245 *np = sol->np;
246
247 sol->npi = 0;
248
249 return 1;
250}
251
253 MMG5_int* np, int* typSol) {
254 MMG5_pSol psl;
255 int j;
256
257 if ( !mesh ) {
258 fprintf(stderr,"\n ## Error: %s: your mesh structure must be allocated"
259 " and filled\n",__func__);
260 return 0;
261 }
262
263 if ( nsols != NULL )
264 *nsols = mesh->nsols;
265
266 for ( j=0; j<mesh->nsols; ++j ) {
267 psl = *sol + j;
268
269 if ( typSol != NULL ) {
270 typSol[j] = psl->type;
271 }
272
273 assert( (!psl->np) || (psl->np == mesh->np));
274 }
275 if ( np != NULL )
276 *np = mesh->np;
277
278 return 1;
279}
280
281int MMGS_Get_meshSize(MMG5_pMesh mesh, MMG5_int* np, MMG5_int* nt, MMG5_int* na) {
282
283 if ( np != NULL )
284 *np = mesh->np;
285 if ( nt != NULL )
286 *nt = mesh->nt;
287 if ( na != NULL )
288 *na = mesh->na;
289
290 return 1;
291}
292
293int MMGS_Set_vertex(MMG5_pMesh mesh, double c0, double c1, double c2, MMG5_int ref, MMG5_int pos) {
294
295 if ( !mesh->np ) {
296 fprintf(stderr,"\n ## Error: %s: you must set the number of points with the",
297 __func__);
298 fprintf(stderr," MMGS_Set_meshSize function before setting vertices in mesh.\n");
299 return 0;
300 }
301
302 if ( pos > mesh->npmax ) {
303 fprintf(stderr,"\n ## Error: %s: unable to allocate a new point.\n",__func__);
304 fprintf(stderr," max number of points: %" MMG5_PRId "\n",mesh->npmax);
306 return 0;
307 }
308
309 if ( pos > mesh->np ) {
310 fprintf(stderr,"\n ## Error: %s: attempt to set new vertex at position %" MMG5_PRId ".",
311 __func__,pos);
312 fprintf(stderr," Overflow of the given number of vertices: %" MMG5_PRId "\n",mesh->np);
313 fprintf(stderr,"\n ## Check the mesh size, its compactness or the position");
314 fprintf(stderr," of the vertex.\n");
315 return 0;
316 }
317
318 mesh->point[pos].c[0] = c0;
319 mesh->point[pos].c[1] = c1;
320 mesh->point[pos].c[2] = c2;
321 mesh->point[pos].ref = ref;
322 mesh->point[pos].tag = MG_NUL;
323 mesh->point[pos].flag = 0;
324 mesh->point[pos].tmp = 0;
325
326 return 1;
327}
328
329int MMGS_Set_vertices(MMG5_pMesh mesh, double *vertices,MMG5_int *refs) {
330
331 MMG5_pPoint ppt;
332 MMG5_int i,j;
333
334 /*coordinates vertices*/
335 for (i=1;i<=mesh->np;i++)
336 {
337 ppt = &mesh->point[i];
338
339 j = (i-1)*3;
340 ppt->c[0] = vertices[j];
341 ppt->c[1] = vertices[j+1];
342 ppt->c[2] = vertices[j+2];
343
344 ppt->tag = MG_NUL;
345 ppt->flag = 0;
346 ppt->tmp = 0;
347
348 if ( refs != NULL )
349 ppt->ref = refs[i-1];
350 }
351
352 return 1;
353}
354
355
356int MMGS_Get_vertex(MMG5_pMesh mesh, double* c0, double* c1, double* c2, MMG5_int* ref,
357 int* isCorner, int* isRequired) {
358
359 if ( mesh->npi == mesh->np ) {
360 mesh->npi = 0;
361 if ( mesh->info.ddebug ) {
362 fprintf(stderr,"\n ## Warning: %s: reset the internal counter of points.\n",
363 __func__);
364 fprintf(stderr," You must pass here exactly one time (the first time ");
365 fprintf(stderr,"you call the MMGS_Get_vertex function).\n");
366 fprintf(stderr," If not, the number of call of this function");
367 fprintf(stderr," exceed the number of points: %" MMG5_PRId "\n ",mesh->np);
368 }
369 }
370
371 mesh->npi++;
372
373 if ( mesh->npi > mesh->np ) {
374 fprintf(stderr,"\n ## Error: %s: unable to get point.\n",__func__);
375 fprintf(stderr," The number of call of MMGS_Get_vertex function");
376 fprintf(stderr," can not exceed the number of points: %" MMG5_PRId "\n ",mesh->np);
377 return 0;
378 }
379
380 return MMGS_GetByIdx_vertex( mesh,c0,c1,c2,ref,isCorner,isRequired,mesh->npi);
381}
382
383int MMGS_GetByIdx_vertex(MMG5_pMesh mesh, double* c0, double* c1, double* c2, MMG5_int* ref,
384 int* isCorner, int* isRequired, MMG5_int idx) {
385
386 if ( idx < 1 || idx > mesh->np ) {
387 fprintf(stderr,"\n ## Error: %s: unable to get point at position %" MMG5_PRId ".\n",
388 __func__,idx);
389 fprintf(stderr," Your vertices numbering goes from 1 to %" MMG5_PRId "\n",mesh->np);
390 return 0;
391 }
392
393 *c0 = mesh->point[idx].c[0];
394 *c1 = mesh->point[idx].c[1];
395 *c2 = mesh->point[idx].c[2];
396 if ( ref != NULL )
397 *ref = mesh->point[idx].ref;
398
399 if ( isCorner != NULL ) {
400 if ( mesh->point[idx].tag & MG_CRN )
401 *isCorner = 1;
402 else
403 *isCorner = 0;
404 }
405
406 if ( isRequired != NULL ) {
407 if ( mesh->point[idx].tag & MG_REQ )
408 *isRequired = 1;
409 else
410 *isRequired = 0;
411 }
412
413 return 1;
414}
415
416int MMGS_Get_vertices(MMG5_pMesh mesh, double* vertices, MMG5_int* refs,
417 int* areCorners, int* areRequired) {
418 MMG5_pPoint ppt;
419 MMG5_int i,j;
420
421 for (i=1;i<=mesh->np;i++)
422 {
423 ppt = &mesh->point[i];
424
425 j = (i-1)*3;
426 vertices[j] = ppt->c[0];
427 vertices[j+1] = ppt->c[1];
428 vertices[j+2] = ppt->c[2];
429
430 j = i-1;
431 if ( refs != NULL )
432 refs[j] = ppt->ref;
433
434 if ( areCorners !=NULL ) {
435 if ( ppt->tag & MG_CRN )
436 areCorners[j] = 1;
437 else
438 areCorners[j] = 0;
439 }
440
441 if ( areRequired != NULL ) {
442 if ( ppt->tag & MG_REQ )
443 areRequired[j] = 1;
444 else
445 areRequired[j] = 0;
446 }
447 }
448
449 return 1;
450}
451
452int MMGS_Set_triangle(MMG5_pMesh mesh, MMG5_int v0, MMG5_int v1, MMG5_int v2, MMG5_int ref,MMG5_int pos) {
453
454 if ( !mesh->nt ) {
455 fprintf(stderr,"\n ## Error: %s: You must set the number of triangles"
456 " with the",__func__);
457 fprintf(stderr," MMGS_Set_meshSize function before setting triangles in mesh\n");
458 return 0;
459 }
460
461 if ( pos > mesh->ntmax ) {
462 fprintf(stderr,"\n ## Error: %s: unable to allocate a new triangle.\n",
463 __func__);
464 fprintf(stderr," max number of triangle: %" MMG5_PRId "\n",mesh->ntmax);
466 return 0;
467 }
468
469 if ( pos > mesh->nt ) {
470 fprintf(stderr,"\n ## Error: %s: attempt to set new triangle at position %" MMG5_PRId ".",
471 __func__,pos);
472 fprintf(stderr," Overflow of the given number of triangles: %" MMG5_PRId "\n",mesh->nt);
473 fprintf(stderr,"\n ## Check the mesh size, its compactness or the position");
474 fprintf(stderr," of the triangle.\n");
475 return 0;
476 }
477
478 mesh->tria[pos].v[0] = v0;
479 mesh->tria[pos].v[1] = v1;
480 mesh->tria[pos].v[2] = v2;
481 mesh->tria[pos].ref = ref;
482
483 mesh->point[v0].tag &= ~MG_NUL;
484 mesh->point[v1].tag &= ~MG_NUL;
485 mesh->point[v2].tag &= ~MG_NUL;
486
487 return 1;
488}
489
490int MMGS_Get_triangle(MMG5_pMesh mesh, MMG5_int* v0, MMG5_int* v1, MMG5_int* v2, MMG5_int* ref
491 ,int* isRequired) {
492 MMG5_pTria ptt;
493
494 if ( mesh->nti == mesh->nt ) {
495 mesh->nti = 0;
496 if ( mesh->info.ddebug ) {
497 fprintf(stderr,"\n ## Warning: %s: reset the internal counter of triangles.\n",
498 __func__);
499 fprintf(stderr," You must pass here exactly one time (the first time ");
500 fprintf(stderr,"you call the MMGS_Get_triangle function).\n");
501 fprintf(stderr," If not, the number of call of this function");
502 fprintf(stderr," exceed the number of triangles: %" MMG5_PRId "\n ",mesh->nt);
503 }
504 }
505
506 mesh->nti++;
507
508 if ( mesh->nti > mesh->nt ) {
509 fprintf(stderr,"\n ## Error: %s: unable to get triangle.\n",__func__);
510 fprintf(stderr," The number of call of MMGS_Get_triangle function");
511 fprintf(stderr," can not exceed the number of triangles: %" MMG5_PRId "\n ",mesh->nt);
512 return 0;
513 }
514
515 ptt = &mesh->tria[mesh->nti];
516 *v0 = ptt->v[0];
517 *v1 = ptt->v[1];
518 *v2 = ptt->v[2];
519 if ( ref != NULL )
520 *ref = ptt->ref;
521
522 if ( isRequired != NULL ) {
523 if ( (ptt->tag[0] & MG_REQ) && (ptt->tag[1] & MG_REQ) &&
524 (ptt->tag[2] & MG_REQ) )
525 *isRequired = 1;
526 else
527 *isRequired = 0;
528 }
529
530 return 1;
531}
532
533int MMGS_Set_triangles(MMG5_pMesh mesh, MMG5_int *tria, MMG5_int *refs) {
534 MMG5_pTria ptt;
535 MMG5_int i, j;
536
537 for (i=1;i<=mesh->nt;i++)
538 {
539 j = (i-1)*3;
540 ptt = &mesh->tria[i];
541 ptt->v[0] = tria[j] ;
542 ptt->v[1] = tria[j+2];
543 ptt->v[2] = tria[j+1];
544
545 mesh->point[ptt->v[0]].tag &= ~MG_NUL;
546 mesh->point[ptt->v[1]].tag &= ~MG_NUL;
547 mesh->point[ptt->v[2]].tag &= ~MG_NUL;
548
549 if ( refs != NULL )
550 ptt->ref = refs[i-1];
551 }
552 return 1;
553}
554
555int MMGS_Get_triangles(MMG5_pMesh mesh, MMG5_int *tria, MMG5_int *refs, int *areRequired) {
556 MMG5_pTria ptt;
557 MMG5_int i, j;
558
559 for (i=1;i<=mesh->nt;i++)
560 {
561 j = (i-1)*3;
562 ptt = &mesh->tria[i];
563 tria[j] = ptt->v[0];
564 tria[j+1] = ptt->v[1];
565 tria[j+2] = ptt->v[2];
566
567 if ( refs!=NULL )
568 refs[i-1] = ptt->ref ;
569 if ( areRequired != NULL ) {
570 if ( (ptt->tag[0] & MG_REQ) && (ptt->tag[1] & MG_REQ) &&
571 (ptt->tag[2] & MG_REQ) )
572 areRequired[i-1] = 1;
573 else
574 areRequired[i-1] = 0;
575 }
576 }
577 return 1;
578}
579
580
581int MMGS_Set_edge(MMG5_pMesh mesh, MMG5_int v0, MMG5_int v1, MMG5_int ref, MMG5_int pos) {
582
583 if ( !mesh->na ) {
584 fprintf(stderr,"\n ## Error: %s: You must set the number of edges with the",
585 __func__);
586 fprintf(stderr," MMGS_Set_meshSize function before setting edges in mesh\n");
587 return 0;
588 }
589 if ( pos > mesh->namax ) {
590 fprintf(stderr,"\n ## Error: %s: unable to allocate a new edge.\n",
591 __func__);
592 fprintf(stderr," max number of edge: %" MMG5_PRId "\n",mesh->namax);
594 return 0;
595 }
596 if ( pos > mesh->na ) {
597 fprintf(stderr,"\n ## Error: %s: attempt to set new edge at position %" MMG5_PRId ".",
598 __func__,pos);
599 fprintf(stderr," Overflow of the given number of edges: %" MMG5_PRId "\n",mesh->na);
600 fprintf(stderr,"\n ## Check the mesh size, its compactness or the position");
601 fprintf(stderr," of the edge.\n");
602 return 0;
603 }
604
605 mesh->edge[pos].a = v0;
606 mesh->edge[pos].b = v1;
607 mesh->edge[pos].ref = ref;
608 mesh->edge[pos].tag |= MG_REF;
609
610 return 1;
611}
612
613int MMGS_Get_edge(MMG5_pMesh mesh, MMG5_int* e0, MMG5_int* e1, MMG5_int* ref
614 ,int* isRidge, int* isRequired) {
615
616 if ( mesh->nai == mesh->na ) {
617 mesh->nai = 0;
618 if ( mesh->info.ddebug ) {
619 fprintf(stderr,"\n ## Warning: %s: reset the internal counter of edges.\n",
620 __func__);
621 fprintf(stderr," You must pass here exactly one time (the first time ");
622 fprintf(stderr,"you call the MMGS_Get_edge function).\n");
623 fprintf(stderr," If not, the number of call of this function");
624 fprintf(stderr," exceed the number of edges: %" MMG5_PRId "\n ",mesh->na);
625 }
626 }
627
628 mesh->nai++;
629
630 if ( mesh->nai > mesh->na ) {
631 fprintf(stderr,"\n ## Error: %s: unable to get edge.\n",__func__);
632 fprintf(stderr," The number of call of MMGS_Get_edge function");
633 fprintf(stderr," can not exceed the number of edges: %" MMG5_PRId "\n ",mesh->na);
634 return 0;
635 }
636
637 *e0 = mesh->edge[mesh->nai].a;
638 *e1 = mesh->edge[mesh->nai].b;
639 if ( ref!=NULL )
640 *ref = mesh->edge[mesh->nai].ref;
641
642 if ( isRidge != NULL ) {
643 if ( mesh->edge[mesh->nai].tag & MG_GEO )
644 *isRidge = 1;
645 else
646 *isRidge = 0;
647 }
648
649 if ( isRequired != NULL ) {
650 if ( mesh->edge[mesh->nai].tag & MG_REQ )
651 *isRequired = 1;
652 else
653 *isRequired = 0;
654 }
655
656 return 1;
657}
658
659int MMGS_Set_edges(MMG5_pMesh mesh, MMG5_int *edges, MMG5_int *refs) {
660 MMG5_int i,j;
661
662 for (i=1;i<=mesh->na;i++)
663 {
664 j = (i-1)*2;
665
666 mesh->edge[i].a = edges[j];
667 mesh->edge[i].b = edges[j+1];
668 if ( refs != NULL )
669 mesh->edge[i].ref = refs[i];
670 mesh->edge[i].tag |= MG_REF;
671 }
672
673 return 1;
674}
675
676int MMGS_Get_edges(MMG5_pMesh mesh, MMG5_int* edges,MMG5_int *refs,int* areRidges,int* areRequired) {
677 MMG5_int i,j;
678
679 for (i=1;i<=mesh->na;i++)
680 {
681 j = (i-1)*2;
682 edges[j] = mesh->edge[i].a;
683 edges[j+1] = mesh->edge[i].b;
684
685 if ( refs!=NULL )
686 refs[i-1] = mesh->edge[i].ref;
687
688 if ( areRidges != NULL ) {
689 if ( mesh->edge[i].tag & MG_GEO )
690 areRidges[i-1] = 1;
691 else
692 areRidges[i-1] = 0;
693 }
694
695 if ( areRequired != NULL ) {
696 if ( mesh->edge[i].tag & MG_REQ )
697 areRequired[i-1] = 1;
698 else
699 areRequired[i-1] = 0;
700 }
701 }
702
703 return 1;
704}
705
707 assert ( k <= mesh->np );
708 mesh->point[k].tag |= MG_CRN;
709 return 1;
710}
711
713 assert ( k <= mesh->np );
714 mesh->point[k].tag &= ~MG_CRN;
715 return 1;
716}
717
719 assert ( k <= mesh->np );
720 mesh->point[k].tag |= MG_REQ;
721 mesh->point[k].tag &= ~MG_NUL;
722 return 1;
723}
724
726 assert ( k <= mesh->np );
727 mesh->point[k].tag &= ~MG_REQ;
728 return 1;
729}
730
732 assert ( k <= mesh->nt );
733 mesh->tria[k].tag[0] |= MG_REQ;
734 mesh->tria[k].tag[1] |= MG_REQ;
735 mesh->tria[k].tag[2] |= MG_REQ;
736 return 1;
737}
738
740 assert ( k <= mesh->nt );
741 mesh->tria[k].tag[0] &= ~MG_REQ;
742 mesh->tria[k].tag[1] &= ~MG_REQ;
743 mesh->tria[k].tag[2] &= ~MG_REQ;
744 return 1;
745}
746
748 assert ( k <= mesh->na );
749 mesh->edge[k].tag |= MG_GEO;
750 return 1;
751}
753 assert ( k <= mesh->na );
754 mesh->edge[k].tag &= ~MG_GEO;
755 return 1;
756}
757
759 assert ( k <= mesh->na );
760 mesh->edge[k].tag |= MG_REQ;
761 return 1;
762}
763
765 assert ( k <= mesh->na );
766 mesh->edge[k].tag &= ~MG_REQ;
767 return 1;
768}
769
770int MMGS_Set_normalAtVertex(MMG5_pMesh mesh, MMG5_int k, double n0, double n1, double n2) {
771
772 assert ( k <= mesh->np );
773 mesh->point[k].n[0] = n0;
774 mesh->point[k].n[1] = n1;
775 mesh->point[k].n[2] = n2;
776
777 ++mesh->nc1;
778
779 return 1;
780}
781
782int MMGS_Get_normalAtVertex(MMG5_pMesh mesh, MMG5_int k, double *n0, double *n1, double *n2) {
783
784 assert ( k <= mesh->np );
785 (*n0) = mesh->point[k].n[0];
786 (*n1) = mesh->point[k].n[1];
787 (*n2) = mesh->point[k].n[2];
788
789 return 1;
790}
791
793 double qual = 0.;
794 MMG5_pTria pt;
795
796 if ( k < 1 || k > mesh->nt ) {
797 fprintf(stderr,"\n ## Error: %s: unable to access to triangle %" MMG5_PRId ".\n",
798 __func__,k);
799 fprintf(stderr," Tria numbering goes from 1 to %" MMG5_PRId "\n",mesh->nt);
800 return 0.;
801 }
802 pt = &mesh->tria[k];
803 assert ( MG_EOK(pt) );
804
805 if ( (!met) || (!met->m) || met->size==1 ) {
806 /* iso quality */
807 qual = MMGS_ALPHAD * MMG5_caltri_iso(mesh,met,pt);
808 }
809 else if ( !mesh->info.metRidTyp ) {
810 qual = MMGS_ALPHAD * MMG5_caltri33_ani(mesh,met,pt);
811 }
812 else {
813 qual = MMGS_ALPHAD * MMG5_caltri_ani(mesh,met,pt);
814 }
815
816 return qual;
817}
818
819int MMGS_Set_scalarSol(MMG5_pSol met, double s, MMG5_int pos) {
820
821 if ( !met->np ) {
822 fprintf(stderr,"\n ## Error: %s: You must set the number of solution"
823 " with the",__func__);
824 fprintf(stderr," MMGS_Set_solSize function before setting values");
825 fprintf(stderr," in solution structure \n");
826 return 0;
827 }
828 if ( pos < 1 ) {
829 fprintf(stderr,"\n ## Error: %s: unable to set a new solution.\n",
830 __func__);
831 fprintf(stderr," Minimal index of the solution position must be 1.\n");
832 return 0;
833 }
834 if ( pos >= met->npmax ) {
835 fprintf(stderr,"\n ## Error: %s: unable to set a new solution.\n",
836 __func__);
837 fprintf(stderr," max number of solutions: %" MMG5_PRId "\n",met->npmax);
838 return 0;
839 }
840
841 if ( pos > met->np ) {
842 fprintf(stderr,"\n ## Error: %s: attempt to set new solution at"
843 " position %" MMG5_PRId ".",__func__,pos);
844 fprintf(stderr," Overflow of the given number of solutions: %" MMG5_PRId "\n",met->np);
845 fprintf(stderr,"\n ## Check the solution size, its compactness or the position");
846 fprintf(stderr," of the solution.\n");
847 return 0;
848 }
849
850 met->m[pos] = s;
851 return 1;
852}
853
854int MMGS_Get_scalarSol(MMG5_pSol met, double* s) {
855 int ddebug = 0;
856
857 if ( met->npi == met->np ) {
858 met->npi = 0;
859 if ( ddebug ) {
860 fprintf(stderr,"\n ## Warning: %s: reset the internal counter of points.\n",
861 __func__);
862 fprintf(stderr," You must pass here exactly one time (the first time ");
863 fprintf(stderr,"you call the MMGS_Get_scalarSol function).\n");
864 fprintf(stderr," If not, the number of call of this function");
865 fprintf(stderr," exceed the number of points: %" MMG5_PRId "\n ",met->np);
866 }
867 }
868
869 met->npi++;
870
871 if ( met->npi > met->np ) {
872 fprintf(stderr,"\n ## Error: %s: unable to get solution.\n",__func__);
873 fprintf(stderr," The number of call of MMGS_Get_scalarSol function");
874 fprintf(stderr," can not exceed the number of points: %" MMG5_PRId "\n ",met->np);
875 return 0;
876 }
877
878 *s = met->m[met->npi];
879
880 return 1;
881}
882
883int MMGS_Set_scalarSols(MMG5_pSol met, double *s ) {
884 MMG5_int k;
885
886 if ( !met->np ) {
887 fprintf(stderr,"\n ## Error: %s: You must set the number of solution"
888 " with the",__func__);
889 fprintf(stderr," MMGS_Set_solSize function before setting values");
890 fprintf(stderr," in solution structure \n");
891 return 0;
892 }
893
894 for ( k=0; k<met->np; ++k )
895 met->m[k+1] = s[k];
896
897 return 1;
898}
899
900int MMGS_Get_scalarSols(MMG5_pSol met, double* s) {
901 MMG5_int k;
902
903 for ( k=0; k<met->np; ++k )
904 s[k] = met->m[k+1];
905
906 return 1;
907}
908
909
910int MMGS_Set_vectorSol(MMG5_pSol met, double vx,double vy, double vz, MMG5_int pos) {
911
912 if ( !met->np ) {
913 fprintf(stderr,"\n ## Error: %s: You must set the number of"
914 " solution with the",__func__);
915 fprintf(stderr," MMGS_Set_solSize function before setting values");
916 fprintf(stderr," in solution structure \n");
917 return 0;
918 }
919 if ( pos < 1 ) {
920 fprintf(stderr,"\n ## Error: %s: unable to set a new solution.\n",
921 __func__);
922 fprintf(stderr," Minimal index of the solution position must be 1.\n");
923 return 0;
924 }
925 if ( pos >= met->npmax ) {
926 fprintf(stderr,"\n ## Error: %s: unable to set a new solution.\n",
927 __func__);
928 fprintf(stderr," max number of solutions: %" MMG5_PRId "\n",met->npmax);
929 return 0;
930 }
931
932 if ( pos > met->np ) {
933 fprintf(stderr,"\n ## Error: %s: attempt to set new solution at position %" MMG5_PRId ".",
934 __func__,pos);
935 fprintf(stderr," Overflow of the given number of solutions: %" MMG5_PRId "\n",met->np);
936 fprintf(stderr,"\n ## Check the solution size, its compactness or the position");
937 fprintf(stderr," of the solution.\n");
938 return 0;
939 }
940
941 met->m[3*pos] = vx;
942 met->m[3*pos+1] = vy;
943 met->m[3*pos+2] = vz;
944
945 return 1;
946}
947
948int MMGS_Get_vectorSol(MMG5_pSol met, double* vx, double* vy, double* vz) {
949 int ddebug = 0;
950
951 if ( met->npi == met->np ) {
952 met->npi = 0;
953 if ( ddebug ) {
954 fprintf(stderr,"\n ## Warning: %s: reset the internal counter of points.\n",
955 __func__);
956 fprintf(stderr," You must pass here exactly one time (the first time ");
957 fprintf(stderr,"you call the MMGS_Get_vectorSol function).\n");
958 fprintf(stderr," If not, the number of call of this function");
959 fprintf(stderr," exceed the number of points: %" MMG5_PRId "\n ",met->np);
960 }
961 }
962
963 met->npi++;
964
965 if ( met->npi > met->np ) {
966 fprintf(stderr,"\n ## Error: %s: unable to get solution.\n",__func__);
967 fprintf(stderr," The number of call of MMGS_Get_vectorSol function");
968 fprintf(stderr," can not exceed the number of points: %" MMG5_PRId "\n ",met->np);
969 return 0;
970 }
971
972 *vx = met->m[3*met->npi];
973 *vy = met->m[3*met->npi+1];
974 *vz = met->m[3*met->npi+2];
975
976 return 1;
977}
978
979
980int MMGS_Set_vectorSols(MMG5_pSol met, double *sols) {
981 double *m;
982 MMG5_int k,j;
983
984 if ( !met->np ) {
985 fprintf(stderr,"\n ## Error: %s: You must set the number of"
986 " solution with the",__func__);
987 fprintf(stderr," MMGS_Set_solSize function before setting values");
988 fprintf(stderr," in solution structure \n");
989 return 0;
990 }
991
992 for ( k=0; k<met->np; ++k ) {
993 j = 3*k;
994 m = &met->m[j+3];
995 m[0] = sols[j];
996 m[1] = sols[j+1];
997 m[2] = sols[j+2];
998 }
999
1000 return 1;
1001}
1002
1003int MMGS_Get_vectorSols(MMG5_pSol met, double* sols) {
1004 double *m;
1005 MMG5_int k, j;
1006
1007 for ( k=0; k<met->np; ++k ) {
1008 j = 3*k;
1009 m = &met->m[j+3];
1010 sols[j] = m[0];
1011 sols[j+1] = m[1];
1012 sols[j+2] = m[2];
1013 }
1014
1015 return 1;
1016}
1017
1018int MMGS_Set_tensorSol(MMG5_pSol met, double m11,double m12, double m13,
1019 double m22,double m23, double m33, MMG5_int pos) {
1020
1021 if ( !met->np ) {
1022 fprintf(stderr,"\n ## Error: %s: You must set the number of"
1023 " solution with the",__func__);
1024 fprintf(stderr," MMGS_Set_solSize function before setting values");
1025 fprintf(stderr," in solution structure \n");
1026 return 0;
1027 }
1028 if ( pos < 1 ) {
1029 fprintf(stderr,"\n ## Error: %s: unable to set a new solution.\n",
1030 __func__);
1031 fprintf(stderr," Minimal index of the solution position must be 1.\n");
1032 return 0;
1033 }
1034 if ( pos >= met->npmax ) {
1035 fprintf(stderr,"\n ## Error: %s: unable to set a new solution.\n",
1036 __func__);
1037 fprintf(stderr," max number of solutions: %" MMG5_PRId "\n",met->npmax);
1038 return 0;
1039 }
1040
1041 if ( pos > met->np ) {
1042 fprintf(stderr,"\n ## Error: %s: attempt to set new solution"
1043 " at position %" MMG5_PRId ".",__func__,pos);
1044 fprintf(stderr," Overflow of the given number of solutions: %" MMG5_PRId "\n",met->np);
1045 fprintf(stderr,"\n ## Check the solution size, its compactness or the position");
1046 fprintf(stderr," of the solution.\n");
1047 return 0;
1048 }
1049
1050 met->m[6*pos] = m11;
1051 met->m[6*pos+1] = m12;
1052 met->m[6*pos+2] = m13;
1053 met->m[6*pos+3] = m22;
1054 met->m[6*pos+4] = m23;
1055 met->m[6*pos+5] = m33;
1056
1057 return 1;
1058}
1059
1060int MMGS_Get_tensorSol(MMG5_pSol met, double *m11,double *m12, double *m13,
1061 double *m22,double *m23, double *m33) {
1062
1063 int ddebug = 0;
1064
1065 if ( met->npi == met->np ) {
1066 met->npi = 0;
1067 if ( ddebug ) {
1068 fprintf(stderr,"\n ## Warning: %s: reset the internal counter of"
1069 " points.\n",__func__);
1070 fprintf(stderr," You must pass here exactly one time (the first time ");
1071 fprintf(stderr,"you call the MMGS_Get_tensorSol function).\n");
1072 fprintf(stderr," If not, the number of call of this function");
1073 fprintf(stderr," exceed the number of points: %" MMG5_PRId "\n ",met->np);
1074 }
1075 }
1076
1077 met->npi++;
1078
1079 if ( met->npi > met->np ) {
1080 fprintf(stderr,"\n ## Error: %s: unable to get solution.\n",__func__);
1081 fprintf(stderr," The number of call of MMGS_Get_tensorSol function");
1082 fprintf(stderr," can not exceed the number of points: %" MMG5_PRId "\n ",met->np);
1083 return 0;
1084 }
1085
1086 *m11 = met->m[6*met->npi];
1087 *m12 = met->m[6*met->npi+1];
1088 *m13 = met->m[6*met->npi+2];
1089 *m22 = met->m[6*met->npi+3];
1090 *m23 = met->m[6*met->npi+4];
1091 *m33 = met->m[6*met->npi+5];
1092
1093 return 1;
1094}
1095
1096
1097int MMGS_Set_tensorSols(MMG5_pSol met, double *sols) {
1098 double *m;
1099 MMG5_int k,j;
1100
1101 if ( !met->np ) {
1102 fprintf(stderr,"\n ## Error: %s: You must set the number"
1103 " of solution with the",__func__);
1104 fprintf(stderr," MMGS_Set_solSize function before setting values");
1105 fprintf(stderr," in solution structure \n");
1106 return 0;
1107 }
1108
1109 for ( k=0; k<met->np; ++k ) {
1110 j = 6*k;
1111 m = &met->m[j+6];
1112
1113 m[0] = sols[j];
1114 m[1] = sols[j+1];
1115 m[2] = sols[j+2];
1116 m[3] = sols[j+3];
1117 m[4] = sols[j+4];
1118 m[5] = sols[j+5];
1119 }
1120 return 1;
1121}
1122
1123int MMGS_Get_tensorSols(MMG5_pSol met, double *sols) {
1124 double *m;
1125 MMG5_int k,j;
1126
1127 for ( k=0; k<met->np; ++k ) {
1128 j = 6*k;
1129 m = &met->m[j+6];
1130
1131 sols[j] = m[0];
1132 sols[j+1] = m[1];
1133 sols[j+2] = m[2];
1134 sols[j+3] = m[3];
1135 sols[j+4] = m[4];
1136 sols[j+5] = m[5];
1137 }
1138
1139 return 1;
1140}
1141
1142int MMGS_Set_ithSol_inSolsAtVertices(MMG5_pSol sol,int i, double* s,MMG5_int pos) {
1143 MMG5_pSol psl;
1144
1145 /* Warning: users give indices from 1 to nsols */
1146 psl = sol + (i-1);
1147
1148 switch ( psl->type ) {
1149 case MMG5_Scalar:
1150 return MMGS_Set_scalarSol(psl,s[0],pos);
1151 break;
1152
1153 case MMG5_Vector:
1154 MMGS_Set_vectorSol(psl,s[0],s[1],s[2],pos);
1155 break;
1156
1157 case MMG5_Tensor:
1158 MMGS_Set_tensorSol(psl,s[0],s[1],s[2],s[3],s[4],s[5],pos);
1159 break;
1160
1161 default:
1162 fprintf(stderr,"\n ## Error: %s: unexpected type of solution: %s.\n",
1163 __func__,MMG5_Get_typeName(psl->type));
1164 return 0;
1165 }
1166 return 1;
1167}
1168
1169int MMGS_Get_ithSol_inSolsAtVertices(MMG5_pSol sol,int i, double *s,MMG5_int pos) {
1170 MMG5_pSol psl;
1171
1172 /* Warning: users give indices from 1 to nsols */
1173 psl = sol + (i-1);
1174
1175 psl->npi = pos-1;
1176
1177 switch ( psl->type ) {
1178 case MMG5_Scalar:
1179 return MMGS_Get_scalarSol(psl,&s[0]);
1180 break;
1181
1182 case MMG5_Vector:
1183 MMGS_Get_vectorSol(psl,&s[0],&s[1],&s[2]);
1184 break;
1185
1186 case MMG5_Tensor:
1187 MMGS_Get_tensorSol(psl,&s[0],&s[1],&s[2],&s[3],&s[4],&s[5]);
1188 break;
1189
1190 default:
1191 fprintf(stderr,"\n ## Error: %s: unexpected type of solution: %s\n",
1192 __func__,MMG5_Get_typeName(psl->type));
1193 return 0;
1194 }
1195
1196 return 1;
1197}
1198
1200 MMG5_pSol psl;
1201
1202 /* Warning: users give indices from 1 to nsols */
1203 psl = sol + (i-1);
1204
1205 switch ( psl->type ) {
1206 case MMG5_Scalar:
1207 return MMGS_Set_scalarSols(psl,s);
1208 break;
1209
1210 case MMG5_Vector:
1211 MMGS_Set_vectorSols(psl,s);
1212 break;
1213
1214 case MMG5_Tensor:
1215 MMGS_Set_tensorSols(psl,s);
1216 break;
1217
1218 default:
1219 fprintf(stderr,"\n ## Error: %s: unexpected type of solution: %s.\n",
1220 __func__,MMG5_Get_typeName(psl->type));
1221 return 0;
1222 }
1223
1224 return 1;
1225}
1226
1228 MMG5_pSol psl;
1229
1230 /* Warning: users give indices from 1 to nsols */
1231 psl = sol + (i-1);
1232
1233 switch ( psl->type ) {
1234 case MMG5_Scalar:
1235 return MMGS_Get_scalarSols(psl,s);
1236 break;
1237
1238 case MMG5_Vector:
1239 MMGS_Get_vectorSols(psl,s);
1240 break;
1241
1242 case MMG5_Tensor:
1243 MMGS_Get_tensorSols(psl,s);
1244 break;
1245
1246 default:
1247 fprintf(stderr,"\n ## Error: %s: unexpected type of solution: %s\n",
1248 __func__,MMG5_Get_typeName(psl->type));
1249 return 0;
1250 }
1251
1252 return 1;
1253}
1254
1255
1257
1258 if ( (mesh->npi != mesh->np) || (mesh->nti != mesh->nt) ) {
1259 fprintf(stderr,"\n ## Error: %s: if you don't use the MMGS_loadMesh"
1260 " function,",__func__);
1261 fprintf(stderr," you must call the MMGS_Set_meshSize function to have a");
1262 fprintf(stderr," valid mesh.\n");
1263 fprintf(stderr," Missing datas.\n");
1264 return 0;
1265 }
1266
1267 if ( met->npi != met->np ) {
1268 fprintf(stderr,"\n ## Error: %s: if you don't use the MMGS_loadSol"
1269 " function,",__func__);
1270 fprintf(stderr," you must call the MMGS_Set_solSize function to have a");
1271 fprintf(stderr," valid solution.\n");
1272 fprintf(stderr," Missing datas.\n");
1273 return 0;
1274 }
1275
1276 /* Check mesh data */
1277 if ( mesh->info.ddebug ) {
1278 if ( (!mesh->np) || (!mesh->point) ||
1279 (!mesh->nt) || (!mesh->tria) ) {
1280 fprintf(stderr," ** MISSING DATA.\n");
1281 fprintf(stderr," Check that your mesh contains points and triangles.\n");
1282 fprintf(stderr," Exit program.\n");
1283 return 0;
1284 }
1285 }
1286
1287 if ( mesh->dim != 3 ) {
1288 fprintf(stderr," ** 3 DIMENSIONAL MESH NEEDED. Exit program.\n");
1289 return 0;
1290 }
1291 if ( met->dim != 3 ) {
1292 fprintf(stderr," ** WRONG DIMENSION FOR METRIC. Exit program.\n");
1293 return 0;
1294 }
1295 if ( !mesh->ver ) mesh->ver = 2;
1296 if ( !met ->ver ) met ->ver = 2;
1297
1298 return 1;
1299}
1300
1301int MMGS_Set_iparameter(MMG5_pMesh mesh, MMG5_pSol sol, int iparam, MMG5_int val){
1302 MMG5_int k;
1303
1304 switch ( iparam ) {
1305 /* Integer parameters */
1306 case MMGS_IPARAM_verbose :
1307 mesh->info.imprim = val;
1308 break;
1309 case MMGS_IPARAM_mem :
1310 if ( val <= 0 ) {
1311 fprintf(stderr,"\n ## Warning: %s: maximal memory authorized must be"
1312 " strictly positive.\n",__func__);
1313 fprintf(stderr," Reset to default value.\n");
1314 }
1315 else
1316 mesh->info.mem = val;
1317 if ( !MMGS_memOption(mesh) ) return 0;
1318 break;
1319 case MMGS_IPARAM_debug :
1320 mesh->info.ddebug = val;
1321 break;
1322 case MMGS_IPARAM_angle :
1323 if ( mesh->xpoint )
1325 if ( !val )
1326 mesh->info.dhd = -1.;
1327 else {
1328 if ( (mesh->info.imprim > 5) || mesh->info.ddebug )
1329 fprintf(stderr,"\n ## Warning: %s: angle detection parameter set"
1330 " to default value\n",__func__);
1332 }
1333 break;
1334 case MMGS_IPARAM_iso :
1335 if ( !mesh->info.iso )
1336 mesh->info.iso = val;
1337 break;
1338 case MMGS_IPARAM_isoref :
1339 mesh->info.isoref = val;
1340 break;
1341 case MMGS_IPARAM_isosurf :
1342 mesh->info.isosurf = val;
1343 break;
1344 case MMGS_IPARAM_keepRef :
1345 if ( mesh->info.nmat ) {
1346 fprintf(stderr,"\n ## Warning: %s: multi material mode not compatible with"
1347 " references preservation. Refs preservation disabled.\n",__func__);
1348 }
1349 else if ( val ) {
1350 mesh->info.iso = 2;
1351 }
1352 break;
1354 mesh->info.nsd = val;
1355 break;
1356 case MMGS_IPARAM_optim :
1357 mesh->info.optim = val;
1358 break;
1360 mesh->info.noinsert = val;
1361 break;
1362 case MMGS_IPARAM_noswap :
1363 mesh->info.noswap = val;
1364 break;
1365 case MMGS_IPARAM_nomove :
1366 mesh->info.nomove = val;
1367 break;
1368 case MMGS_IPARAM_nreg :
1369 mesh->info.nreg = val;
1370 break;
1371 case MMGS_IPARAM_xreg :
1372 mesh->info.xreg = val;
1373 break;
1375 mesh->info.nosizreq = val;
1376 break;
1378 if ( mesh->info.par ) {
1380 if ( (mesh->info.imprim > 5) || mesh->info.ddebug )
1381 fprintf(stderr,"\n ## Warning: %s: new local parameter values\n",__func__);
1382 }
1383 mesh->info.npar = val;
1384 mesh->info.npari = 0;
1385 mesh->info.parTyp = 0;
1386
1387 MMG5_ADD_MEM(mesh,mesh->info.npar*sizeof(MMG5_Par),"parameters",
1388 fprintf(stderr," Exit program.\n");
1389 return 0);
1391
1392 for (k=0; k<mesh->info.npar; k++) {
1394 mesh->info.par[k].ref = INT_MAX;
1395 mesh->info.par[k].hausd = mesh->info.hausd;
1396 mesh->info.par[k].hmin = mesh->info.hmin;
1397 mesh->info.par[k].hmax = mesh->info.hmax;
1398 }
1399 break;
1401 if ( mesh->info.br ) {
1403 if ( (mesh->info.imprim > 5) || mesh->info.ddebug )
1404 fprintf(stderr,"\n ## Warning: %s: new level-set based references values\n",__func__);
1405 }
1406 mesh->info.nbr = val;
1407 mesh->info.nbri = 0;
1408 MMG5_ADD_MEM(mesh,mesh->info.nbr*sizeof(MMG5_int),"References",
1409 printf(" Exit program.\n");
1410 return 0);
1411 MMG5_SAFE_CALLOC(mesh->info.br,mesh->info.nbr,MMG5_int,return 0);
1412
1413 for (k=0; k<mesh->info.nbr; k++)
1414 mesh->info.br[k] = 0;
1415
1416 break;
1417
1419 if ( mesh->info.mat ) {
1421 if ( (mesh->info.imprim > 5) || mesh->info.ddebug )
1422 fprintf(stderr,"\n ## Warning: %s: new multi materials values\n",__func__);
1423 }
1424 if ( mesh->info.iso == 2 ) {
1425 fprintf(stderr,"\n ## Warning: %s: multi material mode not compatible with"
1426 " references preservation. Refs preservation disabled.\n",__func__);
1427 mesh->info.iso = 1;
1428 }
1429 mesh->info.nmat = val;
1430 mesh->info.nmati = 0;
1431
1432 MMG5_ADD_MEM(mesh,(mesh->info.nmat)*sizeof(MMG5_Mat),"multi material",
1433 printf(" Exit program.\n");
1434 return 0);
1436 break;
1437
1438#ifdef USE_SCOTCH
1439 case MMGS_IPARAM_renum :
1440 mesh->info.renum = val;
1441 break;
1442#endif
1444 mesh->info.ani = val;
1445 break;
1446 default :
1447 fprintf(stderr,"\n ## Error: %s: unknown type of parameter\n",__func__);
1448 return 0;
1449 }
1450
1451 return 1;
1452}
1453
1454int MMGS_Get_iparameter(MMG5_pMesh mesh, MMG5_int iparam) {
1455
1456 switch ( iparam ) {
1457 /* Integer parameters */
1458 case MMGS_IPARAM_verbose :
1459 return mesh->info.imprim;
1460 break;
1461 case MMGS_IPARAM_mem :
1462 return mesh->info.mem;
1463 break;
1464 case MMGS_IPARAM_debug :
1465 return mesh->info.ddebug;
1466 break;
1467 case MMGS_IPARAM_angle :
1468 if ( mesh->info.dhd <= 0. ) {
1469 return 0;
1470 }
1471 else {
1472 return 1;
1473 }
1474 break;
1476 return mesh->info.noinsert;
1477 break;
1478 case MMGS_IPARAM_noswap :
1479 return mesh->info.noswap;
1480 break;
1481 case MMGS_IPARAM_nomove :
1482 return mesh->info.nomove;
1483 break;
1484 case MMGS_IPARAM_nreg :
1485 return mesh->info.nreg;
1486 break;
1487 case MMGS_IPARAM_xreg :
1488 return mesh->info.xreg;
1489 break;
1491 return mesh->info.npar;
1492 break;
1493#ifdef USE_SCOTCH
1494 case MMGS_IPARAM_renum :
1495 return mesh->info.renum;
1496 break;
1497#endif
1498 default :
1499 fprintf(stderr,"\n ## Error: %s: unknown type of parameter\n",__func__);
1500 return 0;
1501 }
1502}
1503
1504int MMGS_Set_dparameter(MMG5_pMesh mesh, MMG5_pSol sol, int dparam, double val){
1505
1506 switch ( dparam ) {
1507 /* double parameters */
1509 mesh->info.dhd = val;
1510 mesh->info.dhd = MG_MAX(0.0, MG_MIN(180.0,mesh->info.dhd));
1511 mesh->info.dhd = cos(mesh->info.dhd*M_PI/180.0);
1512 break;
1513 case MMGS_DPARAM_hmin :
1514 mesh->info.sethmin = 1;
1515 mesh->info.hmin = val;
1516 if ( mesh->info.sethmax && ( mesh->info.hmin >= mesh->info.hmax ) ) {
1517 fprintf(stderr,"\n ## Warning: hmin value must be strictly lower than hmax one"
1518 " (hmin = %lf hmax = %lf ).\n",mesh->info.hmin, mesh->info.hmax);
1519 }
1520
1521 break;
1522 case MMGS_DPARAM_hmax :
1523 mesh->info.sethmax = 1;
1524 mesh->info.hmax = val;
1525 if ( mesh->info.sethmin && ( mesh->info.hmin >= mesh->info.hmax ) ) {
1526 fprintf(stderr,"\n ## Warning: hmin value must be strictly lower than hmax one"
1527 " (hmin = %lf hmax = %lf ).\n",mesh->info.hmin, mesh->info.hmax);
1528 }
1529
1530 break;
1531 case MMGS_DPARAM_hsiz :
1532 mesh->info.hsiz = val;
1533 break;
1534 case MMGS_DPARAM_hgrad :
1535 mesh->info.hgrad = val;
1536 if ( mesh->info.hgrad <= 0.0 )
1537 mesh->info.hgrad = -1.0;
1538 else
1539 mesh->info.hgrad = log(mesh->info.hgrad);
1540 break;
1542 mesh->info.hgradreq = val;
1543 if ( mesh->info.hgradreq <= 0.0 )
1544 mesh->info.hgradreq = -1.0;
1545 else
1547 break;
1548 case MMGS_DPARAM_hausd :
1549 if ( val <=0 ) {
1550 fprintf(stderr,"\n ## Error: %s: hausdorff number must be strictly"
1551 " positive.\n",__func__);
1552 return 0;
1553 }
1554 else
1555 mesh->info.hausd = val;
1556 break;
1557 case MMGS_DPARAM_ls :
1558 mesh->info.ls = val;
1559 break;
1560 case MMGS_DPARAM_rmc :
1561 if ( !val ) {
1562 /* Default value */
1564 }
1565 else {
1566 /* User customized value */
1567 mesh->info.rmc = val;
1568 }
1569 break;
1570 default :
1571 fprintf(stderr,"\n ## Error: %s: unknown type of parameter\n",__func__);
1572 return 0;
1573 }
1574 return 1;
1575}
1576
1578 double hmin,double hmax,double hausd){
1579 MMG5_pPar par;
1580 MMG5_int k;
1581
1582 if ( !mesh->info.npar ) {
1583 fprintf(stderr,"\n ## Error: %s: You must set the number of local"
1584 " parameters",__func__);
1585 fprintf(stderr," with the MMGS_Set_iparameters function before setting");
1586 fprintf(stderr," values in local parameters structure. \n");
1587 return 0;
1588 }
1589 if ( mesh->info.npari > mesh->info.npar ) {
1590 fprintf(stderr,"\n ## Error: %s: unable to set a new local parameter.\n",
1591 __func__);
1592 fprintf(stderr," max number of local parameters: %d\n",mesh->info.npar);
1593 return 0;
1594 }
1595 if ( typ != MMG5_Triangle ) {
1596 fprintf(stderr,"\n ## Warning: %s: you must apply your local parameters",
1597 __func__);
1598 fprintf(stderr," on triangles (MMG5_Triangle or %d).\n",MMG5_Triangle);
1599 fprintf(stderr," ## Unknown type of entity: ignored.\n");
1600 return 0;
1601 }
1602 if ( ref < 0 ) {
1603 fprintf(stderr,"\n ## Error: %s: negative references are not allowed.\n",
1604 __func__);
1605 return 0;
1606 }
1607
1608 if ( hmin <= 0 ) {
1609 fprintf(stderr,"\n ## Error: %s: negative hmin value is not allowed.\n",
1610 __func__);
1611 return 0;
1612 }
1613 if ( hmax <= 0 ) {
1614 fprintf(stderr,"\n ## Error: %s: negative hmax value is not allowed.\n",
1615 __func__);
1616 return 0;
1617 }
1618 if ( hausd <= 0 ) {
1619 fprintf(stderr,"\n ## Error: %s: negative hausd value is not allowed.\n",
1620 __func__);
1621 return 0;
1622 }
1623
1624 for (k=0; k<mesh->info.npari; k++) {
1625 par = &mesh->info.par[k];
1626
1627 if ( par->elt == typ && par->ref == ref ) {
1628 par->hausd = hausd;
1629 par->hmin = hmin;
1630 par->hmax = hmax;
1631 if ( (mesh->info.imprim > 5) || mesh->info.ddebug ) {
1632 fprintf(stderr,"\n ## Warning: %s: new parameters (hausd, hmin and hmax)",
1633 __func__);
1634 fprintf(stderr," for entities of type %d and of ref %" MMG5_PRId "\n",typ,ref);
1635 }
1636 return 1;
1637 }
1638 }
1639
1640 mesh->info.par[mesh->info.npari].elt = typ;
1641 mesh->info.par[mesh->info.npari].ref = ref;
1642 mesh->info.par[mesh->info.npari].hmin = hmin;
1643 mesh->info.par[mesh->info.npari].hmax = hmax;
1644 mesh->info.par[mesh->info.npari].hausd = hausd;
1645
1646 switch ( typ )
1647 {
1648 case ( MMG5_Triangle ):
1649 mesh->info.parTyp |= MG_Tria;
1650 break;
1651 default:
1652 fprintf(stderr,"\n ## Error: %s: unexpected entity type: %s.\n",
1653 __func__,MMG5_Get_entitiesName(typ));
1654 return 0;
1655 }
1656
1657 mesh->info.npari++;
1658
1659 return 1;
1660}
1661
1663 int split,MMG5_int rin,MMG5_int rout){
1664 return MMG5_Set_multiMat(mesh,sol,ref,split,rin,rout);
1665}
1666
1669}
1670
1672
1673 return MMG5_Free_allSols(mesh,sol);
1674}
1675
1676int MMGS_Free_all(const int starter,...)
1677{
1678 va_list argptr;
1679 int ier;
1680
1682
1684
1685 va_end(argptr);
1686
1687 return ier;
1688}
1689
1691{
1692 va_list argptr;
1693 int ier;
1694
1696
1698
1699 va_end(argptr);
1700
1701 return ier;
1702}
1703
1704int MMGS_Free_names(const int starter,...)
1705{
1706 va_list argptr;
1707 int ier;
1708
1710
1712
1713 va_end(argptr);
1714
1715 return ier;
1716}
const char * MMG5_Get_typeName(enum MMG5_type typ)
int MMG5_Set_outputMeshName(MMG5_pMesh mesh, const char *meshout)
int MMG5_Set_inputSolName(MMG5_pMesh mesh, MMG5_pSol sol, const char *solin)
int MMG5_Free_allSols(MMG5_pMesh mesh, MMG5_pSol *sol)
int MMG5_Set_inputMeshName(MMG5_pMesh mesh, const char *meshin)
void MMG5_Init_parameters(MMG5_pMesh mesh)
Definition: API_functions.c:51
const char * MMG5_Get_entitiesName(enum MMG5_entities ent)
void MMG5_Init_fileNames(MMG5_pMesh mesh, MMG5_pSol sol)
int MMG5_Set_outputSolName(MMG5_pMesh mesh, MMG5_pSol sol, const char *solout)
int MMGS_Get_vertices(MMG5_pMesh mesh, double *vertices, MMG5_int *refs, int *areCorners, int *areRequired)
int MMGS_Set_triangles(MMG5_pMesh mesh, MMG5_int *tria, MMG5_int *refs)
int MMGS_Set_iparameter(MMG5_pMesh mesh, MMG5_pSol sol, int iparam, MMG5_int val)
int MMGS_Get_edges(MMG5_pMesh mesh, MMG5_int *edges, MMG5_int *refs, int *areRidges, int *areRequired)
int MMGS_Get_edge(MMG5_pMesh mesh, MMG5_int *e0, MMG5_int *e1, MMG5_int *ref, int *isRidge, int *isRequired)
int MMGS_Set_inputMeshName(MMG5_pMesh mesh, const char *meshin)
int MMGS_Get_vectorSol(MMG5_pSol met, double *vx, double *vy, double *vz)
int MMGS_Get_tensorSols(MMG5_pSol met, double *sols)
int MMGS_Get_meshSize(MMG5_pMesh mesh, MMG5_int *np, MMG5_int *nt, MMG5_int *na)
int MMGS_Set_vertices(MMG5_pMesh mesh, double *vertices, MMG5_int *refs)
int MMGS_Get_vectorSols(MMG5_pSol met, double *sols)
int MMGS_Set_requiredVertex(MMG5_pMesh mesh, MMG5_int k)
int MMGS_Set_localParameter(MMG5_pMesh mesh, MMG5_pSol sol, int typ, MMG5_int ref, double hmin, double hmax, double hausd)
int MMGS_Init_mesh(const int starter,...)
int MMGS_Free_allSols(MMG5_pMesh mesh, MMG5_pSol *sol)
int MMGS_Unset_requiredEdge(MMG5_pMesh mesh, MMG5_int k)
int MMGS_Set_solsAtVerticesSize(MMG5_pMesh mesh, MMG5_pSol *sol, int nsols, MMG5_int nentities, int *typSol)
int MMGS_Get_tensorSol(MMG5_pSol met, double *m11, double *m12, double *m13, double *m22, double *m23, double *m33)
int MMGS_Set_vertex(MMG5_pMesh mesh, double c0, double c1, double c2, MMG5_int ref, MMG5_int pos)
int MMGS_Get_solSize(MMG5_pMesh mesh, MMG5_pSol sol, int *typEntity, MMG5_int *np, int *typSol)
int MMGS_Set_requiredTriangle(MMG5_pMesh mesh, MMG5_int k)
int MMGS_Set_scalarSols(MMG5_pSol met, double *s)
int MMGS_Get_ithSols_inSolsAtVertices(MMG5_pSol sol, int i, double *s)
int MMGS_Free_structures(const int starter,...)
int MMGS_Set_edges(MMG5_pMesh mesh, MMG5_int *edges, MMG5_int *refs)
int MMGS_Unset_requiredVertex(MMG5_pMesh mesh, MMG5_int k)
int MMGS_Unset_requiredTriangle(MMG5_pMesh mesh, MMG5_int k)
int MMGS_Free_all(const int starter,...)
int MMGS_Set_ithSol_inSolsAtVertices(MMG5_pSol sol, int i, double *s, MMG5_int pos)
int MMGS_Set_tensorSol(MMG5_pSol met, double m11, double m12, double m13, double m22, double m23, double m33, MMG5_int pos)
void MMGS_Init_parameters(MMG5_pMesh mesh)
int MMGS_Set_requiredEdge(MMG5_pMesh mesh, MMG5_int k)
int MMGS_Set_ridge(MMG5_pMesh mesh, MMG5_int k)
int MMGS_GetByIdx_vertex(MMG5_pMesh mesh, double *c0, double *c1, double *c2, MMG5_int *ref, int *isCorner, int *isRequired, MMG5_int idx)
int MMGS_Get_scalarSol(MMG5_pSol met, double *s)
int MMGS_Set_inputSolName(MMG5_pMesh mesh, MMG5_pSol sol, const char *solin)
int MMGS_Get_ithSol_inSolsAtVertices(MMG5_pSol sol, int i, double *s, MMG5_int pos)
int MMGS_Set_edge(MMG5_pMesh mesh, MMG5_int v0, MMG5_int v1, MMG5_int ref, MMG5_int pos)
int MMGS_Get_iparameter(MMG5_pMesh mesh, MMG5_int iparam)
void MMGS_Init_fileNames(MMG5_pMesh mesh, MMG5_pSol sol)
int MMGS_Set_lsBaseReference(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_int br)
int MMGS_Set_corner(MMG5_pMesh mesh, MMG5_int k)
int MMGS_Set_scalarSol(MMG5_pSol met, double s, MMG5_int pos)
int MMGS_Set_solSize(MMG5_pMesh mesh, MMG5_pSol sol, int typEntity, MMG5_int np, int typSol)
int MMGS_Get_solsAtVerticesSize(MMG5_pMesh mesh, MMG5_pSol *sol, int *nsols, MMG5_int *np, int *typSol)
int MMGS_Get_scalarSols(MMG5_pSol met, double *s)
int MMGS_Unset_corner(MMG5_pMesh mesh, MMG5_int k)
int MMGS_Set_vectorSols(MMG5_pSol met, double *sols)
int MMGS_Set_multiMat(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_int ref, int split, MMG5_int rin, MMG5_int rout)
int MMGS_Get_triangle(MMG5_pMesh mesh, MMG5_int *v0, MMG5_int *v1, MMG5_int *v2, MMG5_int *ref, int *isRequired)
int MMGS_Set_ithSols_inSolsAtVertices(MMG5_pSol sol, int i, double *s)
int MMGS_Set_meshSize(MMG5_pMesh mesh, MMG5_int np, MMG5_int nt, MMG5_int na)
int MMGS_Set_vectorSol(MMG5_pSol met, double vx, double vy, double vz, MMG5_int pos)
int MMGS_Set_triangle(MMG5_pMesh mesh, MMG5_int v0, MMG5_int v1, MMG5_int v2, MMG5_int ref, MMG5_int pos)
int MMGS_Get_normalAtVertex(MMG5_pMesh mesh, MMG5_int k, double *n0, double *n1, double *n2)
int MMGS_Get_vertex(MMG5_pMesh mesh, double *c0, double *c1, double *c2, MMG5_int *ref, int *isCorner, int *isRequired)
double MMGS_Get_triangleQuality(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k)
int MMGS_Chk_meshData(MMG5_pMesh mesh, MMG5_pSol met)
int MMGS_Set_tensorSols(MMG5_pSol met, double *sols)
int MMGS_Unset_ridge(MMG5_pMesh mesh, MMG5_int k)
int MMGS_Set_normalAtVertex(MMG5_pMesh mesh, MMG5_int k, double n0, double n1, double n2)
int MMGS_Set_outputMeshName(MMG5_pMesh mesh, const char *meshout)
int MMGS_Free_names(const int starter,...)
int MMGS_Get_triangles(MMG5_pMesh mesh, MMG5_int *tria, MMG5_int *refs, int *areRequired)
int MMGS_Set_dparameter(MMG5_pMesh mesh, MMG5_pSol sol, int dparam, double val)
int MMGS_Set_outputSolName(MMG5_pMesh mesh, MMG5_pSol sol, const char *solout)
int ier
const int starter
MMG5_pMesh MMG5_pSol * sol
if(!ier) exit(EXIT_FAILURE)
va_start(argptr, starter)
MMG5_pMesh char * meshin
MMG5_pMesh * mesh
va_end(argptr)
const int va_list argptr
LIBMMG_CORE_EXPORT int MMG5_Set_multiMat(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_int ref, int split, MMG5_int rin, MMG5_int rex)
Definition: libtools.c:102
#define MMG5_VOLFRAC
API header for the common part of the MMG libraries.
LIBMMG_CORE_EXPORT int MMG5_Set_lsBaseReference(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_int br)
Definition: libtools.c:174
API headers for the mmgs library.
@ MMGS_IPARAM_keepRef
Definition: libmmgs.h:69
@ MMGS_IPARAM_nreg
Definition: libmmgs.h:74
@ MMGS_IPARAM_optim
Definition: libmmgs.h:70
@ MMGS_IPARAM_numberOfLocalParam
Definition: libmmgs.h:76
@ MMGS_IPARAM_xreg
Definition: libmmgs.h:75
@ MMGS_DPARAM_hgrad
Definition: libmmgs.h:88
@ MMGS_IPARAM_nomove
Definition: libmmgs.h:73
@ MMGS_IPARAM_renum
Definition: libmmgs.h:80
@ MMGS_IPARAM_numsubdomain
Definition: libmmgs.h:79
@ MMGS_IPARAM_anisosize
Definition: libmmgs.h:81
@ MMGS_IPARAM_nosizreq
Definition: libmmgs.h:82
@ MMGS_DPARAM_angleDetection
Definition: libmmgs.h:83
@ MMGS_IPARAM_verbose
Definition: libmmgs.h:62
@ MMGS_IPARAM_numberOfLSBaseReferences
Definition: libmmgs.h:77
@ MMGS_IPARAM_angle
Definition: libmmgs.h:65
@ MMGS_IPARAM_isoref
Definition: libmmgs.h:68
@ MMGS_DPARAM_hsiz
Definition: libmmgs.h:86
@ MMGS_IPARAM_debug
Definition: libmmgs.h:64
@ MMGS_IPARAM_noswap
Definition: libmmgs.h:72
@ MMGS_DPARAM_ls
Definition: libmmgs.h:90
@ MMGS_DPARAM_hmin
Definition: libmmgs.h:84
@ MMGS_IPARAM_numberOfMat
Definition: libmmgs.h:78
@ MMGS_IPARAM_iso
Definition: libmmgs.h:66
@ MMGS_DPARAM_hausd
Definition: libmmgs.h:87
@ MMGS_IPARAM_mem
Definition: libmmgs.h:63
@ MMGS_DPARAM_rmc
Definition: libmmgs.h:91
@ MMGS_IPARAM_isosurf
Definition: libmmgs.h:67
@ MMGS_DPARAM_hgradreq
Definition: libmmgs.h:89
@ MMGS_DPARAM_hmax
Definition: libmmgs.h:85
@ MMGS_IPARAM_noinsert
Definition: libmmgs.h:71
int MMGS_Init_mesh_var(va_list argptr)
Definition: variadic_s.c:149
int MMGS_setMeshSize_alloc(MMG5_pMesh mesh)
Definition: zaldy_s.c:223
int MMGS_Free_all_var(va_list argptr)
Definition: variadic_s.c:225
int MMGS_Free_names_var(va_list argptr)
Definition: variadic_s.c:426
#define MMGS_ALPHAD
int MMGS_memOption(MMG5_pMesh mesh)
Definition: zaldy_s.c:205
int MMGS_Free_structures_var(va_list argptr)
Definition: variadic_s.c:324
@ MMG5_Vector
Definition: libmmgtypes.h:214
@ MMG5_Tensor
Definition: libmmgtypes.h:215
@ MMG5_Scalar
Definition: libmmgtypes.h:213
@ MMG5_Notype
Definition: libmmgtypes.h:212
@ MMG5_Noentity
Definition: libmmgtypes.h:223
@ MMG5_Vertex
Definition: libmmgtypes.h:224
@ MMG5_Triangle
Definition: libmmgtypes.h:226
#define MG_Tria
#define MG_REQ
#define MG_GEO
#define MMG5_SAFE_CALLOC(ptr, size, type, law)
double MMG5_caltri_ani(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTria ptt)
Definition: quality.c:115
#define MG_EOK(pt)
#define MG_NUL
#define MMG5_INCREASE_MEM_MESSAGE()
#define MG_MIN(a, b)
#define MG_MAX(a, b)
#define MMG5_ADD_MEM(mesh, size, message, law)
#define MG_CRN
#define MMG5_ANGEDG
double MMG5_caltri_iso(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTria ptt)
Definition: quality.c:199
#define MG_REF
double MMG5_caltri33_ani(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTria pt)
Definition: quality.c:47
#define MMG5_DEL_MEM(mesh, ptr)
MMG5_int b
Definition: libmmgtypes.h:306
MMG5_int ref
Definition: libmmgtypes.h:307
int16_t tag
Definition: libmmgtypes.h:310
MMG5_int a
Definition: libmmgtypes.h:306
int8_t iso
Definition: libmmgtypes.h:534
int8_t parTyp
Definition: libmmgtypes.h:541
int8_t ddebug
Definition: libmmgtypes.h:532
double hsiz
Definition: libmmgtypes.h:518
int8_t isosurf
Definition: libmmgtypes.h:535
int8_t sethmin
Definition: libmmgtypes.h:544
MMG5_int * br
Definition: libmmgtypes.h:520
uint8_t ani
Definition: libmmgtypes.h:546
uint8_t noswap
Definition: libmmgtypes.h:546
double rmc
Definition: libmmgtypes.h:519
double hmin
Definition: libmmgtypes.h:518
MMG5_pMat mat
Definition: libmmgtypes.h:554
double hgrad
Definition: libmmgtypes.h:518
uint8_t noinsert
Definition: libmmgtypes.h:546
MMG5_int isoref
Definition: libmmgtypes.h:521
uint8_t metRidTyp
Definition: libmmgtypes.h:547
double hmax
Definition: libmmgtypes.h:518
double ls
Definition: libmmgtypes.h:519
uint8_t nomove
Definition: libmmgtypes.h:546
MMG5_int nsd
Definition: libmmgtypes.h:522
int8_t sethmax
Definition: libmmgtypes.h:545
uint8_t nosizreq
Definition: libmmgtypes.h:546
MMG5_pPar par
Definition: libmmgtypes.h:517
uint8_t optim
Definition: libmmgtypes.h:546
double dhd
Definition: libmmgtypes.h:518
double hgradreq
Definition: libmmgtypes.h:518
double hausd
Definition: libmmgtypes.h:518
int8_t xreg
Definition: libmmgtypes.h:531
int8_t nreg
Definition: libmmgtypes.h:530
To store user-defined references in the mesh (useful in LS mode)
Definition: libmmgtypes.h:495
MMG mesh structure.
Definition: libmmgtypes.h:605
MMG5_int ntmax
Definition: libmmgtypes.h:612
MMG5_int nc1
Definition: libmmgtypes.h:615
MMG5_Info info
Definition: libmmgtypes.h:651
MMG5_pPoint point
Definition: libmmgtypes.h:641
MMG5_int npmax
Definition: libmmgtypes.h:612
MMG5_pxPoint xpoint
Definition: libmmgtypes.h:642
MMG5_int namax
Definition: libmmgtypes.h:612
MMG5_int nt
Definition: libmmgtypes.h:612
MMG5_pTria tria
Definition: libmmgtypes.h:647
MMG5_int np
Definition: libmmgtypes.h:612
MMG5_pEdge edge
Definition: libmmgtypes.h:649
MMG5_int nti
Definition: libmmgtypes.h:612
MMG5_int npi
Definition: libmmgtypes.h:612
MMG5_int nai
Definition: libmmgtypes.h:612
MMG5_int na
Definition: libmmgtypes.h:612
double hmin
Definition: libmmgtypes.h:258
double hmax
Definition: libmmgtypes.h:259
double hausd
Definition: libmmgtypes.h:260
MMG5_int ref
Definition: libmmgtypes.h:261
int8_t elt
Definition: libmmgtypes.h:262
Structure to store points of a MMG mesh.
Definition: libmmgtypes.h:270
double n[3]
Definition: libmmgtypes.h:272
int16_t tag
Definition: libmmgtypes.h:284
MMG5_int tmp
Definition: libmmgtypes.h:280
double c[3]
Definition: libmmgtypes.h:271
MMG5_int ref
Definition: libmmgtypes.h:278
MMG5_int flag
Definition: libmmgtypes.h:282
MMG5_int npi
Definition: libmmgtypes.h:667
MMG5_int npmax
Definition: libmmgtypes.h:666
double * m
Definition: libmmgtypes.h:671
MMG5_int np
Definition: libmmgtypes.h:665
int16_t tag[3]
Definition: libmmgtypes.h:342
MMG5_int ref
Definition: libmmgtypes.h:335
MMG5_int v[3]
Definition: libmmgtypes.h:334