[Gmsh] GMSH crashes

Gmsh User amrit_pou at hotmail.com
Thu May 12 02:41:16 CEST 2011


Hello GMSH users,
I noticed that GMSH crashes every time I try to optimize first order tetrahedral
mesh of the geometry that is attached at the end of this post. I tried GMSH's
Optimize 3D and also Netgen Optimizer, however, both of them crashed on me.
Is there anyway to fix this problem? Tetrahedrons obtained from preliminary
meshing in GMSH are of poor quality because I get errors when I try to compute
barycentric coordinates from these tetrahedrons.
Any help/suggestions will be appreciated !
Thanks.

// begin .geo file 
********************************

// Mesh size
lc = 0.2 ; // change this if needed

// All point at z = -1.5 
z = -1.5 ; 
Point(1) = {-1.0, -1.0, z, lc} ;
Point(2) = {-1.0, 1.0, z, lc} ;
Point(3) = {1.0, 1.0, z, lc} ;
Point(4) = {1.0, -1.0, z, lc} ;
Point(5) = {-1.5, -1.5, z, lc} ;
Point(6) = {-1.5, -1.0, z, lc} ;
Point(7) = {-1.5, 1.0, z, lc} ;
Point(8) = {-1.5, 1.5, z, lc} ;
Point(9) = {-1.0, 1.5, z, lc} ;
Point(10) = {1.0, 1.5, z, lc} ;
Point(11) = {1.5, 1.5, z, lc} ;
Point(12) = {1.5, 1.0, z, lc} ;
Point(13) = {1.5, -1.0, z, lc} ;
Point(14) = {1.5, -1.5, z, lc} ;
Point(15) = {1.0, -1.5, z, lc} ;
Point(16) = {-1.0, -1.5, z, lc} ;



// Z surface bottom (PML)
// Lines
Line(1) = {1, 2} ;
Line(2) = {2, 3} ;
Line(3) = {3, 4} ;
Line(4) = {4, 1} ;
Line Loop(5) = {1, 2, 3, 4} ;
// Surface 
Plane Surface(6) = {5} ;


// XZ Edge North (PML)
// Lines
Line(7) = {6 ,7} ;
Line(8) = {7, 2} ;
Line(9) = {1, 6} ;
Line Loop(10) = {7, 8, -1, 9} ;
// Surface 
Plane Surface(11) = {10} ; 



// YZ Edge East (PML) 
// Lines
Line(12) = {2, 9} ;
Line(13) = {9, 10} ;
Line(14) = {10, 3} ;
Line Loop(15) = {12, 13, 14, -2} ;
// Surface 
Plane Surface(16) = {15} ; 


// XZ Edge South (PML) 
// Lines
Line(17) = {3, 12} ;
Line(18) = {12, 13} ;
Line(19) = {13, 4} ;
Line Loop(20) = {-3, 17, 18, 19} ;
// Surface 
Plane Surface(21) = {20} ; 


// YZ Edge West (PML)
// Lines
Line(22) = {16, 1} ;
Line(23) = {4, 15} ;
Line(24) = {15, 16} ;
Line Loop(25) = {22, -4, 23, 24} ;
// Surface 
Plane Surface(26) = {25} ; 




// XYZ Corner  North-West (PML)
// Lines
Line(27) = {5, 6} ;
Line(28) = {16, 5} ;
Line Loop(29) = {27, -9, -22, 28} ;
// Surface 
Plane Surface(30) = {29} ; 



// XYZ Corner North-East (PML)
// Lines
Line(31) = {7, 8} ;
Line(32) = {8, 9} ;
Line Loop(33) = {31, 32, -12, -8 } ;
// Surface 
Plane Surface(34) = {33} ; 


// XYZ Corner South-East (PML) 
// Lines
Line(35) = {10, 11} ;
Line(36) = {11, 12} ;
Line Loop(37) = {-14, 35, 36, -17} ;
// Surface 
Plane Surface(38) = {37} ; 


