msh2geo(1rheolef)
π msh2geo β the glow-up your gmsh mesh deserves π
okay bestie, real talk: this is msh2geo, and it lives in the rheolef manual, section 1. it takes a mesh from the gmsh girlies and hands it to Rheolef in its own .geo language. it's giving translator, it's giving bridge between two friend groups. π¦
β¨ NAME β¨
msh2geo β convert a gmsh mesh into geo format (that's rheolef-7.2, periodt π
)
β¨ SYNOPSIS β¨
msh2geo [-zr|-rz] < file[.msh] > output.geo
msh2geo [-zr|-rz] file[.msh] > output.geo
β¨ DESCRIPTION β¨
so basically πΈ you have a .msh file β the kind the gmsh mesh generator spits out β and you want a .geo one for Rheolef. that's the whole job, and msh2geo eats it for breakfast.
where does the output go? standard output, always. no cap. π«
and the input? your choice, main character:
- it comes from standard input, or
- it comes from a file β either way, you pick.
β¨ EXAMPLES β¨
first up, the classic 2D moment:
gmsh -2 toto.mshcad -o toto.msh
msh2geo < toto.msh > toto.geo
now let's make it fancy with order 2, because why be basic:
gmsh -2 -order 2 toto.mshcad -o toto2.msh
msh2geo < toto2.msh > toto2.geo
also, if you wanna know what goes in that .mshcad input file for gmsh, the gmsh documentation has the detailed tea. go read it, iykyk. π
β¨ OPTIONS β¨
-cartesianβ picks the cartesian coordinate system. this is the default, the vanilla of coordinate systems, and honestly? iconic for it. β¨-rzβ picks an axisymmetric coordinate system. β¨-zrβ picks an axisymmetric coordinate system too, just the other order. β¨
π‘ reminder bestie: most Rheolef codes do NOT care which coordinate system you're in. the coordinate system gets specified in the geometry file .geo. so breathe. π«Ά
β¨ IMPLEMENTATION NOTES β¨
okay this is the part where things get real, and lowkey messy, so pay attention π
there's an issue with curved boundaries when you're using high order Pk polynomial elements. specifically: Pk triangle, when k>=5, may have its internal nodes renumbered. π
here's the gmsh documentation tea on it β the nodes of a curved element are numbered in this order:
- the element principal vertices;
- the internal nodes for each edge;
- the internal nodes for each face;
- the volume internal nodes.
and the numbering for face and volume internal nodes is recursive, meaning the numbering follows that of the nodes of an embedded face/volume. the higher order nodes are assumed to be equispaced on the element. π
now in Rheolef, internal triangle nodes are numbered from left to right and then from bottom to top. so the numbering differs for triangle when k >= 5. that's the drama. π
good news though: msh2geo fixes the corresponding internal nodes numbering during the conversion. slay. π
and there's more: Pk tetrahedrons and hexahedrons in gmsh and Rheolef do not have the same edge-node order and orientation. e.g. for tetrahedrons, edges 13 and 23 should be swapped and reoriented as 32 and 31. so yeah, msh2geo also fixes the corresponding internal nodes numbering. it's doing the work. π
β¨ TODO β¨
the to-do list, aka the group chat of things we're not done with yet π
- Fix for P3-tetra: swap edges orientations for
3,4,5and swap faces1and2. Check P4(T) for face orientation. Perform face visualization with gnuplot face fill. - See also hexa edges orient and faces numbers and orient.
- Check that node are numbered by vertex-node, then edge-node, then face(tri,qua)-node and then volume(T,P,H)-node. Otherwise, renumber all nodes.
- Support for high order >= 6 element is not documented in gmsh, but gmsh supports it at run
β¨ IMPLEMENTATION β¨
fun fact for the lore girlies: this documentation has been generated from file main/sbin/msh2geo.cc. β¨
β¨ AUTHOR β¨
Pierre Saramito <Pierre.Saramito@imag.fr> β the icon, the legend, the one who wrote it. π
β¨ COPYRIGHT β¨
Copyright (C) 2000-2018 Pierre Saramito <Pierre.Saramito@imag.fr>
GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. fr fr, read it and weep (or don't, because it's free software and that's the vibe π)
and that's the whole page, bestie! π this was rheolef, Version 7.2, dated msh2geo(1rheolef) β go convert something gorgeous. π¦β¨π
π¦ where this page comes from
- debian trixie: rheolef 7.2-4 Β· GPL-3.0-or-later
- ubuntu noble: rheolef 7.2-3build5 Β· GPL-3.0-or-later
- ubuntu questing: rheolef 7.2-4build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms