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
42 class EvaluationDDim1,
43 class EvaluationDDim2,
44 class LowerExtrapolationRule1,
45 class UpperExtrapolationRule1,
46 class LowerExtrapolationRule2,
47 class UpperExtrapolationRule2,
53
54
60
61
62 struct eval_deriv_type
68 using continuous_dimension_type1 =
typename BSplines1::continuous_dimension_type;
71 using continuous_dimension_type2 =
typename BSplines2::continuous_dimension_type;
74 using exec_space = ExecSpace;
77 using memory_space = MemorySpace;
80 using evaluation_discrete_dimension_type1 = EvaluationDDim1;
83 using evaluation_discrete_dimension_type2 = EvaluationDDim2;
86 using bsplines_type1 = BSplines1;
89 using bsplines_type2 = BSplines2;
92 using evaluation_domain_type1 =
ddc::
DiscreteDomain<evaluation_discrete_dimension_type1>;
95 using evaluation_domain_type2 =
ddc::
DiscreteDomain<evaluation_discrete_dimension_type2>;
99 evaluation_discrete_dimension_type1,
100 evaluation_discrete_dimension_type2>;
115
116
117
118 using batch_domain_type =
typename ddc::remove_dims_of_t<
119 batched_evaluation_domain_type,
120 evaluation_discrete_dimension_type1,
121 evaluation_discrete_dimension_type2>;
124
125
126
127 using batched_spline_domain_type =
128 typename ddc::detail::convert_type_seq_to_discrete_domain_t<
ddc::type_seq_replace_t<
129 ddc::detail::TypeSeq<IDimX...>,
130 ddc::detail::TypeSeq<
131 evaluation_discrete_dimension_type1,
132 evaluation_discrete_dimension_type2>,
133 ddc::detail::TypeSeq<bsplines_type1, bsplines_type2>>>;
136 using lower_extrapolation_rule_1_type = LowerExtrapolationRule1;
139 using upper_extrapolation_rule_1_type = UpperExtrapolationRule1;
142 using lower_extrapolation_rule_2_type = LowerExtrapolationRule2;
145 using upper_extrapolation_rule_2_type = UpperExtrapolationRule2;
148 LowerExtrapolationRule1 m_lower_extrap_rule_1;
150 UpperExtrapolationRule1 m_upper_extrap_rule_1;
152 LowerExtrapolationRule2 m_lower_extrap_rule_2;
154 UpperExtrapolationRule2 m_upper_extrap_rule_2;
158 std::is_same_v<LowerExtrapolationRule1,
160 == bsplines_type1::is_periodic()
162 UpperExtrapolationRule1,
164 == bsplines_type1::is_periodic()
166 LowerExtrapolationRule2,
168 == bsplines_type2::is_periodic()
170 UpperExtrapolationRule2,
172 == bsplines_type2::is_periodic(),
173 "PeriodicExtrapolationRule has to be used if and only if dimension is periodic");
175 std::is_invocable_r_v<
177 LowerExtrapolationRule1,
178 ddc::Coordinate<continuous_dimension_type1>,
182 Kokkos::layout_right,
184 "LowerExtrapolationRule1::operator() has to be callable "
185 "with usual arguments.");
187 std::is_invocable_r_v<
189 UpperExtrapolationRule1,
190 ddc::Coordinate<continuous_dimension_type1>,
194 Kokkos::layout_right,
196 "UpperExtrapolationRule1::operator() has to be callable "
197 "with usual arguments.");
199 std::is_invocable_r_v<
201 LowerExtrapolationRule2,
202 ddc::Coordinate<continuous_dimension_type2>,
206 Kokkos::layout_right,
208 "LowerExtrapolationRule2::operator() has to be callable "
209 "with usual arguments.");
211 std::is_invocable_r_v<
213 UpperExtrapolationRule2,
214 ddc::Coordinate<continuous_dimension_type2>,
218 Kokkos::layout_right,
220 "UpperExtrapolationRule2::operator() has to be callable "
221 "with usual arguments.");
224
225
226
227
228
229
230
231
232
234 LowerExtrapolationRule1
const& lower_extrap_rule1,
235 UpperExtrapolationRule1
const& upper_extrap_rule1,
236 LowerExtrapolationRule2
const& lower_extrap_rule2,
237 UpperExtrapolationRule2
const& upper_extrap_rule2)
238 : m_lower_extrap_rule_1(lower_extrap_rule1)
239 , m_upper_extrap_rule_1(upper_extrap_rule1)
240 , m_lower_extrap_rule_2(lower_extrap_rule2)
241 , m_upper_extrap_rule_2(upper_extrap_rule2)
246
247
248
249
253
254
255
256
263
264
265
266
267
271
272
273
274
275
279
280
281
282
283
284
285
286
289 return m_lower_extrap_rule_1;
293
294
295
296
297
298
299
300
303 return m_upper_extrap_rule_1;
307
308
309
310
311
312
313
314
317 return m_lower_extrap_rule_2;
321
322
323
324
325
326
327
328
331 return m_upper_extrap_rule_2;
335
336
337
338
339
340
341
342
343
344
345
346 template <
class Layout,
class... CoordsDims>
348 ddc::Coordinate<CoordsDims...>
const& coord_eval,
349 ddc::
ChunkSpan<
double const, spline_domain_type, Layout, memory_space>
const
352 return eval(coord_eval, spline_coef);
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375 template <
class Layout1,
class Layout2,
class Layout3,
class... CoordsDims>
377 ddc::
ChunkSpan<
double, batched_evaluation_domain_type, Layout1, memory_space>
const
380 ddc::Coordinate<CoordsDims...>
const,
381 batched_evaluation_domain_type,
383 memory_space>
const coords_eval,
384 ddc::
ChunkSpan<
double const, batched_spline_domain_type, Layout3, memory_space>
const
387 batch_domain_type
const batch_domain(coords_eval.domain());
388 evaluation_domain_type1
const evaluation_domain1(spline_eval.domain());
389 evaluation_domain_type2
const evaluation_domain2(spline_eval.domain());
390 ddc::parallel_for_each(
391 "ddc_splines_evaluate_2d",
394 KOKKOS_CLASS_LAMBDA(
typename batch_domain_type::discrete_element_type
const j) {
395 const auto spline_eval_2D = spline_eval[j];
396 const auto coords_eval_2D = coords_eval[j];
397 const auto spline_coef_2D = spline_coef[j];
398 for (
auto const i1 : evaluation_domain1) {
399 for (
auto const i2 : evaluation_domain2) {
400 spline_eval_2D(i1, i2) = eval(coords_eval_2D(i1, i2), spline_coef_2D);
407
408
409
410
411
412
413
414
415
416
417 template <
class Layout,
class... CoordsDims>
419 ddc::Coordinate<CoordsDims...>
const& coord_eval,
420 ddc::
ChunkSpan<
double const, spline_domain_type, Layout, memory_space>
const
423 return eval_no_bc<eval_deriv_type, eval_type>(coord_eval, spline_coef);
427
428
429
430
431
432
433
434
435
436
437 template <
class Layout,
class... CoordsDims>
439 ddc::Coordinate<CoordsDims...>
const& coord_eval,
440 ddc::
ChunkSpan<
double const, spline_domain_type, Layout, memory_space>
const
443 return eval_no_bc<eval_type, eval_deriv_type>(coord_eval, spline_coef);
447
448
449
450
451
452
453
454
455
456
457 template <
class Layout,
class... CoordsDims>
459 ddc::Coordinate<CoordsDims...>
const& coord_eval,
460 ddc::
ChunkSpan<
double const, spline_domain_type, Layout, memory_space>
const
463 return eval_no_bc<eval_deriv_type, eval_deriv_type>(coord_eval, spline_coef);
467
468
469
470
471
472
473
474
475
476
477
478
479 template <
class InterestDim,
class Layout,
class... CoordsDims>
481 ddc::Coordinate<CoordsDims...>
const& coord_eval,
482 ddc::
ChunkSpan<
double const, spline_domain_type, Layout, memory_space>
const
486 std::is_same_v<InterestDim, continuous_dimension_type1>
487 || std::is_same_v<InterestDim, continuous_dimension_type2>);
488 if constexpr (std::is_same_v<
490 typename evaluation_discrete_dimension_type1::
491 continuous_dimension_type>) {
492 return deriv_dim_1(coord_eval, spline_coef);
493 }
else if constexpr (std::is_same_v<
495 typename evaluation_discrete_dimension_type2::
496 continuous_dimension_type>) {
497 return deriv_dim_2(coord_eval, spline_coef);
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517 template <
class InterestDim1,
class InterestDim2,
class Layout,
class... CoordsDims>
519 ddc::Coordinate<CoordsDims...>
const& coord_eval,
520 ddc::
ChunkSpan<
double const, spline_domain_type, Layout, memory_space>
const
526 typename evaluation_discrete_dimension_type1::continuous_dimension_type>
527 && std::is_same_v<InterestDim2, continuous_dimension_type2>)
530 typename evaluation_discrete_dimension_type1::continuous_dimension_type>
531 && std::is_same_v<InterestDim1, continuous_dimension_type2>));
532 return deriv_1_and_2(coord_eval, spline_coef);
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555 template <
class Layout1,
class Layout2,
class Layout3,
class... CoordsDims>
557 ddc::
ChunkSpan<
double, batched_evaluation_domain_type, Layout1, memory_space>
const
560 ddc::Coordinate<CoordsDims...>
const,
561 batched_evaluation_domain_type,
563 memory_space>
const coords_eval,
564 ddc::
ChunkSpan<
double const, batched_spline_domain_type, Layout3, memory_space>
const
567 batch_domain_type
const batch_domain(coords_eval.domain());
568 evaluation_domain_type1
const evaluation_domain1(spline_eval.domain());
569 evaluation_domain_type2
const evaluation_domain2(spline_eval.domain());
570 ddc::parallel_for_each(
571 "ddc_splines_differentiate_2d_dim_1",
574 KOKKOS_CLASS_LAMBDA(
typename batch_domain_type::discrete_element_type
const j) {
575 const auto spline_eval_2D = spline_eval[j];
576 const auto coords_eval_2D = coords_eval[j];
577 const auto spline_coef_2D = spline_coef[j];
578 for (
auto const i1 : evaluation_domain1) {
579 for (
auto const i2 : evaluation_domain2) {
580 spline_eval_2D(i1, i2) = eval_no_bc<
582 eval_type>(coords_eval_2D(i1, i2), spline_coef_2D);
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606 template <
class Layout1,
class Layout2,
class Layout3,
class... CoordsDims>
608 ddc::
ChunkSpan<
double, batched_evaluation_domain_type, Layout1, memory_space>
const
611 ddc::Coordinate<CoordsDims...>
const,
612 batched_evaluation_domain_type,
614 memory_space>
const coords_eval,
615 ddc::
ChunkSpan<
double const, batched_spline_domain_type, Layout3, memory_space>
const
618 batch_domain_type
const batch_domain(coords_eval.domain());
619 evaluation_domain_type1
const evaluation_domain1(spline_eval.domain());
620 evaluation_domain_type2
const evaluation_domain2(spline_eval.domain());
621 ddc::parallel_for_each(
622 "ddc_splines_differentiate_2d_dim_2",
625 KOKKOS_CLASS_LAMBDA(
typename batch_domain_type::discrete_element_type
const j) {
626 const auto spline_eval_2D = spline_eval[j];
627 const auto coords_eval_2D = coords_eval[j];
628 const auto spline_coef_2D = spline_coef[j];
629 for (
auto const i1 : evaluation_domain1) {
630 for (
auto const i2 : evaluation_domain2) {
631 spline_eval_2D(i1, i2) = eval_no_bc<
633 eval_deriv_type>(coords_eval_2D(i1, i2), spline_coef_2D);
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657 template <
class Layout1,
class Layout2,
class Layout3,
class... CoordsDims>
659 ddc::
ChunkSpan<
double, batched_evaluation_domain_type, Layout1, memory_space>
const
662 ddc::Coordinate<CoordsDims...>
const,
663 batched_evaluation_domain_type,
665 memory_space>
const coords_eval,
666 ddc::
ChunkSpan<
double const, batched_spline_domain_type, Layout3, memory_space>
const
669 batch_domain_type
const batch_domain(coords_eval.domain());
670 evaluation_domain_type1
const evaluation_domain1(spline_eval.domain());
671 evaluation_domain_type2
const evaluation_domain2(spline_eval.domain());
672 ddc::parallel_for_each(
673 "ddc_splines_cross_differentiate",
676 KOKKOS_CLASS_LAMBDA(
typename batch_domain_type::discrete_element_type
const j) {
677 const auto spline_eval_2D = spline_eval[j];
678 const auto coords_eval_2D = coords_eval[j];
679 const auto spline_coef_2D = spline_coef[j];
680 for (
auto const i1 : evaluation_domain1) {
681 for (
auto const i2 : evaluation_domain2) {
682 spline_eval_2D(i1, i2) = eval_no_bc<
684 eval_deriv_type>(coords_eval_2D(i1, i2), spline_coef_2D);
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709 template <
class InterestDim,
class Layout1,
class Layout2,
class Layout3,
class... CoordsDims>
711 ddc::
ChunkSpan<
double, batched_evaluation_domain_type, Layout1, memory_space>
const
714 ddc::Coordinate<CoordsDims...>
const,
715 batched_evaluation_domain_type,
717 memory_space>
const coords_eval,
718 ddc::
ChunkSpan<
double const, batched_spline_domain_type, Layout3, memory_space>
const
724 typename evaluation_discrete_dimension_type1::continuous_dimension_type>
725 || std::is_same_v<InterestDim, continuous_dimension_type2>);
726 if constexpr (std::is_same_v<
728 typename evaluation_discrete_dimension_type1::
729 continuous_dimension_type>) {
730 return deriv_dim_1(spline_eval, coords_eval, spline_coef);
731 }
else if constexpr (std::is_same_v<
733 typename evaluation_discrete_dimension_type2::
734 continuous_dimension_type>) {
735 return deriv_dim_2(spline_eval, coords_eval, spline_coef);
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
770 ddc::
ChunkSpan<
double, batched_evaluation_domain_type, Layout1, memory_space>
const
773 ddc::Coordinate<CoordsDims...>
const,
774 batched_evaluation_domain_type,
776 memory_space>
const coords_eval,
777 ddc::
ChunkSpan<
double const, batched_spline_domain_type, Layout3, memory_space>
const
783 typename evaluation_discrete_dimension_type1::continuous_dimension_type>
784 && std::is_same_v<InterestDim2, continuous_dimension_type2>)
787 typename evaluation_discrete_dimension_type1::continuous_dimension_type>
788 && std::is_same_v<InterestDim1, continuous_dimension_type2>));
789 return deriv_1_and_2(spline_eval, coords_eval, spline_coef);
793
794
795
796
797
798
799
800
801
802
803
804
805 template <
class Layout1,
class Layout2>
807 ddc::
ChunkSpan<
double, batch_domain_type, Layout1, memory_space>
const integrals,
808 ddc::
ChunkSpan<
double const, batched_spline_domain_type, Layout2, memory_space>
const
811 batch_domain_type batch_domain(integrals.domain());
816 ddc::integrals(exec_space(), values1);
821 ddc::integrals(exec_space(), values2);
823 ddc::parallel_for_each(
824 "ddc_splines_integrate_bsplines",
827 KOKKOS_LAMBDA(
typename batch_domain_type::discrete_element_type
const j) {
829 for (
typename spline_domain_type1::discrete_element_type
const i1 :
831 for (
typename spline_domain_type2::discrete_element_type
const i2 :
833 integrals(j) += spline_coef(i1, i2, j) * values1(i1) * values2(i2);
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859 template <
class Layout,
class... CoordsDims>
860 KOKKOS_INLINE_FUNCTION
double eval(
861 ddc::Coordinate<CoordsDims...> coord_eval,
862 ddc::
ChunkSpan<
double const, spline_domain_type, Layout, memory_space>
const
865 using Dim1 = continuous_dimension_type1;
866 using Dim2 = continuous_dimension_type2;
867 if constexpr (bsplines_type1::is_periodic()) {
868 if (
ddc::get<Dim1>(coord_eval) <
ddc::discrete_space<bsplines_type1>().rmin()
869 ||
ddc::get<Dim1>(coord_eval) >
ddc::discrete_space<bsplines_type1>().rmax()) {
870 ddc::get<Dim1>(coord_eval)
872 (
ddc::get<Dim1>(coord_eval)
873 -
ddc::discrete_space<bsplines_type1>().rmin())
874 /
ddc::discrete_space<bsplines_type1>().length())
875 *
ddc::discrete_space<bsplines_type1>().length();
878 if constexpr (bsplines_type2::is_periodic()) {
879 if (
ddc::get<Dim2>(coord_eval) <
ddc::discrete_space<bsplines_type2>().rmin()
880 ||
ddc::get<Dim2>(coord_eval) >
ddc::discrete_space<bsplines_type2>().rmax()) {
881 ddc::get<Dim2>(coord_eval)
883 (
ddc::get<Dim2>(coord_eval)
884 -
ddc::discrete_space<bsplines_type2>().rmin())
885 /
ddc::discrete_space<bsplines_type2>().length())
886 *
ddc::discrete_space<bsplines_type2>().length();
889 if constexpr (!bsplines_type1::is_periodic()) {
890 if (
ddc::get<Dim1>(coord_eval) <
ddc::discrete_space<bsplines_type1>().rmin()) {
891 return m_lower_extrap_rule_1(coord_eval, spline_coef);
893 if (
ddc::get<Dim1>(coord_eval) >
ddc::discrete_space<bsplines_type1>().rmax()) {
894 return m_upper_extrap_rule_1(coord_eval, spline_coef);
897 if constexpr (!bsplines_type2::is_periodic()) {
898 if (
ddc::get<Dim2>(coord_eval) <
ddc::discrete_space<bsplines_type2>().rmin()) {
899 return m_lower_extrap_rule_2(coord_eval, spline_coef);
901 if (
ddc::get<Dim2>(coord_eval) >
ddc::discrete_space<bsplines_type2>().rmax()) {
902 return m_upper_extrap_rule_2(coord_eval, spline_coef);
905 return eval_no_bc<eval_type, eval_type>(
906 ddc::Coordinate<continuous_dimension_type1, continuous_dimension_type2>(
907 ddc::get<Dim1>(coord_eval),
908 ddc::get<Dim2>(coord_eval)),
913
914
915
916
917
918
919
920
921
922
923
924
925
926 template <
class EvalType1,
class EvalType2,
class Layout,
class... CoordsDims>
927 KOKKOS_INLINE_FUNCTION
double eval_no_bc(
928 ddc::Coordinate<CoordsDims...>
const& coord_eval,
929 ddc::
ChunkSpan<
double const, spline_domain_type, Layout, memory_space>
const
933 std::is_same_v<EvalType1, eval_type> || std::is_same_v<EvalType1, eval_deriv_type>);
935 std::is_same_v<EvalType2, eval_type> || std::is_same_v<EvalType2, eval_deriv_type>);
936 ddc::DiscreteElement<bsplines_type1> jmin1;
937 ddc::DiscreteElement<bsplines_type2> jmin2;
939 std::array<
double, bsplines_type1::degree() + 1> vals1_ptr;
940 Kokkos::mdspan<
double, Kokkos::extents<std::size_t, bsplines_type1::degree() + 1>>
const
941 vals1(vals1_ptr.data());
942 std::array<
double, bsplines_type2::degree() + 1> vals2_ptr;
943 Kokkos::mdspan<
double, Kokkos::extents<std::size_t, bsplines_type2::degree() + 1>>
const
944 vals2(vals2_ptr.data());
945 ddc::Coordinate<continuous_dimension_type1>
const coord_eval_interest1
946 =
ddc::select<continuous_dimension_type1>(coord_eval);
947 ddc::Coordinate<continuous_dimension_type2>
const coord_eval_interest2
948 =
ddc::select<continuous_dimension_type2>(coord_eval);
950 if constexpr (std::is_same_v<EvalType1, eval_type>) {
951 jmin1 =
ddc::discrete_space<bsplines_type1>().eval_basis(vals1, coord_eval_interest1);
952 }
else if constexpr (std::is_same_v<EvalType1, eval_deriv_type>) {
953 jmin1 =
ddc::discrete_space<bsplines_type1>().eval_deriv(vals1, coord_eval_interest1);
955 if constexpr (std::is_same_v<EvalType2, eval_type>) {
956 jmin2 =
ddc::discrete_space<bsplines_type2>().eval_basis(vals2, coord_eval_interest2);
957 }
else if constexpr (std::is_same_v<EvalType2, eval_deriv_type>) {
958 jmin2 =
ddc::discrete_space<bsplines_type2>().eval_deriv(vals2, coord_eval_interest2);
962 for (std::size_t i = 0; i < bsplines_type1::degree() + 1; ++i) {
963 for (std::size_t j = 0; j < bsplines_type2::degree() + 1; ++j) {
964 y += spline_coef(
ddc::DiscreteElement<
966 bsplines_type2>(jmin1 + i, jmin2 + j))
967 * vals1[i] * vals2[j];
friend class DiscreteDomain
A class to evaluate, differentiate or integrate a 2D spline function.
void deriv_dim_1(ddc::ChunkSpan< double, batched_evaluation_domain_type, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< ddc::Coordinate< CoordsDims... > const, batched_evaluation_domain_type, Layout2, memory_space > const coords_eval, ddc::ChunkSpan< double const, batched_spline_domain_type, Layout3, memory_space > const spline_coef) const
Differentiate 2D spline function (described by its spline coefficients) on a mesh along first dimensi...
void deriv(ddc::ChunkSpan< double, batched_evaluation_domain_type, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< ddc::Coordinate< CoordsDims... > const, batched_evaluation_domain_type, Layout2, memory_space > const coords_eval, ddc::ChunkSpan< double const, batched_spline_domain_type, Layout3, 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_dim_2(ddc::Coordinate< CoordsDims... > const &coord_eval, ddc::ChunkSpan< double 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 s...
void deriv_dim_2(ddc::ChunkSpan< double, batched_evaluation_domain_type, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< ddc::Coordinate< CoordsDims... > const, batched_evaluation_domain_type, Layout2, memory_space > const coords_eval, ddc::ChunkSpan< double const, batched_spline_domain_type, Layout3, memory_space > const spline_coef) const
Differentiate 2D spline function (described by its spline coefficients) on a mesh along second dimens...
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 2D spline function (described by its spline coefficients) at a given coordinate.
SplineEvaluator2D(SplineEvaluator2D const &x)=default
Copy-constructs.
SplineEvaluator2D & operator=(SplineEvaluator2D const &x)=default
Copy-assigns.
void deriv2(ddc::ChunkSpan< double, batched_evaluation_domain_type, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< ddc::Coordinate< CoordsDims... > const, batched_evaluation_domain_type, Layout2, memory_space > const coords_eval, ddc::ChunkSpan< double const, batched_spline_domain_type, Layout3, memory_space > const spline_coef) const
Double-differentiate 2D spline function (described by its spline coefficients) on a mesh along specif...
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.
void deriv_1_and_2(ddc::ChunkSpan< double, batched_evaluation_domain_type, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< ddc::Coordinate< CoordsDims... > const, batched_evaluation_domain_type, Layout2, memory_space > const coords_eval, ddc::ChunkSpan< double const, batched_spline_domain_type, Layout3, memory_space > const spline_coef) const
Cross-differentiate 2D spline function (described by its spline coefficients) on a mesh along dimensi...
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 2D spline function (described by its spline coefficients) at a given coordinate along a...
~SplineEvaluator2D()=default
Destructs.
upper_extrapolation_rule_2_type upper_extrapolation_rule_dim_2() const
Get the upper extrapolation rule along the second dimension.
lower_extrapolation_rule_2_type lower_extrapolation_rule_dim_2() const
Get the lower extrapolation rule along the second dimension.
upper_extrapolation_rule_1_type upper_extrapolation_rule_dim_1() const
Get the upper extrapolation rule along the first dimension.
void integrate(ddc::ChunkSpan< double, batch_domain_type, Layout1, memory_space > const integrals, ddc::ChunkSpan< double const, batched_spline_domain_type, Layout2, memory_space > const spline_coef) const
Perform batched 2D integrations of a spline function (described by its spline coefficients) along the...
void operator()(ddc::ChunkSpan< double, batched_evaluation_domain_type, Layout1, memory_space > const spline_eval, ddc::ChunkSpan< ddc::Coordinate< CoordsDims... > const, batched_evaluation_domain_type, Layout2, memory_space > const coords_eval, ddc::ChunkSpan< double const, batched_spline_domain_type, Layout3, memory_space > const spline_coef) const
Evaluate 2D spline function (described by its spline coefficients) on a mesh.
SplineEvaluator2D(SplineEvaluator2D &&x)=default
Move-constructs.
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 2D spline function (described by its spline coefficients) at a given coordinate ...
lower_extrapolation_rule_1_type lower_extrapolation_rule_dim_1() const
Get the lower extrapolation rule along the first dimension.
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 2D spline function (described by its spline coefficients) at a given coordinate.
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 2D spline function (described by its spline coefficients) at a given coordinate along f...
SplineEvaluator2D & operator=(SplineEvaluator2D &&x)=default
Move-assigns.
The top-level namespace of DDC.