Non manifold surface does not lead to an error anymore : warning instead #205
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR allows to return a mesh if the mesh adaptation stage leads to attach the discretized level-set surface to itself or to the bounding-box in a non-manifold way, i.e. the level-set surface touches itself or the box in one vertex only (2D, surface and 3D meshes) or in one edge only (3D meshes). See attached pictures for an illustration of what is considered as manifold level-set surfaces (top images) and as a non-manifold one (bottom images).
Manifold level-set surfaces :

Non-manifold level-set surfaces :

As it is not an expected behaviour (if we start the mesh adaptation stage with a manifold level-set surface, we should end with a similar topology), an error message and the
MMG5_STRONGFAILURE
return value was previoulsy returned without saving the mesh. As the mesh has been entirely remeshed and the generated mesh remains conformal and usable, now, we only raise a warning and the mesh is returned to the user (so the user can decide to use it or not).Note that we still want to raise an error and to refuse to remesh the mesh if the level-set is non-manifold at the end of the stage of level-set discretization (before mesh adaptation). The reason is that we can consider such kind of configuration as a transitional step between the situation where the level-set is not attached to itself or to the bounding-box and where the situation where it has merged and for structural optimization for example, it is preferable to avoid remeshing during this transition.