Trunc a mesh3 from a list of regions

Hello,

  • 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);
Th=change(Th,fregion=int(x*5)+int(y*5)*5);
plot(Th,wait=1);
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 
plot(Th,wait=1);
cout << ok << endl;


for the other question on extract I will see.

Thanks, so cool, it works fine.