Gmsh vs netgen tetrahedral mesh

Hi,

usually I am creating a more or less coarse 2nd or 1st order tetmesh with refinements depending on how much interessed I am in the part results. So far I was happy with the results that netgen provided. Now in 2.0.0 version gmsh is there as an advanced mesher. Does gmsh has any advantages over netgen in terms of tetrahedral mesh? In some older forum thread multiprocesser capabilities were discussed for example.

Now when i think of it… with netgen I often struggled to get a coarse mesh, it sometimes needed a certain minimum element length because the part had certain features. Other meshers (e.g. in Ansys) just kind of defeatured things on-the-fly and ended up with far less elements.

By the way i tried to mesh a simple part by adding “Meshing Parameters” and “Tetrahedral Gmsh” but always got i quite fine mesh… it seems that meshing parameters didn’t had any effect but on the netgen result.

image

image

image

Am i missing something?

Thanks in advance!

FreeCAD also has both Netgen and Gmsh for tetrahedral meshes and sometimes one handles the model better while sometimes the other one is superior so it’s good to have a choice. Netgen seems to be somewhat picky at times (in PrePoMax, it also fails to generate the mesh sometimes if max element size is too high) but I’ve seen a few issues with Gmsh implementation in FreeCAD too. However, it doesn’t have to be a fault of Gmsh only.

It should work: Version 1.5.0 - additional local mesh refinement? - #10 by Matej

In general, both meshers give appropriate results. Both meshers work differently regarding internal element size definitions, but I tried to generalize them so that the effect would be the same. In most of my tests, both meshers created meshes of similar sizes. But Netgen supports element size grading while Gmesh does not, so sometimes different results are created.

Gmsh has a possibility to defeature the geometry, but I did not try it out yet.

There is a bug in the 2.0.0 version where the mesh refinements do not work with Gmsh.

You could grade your mesh playing with the number of elements per curvature and per edge. If you don’t see any change , be sure your minimum element size is small enough to allow what you are requesting.


1 Like

Yes, it should work but can you please quickly try it? No matter what settings I do in Meshing Parameters (followed by “Tetrahedral_Gmsh”) it is not affecting the mesh…

Hey!

Thanks for pointing this out. I never used Elements per edge / Elements per curvature like this.

You only did this with “Meshing Parameters”, right? Or did you also define “Tetrahedral Gmsh”?

The problem with Gmsh is that if you use fine mesh on the curved edges, the mesh size is propagated to the surface internals. This is a setting that can be turned off but then the mesh goes from fine to coarse very quickly since no mesh grading limit can be used.

Only meshing parameters . You should give a try untill you find the right balance.

Yes. It would be ideal if one could first mesh one face for later extrude that surface the desired deep and number of layers.

Such a feature could be added only to the FE model tab. In such a case, the connection between the geometry and mesh is broken.

oh, what a pitty,
Gmsh has an option to mesh only the surface of the volume. Mesh=2;
I’m using it a lot combined with Mesh.Algorithm = 11;

By the way, you are doing a fantastic job. I think Prepomax is even nicer to mesh than Gmsh itself.
NOTE: I would suggest not closing the messages where you post new versions. I think most of us are left wanting to congratulate you when new revisions come out.

Yes, I know about it and I am still figuring out how to integrate it into PrePoMax.

Thank you!

I was not aware they were closed. It probably has something to do with how the category News was prepared. I will look into it.

1 Like

This is so nice by the way. I tried this already and its great on curved surfaces.