# [Gmsh] Experimenting with ThroughSection, Reviewed

Marco Antolovic marco_antolovic at yahoo.it
Thu Oct 26 14:11:46 CEST 2017

```Hi all,
it appears that my previous mail had some editing problems so I'm resending it, hoping that it will make a question clearer.
The code below is trying to create a cylinder using ThruSections. I manage to create and mesh the cylinder but I always get an error during meshing (there is a strange curve inside the cylinder geometry...). To my knowledge there is no example on how to use so ThruSections I went on by trial & error.
I'm aware that the command Cylinder will give the same result but I'm really curious about ThruSections...
My code is as follows:
// Create base circle line loop
base_circle = newl; Circle(newl) = {0,0,0, rd};
base_circle_ll = newll; Line Loop (newll) = {base_circle};

// Create base circle surface, this will be used to draw the wire connecting upper and base circle
base_circle_surface = news; Plane Surface (news) = {base_circle_ll};

// Create upper circle line loop
upper_circle = Translate { 0, 0, .02 } { Duplicata{ Line { base_circle }; }};
upper_circle_ll = newll; Line Loop (newll) = {upper_circle};

// Create upper circle surface, this will be used to draw the wire connecting upper and base circle
upper_circle_surface = news; Plane Surface (news) = {upper_circle_ll};

// Build wire connectiong upper and base circle
extrac_points() = PointsOf { Surface{ base_circle_surface, upper_circle_surface }; };
line_cylinder = newl; Line (line_cylinder) = { extrac_points(0), extrac_points(1) };
wire_cylinder = newl; Wire (wire_cylinder) = { line_cylinder };

// Create ruled surface
Ruled ThruSections { base_circle_ll, wire_cylinder, upper_circle_ll }

And the output log on a PC is:
Info    : Finalized high order topology of periodic connections
Info    : Meshing 1D...
Info    : Meshing curve 1 (Circle)
Info    : Meshing curve 2 (Circle)
Info    : Meshing curve 6 (Line)
Info    : Meshing curve 7 (BSpline)
Info    : Meshing curve 8 (BSpline)
Info    : Meshing curve 9 (BSpline)
Info    : Meshing curve 10 (BSpline)
Info    : Done meshing 1D (0 s)
Info    : Meshing 2D...
Info    : Meshing surface 3 (Plane, MeshAdapt)
Info    : Meshing surface 5 (Plane, MeshAdapt)
Info    : Meshing surface 6 (BSpline surface, MeshAdapt)
.Error   : Unable to recover the edge 9 (7/7) on GEdge 1 (on GFace 6)
Info    : Meshing surface 7 (BSpline surface, MeshAdapt)
.Error   : Unable to recover the edge 16 (7/7) on GEdge 2 (on GFace 7)
Info    : Done meshing 2D (0.015625 s)
Info    : Meshing 3D...
Info    : Done meshing 3D (0 s)
Info    : 49 vertices 74 elements
.Error   : ------------------------------
.Error   : Mesh generation error summary
.Error   :     0 warnings
.Error   :     2 errors
.Error   : Check the full log for details
.Error   : ------------------------------

I hope somebody can give me a hand with this,
Thanks,
Marco

PS: I attach the script and the output log just in case unexpected problems happens again.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20171026/a1ceecdf/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Type: application/octet-stream
Size: 1236 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20171026/a1ceecdf/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...