[Gmsh] periodic surfaces of a cube

Martin Genet genet at lmt.ens-cachan.fr
Mon Oct 12 21:34:33 CEST 2009


Hello all!

I am trying to generate the faces of a cube with periodic meshes. However, I do not succeed.

The code is attached. I do not get any error, but only the first two surfaces are generated. A few points:
 - I can generate each pair of surfaces independantly: the problem only occurs when I try to generate all surfaces in the same code.
 - When I change the extrude vectors (e.g. -L instead of L), everything is alright and I get all surfaces.
 - When I change the extrude vector of the second and third pairs (e.g. -L instead of L), only the extruded surfaces are generated, and I get some "Error : Unknown source surface 42 for extrusion".

Many thanks for your help!

Martin.
-------------- next part --------------
General.Terminal = 1;

L = 10;
l = 1.;

P1 = newp; Point(P1) = {0, 0, 0, l};
P2 = newp; Point(P2) = {L, 0, 0, l};
P3 = newp; Point(P3) = {L, 0, L, l};
P4 = newp; Point(P4) = {0, 0, L, l};
P5 = newp; Point(P5) = {0, L, 0, l};
P6 = newp; Point(P6) = {L, L, 0, l};
P7 = newp; Point(P7) = {L, L, L, l};
P8 = newp; Point(P8) = {0, L, L, l};

L01 = newl; Line(L01) = {P1, P2};
L02 = newl; Line(L02) = {P2, P3};
L03 = newl; Line(L03) = {P3, P4};
L04 = newl; Line(L04) = {P4, P1};
L05 = newl; Line(L05) = {P2, P6};
L06 = newl; Line(L06) = {P6, P7};
L07 = newl; Line(L07) = {P7, P3};
L08 = newl; Line(L08) = {P6, P5};
L09 = newl; Line(L09) = {P5, P8};
L10 = newl; Line(L10) = {P8, P7};
L11 = newl; Line(L11) = {P5, P1};
L12 = newl; Line(L12) = {P4, P8};

LL1 = newll; Line Loop(LL1) = { L01,  L02,  L03,  L04};
LL2 = newll; Line Loop(LL2) = { L05,  L06,  L07, -L02};
LL3 = newll; Line Loop(LL3) = { L08,  L09,  L10, -L06};
LL4 = newll; Line Loop(LL4) = { L11, -L04,  L12, -L09};
LL5 = newll; Line Loop(LL5) = { L01,  L05,  L08,  L11};
LL6 = newll; Line Loop(LL6) = {-L03, -L07, -L10, -L12};

S1 = news; Plane Surface(S1) = {LL1};
out[] = Extrude {0., L, 0.} { Surface{S1}; Layers{{1}, {1}}; };
S3 = out[0];

S4 = news; Plane Surface(S4) = {LL4};
out[] = Extrude {-L, 0., 0.} { Surface{S4}; Layers{{1}, {1}}; };
S2 = out[0];

S5 = news; Plane Surface(S5) = {LL5};
out[] = Extrude {0., 0., -L} { Surface{S5}; Layers{{1}, {1}}; };
S6 = out[0];

Physical Surface ( "surf" ) = { S1, S2, S3, S4, S5, S6 };