DDC 0.17.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
9#include <ddc/ddc.hpp>
10
19
20namespace ddc {
21
22template <class T>
23struct is_spline_builder : std::false_type
24{
25};
26
27template <
28 class ExecSpace,
29 class MemorySpace,
30 class BSplines,
31 class InterpolationDDim,
32 ddc::SplineBuilderClosure SBCLower,
33 ddc::SplineBuilderClosure SBCUpper,
34 SplineSolver Solver>
36 ExecSpace,
37 MemorySpace,
38 BSplines,
39 InterpolationDDim,
40 SBCLower,
41 SBCUpper,
42 Solver>> : std::true_type
43{
44};
45
46/**
47 * @brief A helper to check if T is a SplineBuilder
48 * @tparam T The type to be checked if is a SplineBuilder
49 */
50template <class T>
51inline constexpr bool is_spline_builder_v = is_spline_builder<T>::value;
52
53template <class T>
54struct is_spline_builder2d : std::false_type
55{
56};
57
58template <
59 class ExecSpace,
60 class MemorySpace,
61 class BSpline1,
62 class BSpline2,
63 concepts::discrete_dimension DDimI1,
64 concepts::discrete_dimension DDimI2,
65 ddc::SplineBuilderClosure SBCLower1,
66 ddc::SplineBuilderClosure SBCUpper1,
67 ddc::SplineBuilderClosure SBCLower2,
68 ddc::SplineBuilderClosure SBCUpper2,
69 ddc::SplineSolver Solver>
71 ExecSpace,
72 MemorySpace,
73 BSpline1,
74 BSpline2,
75 DDimI1,
76 DDimI2,
77 SBCLower1,
78 SBCUpper1,
79 SBCLower2,
80 SBCUpper2,
81 Solver>> : std::true_type
82{
83};
84
85/**
86 * @brief A helper to check if T is a SplineBuilder2D
87 * @tparam T The type to be checked if is a SplineBuilder2D
88 */
89template <class T>
90inline constexpr bool is_spline_builder2d_v = is_spline_builder2d<T>::value;
91
92template <class T>
93struct is_spline_builder3d : std::false_type
94{
95};
96
97template <
98 class ExecSpace,
99 class MemorySpace,
100 class BSpline1,
101 class BSpline2,
102 class BSpline3,
103 class DDimI1,
104 class DDimI2,
105 class DDimI3,
106 ddc::SplineBuilderClosure SBCLower1,
107 ddc::SplineBuilderClosure SBCUpper1,
108 ddc::SplineBuilderClosure SBCLower2,
109 ddc::SplineBuilderClosure SBCUpper2,
110 ddc::SplineBuilderClosure SBCLower3,
111 ddc::SplineBuilderClosure SBCUpper3,
112 ddc::SplineSolver Solver>
114 ExecSpace,
115 MemorySpace,
116 BSpline1,
117 BSpline2,
118 BSpline3,
119 DDimI1,
120 DDimI2,
121 DDimI3,
122 SBCLower1,
123 SBCUpper1,
124 SBCLower2,
125 SBCUpper2,
126 SBCLower3,
127 SBCUpper3,
128 Solver>> : std::true_type
129{
130};
131
132/**
133 * @brief A helper to check if T is a SplineBuilder3D
134 * @tparam T The type to be checked if is a SplineBuilder3D
135 */
136template <class T>
137inline constexpr bool is_spline_builder3d_v = is_spline_builder3d<T>::value;
138
139template <class T>
140struct is_spline_evaluator : std::false_type
141{
142};
143
144template <
145 class ExecSpace,
146 class MemorySpace,
147 class BSplines,
148 class EvaluationDDim,
149 class LowerExtrapolationRule,
150 class UpperExtrapolationRule>
152 ExecSpace,
153 MemorySpace,
154 BSplines,
155 EvaluationDDim,
156 LowerExtrapolationRule,
157 UpperExtrapolationRule>> : std::true_type
158{
159};
160
161template <
162 class ExecSpace,
163 class MemorySpace,
164 class BSplines,
165 class EvaluationDDim,
166 class LowerExtrapolationRule,
167 class UpperExtrapolationRule>
168struct is_spline_evaluator<SplineEvaluatorND<
169 ExecSpace,
170 MemorySpace,
171 ddc::TypeSeq<BSplines>,
172 ddc::TypeSeq<EvaluationDDim>,
173 ddc::TypeSeq<LowerExtrapolationRule, UpperExtrapolationRule>>> : std::true_type
174{
175};
176
177/**
178 * @brief A helper to check if T is a SplineEvaluator
179 * @tparam T The type to be checked if is a SplineEvaluator
180 */
181template <class T>
182inline constexpr bool is_spline_evaluator_v = is_spline_evaluator<T>::value;
183
184template <class T>
185struct is_spline_evaluator2d : std::false_type
186{
187};
188
189template <
190 class ExecSpace,
191 class MemorySpace,
192 class BSpline1,
193 class BSpline2,
194 class EvaluationDDim1,
195 class EvaluationDDim2,
196 class LowerExtrapolationRule1,
197 class UpperExtrapolationRule1,
198 class LowerExtrapolationRule2,
199 class UpperExtrapolationRule2>
201 ExecSpace,
202 MemorySpace,
203 BSpline1,
204 BSpline2,
205 EvaluationDDim1,
206 EvaluationDDim2,
207 LowerExtrapolationRule1,
208 UpperExtrapolationRule1,
209 LowerExtrapolationRule2,
210 UpperExtrapolationRule2>> : std::true_type
211{
212};
213
214template <
215 class ExecSpace,
216 class MemorySpace,
217 class BSpline1,
218 class BSpline2,
219 class EvaluationDDim1,
220 class EvaluationDDim2,
221 class LowerExtrapolationRule1,
222 class UpperExtrapolationRule1,
223 class LowerExtrapolationRule2,
224 class UpperExtrapolationRule2>
225struct is_spline_evaluator2d<SplineEvaluatorND<
226 ExecSpace,
227 MemorySpace,
228 ddc::TypeSeq<BSpline1, BSpline2>,
229 ddc::TypeSeq<EvaluationDDim1, EvaluationDDim2>,
230 ddc::TypeSeq<
231 LowerExtrapolationRule1,
232 UpperExtrapolationRule1,
233 LowerExtrapolationRule2,
234 UpperExtrapolationRule2>>> : std::true_type
235{
236};
237
238/**
239 * @brief A helper to check if T is a SplineEvaluator2D
240 * @tparam T The type to be checked if is a SplineEvaluator2D
241 */
242template <class T>
243inline constexpr bool is_spline_evaluator2d_v = is_spline_evaluator2d<T>::value;
244
245template <class T>
246struct is_spline_evaluator3d : std::false_type
247{
248};
249
250template <
251 class ExecSpace,
252 class MemorySpace,
253 class BSpline1,
254 class BSpline2,
255 class BSpline3,
256 class EvaluationDDim1,
257 class EvaluationDDim2,
258 class EvaluationDDim3,
259 class LowerExtrapolationRule1,
260 class UpperExtrapolationRule1,
261 class LowerExtrapolationRule2,
262 class UpperExtrapolationRule2,
263 class LowerExtrapolationRule3,
264 class UpperExtrapolationRule3>
266 ExecSpace,
267 MemorySpace,
268 BSpline1,
269 BSpline2,
270 BSpline3,
271 EvaluationDDim1,
272 EvaluationDDim2,
273 EvaluationDDim3,
274 LowerExtrapolationRule1,
275 UpperExtrapolationRule1,
276 LowerExtrapolationRule2,
277 UpperExtrapolationRule2,
278 LowerExtrapolationRule3,
279 UpperExtrapolationRule3>> : std::true_type
280{
281};
282
283template <
284 class ExecSpace,
285 class MemorySpace,
286 class BSpline1,
287 class BSpline2,
288 class BSpline3,
289 class EvaluationDDim1,
290 class EvaluationDDim2,
291 class EvaluationDDim3,
292 class LowerExtrapolationRule1,
293 class UpperExtrapolationRule1,
294 class LowerExtrapolationRule2,
295 class UpperExtrapolationRule2,
296 class LowerExtrapolationRule3,
297 class UpperExtrapolationRule3>
298struct is_spline_evaluator3d<SplineEvaluatorND<
299 ExecSpace,
300 MemorySpace,
301 ddc::TypeSeq<BSpline1, BSpline2, BSpline3>,
302 ddc::TypeSeq<EvaluationDDim1, EvaluationDDim2, EvaluationDDim3>,
303 ddc::TypeSeq<
304 LowerExtrapolationRule1,
305 UpperExtrapolationRule1,
306 LowerExtrapolationRule2,
307 UpperExtrapolationRule2,
308 LowerExtrapolationRule3,
309 UpperExtrapolationRule3>>> : std::true_type
310{
311};
312
313/**
314 * @brief A helper to check if T is a SplineEvaluator3D
315 * @tparam T The type to be checked if is a SplineEvaluator3D
316 */
317template <class T>
318inline constexpr bool is_spline_evaluator3d_v = is_spline_evaluator3d<T>::value;
319
320template <class T>
321struct is_spline_evaluatornd : std::false_type
322{
323};
324
325template <
326 class ExecSpace,
327 class MemorySpace,
328 class BSplines,
329 class EvaluationDDim,
330 class ExtrapolationRule>
332 SplineEvaluatorND<ExecSpace, MemorySpace, BSplines, EvaluationDDim, ExtrapolationRule>>
333 : std::true_type
334{
335};
336
337/**
338 * @brief A helper to check if T is a SplineEvaluatorND
339 * @tparam T The type to be checked if is a SplineEvaluatorND
340 */
341template <class T>
342inline constexpr bool is_spline_evaluatornd_v = is_spline_evaluatornd<T>::value;
343
344template <class Builder, class Evaluator>
345struct is_evaluator_admissible : std::false_type
346{
347};
348
349template <
350 class ExecSpace,
351 class MemorySpace,
352 class BSplines,
353 class DDim,
354 ddc::SplineBuilderClosure SBCLower,
355 ddc::SplineBuilderClosure SBCUpper,
356 SplineSolver Solver,
357 class LowerExtrapolationRule,
358 class UpperExtrapolationRule>
360 SplineBuilder<ExecSpace, MemorySpace, BSplines, DDim, SBCLower, SBCUpper, Solver>,
362 ExecSpace,
363 MemorySpace,
364 BSplines,
365 DDim,
366 LowerExtrapolationRule,
367 UpperExtrapolationRule>> : std::true_type
368{
369};
370
371template <
372 class ExecSpace,
373 class MemorySpace,
374 class BSplines1,
375 class BSplines2,
376 concepts::discrete_dimension DDimI1,
377 concepts::discrete_dimension DDimI2,
378 ddc::SplineBuilderClosure SBCLower1,
379 ddc::SplineBuilderClosure SBCUpper1,
380 ddc::SplineBuilderClosure SBCLower2,
381 ddc::SplineBuilderClosure SBCUpper2,
382 SplineSolver Solver,
383 class LowerExtrapolationRule1,
384 class UpperExtrapolationRule1,
385 class LowerExtrapolationRule2,
386 class UpperExtrapolationRule2>
389 ExecSpace,
390 MemorySpace,
391 BSplines1,
392 BSplines2,
393 DDimI1,
394 DDimI2,
395 SBCLower1,
396 SBCUpper1,
397 SBCLower2,
398 SBCUpper2,
399 Solver>,
401 ExecSpace,
402 MemorySpace,
403 BSplines1,
404 BSplines2,
405 DDimI1,
406 DDimI2,
407 LowerExtrapolationRule1,
408 UpperExtrapolationRule1,
409 LowerExtrapolationRule2,
410 UpperExtrapolationRule2>> : std::true_type
411{
412};
413
414template <
415 class ExecSpace,
416 class MemorySpace,
417 class BSplines1,
418 class BSplines2,
419 class BSplines3,
420 class DDimI1,
421 class DDimI2,
422 class DDimI3,
423 ddc::SplineBuilderClosure SBCLower1,
424 ddc::SplineBuilderClosure SBCUpper1,
425 ddc::SplineBuilderClosure SBCLower2,
426 ddc::SplineBuilderClosure SBCUpper2,
427 ddc::SplineBuilderClosure SBCLower3,
428 ddc::SplineBuilderClosure SBCUpper3,
429 SplineSolver Solver,
430 class LowerExtrapolationRule1,
431 class UpperExtrapolationRule1,
432 class LowerExtrapolationRule2,
433 class UpperExtrapolationRule2,
434 class LowerExtrapolationRule3,
435 class UpperExtrapolationRule3>
438 ExecSpace,
439 MemorySpace,
440 BSplines1,
441 BSplines2,
442 BSplines3,
443 DDimI1,
444 DDimI2,
445 DDimI3,
446 SBCLower1,
447 SBCUpper1,
448 SBCLower2,
449 SBCUpper2,
450 SBCLower3,
451 SBCUpper3,
452 Solver>,
454 ExecSpace,
455 MemorySpace,
456 BSplines1,
457 BSplines2,
458 BSplines3,
459 DDimI1,
460 DDimI2,
461 DDimI3,
462 LowerExtrapolationRule1,
463 UpperExtrapolationRule1,
464 LowerExtrapolationRule2,
465 UpperExtrapolationRule2,
466 LowerExtrapolationRule3,
467 UpperExtrapolationRule3>> : std::true_type
468{
469};
470
471template <
472 class ExecSpace,
473 class MemorySpace,
474 class BSplines,
475 class DDim,
476 ddc::SplineBuilderClosure SBCLower,
477 ddc::SplineBuilderClosure SBCUpper,
478 SplineSolver Solver,
479 class LowerExtrapolationRule,
480 class UpperExtrapolationRule>
482 SplineBuilder<ExecSpace, MemorySpace, BSplines, DDim, SBCLower, SBCUpper, Solver>,
483 SplineEvaluatorND<
484 ExecSpace,
485 MemorySpace,
486 TypeSeq<BSplines>,
487 TypeSeq<DDim>,
488 TypeSeq<LowerExtrapolationRule, UpperExtrapolationRule>>> : std::true_type
489{
490};
491
492template <
493 class ExecSpace,
494 class MemorySpace,
495 class BSplines1,
496 class BSplines2,
497 class DDimI1,
498 class DDimI2,
499 ddc::SplineBuilderClosure SBCLower1,
500 ddc::SplineBuilderClosure SBCUpper1,
501 ddc::SplineBuilderClosure SBCLower2,
502 ddc::SplineBuilderClosure SBCUpper2,
503 SplineSolver Solver,
504 class LowerExtrapolationRule1,
505 class UpperExtrapolationRule1,
506 class LowerExtrapolationRule2,
507 class UpperExtrapolationRule2>
510 ExecSpace,
511 MemorySpace,
512 BSplines1,
513 BSplines2,
514 DDimI1,
515 DDimI2,
516 SBCLower1,
517 SBCUpper1,
518 SBCLower2,
519 SBCUpper2,
520 Solver>,
521 SplineEvaluatorND<
522 ExecSpace,
523 MemorySpace,
524 TypeSeq<BSplines1, BSplines2>,
525 TypeSeq<DDimI1, DDimI2>,
526 TypeSeq<LowerExtrapolationRule1,
527 UpperExtrapolationRule1,
528 LowerExtrapolationRule2,
529 UpperExtrapolationRule2>>> : std::true_type
530{
531};
532
533template <
534 class ExecSpace,
535 class MemorySpace,
536 class BSplines1,
537 class BSplines2,
538 class BSplines3,
539 class DDimI1,
540 class DDimI2,
541 class DDimI3,
542 ddc::SplineBuilderClosure SBCLower1,
543 ddc::SplineBuilderClosure SBCUpper1,
544 ddc::SplineBuilderClosure SBCLower2,
545 ddc::SplineBuilderClosure SBCUpper2,
546 ddc::SplineBuilderClosure SBCLower3,
547 ddc::SplineBuilderClosure SBCUpper3,
548 SplineSolver Solver,
549 class LowerExtrapolationRule1,
550 class UpperExtrapolationRule1,
551 class LowerExtrapolationRule2,
552 class UpperExtrapolationRule2,
553 class LowerExtrapolationRule3,
554 class UpperExtrapolationRule3>
557 ExecSpace,
558 MemorySpace,
559 BSplines1,
560 BSplines2,
561 BSplines3,
562 DDimI1,
563 DDimI2,
564 DDimI3,
565 SBCLower1,
566 SBCUpper1,
567 SBCLower2,
568 SBCUpper2,
569 SBCLower3,
570 SBCUpper3,
571 Solver>,
572 SplineEvaluatorND<
573 ExecSpace,
574 MemorySpace,
575 TypeSeq<BSplines1, BSplines2, BSplines3>,
576 TypeSeq<DDimI1, DDimI2, DDimI3>,
577 TypeSeq<LowerExtrapolationRule1,
578 UpperExtrapolationRule1,
579 LowerExtrapolationRule2,
580 UpperExtrapolationRule2,
581 LowerExtrapolationRule3,
582 UpperExtrapolationRule3>>> : std::true_type
583{
584};
585
586/**
587 * @brief A helper to check if SplineEvaluator is admissible for SplineBuilder
588 * @tparam Builder The builder type to be checked if it is admissible for Evaluator
589 * @tparam Evaluator The evaluator type to be checked if it is admissible for Builder
590 */
591template <class Builder, class Evaluator>
592inline constexpr bool is_evaluator_admissible_v
594
595} // 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.