I intend to use the gmsh2nek
tool from the Nek5000 library to convert a gmsh
mesh to re2
format. So far I have been able to successfully use the gmsh2nek
tool for the following cube.geo
file.
//Sets the mesh element order
Mesh.ElementOrder = 2;
//Sets the mesh version for exporting the mesh
Mesh.MshFileVersion = 2.2;
Point(1) = {0, 0, 0, 1.0};
Point(2) = {1, 0, 0, 1.0};
Point(3) = {1, 1, 0, 1.0};
Point(4) = {0, 1, 0, 1.0};
Line(1) = {4, 3};
Line(2) = {3, 2};
Line(3) = {2, 1};
Line(4) = {1, 4};
Line Loop(5) = {1, 2, 3, 4};
Plane Surface(6) = {5};
Transfinite Line {1, 2, 3, 4} = 4 Using Progression 1;
Transfinite Surface {6};
Recombine Surface {6};
//+
Extrude {0, 0, 1} {
Surface{6};
Layers{3};
Recombine;
}
Physical Surface("inlet", 29) = {15};
Physical Surface("outlet", 30) = {23};
Physical Surface("walls", 31) = {28, 27, 6, 19};
Physical Volume("fluid", 32) = {1};
I want to model a reactor fuel pin for which I started by sketching a cylinder inside a cylinder (pellet inside clad) for the time being in FreeCAD
, exported it in the STEP
format and opened it gmsh
. The generated mesh seemed fine to me. However gmsh2nek
didn’t work due to the following error:
only line3 and quad8/9 elements are accepted
please choose "set order 2" option to set all elements to 2nd order
please uncheck "save all elements" when exporting mesh
please see readme for more information
I have saved the generated mesh in the ASCII 2 format. The mesh appears fine to me.
However when I observe the .msh
file for the cube (where gmsh2nek
worked) and the file my 2 cylinders, I see that the section $Elements
of cube.msh
only has gmsh
element types with element_ids
10 (Quadrilateral9 – (something called serendipity quadratic quadrilateral) & 12 (this I couldn’t figure out). I think this is somewhere correlated to the error which is asking me to use line3 or quad8/9 elements.
cube.msh snippet
// Comment - Each line is element_id element_type number_of_tags <tags> node_1 node_2 ... node_n.
// Comment - 2nd digit is of our use - element_type
$Elements
81
1 10 2 31 6 4 9 69 25 11 73 74 28 75
2 10 2 31 6 25 69 70 24 74 76 77 27 78
3 10 2 31 6 24 70 20 1 77 79 23 26 80
4 10 2 31 6 9 10 71 69 12 81 82 73 83
....
55 12 2 32 1 69 9 4 25 219 94 49 171 73 74 227 11 98 28 51 181 228 229 99 189 75 230 231 100 190 232 233
56 12 2 32 1 219 94 49 171 220 95 50 172 228 229 234 99 101 189 52 184 235 236 102 191 232 237 238 103 192 239 240
....
$EndElements
OTOH, the $Elements
of the my cylinders .msh
file has all kinds of different gmsh
element types – 5 -> Hexahedron8 (linear hexahedron), 3 -> Quadrilateral4 (linear quadrilateral), 1 -> Line2 (linear line) and 15.
How do I create a cylinder by using the gmsh
element types which the error is indicating me to use?
What all I have tried so far?
- tried to make the cylinders using a
.geo
file – same error - tried to make the cylinders using
gmsh Python API
– same error
I am quite the beginner in 3D modelling and all these softwares so I might be understanding something quite fundamental incorrectly. Please point me in the right direction.