[Gmsh] Unusual phenomena related to transfinite option

Kópházi József j.kophazi at imperial.ac.uk
Mon Dec 16 18:12:35 CET 2013


Dear list members,

I experienced some unusal phenomena when trying to produce structured 
tetrahedral meshes. I've attached two examples.

The first one is twobox.geo. Here a cube is divided into two regions and 
both regions are meshed with transfinite option. As it is shown on 
twobox_crossed_witharrows.png (attached) the surface elements at some 
faces of the cube are not conforming to the underlying spatial elements.

The second example is a cube in a sphere (cubeinsphere.geo). The cube is 
again meshed with transfinite method while in the surrounding parts of 
the sphere an unstructured mesh is created. The attached picture 
(cubeinsphere_closeup_with arrows.png) shows the volumetric elements. As 
it is well visible, some of the volumetric elements are "crossed" at the 
interface of the cube and the sphere, and not connected one by one.

The pictures were created using gmsh 2.5.1, but 2.8.3 produces similar 
results. Moreover, the newer version seems to create two independent 
meshes in the cube. This is shown on cubeinsphere_gmsh-2.8.3.png.

Thank you for your help in advance,

Jozsef


-------------- next part --------------


den=0.06;			// Mesh density


center_point = newp;	Point(center_point) = {   0.0,   0.0,   0.0, den};

cube_frt_point = newp;	Point(cube_frt_point) = {   0.5,   0.5,   0.5, den};
cube_brt_point = newp;	Point(cube_brt_point) = {  -0.5,   0.5,   0.5, den};
cube_flt_point = newp;	Point(cube_flt_point) = {   0.5,  -0.5,   0.5, den};
cube_blt_point = newp;	Point(cube_blt_point) = {  -0.5,  -0.5,   0.5, den};

cube_frb_point = newp;	Point(cube_frb_point) = {   0.5,   0.5,  -0.5, den};
cube_brb_point = newp;	Point(cube_brb_point) = {  -0.5,   0.5,  -0.5, den};
cube_flb_point = newp;	Point(cube_flb_point) = {   0.5,  -0.5,  -0.5, den};
cube_blb_point = newp;	Point(cube_blb_point) = {  -0.5,  -0.5,  -0.5, den};

sphere_fr_point = newp;	Point(sphere_fr_point) = {   1.0,   0.0,   0.0, den};
sphere_ba_point = newp;	Point(sphere_ba_point) = {  -1.0,   0.0,   0.0, den};
sphere_ri_point = newp;	Point(sphere_ri_point) = {   0.0,   1.0,   0.0, den};
sphere_le_point = newp;	Point(sphere_le_point) = {   0.0,  -1.0,   0.0, den};
sphere_to_point = newp;	Point(sphere_to_point) = {   0.0,   0.0,   1.0, den};
sphere_bo_point = newp;	Point(sphere_bo_point) = {   0.0,   0.0,  -1.0, den};


cube_front_right_line = newl;	Line(cube_front_right_line)	= {cube_frb_point, cube_frt_point};
cube_right_top_line = newl;	Line(cube_right_top_line)	= {cube_frt_point, cube_brt_point};
cube_back_right_line = newl;	Line(cube_back_right_line)	= {cube_brt_point, cube_brb_point};
cube_right_bottom_line = newl;	Line(cube_right_bottom_line)	= {cube_brb_point, cube_frb_point};

cube_front_left_line = newl;	Line(cube_front_left_line)	= {cube_flb_point, cube_flt_point};
cube_left_top_line = newl;	Line(cube_left_top_line)	= {cube_flt_point, cube_blt_point};
cube_back_left_line = newl;	Line(cube_back_left_line)	= {cube_blt_point, cube_blb_point};
cube_left_bottom_line = newl;	Line(cube_left_bottom_line)	= {cube_blb_point, cube_flb_point};

cube_back_bottom_line = newl;	Line(cube_back_bottom_line)	= {cube_brb_point, cube_blb_point};
cube_back_top_line = newl;	Line(cube_back_top_line)	= {cube_brt_point, cube_blt_point};
cube_front_top_line = newl;	Line(cube_front_top_line)	= {cube_flt_point, cube_frt_point};
cube_front_bottom_line = newl;	Line(cube_front_bottom_line)	= {cube_flb_point, cube_frb_point};

