Open TTitscher opened 6 years ago
I would only ensure that the determinants are consistent across the NuTo - Gmsh boundary. All the reference elements in Gmsh (as far as I can tell are numbered in mathematically positive direction) http://gmsh.info/doc/texinfo/gmsh.html#Node-ordering, so that if we import a reference element and the determinant is negative, than our node orderings don't match. But that doesn't mean that Det(J) > 0 should always hold…just for the reference elements.
Therefore d) Create test meshes with reference elements according to Gmsh numbering and test Det(J) > 0 once for those meshes.
I think we should enforce a consistent numbering of the elements, thus enforcing detJac>0 for the gmsh import as well as for the element creation. If we don't enforce this, we might get problems, because we would then have to do an fabs(detJ) in the integration routines. In some cases, the numbering might be important e.g. for the calculation of normals.
I was just spending an hour trying to find a bug. It was normal orientation issue (in gmsh), where one of my four surfaces had the wrong normals. For this case, at least a warning like "Det(J) in element ... is negative" would be nice. What do you think?
When we import elements from gmsh, we will sometimes end up with negative Det(Jac). E.g.
With #173 we check if Det(Jac) is consistent - either all positive or all negative, measured at all node locations. How do we want to deal with that? a) add
std::abs()
inJacibian::Det()
b) addstd::abs()
in the numeric integration c) enforce Det(Jac) > 0 withoutstd::abs()
c.1) modifyMeshGmsh
accordingly c.2) add checks for Det(Jac) > 0, e.g. at element creation