22
23
24
25
26
27
28
49 using exec_space = ExecSpace;
52 using memory_space = MemorySpace;
55 using builder_type1 =
ddc::
56 SplineBuilder<ExecSpace, MemorySpace, BSpline1, DDimI1, BcLower1, BcUpper1, Solver>;
73 using continuous_dimension_type1 = builder_type1::continuous_dimension_type;
76 using continuous_dimension_type2 = builder_type_2_3::continuous_dimension_type1;
79 using continuous_dimension_type3 = builder_type_2_3::continuous_dimension_type2;
82 using interpolation_discrete_dimension_type1
83 = builder_type1::interpolation_discrete_dimension_type;
86 using interpolation_discrete_dimension_type2
87 = builder_type_2_3::interpolation_discrete_dimension_type1;
90 using interpolation_discrete_dimension_type3
91 = builder_type_2_3::interpolation_discrete_dimension_type2;
94 using bsplines_type1 = builder_type1::bsplines_type;
97 using bsplines_type2 = builder_type_2_3::bsplines_type1;
100 using bsplines_type3 = builder_type_2_3::bsplines_type2;
103 using deriv_type1 = builder_type1::deriv_type;
106 using deriv_type2 = builder_type_2_3::deriv_type1;
109 using deriv_type3 = builder_type_2_3::deriv_type2;
112 using interpolation_domain_type1 = builder_type1::interpolation_discrete_dimension_type;
115 using interpolation_domain_type2 = builder_type_2_3::interpolation_discrete_dimension_type1;
118 using interpolation_domain_type3 = builder_type_2_3::interpolation_discrete_dimension_type2;
122 interpolation_discrete_dimension_type1,
123 interpolation_discrete_dimension_type2,
124 interpolation_discrete_dimension_type3>;
127
128
129
130
131 template <concepts::discrete_domain BatchedInterpolationDDom>
132 using batched_interpolation_domain_type = BatchedInterpolationDDom;
135
136
137
138
139
140
141
142
143 template <concepts::discrete_domain BatchedInterpolationDDom>
144 using batch_domain_type =
ddc::remove_dims_of_t<
145 BatchedInterpolationDDom,
146 interpolation_discrete_dimension_type1,
147 interpolation_discrete_dimension_type2,
148 interpolation_discrete_dimension_type3>;
151
152
153
154
155
156
157
158
159 template <concepts::discrete_domain BatchedInterpolationDDom>
160 using batched_spline_domain_type
161 =
ddc::detail::convert_type_seq_to_discrete_domain_t<
ddc::type_seq_replace_t<
162 ddc::to_type_seq_t<BatchedInterpolationDDom>,
163 ddc::detail::TypeSeq<
164 interpolation_discrete_dimension_type1,
165 interpolation_discrete_dimension_type2,
166 interpolation_discrete_dimension_type3>,
167 ddc::detail::TypeSeq<bsplines_type1, bsplines_type2, bsplines_type3>>>;
170
171
172
173
174
175
176
177
178 template <concepts::discrete_domain BatchedInterpolationDDom>
179 using batched_derivs_domain_type1 =
ddc::replace_dim_of_t<
180 BatchedInterpolationDDom,
181 interpolation_discrete_dimension_type1,
185
186
187
188
189
190
191
192
193 template <concepts::discrete_domain BatchedInterpolationDDom>
194 using batched_derivs_domain_type2 =
ddc::replace_dim_of_t<
195 BatchedInterpolationDDom,
196 interpolation_discrete_dimension_type2,
200
201
202
203
204
205
206
207
208 template <concepts::discrete_domain BatchedInterpolationDDom>
209 using batched_derivs_domain_type3 =
ddc::replace_dim_of_t<
210 BatchedInterpolationDDom,
211 interpolation_discrete_dimension_type3,
215
216
217
218
219
220
221
222
223
224 template <concepts::discrete_domain BatchedInterpolationDDom>
225 using batched_derivs_domain_type1_2 =
ddc::replace_dim_of_t<
226 ddc::replace_dim_of_t<
227 BatchedInterpolationDDom,
228 interpolation_discrete_dimension_type1,
230 interpolation_domain_type2,
234
235
236
237
238
239
240
241
242
243 template <concepts::discrete_domain BatchedInterpolationDDom>
244 using batched_derivs_domain_type2_3 =
ddc::replace_dim_of_t<
245 ddc::replace_dim_of_t<
246 BatchedInterpolationDDom,
247 interpolation_discrete_dimension_type2,
249 interpolation_domain_type3,
253
254
255
256
257
258
259
260
261
262 template <concepts::discrete_domain BatchedInterpolationDDom>
263 using batched_derivs_domain_type1_3 =
ddc::replace_dim_of_t<
264 ddc::replace_dim_of_t<
265 BatchedInterpolationDDom,
266 interpolation_discrete_dimension_type1,
268 interpolation_domain_type3,
272
273
274
275
276
277
278
279
280 template <concepts::discrete_domain BatchedInterpolationDDom>
281 using batched_derivs_domain_type
282 =
ddc::detail::convert_type_seq_to_discrete_domain_t<
ddc::type_seq_replace_t<
283 ddc::to_type_seq_t<BatchedInterpolationDDom>,
284 ddc::detail::TypeSeq<
285 interpolation_discrete_dimension_type1,
286 interpolation_discrete_dimension_type2,
287 interpolation_discrete_dimension_type3>,
288 ddc::detail::TypeSeq<deriv_type1, deriv_type2, deriv_type3>>>;
291 builder_type1 m_spline_builder1;
292 builder_type_2_3 m_spline_builder_2_3;
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
316 interpolation_domain_type
const& interpolation_domain,
317 std::optional<std::size_t> cols_per_chunk = std::nullopt,
318 std::optional<
unsigned int> preconditioner_max_block_size = std::nullopt)
319 : m_spline_builder1(interpolation_domain, cols_per_chunk, preconditioner_max_block_size)
320 , m_spline_builder_2_3(interpolation_domain, cols_per_chunk, preconditioner_max_block_size)
321 , m_label(std::move(label))
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
342 interpolation_domain_type
const& interpolation_domain,
343 std::optional<std::size_t> cols_per_chunk = std::nullopt,
344 std::optional<
unsigned int> preconditioner_max_block_size = std::nullopt)
347 interpolation_domain,
349 preconditioner_max_block_size)
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371 template <
concepts::discrete_domain BatchedInterpolationDDom>
374 BatchedInterpolationDDom
const& batched_interpolation_domain,
375 std::optional<std::size_t> cols_per_chunk = std::nullopt,
376 std::optional<
unsigned int> preconditioner_max_block_size = std::nullopt)
379 interpolation_domain_type(batched_interpolation_domain),
381 preconditioner_max_block_size)
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401 template <
concepts::discrete_domain BatchedInterpolationDDom>
403 BatchedInterpolationDDom
const& batched_interpolation_domain,
404 std::optional<std::size_t> cols_per_chunk = std::nullopt,
405 std::optional<
unsigned int> preconditioner_max_block_size = std::nullopt)
408 interpolation_domain_type(batched_interpolation_domain),
410 preconditioner_max_block_size)
418
419
420
421
431
432
433
434
438
439
440
441
442
443
447 interpolation_domain_type1,
448 interpolation_domain_type2,
449 interpolation_domain_type3>(
450 m_spline_builder1.interpolation_domain(),
451 m_spline_builder_2_3.interpolation_domain());
455
456
457
458
459
460
461
462
463
464 template <
concepts::discrete_domain BatchedInterpolationDDom>
466 BatchedInterpolationDDom
const& batched_interpolation_domain)
const noexcept
469 return batched_interpolation_domain;
473
474
475
476
477
478
479
480
481 template <
concepts::discrete_domain BatchedInterpolationDDom>
482 batch_domain_type<BatchedInterpolationDDom>
batch_domain(
483 BatchedInterpolationDDom
const& batched_interpolation_domain)
const noexcept
490
491
492
493
494
495
500 ddc::discrete_space<bsplines_type1>().full_domain(),
501 ddc::discrete_space<bsplines_type2>().full_domain(),
502 ddc::discrete_space<bsplines_type3>().full_domain());
506
507
508
509
510
511
512
513
514 template <
concepts::discrete_domain BatchedInterpolationDDom>
516 BatchedInterpolationDDom
const& batched_interpolation_domain)
const noexcept
519 return ddc::replace_dim_of<interpolation_discrete_dimension_type1, bsplines_type1>(
520 ddc::replace_dim_of<interpolation_discrete_dimension_type2, bsplines_type2>(
522 interpolation_discrete_dimension_type3,
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596 template <
class Layout,
class BatchedInterpolationDDom>
600 batched_spline_domain_type<BatchedInterpolationDDom>,
602 memory_space> spline,
603 ddc::
ChunkSpan<
double const, BatchedInterpolationDDom, Layout, memory_space> vals,
606 batched_derivs_domain_type1<BatchedInterpolationDDom>,
608 memory_space>> derivs_min1
612 batched_derivs_domain_type1<BatchedInterpolationDDom>,
614 memory_space>> derivs_max1
618 batched_derivs_domain_type2<BatchedInterpolationDDom>,
620 memory_space>> derivs_min2
624 batched_derivs_domain_type2<BatchedInterpolationDDom>,
626 memory_space>> derivs_max2
630 batched_derivs_domain_type3<BatchedInterpolationDDom>,
632 memory_space>> derivs_min3
636 batched_derivs_domain_type3<BatchedInterpolationDDom>,
638 memory_space>> derivs_max3
642 batched_derivs_domain_type1_2<BatchedInterpolationDDom>,
644 memory_space>> mixed_derivs_min1_min2
648 batched_derivs_domain_type1_2<BatchedInterpolationDDom>,
650 memory_space>> mixed_derivs_max1_min2
654 batched_derivs_domain_type1_2<BatchedInterpolationDDom>,
656 memory_space>> mixed_derivs_min1_max2
660 batched_derivs_domain_type1_2<BatchedInterpolationDDom>,
662 memory_space>> mixed_derivs_max1_max2
666 batched_derivs_domain_type2_3<BatchedInterpolationDDom>,
668 memory_space>> mixed_derivs_min2_min3
672 batched_derivs_domain_type2_3<BatchedInterpolationDDom>,
674 memory_space>> mixed_derivs_max2_min3
678 batched_derivs_domain_type2_3<BatchedInterpolationDDom>,
680 memory_space>> mixed_derivs_min2_max3
684 batched_derivs_domain_type2_3<BatchedInterpolationDDom>,
686 memory_space>> mixed_derivs_max2_max3
690 batched_derivs_domain_type1_3<BatchedInterpolationDDom>,
692 memory_space>> mixed_derivs_min1_min3
696 batched_derivs_domain_type1_3<BatchedInterpolationDDom>,
698 memory_space>> mixed_derivs_max1_min3
702 batched_derivs_domain_type1_3<BatchedInterpolationDDom>,
704 memory_space>> mixed_derivs_min1_max3
708 batched_derivs_domain_type1_3<BatchedInterpolationDDom>,
710 memory_space>> mixed_derivs_max1_max3
714 batched_derivs_domain_type<BatchedInterpolationDDom>,
716 memory_space>> mixed_derivs_min1_min2_min3
720 batched_derivs_domain_type<BatchedInterpolationDDom>,
722 memory_space>> mixed_derivs_max1_min2_min3
726 batched_derivs_domain_type<BatchedInterpolationDDom>,
728 memory_space>> mixed_derivs_min1_max2_min3
732 batched_derivs_domain_type<BatchedInterpolationDDom>,
734 memory_space>> mixed_derivs_max1_max2_min3
738 batched_derivs_domain_type<BatchedInterpolationDDom>,
740 memory_space>> mixed_derivs_min1_min2_max3
744 batched_derivs_domain_type<BatchedInterpolationDDom>,
746 memory_space>> mixed_derivs_max1_min2_max3
750 batched_derivs_domain_type<BatchedInterpolationDDom>,
752 memory_space>> mixed_derivs_min1_max2_max3
756 batched_derivs_domain_type<BatchedInterpolationDDom>,
758 memory_space>> mixed_derivs_max1_max2_max3
759 = std::nullopt)
const;
779template <
class Layout,
class BatchedInterpolationDDom>
799 batched_spline_domain_type<BatchedInterpolationDDom>,
801 memory_space> spline,
802 ddc::
ChunkSpan<
double const, BatchedInterpolationDDom, Layout, memory_space> vals,
805 batched_derivs_domain_type1<BatchedInterpolationDDom>,
807 memory_space>> derivs_min1,
810 batched_derivs_domain_type1<BatchedInterpolationDDom>,
812 memory_space>> derivs_max1,
815 batched_derivs_domain_type2<BatchedInterpolationDDom>,
817 memory_space>> derivs_min2,
820 batched_derivs_domain_type2<BatchedInterpolationDDom>,
822 memory_space>> derivs_max2,
825 batched_derivs_domain_type3<BatchedInterpolationDDom>,
827 memory_space>> derivs_min3,
830 batched_derivs_domain_type3<BatchedInterpolationDDom>,
832 memory_space>> derivs_max3,
835 batched_derivs_domain_type1_2<BatchedInterpolationDDom>,
837 memory_space>> mixed_derivs_min1_min2,
840 batched_derivs_domain_type1_2<BatchedInterpolationDDom>,
842 memory_space>> mixed_derivs_max1_min2,
845 batched_derivs_domain_type1_2<BatchedInterpolationDDom>,
847 memory_space>> mixed_derivs_min1_max2,
850 batched_derivs_domain_type1_2<BatchedInterpolationDDom>,
852 memory_space>> mixed_derivs_max1_max2,
855 batched_derivs_domain_type2_3<BatchedInterpolationDDom>,
857 memory_space>> mixed_derivs_min2_min3,
860 batched_derivs_domain_type2_3<BatchedInterpolationDDom>,
862 memory_space>> mixed_derivs_max2_min3,
865 batched_derivs_domain_type2_3<BatchedInterpolationDDom>,
867 memory_space>> mixed_derivs_min2_max3,
870 batched_derivs_domain_type2_3<BatchedInterpolationDDom>,
872 memory_space>> mixed_derivs_max2_max3,
875 batched_derivs_domain_type1_3<BatchedInterpolationDDom>,
877 memory_space>> mixed_derivs_min1_min3,
880 batched_derivs_domain_type1_3<BatchedInterpolationDDom>,
882 memory_space>> mixed_derivs_max1_min3,
885 batched_derivs_domain_type1_3<BatchedInterpolationDDom>,
887 memory_space>> mixed_derivs_min1_max3,
890 batched_derivs_domain_type1_3<BatchedInterpolationDDom>,
892 memory_space>> mixed_derivs_max1_max3,
895 batched_derivs_domain_type<BatchedInterpolationDDom>,
897 memory_space>> mixed_derivs_min1_min2_min3,
900 batched_derivs_domain_type<BatchedInterpolationDDom>,
902 memory_space>> mixed_derivs_max1_min2_min3,
905 batched_derivs_domain_type<BatchedInterpolationDDom>,
907 memory_space>> mixed_derivs_min1_max2_min3,
910 batched_derivs_domain_type<BatchedInterpolationDDom>,
912 memory_space>> mixed_derivs_max1_max2_min3,
915 batched_derivs_domain_type<BatchedInterpolationDDom>,
917 memory_space>> mixed_derivs_min1_min2_max3,
920 batched_derivs_domain_type<BatchedInterpolationDDom>,
922 memory_space>> mixed_derivs_max1_min2_max3,
925 batched_derivs_domain_type<BatchedInterpolationDDom>,
927 memory_space>> mixed_derivs_min1_max2_max3,
930 batched_derivs_domain_type<BatchedInterpolationDDom>,
932 memory_space>> mixed_derivs_max1_max2_max3)
const
934 auto const batched_interpolation_domain = vals.domain();
937 assert(batch_domain_type<BatchedInterpolationDDom>(batched_interpolation_domain)
938 == batch_domain_type<BatchedInterpolationDDom>(spline.domain()));
940 if (batch_domain(batched_interpolation_domain).empty()) {
945 auto const batched_interpolation_deriv_domain2
946 =
ddc::replace_dim_of<interpolation_discrete_dimension_type2, deriv_type2>(
947 batched_interpolation_domain,
949 ddc::DiscreteElement<deriv_type2>(BSpline2::degree() % 2),
952 ddc::
Chunk spline_derivs_min2_alloc(
953 m_label +
" > spline_derivs_min2 (ddc::SplineBuilder3D::operator())",
954 m_spline_builder1.batched_spline_domain(batched_interpolation_deriv_domain2),
956 auto spline_derivs_min2 = spline_derivs_min2_alloc.span_view();
957 auto spline_derivs_min2_opt = std::optional(spline_derivs_min2.span_cview());
962 mixed_derivs_min1_min2,
963 mixed_derivs_max1_min2);
965 spline_derivs_min2_opt = std::nullopt;
968 ddc::
Chunk spline_derivs_max2_alloc(
969 m_label +
" > spline_derivs_max2 (ddc::SplineBuilder3D::operator())",
970 m_spline_builder1.batched_spline_domain(batched_interpolation_deriv_domain2),
972 auto spline_derivs_max2 = spline_derivs_max2_alloc.span_view();
973 auto spline_derivs_max2_opt = std::optional(spline_derivs_max2.span_cview());
978 mixed_derivs_min1_max2,
979 mixed_derivs_max1_max2);
981 spline_derivs_max2_opt = std::nullopt;
985 auto const batched_interpolation_deriv_domain3
986 =
ddc::replace_dim_of<interpolation_discrete_dimension_type3, deriv_type3>(
987 batched_interpolation_domain,
989 ddc::DiscreteElement<deriv_type3>(BSpline3::degree() % 2),
992 ddc::
Chunk spline_derivs_min3_alloc(
993 m_label +
" > spline_derivs_min3 (ddc::SplineBuilder3D::operator())",
994 m_spline_builder1.batched_spline_domain(batched_interpolation_deriv_domain3),
996 auto spline_derivs_min3 = spline_derivs_min3_alloc.span_view();
997 auto spline_derivs_min3_opt = std::optional(spline_derivs_min3.span_cview());
1002 mixed_derivs_min1_min3,
1003 mixed_derivs_max1_min3);
1005 spline_derivs_min3_opt = std::nullopt;
1008 ddc::
Chunk spline_derivs_max3_alloc(
1009 m_label +
" > spline_derivs_max3 (ddc::SplineBuilder3D::operator())",
1010 m_spline_builder1.batched_spline_domain(batched_interpolation_deriv_domain3),
1012 auto spline_derivs_max3 = spline_derivs_max3_alloc.span_view();
1013 auto spline_derivs_max3_opt = std::optional(spline_derivs_max3.span_cview());
1018 mixed_derivs_min1_max3,
1019 mixed_derivs_max1_max3);
1021 spline_derivs_max3_opt = std::nullopt;
1025 auto batched_interpolation_deriv_domain2_3
1026 =
ddc::replace_dim_of<interpolation_discrete_dimension_type3, deriv_type3>(
1027 batched_interpolation_deriv_domain2,
1029 ddc::DiscreteElement<deriv_type3>(BSpline3::degree() % 2),
1032 ddc::
Chunk spline_derivs_min2_min3_alloc(
1033 m_label +
" > spline_derivs_min2_min3 (ddc::SplineBuilder3D::operator())",
1034 m_spline_builder1.batched_spline_domain(batched_interpolation_deriv_domain2_3),
1036 auto spline_derivs_min2_min3 = spline_derivs_min2_min3_alloc.span_view();
1037 auto spline_derivs_min2_min3_opt = std::optional(spline_derivs_min2_min3.span_cview());
1040 spline_derivs_min2_min3,
1041 *mixed_derivs_min2_min3,
1042 mixed_derivs_min1_min2_min3,
1043 mixed_derivs_max1_min2_min3);
1045 spline_derivs_min2_min3_opt = std::nullopt;
1048 ddc::
Chunk spline_derivs_min2_max3_alloc(
1049 m_label +
" > spline_derivs_min2_max3 (ddc::SplineBuilder3D::operator())",
1050 m_spline_builder1.batched_spline_domain(batched_interpolation_deriv_domain2_3),
1052 auto spline_derivs_min2_max3 = spline_derivs_min2_max3_alloc.span_view();
1053 auto spline_derivs_min2_max3_opt = std::optional(spline_derivs_min2_max3.span_cview());
1056 spline_derivs_min2_max3,
1057 *mixed_derivs_min2_max3,
1058 mixed_derivs_min1_min2_max3,
1059 mixed_derivs_max1_min2_max3);
1061 spline_derivs_min2_max3_opt = std::nullopt;
1064 ddc::
Chunk spline_derivs_max2_min3_alloc(
1065 m_label +
" > spline_derivs_max2_min3 (ddc::SplineBuilder3D::operator())",
1066 m_spline_builder1.batched_spline_domain(batched_interpolation_deriv_domain2_3),
1068 auto spline_derivs_max2_min3 = spline_derivs_max2_min3_alloc.span_view();
1069 auto spline_derivs_max2_min3_opt = std::optional(spline_derivs_max2_min3.span_cview());
1072 spline_derivs_max2_min3,
1073 *mixed_derivs_max2_min3,
1074 mixed_derivs_min1_max2_min3,
1075 mixed_derivs_max1_max2_min3);
1077 spline_derivs_max2_min3_opt = std::nullopt;
1080 ddc::
Chunk spline_derivs_max2_max3_alloc(
1081 m_label +
" > spline_derivs_max2_max3 (ddc::SplineBuilder3D::operator())",
1082 m_spline_builder1.batched_spline_domain(batched_interpolation_deriv_domain2_3),
1084 auto spline_derivs_max2_max3 = spline_derivs_max2_max3_alloc.span_view();
1085 auto spline_derivs_max2_max3_opt = std::optional(spline_derivs_max2_max3.span_cview());
1088 spline_derivs_max2_max3,
1089 *mixed_derivs_max2_max3,
1090 mixed_derivs_min1_max2_max3,
1091 mixed_derivs_max1_max2_max3);
1093 spline_derivs_max2_max3_opt = std::nullopt;
1098 m_label +
" > spline1 (ddc::SplineBuilder3D::operator())",
1099 m_spline_builder1.batched_spline_domain(batched_interpolation_domain),
1101 ddc::
ChunkSpan const spline1 = spline1_alloc.span_view();
1103 m_spline_builder1(spline1, vals, derivs_min1, derivs_max1);
1105 m_spline_builder_2_3(
1107 spline1.span_cview(),
1108 spline_derivs_min2_opt,
1109 spline_derivs_max2_opt,
1110 spline_derivs_min3_opt,
1111 spline_derivs_max3_opt,
1112 spline_derivs_min2_min3_opt,
1113 spline_derivs_max2_min3_opt,
1114 spline_derivs_min2_max3_opt,
1115 spline_derivs_max2_max3_opt);
friend class DiscreteDomain
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.
void operator()(ddc::ChunkSpan< double, batched_spline_domain_type< BatchedInterpolationDDom >, Layout, memory_space > spline, ddc::ChunkSpan< double const, BatchedInterpolationDDom, Layout, memory_space > vals, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type1< BatchedInterpolationDDom >, Layout, memory_space > > derivs_min1=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type1< BatchedInterpolationDDom >, Layout, memory_space > > derivs_max1=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type2< BatchedInterpolationDDom >, Layout, memory_space > > derivs_min2=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type2< BatchedInterpolationDDom >, Layout, memory_space > > derivs_max2=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_min1_min2=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_max1_min2=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_min1_max2=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_max1_max2=std::nullopt) const
Compute a 2D spline approximation of a function.
BatchedInterpolationDDom batched_interpolation_domain(BatchedInterpolationDDom const &batched_interpolation_domain) const noexcept
Get the whole domain representing interpolation points.
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.
ddc::DiscreteDomain< bsplines_type1, bsplines_type2 > spline_domain() const noexcept
Get the 2D domain on which spline coefficients are defined.
SplineBuilder2D(SplineBuilder2D &&x)=default
Move-constructs.
SplineBuilder2D & operator=(SplineBuilder2D &&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.
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.
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.
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(SplineBuilder2D const &x)=delete
Copy-constructor is deleted.
interpolation_domain_type interpolation_domain() const noexcept
Get the domain for the 2D interpolation mesh used by this class.
batch_domain_type< BatchedInterpolationDDom > batch_domain(BatchedInterpolationDDom const &batched_interpolation_domain) const noexcept
Get the batch domain.
SplineBuilder2D & operator=(SplineBuilder2D const &x)=delete
Copy-assignment is deleted.
A class for creating a 3D spline approximation of a function.
SplineBuilder3D(SplineBuilder3D const &x)=delete
Copy-constructor is deleted.
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.
void operator()(ddc::ChunkSpan< double, batched_spline_domain_type< BatchedInterpolationDDom >, Layout, memory_space > spline, ddc::ChunkSpan< double const, BatchedInterpolationDDom, Layout, memory_space > vals, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type1< BatchedInterpolationDDom >, Layout, memory_space > > derivs_min1=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type1< BatchedInterpolationDDom >, Layout, memory_space > > derivs_max1=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type2< BatchedInterpolationDDom >, Layout, memory_space > > derivs_min2=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type2< BatchedInterpolationDDom >, Layout, memory_space > > derivs_max2=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type3< BatchedInterpolationDDom >, Layout, memory_space > > derivs_min3=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type3< BatchedInterpolationDDom >, Layout, memory_space > > derivs_max3=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type1_2< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_min1_min2=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type1_2< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_max1_min2=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type1_2< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_min1_max2=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type1_2< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_max1_max2=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type2_3< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_min2_min3=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type2_3< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_max2_min3=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type2_3< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_min2_max3=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type2_3< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_max2_max3=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type1_3< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_min1_min3=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type1_3< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_max1_min3=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type1_3< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_min1_max3=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type1_3< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_max1_max3=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_min1_min2_min3=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_max1_min2_min3=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_min1_max2_min3=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_max1_max2_min3=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_min1_min2_max3=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_max1_min2_max3=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type< BatchedInterpolationDDom >, Layout, memory_space > > mixed_derivs_min1_max2_max3=std::nullopt, std::optional< ddc::ChunkSpan< double 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.
BatchedInterpolationDDom batched_interpolation_domain(BatchedInterpolationDDom const &batched_interpolation_domain) const noexcept
Get the whole domain representing interpolation points.
~SplineBuilder3D()=default
Destructs.
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.
ddc::DiscreteDomain< bsplines_type1, bsplines_type2, bsplines_type3 > spline_domain() const noexcept
Get the 3D domain on which spline coefficients are defined.
interpolation_domain_type interpolation_domain() const noexcept
Get the domain for the 3D interpolation mesh used by this class.
SplineBuilder3D & operator=(SplineBuilder3D const &x)=delete
Copy-assignment is deleted.
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(SplineBuilder3D &&x)=default
Move-constructs.
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.
batch_domain_type< BatchedInterpolationDDom > batch_domain(BatchedInterpolationDDom const &batched_interpolation_domain) const noexcept
Get the batch domain.
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.
A class for creating a spline approximation of a function.
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 SplineSolver s_spline_solver
The SplineSolver giving the backend used to perform the spline approximation.
batch_domain_type< BatchedInterpolationDDom > batch_domain(BatchedInterpolationDDom const &batched_interpolation_domain) const noexcept
Get the batch domain.
std::tuple< ddc::Chunk< double, ddc::DiscreteDomain< ddc::Deriv< typename InterpolationDDim::continuous_dimension_type > >, ddc::KokkosAllocator< double, OutMemorySpace > >, ddc::Chunk< double, ddc::DiscreteDomain< InterpolationDDim >, ddc::KokkosAllocator< double, OutMemorySpace > >, ddc::Chunk< double, ddc::DiscreteDomain< ddc::Deriv< typename InterpolationDDim::continuous_dimension_type > >, ddc::KokkosAllocator< double, OutMemorySpace > > > quadrature_coefficients() const
Compute the quadrature coefficients associated to the b-splines used by this SplineBuilder.
SplineBuilder & operator=(SplineBuilder const &x)=delete
Copy-assignment is deleted.
SplineBuilder(SplineBuilder &&x)=default
Move-constructs.
static constexpr int s_nbe_xmax
The number of equations defining the boundary condition at the upper bound.
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 ddc::BoundCond s_bc_xmin
The boundary condition implemented at the lower bound.
BatchedInterpolationDDom batched_interpolation_domain(BatchedInterpolationDDom const &batched_interpolation_domain) const noexcept
Get the whole domain representing interpolation points.
SplineBuilder & operator=(SplineBuilder &&x)=default
Move-assigns.
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.
SplineBuilder(SplineBuilder const &x)=delete
Copy-constructor is deleted.
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.
static constexpr int s_nbv_xmax
The number of input values defining the boundary condition at the upper bound.
static constexpr bool s_odd
Indicates if the degree of the splines is odd or even.
static constexpr int s_nbv_xmin
The number of input values defining the boundary condition at the lower bound.
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.
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_xmin_domain(BatchedInterpolationDDom const &batched_interpolation_domain) const noexcept
Get the whole domain on which derivatives on lower boundary are defined.
static constexpr ddc::BoundCond s_bc_xmax
The boundary condition implemented at the upper bound.
void operator()(ddc::ChunkSpan< double, batched_spline_domain_type< BatchedInterpolationDDom >, Layout, memory_space > spline, ddc::ChunkSpan< double const, BatchedInterpolationDDom, Layout, memory_space > vals, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type< BatchedInterpolationDDom >, Layout, memory_space > > derivs_xmin=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type< BatchedInterpolationDDom >, Layout, memory_space > > derivs_xmax=std::nullopt) const
Compute a spline approximation of a function.
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_type > spline_domain() const noexcept
Get the 1D domain on which spline coefficients are defined.
~SplineBuilder()=default
Destructs.
static constexpr int s_nbe_xmin
The number of equations defining the boundary condition at the lower bound.
The top-level namespace of DDC.
constexpr int n_boundary_equations(ddc::BoundCond const bc, std::size_t const degree)
Return the number of equations needed to describe a given boundary condition.
constexpr bool is_uniform_bsplines_v
Indicates if a tag corresponds to uniform B-splines or not.
BoundCond
An enum representing a spline boundary condition.
@ HOMOGENEOUS_HERMITE
Homogeneous Hermite boundary condition (derivatives are 0)
@ GREVILLE
Use Greville points instead of conditions on derivative for B-Spline interpolation.
@ HERMITE
Hermite boundary condition.
@ PERIODIC
Periodic boundary condition u(1)=u(n)
ddc::ChunkSpan< double, ddc::DiscreteDomain< DDim >, Layout, MemorySpace > integrals(ExecSpace const &execution_space, ddc::ChunkSpan< double, ddc::DiscreteDomain< DDim >, Layout, MemorySpace > int_vals)
Compute the integrals of the B-splines.
SplineSolver
An enum determining the backend solver of a SplineBuilder or SplineBuilder2d.
@ LAPACK
Enum member to identify the LAPACK-based solver (direct method)
@ GINKGO
Enum member to identify the Ginkgo-based solver (iterative method)
constexpr bool is_non_uniform_bsplines_v
Indicates if a tag corresponds to non-uniform B-splines or not.
A templated struct representing a discrete dimension storing the derivatives of a function along a co...
If the type DDim is a B-spline, defines type to the discrete dimension of the associated knots.