13#include <Kokkos_Core.hpp>
15#include "integrals.hpp"
16#include "periodic_extrapolation_rule.hpp"
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
46 class EvaluationDDim1,
47 class EvaluationDDim2,
48 class EvaluationDDim3,
49 class LowerExtrapolationRule1,
50 class UpperExtrapolationRule1,
51 class LowerExtrapolationRule2,
52 class UpperExtrapolationRule2,
53 class LowerExtrapolationRule3,
54 class UpperExtrapolationRule3>
59
60
66
67
68 struct eval_deriv_type
74 using continuous_dimension_type1 =
typename BSplines1::continuous_dimension_type;
77 using continuous_dimension_type2 =
typename BSplines2::continuous_dimension_type;
80 using continuous_dimension_type3 =
typename BSplines3::continuous_dimension_type;
83 using exec_space = ExecSpace;
86 using memory_space = MemorySpace;
89 using evaluation_discrete_dimension_type1 = EvaluationDDim1;
92 using evaluation_discrete_dimension_type2 = EvaluationDDim2;
95 using evaluation_discrete_dimension_type3 = EvaluationDDim3;
98 using bsplines_type1 = BSplines1;
101 using bsplines_type2 = BSplines2;
104 using bsplines_type3 = BSplines3;
107 using evaluation_domain_type1 =
ddc::
DiscreteDomain<evaluation_discrete_dimension_type1>;
110 using evaluation_domain_type2 =
ddc::
DiscreteDomain<evaluation_discrete_dimension_type2>;
113 using evaluation_domain_type3 =
ddc::
DiscreteDomain<evaluation_discrete_dimension_type3>;
117 evaluation_discrete_dimension_type1,
118 evaluation_discrete_dimension_type2,
119 evaluation_discrete_dimension_type3>;
122
123
124
125
127 class BatchedInterpolationDDom,
128 class = std::enable_if_t<
ddc::is_discrete_domain_v<BatchedInterpolationDDom>>>
129 using batched_evaluation_domain_type = BatchedInterpolationDDom;
141 using spline_domain_type =
ddc::
DiscreteDomain<bsplines_type1, bsplines_type2, bsplines_type3>;
144
145
146
147
148
150 class BatchedInterpolationDDom,
151 class = std::enable_if_t<
ddc::is_discrete_domain_v<BatchedInterpolationDDom>>>
152 using batch_domain_type =
typename ddc::remove_dims_of_t<
153 BatchedInterpolationDDom,
154 evaluation_discrete_dimension_type1,
155 evaluation_discrete_dimension_type2,
156 evaluation_discrete_dimension_type3>;
159
160
161
162
163
165 class BatchedInterpolationDDom,
166 class = std::enable_if_t<
ddc::is_discrete_domain_v<BatchedInterpolationDDom>>>
167 using batched_spline_domain_type =
168 typename ddc::detail::convert_type_seq_to_discrete_domain_t<
ddc::type_seq_replace_t<
169 ddc::to_type_seq_t<BatchedInterpolationDDom>,
170 ddc::detail::TypeSeq<
171 evaluation_discrete_dimension_type1,
172 evaluation_discrete_dimension_type2,
173 evaluation_discrete_dimension_type3>,
174 ddc::detail::TypeSeq<bsplines_type1, bsplines_type2, bsplines_type3>>>;
177 using lower_extrapolation_rule_1_type = LowerExtrapolationRule1;
180 using upper_extrapolation_rule_1_type = UpperExtrapolationRule1;
183 using lower_extrapolation_rule_2_type = LowerExtrapolationRule2;
186 using upper_extrapolation_rule_2_type = UpperExtrapolationRule2;
189 using lower_extrapolation_rule_3_type = LowerExtrapolationRule3;
192 using upper_extrapolation_rule_3_type = UpperExtrapolationRule3;
195 LowerExtrapolationRule1 m_lower_extrap_rule_1;
197 UpperExtrapolationRule1 m_upper_extrap_rule_1;
199 LowerExtrapolationRule2 m_lower_extrap_rule_2;
201 UpperExtrapolationRule2 m_upper_extrap_rule_2;
203 LowerExtrapolationRule3 m_lower_extrap_rule_3;
205 UpperExtrapolationRule3 m_upper_extrap_rule_3;
209 std::is_same_v<LowerExtrapolationRule1,
211 == bsplines_type1::is_periodic()
213 UpperExtrapolationRule1,
215 == bsplines_type1::is_periodic()
217 LowerExtrapolationRule2,
219 == bsplines_type2::is_periodic()
221 UpperExtrapolationRule2,
223 == bsplines_type2::is_periodic()
225 LowerExtrapolationRule3,
227 == bsplines_type3::is_periodic()
229 UpperExtrapolationRule3,
231 == bsplines_type3::is_periodic(),
232 "PeriodicExtrapolationRule has to be used if and only if dimension is periodic");
234 std::is_invocable_r_v<
236 LowerExtrapolationRule1,
237 ddc::Coordinate<continuous_dimension_type1>,
241 Kokkos::layout_right,
243 "LowerExtrapolationRule1::operator() has to be callable "
244 "with usual arguments.");
246 std::is_invocable_r_v<
248 UpperExtrapolationRule1,
249 ddc::Coordinate<continuous_dimension_type1>,
253 Kokkos::layout_right,
255 "UpperExtrapolationRule1::operator() has to be callable "
256 "with usual arguments.");
258 std::is_invocable_r_v<
260 LowerExtrapolationRule2,
261 ddc::Coordinate<continuous_dimension_type2>,
265 Kokkos::layout_right,
267 "LowerExtrapolationRule2::operator() has to be callable "
268 "with usual arguments.");
270 std::is_invocable_r_v<
272 UpperExtrapolationRule2,
273 ddc::Coordinate<continuous_dimension_type2>,
277 Kokkos::layout_right,
279 "UpperExtrapolationRule2::operator() has to be callable "
280 "with usual arguments.");
282 std::is_invocable_r_v<
284 LowerExtrapolationRule3,
285 ddc::Coordinate<continuous_dimension_type3>,
289 Kokkos::layout_right,
291 "LowerExtrapolationRule3::operator() has to be callable "
292 "with usual arguments.");
294 std::is_invocable_r_v<
296 UpperExtrapolationRule3,
297 ddc::Coordinate<continuous_dimension_type3>,
301 Kokkos::layout_right,
303 "UpperExtrapolationRule3::operator() has to be callable "
304 "with usual arguments.");
307
308
309
310
311
312
313
314
315
316
317
319 LowerExtrapolationRule1
const& lower_extrap_rule1,
320 UpperExtrapolationRule1
const& upper_extrap_rule1,
321 LowerExtrapolationRule2
const& lower_extrap_rule2,
322 UpperExtrapolationRule2
const& upper_extrap_rule2,
323 LowerExtrapolationRule3
const& lower_extrap_rule3,
324 UpperExtrapolationRule3
const& upper_extrap_rule3)
325 : m_lower_extrap_rule_1(lower_extrap_rule1)
326 , m_upper_extrap_rule_1(upper_extrap_rule1)
327 , m_lower_extrap_rule_2(lower_extrap_rule2)
328 , m_upper_extrap_rule_2(upper_extrap_rule2)
329 , m_lower_extrap_rule_3(lower_extrap_rule3)
330 , m_upper_extrap_rule_3(upper_extrap_rule3)
335
336
337
338
342
343
344
345
352
353
354
355
356
360
361
362
363
364
368
369
370
371
372
373
374
375
378 return m_lower_extrap_rule_1;
382
383
384
385
386
387
388
389
392 return m_upper_extrap_rule_1;
396
397
398
399
400
401
402
403
406 return m_lower_extrap_rule_2;
410
411
412
413
414
415
416
417
420 return m_upper_extrap_rule_2;
424
425
426
427
428
429
430
431
434 return m_lower_extrap_rule_3;
438
439
440
441
442
443
444
445
448 return m_upper_extrap_rule_3;
452
453
454
455
456
457
458
459
460
461
462
463 template <
class Layout,
class... CoordsDims>
465 ddc::Coordinate<CoordsDims...>
const& coord_eval,
466 ddc::
ChunkSpan<
double const, spline_domain_type, Layout, memory_space>
const
469 return eval(coord_eval, spline_coef);
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
496 class BatchedInterpolationDDom,
499 ddc::
ChunkSpan<
double, BatchedInterpolationDDom, Layout1, memory_space>
const
502 ddc::Coordinate<CoordsDims...>
const,
503 BatchedInterpolationDDom,
505 memory_space>
const coords_eval,
508 batched_spline_domain_type<BatchedInterpolationDDom>,
510 memory_space>
const spline_coef)
const
512 batch_domain_type<BatchedInterpolationDDom>
const batch_domain(coords_eval.domain());
513 evaluation_domain_type1
const evaluation_domain1(spline_eval.domain());
514 evaluation_domain_type2
const evaluation_domain2(spline_eval.domain());
515 evaluation_domain_type3
const evaluation_domain3(spline_eval.domain());
516 ddc::parallel_for_each(
517 "ddc_splines_evaluate_3d",
521 typename batch_domain_type<
522 BatchedInterpolationDDom>::discrete_element_type
const j) {
523 auto const spline_eval_3D = spline_eval[j];
524 auto const coords_eval_3D = coords_eval[j];
525 auto const spline_coef_3D = spline_coef[j];
526 for (
auto const i1 : evaluation_domain1) {
527 for (
auto const i2 : evaluation_domain2) {
528 for (
auto const i3 : evaluation_domain3) {
529 spline_eval_3D(i1, i2, i3)
530 = eval(coords_eval_3D(i1, i2, i3), spline_coef_3D);
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552 template <
class Layout1,
class Layout2,
class BatchedInterpolationDDom>
554 ddc::
ChunkSpan<
double, BatchedInterpolationDDom, Layout1, memory_space>
const
558 batched_spline_domain_type<BatchedInterpolationDDom>,
560 memory_space>
const spline_coef)
const
562 batch_domain_type<BatchedInterpolationDDom>
const batch_domain(spline_eval.domain());
563 evaluation_domain_type1
const evaluation_domain1(spline_eval.domain());
564 evaluation_domain_type2
const evaluation_domain2(spline_eval.domain());
565 evaluation_domain_type3
const evaluation_domain3(spline_eval.domain());
566 ddc::parallel_for_each(
567 "ddc_splines_evaluate_3d",
571 typename batch_domain_type<
572 BatchedInterpolationDDom>::discrete_element_type
const j) {
573 auto const spline_eval_3D = spline_eval[j];
574 auto const spline_coef_3D = spline_coef[j];
575 for (
auto const i1 : evaluation_domain1) {
576 for (
auto const i2 : evaluation_domain2) {
577 for (
auto const i3 : evaluation_domain3) {
579 continuous_dimension_type1,
580 continuous_dimension_type2,
581 continuous_dimension_type3>
585 ddc::coordinate(i3));
586 spline_eval_3D(i1, i2, i3)
587 = eval(coord_eval_3D(i1, i2, i3), spline_coef_3D);
595
596
597
598
599
600
601
602
603
604
605 template <
class Layout,
class... CoordsDims>
607 ddc::Coordinate<CoordsDims...>
const& coord_eval,
608 ddc::
ChunkSpan<
double const, spline_domain_type, Layout, memory_space>
const
611 return eval_no_bc<eval_deriv_type, eval_type, eval_type>(coord_eval, spline_coef);
615
616
617
618
619
620
621
622
623
624
625 template <
class Layout,
class... CoordsDims>
627 ddc::Coordinate<CoordsDims...>
const& coord_eval,
628 ddc::
ChunkSpan<
double const, spline_domain_type, Layout, memory_space>
const
631 return eval_no_bc<eval_type, eval_deriv_type, eval_type>(coord_eval, spline_coef);
635
636
637
638
639
640
641
642
643
644
645 template <
class Layout,
class... CoordsDims>
647 ddc::Coordinate<CoordsDims...>
const& coord_eval,
648 ddc::
ChunkSpan<
double const, spline_domain_type, Layout, memory_space>
const
651 return eval_no_bc<eval_type, eval_type, eval_deriv_type>(coord_eval, spline_coef);
655
656
657
658
659
660
661
662
663
664
665 template <
class Layout,
class... CoordsDims>
667 ddc::Coordinate<CoordsDims...>
const& coord_eval,
668 ddc::
ChunkSpan<
double const, spline_domain_type, Layout, memory_space>
const
671 return eval_no_bc<eval_deriv_type, eval_deriv_type, eval_type>(coord_eval, spline_coef);
675
676
677
678
679
680
681
682
683
684
685 template <
class Layout,
class... CoordsDims>
687 ddc::Coordinate<CoordsDims...>
const& coord_eval,
688 ddc::
ChunkSpan<
double const, spline_domain_type, Layout, memory_space>
const
691 return eval_no_bc<eval_type, eval_deriv_type, eval_deriv_type>(coord_eval, spline_coef);
695
696
697
698
699
700
701
702
703
704
705 template <
class Layout,
class... CoordsDims>
707 ddc::Coordinate<CoordsDims...>
const& coord_eval,
708 ddc::
ChunkSpan<
double const, spline_domain_type, Layout, memory_space>
const
711 return eval_no_bc<eval_deriv_type, eval_type, eval_deriv_type>(coord_eval, spline_coef);
715
716
717
718
719
720
721
722
723
724
725 template <
class Layout,
class... CoordsDims>
727 ddc::Coordinate<CoordsDims...>
const& coord_eval,
728 ddc::
ChunkSpan<
double const, spline_domain_type, Layout, memory_space>
const
734 eval_deriv_type>(coord_eval, spline_coef);
738
739
740
741
742
743
744
745
746
747
748
749
750 template <
class InterestDim,
class Layout,
class... CoordsDims>
752 ddc::Coordinate<CoordsDims...>
const& coord_eval,
753 ddc::
ChunkSpan<
double const, spline_domain_type, Layout, memory_space>
const
757 std::is_same_v<InterestDim, continuous_dimension_type1>
758 || std::is_same_v<InterestDim, continuous_dimension_type2>
759 || std::is_same_v<InterestDim, continuous_dimension_type3>);
760 if constexpr (std::is_same_v<InterestDim, continuous_dimension_type1>) {
761 return deriv_dim_1(coord_eval, spline_coef);
762 }
else if constexpr (std::is_same_v<InterestDim, continuous_dimension_type2>) {
763 return deriv_dim_2(coord_eval, spline_coef);
764 }
else if constexpr (std::is_same_v<InterestDim, continuous_dimension_type3>) {
765 return deriv_dim_3(coord_eval, spline_coef);
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785 template <
class InterestDim1,
class InterestDim2,
class Layout,
class... CoordsDims>
787 ddc::Coordinate<CoordsDims...>
const& coord_eval,
788 ddc::
ChunkSpan<
double const, spline_domain_type, Layout, memory_space>
const
792 (std::is_same_v<InterestDim1, continuous_dimension_type1>
793 && std::is_same_v<InterestDim2, continuous_dimension_type2>)
794 || (std::is_same_v<InterestDim2, continuous_dimension_type1>
795 && std::is_same_v<InterestDim1, continuous_dimension_type2>)
796 || (std::is_same_v<InterestDim1, continuous_dimension_type2>
797 && std::is_same_v<InterestDim2, continuous_dimension_type3>)
798 || (std::is_same_v<InterestDim2, continuous_dimension_type2>
799 && std::is_same_v<InterestDim1, continuous_dimension_type3>)
800 || (std::is_same_v<InterestDim1, continuous_dimension_type1>
801 && std::is_same_v<InterestDim2, continuous_dimension_type3>)
802 || (std::is_same_v<InterestDim2, continuous_dimension_type1>
803 && std::is_same_v<InterestDim1, continuous_dimension_type3>));
806 (std::is_same_v<InterestDim1, continuous_dimension_type1>
807 && std::is_same_v<InterestDim2, continuous_dimension_type2>)
808 || (std::is_same_v<InterestDim2, continuous_dimension_type1>
809 && std::is_same_v<InterestDim1, continuous_dimension_type2>)) {
810 return deriv_1_and_2(coord_eval, spline_coef);
811 }
else if constexpr (
812 (std::is_same_v<InterestDim1, continuous_dimension_type2>
813 && std::is_same_v<InterestDim2, continuous_dimension_type3>)
814 || (std::is_same_v<InterestDim2, continuous_dimension_type2>
815 && std::is_same_v<InterestDim1, continuous_dimension_type3>)) {
816 return deriv_2_and_3(coord_eval, spline_coef);
817 }
else if constexpr (
818 (std::is_same_v<InterestDim1, continuous_dimension_type1>
819 && std::is_same_v<InterestDim2, continuous_dimension_type3>)
820 || (std::is_same_v<InterestDim2, continuous_dimension_type1>
821 && std::is_same_v<InterestDim1, continuous_dimension_type3>)) {
822 return deriv_1_and_3(coord_eval, spline_coef);
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
850 ddc::Coordinate<CoordsDims...>
const& coord_eval,
851 ddc::
ChunkSpan<
double const, spline_domain_type, Layout, memory_space>
const
855 (std::is_same_v<InterestDim1, continuous_dimension_type1>
856 && std::is_same_v<InterestDim2, continuous_dimension_type2>
857 && std::is_same_v<InterestDim3, continuous_dimension_type3>)
858 || (std::is_same_v<InterestDim3, continuous_dimension_type1>
859 && std::is_same_v<InterestDim1, continuous_dimension_type2>
860 && std::is_same_v<InterestDim2, continuous_dimension_type3>)
861 || (std::is_same_v<InterestDim2, continuous_dimension_type1>
862 && std::is_same_v<InterestDim3, continuous_dimension_type2>
863 && std::is_same_v<InterestDim1, continuous_dimension_type3>));
865 return deriv_1_2_3(coord_eval, spline_coef);
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
892 class BatchedInterpolationDDom,
895 ddc::
ChunkSpan<
double, BatchedInterpolationDDom, Layout1, memory_space>
const
898 ddc::Coordinate<CoordsDims...>
const,
899 BatchedInterpolationDDom,
901 memory_space>
const coords_eval,
904 batched_spline_domain_type<BatchedInterpolationDDom>,
906 memory_space>
const spline_coef)
const
908 batch_domain_type<BatchedInterpolationDDom>
const batch_domain(coords_eval.domain());
909 evaluation_domain_type1
const evaluation_domain1(spline_eval.domain());
910 evaluation_domain_type2
const evaluation_domain2(spline_eval.domain());
911 evaluation_domain_type3
const evaluation_domain3(spline_eval.domain());
912 ddc::parallel_for_each(
913 "ddc_splines_differentiate_3d_dim_1",
917 typename batch_domain_type<
918 BatchedInterpolationDDom>::discrete_element_type
const j) {
919 auto const spline_eval_3D = spline_eval[j];
920 auto const coords_eval_3D = coords_eval[j];
921 auto const spline_coef_3D = spline_coef[j];
922 for (
auto const i1 : evaluation_domain1) {
923 for (
auto const i2 : evaluation_domain2) {
924 for (
auto const i3 : evaluation_domain3) {
925 spline_eval_3D(i1, i2, i3) = eval_no_bc<
928 eval_type>(coords_eval_3D(i1, i2, i3), spline_coef_3D);
936
937
938
939
940
941
942
943
944
945
946
947
948 template <
class Layout1,
class Layout2,
class BatchedInterpolationDDom>
950 ddc::
ChunkSpan<
double, BatchedInterpolationDDom, Layout1, memory_space>
const
954 batched_spline_domain_type<BatchedInterpolationDDom>,
956 memory_space>
const spline_coef)
const
958 batch_domain_type<BatchedInterpolationDDom>
const batch_domain(spline_eval.domain());
959 evaluation_domain_type1
const evaluation_domain1(spline_eval.domain());
960 evaluation_domain_type2
const evaluation_domain2(spline_eval.domain());
961 evaluation_domain_type3
const evaluation_domain3(spline_eval.domain());
962 ddc::parallel_for_each(
963 "ddc_splines_differentiate_3d_dim_1",
967 typename batch_domain_type<
968 BatchedInterpolationDDom>::discrete_element_type
const j) {
969 auto const spline_eval_3D = spline_eval[j];
970 auto const spline_coef_3D = spline_coef[j];
971 for (
auto const i1 : evaluation_domain1) {
972 for (
auto const i2 : evaluation_domain2) {
973 for (
auto const i3 : evaluation_domain3) {
975 continuous_dimension_type1,
976 continuous_dimension_type2,
977 continuous_dimension_type3>
981 ddc::coordinate(i3));
982 spline_eval_3D(i1, i2, i3) = eval_no_bc<
985 eval_type>(coord_eval_3D, spline_coef_3D);
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1014 class BatchedInterpolationDDom,
1015 class... CoordsDims>
1017 ddc::
ChunkSpan<
double, BatchedInterpolationDDom, Layout1, memory_space>
const
1020 ddc::Coordinate<CoordsDims...>
const,
1021 BatchedInterpolationDDom,
1023 memory_space>
const coords_eval,
1026 batched_spline_domain_type<BatchedInterpolationDDom>,
1028 memory_space>
const spline_coef)
const
1030 batch_domain_type<BatchedInterpolationDDom>
const batch_domain(coords_eval.domain());
1031 evaluation_domain_type1
const evaluation_domain1(spline_eval.domain());
1032 evaluation_domain_type2
const evaluation_domain2(spline_eval.domain());
1033 evaluation_domain_type3
const evaluation_domain3(spline_eval.domain());
1034 ddc::parallel_for_each(
1035 "ddc_splines_differentiate_3d_dim_2",
1038 KOKKOS_CLASS_LAMBDA(
1039 typename batch_domain_type<
1040 BatchedInterpolationDDom>::discrete_element_type
const j) {
1041 auto const spline_eval_3D = spline_eval[j];
1042 auto const coords_eval_3D = coords_eval[j];
1043 auto const spline_coef_3D = spline_coef[j];
1044 for (
auto const i1 : evaluation_domain1) {
1045 for (
auto const i2 : evaluation_domain2) {
1046 for (
auto const i3 : evaluation_domain3) {
1047 spline_eval_3D(i1, i2, i3) = eval_no_bc<
1050 eval_type>(coords_eval_3D(i1, i2, i3), spline_coef_3D);
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070 template <
class Layout1,
class Layout2,
class BatchedInterpolationDDom>
1072 ddc::
ChunkSpan<
double, BatchedInterpolationDDom, Layout1, memory_space>
const
1076 batched_spline_domain_type<BatchedInterpolationDDom>,
1078 memory_space>
const spline_coef)
const
1080 batch_domain_type<BatchedInterpolationDDom>
const batch_domain(spline_eval.domain());
1081 evaluation_domain_type1
const evaluation_domain1(spline_eval.domain());
1082 evaluation_domain_type2
const evaluation_domain2(spline_eval.domain());
1083 evaluation_domain_type3
const evaluation_domain3(spline_eval.domain());
1084 ddc::parallel_for_each(
1085 "ddc_splines_differentiate_3d_dim_2",
1088 KOKKOS_CLASS_LAMBDA(
1089 typename batch_domain_type<
1090 BatchedInterpolationDDom>::discrete_element_type
const j) {
1091 auto const spline_eval_3D = spline_eval[j];
1092 auto const spline_coef_3D = spline_coef[j];
1093 for (
auto const i1 : evaluation_domain1) {
1094 for (
auto const i2 : evaluation_domain2) {
1095 for (
auto const i3 : evaluation_domain3) {
1097 continuous_dimension_type1,
1098 continuous_dimension_type2,
1099 continuous_dimension_type3>
1101 ddc::coordinate(i1),
1102 ddc::coordinate(i2),
1103 ddc::coordinate(i3));
1104 spline_eval_3D(i1, i2, i3) = eval_no_bc<
1107 eval_type>(coord_eval_3D, spline_coef_3D);
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1136 class BatchedInterpolationDDom,
1137 class... CoordsDims>
1139 ddc::
ChunkSpan<
double, BatchedInterpolationDDom, Layout1, memory_space>
const
1142 ddc::Coordinate<CoordsDims...>
const,
1143 BatchedInterpolationDDom,
1145 memory_space>
const coords_eval,
1148 batched_spline_domain_type<BatchedInterpolationDDom>,
1150 memory_space>
const spline_coef)
const
1152 batch_domain_type<BatchedInterpolationDDom>
const batch_domain(coords_eval.domain());
1153 evaluation_domain_type1
const evaluation_domain1(spline_eval.domain());
1154 evaluation_domain_type2
const evaluation_domain2(spline_eval.domain());
1155 evaluation_domain_type3
const evaluation_domain3(spline_eval.domain());
1156 ddc::parallel_for_each(
1157 "ddc_splines_differentiate_3d_dim_3",
1160 KOKKOS_CLASS_LAMBDA(
1161 typename batch_domain_type<
1162 BatchedInterpolationDDom>::discrete_element_type
const j) {
1163 auto const spline_eval_3D = spline_eval[j];
1164 auto const coords_eval_3D = coords_eval[j];
1165 auto const spline_coef_3D = spline_coef[j];
1166 for (
auto const i1 : evaluation_domain1) {
1167 for (
auto const i2 : evaluation_domain2) {
1168 for (
auto const i3 : evaluation_domain3) {
1169 spline_eval_3D(i1, i2, i3)
1170 = eval_no_bc<eval_type, eval_type, eval_deriv_type>(
1171 coords_eval_3D(i1, i2, i3),
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192 template <
class Layout1,
class Layout2,
class BatchedInterpolationDDom>
1194 ddc::
ChunkSpan<
double, BatchedInterpolationDDom, Layout1, memory_space>
const
1198 batched_spline_domain_type<BatchedInterpolationDDom>,
1200 memory_space>
const spline_coef)
const
1202 batch_domain_type<BatchedInterpolationDDom>
const batch_domain(spline_eval.domain());
1203 evaluation_domain_type1
const evaluation_domain1(spline_eval.domain());
1204 evaluation_domain_type2
const evaluation_domain2(spline_eval.domain());
1205 evaluation_domain_type3
const evaluation_domain3(spline_eval.domain());
1206 ddc::parallel_for_each(
1207 "ddc_splines_differentiate_3d_dim_3",
1210 KOKKOS_CLASS_LAMBDA(
1211 typename batch_domain_type<
1212 BatchedInterpolationDDom>::discrete_element_type
const j) {
1213 auto const spline_eval_3D = spline_eval[j];
1214 auto const spline_coef_3D = spline_coef[j];
1215 for (
auto const i1 : evaluation_domain1) {
1216 for (
auto const i2 : evaluation_domain2) {
1217 for (
auto const i3 : evaluation_domain3) {
1219 continuous_dimension_type1,
1220 continuous_dimension_type2,
1221 continuous_dimension_type3>
1223 ddc::coordinate(i1),
1224 ddc::coordinate(i2),
1225 ddc::coordinate(i3));
1226 spline_eval_3D(i1, i2, i3) = eval_no_bc<
1229 eval_deriv_type>(coord_eval_3D, spline_coef_3D);
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1258 class BatchedInterpolationDDom,
1259 class... CoordsDims>
1261 ddc::
ChunkSpan<
double, BatchedInterpolationDDom, Layout1, memory_space>
const
1264 ddc::Coordinate<CoordsDims...>
const,
1265 BatchedInterpolationDDom,
1267 memory_space>
const coords_eval,
1270 batched_spline_domain_type<BatchedInterpolationDDom>,
1272 memory_space>
const spline_coef)
const
1274 batch_domain_type<BatchedInterpolationDDom>
const batch_domain(coords_eval.domain());
1275 evaluation_domain_type1
const evaluation_domain1(spline_eval.domain());
1276 evaluation_domain_type2
const evaluation_domain2(spline_eval.domain());
1277 evaluation_domain_type3
const evaluation_domain3(spline_eval.domain());
1278 ddc::parallel_for_each(
1279 "ddc_splines_cross_differentiate_3d_dim1_2",
1282 KOKKOS_CLASS_LAMBDA(
1283 typename batch_domain_type<
1284 BatchedInterpolationDDom>::discrete_element_type
const j) {
1285 auto const spline_eval_3D = spline_eval[j];
1286 auto const coords_eval_3D = coords_eval[j];
1287 auto const spline_coef_3D = spline_coef[j];
1288 for (
auto const i1 : evaluation_domain1) {
1289 for (
auto const i2 : evaluation_domain2) {
1290 for (
auto const i3 : evaluation_domain3) {
1291 spline_eval_3D(i1, i2, i3) = eval_no_bc<
1294 eval_type>(coords_eval_3D(i1, i2, i3), spline_coef_3D);
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314 template <
class Layout1,
class Layout2,
class BatchedInterpolationDDom>
1316 ddc::
ChunkSpan<
double, BatchedInterpolationDDom, Layout1, memory_space>
const
1320 batched_spline_domain_type<BatchedInterpolationDDom>,
1322 memory_space>
const spline_coef)
const
1324 batch_domain_type<BatchedInterpolationDDom>
const batch_domain(spline_eval.domain());
1325 evaluation_domain_type1
const evaluation_domain1(spline_eval.domain());
1326 evaluation_domain_type2
const evaluation_domain2(spline_eval.domain());
1327 evaluation_domain_type3
const evaluation_domain3(spline_eval.domain());
1328 ddc::parallel_for_each(
1329 "ddc_splines_cross_differentiate_3d_dim1_2",
1332 KOKKOS_CLASS_LAMBDA(
1333 typename batch_domain_type<
1334 BatchedInterpolationDDom>::discrete_element_type
const j) {
1335 auto const spline_eval_3D = spline_eval[j];
1336 auto const spline_coef_3D = spline_coef[j];
1337 for (
auto const i1 : evaluation_domain1) {
1338 for (
auto const i2 : evaluation_domain2) {
1339 for (
auto const i3 : evaluation_domain3) {
1341 continuous_dimension_type1,
1342 continuous_dimension_type2,
1343 continuous_dimension_type3>
1345 ddc::coordinate(i1),
1346 ddc::coordinate(i2),
1347 ddc::coordinate(i3));
1348 spline_eval_3D(i1, i2, i3) = eval_no_bc<
1351 eval_type>(coord_eval_3D, spline_coef_3D);
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1380 class BatchedInterpolationDDom,
1381 class... CoordsDims>
1383 ddc::
ChunkSpan<
double, BatchedInterpolationDDom, Layout1, memory_space>
const
1386 ddc::Coordinate<CoordsDims...>
const,
1387 BatchedInterpolationDDom,
1389 memory_space>
const coords_eval,
1392 batched_spline_domain_type<BatchedInterpolationDDom>,
1394 memory_space>
const spline_coef)
const
1396 batch_domain_type<BatchedInterpolationDDom>
const batch_domain(coords_eval.domain());
1397 evaluation_domain_type1
const evaluation_domain1(spline_eval.domain());
1398 evaluation_domain_type2
const evaluation_domain2(spline_eval.domain());
1399 evaluation_domain_type3
const evaluation_domain3(spline_eval.domain());
1400 ddc::parallel_for_each(
1401 "ddc_splines_cross_differentiate_3d_dim2_3",
1404 KOKKOS_CLASS_LAMBDA(
1405 typename batch_domain_type<
1406 BatchedInterpolationDDom>::discrete_element_type
const j) {
1407 auto const spline_eval_3D = spline_eval[j];
1408 auto const coords_eval_3D = coords_eval[j];
1409 auto const spline_coef_3D = spline_coef[j];
1410 for (
auto const i1 : evaluation_domain1) {
1411 for (
auto const i2 : evaluation_domain2) {
1412 for (
auto const i3 : evaluation_domain3) {
1413 spline_eval_3D(i1, i2, i3)
1414 = eval_no_bc<eval_type, eval_deriv_type, eval_deriv_type>(
1415 coords_eval_3D(i1, i2, i3),
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436 template <
class Layout1,
class Layout2,
class BatchedInterpolationDDom>
1438 ddc::
ChunkSpan<
double, BatchedInterpolationDDom, Layout1, memory_space>
const
1442 batched_spline_domain_type<BatchedInterpolationDDom>,
1444 memory_space>
const spline_coef)
const
1446 batch_domain_type<BatchedInterpolationDDom>
const batch_domain(spline_eval.domain());
1447 evaluation_domain_type1
const evaluation_domain1(spline_eval.domain());
1448 evaluation_domain_type2
const evaluation_domain2(spline_eval.domain());
1449 evaluation_domain_type3
const evaluation_domain3(spline_eval.domain());
1450 ddc::parallel_for_each(
1451 "ddc_splines_cross_differentiate_3d_dim2_3",
1454 KOKKOS_CLASS_LAMBDA(
1455 typename batch_domain_type<
1456 BatchedInterpolationDDom>::discrete_element_type
const j) {
1457 auto const spline_eval_3D = spline_eval[j];
1458 auto const spline_coef_3D = spline_coef[j];
1459 for (
auto const i1 : evaluation_domain1) {
1460 for (
auto const i2 : evaluation_domain2) {
1461 for (
auto const i3 : evaluation_domain3) {
1463 continuous_dimension_type1,
1464 continuous_dimension_type2,
1465 continuous_dimension_type3>
1467 ddc::coordinate(i1),
1468 ddc::coordinate(i2),
1469 ddc::coordinate(i3));
1470 spline_eval_3D(i1, i2, i3) = eval_no_bc<
1473 eval_deriv_type>(coord_eval_3D, spline_coef_3D);
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1502 class BatchedInterpolationDDom,
1503 class... CoordsDims>
1505 ddc::
ChunkSpan<
double, BatchedInterpolationDDom, Layout1, memory_space>
const
1508 ddc::Coordinate<CoordsDims...>
const,
1509 BatchedInterpolationDDom,
1511 memory_space>
const coords_eval,
1514 batched_spline_domain_type<BatchedInterpolationDDom>,
1516 memory_space>
const spline_coef)
const
1518 batch_domain_type<BatchedInterpolationDDom>
const batch_domain(coords_eval.domain());
1519 evaluation_domain_type1
const evaluation_domain1(spline_eval.domain());
1520 evaluation_domain_type2
const evaluation_domain2(spline_eval.domain());
1521 evaluation_domain_type3
const evaluation_domain3(spline_eval.domain());
1522 ddc::parallel_for_each(
1523 "ddc_splines_cross_differentiate_3d_dim1_3",
1526 KOKKOS_CLASS_LAMBDA(
1527 typename batch_domain_type<
1528 BatchedInterpolationDDom>::discrete_element_type
const j) {
1529 auto const spline_eval_3D = spline_eval[j];
1530 auto const coords_eval_3D = coords_eval[j];
1531 auto const spline_coef_3D = spline_coef[j];
1532 for (
auto const i1 : evaluation_domain1) {
1533 for (
auto const i2 : evaluation_domain2) {
1534 for (
auto const i3 : evaluation_domain3) {
1535 spline_eval_3D(i1, i2, i3)
1536 = eval_no_bc<eval_deriv_type, eval_type, eval_deriv_type>(
1537 coords_eval_3D(i1, i2, i3),
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558 template <
class Layout1,
class Layout2,
class BatchedInterpolationDDom>
1560 ddc::
ChunkSpan<
double, BatchedInterpolationDDom, Layout1, memory_space>
const
1564 batched_spline_domain_type<BatchedInterpolationDDom>,
1566 memory_space>
const spline_coef)
const
1568 batch_domain_type<BatchedInterpolationDDom>
const batch_domain(spline_eval.domain());
1569 evaluation_domain_type1
const evaluation_domain1(spline_eval.domain());
1570 evaluation_domain_type2
const evaluation_domain2(spline_eval.domain());
1571 evaluation_domain_type3
const evaluation_domain3(spline_eval.domain());
1572 ddc::parallel_for_each(
1573 "ddc_splines_cross_differentiate_3d_dim1_3",
1576 KOKKOS_CLASS_LAMBDA(
1577 typename batch_domain_type<
1578 BatchedInterpolationDDom>::discrete_element_type
const j) {
1579 auto const spline_eval_3D = spline_eval[j];
1580 auto const spline_coef_3D = spline_coef[j];
1581 for (
auto const i1 : evaluation_domain1) {
1582 for (
auto const i2 : evaluation_domain2) {
1583 for (
auto const i3 : evaluation_domain3) {
1585 continuous_dimension_type1,
1586 continuous_dimension_type2,
1587 continuous_dimension_type3>
1589 ddc::coordinate(i1),
1590 ddc::coordinate(i2),
1591 ddc::coordinate(i3));
1592 spline_eval_3D(i1, i2, i3) = eval_no_bc<
1595 eval_deriv_type>(coord_eval_3D, spline_coef_3D);
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1624 class BatchedInterpolationDDom,
1625 class... CoordsDims>
1627 ddc::
ChunkSpan<
double, BatchedInterpolationDDom, Layout1, memory_space>
const
1630 ddc::Coordinate<CoordsDims...>
const,
1631 BatchedInterpolationDDom,
1633 memory_space>
const coords_eval,
1636 batched_spline_domain_type<BatchedInterpolationDDom>,
1638 memory_space>
const spline_coef)
const
1640 batch_domain_type<BatchedInterpolationDDom>
const batch_domain(coords_eval.domain());
1641 evaluation_domain_type1
const evaluation_domain1(spline_eval.domain());
1642 evaluation_domain_type2
const evaluation_domain2(spline_eval.domain());
1643 evaluation_domain_type3
const evaluation_domain3(spline_eval.domain());
1644 ddc::parallel_for_each(
1645 "ddc_splines_cross_differentiate_3d_dim1_2_3",
1648 KOKKOS_CLASS_LAMBDA(
1649 typename batch_domain_type<
1650 BatchedInterpolationDDom>::discrete_element_type
const j) {
1651 auto const spline_eval_3D = spline_eval[j];
1652 auto const coords_eval_3D = coords_eval[j];
1653 auto const spline_coef_3D = spline_coef[j];
1654 for (
auto const i1 : evaluation_domain1) {
1655 for (
auto const i2 : evaluation_domain2) {
1656 for (
auto const i3 : evaluation_domain3) {
1657 spline_eval_3D(i1, i2, i3) = eval_no_bc<
1661 coords_eval_3D(i1, i2, i3),
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682 template <
class Layout1,
class Layout2,
class BatchedInterpolationDDom>
1684 ddc::
ChunkSpan<
double, BatchedInterpolationDDom, Layout1, memory_space>
const
1688 batched_spline_domain_type<BatchedInterpolationDDom>,
1690 memory_space>
const spline_coef)
const
1692 batch_domain_type<BatchedInterpolationDDom>
const batch_domain(spline_eval.domain());
1693 evaluation_domain_type1
const evaluation_domain1(spline_eval.domain());
1694 evaluation_domain_type2
const evaluation_domain2(spline_eval.domain());
1695 evaluation_domain_type3
const evaluation_domain3(spline_eval.domain());
1696 ddc::parallel_for_each(
1697 "ddc_splines_cross_differentiate_3d_dim1_2_3",
1700 KOKKOS_CLASS_LAMBDA(
1701 typename batch_domain_type<
1702 BatchedInterpolationDDom>::discrete_element_type
const j) {
1703 auto const spline_eval_3D = spline_eval[j];
1704 auto const spline_coef_3D = spline_coef[j];
1705 for (
auto const i1 : evaluation_domain1) {
1706 for (
auto const i2 : evaluation_domain2) {
1707 for (
auto const i3 : evaluation_domain3) {
1709 continuous_dimension_type1,
1710 continuous_dimension_type2,
1711 continuous_dimension_type3>
1713 ddc::coordinate(i1),
1714 ddc::coordinate(i2),
1715 ddc::coordinate(i3));
1716 spline_eval_3D(i1, i2, i3) = eval_no_bc<
1719 eval_deriv_type>(coord_eval_3D, spline_coef_3D);
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1750 class BatchedInterpolationDDom,
1751 class... CoordsDims>
1753 ddc::
ChunkSpan<
double, BatchedInterpolationDDom, Layout1, memory_space>
const
1756 ddc::Coordinate<CoordsDims...>
const,
1757 BatchedInterpolationDDom,
1759 memory_space>
const coords_eval,
1762 batched_spline_domain_type<BatchedInterpolationDDom>,
1764 memory_space>
const spline_coef)
const
1767 std::is_same_v<InterestDim, continuous_dimension_type1>
1768 || std::is_same_v<InterestDim, continuous_dimension_type2>
1769 || std::is_same_v<InterestDim, continuous_dimension_type3>);
1770 if constexpr (std::is_same_v<InterestDim, continuous_dimension_type1>) {
1771 return deriv_dim_1(spline_eval, coords_eval, spline_coef);
1772 }
else if constexpr (std::is_same_v<InterestDim, continuous_dimension_type2>) {
1773 return deriv_dim_2(spline_eval, coords_eval, spline_coef);
1774 }
else if constexpr (std::is_same_v<InterestDim, continuous_dimension_type3>) {
1775 return deriv_dim_3(spline_eval, coords_eval, spline_coef);
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793 template <
class InterestDim,
class Layout1,
class Layout2,
class BatchedInterpolationDDom>
1795 ddc::
ChunkSpan<
double, BatchedInterpolationDDom, Layout1, memory_space>
const
1799 batched_spline_domain_type<BatchedInterpolationDDom>,
1801 memory_space>
const spline_coef)
const
1804 std::is_same_v<InterestDim, continuous_dimension_type1>
1805 || std::is_same_v<InterestDim, continuous_dimension_type2>
1806 || std::is_same_v<InterestDim, continuous_dimension_type3>);
1807 if constexpr (std::is_same_v<InterestDim, continuous_dimension_type1>) {
1808 return deriv_dim_1(spline_eval, spline_coef);
1809 }
else if constexpr (std::is_same_v<InterestDim, continuous_dimension_type2>) {
1810 return deriv_dim_2(spline_eval, spline_coef);
1811 }
else if constexpr (std::is_same_v<InterestDim, continuous_dimension_type3>) {
1812 return deriv_dim_3(spline_eval, spline_coef);
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1845 class BatchedInterpolationDDom,
1846 class... CoordsDims>
1848 ddc::
ChunkSpan<
double, BatchedInterpolationDDom, Layout1, memory_space>
const
1851 ddc::Coordinate<CoordsDims...>
const,
1852 BatchedInterpolationDDom,
1854 memory_space>
const coords_eval,
1857 batched_spline_domain_type<BatchedInterpolationDDom>,
1859 memory_space>
const spline_coef)
const
1862 (std::is_same_v<InterestDim1, continuous_dimension_type1>
1863 && std::is_same_v<InterestDim2, continuous_dimension_type2>)
1864 || (std::is_same_v<InterestDim2, continuous_dimension_type1>
1865 && std::is_same_v<InterestDim1, continuous_dimension_type2>)
1866 || (std::is_same_v<InterestDim1, continuous_dimension_type2>
1867 && std::is_same_v<InterestDim2, continuous_dimension_type3>)
1868 || (std::is_same_v<InterestDim2, continuous_dimension_type2>
1869 && std::is_same_v<InterestDim1, continuous_dimension_type3>)
1870 || (std::is_same_v<InterestDim1, continuous_dimension_type1>
1871 && std::is_same_v<InterestDim2, continuous_dimension_type3>)
1872 || (std::is_same_v<InterestDim2, continuous_dimension_type1>
1873 && std::is_same_v<InterestDim1, continuous_dimension_type3>));
1876 (std::is_same_v<InterestDim1, continuous_dimension_type1>
1877 && std::is_same_v<InterestDim2, continuous_dimension_type2>)
1878 || (std::is_same_v<InterestDim2, continuous_dimension_type1>
1879 && std::is_same_v<InterestDim1, continuous_dimension_type2>)) {
1880 return deriv_1_and_2(spline_eval, coords_eval, spline_coef);
1881 }
else if constexpr (
1882 (std::is_same_v<InterestDim1, continuous_dimension_type2>
1883 && std::is_same_v<InterestDim2, continuous_dimension_type3>)
1884 || (std::is_same_v<InterestDim2, continuous_dimension_type2>
1885 && std::is_same_v<InterestDim1, continuous_dimension_type3>)) {
1886 return deriv_2_and_3(spline_eval, coords_eval, spline_coef);
1887 }
else if constexpr (
1888 (std::is_same_v<InterestDim1, continuous_dimension_type1>
1889 && std::is_same_v<InterestDim2, continuous_dimension_type3>)
1890 || (std::is_same_v<InterestDim2, continuous_dimension_type1>
1891 && std::is_same_v<InterestDim1, continuous_dimension_type3>)) {
1892 return deriv_1_and_3(spline_eval, coords_eval, spline_coef);
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1919 class BatchedInterpolationDDom>
1921 ddc::
ChunkSpan<
double, BatchedInterpolationDDom, Layout1, memory_space>
const
1925 batched_spline_domain_type<BatchedInterpolationDDom>,
1927 memory_space>
const spline_coef)
const
1930 (std::is_same_v<InterestDim1, continuous_dimension_type1>
1931 && std::is_same_v<InterestDim2, continuous_dimension_type2>)
1932 || (std::is_same_v<InterestDim2, continuous_dimension_type1>
1933 && std::is_same_v<InterestDim1, continuous_dimension_type2>)
1934 || (std::is_same_v<InterestDim1, continuous_dimension_type2>
1935 && std::is_same_v<InterestDim2, continuous_dimension_type3>)
1936 || (std::is_same_v<InterestDim2, continuous_dimension_type2>
1937 && std::is_same_v<InterestDim1, continuous_dimension_type3>)
1938 || (std::is_same_v<InterestDim1, continuous_dimension_type1>
1939 && std::is_same_v<InterestDim2, continuous_dimension_type3>)
1940 || (std::is_same_v<InterestDim2, continuous_dimension_type1>
1941 && std::is_same_v<InterestDim1, continuous_dimension_type3>));
1944 (std::is_same_v<InterestDim1, continuous_dimension_type1>
1945 && std::is_same_v<InterestDim2, continuous_dimension_type2>)
1946 || (std::is_same_v<InterestDim2, continuous_dimension_type1>
1947 && std::is_same_v<InterestDim1, continuous_dimension_type2>)) {
1948 return deriv_1_and_2(spline_eval, spline_coef);
1949 }
else if constexpr (
1950 (std::is_same_v<InterestDim1, continuous_dimension_type2>
1951 && std::is_same_v<InterestDim2, continuous_dimension_type3>)
1952 || (std::is_same_v<InterestDim2, continuous_dimension_type2>
1953 && std::is_same_v<InterestDim1, continuous_dimension_type3>)) {
1954 return deriv_2_and_3(spline_eval, spline_coef);
1955 }
else if constexpr (
1956 (std::is_same_v<InterestDim1, continuous_dimension_type1>
1957 && std::is_same_v<InterestDim2, continuous_dimension_type3>)
1958 || (std::is_same_v<InterestDim2, continuous_dimension_type1>
1959 && std::is_same_v<InterestDim1, continuous_dimension_type3>)) {
1960 return deriv_1_and_3(spline_eval, spline_coef);
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1995 class BatchedInterpolationDDom,
1996 class... CoordsDims>
1998 ddc::
ChunkSpan<
double, BatchedInterpolationDDom, Layout1, memory_space>
const
2001 ddc::Coordinate<CoordsDims...>
const,
2002 BatchedInterpolationDDom,
2004 memory_space>
const coords_eval,
2007 batched_spline_domain_type<BatchedInterpolationDDom>,
2009 memory_space>
const spline_coef)
const
2012 (std::is_same_v<InterestDim1, continuous_dimension_type1>
2013 && std::is_same_v<InterestDim2, continuous_dimension_type2>
2014 && std::is_same_v<InterestDim3, continuous_dimension_type3>)
2015 || (std::is_same_v<InterestDim3, continuous_dimension_type1>
2016 && std::is_same_v<InterestDim1, continuous_dimension_type2>
2017 && std::is_same_v<InterestDim2, continuous_dimension_type3>)
2018 || (std::is_same_v<InterestDim2, continuous_dimension_type1>
2019 && std::is_same_v<InterestDim3, continuous_dimension_type2>
2020 && std::is_same_v<InterestDim1, continuous_dimension_type3>));
2022 return deriv_1_2_3(spline_eval, coords_eval, spline_coef);
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2050 class BatchedInterpolationDDom>
2052 ddc::
ChunkSpan<
double, BatchedInterpolationDDom, Layout1, memory_space>
const
2056 batched_spline_domain_type<BatchedInterpolationDDom>,
2058 memory_space>
const spline_coef)
const
2061 (std::is_same_v<InterestDim1, continuous_dimension_type1>
2062 && std::is_same_v<InterestDim2, continuous_dimension_type2>
2063 && std::is_same_v<InterestDim3, continuous_dimension_type3>)
2064 || (std::is_same_v<InterestDim3, continuous_dimension_type1>
2065 && std::is_same_v<InterestDim1, continuous_dimension_type2>
2066 && std::is_same_v<InterestDim2, continuous_dimension_type3>)
2067 || (std::is_same_v<InterestDim2, continuous_dimension_type1>
2068 && std::is_same_v<InterestDim3, continuous_dimension_type2>
2069 && std::is_same_v<InterestDim1, continuous_dimension_type3>));
2071 return deriv_1_2_3(spline_eval, spline_coef);
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087 template <
class Layout1,
class Layout2,
class BatchedDDom,
class BatchedSplineDDom>
2089 ddc::
ChunkSpan<
double, BatchedDDom, Layout1, memory_space>
const integrals,
2090 ddc::
ChunkSpan<
double const, BatchedSplineDDom, Layout2, memory_space>
const
2094 ddc::type_seq_contains_v<
2095 ddc::detail::TypeSeq<bsplines_type1, bsplines_type2, bsplines_type3>,
2096 to_type_seq_t<BatchedSplineDDom>>,
2097 "The spline coefficients domain must contain the bsplines dimensions");
2098 using batch_domain_type =
ddc::
2099 remove_dims_of_t<BatchedSplineDDom, bsplines_type1, bsplines_type2, bsplines_type3>;
2101 std::is_same_v<batch_domain_type, BatchedDDom>,
2102 "The integrals domain must only contain the batch dimensions");
2104 batch_domain_type batch_domain(integrals.domain());
2109 ddc::integrals(exec_space(), values1);
2114 ddc::integrals(exec_space(), values2);
2119 ddc::integrals(exec_space(), values3);
2121 ddc::parallel_for_each(
2122 "ddc_splines_integrate_bsplines",
2125 KOKKOS_LAMBDA(
typename batch_domain_type::discrete_element_type
const j) {
2127 for (
typename spline_domain_type1::discrete_element_type
const i1 :
2129 for (
typename spline_domain_type2::discrete_element_type
const i2 :
2131 for (
typename spline_domain_type3::discrete_element_type
const i3 :
2133 integrals(j) += spline_coef(i1, i2, i3, j) * values1(i1)
2134 * values2(i2) * values3(i3);
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157 template <
class Layout,
class... CoordsDims>
2158 KOKKOS_INLINE_FUNCTION
double eval(
2159 ddc::Coordinate<CoordsDims...> coord_eval,
2160 ddc::
ChunkSpan<
double const, spline_domain_type, Layout, memory_space>
const
2163 using Dim1 = continuous_dimension_type1;
2164 using Dim2 = continuous_dimension_type2;
2165 using Dim3 = continuous_dimension_type3;
2166 if constexpr (bsplines_type1::is_periodic()) {
2167 if (
ddc::get<Dim1>(coord_eval) <
ddc::discrete_space<bsplines_type1>().rmin()
2168 ||
ddc::get<Dim1>(coord_eval) >
ddc::discrete_space<bsplines_type1>().rmax()) {
2169 ddc::get<Dim1>(coord_eval)
2171 (
ddc::get<Dim1>(coord_eval)
2172 -
ddc::discrete_space<bsplines_type1>().rmin())
2173 /
ddc::discrete_space<bsplines_type1>().length())
2174 *
ddc::discrete_space<bsplines_type1>().length();
2177 if constexpr (bsplines_type2::is_periodic()) {
2178 if (
ddc::get<Dim2>(coord_eval) <
ddc::discrete_space<bsplines_type2>().rmin()
2179 ||
ddc::get<Dim2>(coord_eval) >
ddc::discrete_space<bsplines_type2>().rmax()) {
2180 ddc::get<Dim2>(coord_eval)
2182 (
ddc::get<Dim2>(coord_eval)
2183 -
ddc::discrete_space<bsplines_type2>().rmin())
2184 /
ddc::discrete_space<bsplines_type2>().length())
2185 *
ddc::discrete_space<bsplines_type2>().length();
2188 if constexpr (bsplines_type3::is_periodic()) {
2189 if (
ddc::get<Dim3>(coord_eval) <
ddc::discrete_space<bsplines_type3>().rmin()
2190 ||
ddc::get<Dim3>(coord_eval) >
ddc::discrete_space<bsplines_type3>().rmax()) {
2191 ddc::get<Dim3>(coord_eval)
2193 (
ddc::get<Dim3>(coord_eval)
2194 -
ddc::discrete_space<bsplines_type3>().rmin())
2195 /
ddc::discrete_space<bsplines_type3>().length())
2196 *
ddc::discrete_space<bsplines_type3>().length();
2199 if constexpr (!bsplines_type1::is_periodic()) {
2200 if (
ddc::get<Dim1>(coord_eval) <
ddc::discrete_space<bsplines_type1>().rmin()) {
2201 return m_lower_extrap_rule_1(coord_eval, spline_coef);
2203 if (
ddc::get<Dim1>(coord_eval) >
ddc::discrete_space<bsplines_type1>().rmax()) {
2204 return m_upper_extrap_rule_1(coord_eval, spline_coef);
2207 if constexpr (!bsplines_type2::is_periodic()) {
2208 if (
ddc::get<Dim2>(coord_eval) <
ddc::discrete_space<bsplines_type2>().rmin()) {
2209 return m_lower_extrap_rule_2(coord_eval, spline_coef);
2211 if (
ddc::get<Dim2>(coord_eval) >
ddc::discrete_space<bsplines_type2>().rmax()) {
2212 return m_upper_extrap_rule_2(coord_eval, spline_coef);
2215 if constexpr (!bsplines_type3::is_periodic()) {
2216 if (
ddc::get<Dim3>(coord_eval) <
ddc::discrete_space<bsplines_type3>().rmin()) {
2217 return m_lower_extrap_rule_3(coord_eval, spline_coef);
2219 if (
ddc::get<Dim3>(coord_eval) >
ddc::discrete_space<bsplines_type3>().rmax()) {
2220 return m_upper_extrap_rule_3(coord_eval, spline_coef);
2223 return eval_no_bc<eval_type, eval_type, eval_type>(
2225 continuous_dimension_type1,
2226 continuous_dimension_type2,
2227 continuous_dimension_type3>(
2228 ddc::get<Dim1>(coord_eval),
2229 ddc::get<Dim2>(coord_eval),
2230 ddc::get<Dim3>(coord_eval)),
2235
2236
2237
2238
2239
2240
2241
2242 template <
class EvalType1,
class EvalType2,
class EvalType3,
class Layout,
class... CoordsDims>
2243 KOKKOS_INLINE_FUNCTION
double eval_no_bc(
2244 ddc::Coordinate<CoordsDims...>
const& coord_eval,
2245 ddc::
ChunkSpan<
double const, spline_domain_type, Layout, memory_space>
const
2249 std::is_same_v<EvalType1, eval_type> || std::is_same_v<EvalType1, eval_deriv_type>);
2251 std::is_same_v<EvalType2, eval_type> || std::is_same_v<EvalType2, eval_deriv_type>);
2253 std::is_same_v<EvalType3, eval_type> || std::is_same_v<EvalType3, eval_deriv_type>);
2254 ddc::DiscreteElement<bsplines_type1> jmin1;
2255 ddc::DiscreteElement<bsplines_type2> jmin2;
2256 ddc::DiscreteElement<bsplines_type3> jmin3;
2258 std::array<
double, bsplines_type1::degree() + 1> vals1_ptr;
2259 Kokkos::mdspan<
double, Kokkos::extents<std::size_t, bsplines_type1::degree() + 1>>
const
2260 vals1(vals1_ptr.data());
2261 std::array<
double, bsplines_type2::degree() + 1> vals2_ptr;
2262 Kokkos::mdspan<
double, Kokkos::extents<std::size_t, bsplines_type2::degree() + 1>>
const
2263 vals2(vals2_ptr.data());
2264 std::array<
double, bsplines_type3::degree() + 1> vals3_ptr;
2265 Kokkos::mdspan<
double, Kokkos::extents<std::size_t, bsplines_type3::degree() + 1>>
const
2266 vals3(vals3_ptr.data());
2267 ddc::Coordinate<continuous_dimension_type1>
const coord_eval_interest1(coord_eval);
2268 ddc::Coordinate<continuous_dimension_type2>
const coord_eval_interest2(coord_eval);
2269 ddc::Coordinate<continuous_dimension_type3>
const coord_eval_interest3(coord_eval);
2271 if constexpr (std::is_same_v<EvalType1, eval_type>) {
2272 jmin1 =
ddc::discrete_space<bsplines_type1>().eval_basis(vals1, coord_eval_interest1);
2273 }
else if constexpr (std::is_same_v<EvalType1, eval_deriv_type>) {
2274 jmin1 =
ddc::discrete_space<bsplines_type1>().eval_deriv(vals1, coord_eval_interest1);
2276 if constexpr (std::is_same_v<EvalType2, eval_type>) {
2277 jmin2 =
ddc::discrete_space<bsplines_type2>().eval_basis(vals2, coord_eval_interest2);
2278 }
else if constexpr (std::is_same_v<EvalType2, eval_deriv_type>) {
2279 jmin2 =
ddc::discrete_space<bsplines_type2>().eval_deriv(vals2, coord_eval_interest2);
2281 if constexpr (std::is_same_v<EvalType3, eval_type>) {
2282 jmin3 =
ddc::discrete_space<bsplines_type3>().eval_basis(vals3, coord_eval_interest3);
2283 }
else if constexpr (std::is_same_v<EvalType3, eval_deriv_type>) {
2284 jmin3 =
ddc::discrete_space<bsplines_type3>().eval_deriv(vals3, coord_eval_interest3);
2288 for (std::size_t i = 0; i < bsplines_type1::degree() + 1; ++i) {
2289 for (std::size_t j = 0; j < bsplines_type2::degree() + 1; ++j) {
2290 for (std::size_t k = 0; k < bsplines_type3::degree() + 1; ++k) {
2292 ddc::DiscreteElement<
2295 bsplines_type3>(jmin1 + i, jmin2 + j, jmin3 + k))
2296 * vals1[i] * vals2[j] * vals3[k];
friend class DiscreteDomain
A class to evaluate, differentiate or integrate a 3D spline function.
upper_extrapolation_rule_1_type upper_extrapolation_rule_dim_1() const
Get the upper extrapolation rule along the first dimension.
KOKKOS_FUNCTION double deriv_dim_2(ddc::Coordinate< CoordsDims... > const &coord_eval, ddc::ChunkSpan< double 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 s...
void deriv(ddc::ChunkSpan< double, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< ddc::Coordinate< CoordsDims... > const, BatchedInterpolationDDom, Layout2, memory_space > const coords_eval, ddc::ChunkSpan< double 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 a specified dime...
void deriv_dim_2(ddc::ChunkSpan< double, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< double 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 second dimens...
void operator()(ddc::ChunkSpan< double, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< ddc::Coordinate< CoordsDims... > const, BatchedInterpolationDDom, Layout2, memory_space > const coords_eval, ddc::ChunkSpan< double 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.
SplineEvaluator3D & operator=(SplineEvaluator3D &&x)=default
Move-assigns.
void deriv_2_and_3(ddc::ChunkSpan< double, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< double const, batched_spline_domain_type< BatchedInterpolationDDom >, Layout2, memory_space > const spline_coef) const
Cross-differentiate 3D spline function (described by its spline coefficients) on a mesh along the sec...
void deriv_dim_1(ddc::ChunkSpan< double, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< double 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 first dimensi...
upper_extrapolation_rule_3_type upper_extrapolation_rule_dim_3() const
Get the upper extrapolation rule along the third dimension.
void deriv_1_2_3(ddc::ChunkSpan< double, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< ddc::Coordinate< CoordsDims... > const, BatchedInterpolationDDom, Layout2, memory_space > const coords_eval, ddc::ChunkSpan< double const, batched_spline_domain_type< BatchedInterpolationDDom >, Layout3, memory_space > const spline_coef) const
Cross-differentiate 3D spline function (described by its spline coefficients) on a mesh along the dim...
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.
void deriv_dim_2(ddc::ChunkSpan< double, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< ddc::Coordinate< CoordsDims... > const, BatchedInterpolationDDom, Layout2, memory_space > const coords_eval, ddc::ChunkSpan< double 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 second dimens...
KOKKOS_FUNCTION double deriv_dim_1(ddc::Coordinate< CoordsDims... > const &coord_eval, ddc::ChunkSpan< double 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 f...
void deriv(ddc::ChunkSpan< double, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< double 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 a specified dime...
KOKKOS_FUNCTION double deriv_1_and_3(ddc::Coordinate< CoordsDims... > const &coord_eval, ddc::ChunkSpan< double const, spline_domain_type, Layout, memory_space > const spline_coef) const
Cross-differentiate 3D spline function (described by its spline coefficients) at a given coordinate a...
~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.
KOKKOS_FUNCTION double deriv(ddc::Coordinate< CoordsDims... > const &coord_eval, ddc::ChunkSpan< double 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 a...
KOKKOS_FUNCTION double deriv_dim_3(ddc::Coordinate< CoordsDims... > const &coord_eval, ddc::ChunkSpan< double 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...
KOKKOS_FUNCTION double deriv2(ddc::Coordinate< CoordsDims... > const &coord_eval, ddc::ChunkSpan< double const, spline_domain_type, Layout, memory_space > const spline_coef) const
Double-differentiate 3D spline function (described by its spline coefficients) at a given coordinate ...
SplineEvaluator3D(SplineEvaluator3D const &x)=default
Copy-constructs.
KOKKOS_FUNCTION double operator()(ddc::Coordinate< CoordsDims... > const &coord_eval, ddc::ChunkSpan< double const, spline_domain_type, Layout, memory_space > const spline_coef) const
Evaluate 3D spline function (described by its spline coefficients) at a given coordinate.
lower_extrapolation_rule_3_type lower_extrapolation_rule_dim_3() const
Get the lower extrapolation rule along the third dimension.
void deriv2(ddc::ChunkSpan< double, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< ddc::Coordinate< CoordsDims... > const, BatchedInterpolationDDom, Layout2, memory_space > const coords_eval, ddc::ChunkSpan< double const, batched_spline_domain_type< BatchedInterpolationDDom >, Layout3, memory_space > const spline_coef) const
Double-differentiate 3D spline function (described by its spline coefficients) on a mesh along specif...
KOKKOS_FUNCTION double deriv_1_2_3(ddc::Coordinate< CoordsDims... > const &coord_eval, ddc::ChunkSpan< double const, spline_domain_type, Layout, memory_space > const spline_coef) const
Cross-differentiate 3D spline function (described by its spline coefficients) at a given coordinate a...
void deriv_dim_3(ddc::ChunkSpan< double, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< double 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 third dimensi...
void deriv_dim_1(ddc::ChunkSpan< double, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< ddc::Coordinate< CoordsDims... > const, BatchedInterpolationDDom, Layout2, memory_space > const coords_eval, ddc::ChunkSpan< double 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 first dimensi...
KOKKOS_FUNCTION double deriv_1_and_2(ddc::Coordinate< CoordsDims... > const &coord_eval, ddc::ChunkSpan< double const, spline_domain_type, Layout, memory_space > const spline_coef) const
Cross-differentiate 3D spline function (described by its spline coefficients) at a given coordinate a...
SplineEvaluator3D(SplineEvaluator3D &&x)=default
Move-constructs.
void deriv3(ddc::ChunkSpan< double, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< ddc::Coordinate< CoordsDims... > const, BatchedInterpolationDDom, Layout2, memory_space > const coords_eval, ddc::ChunkSpan< double 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 a specified dime...
void deriv_dim_3(ddc::ChunkSpan< double, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< ddc::Coordinate< CoordsDims... > const, BatchedInterpolationDDom, Layout2, memory_space > const coords_eval, ddc::ChunkSpan< double 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 third dimensi...
void deriv_2_and_3(ddc::ChunkSpan< double, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< ddc::Coordinate< CoordsDims... > const, BatchedInterpolationDDom, Layout2, memory_space > const coords_eval, ddc::ChunkSpan< double const, batched_spline_domain_type< BatchedInterpolationDDom >, Layout3, memory_space > const spline_coef) const
Cross-differentiate 3D spline function (described by its spline coefficients) on a mesh along the sec...
void deriv_1_2_3(ddc::ChunkSpan< double, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< double const, batched_spline_domain_type< BatchedInterpolationDDom >, Layout2, memory_space > const spline_coef) const
Cross-differentiate 3D spline function (described by its spline coefficients) on a mesh along the dim...
void deriv2(ddc::ChunkSpan< double, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< double const, batched_spline_domain_type< BatchedInterpolationDDom >, Layout2, memory_space > const spline_coef) const
Double-differentiate 3D spline function (described by its spline coefficients) on a mesh along specif...
void deriv3(ddc::ChunkSpan< double, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< double 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 deriv_1_and_2(ddc::ChunkSpan< double, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< double const, batched_spline_domain_type< BatchedInterpolationDDom >, Layout2, memory_space > const spline_coef) const
Cross-differentiate 3D spline function (described by its spline coefficients) on a mesh along the fir...
void integrate(ddc::ChunkSpan< double, BatchedDDom, Layout1, memory_space > const integrals, ddc::ChunkSpan< double const, BatchedSplineDDom, Layout2, memory_space > const spline_coef) const
Perform batched 3D integrations of a spline function (described by its spline coefficients) along the...
void deriv_1_and_2(ddc::ChunkSpan< double, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< ddc::Coordinate< CoordsDims... > const, BatchedInterpolationDDom, Layout2, memory_space > const coords_eval, ddc::ChunkSpan< double const, batched_spline_domain_type< BatchedInterpolationDDom >, Layout3, memory_space > const spline_coef) const
Cross-differentiate 3D spline function (described by its spline coefficients) on a mesh along the fir...
void deriv_1_and_3(ddc::ChunkSpan< double, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< ddc::Coordinate< CoordsDims... > const, BatchedInterpolationDDom, Layout2, memory_space > const coords_eval, ddc::ChunkSpan< double const, batched_spline_domain_type< BatchedInterpolationDDom >, Layout3, memory_space > const spline_coef) const
Cross-differentiate 3D spline function (described by its spline coefficients) on a mesh along the fir...
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 deriv_1_and_3(ddc::ChunkSpan< double, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< double const, batched_spline_domain_type< BatchedInterpolationDDom >, Layout2, memory_space > const spline_coef) const
Cross-differentiate 3D spline function (described by its spline coefficients) on a mesh along the fir...
void operator()(ddc::ChunkSpan< double, BatchedInterpolationDDom, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< double 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 double deriv3(ddc::Coordinate< CoordsDims... > const &coord_eval, ddc::ChunkSpan< double const, spline_domain_type, Layout, memory_space > const spline_coef) const
Triple-differentiate 3D spline function (described by its spline coefficients) at a given coordinate ...
KOKKOS_FUNCTION double deriv_2_and_3(ddc::Coordinate< CoordsDims... > const &coord_eval, ddc::ChunkSpan< double const, spline_domain_type, Layout, memory_space > const spline_coef) const
Cross-differentiate 3D spline function (described by its spline coefficients) at a given coordinate a...
The top-level namespace of DDC.