@@ -234,7 +234,7 @@ template<class ffmesh>
234
234
class mmg_Op : public E_F0mps {
235
235
public:
236
236
Expression eTh;
237
- static const int n_name_param = std::is_same<ffmesh,Mesh3>::value ? 27 : 20 ;
237
+ static const int n_name_param = std::is_same<ffmesh,Mesh3>::value ? 28 : 21 ;
238
238
static basicAC_F0::name_and_type name_param[];
239
239
Expression nargs[n_name_param];
240
240
@@ -301,6 +301,7 @@ basicAC_F0::name_and_type mmg_Op<Mesh3>::name_param[] = {
301
301
{" ls" , &typeid (double )},/* !< [val], Value of level-set */
302
302
// {"rmc" , &typeid(double)},/*!< [-1/val], Remove small connex componants in level-set mode */
303
303
{" requiredTriangle" , &typeid (KN<long >*)},/* !< [val], References of surfaces with required triangles */
304
+ {" requiredVertex" , &typeid (KN<long >*)},/* !< [val], Indices of required vertices */
304
305
{" localParameter" , &typeid (KNM<double >*)}/* !< [val], Local parameters on given surfaces */
305
306
};
306
307
@@ -326,7 +327,8 @@ basicAC_F0::name_and_type mmg_Op<MeshS>::name_param[] = {
326
327
{" hausd" , &typeid (double )},/* !< [val], Control global Hausdorff distance (on all the boundary surfaces of the mesh) */
327
328
{" hgrad" , &typeid (double )},/* !< [val], Control gradation */
328
329
{" ls" , &typeid (double )},/* !< [val], Value of level-set */
329
- {" requiredEdge" , &typeid (KN<long >*)}/* !< [val], References of boundaries with required edges */
330
+ {" requiredEdge" , &typeid (KN<long >*)},/* !< [val], References of boundaries with required edges */
331
+ {" requiredVertex" , &typeid (KN<long >*)}/* !< [val], Indices of required vertices */
330
332
};
331
333
332
334
template <class ffmesh >
@@ -352,6 +354,7 @@ AnyType mmg_Op<Mesh3>::operator( )(Stack stack) const {
352
354
353
355
KN< double > *pmetric = 0 ;
354
356
KN< long > *prequiredTriangle = 0 ;
357
+ KN< long > *prequiredVertex = 0 ;
355
358
KNM< double > *plocalParameter = 0 ;
356
359
357
360
if (nargs[0 ]) {
@@ -361,7 +364,10 @@ AnyType mmg_Op<Mesh3>::operator( )(Stack stack) const {
361
364
prequiredTriangle = GetAny< KN< long > * >((*nargs[25 ])(stack));
362
365
}
363
366
if (nargs[26 ]) {
364
- plocalParameter = GetAny< KNM< double > * >((*nargs[26 ])(stack));
367
+ prequiredVertex = GetAny< KN< long > * >((*nargs[26 ])(stack));
368
+ }
369
+ if (nargs[27 ]) {
370
+ plocalParameter = GetAny< KNM< double > * >((*nargs[27 ])(stack));
365
371
}
366
372
367
373
MMG5_pMesh mesh;
@@ -425,6 +431,14 @@ AnyType mmg_Op<Mesh3>::operator( )(Stack stack) const {
425
431
}
426
432
}
427
433
}
434
+ if (prequiredVertex && prequiredVertex->N ( ) > 0 ) {
435
+ const KN< long > &requiredVertex = *prequiredVertex;
436
+ for (int k=0 ; k<requiredVertex.N ( ); k++) {
437
+ if ( MMG3D_Set_requiredVertex (mesh,requiredVertex[k]+1 ) != 1 ) {
438
+ exit (EXIT_FAILURE);
439
+ }
440
+ }
441
+ }
428
442
if (plocalParameter && plocalParameter->M ( ) > 0 ) {
429
443
const KNM< double > &localParameter = *plocalParameter;
430
444
ffassert (localParameter.N () == 4 );
@@ -502,13 +516,17 @@ AnyType mmg_Op<MeshS>::operator( )(Stack stack) const {
502
516
503
517
KN< double > *pmetric = 0 ;
504
518
KN< long > *prequiredEdge = 0 ;
519
+ KN< long > *prequiredVertex = 0 ;
505
520
506
521
if (nargs[0 ]) {
507
522
pmetric = GetAny< KN< double > * >((*nargs[0 ])(stack));
508
523
}
509
524
if (nargs[19 ]) {
510
525
prequiredEdge = GetAny< KN< long > * >((*nargs[19 ])(stack));
511
526
}
527
+ if (nargs[20 ]) {
528
+ prequiredVertex = GetAny< KN< long > * >((*nargs[20 ])(stack));
529
+ }
512
530
513
531
MMG5_pMesh mesh;
514
532
MMG5_pSol sol;
@@ -569,6 +587,14 @@ AnyType mmg_Op<MeshS>::operator( )(Stack stack) const {
569
587
}
570
588
}
571
589
}
590
+ if (prequiredVertex && prequiredVertex->N ( ) > 0 ) {
591
+ const KN< long > &requiredVertex = *prequiredVertex;
592
+ for (int k=0 ; k<requiredVertex.N ( ); k++) {
593
+ if ( MMGS_Set_requiredVertex (mesh,requiredVertex[k]+1 ) != 1 ) {
594
+ exit (EXIT_FAILURE);
595
+ }
596
+ }
597
+ }
572
598
573
599
long iso=0L ;
574
600
0 commit comments