3d labels questions

Hi all,
I have a 3D mesh which is a cubic but with some cylinders borders inside.
First I build a 2D square mesh with some circles, I put label = 1,2,3,4 for square’s borders, respectively. label = 5 for circles. The 3D mesh should has the corresponding labels. I test the 3D label by a PDE problem with a Dirichlet boundary condition on a certain border, it seems like my labels are wrong.
I want the upper and down face (z=zmin and z=zmax) label =0, but when I set on (0,phase = 1), while only the upper and down circle part is phase=1.
And I thought label=1 represents the border (y=0), but it is the upper and down face without the circle. I don’t understand the way to define labels, wish you can have a help.
Thanks!

load "iovtk"
load "UMFPACK64";
load "msh3"

real r = 0.005; //     disk radius 

real x0 = 0.015;
real y0 = 0.015;

real x1 = 0.015;
real y1 = 0.03;
real x2 = 0.015;
real y2 = 0.045;

real x3 = 0.04098;
real y3 = 0.015;

real x4 = 0.04098;
real y4 = 0.03;

real x5 = 0.04098;
real y5 = 0.045;

real x6 = 0.02799;
real y6 = 0.0225;

real x7 = 0.02799;
real y7 = 0.0375;

int m = 40, mc = m;
// Definition of the border of the domain
border C1(t=0,0.0598){ x=t; y=0; label=1;}
border C2(t=0,0.06){ x=0.0598; y=t; label=2;}
border C3(t=0,0.0598){ x=0.0598-t; y=0.06; label=3;}
border C4(t=0,0.06){ x=0; y=0.06-t; label=4;}
border C5(t=0,2*pi){x=x0+r*cos(t); y=y0+r*sin(t); label=5;}
// border C6(t=0,2*pi){x=x1+r*cos(t); y=y1+r*sin(t); label=5;}
// border C7(t=0,2*pi){x=x2+r*cos(t); y=y2+r*sin(t); label=5;}
// border C8(t=0,2*pi){x=x3+r*cos(t); y=y3+r*sin(t); label=5;}
// border C9(t=0,2*pi){x=x4+r*cos(t); y=y4+r*sin(t); label=5;}
// border C10(t=0,2*pi){x=x5+r*cos(t); y=y5+r*sin(t); label=5;}
// border C11(t=0,2*pi){x=x6+r*cos(t); y=y6+r*sin(t); label=5;}
// border C12(t=0,2*pi){x=x7+r*cos(t); y=y7+r*sin(t); label=5;}

mesh Baseh = buildmesh(C1(m)+C2(m)+C3(m)+C4(m)+C5(mc));
// mesh Baseh = buildmesh(C1(m)+C2(m)+C3(m)+C4(2*m)+C5(mc)+C6(mc)+C7(mc)+C8(mc)+C9(mc)+C10(mc)+C11(mc)+C12(mc));

int[int] rup=[0,0,5,0], rdown=[0,0,5,0];
int[int] rmid=[1,1,2,2,3,3,4,4,5,5];
func zmin= 0;
func zmax= 0.01;
int nlayer=2;
mesh3 Th=buildlayers(Baseh,nlayer,
  coef= 1.,
  zbound=[zmin,zmax],
  reffacemid=rmid, 
  reffaceup = rup,
  reffacelow = rdown);
fespace Ph(Th,P1);
Ph phase,psi;
Ph phaseOld=0;		
real idt =1/0.0001;
problem AC(phase,psi)=
	int3d(Th)(	idt*phase*psi + 0.005*dx(phase)*dx(psi) + 0.005*dy(phase)*dy(psi)+  0.005*dz(phase)*dz(psi) )
-	int3d(Th)( idt*phaseOld*psi  )
+ on(0,phase = 1);
//+ on(1,phase = 1);
AC;
plot(phase,fill=1,value=1);
savevtk("label.vtk", Th,phase);	

Example3Dlabels.edp (1.9 KB)

Does this produce the answer you want ( try just the changed rup or
rdown one a t time maybe )? I’m not real clear on this myself :slight_smile: Probably
one good thing to do is make a small mesh and save it then look at the saved
file and verify the dof’s have the labels you expect. I’m doing this now
for 2D mesh although presumably it is not hard fro 3D either…

int[int] rup=[0,0,5,0], rdown=[0,0,5,0];
rdown=[1,0,2,0,3,0,4,0,5,0];
rup=[1,0,2,0,3,0,4,0,5,0];
int[int] rmid=[1,1,2,2,3,3,4,4,5,5];

Thank you for your help!
This is what I expected.