From db931252fc393d5988cc4736a600fb696f7cf757 Mon Sep 17 00:00:00 2001 From: blegouix Date: Mon, 6 May 2024 10:04:44 +0200 Subject: [PATCH] interest coordinate --- .../ddc/kernels/splines/spline_evaluator.hpp | 32 +++++++++---------- .../kernels/splines/spline_evaluator_2d.hpp | 12 +++---- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/include/ddc/kernels/splines/spline_evaluator.hpp b/include/ddc/kernels/splines/spline_evaluator.hpp index af8a4100e..263135b03 100644 --- a/include/ddc/kernels/splines/spline_evaluator.hpp +++ b/include/ddc/kernels/splines/spline_evaluator.hpp @@ -241,26 +241,26 @@ class SplineEvaluator spline_coef) const { ddc::Coordinate - coord_eval_evaluation + coord_eval_interest = ddc::select(coord_eval); if constexpr (bsplines_type::is_periodic()) { - if (coord_eval_evaluation < ddc::discrete_space().rmin() - || coord_eval_evaluation > ddc::discrete_space().rmax()) { - coord_eval_evaluation -= Kokkos::floor( - (coord_eval_evaluation - - ddc::discrete_space().rmin()) - / ddc::discrete_space().length()) - * ddc::discrete_space().length(); + if (coord_eval_interest < ddc::discrete_space().rmin() + || coord_eval_interest > ddc::discrete_space().rmax()) { + coord_eval_interest -= Kokkos::floor( + (coord_eval_interest + - ddc::discrete_space().rmin()) + / ddc::discrete_space().length()) + * ddc::discrete_space().length(); } } else { - if (coord_eval_evaluation < ddc::discrete_space().rmin()) { - return m_left_extrap_rule(coord_eval_evaluation, spline_coef); + if (coord_eval_interest < ddc::discrete_space().rmin()) { + return m_left_extrap_rule(coord_eval_interest, spline_coef); } - if (coord_eval_evaluation > ddc::discrete_space().rmax()) { - return m_right_extrap_rule(coord_eval_evaluation, spline_coef); + if (coord_eval_interest > ddc::discrete_space().rmax()) { + return m_right_extrap_rule(coord_eval_interest, spline_coef); } } - return eval_no_bc(coord_eval_evaluation, spline_coef); + return eval_no_bc(coord_eval_interest, spline_coef); } template @@ -278,12 +278,12 @@ class SplineEvaluator std::experimental::extents> const vals(vals_ptr.data()); ddc::Coordinate - coord_eval_evaluation + coord_eval_interest = ddc::select(coord_eval); if constexpr (std::is_same_v) { - jmin = ddc::discrete_space().eval_basis(vals, coord_eval_evaluation); + jmin = ddc::discrete_space().eval_basis(vals, coord_eval_interest); } else if constexpr (std::is_same_v) { - jmin = ddc::discrete_space().eval_deriv(vals, coord_eval_evaluation); + jmin = ddc::discrete_space().eval_deriv(vals, coord_eval_interest); } double y = 0.0; for (std::size_t i = 0; i < bsplines_type::degree() + 1; ++i) { diff --git a/include/ddc/kernels/splines/spline_evaluator_2d.hpp b/include/ddc/kernels/splines/spline_evaluator_2d.hpp index 830e3b1d0..3c3021230 100644 --- a/include/ddc/kernels/splines/spline_evaluator_2d.hpp +++ b/include/ddc/kernels/splines/spline_evaluator_2d.hpp @@ -739,23 +739,23 @@ class SplineEvaluator2D std::experimental::extents> const vals2(vals2_ptr.data()); ddc::Coordinate - coord_eval_evaluation1 + coord_eval_interest1 = ddc::select( coord_eval); ddc::Coordinate - coord_eval_evaluation2 + coord_eval_interest2 = ddc::select( coord_eval); if constexpr (std::is_same_v) { - jmin1 = ddc::discrete_space().eval_basis(vals1, coord_eval_evaluation1); + jmin1 = ddc::discrete_space().eval_basis(vals1, coord_eval_interest1); } else if constexpr (std::is_same_v) { - jmin1 = ddc::discrete_space().eval_deriv(vals1, coord_eval_evaluation1); + jmin1 = ddc::discrete_space().eval_deriv(vals1, coord_eval_interest1); } if constexpr (std::is_same_v) { - jmin2 = ddc::discrete_space().eval_basis(vals2, coord_eval_evaluation2); + jmin2 = ddc::discrete_space().eval_basis(vals2, coord_eval_interest2); } else if constexpr (std::is_same_v) { - jmin2 = ddc::discrete_space().eval_deriv(vals2, coord_eval_evaluation2); + jmin2 = ddc::discrete_space().eval_deriv(vals2, coord_eval_interest2); } double y = 0.0;