sphere_bottom_right_line = newl;	Circle(sphere_bottom_right_line)	= {sphere_bo_point, center_point, sphere_ri_point};
sphere_right_back_line = newl;		Circle(sphere_right_back_line)		= {sphere_ri_point, center_point, sphere_ba_point};
sphere_bottom_back_line = newl;		Circle(sphere_bottom_back_line)		= {sphere_bo_point, center_point, sphere_ba_point};
sphere_back_left_line = newl;		Circle(sphere_back_left_line)		= {sphere_ba_point, center_point, sphere_le_point};

sphere_left_bottom_line = newl;		Circle(sphere_left_bottom_line)		= {sphere_le_point, center_point, sphere_bo_point};
sphere_right_top_line = newl;		Circle(sphere_right_top_line)		= {sphere_ri_point, center_point, sphere_to_point};
sphere_top_back_line = newl;		Circle(sphere_top_back_line)		= {sphere_to_point, center_point, sphere_ba_point};
sphere_top_left_line = newl;		Circle(sphere_top_left_line)		= {sphere_to_point, center_point, sphere_le_point};

sphere_left_front_line = newl;		Circle(sphere_left_front_line)		= {sphere_le_point, center_point, sphere_fr_point};
sphere_front_top_line = newl;		Circle(sphere_front_top_line)		= {sphere_fr_point, center_point, sphere_to_point};
sphere_front_bottom_line = newl;	Circle(sphere_front_bottom_line)	= {sphere_fr_point, center_point, sphere_bo_point};
sphere_front_right_line = newl;		Circle(sphere_front_right_line)		= {sphere_fr_point, center_point, sphere_ri_point};

// Faces of the cube

cube_rightface_lineloop = newll;
Line Loop(cube_rightface_lineloop) = {cube_right_bottom_line, cube_front_right_line, cube_right_top_line, cube_back_right_line};
cube_rightface_surface = news;
Plane Surface(cube_rightface_surface) = {cube_rightface_lineloop};

cube_leftface_lineloop = newll;
Line Loop(cube_leftface_lineloop) = {cube_left_bottom_line, cube_front_left_line, cube_left_top_line, cube_back_left_line};
cube_leftface_surface = news;
Plane Surface(cube_leftface_surface) = {cube_leftface_lineloop};

cube_backface_lineloop = newll;
Line Loop(cube_backface_lineloop) = {cube_back_bottom_line, -cube_back_left_line, -cube_back_top_line, cube_back_right_line};
cube_backface_surface = news;
Plane Surface(cube_backface_surface) = {cube_backface_lineloop};

cube_topface_lineloop = newll;
Line Loop(cube_topface_lineloop) = {cube_right_top_line, cube_back_top_line, -cube_left_top_line, cube_front_top_line};
cube_topface_surface = news;
Plane Surface(cube_topface_surface) = {cube_topface_lineloop};

cube_frontface_lineloop = newll;
Line Loop(cube_frontface_lineloop) = {cube_front_right_line, -cube_front_top_line, -cube_front_left_line, cube_front_bottom_line};
cube_frontface_surface = news;
Plane Surface(cube_frontface_surface) = {cube_frontface_lineloop};

cube_bottomface_lineloop = newll;
Line Loop(cube_bottomface_lineloop) = {cube_right_bottom_line, -cube_front_bottom_line, -cube_left_bottom_line, -cube_back_bottom_line};
cube_bottomface_surface = news;
Plane Surface(cube_bottomface_surface) = {cube_bottomface_lineloop};

// Faces of the sphere

sphere_fltface_lineloop = newll;
Line Loop(sphere_fltface_lineloop) = {sphere_top_left_line, sphere_left_front_line, sphere_front_top_line};
sphere_fltface_surface = news;
Ruled Surface(sphere_fltface_surface) = {sphere_fltface_lineloop};

sphere_flbface_lineloop = newll;
Line Loop(sphere_flbface_lineloop) = {sphere_front_bottom_line, -sphere_left_bottom_line, sphere_left_front_line};
sphere_flbface_surface = news;
Ruled Surface(sphere_flbface_surface) = {sphere_flbface_lineloop};

sphere_bltface_lineloop = newll;
Line Loop(sphere_bltface_lineloop) = {sphere_top_left_line, -sphere_back_left_line, -sphere_top_back_line};
sphere_bltface_surface = news;
Ruled Surface(sphere_bltface_surface) = {sphere_bltface_lineloop};

sphere_blbface_lineloop = newll;
Line Loop(sphere_blbface_lineloop) = {sphere_back_left_line, sphere_left_bottom_line, sphere_bottom_back_line};
sphere_blbface_surface = news;
Ruled Surface(sphere_blbface_surface) = {sphere_blbface_lineloop};

