ufz/ogs — pull request #324 by rinkk (2014-02-19 17:21:27+00:00)
Title: Testing mesh elements for geometric correctness

This adds a ```isValid()``` method to each element-type-class that checks if the element is geometrically correct. A pure virtual method ```isValid()``` is also added to the element base class.

There are a few things that might require discussion. Here's what I did:
* 1D and 2D elements are tested for zero volume (i.e. length/area), 3D elements are not tested because it was mentioned before that this might be a thing we might need. I can add this if you want.
* **Quads:** tests if the element is convex and if all four nodes are on a plane.
* **Pyramids:** tests if the base face (the quad) is valid.
* **Prisms:** tests if all three quad faces are valid quads (this should implicitly test convexity).
* **Hexes:** tests if all six quad faces are valid quads (this should implicitly test convexity).

Did I miss anything that needs to be tested?

I specifically don't test if the top node of tets or pyramids is in the same plane as the "base"-face because I suppose this might be okay for zero volume elements. Should I add this test?
I also don't test if there are element nodes could be collapsed. This is part of a later PR I am currently preparing and I could add it later if you like.

I tested this with a number of our meshes and it worked fine. I also tested a FEFLOW and a PETREL mesh (both Hex-meshes) and noticed that both include invalid elements (i.e. hex elements whose quad-faces are not on a plane. I am not sure what to make of this. Any comments?
(To be clear: as far as I can see the method works correctly and the mesh elements are actually "deformed")

In the uploaded version I test all mesh elements when calling the mesh constructor. This will be removed before merging. I left it in for now so you can test the functionality if you want to.

I would appreciate information on the questions I have from a simulation point of view.