diff --git a/include/ddc/kernels/splines/bsplines_non_uniform.hpp b/include/ddc/kernels/splines/bsplines_non_uniform.hpp index 0c3cd4e84..18ed8dbb3 100644 --- a/include/ddc/kernels/splines/bsplines_non_uniform.hpp +++ b/include/ddc/kernels/splines/bsplines_non_uniform.hpp @@ -462,8 +462,8 @@ KOKKOS_INLINE_FUNCTION ddc::DiscreteElement NonUniformBSplines:: std::array left; std::array right; - assert(x >= rmin()); - assert(x <= rmax()); + assert(x - rmin() >= -length() * 1e-14); + assert(rmax() - x >= -length() * 1e-14); assert(values.size() == degree() + 1); // 1. Compute cell index 'icell' @@ -500,8 +500,8 @@ KOKKOS_INLINE_FUNCTION ddc::DiscreteElement NonUniformBSplines:: std::array left; std::array right; - assert(x >= rmin()); - assert(x <= rmax()); + assert(x - rmin() >= -length() * 1e-14); + assert(rmax() - x >= -length() * 1e-14); assert(derivs.size() == degree() + 1); // 1. Compute cell index 'icell' @@ -573,8 +573,8 @@ KOKKOS_INLINE_FUNCTION ddc::DiscreteElement NonUniformBSplines:: std::experimental::extents> const ndu(ndu_ptr.data()); - assert(x >= rmin()); - assert(x <= rmax()); + assert(x - rmin() >= -length() * 1e-14); + assert(rmax() - x >= -length() * 1e-14); // assert(n >= 0); as long as n is unsigned assert(n <= degree()); assert(derivs.extent(0) == 1 + degree()); @@ -663,8 +663,8 @@ KOKKOS_INLINE_FUNCTION ddc::DiscreteElement> NonUn Tag, D>::Impl::find_cell_start(ddc::Coordinate const& x) const { - assert(x <= rmax()); - assert(x >= rmin()); + assert(x - rmin() >= -length() * 1e-14); + assert(rmax() - x >= -length() * 1e-14); if (x == rmin()) return m_break_point_domain.front(); diff --git a/include/ddc/kernels/splines/bsplines_uniform.hpp b/include/ddc/kernels/splines/bsplines_uniform.hpp index f15fc54f6..722416fac 100644 --- a/include/ddc/kernels/splines/bsplines_uniform.hpp +++ b/include/ddc/kernels/splines/bsplines_uniform.hpp @@ -474,8 +474,8 @@ KOKKOS_INLINE_FUNCTION ddc::DiscreteElement UniformBSplines::Impl< double offset; int jmin; - assert(x >= rmin()); - assert(x <= rmax()); + assert(x - rmin() >= -length() * 1e-14); + assert(rmax() - x >= -length() * 1e-14); // assert(n >= 0); as long as n is unsigned assert(n <= degree()); assert(derivs.extent(0) == 1 + degree()); @@ -554,8 +554,8 @@ KOKKOS_INLINE_FUNCTION void UniformBSplines::Impl::ge double& offset, ddc::Coordinate const& x) const { - assert(x >= rmin()); - assert(x <= rmax()); + assert(x - rmin() >= -length() * 1e-14); + assert(rmax() - x >= -length() * 1e-14); double const inv_dx = inv_step(); if (x == rmin()) {