13#include <Kokkos_Core.hpp>
17template <
class DimI,
class... Dim>
23
24
25
26
27
32 ddc::Coordinate<DimI> m_eval_pos;
36
37
38
39
40
41
42
46
47
48
49
50
51
52
53
54
55 template <
class CoordType,
class BSplines,
class Layout,
class MemorySpace>
61 static_assert(in_tags_v<DimI, to_type_seq_t<CoordType>>);
63 std::array<
double, BSplines::degree() + 1> vals_ptr;
64 Kokkos::mdspan<
double, Kokkos::extents<std::size_t, BSplines::degree() + 1>>
const vals(
67 ddc::DiscreteElement<BSplines>
const idx
68 =
ddc::discrete_space<BSplines>().eval_basis(vals, m_eval_pos);
71 for (std::size_t i = 0; i < BSplines::degree() + 1; ++i) {
72 y += spline_coef(idx + i) * vals[i];
79
80
81
82
83
84template <
class DimI,
class DimNI>
88 ddc::Coordinate<DimI> m_eval_pos;
89 ddc::Coordinate<DimNI> m_eval_pos_not_interest_min;
90 ddc::Coordinate<DimNI> m_eval_pos_not_interest_max;
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
111 ddc::Coordinate<DimI> eval_pos,
112 ddc::Coordinate<DimNI> eval_pos_not_interest_min,
113 ddc::Coordinate<DimNI> eval_pos_not_interest_max)
114 : m_eval_pos(eval_pos)
115 , m_eval_pos_not_interest_min(eval_pos_not_interest_min)
116 , m_eval_pos_not_interest_max(eval_pos_not_interest_max)
121
122
123
124
125
126
127
128
129
130
131
132 template <
class DimNI_sfinae = DimNI, std::enable_if_t<DimNI_sfinae::PERIODIC,
int> = 0>
134 : m_eval_pos(eval_pos)
135 , m_eval_pos_not_interest_min(0.)
136 , m_eval_pos_not_interest_max(0.)
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157 template <
class CoordType,
class BSplines1,
class BSplines2,
class Layout,
class MemorySpace>
159 CoordType coord_extrap,
164 MemorySpace>
const spline_coef)
const
167 in_tags_v<DimI, to_type_seq_t<CoordType>>
168 && in_tags_v<DimNI, to_type_seq_t<CoordType>>);
170 ddc::Coordinate<DimI, DimNI> eval_pos;
171 if constexpr (DimNI::PERIODIC) {
172 eval_pos =
ddc::Coordinate<DimI, DimNI>(m_eval_pos,
ddc::select<DimNI>(coord_extrap));
174 eval_pos =
ddc::Coordinate<DimI, DimNI>(
177 clamp(
ddc::select<DimNI>(coord_extrap),
178 m_eval_pos_not_interest_min,
179 m_eval_pos_not_interest_max));
182 std::array<
double, BSplines1::degree() + 1> vals1_ptr;
183 Kokkos::mdspan<
double, Kokkos::extents<std::size_t, BSplines1::degree() + 1>>
const vals1(
185 std::array<
double, BSplines2::degree() + 1> vals2_ptr;
186 Kokkos::mdspan<
double, Kokkos::extents<std::size_t, BSplines2::degree() + 1>>
const vals2(
189 ddc::DiscreteElement<BSplines1>
const idx1 =
ddc::discrete_space<BSplines1>().eval_basis(
191 ddc::select<
typename BSplines1::continuous_dimension_type>(eval_pos));
192 ddc::DiscreteElement<BSplines2>
const idx2 =
ddc::discrete_space<BSplines2>().eval_basis(
194 ddc::select<
typename BSplines2::continuous_dimension_type>(eval_pos));
197 for (std::size_t i = 0; i < BSplines1::degree() + 1; ++i) {
198 for (std::size_t j = 0; j < BSplines2::degree() + 1; ++j) {
199 y += spline_coef(idx1 + i, idx2 + j) * vals1[i] * vals2[j];
friend class DiscreteDomain
The top-level namespace of DDC.