Trunc a mesh3 from a list of regions


  • Is it possible to extend the truncfunction with an array region as argument ? It could be useful to write trunc(Th,region=listRegion or trunc(Th,region=[region1,region2] instead of writing the conditional test region=region1||region=region2, specially when the list of regions is long and already computed.

  • Why extract function can’t directly use an explicit array as argument, something like: extract(Th,label=[1,2]) ?

Best regards.

an idea:

mesh Th=square(10,10);
int[string] ok;
for(int i=0; i<25;i+=3)
  ok[i]=1;// def region i in ok map 
Th=trunc(Th,ok&region); //   check if region is defined  on ok map 
cout << ok << endl;

for the other question on extract I will see.

Thanks, so cool, it works fine.