sphere_brbface_lineloop = newll;
Line Loop(sphere_brbface_lineloop) = {sphere_right_back_line, -sphere_bottom_back_line, sphere_bottom_right_line};
sphere_brbface_surface = news;
Ruled Surface(sphere_brbface_surface) = {sphere_brbface_lineloop};

sphere_frbface_lineloop = newll;
Line Loop(sphere_frbface_lineloop) = {sphere_front_right_line, -sphere_bottom_right_line, -sphere_front_bottom_line};
sphere_frbface_surface = news;
Ruled Surface(sphere_frbface_surface) = {sphere_frbface_lineloop};

sphere_frtface_lineloop = newll;
Line Loop(sphere_frtface_lineloop) = {sphere_front_top_line, -sphere_right_top_line, -sphere_front_right_line};
sphere_frtface_surface = news;
Ruled Surface(sphere_frtface_surface) = {sphere_frtface_lineloop};

sphere_brtface_lineloop = newll;
Line Loop(sphere_brtface_lineloop) = {sphere_top_back_line, -sphere_right_back_line, sphere_right_top_line};
sphere_brtface_surface = news;
Ruled Surface(sphere_brtface_surface) = {sphere_brtface_lineloop};


cube_surfaceloop = newsl;
Surface Loop(cube_surfaceloop) = {	cube_rightface_surface, cube_leftface_surface,
					cube_backface_surface, cube_topface_surface,
					cube_frontface_surface,	cube_bottomface_surface	};
cube_volume = newv;
Volume(cube_volume) = {cube_surfaceloop};





sphere_surfaceloop = newsl;
Surface Loop(sphere_surfaceloop) = {	sphere_fltface_surface, sphere_flbface_surface,
					sphere_bltface_surface, sphere_blbface_surface,
					sphere_brbface_surface, sphere_frbface_surface,
					sphere_frtface_surface, sphere_brtface_surface };
sphere_volume = newv;
Volume(sphere_volume) = {sphere_surfaceloop, cube_surfaceloop};


Transfinite Line {cube_front_right_line}	= 1/den Using Progression 1.;
Transfinite Line {cube_right_top_line}		= 1/den Using Progression 1.;
Transfinite Line {cube_back_right_line}		= 1/den Using Progression 1.;
Transfinite Line {cube_right_bottom_line}	= 1/den Using Progression 1.;
Transfinite Line {cube_front_left_line}		= 1/den Using Progression 1.;
Transfinite Line {cube_left_top_line}		= 1/den Using Progression 1.;
Transfinite Line {cube_back_left_line}		= 1/den Using Progression 1.;
Transfinite Line {cube_left_bottom_line}	= 1/den Using Progression 1.;
Transfinite Line {cube_back_bottom_line}	= 1/den Using Progression 1.;
Transfinite Line {cube_back_top_line}		= 1/den Using Progression 1.;
Transfinite Line {cube_front_top_line}		= 1/den Using Progression 1.;
Transfinite Line {cube_front_bottom_line}	= 1/den Using Progression 1.;

Transfinite Surface {cube_rightface_surface};
Transfinite Surface {cube_leftface_surface};
Transfinite Surface {cube_backface_surface};
Transfinite Surface {cube_topface_surface};
Transfinite Surface {cube_frontface_surface};
Transfinite Surface {cube_bottomface_surface};

Transfinite Volume {cube_volume};

Physical Surface("CubeRightFace") = { cube_rightface_surface };
Physical Surface("CubeBackFace") = { cube_backface_surface };
Physical Surface("CubeLeftFace") = { cube_leftface_surface };
Physical Surface("CubeTopFace") = { cube_topface_surface };
Physical Surface("CubeFrontFace") = { cube_frontface_surface };
Physical Surface("CubeBottomFace") = { cube_bottomface_surface };


Physical Surface("SphereFrontLeftTopFace") = {sphere_fltface_surface};
Physical Surface("SphereFrontLeftBottomFace") = {sphere_flbface_surface};
Physical Surface("SphereBackLeftTopFace") = {sphere_bltface_surface};
Physical Surface("SphereBackLeftBottomFace") = {sphere_blbface_surface};
Physical Surface("SphereBackRightBottomFace") = {sphere_brbface_surface};
Physical Surface("SphereFrontRightBottomFace") = {sphere_frbface_surface};
Physical Surface("SphereFrontRightTopFace") = {sphere_frtface_surface};
Physical Surface("SphereBackRightTopFace") = {sphere_brtface_surface};

