11#include "Kokkos_Macros.hpp"
24 class interpolation_mesh_type1,
25 class interpolation_mesh_type2,
44 struct eval_deriv_type
48 using tag_type1 =
typename BSplinesType1::tag_type;
49 using tag_type2 =
typename BSplinesType2::tag_type;
77 ddc::detail::TypeSeq<
IDimX...>,
78 ddc::detail::TypeSeq<interpolation_mesh_type1, interpolation_mesh_type2>>>;
82 ddc::detail::TypeSeq<
IDimX...>,
83 ddc::detail::TypeSeq<interpolation_mesh_type1, interpolation_mesh_type2>,
84 ddc::detail::TypeSeq<bsplines_type1, bsplines_type2>>>;
100 tag_type1>> == bsplines_type1::is_periodic()
104 tag_type1>> == bsplines_type1::is_periodic()
108 tag_type2>> == bsplines_type2::is_periodic()
112 tag_type2>> == bsplines_type2::is_periodic(),
113 "PeriodicExtrapolationRule has to be used if and only if dimension is periodic");
115 std::is_invocable_r_v<
122 std::experimental::layout_right,
124 "LeftExtrapolationRule1::operator() has to be callable "
125 "with usual arguments.");
127 std::is_invocable_r_v<
134 std::experimental::layout_right,
136 "RightExtrapolationRule1::operator() has to be callable "
137 "with usual arguments.");
139 std::is_invocable_r_v<
146 std::experimental::layout_right,
148 "LeftExtrapolationRule2::operator() has to be callable "
149 "with usual arguments.");
151 std::is_invocable_r_v<
158 std::experimental::layout_right,
160 "RightExtrapolationRule2::operator() has to be callable "
161 "with usual arguments.");
237 return m_left_extrap_rule_1;
242 return m_right_extrap_rule_1;
247 return m_left_extrap_rule_2;
252 return m_right_extrap_rule_2;
370 typename interpolation_mesh_type1::
371 continuous_dimension_type> || std::is_same_v<InterestDim, typename interpolation_mesh_type2::continuous_dimension_type>);
372 if constexpr (std::is_same_v<
374 typename interpolation_mesh_type1::continuous_dimension_type>) {
376 }
else if constexpr (std::is_same_v<
378 typename interpolation_mesh_type2::
379 continuous_dimension_type>) {
393 typename interpolation_mesh_type1::
394 continuous_dimension_type> && std::is_same_v<InterestDim2, typename interpolation_mesh_type2::continuous_dimension_type>)
397 typename interpolation_mesh_type1::
398 continuous_dimension_type> && std::is_same_v<InterestDim1, typename interpolation_mesh_type2::continuous_dimension_type>));
543 typename interpolation_mesh_type1::
544 continuous_dimension_type> || std::is_same_v<InterestDim, typename interpolation_mesh_type2::continuous_dimension_type>);
545 if constexpr (std::is_same_v<
547 typename interpolation_mesh_type1::continuous_dimension_type>) {
549 }
else if constexpr (std::is_same_v<
551 typename interpolation_mesh_type2::
552 continuous_dimension_type>) {
578 typename interpolation_mesh_type1::
579 continuous_dimension_type> && std::is_same_v<InterestDim2, typename interpolation_mesh_type2::continuous_dimension_type>)
582 typename interpolation_mesh_type1::
583 continuous_dimension_type> && std::is_same_v<InterestDim1, typename interpolation_mesh_type2::continuous_dimension_type>));
594 template <
class Layout1,
class Layout2>
609 Kokkos::parallel_for(
610 Kokkos::RangePolicy<exec_space>(0, 1),
619 KOKKOS_LAMBDA(
typename batch_domain_type::discrete_element_type
const j) {
657 using Dim1 =
typename interpolation_mesh_type1::continuous_dimension_type;
658 using Dim2 =
typename interpolation_mesh_type2::continuous_dimension_type;
659 if constexpr (bsplines_type1::is_periodic()) {
670 if constexpr (bsplines_type2::is_periodic()) {
681 if constexpr (!bsplines_type1::is_periodic()) {
689 if constexpr (!bsplines_type2::is_periodic()) {
699 typename interpolation_mesh_type1::continuous_dimension_type,
700 typename interpolation_mesh_type2::continuous_dimension_type>(
727 std::is_same_v<EvalType1, eval_type> || std::is_same_v<EvalType1, eval_deriv_type>);
729 std::is_same_v<EvalType2, eval_type> || std::is_same_v<EvalType2, eval_deriv_type>);
734 std::experimental::mdspan<
736 std::experimental::extents<std::size_t, bsplines_type1::degree() + 1>>
const
739 std::experimental::mdspan<
741 std::experimental::extents<std::size_t, bsplines_type2::degree() + 1>>
const
752 if constexpr (std::is_same_v<EvalType1, eval_type>) {
755 }
else if constexpr (std::is_same_v<EvalType1, eval_deriv_type>) {
759 if constexpr (std::is_same_v<EvalType2, eval_type>) {
762 }
else if constexpr (std::is_same_v<EvalType2, eval_deriv_type>) {
768 for (std::size_t
i = 0;
i < bsplines_type1::degree() + 1; ++
i) {
769 for (std::size_t
j = 0;
j < bsplines_type2::degree() + 1; ++
j) {
Definition discrete_domain.hpp:51
Definition kokkos_allocator.hpp:17
Define an evaluator 2D on B-splines.
Definition spline_evaluator_2d.hpp:32
RightExtrapolationRule1 right_extrapolation_rule_1_type
Definition spline_evaluator_2d.hpp:60
BSplinesType2 bsplines_type2
Definition spline_evaluator_2d.hpp:57
right_extrapolation_rule_2_type right_extrapolation_rule_dim_2() const
Definition spline_evaluator_2d.hpp:249
void integrate(ddc::ChunkSpan< double, batch_domain_type, Layout1, memory_space > const integrals, ddc::ChunkSpan< double const, batched_spline_domain_type, Layout2, memory_space > const spline_coef) const
Get the the integral of the function on B-splines on the domain.
Definition spline_evaluator_2d.hpp:594
KOKKOS_FUNCTION double deriv_1_and_2(ddc::Coordinate< CoordsDims... > const &coord_eval, ddc::ChunkSpan< double const, spline_domain_type, Layout, memory_space > const spline_coef) const
Get the value of the cross derivative of the function on B-splines at the coordinate given.
Definition spline_evaluator_2d.hpp:352
left_extrapolation_rule_2_type left_extrapolation_rule_dim_2() const
Definition spline_evaluator_2d.hpp:244
KOKKOS_FUNCTION double deriv_dim_1(ddc::Coordinate< CoordsDims... > const &coord_eval, ddc::ChunkSpan< double const, spline_domain_type, Layout, memory_space > const spline_coef) const
Get the value of the derivative of the first dimension of the function on B-splines at the coordinate...
Definition spline_evaluator_2d.hpp:314
SplineEvaluator2D(LeftExtrapolationRule1 const &left_extrap_rule1, RightExtrapolationRule1 const &right_extrap_rule1, LeftExtrapolationRule2 const &left_extrap_rule2, RightExtrapolationRule2 const &right_extrap_rule2)
Instantiate an evaluator operator.
Definition spline_evaluator_2d.hpp:180
right_extrapolation_rule_1_type right_extrapolation_rule_dim_1() const
Definition spline_evaluator_2d.hpp:239
SplineEvaluator2D & operator=(SplineEvaluator2D const &x)=default
Assign a SplineEvaluator2D from another SplineEvaluator2D (lvalue).
ddc::DiscreteDomain< bsplines_type1, bsplines_type2 > spline_domain_type
Definition spline_evaluator_2d.hpp:72
LeftExtrapolationRule1 left_extrapolation_rule_1_type
Definition spline_evaluator_2d.hpp:59
~SplineEvaluator2D()=default
typename ddc::detail::convert_type_seq_to_discrete_domain< ddc::type_seq_remove_t< ddc::detail::TypeSeq< IDimX... >, ddc::detail::TypeSeq< interpolation_mesh_type1, interpolation_mesh_type2 > > > batch_domain_type
Definition spline_evaluator_2d.hpp:74
typename ddc::detail::convert_type_seq_to_discrete_domain< ddc::type_seq_replace_t< ddc::detail::TypeSeq< IDimX... >, ddc::detail::TypeSeq< interpolation_mesh_type1, interpolation_mesh_type2 >, ddc::detail::TypeSeq< bsplines_type1, bsplines_type2 > > > batched_spline_domain_type
Definition spline_evaluator_2d.hpp:79
RightExtrapolationRule2 right_extrapolation_rule_2_type
Definition spline_evaluator_2d.hpp:62
KOKKOS_FUNCTION double deriv(ddc::Coordinate< CoordsDims... > const &coord_eval, ddc::ChunkSpan< double const, spline_domain_type, Layout, memory_space > const spline_coef) const
Definition spline_evaluator_2d.hpp:361
KOKKOS_FUNCTION double operator()(ddc::Coordinate< CoordsDims... > const &coord_eval, ddc::ChunkSpan< double const, spline_domain_type, Layout, memory_space > const spline_coef) const
Get the value of the function on B-splines at the coordinate given.
Definition spline_evaluator_2d.hpp:265
ExecSpace exec_space
Definition spline_evaluator_2d.hpp:52
MemorySpace memory_space
Definition spline_evaluator_2d.hpp:54
BSplinesType1 bsplines_type1
Definition spline_evaluator_2d.hpp:56
KOKKOS_FUNCTION double deriv_dim_2(ddc::Coordinate< CoordsDims... > const &coord_eval, ddc::ChunkSpan< double const, spline_domain_type, Layout, memory_space > const spline_coef) const
Get the value of the derivative of the second dimension of the function on B-splines at the coordinat...
Definition spline_evaluator_2d.hpp:333
KOKKOS_FUNCTION double deriv2(ddc::Coordinate< CoordsDims... > const &coord_eval, ddc::ChunkSpan< double const, spline_domain_type, Layout, memory_space > const spline_coef) const
Definition spline_evaluator_2d.hpp:384
LeftExtrapolationRule2 left_extrapolation_rule_2_type
Definition spline_evaluator_2d.hpp:61
left_extrapolation_rule_1_type left_extrapolation_rule_dim_1() const
Definition spline_evaluator_2d.hpp:234
The top-level namespace of DDC.
Definition aligned_allocator.hpp:11
constexpr bool enable_chunk
Definition chunk_traits.hpp:16
KOKKOS_FUNCTION Coordinate< typename DDim::continuous_dimension_type > rmax(DiscreteDomain< DDim > const &d)
Definition non_uniform_point_sampling.hpp:182
void parallel_for_each(std::string const &label, ExecSpace const &execution_space, DiscreteDomain< DDims... > const &domain, Functor &&f) noexcept
iterates over a nD domain using a given Kokkos execution space
Definition parallel_for_each.hpp:155
KOKKOS_FUNCTION Coordinate< typename DDim::continuous_dimension_type > rmin(DiscreteDomain< DDim > const &d)
Definition non_uniform_point_sampling.hpp:175
detail::TaggedVector< CoordinateElement, CDims... > Coordinate
A Coordinate represents a coordinate in the continuous space.
Definition coordinate.hpp:26
Definition chunk_span.hpp:30