Mesh with Unique element

I wonder if native Gmsh also has this behavior where changing the element order affects the number of elements, perhaps it’s worth reporting as a bug.

The same behavior can be reproduced in gmsh, but it can be circumvented.

Example
Transfinite a 2D mesh, resulting in a triangular mesh with an odd number of elements along the edges (3 and 5 in this example).

Then select recombine triangular meshes:

In the first animation, the number of elements doesn’t change because only 2D generation is triggered.

In the second animation, an even number of elements is generated because 1D generation is triggered first, followed by 2D.

This is not in general the case, but in my experience this happens in most cases.

Animation1

Animation2

1 Like

So extrusion will also be affected because it uses 2D transfinite/recombined mesh as a base.

After fixing the PrePoMax code it is now possilble to create a mesh of a single hex.

I think I added rounding of the number of elements to the even numbers for the full-quad recombine algorithms to work in general. I will look deeper into this.

1 Like