Physical Volume("CubeVolume") = {cube_volume};
Physical Volume("SphereVolume") = {sphere_volume};

-------------- next part --------------

den=0.1;


// Points
blb_point = newp;	Point( blb_point) = {  0.0,   0.0,   0.0, den};
flb_point = newp;	Point( flb_point) = {  1.0,   0.0,   0.0, den};
brb_point = newp;	Point( brb_point) = {  0.0,   1.0,   0.0, den};
frb_point = newp;	Point( frb_point) = {  1.0,   1.0,   0.0, den};

blm_point = newp;	Point( blm_point) = {  0.0,   0.0,   0.5, den};
flm_point = newp;	Point( flm_point) = {  1.0,   0.0,   0.5, den};
brm_point = newp;	Point( brm_point) = {  0.0,   1.0,   0.5, den};
frm_point = newp;	Point( frm_point) = {  1.0,   1.0,   0.5, den};

blt_point = newp;	Point( blt_point) = {  0.0,   0.0,   1.0, den};
flt_point = newp;	Point( flt_point) = {  1.0,   0.0,   1.0, den};
brt_point = newp;	Point( brt_point) = {  0.0,   1.0,   1.0, den};
frt_point = newp;	Point( frt_point) = {  1.0,   1.0,   1.0, den};

// Lines
rb_line = newl;		Line( rb_line) = {frb_point, brb_point};
bb_line = newl;		Line( bb_line) = {brb_point, blb_point};
lb_line = newl;		Line( lb_line) = {blb_point, flb_point};
fb_line = newl;		Line( fb_line) = {flb_point, frb_point};

rm_line = newl;		Line( rm_line) = {frm_point, brm_point};
bm_line = newl;		Line( bm_line) = {brm_point, blm_point};
lm_line = newl;		Line( lm_line) = {blm_point, flm_point};
fm_line = newl;		Line( fm_line) = {flm_point, frm_point};

rt_line = newl;		Line( rt_line) = {frt_point, brt_point};
bt_line = newl;		Line( bt_line) = {brt_point, blt_point};
lt_line = newl;		Line( lt_line) = {blt_point, flt_point};
ft_line = newl;		Line( ft_line) = {flt_point, frt_point};

frt_line = newl;	Line(frt_line) = {frt_point, frm_point};
frb_line = newl;	Line(frb_line) = {frm_point, frb_point};
brb_line = newl;	Line(brb_line) = {brb_point, brm_point};
brt_line = newl;	Line(brt_line) = {brm_point, brt_point};

blb_line = newl;	Line(blb_line) = {blb_point, blm_point};
blt_line = newl;	Line(blt_line) = {blm_point, blt_point};
flt_line = newl;	Line(flt_line) = {flt_point, flm_point};
flb_line = newl;	Line(flb_line) = {flm_point, flb_point};


// Surfaces
b_lineloop = newll;	Line Loop(b_lineloop) = {fb_line, rb_line, bb_line, lb_line};
b_surface = news;	Plane Surface(b_surface) = {b_lineloop};
m_lineloop = newll;	Line Loop(m_lineloop) = {fm_line, rm_line, bm_line, lm_line};
m_surface = news;	Plane Surface(m_surface) = {m_lineloop};
t_lineloop = newll;	Line Loop(t_lineloop) = {rt_line, bt_line, lt_line, ft_line};
t_surface = news;	Plane Surface(t_surface) = {t_lineloop};

fb_lineloop = newll;	Line Loop(fb_lineloop) = {frb_line, -fb_line, -flb_line, fm_line};
fb_surface = news;	Plane Surface(fb_surface) = {fb_lineloop};
ft_lineloop = newll;	Line Loop(ft_lineloop) = {frt_line, -fm_line, -flt_line, ft_line};
ft_surface = news;	Plane Surface(ft_surface) = {ft_lineloop};
bb_lineloop = newll;	Line Loop(bb_lineloop) = {brb_line, bm_line, -blb_line, -bb_line};
bb_surface = news;	Plane Surface(bb_surface) = {bb_lineloop};
bt_lineloop = newll;	Line Loop(bt_lineloop) = {brt_line, bt_line, -blt_line, -bm_line};
bt_surface = news;	Plane Surface(bt_surface) = {bt_lineloop};
rb_lineloop = newll;	Line Loop(rb_lineloop) = {rb_line, brb_line, -rm_line, frb_line};
rb_surface = news;	Plane Surface(rb_surface) = {rb_lineloop};

