[Gmsh] holes in 2D surfaces
Nico Schlömer
nico.schloemer at gmail.com
Wed Oct 9 09:08:13 CEST 2013
> you need two surfaces :
Actually, no.
The mistake (that you also corrected) was the definition of ll2. It
all works with
Line Loop(ll2) = {c5,c6,c7,c8};
surf2 = news;
Plane Surface(surf2) = {ll1,ll2};
Thanks!
On Wed, Oct 9, 2013 at 11:41 AM, Nico Schlömer <nico.schloemer at gmail.com> wrote:
> Hi all,
>
> I would like to define a 2D surface with a hole, and expected it to
> work in the same way that holes in volumes work. However, the
> following script does not yield the expected result.
>
> ================ *snip* ================
> // Points
> p1 = newp;
> Point(p1) = {0, 0, 0, 0.1};
> p2 = newp;
> Point(p2) = {0, 0.4, 0, 0.1};
> p3 = newp;
> Point(p3) = {0, 0, 0.4, 0.1};
> p4 = newp;
> Point(p4) = {0, 0, -0.4, 0.1};
> p5 = newp;
> Point(p5) = {0, -0.4, 0, 0.1};
> // Circle arcs
> c1 = newreg;
> Circle(c1) = {p2, p1, p3};
> c2 = newreg;
> Circle(c2) = {p3, p1, p5};
> c3 = newreg;
> Circle(c3) = {p5, p1, p4};
> c4 = newreg;
> Circle(c4) = {p4, p1, p2};
> ll1 = newreg;
> Line Loop(ll1) = {c1,c2,c3,c4};
> // Points
> p6 = newp;
> Point(p6) = {0, 0, 0, 0.1};
> p7 = newp;
> Point(p7) = {0, 0.3, 0, 0.1};
> p8 = newp;
> Point(p8) = {0, 0, 0.3, 0.1};
> p9 = newp;
> Point(p9) = {0, 0, -0.3, 0.1};
> p10 = newp;
> Point(p10) = {0, -0.3, 0, 0.1};
> // Circle arcs
> c5 = newreg;
> Circle(c5) = {p7, p6, p8};
> c6 = newreg;
> Circle(c6) = {p8, p6, p10};
> c7 = newreg;
> Circle(c7) = {p10, p6, p9};
> c8 = newreg;
> Circle(c8) = {p9, p6, p7};
> ll2 = newreg;
> Line Loop(ll2) = {c1,c2,c3,c4};
> surf1 = news;
> Plane Surface(surf1) = {ll1,ll2};
> ================ *snap* ================
>
> Any obvious mistakes here?
>
> --Nico