DDC 0.16.0
Loading...
Searching...
No Matches
spline_traits.hpp
1// Copyright (C) The DDC development team, see COPYRIGHT.md file
2//
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
7#include <type_traits>
8
17
18namespace ddc {
19
20template <class T>
21struct is_spline_builder : std::false_type
22{
23};
24
25template <
26 class ExecSpace,
27 class MemorySpace,
28 class BSplines,
29 class InterpolationDDim,
30 ddc::SplineBuilderClosure SBCLower,
31 ddc::SplineBuilderClosure SBCUpper,
32 SplineSolver Solver>
34 ExecSpace,
35 MemorySpace,
36 BSplines,
37 InterpolationDDim,
38 SBCLower,
39 SBCUpper,
40 Solver>> : std::true_type
41{
42};
43
44/**
45 * @brief A helper to check if T is a SplineBuilder
46 * @tparam T The type to be checked if is a SplineBuilder
47 */
48template <class T>
49inline constexpr bool is_spline_builder_v = is_spline_builder<T>::value;
50
51template <class T>
52struct is_spline_builder2d : std::false_type
53{
54};
55
56template <
57 class ExecSpace,
58 class MemorySpace,
59 class BSpline1,
60 class BSpline2,
61 concepts::discrete_dimension DDimI1,
62 concepts::discrete_dimension DDimI2,
63 ddc::SplineBuilderClosure SBCLower1,
64 ddc::SplineBuilderClosure SBCUpper1,
65 ddc::SplineBuilderClosure SBCLower2,
66 ddc::SplineBuilderClosure SBCUpper2,
67 ddc::SplineSolver Solver>
69 ExecSpace,
70 MemorySpace,
71 BSpline1,
72 BSpline2,
73 DDimI1,
74 DDimI2,
75 SBCLower1,
76 SBCUpper1,
77 SBCLower2,
78 SBCUpper2,
79 Solver>> : std::true_type
80{
81};
82
83/**
84 * @brief A helper to check if T is a SplineBuilder2D
85 * @tparam T The type to be checked if is a SplineBuilder2D
86 */
87template <class T>
88inline constexpr bool is_spline_builder2d_v = is_spline_builder2d<T>::value;
89
90template <class T>
91struct is_spline_builder3d : std::false_type
92{
93};
94
95template <
96 class ExecSpace,
97 class MemorySpace,
98 class BSpline1,
99 class BSpline2,
100 class BSpline3,
101 class DDimI1,
102 class DDimI2,
103 class DDimI3,
104 ddc::SplineBuilderClosure SBCLower1,
105 ddc::SplineBuilderClosure SBCUpper1,
106 ddc::SplineBuilderClosure SBCLower2,
107 ddc::SplineBuilderClosure SBCUpper2,
108 ddc::SplineBuilderClosure SBCLower3,
109 ddc::SplineBuilderClosure SBCUpper3,
110 ddc::SplineSolver Solver>
112 ExecSpace,
113 MemorySpace,
114 BSpline1,
115 BSpline2,
116 BSpline3,
117 DDimI1,
118 DDimI2,
119 DDimI3,
120 SBCLower1,
121 SBCUpper1,
122 SBCLower2,
123 SBCUpper2,
124 SBCLower3,
125 SBCUpper3,
126 Solver>> : std::true_type
127{
128};
129
130/**
131 * @brief A helper to check if T is a SplineBuilder3D
132 * @tparam T The type to be checked if is a SplineBuilder3D
133 */
134template <class T>
135inline constexpr bool is_spline_builder3d_v = is_spline_builder3d<T>::value;
136
137template <class T>
138struct is_spline_evaluator : std::false_type
139{
140};
141
142template <
143 class ExecSpace,
144 class MemorySpace,
145 class BSplines,
146 class EvaluationDDim,
147 class LowerExtrapolationRule,
148 class UpperExtrapolationRule>
150 ExecSpace,
151 MemorySpace,
152 BSplines,
153 EvaluationDDim,
154 LowerExtrapolationRule,
155 UpperExtrapolationRule>> : std::true_type
156{
157};
158
159template <
160 class ExecSpace,
161 class MemorySpace,
162 class BSplines,
163 class EvaluationDDim,
164 class LowerExtrapolationRule,
165 class UpperExtrapolationRule>
166struct is_spline_evaluator<SplineEvaluatorND<
167 ExecSpace,
168 MemorySpace,
169 ddc::TypeSeq<BSplines>,
170 ddc::TypeSeq<EvaluationDDim>,
171 ddc::TypeSeq<LowerExtrapolationRule, UpperExtrapolationRule>>> : std::true_type
172{
173};
174
175/**
176 * @brief A helper to check if T is a SplineEvaluator
177 * @tparam T The type to be checked if is a SplineEvaluator
178 */
179template <class T>
180inline constexpr bool is_spline_evaluator_v = is_spline_evaluator<T>::value;
181
182template <class T>
183struct is_spline_evaluator2d : std::false_type
184{
185};
186
187template <
188 class ExecSpace,
189 class MemorySpace,
190 class BSpline1,
191 class BSpline2,
192 class EvaluationDDim1,
193 class EvaluationDDim2,
194 class LowerExtrapolationRule1,
195 class UpperExtrapolationRule1,
196 class LowerExtrapolationRule2,
197 class UpperExtrapolationRule2>
199 ExecSpace,
200 MemorySpace,
201 BSpline1,
202 BSpline2,
203 EvaluationDDim1,
204 EvaluationDDim2,
205 LowerExtrapolationRule1,
206 UpperExtrapolationRule1,
207 LowerExtrapolationRule2,
208 UpperExtrapolationRule2>> : std::true_type
209{
210};
211
212template <
213 class ExecSpace,
214 class MemorySpace,
215 class BSpline1,
216 class BSpline2,
217 class EvaluationDDim1,
218 class EvaluationDDim2,
219 class LowerExtrapolationRule1,
220 class UpperExtrapolationRule1,
221 class LowerExtrapolationRule2,
222 class UpperExtrapolationRule2>
223struct is_spline_evaluator2d<SplineEvaluatorND<
224 ExecSpace,
225 MemorySpace,
226 ddc::TypeSeq<BSpline1, BSpline2>,
227 ddc::TypeSeq<EvaluationDDim1, EvaluationDDim2>,
228 ddc::TypeSeq<
229 LowerExtrapolationRule1,
230 UpperExtrapolationRule1,
231 LowerExtrapolationRule2,
232 UpperExtrapolationRule2>>> : std::true_type
233{
234};
235
236/**
237 * @brief A helper to check if T is a SplineEvaluator2D
238 * @tparam T The type to be checked if is a SplineEvaluator2D
239 */
240template <class T>
241inline constexpr bool is_spline_evaluator2d_v = is_spline_evaluator2d<T>::value;
242
243template <class T>
244struct is_spline_evaluator3d : std::false_type
245{
246};
247
248template <
249 class ExecSpace,
250 class MemorySpace,
251 class BSpline1,
252 class BSpline2,
253 class BSpline3,
254 class EvaluationDDim1,
255 class EvaluationDDim2,
256 class EvaluationDDim3,
257 class LowerExtrapolationRule1,
258 class UpperExtrapolationRule1,
259 class LowerExtrapolationRule2,
260 class UpperExtrapolationRule2,
261 class LowerExtrapolationRule3,
262 class UpperExtrapolationRule3>
264 ExecSpace,
265 MemorySpace,
266 BSpline1,
267 BSpline2,
268 BSpline3,
269 EvaluationDDim1,
270 EvaluationDDim2,
271 EvaluationDDim3,
272 LowerExtrapolationRule1,
273 UpperExtrapolationRule1,
274 LowerExtrapolationRule2,
275 UpperExtrapolationRule2,
276 LowerExtrapolationRule3,
277 UpperExtrapolationRule3>> : std::true_type
278{
279};
280
281template <
282 class ExecSpace,
283 class MemorySpace,
284 class BSpline1,
285 class BSpline2,
286 class BSpline3,
287 class EvaluationDDim1,
288 class EvaluationDDim2,
289 class EvaluationDDim3,
290 class LowerExtrapolationRule1,
291 class UpperExtrapolationRule1,
292 class LowerExtrapolationRule2,
293 class UpperExtrapolationRule2,
294 class LowerExtrapolationRule3,
295 class UpperExtrapolationRule3>
296struct is_spline_evaluator3d<SplineEvaluatorND<
297 ExecSpace,
298 MemorySpace,
299 ddc::TypeSeq<BSpline1, BSpline2, BSpline3>,
300 ddc::TypeSeq<EvaluationDDim1, EvaluationDDim2, EvaluationDDim3>,
301 ddc::TypeSeq<
302 LowerExtrapolationRule1,
303 UpperExtrapolationRule1,
304 LowerExtrapolationRule2,
305 UpperExtrapolationRule2,
306 LowerExtrapolationRule3,
307 UpperExtrapolationRule3>>> : std::true_type
308{
309};
310
311/**
312 * @brief A helper to check if T is a SplineEvaluator3D
313 * @tparam T The type to be checked if is a SplineEvaluator3D
314 */
315template <class T>
316inline constexpr bool is_spline_evaluator3d_v = is_spline_evaluator3d<T>::value;
317
318template <class T>
319struct is_spline_evaluatornd : std::false_type
320{
321};
322
323template <
324 class ExecSpace,
325 class MemorySpace,
326 class BSplines,
327 class EvaluationDDim,
328 class ExtrapolationRule>
330 SplineEvaluatorND<ExecSpace, MemorySpace, BSplines, EvaluationDDim, ExtrapolationRule>>
331 : std::true_type
332{
333};
334
335/**
336 * @brief A helper to check if T is a SplineEvaluatorND
337 * @tparam T The type to be checked if is a SplineEvaluatorND
338 */
339template <class T>
340inline constexpr bool is_spline_evaluatornd_v = is_spline_evaluatornd<T>::value;
341
342template <class Builder, class Evaluator>
343struct is_evaluator_admissible : std::false_type
344{
345};
346
347template <
348 class ExecSpace,
349 class MemorySpace,
350 class BSplines,
351 class DDim,
352 ddc::SplineBuilderClosure SBCLower,
353 ddc::SplineBuilderClosure SBCUpper,
354 SplineSolver Solver,
355 class LowerExtrapolationRule,
356 class UpperExtrapolationRule>
358 SplineBuilder<ExecSpace, MemorySpace, BSplines, DDim, SBCLower, SBCUpper, Solver>,
360 ExecSpace,
361 MemorySpace,
362 BSplines,
363 DDim,
364 LowerExtrapolationRule,
365 UpperExtrapolationRule>> : std::true_type
366{
367};
368
369template <
370 class ExecSpace,
371 class MemorySpace,
372 class BSplines1,
373 class BSplines2,
374 concepts::discrete_dimension DDimI1,
375 concepts::discrete_dimension DDimI2,
376 ddc::SplineBuilderClosure SBCLower1,
377 ddc::SplineBuilderClosure SBCUpper1,
378 ddc::SplineBuilderClosure SBCLower2,
379 ddc::SplineBuilderClosure SBCUpper2,
380 SplineSolver Solver,
381 class LowerExtrapolationRule1,
382 class UpperExtrapolationRule1,
383 class LowerExtrapolationRule2,
384 class UpperExtrapolationRule2>
387 ExecSpace,
388 MemorySpace,
389 BSplines1,
390 BSplines2,
391 DDimI1,
392 DDimI2,
393 SBCLower1,
394 SBCUpper1,
395 SBCLower2,
396 SBCUpper2,
397 Solver>,
399 ExecSpace,
400 MemorySpace,
401 BSplines1,
402 BSplines2,
403 DDimI1,
404 DDimI2,
405 LowerExtrapolationRule1,
406 UpperExtrapolationRule1,
407 LowerExtrapolationRule2,
408 UpperExtrapolationRule2>> : std::true_type
409{
410};
411
412template <
413 class ExecSpace,
414 class MemorySpace,
415 class BSplines1,
416 class BSplines2,
417 class BSplines3,
418 class DDimI1,
419 class DDimI2,
420 class DDimI3,
421 ddc::SplineBuilderClosure SBCLower1,
422 ddc::SplineBuilderClosure SBCUpper1,
423 ddc::SplineBuilderClosure SBCLower2,
424 ddc::SplineBuilderClosure SBCUpper2,
425 ddc::SplineBuilderClosure SBCLower3,
426 ddc::SplineBuilderClosure SBCUpper3,
427 SplineSolver Solver,
428 class LowerExtrapolationRule1,
429 class UpperExtrapolationRule1,
430 class LowerExtrapolationRule2,
431 class UpperExtrapolationRule2,
432 class LowerExtrapolationRule3,
433 class UpperExtrapolationRule3>
436 ExecSpace,
437 MemorySpace,
438 BSplines1,
439 BSplines2,
440 BSplines3,
441 DDimI1,
442 DDimI2,
443 DDimI3,
444 SBCLower1,
445 SBCUpper1,
446 SBCLower2,
447 SBCUpper2,
448 SBCLower3,
449 SBCUpper3,
450 Solver>,
452 ExecSpace,
453 MemorySpace,
454 BSplines1,
455 BSplines2,
456 BSplines3,
457 DDimI1,
458 DDimI2,
459 DDimI3,
460 LowerExtrapolationRule1,
461 UpperExtrapolationRule1,
462 LowerExtrapolationRule2,
463 UpperExtrapolationRule2,
464 LowerExtrapolationRule3,
465 UpperExtrapolationRule3>> : std::true_type
466{
467};
468
469template <
470 class ExecSpace,
471 class MemorySpace,
472 class BSplines,
473 class DDim,
474 ddc::SplineBuilderClosure SBCLower,
475 ddc::SplineBuilderClosure SBCUpper,
476 SplineSolver Solver,
477 class LowerExtrapolationRule,
478 class UpperExtrapolationRule>
480 SplineBuilder<ExecSpace, MemorySpace, BSplines, DDim, SBCLower, SBCUpper, Solver>,
481 SplineEvaluatorND<
482 ExecSpace,
483 MemorySpace,
484 TypeSeq<BSplines>,
485 TypeSeq<DDim>,
486 TypeSeq<LowerExtrapolationRule, UpperExtrapolationRule>>> : std::true_type
487{
488};
489
490template <
491 class ExecSpace,
492 class MemorySpace,
493 class BSplines1,
494 class BSplines2,
495 class DDimI1,
496 class DDimI2,
497 ddc::SplineBuilderClosure SBCLower1,
498 ddc::SplineBuilderClosure SBCUpper1,
499 ddc::SplineBuilderClosure SBCLower2,
500 ddc::SplineBuilderClosure SBCUpper2,
501 SplineSolver Solver,
502 class LowerExtrapolationRule1,
503 class UpperExtrapolationRule1,
504 class LowerExtrapolationRule2,
505 class UpperExtrapolationRule2>
508 ExecSpace,
509 MemorySpace,
510 BSplines1,
511 BSplines2,
512 DDimI1,
513 DDimI2,
514 SBCLower1,
515 SBCUpper1,
516 SBCLower2,
517 SBCUpper2,
518 Solver>,
519 SplineEvaluatorND<
520 ExecSpace,
521 MemorySpace,
522 TypeSeq<BSplines1, BSplines2>,
523 TypeSeq<DDimI1, DDimI2>,
524 TypeSeq<LowerExtrapolationRule1,
525 UpperExtrapolationRule1,
526 LowerExtrapolationRule2,
527 UpperExtrapolationRule2>>> : std::true_type
528{
529};
530
531template <
532 class ExecSpace,
533 class MemorySpace,
534 class BSplines1,
535 class BSplines2,
536 class BSplines3,
537 class DDimI1,
538 class DDimI2,
539 class DDimI3,
540 ddc::SplineBuilderClosure SBCLower1,
541 ddc::SplineBuilderClosure SBCUpper1,
542 ddc::SplineBuilderClosure SBCLower2,
543 ddc::SplineBuilderClosure SBCUpper2,
544 ddc::SplineBuilderClosure SBCLower3,
545 ddc::SplineBuilderClosure SBCUpper3,
546 SplineSolver Solver,
547 class LowerExtrapolationRule1,
548 class UpperExtrapolationRule1,
549 class LowerExtrapolationRule2,
550 class UpperExtrapolationRule2,
551 class LowerExtrapolationRule3,
552 class UpperExtrapolationRule3>
555 ExecSpace,
556 MemorySpace,
557 BSplines1,
558 BSplines2,
559 BSplines3,
560 DDimI1,
561 DDimI2,
562 DDimI3,
563 SBCLower1,
564 SBCUpper1,
565 SBCLower2,
566 SBCUpper2,
567 SBCLower3,
568 SBCUpper3,
569 Solver>,
570 SplineEvaluatorND<
571 ExecSpace,
572 MemorySpace,
573 TypeSeq<BSplines1, BSplines2, BSplines3>,
574 TypeSeq<DDimI1, DDimI2, DDimI3>,
575 TypeSeq<LowerExtrapolationRule1,
576 UpperExtrapolationRule1,
577 LowerExtrapolationRule2,
578 UpperExtrapolationRule2,
579 LowerExtrapolationRule3,
580 UpperExtrapolationRule3>>> : std::true_type
581{
582};
583
584/**
585 * @brief A helper to check if SplineEvaluator is admissible for SplineBuilder
586 * @tparam Builder The builder type to be checked if it is admissible for Evaluator
587 * @tparam Evaluator The evaluator type to be checked if it is admissible for Builder
588 */
589template <class Builder, class Evaluator>
590inline constexpr bool is_evaluator_admissible_v
592
593} // namespace ddc
friend class ChunkSpan
friend class Chunk
Definition chunk.hpp:83
friend class DiscreteDomain
KOKKOS_DEFAULTED_FUNCTION constexpr DiscreteElement()=default
KOKKOS_FUNCTION constexpr bool operator!=(DiscreteVector< OTags... > const &rhs) const noexcept
A class which provides helper functions to initialise the Greville points from a B-Spline definition.
static ddc::DiscreteDomain< Sampling > get_domain()
Get the domain which gives us access to all of the Greville points.
Helper class for the initialisation of the mesh of interpolation points.
static auto get_sampling()
Get the sampling of interpolation points.
static ddc::DiscreteDomain< Sampling > get_domain()
Get the domain which can be used to access the interpolation points in the sampling.
Storage class of the static attributes of the discrete dimension.
KOKKOS_INLINE_FUNCTION std::size_t ncells() const noexcept
Returns the number of cells over which the B-splines are defined.
Impl(Impl &&x)=default
Move-constructs.
KOKKOS_INLINE_FUNCTION std::size_t nbasis() const noexcept
Returns the number of basis functions.
KOKKOS_INLINE_FUNCTION ddc::DiscreteElement< knot_discrete_dimension_type > get_last_support_knot(discrete_element_type const &ix) const
Returns the coordinate of the last support knot associated to a DiscreteElement identifying a B-splin...
KOKKOS_INLINE_FUNCTION discrete_element_type eval_basis_and_n_derivs(Kokkos::mdspan< double, Kokkos::dextents< std::size_t, 2 > > derivs, ddc::Coordinate< CDim > const &x, std::size_t n) const
Evaluates non-zero B-spline values and derivatives at a given coordinate.
Impl(Impl< DDim, OriginMemorySpace > const &impl)
Copy-constructs from another Impl with a different Kokkos memory space.
Impl(Impl const &x)=default
Copy-constructs.
KOKKOS_INLINE_FUNCTION discrete_element_type eval_deriv(Kokkos::mdspan< double, Kokkos::dextents< std::size_t, 1 > > derivs, ddc::Coordinate< CDim > const &x) const
Evaluates non-zero B-spline derivatives at a given coordinate.
KOKKOS_INLINE_FUNCTION ddc::DiscreteDomain< knot_discrete_dimension_type > break_point_domain() const
Returns the discrete domain which describes the break points.
Impl & operator=(Impl const &x)=default
Copy-assigns.
KOKKOS_INLINE_FUNCTION Real length() const noexcept
Returns the length of the domain.
KOKKOS_INLINE_FUNCTION std::size_t npoints() const noexcept
The number of break points.
KOKKOS_INLINE_FUNCTION ddc::DiscreteElement< knot_discrete_dimension_type > get_first_support_knot(discrete_element_type const &ix) const
Returns the coordinate of the first support knot associated to a DiscreteElement identifying a B-spli...
Impl(RandomIt breaks_begin, RandomIt breaks_end)
Constructs an Impl by iterating over a range of break points from begin to end.
KOKKOS_INLINE_FUNCTION discrete_domain_type full_domain() const
Returns the discrete domain including eventual additional B-splines in the periodic case.
KOKKOS_INLINE_FUNCTION std::size_t size() const noexcept
Returns the number of elements necessary to construct a spline representation of a function.
Impl(std::initializer_list< ddc::Coordinate< CDim > > breaks)
Constructs an Impl using a brace-list, i.e.
Impl & operator=(Impl &&x)=default
Move-assigns.
KOKKOS_INLINE_FUNCTION ddc::Coordinate< CDim > rmin() const noexcept
Returns the coordinate of the first break point of the domain on which the B-splines are defined.
KOKKOS_INLINE_FUNCTION discrete_element_type eval_basis(Kokkos::mdspan< double, Kokkos::dextents< std::size_t, 1 > > values, ddc::Coordinate< CDim > const &x) const
Evaluates non-zero B-splines at a given coordinate.
~Impl()=default
Destructs.
KOKKOS_INLINE_FUNCTION ddc::Coordinate< CDim > rmax() const noexcept
Returns the coordinate of the last break point of the domain on which the B-splines are defined.
Impl(std::vector< ddc::Coordinate< CDim > > const &breaks)
Constructs an Impl using a std::vector.
The type of a non-uniform 1D spline basis (B-spline).
static constexpr std::size_t degree() noexcept
The degree of B-splines.
static constexpr bool is_periodic() noexcept
Indicates if the B-splines are periodic or not.
static constexpr bool is_uniform() noexcept
Indicates if the B-splines are uniform or not (this is not the case here).
NonUniformPointSampling models a non-uniform discretization of the CDim segment .
A class for creating a 2D spline approximation of a function.
SplineBuilder2D(BatchedInterpolationDDom const &batched_interpolation_domain, std::optional< std::size_t > cols_per_chunk=std::nullopt, std::optional< unsigned int > preconditioner_max_block_size=std::nullopt)
Build a SplineBuilder2D acting on the interpolation domain contained in batched_interpolation_domain.
void operator()(ddc::ChunkSpan< Real, batched_spline_domain_type< BatchedInterpolationDDom >, Layout, memory_space > spline, ddc::ChunkSpan< Real const, BatchedInterpolationDDom, Layout, memory_space > vals, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type1< BatchedInterpolationDDom >, Layout, memory_space > > derivs_min1=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type1< BatchedInterpolationDDom >, Layout, memory_space > > derivs_max1=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type2< BatchedInterpolationDDom >, Layout, memory_space > > derivs_min2=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type2< BatchedInterpolationDDom >, Layout, memory_space > > derivs_max2=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_min1_min2=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_max1_min2=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_min1_max2=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_max1_max2=std::nullopt) const
Compute a 2D spline approximation of a function.
SplineBuilder2D & operator=(SplineBuilder2D const &x)=delete
Copy-assignment is deleted.
SplineBuilder2D(std::string const &label, BatchedInterpolationDDom const &batched_interpolation_domain, std::optional< std::size_t > cols_per_chunk=std::nullopt, std::optional< unsigned int > preconditioner_max_block_size=std::nullopt)
Build a SplineBuilder2D acting on the interpolation domain contained in batched_interpolation_domain.
batch_domain_type< BatchedInterpolationDDom > batch_domain(BatchedInterpolationDDom const &batched_interpolation_domain) const noexcept
Get the batch domain.
interpolation_domain_type interpolation_domain() const noexcept
Get the domain for the 2D interpolation mesh used by this class.
SplineBuilder2D(SplineBuilder2D &&x)=default
Move-constructs.
batched_spline_domain_type< BatchedInterpolationDDom > batched_spline_domain(BatchedInterpolationDDom const &batched_interpolation_domain) const noexcept
Get the whole domain on which spline coefficients are defined.
SplineBuilder2D(interpolation_domain_type const &interpolation_domain, std::optional< std::size_t > cols_per_chunk=std::nullopt, std::optional< unsigned int > preconditioner_max_block_size=std::nullopt)
Build a SplineBuilder2D acting on interpolation_domain.
~SplineBuilder2D()=default
Destructs.
SplineBuilder2D(std::string const &label, interpolation_domain_type const &interpolation_domain, std::optional< std::size_t > cols_per_chunk=std::nullopt, std::optional< unsigned int > preconditioner_max_block_size=std::nullopt)
Build a SplineBuilder2D acting on interpolation_domain.
ddc::DiscreteDomain< bsplines_type1, bsplines_type2 > spline_domain() const noexcept
Get the 2D domain on which spline coefficients are defined.
SplineBuilder2D(SplineBuilder2D const &x)=delete
Copy-constructor is deleted.
BatchedInterpolationDDom batched_interpolation_domain(BatchedInterpolationDDom const &batched_interpolation_domain) const noexcept
Get the whole domain representing interpolation points.
SplineBuilder2D & operator=(SplineBuilder2D &&x)=default
Move-assigns.
A class for creating a 3D spline approximation of a function.
BatchedInterpolationDDom batched_interpolation_domain(BatchedInterpolationDDom const &batched_interpolation_domain) const noexcept
Get the whole domain representing interpolation points.
SplineBuilder3D(interpolation_domain_type const &interpolation_domain, std::optional< std::size_t > cols_per_chunk=std::nullopt, std::optional< unsigned int > preconditioner_max_block_size=std::nullopt)
Build a SplineBuilder3D acting on interpolation_domain.
SplineBuilder3D(std::string label, BatchedInterpolationDDom const &batched_interpolation_domain, std::optional< std::size_t > cols_per_chunk=std::nullopt, std::optional< unsigned int > preconditioner_max_block_size=std::nullopt)
Build a SplineBuilder3D acting on the interpolation domain contained in batched_interpolation_domain.
SplineBuilder3D & operator=(SplineBuilder3D &&x)=default
Move-assigns.
batched_spline_domain_type< BatchedInterpolationDDom > batched_spline_domain(BatchedInterpolationDDom const &batched_interpolation_domain) const noexcept
Get the whole domain on which spline coefficients are defined.
ddc::DiscreteDomain< bsplines_type1, bsplines_type2, bsplines_type3 > spline_domain() const noexcept
Get the 3D domain on which spline coefficients are defined.
batch_domain_type< BatchedInterpolationDDom > batch_domain(BatchedInterpolationDDom const &batched_interpolation_domain) const noexcept
Get the batch domain.
interpolation_domain_type interpolation_domain() const noexcept
Get the domain for the 3D interpolation mesh used by this class.
~SplineBuilder3D()=default
Destructs.
SplineBuilder3D & operator=(SplineBuilder3D const &x)=delete
Copy-assignment is deleted.
SplineBuilder3D(BatchedInterpolationDDom const &batched_interpolation_domain, std::optional< std::size_t > cols_per_chunk=std::nullopt, std::optional< unsigned int > preconditioner_max_block_size=std::nullopt)
Build a SplineBuilder3D acting on the interpolation domain contained in batched_interpolation_domain.
void operator()(ddc::ChunkSpan< Real, batched_spline_domain_type< BatchedInterpolationDDom >, Layout, memory_space > spline, ddc::ChunkSpan< Real const, BatchedInterpolationDDom, Layout, memory_space > vals, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type1< BatchedInterpolationDDom >, Layout, memory_space > > derivs_min1=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type1< BatchedInterpolationDDom >, Layout, memory_space > > derivs_max1=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type2< BatchedInterpolationDDom >, Layout, memory_space > > derivs_min2=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type2< BatchedInterpolationDDom >, Layout, memory_space > > derivs_max2=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type3< BatchedInterpolationDDom >, Layout, memory_space > > derivs_min3=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type3< BatchedInterpolationDDom >, Layout, memory_space > > derivs_max3=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type1_2< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_min1_min2=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type1_2< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_max1_min2=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type1_2< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_min1_max2=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type1_2< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_max1_max2=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type2_3< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_min2_min3=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type2_3< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_max2_min3=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type2_3< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_min2_max3=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type2_3< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_max2_max3=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type1_3< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_min1_min3=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type1_3< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_max1_min3=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type1_3< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_min1_max3=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type1_3< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_max1_max3=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_min1_min2_min3=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_max1_min2_min3=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_min1_max2_min3=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_max1_max2_min3=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_min1_min2_max3=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_max1_min2_max3=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_min1_max2_max3=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_max1_max2_max3=std::nullopt) const
Compute a 3D spline approximation of a function.
SplineBuilder3D(std::string label, interpolation_domain_type const &interpolation_domain, std::optional< std::size_t > cols_per_chunk=std::nullopt, std::optional< unsigned int > preconditioner_max_block_size=std::nullopt)
Build a SplineBuilder3D acting on interpolation_domain.
SplineBuilder3D(SplineBuilder3D const &x)=delete
Copy-constructor is deleted.
SplineBuilder3D(SplineBuilder3D &&x)=default
Move-constructs.
A class for creating a spline approximation of a function.
std::tuple< ddc::Chunk< Real, ddc::DiscreteDomain< ddc::Deriv< typename InterpolationDDim::continuous_dimension_type > >, ddc::KokkosAllocator< Real, OutMemorySpace > >, ddc::Chunk< Real, ddc::DiscreteDomain< InterpolationDDim >, ddc::KokkosAllocator< Real, OutMemorySpace > >, ddc::Chunk< Real, ddc::DiscreteDomain< ddc::Deriv< typename InterpolationDDim::continuous_dimension_type > >, ddc::KokkosAllocator< Real, OutMemorySpace > > > quadrature_coefficients() const
Compute the quadrature coefficients associated to the b-splines used by this SplineBuilder.
ddc::DiscreteDomain< bsplines_type > spline_domain() const noexcept
Get the 1D domain on which spline coefficients are defined.
SplineBuilder(BatchedInterpolationDDom const &batched_interpolation_domain, std::optional< std::size_t > cols_per_chunk=std::nullopt, std::optional< unsigned int > preconditioner_max_block_size=std::nullopt)
Build a SplineBuilder acting on the interpolation domain contained by batched_interpolation_domain.
SplineBuilder(SplineBuilder const &x)=delete
Copy-constructor is deleted.
interpolation_domain_type interpolation_domain() const noexcept
Get the domain for the 1D interpolation mesh used by this class.
batched_derivs_domain_type< BatchedInterpolationDDom > batched_derivs_xmax_domain(BatchedInterpolationDDom const &batched_interpolation_domain) const noexcept
Get the whole domain on which derivatives on upper boundary are defined.
static constexpr int s_nbe_xmin
The number of equations defining the closure relation at the lower bound.
static constexpr ddc::SplineBuilderClosure s_sbc_xmin
The closure relation implemented at the lower bound.
SplineBuilder(std::string label, BatchedInterpolationDDom const &batched_interpolation_domain, std::optional< std::size_t > cols_per_chunk=std::nullopt, std::optional< unsigned int > preconditioner_max_block_size=std::nullopt)
Build a SplineBuilder acting on the interpolation domain contained by batched_interpolation_domain.
batch_domain_type< BatchedInterpolationDDom > batch_domain(BatchedInterpolationDDom const &batched_interpolation_domain) const noexcept
Get the batch domain.
SplineBuilder & operator=(SplineBuilder &&x)=default
Move-assigns.
static constexpr int s_nbe_xmax
The number of equations defining the closure relation at the upper bound.
static constexpr SplineSolver s_spline_solver
The SplineSolver giving the backend used to perform the spline approximation.
static constexpr ddc::SplineBuilderClosure s_sbc_xmax
The closure relation implemented at the upper bound.
BatchedInterpolationDDom batched_interpolation_domain(BatchedInterpolationDDom const &batched_interpolation_domain) const noexcept
Get the whole domain representing interpolation points.
batched_spline_domain_type< BatchedInterpolationDDom > batched_spline_domain(BatchedInterpolationDDom const &batched_interpolation_domain) const noexcept
Get the whole domain on which spline coefficients are defined.
SplineBuilder(interpolation_domain_type const &interpolation_domain, std::optional< std::size_t > cols_per_chunk=std::nullopt, std::optional< unsigned int > preconditioner_max_block_size=std::nullopt)
Build a SplineBuilder acting on interpolation_domain.
static constexpr bool s_odd
Indicates if the degree of the splines is odd or even.
void operator()(ddc::ChunkSpan< Real, batched_spline_domain_type< BatchedInterpolationDDom >, Layout, memory_space > spline, ddc::ChunkSpan< Real const, BatchedInterpolationDDom, Layout, memory_space > vals, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type< BatchedInterpolationDDom >, Layout, memory_space > > derivs_xmin=std::nullopt, std::optional< ddc::ChunkSpan< Real const, batched_derivs_domain_type< BatchedInterpolationDDom >, Layout, memory_space > > derivs_xmax=std::nullopt) const
Compute a spline approximation of a function.
batched_derivs_domain_type< BatchedInterpolationDDom > batched_derivs_xmin_domain(BatchedInterpolationDDom const &batched_interpolation_domain) const noexcept
Get the whole domain on which derivatives on lower boundary are defined.
SplineBuilder(std::string label, interpolation_domain_type const &interpolation_domain, std::optional< std::size_t > cols_per_chunk=std::nullopt, std::optional< unsigned int > preconditioner_max_block_size=std::nullopt)
Build a SplineBuilder acting on interpolation_domain.
SplineBuilder(SplineBuilder &&x)=default
Move-constructs.
static constexpr int s_nbv_xmax
The number of input values defining the closure relation at the upper bound.
~SplineBuilder()=default
Destructs.
static constexpr int s_nbv_xmin
The number of input values defining the closure relation at the lower bound.
SplineBuilder & operator=(SplineBuilder const &x)=delete
Copy-assignment is deleted.
A class to evaluate, differentiate or integrate a 2D spline function.
SplineEvaluator2D(SplineEvaluator2D &&x)=default
Move-constructs.
lower_extrapolation_rule_1_type lower_extrapolation_rule_dim_1() const
Get the lower extrapolation rule along the first dimension.
void integrate(ddc::ChunkSpan< Real, BatchedDDom, Layout1, memory_space > const integrals, ddc::ChunkSpan< Real const, BatchedSplineDDom, Layout2, memory_space > const spline_coef) const
Perform batched 2D integrations of a spline function (described by its spline coefficients) along the...
SplineEvaluator2D & operator=(SplineEvaluator2D const &x)=default
Copy-assigns.
void deriv(DElem const &deriv_order, ddc::ChunkSpan< Real, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< Real const, batched_spline_domain_type< BatchedInterpolationDDom >, Layout2, memory_space > const spline_coef) const
Differentiate 2D spline function (described by its spline coefficients) on a mesh along the dimension...
SplineEvaluator2D(SplineEvaluator2D const &x)=default
Copy-constructs.
~SplineEvaluator2D()=default
Destructs.
void operator()(ddc::ChunkSpan< Real, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< ddc::Coordinate< CoordsDims... > const, BatchedInterpolationDDom, Layout2, memory_space > const coords_eval, ddc::ChunkSpan< Real const, batched_spline_domain_type< BatchedInterpolationDDom >, Layout3, memory_space > const spline_coef) const
Evaluate 2D spline function (described by its spline coefficients) on a mesh.
void operator()(ddc::ChunkSpan< Real, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< Real const, batched_spline_domain_type< BatchedInterpolationDDom >, Layout2, memory_space > const spline_coef) const
Evaluate 2D spline function (described by its spline coefficients) on a mesh.
void deriv(DElem const &deriv_order, ddc::ChunkSpan< Real, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< ddc::Coordinate< CoordsDims... > const, BatchedInterpolationDDom, Layout2, memory_space > const coords_eval, ddc::ChunkSpan< Real const, batched_spline_domain_type< BatchedInterpolationDDom >, Layout3, memory_space > const spline_coef) const
Differentiate 2D spline function (described by its spline coefficients) on a mesh along the dimension...
KOKKOS_FUNCTION Real deriv(DElem const &deriv_order, ddc::Coordinate< CoordsDims... > const &coord_eval, ddc::ChunkSpan< Real const, spline_domain_type, Layout, memory_space > const spline_coef) const
Differentiate 2D spline function (described by its spline coefficients) at a given coordinate along t...
upper_extrapolation_rule_2_type upper_extrapolation_rule_dim_2() const
Get the upper extrapolation rule along the second dimension.
KOKKOS_FUNCTION Real operator()(ddc::Coordinate< CoordsDims... > const &coord_eval, ddc::ChunkSpan< Real const, spline_domain_type, Layout, memory_space > const spline_coef) const
Evaluate 2D spline function (described by its spline coefficients) at a given coordinate.
upper_extrapolation_rule_1_type upper_extrapolation_rule_dim_1() const
Get the upper extrapolation rule along the first dimension.
lower_extrapolation_rule_2_type lower_extrapolation_rule_dim_2() const
Get the lower extrapolation rule along the second dimension.
SplineEvaluator2D & operator=(SplineEvaluator2D &&x)=default
Move-assigns.
SplineEvaluator2D(LowerExtrapolationRule1 const &lower_extrap_rule1, UpperExtrapolationRule1 const &upper_extrap_rule1, LowerExtrapolationRule2 const &lower_extrap_rule2, UpperExtrapolationRule2 const &upper_extrap_rule2)
Build a SplineEvaluator2D acting on batched_spline_domain.
A class to evaluate, differentiate or integrate a 3D spline function.
void operator()(ddc::ChunkSpan< Real, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< Real const, batched_spline_domain_type< BatchedInterpolationDDom >, Layout2, memory_space > const spline_coef) const
Evaluate 3D spline function (described by its spline coefficients) on a mesh.
KOKKOS_FUNCTION Real deriv(DElem const &deriv_order, ddc::Coordinate< CoordsDims... > const &coord_eval, ddc::ChunkSpan< Real const, spline_domain_type, Layout, memory_space > const spline_coef) const
Differentiate 3D spline function (described by its spline coefficients) at a given coordinate along t...
upper_extrapolation_rule_1_type upper_extrapolation_rule_dim_1() const
Get the upper extrapolation rule along the first dimension.
void deriv(DElem const &deriv_order, ddc::ChunkSpan< Real, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< Real const, batched_spline_domain_type< BatchedInterpolationDDom >, Layout2, memory_space > const spline_coef) const
Differentiate 3D spline function (described by its spline coefficients) on a mesh along the dimension...
KOKKOS_FUNCTION Real operator()(ddc::Coordinate< CoordsDims... > const &coord_eval, ddc::ChunkSpan< Real const, spline_domain_type, Layout, memory_space > const spline_coef) const
Evaluate 3D spline function (described by its spline coefficients) at a given coordinate.
SplineEvaluator3D & operator=(SplineEvaluator3D &&x)=default
Move-assigns.
void deriv(DElem const &deriv_order, ddc::ChunkSpan< Real, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< ddc::Coordinate< CoordsDims... > const, BatchedInterpolationDDom, Layout2, memory_space > const coords_eval, ddc::ChunkSpan< Real const, batched_spline_domain_type< BatchedInterpolationDDom >, Layout3, memory_space > const spline_coef) const
Differentiate 3D spline function (described by its spline coefficients) on a mesh along the dimension...
void operator()(ddc::ChunkSpan< Real, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< ddc::Coordinate< CoordsDims... > const, BatchedInterpolationDDom, Layout2, memory_space > const coords_eval, ddc::ChunkSpan< Real const, batched_spline_domain_type< BatchedInterpolationDDom >, Layout3, memory_space > const spline_coef) const
Evaluate 3D spline function (described by its spline coefficients) on a mesh.
upper_extrapolation_rule_3_type upper_extrapolation_rule_dim_3() const
Get the upper extrapolation rule along the third dimension.
SplineEvaluator3D(LowerExtrapolationRule1 const &lower_extrap_rule1, UpperExtrapolationRule1 const &upper_extrap_rule1, LowerExtrapolationRule2 const &lower_extrap_rule2, UpperExtrapolationRule2 const &upper_extrap_rule2, LowerExtrapolationRule3 const &lower_extrap_rule3, UpperExtrapolationRule3 const &upper_extrap_rule3)
Build a SplineEvaluator3D acting on batched_spline_domain.
~SplineEvaluator3D()=default
Destructs.
lower_extrapolation_rule_1_type lower_extrapolation_rule_dim_1() const
Get the lower extrapolation rule along the first dimension.
upper_extrapolation_rule_2_type upper_extrapolation_rule_dim_2() const
Get the upper extrapolation rule along the second dimension.
SplineEvaluator3D(SplineEvaluator3D const &x)=default
Copy-constructs.
lower_extrapolation_rule_3_type lower_extrapolation_rule_dim_3() const
Get the lower extrapolation rule along the third dimension.
SplineEvaluator3D(SplineEvaluator3D &&x)=default
Move-constructs.
lower_extrapolation_rule_2_type lower_extrapolation_rule_dim_2() const
Get the lower extrapolation rule along the second dimension.
SplineEvaluator3D & operator=(SplineEvaluator3D const &x)=default
Copy-assigns.
void integrate(ddc::ChunkSpan< Real, BatchedDDom, Layout1, memory_space > const integrals, ddc::ChunkSpan< Real const, BatchedSplineDDom, Layout2, memory_space > const spline_coef) const
Perform batched 3D integrations of a spline function (described by its spline coefficients) along the...
KOKKOS_FUNCTION Real deriv(DElem const &deriv_order, ddc::Coordinate< CoordsDims... > const &coord_eval, ddc::ChunkSpan< Real const, ddc::DiscreteDomain< BSplines... >, Layout, memory_space > const spline_coef) const
Differentiate ND spline function (described by its spline coefficients) at a given coordinate along s...
SplineEvaluatorND(ExtrapolationRule const &... extrap_rules)
Build a SplineEvaluatorND acting on batched_spline_domain.
KOKKOS_FUNCTION Real operator()(ddc::Coordinate< CoordsDims... > const &coord_eval, ddc::ChunkSpan< Real const, ddc::DiscreteDomain< BSplines... >, Layout, memory_space > const spline_coef) const
Evaluate ND spline function (described by its spline coefficients) at a given coordinate.
void deriv(DElem const &deriv_order, ddc::ChunkSpan< Real, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< Real const, batched_spline_domain_type< BatchedInterpolationDDom >, Layout2, memory_space > const spline_coef) const
Differentiate spline function (described by its spline coefficients) on a mesh along specified dimens...
void operator()(ddc::ChunkSpan< Real, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< Real const, batched_spline_domain_type< BatchedInterpolationDDom >, Layout2, memory_space > const spline_coef) const
Evaluate ND spline function (described by its spline coefficients) on a mesh.
void operator()(ddc::ChunkSpan< Real, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< ddc::Coordinate< CoordsDims... > const, BatchedInterpolationDDom, Layout2, memory_space > const coords_eval, ddc::ChunkSpan< Real const, batched_spline_domain_type< BatchedInterpolationDDom >, Layout3, memory_space > const spline_coef) const
Evaluate ND spline function (described by its spline coefficients) on a mesh.
void integrate(ddc::ChunkSpan< Real, BatchedDDom, Layout1, memory_space > const integrals, ddc::ChunkSpan< Real const, BatchedSplineDDom, Layout2, memory_space > const spline_coef) const
Perform batched ND integrations of a spline function (described by its spline coefficients) along the...
void deriv(DElem const &deriv_order, ddc::ChunkSpan< Real, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< ddc::Coordinate< CoordsDims... > const, BatchedInterpolationDDom, Layout2, memory_space > const coords_eval, ddc::ChunkSpan< Real const, batched_spline_domain_type< BatchedInterpolationDDom >, Layout3, memory_space > const spline_coef) const
Differentiate spline function (described by its spline coefficients) on a mesh along specified dimens...
A class to evaluate, differentiate or integrate a spline function.
void deriv(DElem const &deriv_order, ddc::ChunkSpan< Real, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< ddc::Coordinate< CoordsDims... > const, BatchedInterpolationDDom, Layout2, memory_space > const coords_eval, ddc::ChunkSpan< Real const, batched_spline_domain_type< BatchedInterpolationDDom >, Layout3, memory_space > const spline_coef) const
Differentiate 1D spline function (described by its spline coefficients) on a mesh.
void operator()(ddc::ChunkSpan< Real, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< Real const, batched_spline_domain_type< BatchedInterpolationDDom >, Layout2, memory_space > const spline_coef) const
Evaluate a spline function (described by its spline coefficients) on a mesh.
upper_extrapolation_rule_type upper_extrapolation_rule() const
Get the upper extrapolation rule.
SplineEvaluator & operator=(SplineEvaluator const &x)=default
Copy-assigns.
void deriv(DElem const &deriv_order, ddc::ChunkSpan< Real, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< Real const, batched_spline_domain_type< BatchedInterpolationDDom >, Layout2, memory_space > const spline_coef) const
Differentiate 1D spline function (described by its spline coefficients) on a mesh.
SplineEvaluator & operator=(SplineEvaluator &&x)=default
Move-assigns.
void operator()(ddc::ChunkSpan< Real, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< ddc::Coordinate< CoordsDims... > const, BatchedInterpolationDDom, Layout2, memory_space > const coords_eval, ddc::ChunkSpan< Real const, batched_spline_domain_type< BatchedInterpolationDDom >, Layout3, memory_space > const spline_coef) const
Evaluate spline function (described by its spline coefficients) on a mesh.
KOKKOS_FUNCTION Real operator()(ddc::Coordinate< CoordsDims... > const &coord_eval, ddc::ChunkSpan< Real const, spline_domain_type, Layout, memory_space > const spline_coef) const
Evaluate 1D spline function (described by its spline coefficients) at a given coordinate.
SplineEvaluator(LowerExtrapolationRule const &lower_extrap_rule, UpperExtrapolationRule const &upper_extrap_rule)
Build a SplineEvaluator acting on batched_spline_domain.
lower_extrapolation_rule_type lower_extrapolation_rule() const
Get the lower extrapolation rule.
SplineEvaluator(SplineEvaluator const &x)=default
Copy-constructs.
SplineEvaluator(SplineEvaluator &&x)=default
Move-constructs.
KOKKOS_FUNCTION Real deriv(DElem const &deriv_order, ddc::Coordinate< CoordsDims... > const &coord_eval, ddc::ChunkSpan< Real const, spline_domain_type, Layout, memory_space > const spline_coef) const
Differentiate 1D spline function (described by its spline coefficients) at a given coordinate.
void integrate(ddc::ChunkSpan< Real, BatchedDDom, Layout1, memory_space > const integrals, ddc::ChunkSpan< Real const, BatchedSplineDDom, Layout2, memory_space > const spline_coef) const
Perform batched 1D integrations of a spline function (described by its spline coefficients) along the...
~SplineEvaluator()=default
Destructs.
Storage class of the static attributes of the discrete dimension.
KOKKOS_INLINE_FUNCTION std::size_t ncells() const noexcept
Returns the number of cells over which the B-splines are defined.
KOKKOS_INLINE_FUNCTION Real length() const noexcept
Returns the length of the domain.
KOKKOS_INLINE_FUNCTION ddc::Coordinate< CDim > rmin() const noexcept
Returns the coordinate of the lower bound of the domain on which the B-splines are defined.
Impl(Impl const &x)=default
Copy-constructs.
KOKKOS_INLINE_FUNCTION discrete_domain_type full_domain() const
Returns the discrete domain including eventual additional B-splines in the periodic case.
KOKKOS_INLINE_FUNCTION discrete_element_type eval_deriv(Kokkos::mdspan< double, Kokkos::dextents< std::size_t, 1 > > derivs, ddc::Coordinate< CDim > const &x) const
Evaluates non-zero B-spline derivatives at a given coordinate.
~Impl()=default
Destructs.
Impl(Impl< DDim, OriginMemorySpace > const &impl)
Copy-constructs from another Impl with a different Kokkos memory space.
KOKKOS_INLINE_FUNCTION discrete_element_type eval_basis_and_n_derivs(Kokkos::mdspan< double, Kokkos::dextents< std::size_t, 2 > > derivs, ddc::Coordinate< CDim > const &x, std::size_t n) const
Evaluates non-zero B-spline values and derivatives at a given coordinate.
Impl & operator=(Impl &&x)=default
Move-assigns.
KOKKOS_INLINE_FUNCTION ddc::Coordinate< CDim > rmax() const noexcept
Returns the coordinate of the upper bound of the domain on which the B-splines are defined.
KOKKOS_INLINE_FUNCTION ddc::DiscreteElement< knot_discrete_dimension_type > get_last_support_knot(discrete_element_type const &ix) const
Returns the coordinate of the last support knot associated to a DiscreteElement identifying a B-splin...
KOKKOS_INLINE_FUNCTION ddc::DiscreteDomain< knot_discrete_dimension_type > break_point_domain() const
Returns the discrete domain which describes the break points.
KOKKOS_INLINE_FUNCTION discrete_element_type eval_basis(Kokkos::mdspan< double, Kokkos::dextents< std::size_t, 1 > > values, ddc::Coordinate< CDim > const &x) const
Evaluates non-zero B-splines at a given coordinate.
KOKKOS_INLINE_FUNCTION ddc::DiscreteElement< knot_discrete_dimension_type > get_first_support_knot(discrete_element_type const &ix) const
Returns the coordinate of the first support knot associated to a DiscreteElement identifying a B-spli...
KOKKOS_INLINE_FUNCTION std::size_t nbasis() const noexcept
Returns the number of basis functions.
Impl & operator=(Impl const &x)=default
Copy-assigns.
KOKKOS_INLINE_FUNCTION std::size_t size() const noexcept
Returns the number of elements necessary to construct a spline representation of a function.
Impl(Impl &&x)=default
Move-constructs.
Impl(ddc::Coordinate< CDim > rmin, ddc::Coordinate< CDim > rmax, std::size_t ncells)
Constructs a spline basis (B-splines) with n equidistant knots over .
The type of a uniform 1D spline basis (B-spline).
static constexpr bool is_uniform() noexcept
Indicates if the B-splines are uniform or not (this is the case here).
static constexpr std::size_t degree() noexcept
The degree of B-splines.
static constexpr bool is_periodic() noexcept
Indicates if the B-splines are periodic or not.
UniformPointSampling models a uniform discretization of the provided continuous dimension.
The top-level namespace of DDC.
constexpr bool is_spline_builder_v
A helper to check if T is a SplineBuilder.
constexpr bool is_spline_builder3d_v
A helper to check if T is a SplineBuilder3D.
constexpr bool is_uniform_bsplines_v
Indicates if a tag corresponds to uniform B-splines or not.
constexpr bool is_spline_evaluator2d_v
A helper to check if T is a SplineEvaluator2D.
SplineSolver
An enum determining the backend solver of a SplineBuilder or SplineBuilder2d.
@ LAPACK
Enum member to identify the LAPACK-based solver (direct method)
@ GINKGO
Enum member to identify the Ginkgo-based solver (iterative method)
constexpr bool is_spline_builder2d_v
A helper to check if T is a SplineBuilder2D.
constexpr int n_boundary_equations(ddc::SplineBuilderClosure const sbc, std::size_t const degree)
Return the number of equations needed to describe a given closure relation.
constexpr bool is_spline_evaluator_v
A helper to check if T is a SplineEvaluator.
ddc::ChunkSpan< Real, ddc::DiscreteDomain< DDim >, Layout, MemorySpace > integrals(ExecSpace const &execution_space, ddc::ChunkSpan< Real, ddc::DiscreteDomain< DDim >, Layout, MemorySpace > int_vals)
Compute the integrals of the B-splines.
constexpr bool is_non_uniform_bsplines_v
Indicates if a tag corresponds to non-uniform B-splines or not.
constexpr bool is_spline_evaluatornd_v
A helper to check if T is a SplineEvaluatorND.
constexpr bool is_evaluator_admissible_v
A helper to check if SplineEvaluator is admissible for SplineBuilder.
SplineBuilderClosure
An enum representing a spline closure relation.
@ HOMOGENEOUS_HERMITE
Homogeneous Hermite closure relation (derivatives are 0)
@ GREVILLE
Use Greville points instead of conditions on derivative for B-Spline interpolation.
@ HERMITE
Hermite closure relation.
@ PERIODIC
Periodic closure relation u(1)=u(n)
constexpr bool is_spline_evaluator3d_v
A helper to check if T is a SplineEvaluator3D.
If the type DDim is a B-spline, defines type to the discrete dimension of the associated knots.
A compile-time sequence of types.
Definition type_seq.hpp:30
A functor for describing a spline boundary value by a constant extrapolation for 2D evaluator.
KOKKOS_FUNCTION Real operator()(CoordType coord_extrap, ddc::ChunkSpan< Real const, ddc::DiscreteDomain< BSplines... >, Layout, MemorySpace > const spline_coef) const
Get the value of the function on B-splines at a coordinate outside the domain.
ConstantExtrapolationRule(ddc::Coordinate< DimI > eval_pos)
Instantiate a ConstantExtrapolationRule.
A templated struct representing a discrete dimension storing the derivatives of a function along a co...
Definition deriv.hpp:17
A functor describing a null extrapolation boundary value for 1D spline evaluator.
KOKKOS_FUNCTION Real operator()(CoordType, ChunkSpan) const
Evaluates the spline at a coordinate outside of the domain.
A functor to represent periodic extrapolation in a 1D spline evaluator.
KOKKOS_FUNCTION Real operator()(CoordType, ChunkSpan) const
This function should never be called.