rt_lineloop = newll;	Line Loop(rt_lineloop) = {frt_line, rm_line, brt_line, -rt_line};
rt_surface = news;	Plane Surface(rt_surface) = {rt_lineloop};
lb_lineloop = newll;	Line Loop(lb_lineloop) = {flb_line, -lb_line, blb_line, lm_line};
lb_surface = news;	Plane Surface(lb_surface) = {lb_lineloop};
lt_lineloop = newll;	Line Loop(lt_lineloop) = {flt_line, -lm_line, blt_line, lt_line};
lt_surface = news;	Plane Surface(lt_surface) = {lt_lineloop};

// Volumes
b_surfaceloop = newsl;	Surface Loop(b_surfaceloop) = {	b_surface, fb_surface, bb_surface,
							rb_surface, lb_surface, m_surface};
b_volume = newv;	Volume(b_volume) = {b_surfaceloop};
t_surfaceloop = newsl;	Surface Loop(t_surfaceloop) = {	m_surface, ft_surface, bt_surface,
							rt_surface, lt_surface, t_surface};
t_volume = newv;	Volume(t_volume) = {t_surfaceloop};

// Transfinite settings
Transfinite Line { rb_line} = 1/den Using Progression 1.;
Transfinite Line { bb_line} = 1/den Using Progression 1.;
Transfinite Line { lb_line} = 1/den Using Progression 1.;
Transfinite Line { fb_line} = 1/den Using Progression 1.;
Transfinite Line { rm_line} = 1/den Using Progression 1.;
Transfinite Line { bm_line} = 1/den Using Progression 1.;
Transfinite Line { lm_line} = 1/den Using Progression 1.;
Transfinite Line { fm_line} = 1/den Using Progression 1.;
Transfinite Line {frb_line} = 0.5/den Using Progression 1.;
Transfinite Line {brb_line} = 0.5/den Using Progression 1.;
Transfinite Line {blb_line} = 0.5/den Using Progression 1.;
Transfinite Line {flb_line} = 0.5/den Using Progression 1.;

Transfinite Line {frt_line} = 0.5/den Using Progression 1.;
Transfinite Line {brt_line} = 0.5/den Using Progression 1.;
Transfinite Line {blt_line} = 0.5/den Using Progression 1.;
Transfinite Line {flt_line} = 0.5/den Using Progression 1.;
Transfinite Line { rt_line} = 1/den Using Progression 1.;
Transfinite Line { bt_line} = 1/den Using Progression 1.;
Transfinite Line { lt_line} = 1/den Using Progression 1.;
Transfinite Line { ft_line} = 1/den Using Progression 1.;

Transfinite Surface { t_surface};
Transfinite Surface {ft_surface};
Transfinite Surface {bt_surface};
Transfinite Surface {rt_surface};
Transfinite Surface {lt_surface};

Transfinite Surface { b_surface};
Transfinite Surface {fb_surface};
Transfinite Surface {bb_surface};
Transfinite Surface {rb_surface};
Transfinite Surface {lb_surface};

Transfinite Surface {m_surface};
Transfinite Volume {t_volume} ;
Transfinite Volume {b_volume} ;

// Physical domains
Physical Surface("TopFace") = {t_surface};
Physical Surface("MiddleFace") = {m_surface};
Physical Surface("BottomFace") = {b_surface};
Physical Surface("UpperLeftFace") = {lt_surface};
Physical Surface("LowerLeftFace") = {lb_surface};
Physical Surface("UpperRightFace") = {rt_surface};
Physical Surface("LowerRightFace") = {rb_surface};
Physical Surface("UpperBackFace") = {bt_surface};
Physical Surface("LowerBackFace") = {bb_surface};
Physical Surface("UpperFrontFace") = {ft_surface};
Physical Surface("LowerFrontFace") = {fb_surface};

Physical Volume("TopVolume") = {t_volume};
Physical Volume("BottomVolume") = {b_volume};


-------------- next part --------------
A non-text attachment was scrubbed...
Name: twobox_crossed_with arrows.png
Type: image/png
Size: 16117 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20131216/87761140/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cubeinsphere_closeup_with arrows.png
Type: image/png
Size: 70585 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20131216/87761140/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cubeinsphere_gmsh-2.8.3.png
Type: image/png
Size: 75824 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20131216/87761140/attachment-0002.png>