# [Gmsh] meshing compound surfaces vs. elementary surfaces

Nico Schlömer nico.schloemer at gmail.com
Wed Oct 9 19:57:42 CEST 2013

```Hi all,

I'm trying to mesh the surface of a pipe built with Compound Surfaces.
Unfortunately, not only the compound surfaces are meshes but also the
constituting elementary surfaces (such that there are two meshes on
the domain surface then).
Here is some code to reproduce the problem:

============= *snip* =============
p1 = newp;
Point(p1) = {0, 0.59641, -0.233013, 0.04};
p2 = newp;
Point(p2) = {0, 0.0964102, 0.633013, 0.04};
p3 = newp;
Point(p3) = {0, 0.00980762, 0.583013, 0.04};
p4 = newp;
Point(p4) = {0, 0.509808, -0.283013, 0.04};
l1 = newreg;
Line(l1) = {p1, p2};
l2 = newreg;
Line(l2) = {p2, p3};
l3 = newreg;
Line(l3) = {p3, p4};
l4 = newreg;
Line(l4) = {p4, p1};
//
ex1[] = Extrude{{0.0,-0.5,0.866025403784}, {0.0,0.0,0.0}, 2*Pi/3}{Line{l1};};
ex2[] = Extrude{{0.0,-0.5,0.866025403784}, {0.0,0.0,0.0}, 2*Pi/3}{Line{l2};};
ex3[] = Extrude{{0.0,-0.5,0.866025403784}, {0.0,0.0,0.0}, 2*Pi/3}{Line{l3};};
ex4[] = Extrude{{0.0,-0.5,0.866025403784}, {0.0,0.0,0.0}, 2*Pi/3}{Line{l4};};
//
ex5[] = Extrude{{0.0,-0.5,0.866025403784}, {0.0,0.0,0.0},
2*Pi/3}{Line{ex1[0]};};
ex6[] = Extrude{{0.0,-0.5,0.866025403784}, {0.0,0.0,0.0},
2*Pi/3}{Line{ex2[0]};};
ex7[] = Extrude{{0.0,-0.5,0.866025403784}, {0.0,0.0,0.0},
2*Pi/3}{Line{ex3[0]};};
ex8[] = Extrude{{0.0,-0.5,0.866025403784}, {0.0,0.0,0.0},
2*Pi/3}{Line{ex4[0]};};
//
ex9[] = Extrude{{0.0,-0.5,0.866025403784}, {0.0,0.0,0.0},
2*Pi/3}{Line{ex5[0]};};
ex10[] = Extrude{{0.0,-0.5,0.866025403784}, {0.0,0.0,0.0},
2*Pi/3}{Line{ex6[0]};};
ex11[] = Extrude{{0.0,-0.5,0.866025403784}, {0.0,0.0,0.0},
2*Pi/3}{Line{ex7[0]};};
ex12[] = Extrude{{0.0,-0.5,0.866025403784}, {0.0,0.0,0.0},
2*Pi/3}{Line{ex8[0]};};
surf1 = news;
Compound Surface(surf1) = {ex1[1],ex5[1],ex9[1]};
surf2 = news;
Compound Surface(surf2) = {ex2[1],ex6[1],ex10[1]};
surf3 = news;
Compound Surface(surf3) = {ex3[1],ex7[1],ex11[1]};
surf4 = news;
Compound Surface(surf4) = {ex4[1],ex8[1],ex12[1]};
============= *snap* =============

Running

\$ gmsh test.geo -2 -o test.vtk

shows that not only the compound surfaces are meshed.

Any hints?

Cheers,
Nico

```