// XYZ Corner South-West (PML) 
// Lines
Line(39) = {13, 14} ;
Line(40) = {14, 15} ;
Line Loop(41) = {-23, -19, 39, 40} ;
// Surface 
Plane Surface(42) = {41} ; 


// (First) all volumes from surfaces at z = -1.5
// NOTE :out[] = Extrude{} {Surface{};} ; 
// Here out[0] contains surface number of "top surface" of the extrusion and
out[1] contains the volume number

VolF6[] = Extrude{0, 0, 0.5} {Surface{6}; } ; 
VolF11[] = Extrude{0, 0, 0.5} {Surface{11}; } ; 
VolF16[] = Extrude{0, 0, 0.5} {Surface{16}; } ; 
VolF21[] = Extrude{0, 0, 0.5} {Surface{21}; } ; 
VolF26[] = Extrude{0, 0, 0.5} {Surface{26}; } ; 
VolF30[] = Extrude{0, 0, 0.5} {Surface{30}; } ; 
VolF34[] = Extrude{0, 0, 0.5} {Surface{34}; } ; 
VolF38[] = Extrude{0, 0, 0.5} {Surface{38}; } ; 
VolF42[] = Extrude{0, 0, 0.5} {Surface{42}; } ; 


// (Second) all volumes from surfaces at z = -1.0
VolS6[] = Extrude{0, 0, 2} {Surface{VolF6[0]}; } ;  
VolS11[] = Extrude{0, 0, 2} {Surface{VolF11[0]}; } ; 
VolS16[] = Extrude{0, 0, 2} {Surface{VolF16[0]}; } ; 
VolS21[] = Extrude{0, 0, 2} {Surface{VolF21[0]}; } ; 
VolS26[] = Extrude{0, 0, 2} {Surface{VolF26[0]}; } ; 
VolS30[] = Extrude{0, 0, 2} {Surface{VolF30[0]}; } ; 
VolS34[] = Extrude{0, 0, 2} {Surface{VolF34[0]}; } ; 
VolS38[] = Extrude{0, 0, 2} {Surface{VolF38[0]}; } ; 
VolS42[] = Extrude{0, 0, 2} {Surface{VolF42[0]}; } ; 


// (Third) all volumes from surfaces at z = 1.0
VolT6[] = Extrude{0, 0, 0.5} {Surface{VolS6[0]}; } ; 
VolT11[] = Extrude{0, 0, 0.5} {Surface{VolS11[0]}; } ; 
VolT16[] = Extrude{0, 0, 0.5} {Surface{VolS16[0]}; } ; 
VolT21[] = Extrude{0, 0, 0.5} {Surface{VolS21[0]}; } ; 
VolT26[] = Extrude{0, 0, 0.5} {Surface{VolS26[0]}; } ; 
VolT30[] = Extrude{0, 0, 0.5} {Surface{VolS30[0]}; } ; 
VolT34[] = Extrude{0, 0, 0.5} {Surface{VolS34[0]}; } ; 
VolT38[] = Extrude{0, 0, 0.5} {Surface{VolS38[0]}; } ; 
VolT42[] = Extrude{0, 0, 0.5} {Surface{VolS42[0]}; } ; 


// Group volumes with same material together
Physical Volume(1000) = {VolF6[1], VolT6[1]} ;  // PML Z surface volume
Physical Volume(1001) = {VolS11[1], VolS21[1]} ; // PML X surface volume
Physical Volume(1002) = {VolS16[1], VolS26[1]} ; // PML Y surface volume

Physical Volume(1003) = {VolF11[1], VolF21[1],VolT11[1], VolT21[1]} ; // PML ZX
edges volume
Physical Volume(1004) ={VolF16[1], VolF26[1], VolT16[1], VolT26[1]} ; // PML YZ
edges volume
Physical Volume(1005) = {VolS30[1], VolS34[1], VolS38[1], VolS42[1] } ; // PML
XY edges volume


Physical Volume(1006) = {VolF30[1], VolF34[1], VolF38[1], VolF42[1], VolT30[1],
VolT34[1], VolT38[1], VolT42[1] } ; // PML XYZ corners volume


Physical Volume(1007) = {VolS6[1]} ;