Discussion:
[Gmsh] making an equilateral mesh.
Dr Colin J. Cotter
2009-10-07 09:07:47 UTC
Permalink
Dear Gmsh list,
I have been trying to make a mesh of equilateral triangles by
extruding a horizontal line at a 60 degree angle (later I will use
periodic boundary conditions so I have an equilateral mesh on the
torus). I have noticed that if you do this then the extrusion divides
the quadrilaterals in the wrong direction and you don't get a Delaunay
mesh (the equilateral one):

Point(1) = {0,0,0,0.1};
Extrude {1,0,0} {
Point{1}; Layers{5};
}
Extrude {0.5,0.866025403784,0} {
Line{1}; Layers{5};
}

but it works if you extrude at a -60 degree angle instead:

Point(1) = {0,0,0,0.1};
Extrude {1,0,0} {
Point{1}; Layers{5};
}
Extrude {-0.5,0.866025403784,0} {
Line{1}; Layers{5};
}

Is there a way to force Gmsh to produce a Delaunay mesh in the first case?

all the best
--cjc
David Colignon
2009-10-07 10:20:22 UTC
Permalink
Hi Colin,

what about this ?


Point(1) = {0,0,0,0.1};
Extrude {1,0,0} { Point{1}; }
Extrude {0.5,0.866025403784,0} { Line{1}; }
Transfinite Line { 1 , 2 , 3 , 4 } = 5 ;
Transfinite Surface {5} Left ;


Cheers,

Dave
--
David Colignon, Ph.D.
Collaborateur Logistique du F.R.S.-FNRS
CÉCI - Consortium des Équipements de Calcul Intensif
ACE - Applied & Computational Electromagnetics
Sart-Tilman B28
Université de Liège
4000 Liège - BELGIQUE
Tél: +32 (0)4 366 37 32
Fax: +32 (0)4 366 29 10
WWW: http://hpc.montefiore.ulg.ac.be/
Agenda: http://www.google.com/calendar/embed?src=david.colignon%40gmail.com
Post by Dr Colin J. Cotter
Dear Gmsh list,
I have been trying to make a mesh of equilateral triangles by
extruding a horizontal line at a 60 degree angle (later I will use
periodic boundary conditions so I have an equilateral mesh on the
torus). I have noticed that if you do this then the extrusion divides
the quadrilaterals in the wrong direction and you don't get a Delaunay
Point(1) = {0,0,0,0.1};
Extrude {1,0,0} {
Point{1}; Layers{5};
}
Extrude {0.5,0.866025403784,0} {
Line{1}; Layers{5};
}
Point(1) = {0,0,0,0.1};
Extrude {1,0,0} {
Point{1}; Layers{5};
}
Extrude {-0.5,0.866025403784,0} {
Line{1}; Layers{5};
}
Is there a way to force Gmsh to produce a Delaunay mesh in the first case?
all the best
--cjc
_______________________________________________
gmsh mailing list
http://www.geuz.org/mailman/listinfo/gmsh
Dr Colin J. Cotter
2009-10-07 10:51:10 UTC
Permalink
Dear Dave,
Thanks for your reply. I'm running Gmsh 2.2 which complains about the
"Left" bit (not sure what that does):
Error : 'equilateral3.geo', line 4 : syntax error (Left)

When I run it in command line mode I get a mesh which is not perfectly
regular.

--cjc
Post by David Colignon
Hi Colin,
what about this ?
Point(1) = {0,0,0,0.1};
Extrude {1,0,0} { Point{1}; }
Extrude {0.5,0.866025403784,0} { Line{1}; }
Transfinite Line { 1 , 2 , 3 , 4 } = 5 ;
Transfinite Surface {5} Left ;
Cheers,
Dave
David Colignon
2009-10-07 11:03:01 UTC
Permalink
Post by Dr Colin J. Cotter
Dear Dave,
Thanks for your reply. I'm running Gmsh 2.2
you should upgrade to the latest 2.4.2 version :-)
Post by Dr Colin J. Cotter
which complains about the
see "Transfinite Surface" in http://www.geuz.org/gmsh/doc/texinfo/gmsh.html#Structured-grids
Post by Dr Colin J. Cotter
Error : 'equilateral3.geo', line 4 : syntax error (Left)
you can replace

Transfinite Surface {5} Left ;

by

Transfinite Surface {5} = {1,2,4,3} ;
Post by Dr Colin J. Cotter
When I run it in command line mode I get a mesh which is not perfectly
regular.
What do you mean by "not perfectly regular" ?

Dave
Post by Dr Colin J. Cotter
--cjc
Post by David Colignon
Hi Colin,
what about this ?
Point(1) = {0,0,0,0.1};
Extrude {1,0,0} { Point{1}; }
Extrude {0.5,0.866025403784,0} { Line{1}; }
Transfinite Line { 1 , 2 , 3 , 4 } = 5 ;
Transfinite Surface {5} Left ;
Cheers,
Dave
Christophe Geuzaine
2009-10-13 08:05:59 UTC
Permalink
Post by Dr Colin J. Cotter
Dear Gmsh list,
I have been trying to make a mesh of equilateral triangles by
extruding a horizontal line at a 60 degree angle (later I will use
periodic boundary conditions so I have an equilateral mesh on the
torus). I have noticed that if you do this then the extrusion divides
the quadrilaterals in the wrong direction and you don't get a Delaunay
Point(1) = {0,0,0,0.1};
Extrude {1,0,0} {
Point{1}; Layers{5};
}
Extrude {0.5,0.866025403784,0} {
Line{1}; Layers{5};
}
Point(1) = {0,0,0,0.1};
Extrude {1,0,0} {
Point{1}; Layers{5};
}
Extrude {-0.5,0.866025403784,0} {
Line{1}; Layers{5};
}
Is there a way to force Gmsh to produce a Delaunay mesh in the first case?
there's no option to subdivide in the other direction... but you could
use the following trick:

Point(1) = {1,0,0,0.1};
Extrude {-1,0,0} {
Point{1}; Layers{5};
}
Extrude {0.5,0.866025403784,0} {
Line{1}; Layers{5};
}
Post by Dr Colin J. Cotter
all the best
--cjc
_______________________________________________
gmsh mailing list
http://www.geuz.org/mailman/listinfo/gmsh
--
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science
http://www.montefiore.ulg.ac.be/~geuzaine
Loading...