|
[Sponsors] |
Gmsh crashes and gives a segfault when trying to extrude mesh to 3D |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 24, 2022, 13:43 |
Gmsh crashes and gives a segfault when trying to extrude mesh to 3D
|
#1 |
New Member
Anthony Cummins
Join Date: Sep 2022
Posts: 4
Rep Power: 4 |
Hi all,
I'm using gmsh for the first time, and trying to create a mesh around a cylinder for use in OpenFOAM. When I try to extrude the mesh into 3D using the translation, it crashes immediately and gives a segmentation fault. My .geo file is below: __________________________________________ // Gmsh project created on Sat Sep 24 15:53:50 2022 SetFactory("OpenCASCADE"); //+ xbox = -1; ybox = 1; xfar= 20; xinlet = -8; yfar = 8; ncyl = 200; ninlet= 32; ntop = 32; nbot = 32; nybox = 16; nxbox = 128; noutlet = 32; Circle(1) = {0, 0, 0, 0.5, 0, 2*Pi}; //+ Point(2) = {xbox, ybox, 0, 1.0}; //+ Point(3) = {xbox, -ybox, 0, 1.0}; //+ Point(4) = {xfar, -ybox, 0, 1.0}; //+ Point(5) = {xfar, ybox, 0, 1.0}; //+ Point(6) = {xinlet, yfar, 0, 1.0}; //+ Point(7) = {xinlet, -yfar, 0, 1.0}; //+ Point(8) = {xfar, -yfar, 0, 1.0}; //+ Point(9) = {xfar, yfar, 0, 1.0}; //+ Line(2) = {6, 9}; //+ Line(3) = {6, 7}; //+ Line(4) = {7, 8}; //+ Line(5) = {8, 4}; //+ Line(6) = {9, 5}; //+ Line(7) = {4, 5}; //+ Line(8) = {2, 5}; //+ Line(9) = {3, 4}; //+ Line(10) = {2, 3}; //+ Transfinite Curve {1} = ncyl Using Progression 1; //+ Transfinite Curve {3} = ninlet Using Progression 1; //+ Transfinite Curve {2} = ntop Using Progression 1; //+ Transfinite Curve {4} = nbot Using Progression 1; //+ Transfinite Curve {10} = nybox Using Progression 1; //+ Transfinite Curve {7} = nybox Using Progression 1; //+ Transfinite Curve {8} = nxbox Using Progression 1; //+ Transfinite Curve {9} = nxbox Using Progression 1; //+ Transfinite Curve {6} = noutlet/2 Using Progression 1; //+ Transfinite Curve {5} = noutlet/2 Using Progression 1; //+ Curve Loop(1) = {3, 4, 5, -9, -10, 8, -6, -2}; //+ Plane Surface(1) = {1}; //+ Curve Loop(2) = {8, -7, -9, -10}; //+ Curve Loop(3) = {1}; //+ Plane Surface(2) = {2, 3}; ___________________________________ Any help will be greatly appreciated! |
|
September 24, 2022, 14:20 |
|
#2 |
Senior Member
Sayan Bhattacharjee
Join Date: Mar 2020
Posts: 495
Rep Power: 8 |
I played around a little bit, and did get a 3d grid, but the error report says something definitely isn't correct. Need to find out more about how to correct the errors.
I did it with the GUI, but the script had this code added automatically to the end of it. Maybe you can also add it to your script, and try it. Code:
//+ Extrude {0, 0, 10} { Surface{1}; Layers{10}; Recombine; } |
|
September 24, 2022, 14:28 |
|
#3 |
Senior Member
Sayan Bhattacharjee
Join Date: Mar 2020
Posts: 495
Rep Power: 8 |
The 2 sections don't combine. Don't know why. Additional code:
Code:
//+ Extrude {0, 0, 5} { Surface{1}; Surface{2}; Layers{5}; Recombine; } |
|
September 24, 2022, 14:33 |
|
#4 |
Senior Member
Sayan Bhattacharjee
Join Date: Mar 2020
Posts: 495
Rep Power: 8 |
Okay, now it works.
Code:
// Gmsh project created on Sat Sep 24 15:53:50 2022 SetFactory("OpenCASCADE"); //+ xbox = -1; ybox = 1; xfar= 20; xinlet = -8; yfar = 8; ncyl = 200; ninlet= 32; ntop = 32; nbot = 32; nybox = 16; nxbox = 128; noutlet = 32; Circle(1) = {0, 0, 0, 0.5, 0, 2*Pi}; //+ Point(2) = {xbox, ybox, 0, 1.0}; //+ Point(3) = {xbox, -ybox, 0, 1.0}; //+ Point(4) = {xfar, -ybox, 0, 1.0}; //+ Point(5) = {xfar, ybox, 0, 1.0}; //+ Point(6) = {xinlet, yfar, 0, 1.0}; //+ Point(7) = {xinlet, -yfar, 0, 1.0}; //+ Point(8) = {xfar, -yfar, 0, 1.0}; //+ Point(9) = {xfar, yfar, 0, 1.0}; //+ Line(2) = {6, 9}; //+ Line(3) = {6, 7}; //+ Line(4) = {7, 8}; //+ Line(5) = {8, 4}; //+ Line(6) = {9, 5}; //+ Line(7) = {4, 5}; //+ Line(8) = {2, 5}; //+ Line(9) = {3, 4}; //+ Line(10) = {2, 3}; //+ Transfinite Curve {1} = ncyl Using Progression 1; //+ Transfinite Curve {3} = ninlet Using Progression 1; //+ Transfinite Curve {2} = ntop Using Progression 1; //+ Transfinite Curve {4} = nbot Using Progression 1; //+ Transfinite Curve {10} = nybox Using Progression 1; //+ Transfinite Curve {7} = nybox Using Progression 1; //+ Transfinite Curve {8} = nxbox Using Progression 1; //+ Transfinite Curve {9} = nxbox Using Progression 1; //+ Transfinite Curve {6} = noutlet/2 Using Progression 1; //+ Transfinite Curve {5} = noutlet/2 Using Progression 1; //+ Curve Loop(1) = {3, 4, 5, -9, -10, 8, -6, -2}; //+ Plane Surface(1) = {1}; //+ Curve Loop(2) = {8, -7, -9, -10}; //+ Curve Loop(3) = {1}; //+ Plane Surface(2) = {2, 3}; //+ Extrude {0, 0, 5} { Surface{1}; Surface{2}; Layers{5}; Recombine; } |
|
September 24, 2022, 19:32 |
|
#5 |
New Member
Anthony Cummins
Join Date: Sep 2022
Posts: 4
Rep Power: 4 |
Thank you so much! I'm going to bed now, will write more tomorrow.
|
|
Tags |
gmsh, gmsh 4.8.4, gmsh cylinder |
|
|