[Gmsh] Cylinder structured grid problem

gmsh at praveen.e4ward.com gmsh at praveen.e4ward.com
Sat Mar 19 03:17:27 CET 2011


Thanks. That worked.

I have  a problem with areas. I am using the circle grid with deal.II. Its a
2-d problem so I generate only mesh in z=0. deal.II is saying that areas are
negative.

In the attached grid, Ruled Surface 1 is oriented ccw but the other Ruled
Surface 5, 10 are cw. I think this is causing the problem. Is there a way to
fix this ?

praveen



On Sat, Mar 19, 2011 at 6:07 AM, Geordie McBain <gdmcbain at freeshell.org>wrote:

> 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 --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20110319/660a21aa/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cylinder.geo
Type: application/octet-stream
Size: 1062 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20110319/660a21aa/attachment.geo>