KyleVaughn / UM2

An unstructured mesh library for automated method of characteristic mesh generation
https://univeristy-of-michigan-unstructured-mesh-code.readthedocs.io/en/main/index.html#
MIT License
7 stars 2 forks source link

Fix self-intersecting quadratic mesh faces in a post-processing step #158

Closed KyleVaughn closed 4 months ago

KyleVaughn commented 4 months ago

Frequently, the mesh desired for MOC is coarse relative to the curvature of the geometry. This mean quadratic curves have a large curvature. The meshes generated by Gmsh can therefore sometimes have self-intersecting mesh faces.

Some insight into how this happens: Gmsh first creates a linear mesh, which has the correct topology. Then, the mesh is made quadratic by placing an additional vertex for each edge. These new vertices may lie on an entity's bounding curves, overlapping a linear edge of the same mesh element. See below for an example. order1 order2

We can currently detect when self-intersection occurs, but make no effort to fix it. I think we should be able to fix self-intersection in cases like this by translating the quadratic vertex of the straight edge by a small amount.

KyleVaughn commented 4 months ago

Added in https://github.com/KyleVaughn/UM2/pull/165