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
45
46
47
48
49
50
51
52 template <
class CoordType,
class BSplines,
class Layout,
class MemorySpace>
58 static_assert(in_tags_v<DimI, to_type_seq_t<CoordType>>);
60 std::array<
double, BSplines::degree() + 1> vals_ptr;
61 Kokkos::mdspan<
double, Kokkos::extents<std::size_t, BSplines::degree() + 1>>
const vals(
64 ddc::DiscreteElement<BSplines>
const idx
65 =
ddc::discrete_space<BSplines>().eval_basis(vals, m_eval_pos);
68 for (std::size_t i = 0; i < BSplines::degree() + 1; ++i) {
69 y += spline_coef(idx + i) * vals[i];
76
77
78
79
80
81template <
class DimI,
class DimNI>
85 ddc::Coordinate<DimI> m_eval_pos;
86 ddc::Coordinate<DimNI> m_eval_pos_not_interest_min;
87 ddc::Coordinate<DimNI> m_eval_pos_not_interest_max;
91
92
93
94
95
96
97
98
99
100
101
102
104 ddc::Coordinate<DimI> eval_pos,
105 ddc::Coordinate<DimNI> eval_pos_not_interest_min,
106 ddc::Coordinate<DimNI> eval_pos_not_interest_max)
107 : m_eval_pos(eval_pos)
108 , m_eval_pos_not_interest_min(eval_pos_not_interest_min)
109 , m_eval_pos_not_interest_max(eval_pos_not_interest_max)
114
115
116
117
118
119
120
121
122
123 template <
class DimNI_sfinae = DimNI, std::enable_if_t<DimNI_sfinae::PERIODIC,
int> = 0>
125 : m_eval_pos(eval_pos)
126 , m_eval_pos_not_interest_min(0.)
127 , m_eval_pos_not_interest_max(0.)
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146 template <
class CoordType,
class BSplines1,
class BSplines2,
class Layout,
class MemorySpace>
148 CoordType coord_extrap,
153 MemorySpace>
const spline_coef)
const
156 in_tags_v<DimI, to_type_seq_t<CoordType>>
157 && in_tags_v<DimNI, to_type_seq_t<CoordType>>);
159 ddc::Coordinate<DimI, DimNI> eval_pos;
160 if constexpr (DimNI::PERIODIC) {
162 Coordinate<DimI, DimNI>(m_eval_pos,
ddc::Coordinate<DimNI>(coord_extrap));
164 eval_pos =
ddc::Coordinate<DimI, DimNI>(
167 clamp(
ddc::Coordinate<DimNI>(coord_extrap),
168 m_eval_pos_not_interest_min,
169 m_eval_pos_not_interest_max));
172 std::array<
double, BSplines1::degree() + 1> vals1_ptr;
173 Kokkos::mdspan<
double, Kokkos::extents<std::size_t, BSplines1::degree() + 1>>
const vals1(
175 std::array<
double, BSplines2::degree() + 1> vals2_ptr;
176 Kokkos::mdspan<
double, Kokkos::extents<std::size_t, BSplines2::degree() + 1>>
const vals2(
179 ddc::DiscreteElement<BSplines1>
const idx1 =
ddc::discrete_space<BSplines1>().eval_basis(
181 ddc::Coordinate<
typename BSplines1::continuous_dimension_type>(eval_pos));
182 ddc::DiscreteElement<BSplines2>
const idx2 =
ddc::discrete_space<BSplines2>().eval_basis(
184 ddc::Coordinate<
typename BSplines2::continuous_dimension_type>(eval_pos));
187 for (std::size_t i = 0; i < BSplines1::degree() + 1; ++i) {
188 for (std::size_t j = 0; j < BSplines2::degree() + 1; ++j) {
189 y += spline_coef(idx1 + i, idx2 + j) * vals1[i] * vals2[j];
friend class DiscreteDomain
The top-level namespace of DDC.