[Gmsh] (no subject)
Nico Schlömer
nico.schloemer at gmail.com
Thu Oct 18 12:18:11 CEST 2012
Hi all,
I'd like to stick two bricks together such that they share one face.
I've gotten as far as
========================= *snip* =========================
Function Brick
// Creates a rectangular brick.
// Define points.
cp1 = newp;
Point(cp1) = {xmax,ymax,zmax,lcar};
cp2 = newp;
Point(cp2) = {xmax,ymax,zmin,lcar};
cp3 = newp;
Point(cp3) = {xmax,ymin,zmax,lcar};
cp4 = newp;
Point(cp4) = {xmax,ymin,zmin,lcar};
cp5 = newp;
Point(cp5) = {xmin,ymax,zmax,lcar};
cp6 = newp;
Point(cp6) = {xmin,ymax,zmin,lcar};
cp7 = newp;
Point(cp7) = {xmin,ymin,zmax,lcar};
cp8 = newp;
Point(cp8) = {xmin,ymin,zmin,lcar};
// Lines.
cl1 = newreg;
Line(cl1) = {cp1,cp2};
cl2 = newreg;
Line(cl2) = {cp1,cp3};
cl3 = newreg;
Line(cl3) = {cp1,cp5};
cl4 = newreg;
Line(cl4) = {cp2,cp4};
cl5 = newreg;
Line(cl5) = {cp2,cp6};
cl6 = newreg;
Line(cl6) = {cp3,cp4};
cl7 = newreg;
Line(cl7) = {cp3,cp7};
cl8 = newreg;
Line(cl8) = {cp4,cp8};
cl9 = newreg;
Line(cl9) = {cp5,cp6};
cl10 = newreg;
Line(cl10) = {cp5,cp7};
cl11 = newreg;
Line(cl11) = {cp6,cp8};
cl12 = newreg;
Line(cl12) = {cp7,cp8};
// Surfaces.
cll1 = newreg; Line Loop(cll1) = {cl1,cl4,-cl6,-cl2}; Plane
Surface(newreg) = {cll1};
cll2 = newreg; Line Loop(cll2) = {cl1,cl5,-cl9,-cl3}; Plane
Surface(newreg) = {cll2};
cll3 = newreg; Line Loop(cll3) = {cl2,cl7,-cl10,-cl3}; Plane
Surface(newreg) = {cll3};
cll4 = newreg; Line Loop(cll4) = {cl4,cl8,-cl11,-cl5}; Plane
Surface(newreg) = {cll4};
cll5 = newreg; Line Loop(cll5) = {cl6,cl8,-cl12,-cl7}; Plane
Surface(newreg) = {cll5};
cll6 = newreg; Line Loop(cll6) = {cl9,cl11,-cl12,-cl10}; Plane
Surface(newreg) = {cll6};
// We then store the surface loops identification numbers in a list
// for later reference (we will need these to define the final
// volume).
theloops[t] = newreg;
// Define outer surface.
Surface Loop(theloops[t]) = {cll1+1,cll2+1,cll3+1,cll4+1,cll5+1,cll6+1};
Return
// Left brick.
t = 1;
lcar = 0.5;
xmin = -1;
xmax = 0;
ymin = -1;
ymax = 1;
zmin = -1;
zmax = 1;
Call Brick;
brick1 = newreg;
Volume(brick1) = theloops[t];
Physical Volume("brick1") = brick1;
// Right brick.
t = 2;
lcar = 0.1;
xmin = 0;
xmax = 1;
ymin = -1;
ymax = 1;
zmin = -1;
zmax = 1;
Call Brick;
brick2 = newreg;
Volume(brick2) = theloops[t];
Physical Volume("brick2") = brick2;
Compound Volume(newreg) = {brick1, brick2};
========================= *snap* =========================
which generates the correct geometry.
When meshing this thing, however, the mesh is not conforming at the
shared face. How can I make it conform?
--Nico