[Gmsh] Cylinder structured grid problem

Geordie McBain gdmcbain at freeshell.org
Sat Mar 19 01:37:17 CET 2011


2011/3/19  <gmsh at praveen.e4ward.com>:
> Hi all,
> I have attached below a simple script to generate grid for a full circle. I
> create it for half a circle and use Symmetry to reflect it, so it becomes a
> full circle.
> But Symmetry is not working. Can you point out the mistake in my script.
> Thanks
> praveen
>
> r = 1.0;  // cylinder radius
> R = 10.0; // outer boundary radius
> n1 = 10;
> n2 = 10;
> Point(1) = { 0, 0, 0};
> Point(2) = {-r, 0, 0};
> Point(3) = { r, 0, 0};
> Point(4) = {-R, 0, 0};
> Point(5) = { R, 0, 0};
> Circle(1) = {3,1,2};
> Circle(2) = {5,1,4};
> Line(3) = {5,3};
> Line(4) = {2,4};
> Line Loop(1) = {3, 1, 4, -2};
> Ruled Surface(1) = {1};
> Transfinite Surface(1) = {3,5,4,2};
> Recombine Surface(1);
> Transfinite Line {3,4} = n1;
> Transfinite Line {1,2} = n2;
> Symmetry {0.0, 1.0, 0.0, 0.0} { Duplicata{Surface{1};} }
> _______________________________________________

I see that this doesn't work they way you expected.  Note that Circle
`creates a circle arc (strictly) smaller than Pi.'
<http://geuz.org/gmsh/doc/texinfo/gmsh.html#Lines>.

In the attached modified input file, the arcs subtend right angles,
and Symmetry does work as expected.  (The resulting mesh probably
isn't what you're after, but I'll leave the further modifications
required to fix that to you.)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: symmetry1.geo
Type: application/octet-stream
Size: 597 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20110319/46d160b1/attachment.geo>