Skip to content

tolerances too small for shape function checks #69

@jacobmerson

Description

@jacobmerson

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.

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;
}

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions