# Regional attributes

Hello everyone, may I ask how the Regional attributes in the regionlist are generated when using Tetgen to generate mesh? how to get “145” as follow?

real[int] domain =[1.5,pi,0.75,145,0.0025];
mesh3 Thfinal = tetg(Th33,switch=“paAAQY”,regionlist=domain);

I think you get a region number = 145 if the point [1.5,pi,0.75] is in the discrete domain , Pay attention to curved domain.

I tested using a simple case in the manual, where regional attributes=Th (x, y, z). region, but the results did not match the region list. I hope to receive your further explanation.
tet.edp (9.8 KB)

Some correction, remark the region number od meshS is the surface number non a volume number.

``````
{
real hs = 0.1;  // mesh size on sphere
int[int]  N=[20,20,20];
real [int,int]  B=[[-1,1],[-1,1],[-1,1]];
int [int,int]  L=[[1,2],[3,4],[5,6]];

////////////////////////////////
meshS ThH = SurfaceHex(N,B,L,1);
meshS ThS =Sphere(0.5,hs,7,1); // "gluing" surface meshs to tolat boundary meshes
cout << " xxxx" << ThH.nv << " " << ThS.nv << endl;

meshS ThHS=ThH+ThS;
plot(ThHS);
// soory MeshS no mesh3 wrong ..
real voltet=(hs^3)/6.;
cout << " voltet = " << voltet << endl;
real[int] domaine = [0,0,0,1,voltet,0,0,0.7,2,voltet];

mesh3 Th = tetg(ThHS,switch="pqaAAYYQ",nbofregions=2,regionlist=domaine);
cout << "3d regions " << regions(Th) << endl;
cout << " Th 3d = (0,0,0) " << Th(0,0,0).region<< endl;
cout << " Th 3d = (0,0,0.7)" << Th(0,0,0.7).region<< endl;
plot(Th,wait=1);
}

``````

Thank you for your reply, Professor. If this number comes from a 3D mesh, but the 3D mesh requires this number to be generated, is this contradictory? For example, in the following case, how to determine this number in “int [int] domain”?
test.edp (2.1 KB)

The 4th argument (out of 5) of each region description in “regionlist” sets the label. You can choose it as you like!
If you define as in your file
`real[int] domaine = [0.2,0.2,1,0,voltet];`
then the label of the region will be 0.
If you set
`real[int] domaine = [0,0,0,1,voltet,0,0,0.7,2,voltet];`
then you will have two regions, the first with region label 1, and the second with region label 2.

Thank you for your help, Professor. In the following case, I did this, but the program process was killed without any errors，can you help me? please
test.edp (2.2 KB)

I don’t see any problem in your code, it terminates normally after doing what it is asked to do!

Thank you, professor. I am looking for the reason for its abnormal termination. Have a good day

Make a brief mark here so that friends who have the same questions as me can refer to it. Thank you again to the two professors.
Solution: 1. The number in the region list {4th} can be given freely by oneself; 2. If the program terminates inexplicably, check if (x, y, z) in the regionlist exceeds the limit