-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Labels
Description
The tolerances on these checks are quite strict and I found that they fail in many practical cases where Omega_h::barycentric_from_global is used.
meshFields/src/MeshField_Shape.hpp
Lines 22 to 28 in 26f923c
| KOKKOS_INLINE_FUNCTION bool greaterThanOrEqualZero(Array &xi) { | |
| auto gt = true; | |
| for (int i = 0; i < xi.size(); i++) { | |
| gt = gt && (xi[i] >= 0); | |
| } | |
| return gt; | |
| } |
meshFields/src/MeshField_Shape.hpp
Lines 13 to 19 in 26f923c
| template <typename Array> KOKKOS_INLINE_FUNCTION bool sumsToOne(Array &xi) { | |
| auto sum = 0.0; | |
| for (int i = 0; i < xi.size(); i++) { | |
| sum += xi[i]; | |
| } | |
| return (Kokkos::fabs(sum - 1) <= MeshField::MachinePrecision); | |
| } |
For the cases I was working with I found setting the tolerances to 1E-12 was adequate. I don't have a good reason that this is a good tolerance to pick in general. I'm open to alternate suggestions.