How to convert .msh files into .vtu files in Linux?

Hello, I am now using the “GMSH2OGS -i input.msh -o output.vtu” command, but the results generated by this grid file in the project file cannot display the BHE part. I don’t know if there is something wrong with my geo file or when converting the file format. This is my geo file. Please help me. Thank you!

lc = DefineNumber[ 5, Name "Parameters/lc" ];
Point(1) = {0, 0, 0, lc};
Point(2) = {20, 0, 0, lc};
Point(3) = {20, 20, 0, lc};
Point(4) = {0, 20, 0, lc};
Point(5) = {0, 20, 120, lc};
Point(6) = {20, 20, 120, lc};
Point(7) = {20, 0, 120, lc};
Point(8) = {0, 0, 120, lc};
Line(1) = {8, 7};
Line(2) = {7, 6};
Line(3) = {6, 5};
Line(4) = {5, 8};
Line(5) = {1, 2};
Line(6) = {2, 3};
Line(7) = {3, 4};
Line(8) = {4, 1};
Line(9) = {1, 8};
Line(10) = {5, 4};
Line(11) = {6, 3};
Line(12) = {2, 7};
Curve Loop(1) = {1, 2, 3, 4};
Plane Surface(1) = {1};
Curve Loop(2) = {3, 10, -7, -11};
Plane Surface(2) = {2};
Curve Loop(3) = {2, 11, -6, 12};
Plane Surface(3) = {3};
Curve Loop(4) = {7, 8, 5, 6};
Plane Surface(4) = {4};
Curve Loop(5) = {10, 8, 9, -4};
Plane Surface(5) = {5};
Curve Loop(6) = {1, -12, -5, 9};
Plane Surface(6) = {6};
Surface Loop(1) = {6, 1, 3, 2, 5, 4};
Volume(1) = {1};

Point(9) = {10, 10, 120, lc};
Point(10) = {10, 10, 0, lc};
Point{9} In Surface{1};
Point{10} In Surface{4};
Line(13) = {9, 10};

Physical Volume("0") = {1};
Physical Line("1") = {13};

Hello, I think this tutorial on the OGS-Website can help you, how to get a BHE mesh from gmsh. In your current gmsh input file I didn’t see that you mesh the volume and the BHE line. The tutorial is based on the gmsh python interface, the original gmsh commands should be equally.

I’n OGSTools we have a tool to generate BHE meshes, see the usage in this example. This tool is sufficient for simple models and delivers ready to use meshes to simulate BHEs with OGS.

Best regards, Max

1 Like

Thank you very much for your answer, I have successfully made a BHE mesh using python script!
I tried to build the 3d mesh using “mesh-3d” directly in the gmsh interface, but the generated mesh is not the same as the one built by the python script in the project file, is it because the two meshes are not the same?

Great! About the differences in gmsh I am not familiar with. This is a gmsh related questions, so you need to ask in gmsh forum or similar.

Okay, thank you again. Best wishes!