Mesh generation - boundary conditions - command cube

Hello everyone,

I am currently trying to simulate on a cube a coupling of two problems.
For this, I have retrieved the mesh given as an example on the site :

which is :

load “medit”
load “msh3”

func mesh3 Cube (int[int] &NN, real[int, int] &BB, int[int, int] &L){
real x0 = BB(0,0), x1 = BB(0,1);
real y0 = BB(1,0), y1 = BB(1,1);
real z0 = BB(2,0), z1 = BB(2,1);

int nx = NN[0], ny = NN[1], nz = NN[2];

// 2D mesh
mesh Thx = square(nx, ny, [x0+(x1-x0)*x, y0+(y1-y0)*y]);

// 3D mesh
int[int] rup = [0, L(2,1)], rdown=[0, L(2,0)];
int[int] rmid=[1, L(1,0), 2, L(0,1), 3, L(1,1), 4, L(0,0)];
mesh3 Th = buildlayers(Thx, nz, zbound=[z0,z1],
labelmid=rmid, labelup = rup, labeldown = rdown);

return Th;


I’m trying to add boundary conditions that correspond to blocking displacement on certain faces. For this, on the same site (same page) I found this information:

By default the labels are :

1: face y=0,
2: face x=1,
3: face y=1,
4: face x=0,
5: face z=0,
6: face z=1

and the region number is 0.

This information allows me to define the boundary conditions so that my cube is isostatic as follows:

  + on(1,Vy=0)
  + on(4,Vx=0)
  + on(5,Vz=0)

Once I run the calculation I don’t get the desired symmetry.

I would like to know if the information on the face labels corresponds to the defined mesh?
I have tried a new combination :

  + on(3,Vy=0)
  + on(2,Vx=0)
  + on(5,Vz=0)

I get completely inconsistent results when I compare the two possibilities of boundary conditions, when it seems to me that I should obtain a “symmetry” between them.

I hope I have been explicit in my explanations and that someone will know or could help me.

Thank you in advance.


The problem is solved.