Dear list members,

I have encountered some unusual behavior while trying to generate a very simple structured tetrahedral mesh for two boxes. The attached images show the surface (triangle) and volumetric (tetrahedron) elements of the same mesh. However, some of the triangles do not "sit" properly on the face of the corresponding tetrahedron but they are "laid across" on two tetrahedra. This is marked with red arrows on the images. I have also attached the script resulting this mesh.

I generated these pictures using gmsh version 2.9.1 but some other versions also produce the same problem.

Thank you for your help,

Jozsef Kophazi


////////    Configuration block     ////////
// Possible values:
//    lores  0.1
//    mdres  0.025
//    mhres  0.010
//    hires  0.005
den=0.1;
top_structured=1;
top_hex=0;
bottom_structured=1;
bottom_hex=0;
alternate=0;
//////// End of configuration block ////////


// 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.;

If( top_structured == 1 )
  If( alternate == 1 )
    Transfinite Surface { t_surface} Alternate;
    Transfinite Surface {ft_surface} Alternate;
    Transfinite Surface {bt_surface} Alternate;
    Transfinite Surface {rt_surface} Alternate;
    Transfinite Surface {lt_surface} Alternate;
  EndIf
  If( alternate == 0 )
    Transfinite Surface { t_surface};
    Transfinite Surface {ft_surface};
    Transfinite Surface {bt_surface};
    Transfinite Surface {rt_surface};
    Transfinite Surface {lt_surface};
  EndIf
EndIf

If( bottom_structured == 1 )
  If( alternate == 1 )
    Transfinite Surface { b_surface} Alternate;
    Transfinite Surface {fb_surface} Alternate;
    Transfinite Surface {bb_surface} Alternate;
    Transfinite Surface {rb_surface} Alternate;
    Transfinite Surface {lb_surface} Alternate;
  EndIf
  If( alternate == 0 )
    Transfinite Surface { b_surface};
    Transfinite Surface {fb_surface};
    Transfinite Surface {bb_surface};
    Transfinite Surface {rb_surface};
    Transfinite Surface {lb_surface};
  EndIf
EndIf

If( top_structured == 1 || bottom_structured == 1 )
  If( alternate == 1 )
    Transfinite Surface {m_surface} Alternate;
  EndIf
  If( alternate == 0 )
    Transfinite Surface {m_surface};
  EndIf
EndIf

If( top_hex == 1 )
  Recombine Surface {t_surface};
  Recombine Surface {ft_surface};
  Recombine Surface {bt_surface};
  Recombine Surface {rt_surface};
  Recombine Surface {lt_surface};
EndIf
If( bottom_hex == 1 )
  Recombine Surface {b_surface};
  Recombine Surface {fb_surface};
  Recombine Surface {bb_surface};
  Recombine Surface {rb_surface};
  Recombine Surface {lb_surface};
EndIf


If( top_hex == 1 && bottom_hex == 1 )
  Recombine Surface {m_surface};
EndIf

If( top_hex == 1 && bottom_hex == 0 )
  TransfQuadTri {t_volume};
EndIf
If( top_hex == 0 && bottom_hex == 1 )
  TransfQuadTri {b_volume};
EndIf

If( top_structured == 1 )
  Transfinite Volume {t_volume} ;
EndIf

If( bottom_structured == 1 )
  Transfinite Volume {b_volume} ;
EndIf

// 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};


_______________________________________________
gmsh mailing list
[email protected]
http://onelab.info/mailman/listinfo/gmsh

Reply via email to