CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Open Source Meshers: Gmsh, Netgen, CGNS, ... (
-   -   Create Hex Mesh (

fabrizio November 3, 2008 11:37

Hi dear users, I'm an engineer
Hi dear users, I'm an engineer student in Milan, Italy. I use Calculix to build Fem analysis importing OpenFoam results. To complete this import I need a hex mesh; how can I create a hex mesh with Gmsh? I've read a lot of tutorial, but are all concerning Gmsh generation of tet mesh.
Can you help me?

King regards


philippose November 3, 2008 14:30

Hello Fabrizio, As far as I
Hello Fabrizio,

As far as I am aware, Gmsh cannot create a Hex mesh of a complex 3D geometry.

For most practical cases I have come across, Gmsh (and all other open source meshing software I have tried) only generates pure tetrahedral meshes.


fabrizio November 3, 2008 16:33

Hi thank you for your reply. M
Hi thank you for your reply. My geometry is quite simple. Can you tell me how use gmsh to generate the mesh?

Thank you


philippose November 3, 2008 17:18

Hello again, Well.... I cou
Hello again,

Well.... I could probably help you out if I got to see the geometry :-)! As in... for example...

1. What format is your geometry in?
2. Have you been able to load it into GMSH yet?
3. What format do you want the output in... and does GMSH support this format?
4. How does the geometry itself look?
5. etc...etc...

Quoting from the GMSH Website:
"Gmsh's mesh module regroups several 1D, 2D and 3D mesh algorithms, all producing grids conforming in the sense of finite elements (see section 1.2 Mesh: finite element mesh generation).

The 2D unstructured algorithms generate triangles or both triangles and quadrangles (when Recombine Surface is used: see 4.2.3 Miscellaneous). The 3D unstructured algorithms only generate tetrahedra.

The 2D structured algorithms (transfinite and extrusion) generate triangles by default, but quadrangles can be obtained by using the Recombine commands (see 4.2.2 Structured grids, and 4.2.3 Miscellaneous). The 3D structured algorithms generate tetrahedra, hexahedra, prisms and pyramids, depending on the type of the surface meshes they are based on. "

So, if you need to create unstructured 3D meshes, then tetrahedral meshes are the only option....

Hope this helps..


fabrizio November 5, 2008 11:30

Hi Philippose thank for help.
Hi Philippose thank for help. I've decided to try another way to mesh my model, I think that SnappyHexMesh utility could be great for my pourpose.

Thank you again


mavimo November 9, 2008 13:17

Hi fabrizio, I'm aso a enginee
Hi fabrizio, I'm aso a engineer student in Milan

For snappyHexMesh I'm writing tutorial, you can find first step on [IT].

If you have sono question or can help me to write it please contact me

fabrizio November 9, 2008 14:20

Hi Marco thanks for your reply
Hi Marco thanks for your reply. I have some problems in writing the snappyHexMeshDict file, the OF tutorial about this topic is not very clear in my opinion. I've read the tutorial in the site you suggested, but it's not about snappyHexMeshDict file, I've alredy created the base mesh with blockMesh utility; I'll be very interested in the second part of the tutorial when it will be on line. If you want we can meet in university, so we can speak about our OF works.

Thank you again


mavimo November 10, 2008 14:59

hi fabrizio, contact me by mai
hi fabrizio, contact me by mail (find it on my profile)

erik023 November 12, 2008 12:48

dear all, i have the problem
dear all,
i have the problem of getting very poor results when using a finer (0.1-0.3 m) background (blockmesh) for snappy. it does not seem to perform the refine surface. i get muche better results for the surface when using a very coarse background mesh (0.5-1m)

why is it behaving this way, there is now error when i run checkmesh?

thanks erik

idrama March 22, 2010 10:09

Ciao mavimo,

I tried to reach your page which did you announced. But i could not get on it. Is it down? However, proparly you are very involved into snappyhexmesh. Therefore , I want to ask you the question how to avoid polyheder. Because I need a mesh consisting purely of hexhedron. How can I make it happen?


All times are GMT -4. The time now is 08:10.