13#include <Kokkos_Core.hpp>
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
47 class EvaluationDDim1,
48 class EvaluationDDim2,
49 class EvaluationDDim3,
50 class LowerExtrapolationRule1,
51 class UpperExtrapolationRule1,
52 class LowerExtrapolationRule2,
53 class UpperExtrapolationRule2,
54 class LowerExtrapolationRule3,
55 class UpperExtrapolationRule3>
60 using continuous_dimension_type1 = BSplines1::continuous_dimension_type;
63 using continuous_dimension_type2 = BSplines2::continuous_dimension_type;
66 using continuous_dimension_type3 = BSplines3::continuous_dimension_type;
69 using exec_space = ExecSpace;
72 using memory_space = MemorySpace;
75 using evaluation_discrete_dimension_type1 = EvaluationDDim1;
78 using evaluation_discrete_dimension_type2 = EvaluationDDim2;
81 using evaluation_discrete_dimension_type3 = EvaluationDDim3;
84 using bsplines_type1 = BSplines1;
87 using bsplines_type2 = BSplines2;
90 using bsplines_type3 = BSplines3;
93 using evaluation_domain_type1 =
ddc::
DiscreteDomain<evaluation_discrete_dimension_type1>;
96 using evaluation_domain_type2 =
ddc::
DiscreteDomain<evaluation_discrete_dimension_type2>;
99 using evaluation_domain_type3 =
ddc::
DiscreteDomain<evaluation_discrete_dimension_type3>;
103 evaluation_discrete_dimension_type1,
104 evaluation_discrete_dimension_type2,
105 evaluation_discrete_dimension_type3>;
108
109
110
111
112 template <concepts::discrete_domain BatchedInterpolationDDom>
113 using batched_evaluation_domain_type = BatchedInterpolationDDom;
125 using spline_domain_type =
ddc::
DiscreteDomain<bsplines_type1, bsplines_type2, bsplines_type3>;
128
129
130
131
132
133 template <concepts::discrete_domain BatchedInterpolationDDom>
134 using batch_domain_type =
ddc::remove_dims_of_t<
135 BatchedInterpolationDDom,
136 evaluation_discrete_dimension_type1,
137 evaluation_discrete_dimension_type2,
138 evaluation_discrete_dimension_type3>;
141
142
143
144
145
146 template <concepts::discrete_domain BatchedInterpolationDDom>
147 using batched_spline_domain_type
148 =
ddc::detail::convert_type_seq_to_discrete_domain_t<
ddc::type_seq_replace_t<
149 ddc::to_type_seq_t<BatchedInterpolationDDom>,
151 evaluation_discrete_dimension_type1,
152 evaluation_discrete_dimension_type2,
153 evaluation_discrete_dimension_type3>,
154 ddc::
TypeSeq<bsplines_type1, bsplines_type2, bsplines_type3>>>;
157 using lower_extrapolation_rule_1_type = LowerExtrapolationRule1;
160 using upper_extrapolation_rule_1_type = UpperExtrapolationRule1;
163 using lower_extrapolation_rule_2_type = LowerExtrapolationRule2;
166 using upper_extrapolation_rule_2_type = UpperExtrapolationRule2;
169 using lower_extrapolation_rule_3_type = LowerExtrapolationRule3;
172 using upper_extrapolation_rule_3_type = UpperExtrapolationRule3;
175 LowerExtrapolationRule1 m_lower_extrap_rule_1;
177 UpperExtrapolationRule1 m_upper_extrap_rule_1;
179 LowerExtrapolationRule2 m_lower_extrap_rule_2;
181 UpperExtrapolationRule2 m_upper_extrap_rule_2;
183 LowerExtrapolationRule3 m_lower_extrap_rule_3;
185 UpperExtrapolationRule3 m_upper_extrap_rule_3;
189 std::is_same_v<LowerExtrapolationRule1,
191 == bsplines_type1::is_periodic()
193 UpperExtrapolationRule1,
195 == bsplines_type1::is_periodic()
197 LowerExtrapolationRule2,
199 == bsplines_type2::is_periodic()
201 UpperExtrapolationRule2,
203 == bsplines_type2::is_periodic()
205 LowerExtrapolationRule3,
207 == bsplines_type3::is_periodic()
209 UpperExtrapolationRule3,
211 == bsplines_type3::is_periodic(),
212 "PeriodicExtrapolationRule has to be used if and only if dimension is periodic");
214 std::is_invocable_r_v<
216 LowerExtrapolationRule1,
217 ddc::Coordinate<continuous_dimension_type1>,
221 Kokkos::layout_right,
223 "LowerExtrapolationRule1::operator() has to be callable "
224 "with usual arguments.");
226 std::is_invocable_r_v<
228 UpperExtrapolationRule1,
229 ddc::Coordinate<continuous_dimension_type1>,
233 Kokkos::layout_right,
235 "UpperExtrapolationRule1::operator() has to be callable "
236 "with usual arguments.");
238 std::is_invocable_r_v<
240 LowerExtrapolationRule2,
241 ddc::Coordinate<continuous_dimension_type2>,
245 Kokkos::layout_right,
247 "LowerExtrapolationRule2::operator() has to be callable "
248 "with usual arguments.");
250 std::is_invocable_r_v<
252 UpperExtrapolationRule2,
253 ddc::Coordinate<continuous_dimension_type2>,
257 Kokkos::layout_right,
259 "UpperExtrapolationRule2::operator() has to be callable "
260 "with usual arguments.");
262 std::is_invocable_r_v<
264 LowerExtrapolationRule3,
265 ddc::Coordinate<continuous_dimension_type3>,
269 Kokkos::layout_right,
271 "LowerExtrapolationRule3::operator() has to be callable "
272 "with usual arguments.");
274 std::is_invocable_r_v<
276 UpperExtrapolationRule3,
277 ddc::Coordinate<continuous_dimension_type3>,
281 Kokkos::layout_right,
283 "UpperExtrapolationRule3::operator() has to be callable "
284 "with usual arguments.");
287
288
289
290
291
292
293
294
295
296
297
299 LowerExtrapolationRule1
const& lower_extrap_rule1,
300 UpperExtrapolationRule1
const& upper_extrap_rule1,
301 LowerExtrapolationRule2
const& lower_extrap_rule2,
302 UpperExtrapolationRule2
const& upper_extrap_rule2,
303 LowerExtrapolationRule3
const& lower_extrap_rule3,
304 UpperExtrapolationRule3
const& upper_extrap_rule3)
305 : m_lower_extrap_rule_1(lower_extrap_rule1)
306 , m_upper_extrap_rule_1(upper_extrap_rule1)
307 , m_lower_extrap_rule_2(lower_extrap_rule2)
308 , m_upper_extrap_rule_2(upper_extrap_rule2)
309 , m_lower_extrap_rule_3(lower_extrap_rule3)
310 , m_upper_extrap_rule_3(upper_extrap_rule3)
315
316
317
318
322
323
324
325
332
333
334
335
336
340
341
342
343
344
348
349
350
351
352
353
354
355
358 return m_lower_extrap_rule_1;
362
363
364
365
366
367
368
369
372 return m_upper_extrap_rule_1;
376
377
378
379
380
381
382
383
386 return m_lower_extrap_rule_2;
390
391
392
393
394
395
396
397
400 return m_upper_extrap_rule_2;
404
405
406
407
408
409
410
411
414 return m_lower_extrap_rule_3;
418
419
420
421
422
423
424
425
428 return m_upper_extrap_rule_3;
432
433
434
435
436
437
438
439
440
441
442
443 template <
class Layout,
class... CoordsDims>
445 ddc::Coordinate<CoordsDims...>
const& coord_eval,
446 ddc::
ChunkSpan<Real
const, spline_domain_type, Layout, memory_space>
const spline_coef)
449 return eval(coord_eval, spline_coef);
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
476 class BatchedInterpolationDDom,
479 ddc::
ChunkSpan<Real, BatchedInterpolationDDom, Layout1, memory_space>
const spline_eval,
481 ddc::Coordinate<CoordsDims...>
const,
482 BatchedInterpolationDDom,
484 memory_space>
const coords_eval,
487 batched_spline_domain_type<BatchedInterpolationDDom>,
489 memory_space>
const spline_coef)
const
491 batch_domain_type<BatchedInterpolationDDom>
const batch_domain(coords_eval.domain());
492 evaluation_domain_type1
const evaluation_domain1(spline_eval.domain());
493 evaluation_domain_type2
const evaluation_domain2(spline_eval.domain());
494 evaluation_domain_type3
const evaluation_domain3(spline_eval.domain());
495 ddc::parallel_for_each(
496 "ddc_splines_evaluate_3d",
500 batch_domain_type<BatchedInterpolationDDom>::discrete_element_type
const
502 auto const spline_eval_3D = spline_eval[j];
503 auto const coords_eval_3D = coords_eval[j];
504 auto const spline_coef_3D = spline_coef[j];
505 for (
auto const i1 : evaluation_domain1) {
506 for (
auto const i2 : evaluation_domain2) {
507 for (
auto const i3 : evaluation_domain3) {
508 spline_eval_3D(i1, i2, i3)
509 = eval(coords_eval_3D(i1, i2, i3), spline_coef_3D);
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531 template <
class Layout1,
class Layout2,
class BatchedInterpolationDDom>
533 ddc::
ChunkSpan<Real, BatchedInterpolationDDom, Layout1, memory_space>
const spline_eval,
536 batched_spline_domain_type<BatchedInterpolationDDom>,
538 memory_space>
const spline_coef)
const
540 batch_domain_type<BatchedInterpolationDDom>
const batch_domain(spline_eval.domain());
541 evaluation_domain_type1
const evaluation_domain1(spline_eval.domain());
542 evaluation_domain_type2
const evaluation_domain2(spline_eval.domain());
543 evaluation_domain_type3
const evaluation_domain3(spline_eval.domain());
544 ddc::parallel_for_each(
545 "ddc_splines_evaluate_3d",
549 batch_domain_type<BatchedInterpolationDDom>::discrete_element_type
const
551 auto const spline_eval_3D = spline_eval[j];
552 auto const spline_coef_3D = spline_coef[j];
553 for (
auto const i1 : evaluation_domain1) {
554 for (
auto const i2 : evaluation_domain2) {
555 for (
auto const i3 : evaluation_domain3) {
557 continuous_dimension_type1,
558 continuous_dimension_type2,
559 continuous_dimension_type3>
563 ddc::coordinate(i3));
564 spline_eval_3D(i1, i2, i3) = eval(coord_eval_3D, spline_coef_3D);
572
573
574
575
576
577
578
579
580
581
582
583
584 template <
class DElem,
class Layout,
class... CoordsDims>
586 deriv(DElem
const& deriv_order,
587 ddc::Coordinate<CoordsDims...>
const& coord_eval,
588 ddc::
ChunkSpan<Real
const, spline_domain_type, Layout, memory_space>
const spline_coef)
591 static_assert(is_discrete_element_v<DElem>);
592 return eval_no_bc(deriv_order, coord_eval, spline_coef);
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
620 class BatchedInterpolationDDom,
623 DElem
const& deriv_order,
624 ddc::
ChunkSpan<Real, BatchedInterpolationDDom, Layout1, memory_space>
const spline_eval,
626 ddc::Coordinate<CoordsDims...>
const,
627 BatchedInterpolationDDom,
629 memory_space>
const coords_eval,
632 batched_spline_domain_type<BatchedInterpolationDDom>,
634 memory_space>
const spline_coef)
const
636 static_assert(is_discrete_element_v<DElem>);
638 batch_domain_type<BatchedInterpolationDDom>
const batch_domain(coords_eval.domain());
639 evaluation_domain_type1
const evaluation_domain1(spline_eval.domain());
640 evaluation_domain_type2
const evaluation_domain2(spline_eval.domain());
641 evaluation_domain_type3
const evaluation_domain3(spline_eval.domain());
642 ddc::parallel_for_each(
643 "ddc_splines_cross_differentiate_3d",
647 batch_domain_type<BatchedInterpolationDDom>::discrete_element_type
const
649 auto const spline_eval_3D = spline_eval[j];
650 auto const coords_eval_3D = coords_eval[j];
651 auto const spline_coef_3D = spline_coef[j];
652 for (
auto const i1 : evaluation_domain1) {
653 for (
auto const i2 : evaluation_domain2) {
654 for (
auto const i3 : evaluation_domain3) {
655 spline_eval_3D(i1, i2, i3) = eval_no_bc(
657 coords_eval_3D(i1, i2, i3),
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680 template <
class DElem,
class Layout1,
class Layout2,
class BatchedInterpolationDDom>
682 DElem
const& deriv_order,
683 ddc::
ChunkSpan<Real, BatchedInterpolationDDom, Layout1, memory_space>
const spline_eval,
686 batched_spline_domain_type<BatchedInterpolationDDom>,
688 memory_space>
const spline_coef)
const
690 static_assert(is_discrete_element_v<DElem>);
692 batch_domain_type<BatchedInterpolationDDom>
const batch_domain(spline_eval.domain());
693 evaluation_domain_type1
const evaluation_domain1(spline_eval.domain());
694 evaluation_domain_type2
const evaluation_domain2(spline_eval.domain());
695 evaluation_domain_type3
const evaluation_domain3(spline_eval.domain());
696 ddc::parallel_for_each(
697 "ddc_splines_cross_differentiate_3d",
701 batch_domain_type<BatchedInterpolationDDom>::discrete_element_type
const
703 auto const spline_eval_3D = spline_eval[j];
704 auto const spline_coef_3D = spline_coef[j];
705 for (
auto const i1 : evaluation_domain1) {
706 for (
auto const i2 : evaluation_domain2) {
707 for (
auto const i3 : evaluation_domain3) {
709 continuous_dimension_type1,
710 continuous_dimension_type2,
711 continuous_dimension_type3>
715 ddc::coordinate(i3));
716 spline_eval_3D(i1, i2, i3)
717 = eval_no_bc(deriv_order, coord_eval_3D, spline_coef_3D);
725
726
727
728
729
730
731
732
733
734
735
736
737 template <
class Layout1,
class Layout2,
class BatchedDDom,
class BatchedSplineDDom>
739 ddc::
ChunkSpan<Real, BatchedDDom, Layout1, memory_space>
const integrals,
740 ddc::
ChunkSpan<Real
const, BatchedSplineDDom, Layout2, memory_space>
const spline_coef)
744 ddc::type_seq_contains_v<
745 ddc::
TypeSeq<bsplines_type1, bsplines_type2, bsplines_type3>,
746 to_type_seq_t<BatchedSplineDDom>>,
747 "The spline coefficients domain must contain the bsplines dimensions");
748 using batch_domain_type =
ddc::
749 remove_dims_of_t<BatchedSplineDDom, bsplines_type1, bsplines_type2, bsplines_type3>;
751 std::is_same_v<batch_domain_type, BatchedDDom>,
752 "The integrals domain must only contain the batch dimensions");
754 batch_domain_type batch_domain(integrals.domain());
756 "values1 (ddc::SplineEvaluator3D::integrate)",
760 ddc::integrals(exec_space(), values1);
762 "values2 (ddc::SplineEvaluator3D::integrate)",
766 ddc::integrals(exec_space(), values2);
768 "values3 (ddc::SplineEvaluator3D::integrate)",
772 ddc::integrals(exec_space(), values3);
774 ddc::parallel_for_each(
775 "ddc_splines_integrate_bsplines",
778 KOKKOS_LAMBDA(batch_domain_type::discrete_element_type
const j) {
780 for (
typename spline_domain_type1::discrete_element_type
const i1 :
782 for (
typename spline_domain_type2::discrete_element_type
const i2 :
784 for (
typename spline_domain_type3::discrete_element_type
const i3 :
786 integrals(j) += spline_coef(i1, i2, i3, j) * values1(i1)
787 * values2(i2) * values3(i3);
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810 template <
class Layout,
class... CoordsDims>
811 KOKKOS_INLINE_FUNCTION Real
812 eval(
ddc::Coordinate<CoordsDims...> coord_eval,
813 ddc::
ChunkSpan<Real
const, spline_domain_type, Layout, memory_space>
const spline_coef)
816 using Dim1 = continuous_dimension_type1;
817 using Dim2 = continuous_dimension_type2;
818 using Dim3 = continuous_dimension_type3;
819 if constexpr (bsplines_type1::is_periodic()) {
820 if (
ddc::get<Dim1>(coord_eval) <
ddc::discrete_space<bsplines_type1>().rmin()
821 ||
ddc::get<Dim1>(coord_eval) >
ddc::discrete_space<bsplines_type1>().rmax()) {
822 ddc::get<Dim1>(coord_eval)
824 (
ddc::get<Dim1>(coord_eval)
825 -
ddc::discrete_space<bsplines_type1>().rmin())
826 /
ddc::discrete_space<bsplines_type1>().length())
827 *
ddc::discrete_space<bsplines_type1>().length();
830 if constexpr (bsplines_type2::is_periodic()) {
831 if (
ddc::get<Dim2>(coord_eval) <
ddc::discrete_space<bsplines_type2>().rmin()
832 ||
ddc::get<Dim2>(coord_eval) >
ddc::discrete_space<bsplines_type2>().rmax()) {
833 ddc::get<Dim2>(coord_eval)
835 (
ddc::get<Dim2>(coord_eval)
836 -
ddc::discrete_space<bsplines_type2>().rmin())
837 /
ddc::discrete_space<bsplines_type2>().length())
838 *
ddc::discrete_space<bsplines_type2>().length();
841 if constexpr (bsplines_type3::is_periodic()) {
842 if (
ddc::get<Dim3>(coord_eval) <
ddc::discrete_space<bsplines_type3>().rmin()
843 ||
ddc::get<Dim3>(coord_eval) >
ddc::discrete_space<bsplines_type3>().rmax()) {
844 ddc::get<Dim3>(coord_eval)
846 (
ddc::get<Dim3>(coord_eval)
847 -
ddc::discrete_space<bsplines_type3>().rmin())
848 /
ddc::discrete_space<bsplines_type3>().length())
849 *
ddc::discrete_space<bsplines_type3>().length();
852 if constexpr (!bsplines_type1::is_periodic()) {
853 if (
ddc::get<Dim1>(coord_eval) <
ddc::discrete_space<bsplines_type1>().rmin()) {
854 return m_lower_extrap_rule_1(coord_eval, spline_coef);
856 if (
ddc::get<Dim1>(coord_eval) >
ddc::discrete_space<bsplines_type1>().rmax()) {
857 return m_upper_extrap_rule_1(coord_eval, spline_coef);
860 if constexpr (!bsplines_type2::is_periodic()) {
861 if (
ddc::get<Dim2>(coord_eval) <
ddc::discrete_space<bsplines_type2>().rmin()) {
862 return m_lower_extrap_rule_2(coord_eval, spline_coef);
864 if (
ddc::get<Dim2>(coord_eval) >
ddc::discrete_space<bsplines_type2>().rmax()) {
865 return m_upper_extrap_rule_2(coord_eval, spline_coef);
868 if constexpr (!bsplines_type3::is_periodic()) {
869 if (
ddc::get<Dim3>(coord_eval) <
ddc::discrete_space<bsplines_type3>().rmin()) {
870 return m_lower_extrap_rule_3(coord_eval, spline_coef);
872 if (
ddc::get<Dim3>(coord_eval) >
ddc::discrete_space<bsplines_type3>().rmax()) {
873 return m_upper_extrap_rule_3(coord_eval, spline_coef);
879 continuous_dimension_type1,
880 continuous_dimension_type2,
881 continuous_dimension_type3>(
882 ddc::get<Dim1>(coord_eval),
883 ddc::get<Dim2>(coord_eval),
884 ddc::get<Dim3>(coord_eval)),
889
890
891
892
893
894
895
896 template <
class... DerivDims,
class Layout,
class... CoordsDims>
897 KOKKOS_INLINE_FUNCTION Real eval_no_bc(
898 ddc::DiscreteElement<DerivDims...>
const& deriv_order,
899 ddc::Coordinate<CoordsDims...>
const& coord_eval,
900 ddc::
ChunkSpan<Real
const, spline_domain_type, Layout, memory_space>
const spline_coef)
903 using deriv_dim1 =
Deriv<continuous_dimension_type1>;
904 using deriv_dim2 =
Deriv<continuous_dimension_type2>;
905 using deriv_dim3 =
Deriv<continuous_dimension_type3>;
906 using deriv_dims =
TypeSeq<DerivDims...>;
910 (in_tags_v<DerivDims,
ddc::
TypeSeq<deriv_dim1, deriv_dim2, deriv_dim3>> && ...),
911 "The only valid dimensions for deriv_order are Deriv<Dim1>, Deriv<Dim2> and "
914 ddc::DiscreteElement<bsplines_type1> jmin1;
915 ddc::DiscreteElement<bsplines_type2> jmin2;
916 ddc::DiscreteElement<bsplines_type3> jmin3;
918 std::array<Real, bsplines_type1::degree() + 1> vals1_ptr;
919 Kokkos::mdspan<Real, Kokkos::extents<std::size_t, bsplines_type1::degree() + 1>>
const
920 vals1(vals1_ptr.data());
921 std::array<Real, bsplines_type2::degree() + 1> vals2_ptr;
922 Kokkos::mdspan<Real, Kokkos::extents<std::size_t, bsplines_type2::degree() + 1>>
const
923 vals2(vals2_ptr.data());
924 std::array<Real, bsplines_type3::degree() + 1> vals3_ptr;
925 Kokkos::mdspan<Real, Kokkos::extents<std::size_t, bsplines_type3::degree() + 1>>
const
926 vals3(vals3_ptr.data());
927 ddc::Coordinate<continuous_dimension_type1>
const coord_eval_interest1(coord_eval);
928 ddc::Coordinate<continuous_dimension_type2>
const coord_eval_interest2(coord_eval);
929 ddc::Coordinate<continuous_dimension_type3>
const coord_eval_interest3(coord_eval);
931 if constexpr (!in_tags_v<deriv_dim1, deriv_dims>) {
932 jmin1 =
ddc::discrete_space<bsplines_type1>().eval_basis(vals1, coord_eval_interest1);
934 auto const order1 = deriv_order.
template uid<deriv_dim1>();
935 KOKKOS_ASSERT(order1 > 0 && order1 <= bsplines_type1::degree())
937 std::array<Real, (bsplines_type1::degree() + 1) * (bsplines_type1::degree() + 1)>
943 bsplines_type1::degree() + 1,
944 Kokkos::dynamic_extent>>
const derivs1(derivs1_ptr.data(), order1 + 1);
946 jmin1 =
ddc::discrete_space<bsplines_type1>()
947 .eval_basis_and_n_derivs(derivs1, coord_eval_interest1, order1);
949 for (std::size_t i = 0; i < bsplines_type1::degree() + 1; ++i) {
950 vals1[i] = DDC_MDSPAN_ACCESS_OP(derivs1, i, order1);
954 if constexpr (!in_tags_v<deriv_dim2, deriv_dims>) {
955 jmin2 =
ddc::discrete_space<bsplines_type2>().eval_basis(vals2, coord_eval_interest2);
957 auto const order2 = deriv_order.
template uid<deriv_dim2>();
958 KOKKOS_ASSERT(order2 > 0 && order2 <= bsplines_type2::degree())
960 std::array<Real, (bsplines_type2::degree() + 1) * (bsplines_type2::degree() + 1)>
966 bsplines_type2::degree() + 1,
967 Kokkos::dynamic_extent>>
const derivs2(derivs2_ptr.data(), order2 + 1);
969 jmin2 =
ddc::discrete_space<bsplines_type2>()
970 .eval_basis_and_n_derivs(derivs2, coord_eval_interest2, order2);
972 for (std::size_t i = 0; i < bsplines_type2::degree() + 1; ++i) {
973 vals2[i] = DDC_MDSPAN_ACCESS_OP(derivs2, i, order2);
977 if constexpr (!in_tags_v<deriv_dim3, deriv_dims>) {
978 jmin3 =
ddc::discrete_space<bsplines_type3>().eval_basis(vals3, coord_eval_interest3);
980 auto const order3 = deriv_order.
template uid<deriv_dim3>();
981 KOKKOS_ASSERT(order3 > 0 && order3 <= bsplines_type3::degree())
983 std::array<Real, (bsplines_type3::degree() + 1) * (bsplines_type3::degree() + 1)>
989 bsplines_type3::degree() + 1,
990 Kokkos::dynamic_extent>>
const derivs3(derivs3_ptr.data(), order3 + 1);
992 jmin3 =
ddc::discrete_space<bsplines_type3>()
993 .eval_basis_and_n_derivs(derivs3, coord_eval_interest3, order3);
995 for (std::size_t i = 0; i < bsplines_type3::degree() + 1; ++i) {
996 vals3[i] = DDC_MDSPAN_ACCESS_OP(derivs3, i, order3);
1001 for (std::size_t i = 0; i < bsplines_type1::degree() + 1; ++i) {
1002 for (std::size_t j = 0; j < bsplines_type2::degree() + 1; ++j) {
1003 for (std::size_t k = 0; k < bsplines_type3::degree() + 1; ++k) {
1005 ddc::DiscreteElement<
1008 bsplines_type3>(jmin1 + i, jmin2 + j, jmin3 + k))
1009 * vals1[i] * vals2[j] * vals3[k];
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.
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...
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.
The top-level namespace of DDC.
constexpr bool is_uniform_bsplines_v
Indicates if a tag corresponds to uniform B-splines or not.
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 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.
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.
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)
If the type DDim is a B-spline, defines type to the discrete dimension of the associated knots.
A compile-time sequence of types.
A templated struct representing a discrete dimension storing the derivatives of a function along a co...