diff --git a/vendor/ddc/.github/workflows/pages.yml b/vendor/ddc/.github/workflows/pages.yml index cd9d0bfb1..39ed4c6a9 100644 --- a/vendor/ddc/.github/workflows/pages.yml +++ b/vendor/ddc/.github/workflows/pages.yml @@ -31,6 +31,7 @@ jobs: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin || true docker pull ghcr.io/cexa-project/ddc/doxygen || true DOCKER_BUILDKIT=1 docker build \ + --build-arg BUILDKIT_INLINE_CACHE=1 \ --cache-from ghcr.io/cexa-project/ddc/doxygen \ -t ghcr.io/cexa-project/ddc/doxygen \ -t ghcr.io/cexa-project/ddc/doxygen:${GITHUB_SHA:0:7} \ diff --git a/vendor/ddc/docs/CMakeLists.txt b/vendor/ddc/docs/CMakeLists.txt index 08ceffd80..dc0b4c4b8 100644 --- a/vendor/ddc/docs/CMakeLists.txt +++ b/vendor/ddc/docs/CMakeLists.txt @@ -19,7 +19,8 @@ set(DOXYGEN_ENUM_VALUES_PER_LINE 1) set(DOXYGEN_EXAMPLE_PATH "${DDC_SOURCE_DIR}/examples") set(DOXYGEN_EXPAND_ONLY_PREDEF YES) set(DOXYGEN_EXTRACT_ALL YES) -set(DOXYGEN_EXCLUDE_SYMBOLS "detail" "details") +set(DOXYGEN_EXCLUDE_SYMBOLS "detail") +set(DOXYGEN_EXCLUDE_PATTERNS "*/experimental/*;*/detail/*") set(DOXYGEN_EXTRACT_LOCAL_CLASSES YES) set(DOXYGEN_FULL_PATH_NAMES NO) set(DOXYGEN_GENERATE_TREEVIEW YES) @@ -39,7 +40,7 @@ set(DOXYGEN_PREDEFINED "DOXYGEN_IGNORE") set(DOXYGEN_PROJECT_LOGO "${CMAKE_CURRENT_SOURCE_DIR}/_template/logo.png") set(DOXYGEN_PROJECT_NUMBER "${DDC_VERSION}") set(DOXYGEN_QT_AUTOBRIEF YES) -set(DOXYGEN_RECURSIVE NO) +set(DOXYGEN_RECURSIVE YES) set(DOXYGEN_SEARCHENGINE NO) set(DOXYGEN_SHOW_FILES NO) set(DOXYGEN_SHOW_INCLUDE_FILES NO) diff --git a/vendor/ddc/include/ddc/chunk.hpp b/vendor/ddc/include/ddc/chunk.hpp index 14b0cc812..a0541fc0d 100644 --- a/vendor/ddc/include/ddc/chunk.hpp +++ b/vendor/ddc/include/ddc/chunk.hpp @@ -11,6 +11,7 @@ #include "ddc/chunk_common.hpp" #include "ddc/chunk_span.hpp" +#include "ddc/chunk_traits.hpp" #include "ddc/kokkos_allocator.hpp" #include "ddc/parallel_deepcopy.hpp" diff --git a/vendor/ddc/include/ddc/chunk_common.hpp b/vendor/ddc/include/ddc/chunk_common.hpp index a60efd3d2..fa1414e33 100644 --- a/vendor/ddc/include/ddc/chunk_common.hpp +++ b/vendor/ddc/include/ddc/chunk_common.hpp @@ -13,48 +13,12 @@ #include +#include "ddc/chunk_traits.hpp" #include "ddc/detail/macros.hpp" #include "ddc/discrete_domain.hpp" namespace ddc { -template -inline constexpr bool enable_borrowed_chunk = false; - -template -inline constexpr bool enable_chunk = false; - -template -inline constexpr bool is_chunk_v = enable_chunk>>; - -template -inline constexpr bool is_borrowed_chunk_v - = is_chunk_v< - T> && (std::is_lvalue_reference_v || enable_borrowed_chunk>>); - -template -struct chunk_traits -{ - static_assert(is_chunk_v); - using value_type - = std::remove_cv_t().data_handle())>>; - using pointer_type = decltype(std::declval().data_handle()); - using reference_type = decltype(*std::declval().data_handle()); -}; - -template -using chunk_value_t = typename chunk_traits::value_type; - -template -using chunk_pointer_t = typename chunk_traits::pointer_type; - -template -using chunk_reference_t = typename chunk_traits::reference_type; - -template -inline constexpr bool is_writable_chunk_v - = !std::is_const_v>>; - /** Access the domain (or subdomain) of a view * @param[in] chunk the view whose domain to access * @return the domain of view in the queried dimensions @@ -351,5 +315,4 @@ class ChunkCommon, LayoutStridedPolicy> } }; - } // namespace ddc diff --git a/vendor/ddc/include/ddc/chunk_traits.hpp b/vendor/ddc/include/ddc/chunk_traits.hpp new file mode 100644 index 000000000..ee1f7f114 --- /dev/null +++ b/vendor/ddc/include/ddc/chunk_traits.hpp @@ -0,0 +1,49 @@ +// Copyright (C) The DDC development team, see COPYRIGHT.md file +// +// SPDX-License-Identifier: MIT + +#pragma once + +#include +#include + +namespace ddc { + +template +inline constexpr bool enable_borrowed_chunk = false; + +template +inline constexpr bool enable_chunk = false; + +template +inline constexpr bool is_chunk_v = enable_chunk>>; + +template +inline constexpr bool is_borrowed_chunk_v + = is_chunk_v< + T> && (std::is_lvalue_reference_v || enable_borrowed_chunk>>); + +template +struct chunk_traits +{ + static_assert(is_chunk_v); + using value_type + = std::remove_cv_t().data_handle())>>; + using pointer_type = decltype(std::declval().data_handle()); + using reference_type = decltype(*std::declval().data_handle()); +}; + +template +using chunk_value_t = typename chunk_traits::value_type; + +template +using chunk_pointer_t = typename chunk_traits::pointer_type; + +template +using chunk_reference_t = typename chunk_traits::reference_type; + +template +inline constexpr bool is_writable_chunk_v + = !std::is_const_v>>; + +} // namespace ddc diff --git a/vendor/ddc/include/ddc/coordinate.hpp b/vendor/ddc/include/ddc/coordinate.hpp index 1182bba3a..68fdf69eb 100644 --- a/vendor/ddc/include/ddc/coordinate.hpp +++ b/vendor/ddc/include/ddc/coordinate.hpp @@ -4,7 +4,10 @@ #pragma once +#include + #include "ddc/detail/tagged_vector.hpp" +#include "ddc/discrete_element.hpp" #include "ddc/real_type.hpp" namespace ddc { @@ -22,9 +25,24 @@ using CoordinateElement = Real; template using Coordinate = detail::TaggedVector; +template 1), int> = 0> +KOKKOS_FUNCTION Coordinate coordinate( + DiscreteElement const& c) +{ + return Coordinate( + coordinate(DiscreteElement(c))...); +} + +// Gives access to the type of the coordinates of a discrete element +// Example usage : "using Coords = coordinate_of_t;" template -struct coordinate_of; +struct coordinate_of +{ + static_assert(is_discrete_element_v, "Parameter T must be of type DiscreteElement"); + using type = decltype(coordinate(std::declval())); +}; +/// Helper type of \ref ddc::coordinate_of template using coordinate_of_t = typename coordinate_of::type; diff --git a/vendor/ddc/include/ddc/coordinate_md.hpp b/vendor/ddc/include/ddc/coordinate_md.hpp deleted file mode 100644 index 18244074e..000000000 --- a/vendor/ddc/include/ddc/coordinate_md.hpp +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) The DDC development team, see COPYRIGHT.md file -// -// SPDX-License-Identifier: MIT - -#pragma once - -#include - -#include "ddc/coordinate.hpp" -#include "ddc/discrete_element.hpp" - -namespace ddc { - -template 1), int> = 0> -KOKKOS_FUNCTION Coordinate coordinate( - DiscreteElement const& c) -{ - return Coordinate(coordinate(select(c))...); -} - -} // namespace ddc diff --git a/vendor/ddc/include/ddc/ddc.hpp b/vendor/ddc/include/ddc/ddc.hpp index c0668bbdd..dae35b18a 100644 --- a/vendor/ddc/include/ddc/ddc.hpp +++ b/vendor/ddc/include/ddc/ddc.hpp @@ -15,10 +15,10 @@ #include "ddc/aligned_allocator.hpp" #include "ddc/chunk.hpp" #include "ddc/chunk_span.hpp" +#include "ddc/chunk_traits.hpp" #include "ddc/kokkos_allocator.hpp" // Discretizations -#include "ddc/coordinate_md.hpp" #include "ddc/discrete_domain.hpp" #include "ddc/discrete_element.hpp" #include "ddc/discrete_space.hpp" diff --git a/vendor/ddc/include/ddc/dual_discretization.hpp b/vendor/ddc/include/ddc/detail/dual_discretization.hpp similarity index 97% rename from vendor/ddc/include/ddc/dual_discretization.hpp rename to vendor/ddc/include/ddc/detail/dual_discretization.hpp index c2e955c52..ae8e091c8 100644 --- a/vendor/ddc/include/ddc/dual_discretization.hpp +++ b/vendor/ddc/include/ddc/detail/dual_discretization.hpp @@ -16,7 +16,7 @@ #include #endif -namespace ddc { +namespace ddc::detail { template class DualDiscretization @@ -80,4 +80,4 @@ class DualDiscretization } }; -} // namespace ddc +} // namespace ddc::detail diff --git a/vendor/ddc/include/ddc/detail/tagged_vector.hpp b/vendor/ddc/include/ddc/detail/tagged_vector.hpp index 9100bbfb6..a6a49c3bb 100644 --- a/vendor/ddc/include/ddc/detail/tagged_vector.hpp +++ b/vendor/ddc/include/ddc/detail/tagged_vector.hpp @@ -21,17 +21,17 @@ template class TaggedVector; template -struct IsTaggedVector : std::false_type +struct is_tagged_vector : std::false_type { }; template -struct IsTaggedVector> : std::true_type +struct is_tagged_vector> : std::true_type { }; template -inline constexpr bool is_tagged_vector_v = IsTaggedVector::value; +inline constexpr bool is_tagged_vector_v = is_tagged_vector::value; template struct ToTypeSeq> @@ -224,12 +224,12 @@ KOKKOS_FUNCTION constexpr auto const& take( template -class ConversionOperators +class TaggedVectorConversionOperators { }; template -class ConversionOperators> +class TaggedVectorConversionOperators> { public: KOKKOS_FUNCTION constexpr operator ElementType const &() const noexcept @@ -244,9 +244,9 @@ class ConversionOperators> }; template -class TaggedVector : public ConversionOperators> +class TaggedVector : public TaggedVectorConversionOperators> { - friend class ConversionOperators>; + friend class TaggedVectorConversionOperators>; using tags_seq = detail::TypeSeq; diff --git a/vendor/ddc/include/ddc/discrete_domain.hpp b/vendor/ddc/include/ddc/discrete_domain.hpp index e1ab56746..0f927eb38 100644 --- a/vendor/ddc/include/ddc/discrete_domain.hpp +++ b/vendor/ddc/include/ddc/discrete_domain.hpp @@ -23,17 +23,17 @@ template class DiscreteDomain; template -struct IsDiscreteDomain : std::false_type +struct is_discrete_domain : std::false_type { }; template -struct IsDiscreteDomain> : std::true_type +struct is_discrete_domain> : std::true_type { }; template -inline constexpr bool is_discrete_domain_v = IsDiscreteDomain::value; +inline constexpr bool is_discrete_domain_v = is_discrete_domain::value; namespace detail { diff --git a/vendor/ddc/include/ddc/discrete_element.hpp b/vendor/ddc/include/ddc/discrete_element.hpp index e9d00c23f..15b963d6f 100644 --- a/vendor/ddc/include/ddc/discrete_element.hpp +++ b/vendor/ddc/include/ddc/discrete_element.hpp @@ -10,7 +10,6 @@ #include #include -#include "ddc/coordinate.hpp" #include "ddc/detail/macros.hpp" #include "ddc/detail/type_seq.hpp" #include "ddc/discrete_vector.hpp" @@ -21,17 +20,17 @@ template class DiscreteElement; template -struct IsDiscreteElement : std::false_type +struct is_discrete_element : std::false_type { }; template -struct IsDiscreteElement> : std::true_type +struct is_discrete_element> : std::true_type { }; template -inline constexpr bool is_discrete_element_v = IsDiscreteElement::value; +inline constexpr bool is_discrete_element_v = is_discrete_element::value; namespace detail { @@ -443,13 +442,4 @@ KOKKOS_FUNCTION constexpr DiscreteVector operator-( return DiscreteVector((uid(lhs) - uid(rhs))...); } -// Gives access to the type of the coordinates of a discrete element -// Example usage : "using Coords = coordinate_of_t;" -template -struct coordinate_of> -{ - // maybe a static_assert on DDims ? - using type = Coordinate; -}; - } // namespace ddc diff --git a/vendor/ddc/include/ddc/discrete_space.hpp b/vendor/ddc/include/ddc/discrete_space.hpp index f207d3461..1ddf03830 100644 --- a/vendor/ddc/include/ddc/discrete_space.hpp +++ b/vendor/ddc/include/ddc/discrete_space.hpp @@ -17,7 +17,9 @@ #include +#include "ddc/detail/dual_discretization.hpp" #include "ddc/detail/macros.hpp" + #if defined(__CUDACC__) #include @@ -29,7 +31,6 @@ #include #endif -#include "ddc/dual_discretization.hpp" namespace ddc { diff --git a/vendor/ddc/include/ddc/discrete_vector.hpp b/vendor/ddc/include/ddc/discrete_vector.hpp index aac322b5c..446f98f2c 100644 --- a/vendor/ddc/include/ddc/discrete_vector.hpp +++ b/vendor/ddc/include/ddc/discrete_vector.hpp @@ -21,17 +21,17 @@ template class DiscreteVector; template -struct IsDiscreteVector : std::false_type +struct is_discrete_vector : std::false_type { }; template -struct IsDiscreteVector> : std::true_type +struct is_discrete_vector> : std::true_type { }; template -inline constexpr bool is_discrete_vector_v = IsDiscreteVector::value; +inline constexpr bool is_discrete_vector_v = is_discrete_vector::value; namespace detail { @@ -205,13 +205,15 @@ KOKKOS_FUNCTION constexpr auto const& take(HeadDVect const& head, TailDVects con DDC_IF_NVCC_THEN_POP } +namespace detail { + template -class ConversionOperators +class DiscreteVectorConversionOperators { }; template -class ConversionOperators> +class DiscreteVectorConversionOperators> { public: KOKKOS_FUNCTION constexpr operator DiscreteVectorElement const &() const noexcept @@ -225,8 +227,6 @@ class ConversionOperators> } }; -namespace detail { - /// Returns a reference to the underlying `std::array` template KOKKOS_FUNCTION constexpr std::array& array( @@ -250,9 +250,9 @@ KOKKOS_FUNCTION constexpr std::array con * Each is tagged by its associated dimensions. */ template -class DiscreteVector : public ConversionOperators> +class DiscreteVector : public detail::DiscreteVectorConversionOperators> { - friend class ConversionOperators>; + friend class detail::DiscreteVectorConversionOperators>; friend KOKKOS_FUNCTION constexpr std::array& detail:: array(DiscreteVector& v) noexcept; diff --git a/vendor/ddc/include/ddc/kernels/splines.hpp b/vendor/ddc/include/ddc/kernels/splines.hpp index 4ad1848c8..fc67f83fd 100644 --- a/vendor/ddc/include/ddc/kernels/splines.hpp +++ b/vendor/ddc/include/ddc/kernels/splines.hpp @@ -4,7 +4,6 @@ #pragma once -#include "splines/bspline.hpp" #include "splines/bsplines_non_uniform.hpp" #include "splines/bsplines_uniform.hpp" #include "splines/constant_extrapolation_rule.hpp" diff --git a/vendor/ddc/include/ddc/kernels/splines/bspline.hpp b/vendor/ddc/include/ddc/kernels/splines/bspline.hpp deleted file mode 100644 index 83f90c70c..000000000 --- a/vendor/ddc/include/ddc/kernels/splines/bspline.hpp +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (C) The DDC development team, see COPYRIGHT.md file -// -// SPDX-License-Identifier: MIT - -#pragma once -namespace ddc { -template -struct BSpline -{ -}; -} // namespace ddc diff --git a/vendor/ddc/include/ddc/kernels/splines/bsplines_non_uniform.hpp b/vendor/ddc/include/ddc/kernels/splines/bsplines_non_uniform.hpp index f5d5dd1c8..8160de039 100644 --- a/vendor/ddc/include/ddc/kernels/splines/bsplines_non_uniform.hpp +++ b/vendor/ddc/include/ddc/kernels/splines/bsplines_non_uniform.hpp @@ -11,7 +11,6 @@ #include -#include "bspline.hpp" #include "view.hpp" namespace ddc { @@ -47,8 +46,6 @@ class NonUniformBSplines public: using tag_type = Tag; - using continuous_dimension_type = BSpline; - using discrete_dimension_type = NonUniformBSplines; diff --git a/vendor/ddc/include/ddc/kernels/splines/bsplines_uniform.hpp b/vendor/ddc/include/ddc/kernels/splines/bsplines_uniform.hpp index ecdd0494f..26a781f68 100644 --- a/vendor/ddc/include/ddc/kernels/splines/bsplines_uniform.hpp +++ b/vendor/ddc/include/ddc/kernels/splines/bsplines_uniform.hpp @@ -10,7 +10,6 @@ #include -#include "bspline.hpp" #include "math_tools.hpp" #include "view.hpp" @@ -46,8 +45,6 @@ class UniformBSplines public: using tag_type = Tag; - using continuous_dimension_type = BSpline; - using discrete_dimension_type = UniformBSplines; diff --git a/vendor/ddc/include/ddc/kernels/splines/spline_evaluator_2d.hpp b/vendor/ddc/include/ddc/kernels/splines/spline_evaluator_2d.hpp index 792bab49a..33fc2d4ef 100644 --- a/vendor/ddc/include/ddc/kernels/splines/spline_evaluator_2d.hpp +++ b/vendor/ddc/include/ddc/kernels/splines/spline_evaluator_2d.hpp @@ -651,47 +651,47 @@ class SplineEvaluator2D */ template KOKKOS_INLINE_FUNCTION double eval( - ddc::Coordinate const& coord_eval, + ddc::Coordinate coord_eval, ddc::ChunkSpan const spline_coef) const { - ddc::Coordinate - coord_eval_interpolation1(coord_eval); - ddc::Coordinate - coord_eval_interpolation2(coord_eval); + using Dim1 = typename interpolation_mesh_type1::continuous_dimension_type; + using Dim2 = typename interpolation_mesh_type2::continuous_dimension_type; if constexpr (bsplines_type1::is_periodic()) { - if (coord_eval_interpolation1 < ddc::discrete_space().rmin() - || coord_eval_interpolation1 > ddc::discrete_space().rmax()) { - coord_eval_interpolation1 + if (ddc::get(coord_eval) < ddc::discrete_space().rmin() + || ddc::get(coord_eval) > ddc::discrete_space().rmax()) { + ddc::get(coord_eval) -= Kokkos::floor( - (coord_eval_interpolation1 + (ddc::get(coord_eval) - ddc::discrete_space().rmin()) / ddc::discrete_space().length()) * ddc::discrete_space().length(); } - } else { - if (coord_eval_interpolation1 < ddc::discrete_space().rmin()) { - return m_left_extrap_rule_1(coord_eval, spline_coef); - } - if (coord_eval_interpolation1 > ddc::discrete_space().rmax()) { - return m_right_extrap_rule_1(coord_eval, spline_coef); - } } if constexpr (bsplines_type2::is_periodic()) { - if (coord_eval_interpolation2 < ddc::discrete_space().rmin() - || coord_eval_interpolation2 > ddc::discrete_space().rmax()) { - coord_eval_interpolation2 + if (ddc::get(coord_eval) < ddc::discrete_space().rmin() + || ddc::get(coord_eval) > ddc::discrete_space().rmax()) { + ddc::get(coord_eval) -= Kokkos::floor( - (coord_eval_interpolation2 + (ddc::get(coord_eval) - ddc::discrete_space().rmin()) / ddc::discrete_space().length()) * ddc::discrete_space().length(); } - } else { - if (coord_eval_interpolation2 < ddc::discrete_space().rmin()) { + } + if constexpr (!bsplines_type1::is_periodic()) { + if (ddc::get(coord_eval) < ddc::discrete_space().rmin()) { + return m_left_extrap_rule_1(coord_eval, spline_coef); + } + if (ddc::get(coord_eval) > ddc::discrete_space().rmax()) { + return m_right_extrap_rule_1(coord_eval, spline_coef); + } + } + if constexpr (!bsplines_type2::is_periodic()) { + if (ddc::get(coord_eval) < ddc::discrete_space().rmin()) { return m_left_extrap_rule_2(coord_eval, spline_coef); } - if (coord_eval_interpolation2 > ddc::discrete_space().rmax()) { + if (ddc::get(coord_eval) > ddc::discrete_space().rmax()) { return m_right_extrap_rule_2(coord_eval, spline_coef); } } @@ -699,28 +699,22 @@ class SplineEvaluator2D ddc::Coordinate< typename interpolation_mesh_type1::continuous_dimension_type, typename interpolation_mesh_type2::continuous_dimension_type>( - coord_eval_interpolation1, - coord_eval_interpolation2), + ddc::get(coord_eval), + ddc::get(coord_eval)), spline_coef); } /** * @brief Evaluate the function or its derivative at the coordinate given. * - * @param[in] coord_eval1 - * The coordinate on the first dimension where we want to evaluate. - * @param[in] coord_eval2 - * The coordinate on the second dimension where we want to evaluate. + * @param[in] coord_eval + * The coordinate where we want to evaluate. * @param[in] splne_coef * The B-splines coefficients of the function we want to evaluate. - * @param[out] vals1 - * A ChunkSpan with the not-null values of each function of the spline in the first dimension. - * @param[out] vals2 - * A ChunkSpan with the not-null values of each function of the spline in the second dimension. - * @param[in] eval_type_1 + * @tparam EvalType1 * A flag indicating if we evaluate the function or its derivative in the first dimension. * The type of this object is either `eval_type` or `eval_deriv_type`. - * @param[in] eval_type_2 + * @tparam EvalType2 * A flag indicating if we evaluate the function or its derivative in the second dimension. * The type of this object is either `eval_type` or `eval_deriv_type`. */ diff --git a/vendor/ddc/include/ddc/parallel_deepcopy.hpp b/vendor/ddc/include/ddc/parallel_deepcopy.hpp index 127b20df5..b395e9153 100644 --- a/vendor/ddc/include/ddc/parallel_deepcopy.hpp +++ b/vendor/ddc/include/ddc/parallel_deepcopy.hpp @@ -8,7 +8,7 @@ #include -#include "ddc/chunk_common.hpp" +#include "ddc/chunk_traits.hpp" namespace ddc { diff --git a/vendor/ddc/include/ddc/parallel_fill.hpp b/vendor/ddc/include/ddc/parallel_fill.hpp index a0b1b050e..52020e5ea 100644 --- a/vendor/ddc/include/ddc/parallel_fill.hpp +++ b/vendor/ddc/include/ddc/parallel_fill.hpp @@ -8,7 +8,7 @@ #include -#include "ddc/chunk_common.hpp" +#include "ddc/chunk_traits.hpp" namespace ddc { diff --git a/vendor/ddc/include/ddc/pdi.hpp b/vendor/ddc/include/ddc/pdi.hpp index 39058a56e..1f64ca80b 100644 --- a/vendor/ddc/include/ddc/pdi.hpp +++ b/vendor/ddc/include/ddc/pdi.hpp @@ -12,7 +12,7 @@ #include -#include "ddc/chunk_common.hpp" +#include "ddc/chunk_traits.hpp" namespace ddc { diff --git a/vendor/ddc/tests/splines/extrapolation_rule.cpp b/vendor/ddc/tests/splines/extrapolation_rule.cpp index 9c355fe99..864b51f76 100644 --- a/vendor/ddc/tests/splines/extrapolation_rule.cpp +++ b/vendor/ddc/tests/splines/extrapolation_rule.cpp @@ -333,13 +333,13 @@ static void ExtrapolationRuleSplineTest() coords_eval.domain(), KOKKOS_LAMBDA(Index...> const e) { coords_eval(e) = ddc::coordinate(e); - // Set coords_eval outside of the domain + // Set coords_eval outside of the domain (+1 to ensure left bound is outside domain) ddc::get(coords_eval(e)) = xN() + (ddc::select(ddc::coordinate(e)) - x0()) + 1; -#if defined(BC_GREVILLE) + // Set coords_eval outside of the domain (this point should be found on the grid in + // the periodic case) ddc::get(coords_eval(e)) - = xN() + (ddc::select(ddc::coordinate(e)) - x0()) + 1; -#endif + = 2 * xN() + (ddc::select(ddc::coordinate(e)) - x0()); }); @@ -370,10 +370,16 @@ static void ExtrapolationRuleSplineTest() discrete_element_type e_batch(e); double tmp; if (ddc::select(coords_eval(e)) > xN()) { +#if defined(BC_PERIODIC) + tmp = vals(ddc::DiscreteElement...>( + vals.template domain>().back(), + e_without_interest)); +#else tmp = vals(ddc::DiscreteElement...>( vals.template domain>().back(), vals.template domain>().back(), e_batch)); +#endif } else { tmp = vals(ddc::DiscreteElement...>( vals.template domain>().back(),