CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Mesh Generation & Pre-Processing (https://www.cfd-online.com/Forums/mesh-generation/)
-   -   Convert existing gmsh mesh to second order? (https://www.cfd-online.com/Forums/mesh-generation/227086-convert-existing-gmsh-mesh-second-order.html)

hsnyder May 16, 2020 21:51

Convert existing gmsh mesh to second order?
 
Hello everyone,


Quick question about gmsh. Is there a way to take an existing gmsh .msh file, and convert it to second order elements? Specifically, I'm trying to go from 8-point hexahedra (hex8) to 20-point hexahedra (hex20). Ideally, I'd like a command-line solution. I tried this:


Code:

gmsh -o output.msh -format msh2 input.msh -order 2 -0

But it doesn't seem to work - I still get hex8 elements in the output. Is there a way to do this, or does the order need to be set when the mesh is first generated?

Thanks

hsnyder May 17, 2020 00:46

Answered my own question - you can do it using a gmsh script (i.e. a .geo file).

Code:


Merge "input.msh";

SetOrder 2;

Save "output.msh";


Saving that as "convert.geo", you can then run:

Code:

gmsh convert.geo -0


All times are GMT -4. The time now is 19:34.