GEOS icon indicating copy to clipboard operation
GEOS copied to clipboard

Develop a check mesh routine

Open AntoineMazuyer opened this issue 4 years ago • 6 comments

Hello :wave:

@herve-gross @TotoGaz @jafranc and I were discussing the following questions:

  • Shall we accept every grids into GEOSX ?
  • Shall we take actions internally to "repair" the grids in GEOSX ?

Indeed, we already faced a lot problem due to badly designed grids:

  • Negative volume (when the ordering of nodes is inverted for instance)
  • Badly shaped hex from eclipse leading to bad transmissibility computation in our routines
  • Duplicated nodes
  • flat elements.

We agree that it is very hard to develop a "mesh repair" function because:

  • It means we are doing a choice for instance to not import flat cells, but maybe the user want to do it ?
  • It's difficult and not the purpose of a simulator.

The idea is to have a routine à la OpenFoam CheckMesh routine that will run some loops over the elements and the vertices to ensure the mesh is valid for the simulation. It can warn the user like :

WARNING : cell 4568 has inverted node numbering. Consider changing it.

This CheckMesh can be launched every time and be deactivated with a flag in the XML

<PAMELAMeshGenerator name="mesh" file="mesh.msh" checkMesh="0"/>

Thoughts ?

AntoineMazuyer avatar Feb 28 '20 19:02 AntoineMazuyer

If we open more and more our software to users outside of the team, it would be wise to protect us against storms of issues related to surprising meshes.

Even inside the team, it is infuriating to lose time before you discover it's the mesh!

TotoGaz avatar Feb 28 '20 19:02 TotoGaz

Mesh checking is a very good idea in light of some of the imported meshes that we will be dealing with. Do you have ideas about how to check for mesh quality? Perhaps it is enough to simple enough to:

  1. compare the edge lengths in an element. For different element types, we may have different thresholding?
  2. check the angle between edges relative to a common node. Same thresholding question.
  3. Of course a volume check.

rrsettgast avatar Mar 03 '20 19:03 rrsettgast

Here is OpenFoam's CheckMesh. It may be helpful to check what they did.

herve-gross avatar Mar 03 '20 19:03 herve-gross

Do you have ideas about how to check for mesh quality?

We should probably first verify that the provided mesh conforms our assumptions (strictly positive volume, normals directed outwards (?), other ?)

For the information, vtk provides some tools https://vtk.org/doc/nightly/html/classvtkMeshQuality.html

TotoGaz avatar Mar 03 '20 19:03 TotoGaz

Here is the sources for output-ing stats and some helpers writing useful vtk outputs

checkTools.C

for doing topological checks (illegal cells, holes in a patch of faces, ...) and geometrical checks. It has to be noted that some of the tests are done by the class implementing the appropriate object (e.g. mesh.boundaryMesh().checkDefinition(true); )

checkTopology.C checkGeometry.C

jafranc avatar Mar 03 '20 20:03 jafranc

@AntoineMazuyer @castelletto1 What is the status of this issue?

rrsettgast avatar Aug 23 '22 06:08 rrsettgast

A meshDoctor tool has been merged in https://github.com/GEOSX/GEOSX/pull/2091 and could be used to welcome more and more checks. Closing this issue in favor of more precise check needs.

TotoGaz avatar Oct 12 '22 00:10 TotoGaz