invertElementwise is susceptible to division-by-zero errors
Hi,
looking into the cause of a NaN I get for something I'm currently working on, I detected the following (unrelated) issue with the implementation of the invertElementwise
method. Currently the method runs over the complete DoF data array of a primitive and computes the scalar inverse of the corresponding value. This means that the inverses are also computed for DoFs inside the ghost layers. If these are zero, we get a division-by-zero exception. This is e.g. the case when the P[12]ElementwiseOperators call invertElementwise() to invert their diagonals, as only the halos of the face (in 2D) or cell (3D) primitives contain non-zero values.
Cheers
Marcus