20
21
22
23
24
25
26
47 using exec_space = ExecSpace;
50 using memory_space = MemorySpace;
53 using builder_type1 =
ddc::
54 SplineBuilder<ExecSpace, MemorySpace, BSpline1, DDimI1, BcLower1, BcUpper1, Solver>;
71 using continuous_dimension_type1 =
typename builder_type1::continuous_dimension_type;
74 using continuous_dimension_type2 =
typename builder_type_2_3::continuous_dimension_type1;
77 using continuous_dimension_type3 =
typename builder_type_2_3::continuous_dimension_type2;
80 using interpolation_discrete_dimension_type1 =
81 typename builder_type1::interpolation_discrete_dimension_type;
84 using interpolation_discrete_dimension_type2 =
85 typename builder_type_2_3::interpolation_discrete_dimension_type1;
88 using interpolation_discrete_dimension_type3 =
89 typename builder_type_2_3::interpolation_discrete_dimension_type2;
92 using bsplines_type1 =
typename builder_type1::bsplines_type;
95 using bsplines_type2 =
typename builder_type_2_3::bsplines_type1;
98 using bsplines_type3 =
typename builder_type_2_3::bsplines_type2;
101 using deriv_type1 =
typename builder_type1::deriv_type;
104 using deriv_type2 =
typename builder_type_2_3::deriv_type1;
107 using deriv_type3 =
typename builder_type_2_3::deriv_type2;
110 using interpolation_domain_type1 =
111 typename builder_type1::interpolation_discrete_dimension_type;
114 using interpolation_domain_type2 =
115 typename builder_type_2_3::interpolation_discrete_dimension_type1;
118 using interpolation_domain_type3 =
119 typename builder_type_2_3::interpolation_discrete_dimension_type2;
123 interpolation_discrete_dimension_type1,
124 interpolation_discrete_dimension_type2,
125 interpolation_discrete_dimension_type3>;
128
129
130
131
132 template <concepts::discrete_domain BatchedInterpolationDDom>
133 using batched_interpolation_domain_type = BatchedInterpolationDDom;
136
137
138
139
140
141
142
143
144 template <concepts::discrete_domain BatchedInterpolationDDom>
145 using batch_domain_type =
ddc::remove_dims_of_t<
146 BatchedInterpolationDDom,
147 interpolation_discrete_dimension_type1,
148 interpolation_discrete_dimension_type2,
149 interpolation_discrete_dimension_type3>;
152
153
154
155
156
157
158
159
160 template <concepts::discrete_domain BatchedInterpolationDDom>
161 using batched_spline_domain_type
162 =
ddc::detail::convert_type_seq_to_discrete_domain_t<
ddc::type_seq_replace_t<
163 ddc::to_type_seq_t<BatchedInterpolationDDom>,
164 ddc::detail::TypeSeq<
165 interpolation_discrete_dimension_type1,
166 interpolation_discrete_dimension_type2,
167 interpolation_discrete_dimension_type3>,
168 ddc::detail::TypeSeq<bsplines_type1, bsplines_type2, bsplines_type3>>>;
171
172
173
174
175
176
177
178
179 template <concepts::discrete_domain BatchedInterpolationDDom>
180 using batched_derivs_domain_type1 =
ddc::replace_dim_of_t<
181 BatchedInterpolationDDom,
182 interpolation_discrete_dimension_type1,
186
187
188
189
190
191
192
193
194 template <concepts::discrete_domain BatchedInterpolationDDom>
195 using batched_derivs_domain_type2 =
ddc::replace_dim_of_t<
196 BatchedInterpolationDDom,
197 interpolation_discrete_dimension_type2,
201
202
203
204
205
206
207
208
209 template <concepts::discrete_domain BatchedInterpolationDDom>
210 using batched_derivs_domain_type3 =
ddc::replace_dim_of_t<
211 BatchedInterpolationDDom,
212 interpolation_discrete_dimension_type3,
216
217
218
219
220
221
222
223
224
225 template <concepts::discrete_domain BatchedInterpolationDDom>
226 using batched_derivs_domain_type1_2 =
ddc::replace_dim_of_t<
227 ddc::replace_dim_of_t<
228 BatchedInterpolationDDom,
229 interpolation_discrete_dimension_type1,
231 interpolation_domain_type2,
235
236
237
238
239
240
241
242
243
244 template <concepts::discrete_domain BatchedInterpolationDDom>
245 using batched_derivs_domain_type2_3 =
ddc::replace_dim_of_t<
246 ddc::replace_dim_of_t<
247 BatchedInterpolationDDom,
248 interpolation_discrete_dimension_type2,
250 interpolation_domain_type3,
254
255
256
257
258
259
260
261
262
263 template <concepts::discrete_domain BatchedInterpolationDDom>
264 using batched_derivs_domain_type1_3 =
ddc::replace_dim_of_t<
265 ddc::replace_dim_of_t<
266 BatchedInterpolationDDom,
267 interpolation_discrete_dimension_type1,
269 interpolation_domain_type3,
273
274
275
276
277
278
279
280
281 template <concepts::discrete_domain BatchedInterpolationDDom>
282 using batched_derivs_domain_type
283 =
ddc::detail::convert_type_seq_to_discrete_domain_t<
ddc::type_seq_replace_t<
284 ddc::to_type_seq_t<BatchedInterpolationDDom>,
285 ddc::detail::TypeSeq<
286 interpolation_discrete_dimension_type1,
287 interpolation_discrete_dimension_type2,
288 interpolation_discrete_dimension_type3>,
289 ddc::detail::TypeSeq<deriv_type1, deriv_type2, deriv_type3>>>;
292 builder_type1 m_spline_builder1;
293 builder_type_2_3 m_spline_builder_2_3;
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
313 interpolation_domain_type
const& interpolation_domain,
314 std::optional<std::size_t> cols_per_chunk = std::nullopt,
315 std::optional<
unsigned int> preconditioner_max_block_size = std::nullopt)
316 : m_spline_builder1(interpolation_domain, cols_per_chunk, preconditioner_max_block_size)
317 , m_spline_builder_2_3(interpolation_domain, cols_per_chunk, preconditioner_max_block_size)
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337 template <
concepts::discrete_domain BatchedInterpolationDDom>
339 BatchedInterpolationDDom
const& batched_interpolation_domain,
340 std::optional<std::size_t> cols_per_chunk = std::nullopt,
341 std::optional<
unsigned int> preconditioner_max_block_size = std::nullopt)
343 interpolation_domain_type(batched_interpolation_domain),
345 preconditioner_max_block_size)
353
354
355
356
366
367
368
369
373
374
375
376
377
378
382 interpolation_domain_type1,
383 interpolation_domain_type2,
384 interpolation_domain_type3>(
385 m_spline_builder1.interpolation_domain(),
386 m_spline_builder_2_3.interpolation_domain());
390
391
392
393
394
395
396
397
398
399 template <
concepts::discrete_domain BatchedInterpolationDDom>
401 BatchedInterpolationDDom
const& batched_interpolation_domain)
const noexcept
404 return batched_interpolation_domain;
408
409
410
411
412
413
414
415
416 template <
concepts::discrete_domain BatchedInterpolationDDom>
417 batch_domain_type<BatchedInterpolationDDom>
batch_domain(
418 BatchedInterpolationDDom
const& batched_interpolation_domain)
const noexcept
425
426
427
428
429
430
435 ddc::discrete_space<bsplines_type1>().full_domain(),
436 ddc::discrete_space<bsplines_type2>().full_domain(),
437 ddc::discrete_space<bsplines_type3>().full_domain());
441
442
443
444
445
446
447
448
449 template <
concepts::discrete_domain BatchedInterpolationDDom>
451 BatchedInterpolationDDom
const& batched_interpolation_domain)
const noexcept
454 return ddc::replace_dim_of<interpolation_discrete_dimension_type1, bsplines_type1>(
455 ddc::replace_dim_of<interpolation_discrete_dimension_type2, bsplines_type2>(
457 interpolation_discrete_dimension_type3,
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531 template <
class Layout,
class BatchedInterpolationDDom>
535 batched_spline_domain_type<BatchedInterpolationDDom>,
537 memory_space> spline,
538 ddc::
ChunkSpan<
double const, BatchedInterpolationDDom, Layout, memory_space> vals,
541 batched_derivs_domain_type1<BatchedInterpolationDDom>,
543 memory_space>> derivs_min1
547 batched_derivs_domain_type1<BatchedInterpolationDDom>,
549 memory_space>> derivs_max1
553 batched_derivs_domain_type2<BatchedInterpolationDDom>,
555 memory_space>> derivs_min2
559 batched_derivs_domain_type2<BatchedInterpolationDDom>,
561 memory_space>> derivs_max2
565 batched_derivs_domain_type3<BatchedInterpolationDDom>,
567 memory_space>> derivs_min3
571 batched_derivs_domain_type3<BatchedInterpolationDDom>,
573 memory_space>> derivs_max3
577 batched_derivs_domain_type1_2<BatchedInterpolationDDom>,
579 memory_space>> mixed_derivs_min1_min2
583 batched_derivs_domain_type1_2<BatchedInterpolationDDom>,
585 memory_space>> mixed_derivs_max1_min2
589 batched_derivs_domain_type1_2<BatchedInterpolationDDom>,
591 memory_space>> mixed_derivs_min1_max2
595 batched_derivs_domain_type1_2<BatchedInterpolationDDom>,
597 memory_space>> mixed_derivs_max1_max2
601 batched_derivs_domain_type2_3<BatchedInterpolationDDom>,
603 memory_space>> mixed_derivs_min2_min3
607 batched_derivs_domain_type2_3<BatchedInterpolationDDom>,
609 memory_space>> mixed_derivs_max2_min3
613 batched_derivs_domain_type2_3<BatchedInterpolationDDom>,
615 memory_space>> mixed_derivs_min2_max3
619 batched_derivs_domain_type2_3<BatchedInterpolationDDom>,
621 memory_space>> mixed_derivs_max2_max3
625 batched_derivs_domain_type1_3<BatchedInterpolationDDom>,
627 memory_space>> mixed_derivs_min1_min3
631 batched_derivs_domain_type1_3<BatchedInterpolationDDom>,
633 memory_space>> mixed_derivs_max1_min3
637 batched_derivs_domain_type1_3<BatchedInterpolationDDom>,
639 memory_space>> mixed_derivs_min1_max3
643 batched_derivs_domain_type1_3<BatchedInterpolationDDom>,
645 memory_space>> mixed_derivs_max1_max3
649 batched_derivs_domain_type<BatchedInterpolationDDom>,
651 memory_space>> mixed_derivs_min1_min2_min3
655 batched_derivs_domain_type<BatchedInterpolationDDom>,
657 memory_space>> mixed_derivs_max1_min2_min3
661 batched_derivs_domain_type<BatchedInterpolationDDom>,
663 memory_space>> mixed_derivs_min1_max2_min3
667 batched_derivs_domain_type<BatchedInterpolationDDom>,
669 memory_space>> mixed_derivs_max1_max2_min3
673 batched_derivs_domain_type<BatchedInterpolationDDom>,
675 memory_space>> mixed_derivs_min1_min2_max3
679 batched_derivs_domain_type<BatchedInterpolationDDom>,
681 memory_space>> mixed_derivs_max1_min2_max3
685 batched_derivs_domain_type<BatchedInterpolationDDom>,
687 memory_space>> mixed_derivs_min1_max2_max3
691 batched_derivs_domain_type<BatchedInterpolationDDom>,
693 memory_space>> mixed_derivs_max1_max2_max3
694 = std::nullopt)
const;
714template <
class Layout,
class BatchedInterpolationDDom>
734 batched_spline_domain_type<BatchedInterpolationDDom>,
736 memory_space> spline,
737 ddc::
ChunkSpan<
double const, BatchedInterpolationDDom, Layout, memory_space> vals,
740 batched_derivs_domain_type1<BatchedInterpolationDDom>,
742 memory_space>> derivs_min1,
745 batched_derivs_domain_type1<BatchedInterpolationDDom>,
747 memory_space>> derivs_max1,
750 batched_derivs_domain_type2<BatchedInterpolationDDom>,
752 memory_space>> derivs_min2,
755 batched_derivs_domain_type2<BatchedInterpolationDDom>,
757 memory_space>> derivs_max2,
760 batched_derivs_domain_type3<BatchedInterpolationDDom>,
762 memory_space>> derivs_min3,
765 batched_derivs_domain_type3<BatchedInterpolationDDom>,
767 memory_space>> derivs_max3,
770 batched_derivs_domain_type1_2<BatchedInterpolationDDom>,
772 memory_space>> mixed_derivs_min1_min2,
775 batched_derivs_domain_type1_2<BatchedInterpolationDDom>,
777 memory_space>> mixed_derivs_max1_min2,
780 batched_derivs_domain_type1_2<BatchedInterpolationDDom>,
782 memory_space>> mixed_derivs_min1_max2,
785 batched_derivs_domain_type1_2<BatchedInterpolationDDom>,
787 memory_space>> mixed_derivs_max1_max2,
790 batched_derivs_domain_type2_3<BatchedInterpolationDDom>,
792 memory_space>> mixed_derivs_min2_min3,
795 batched_derivs_domain_type2_3<BatchedInterpolationDDom>,
797 memory_space>> mixed_derivs_max2_min3,
800 batched_derivs_domain_type2_3<BatchedInterpolationDDom>,
802 memory_space>> mixed_derivs_min2_max3,
805 batched_derivs_domain_type2_3<BatchedInterpolationDDom>,
807 memory_space>> mixed_derivs_max2_max3,
810 batched_derivs_domain_type1_3<BatchedInterpolationDDom>,
812 memory_space>> mixed_derivs_min1_min3,
815 batched_derivs_domain_type1_3<BatchedInterpolationDDom>,
817 memory_space>> mixed_derivs_max1_min3,
820 batched_derivs_domain_type1_3<BatchedInterpolationDDom>,
822 memory_space>> mixed_derivs_min1_max3,
825 batched_derivs_domain_type1_3<BatchedInterpolationDDom>,
827 memory_space>> mixed_derivs_max1_max3,
830 batched_derivs_domain_type<BatchedInterpolationDDom>,
832 memory_space>> mixed_derivs_min1_min2_min3,
835 batched_derivs_domain_type<BatchedInterpolationDDom>,
837 memory_space>> mixed_derivs_max1_min2_min3,
840 batched_derivs_domain_type<BatchedInterpolationDDom>,
842 memory_space>> mixed_derivs_min1_max2_min3,
845 batched_derivs_domain_type<BatchedInterpolationDDom>,
847 memory_space>> mixed_derivs_max1_max2_min3,
850 batched_derivs_domain_type<BatchedInterpolationDDom>,
852 memory_space>> mixed_derivs_min1_min2_max3,
855 batched_derivs_domain_type<BatchedInterpolationDDom>,
857 memory_space>> mixed_derivs_max1_min2_max3,
860 batched_derivs_domain_type<BatchedInterpolationDDom>,
862 memory_space>> mixed_derivs_min1_max2_max3,
865 batched_derivs_domain_type<BatchedInterpolationDDom>,
867 memory_space>> mixed_derivs_max1_max2_max3)
const
869 auto const batched_interpolation_domain = vals.domain();
872 assert(batch_domain_type<BatchedInterpolationDDom>(batched_interpolation_domain)
873 == batch_domain_type<BatchedInterpolationDDom>(spline.domain()));
875 if (batch_domain(batched_interpolation_domain).empty()) {
880 auto const batched_interpolation_deriv_domain2
881 =
ddc::replace_dim_of<interpolation_discrete_dimension_type2, deriv_type2>(
882 batched_interpolation_domain,
884 ddc::DiscreteElement<deriv_type2>(BSpline2::degree() % 2),
887 ddc::
Chunk spline_derivs_min2_alloc(
888 m_spline_builder1.batched_spline_domain(batched_interpolation_deriv_domain2),
890 auto spline_derivs_min2 = spline_derivs_min2_alloc.span_view();
891 auto spline_derivs_min2_opt = std::optional(spline_derivs_min2.span_cview());
896 mixed_derivs_min1_min2,
897 mixed_derivs_max1_min2);
899 spline_derivs_min2_opt = std::nullopt;
902 ddc::
Chunk spline_derivs_max2_alloc(
903 m_spline_builder1.batched_spline_domain(batched_interpolation_deriv_domain2),
905 auto spline_derivs_max2 = spline_derivs_max2_alloc.span_view();
906 auto spline_derivs_max2_opt = std::optional(spline_derivs_max2.span_cview());
911 mixed_derivs_min1_max2,
912 mixed_derivs_max1_max2);
914 spline_derivs_max2_opt = std::nullopt;
918 auto const batched_interpolation_deriv_domain3
919 =
ddc::replace_dim_of<interpolation_discrete_dimension_type3, deriv_type3>(
920 batched_interpolation_domain,
922 ddc::DiscreteElement<deriv_type3>(BSpline3::degree() % 2),
925 ddc::
Chunk spline_derivs_min3_alloc(
926 m_spline_builder1.batched_spline_domain(batched_interpolation_deriv_domain3),
928 auto spline_derivs_min3 = spline_derivs_min3_alloc.span_view();
929 auto spline_derivs_min3_opt = std::optional(spline_derivs_min3.span_cview());
934 mixed_derivs_min1_min3,
935 mixed_derivs_max1_min3);
937 spline_derivs_min3_opt = std::nullopt;
940 ddc::
Chunk spline_derivs_max3_alloc(
941 m_spline_builder1.batched_spline_domain(batched_interpolation_deriv_domain3),
943 auto spline_derivs_max3 = spline_derivs_max3_alloc.span_view();
944 auto spline_derivs_max3_opt = std::optional(spline_derivs_max3.span_cview());
949 mixed_derivs_min1_max3,
950 mixed_derivs_max1_max3);
952 spline_derivs_max3_opt = std::nullopt;
956 auto batched_interpolation_deriv_domain2_3
957 =
ddc::replace_dim_of<interpolation_discrete_dimension_type3, deriv_type3>(
958 batched_interpolation_deriv_domain2,
960 ddc::DiscreteElement<deriv_type3>(BSpline3::degree() % 2),
963 ddc::
Chunk spline_derivs_min2_min3_alloc(
964 m_spline_builder1.batched_spline_domain(batched_interpolation_deriv_domain2_3),
966 auto spline_derivs_min2_min3 = spline_derivs_min2_min3_alloc.span_view();
967 auto spline_derivs_min2_min3_opt = std::optional(spline_derivs_min2_min3.span_cview());
970 spline_derivs_min2_min3,
971 *mixed_derivs_min2_min3,
972 mixed_derivs_min1_min2_min3,
973 mixed_derivs_max1_min2_min3);
975 spline_derivs_min2_min3_opt = std::nullopt;
978 ddc::
Chunk spline_derivs_min2_max3_alloc(
979 m_spline_builder1.batched_spline_domain(batched_interpolation_deriv_domain2_3),
981 auto spline_derivs_min2_max3 = spline_derivs_min2_max3_alloc.span_view();
982 auto spline_derivs_min2_max3_opt = std::optional(spline_derivs_min2_max3.span_cview());
985 spline_derivs_min2_max3,
986 *mixed_derivs_min2_max3,
987 mixed_derivs_min1_min2_max3,
988 mixed_derivs_max1_min2_max3);
990 spline_derivs_min2_max3_opt = std::nullopt;
993 ddc::
Chunk spline_derivs_max2_min3_alloc(
994 m_spline_builder1.batched_spline_domain(batched_interpolation_deriv_domain2_3),
996 auto spline_derivs_max2_min3 = spline_derivs_max2_min3_alloc.span_view();
997 auto spline_derivs_max2_min3_opt = std::optional(spline_derivs_max2_min3.span_cview());
1000 spline_derivs_max2_min3,
1001 *mixed_derivs_max2_min3,
1002 mixed_derivs_min1_max2_min3,
1003 mixed_derivs_max1_max2_min3);
1005 spline_derivs_max2_min3_opt = std::nullopt;
1008 ddc::
Chunk spline_derivs_max2_max3_alloc(
1009 m_spline_builder1.batched_spline_domain(batched_interpolation_deriv_domain2_3),
1011 auto spline_derivs_max2_max3 = spline_derivs_max2_max3_alloc.span_view();
1012 auto spline_derivs_max2_max3_opt = std::optional(spline_derivs_max2_max3.span_cview());
1015 spline_derivs_max2_max3,
1016 *mixed_derivs_max2_max3,
1017 mixed_derivs_min1_max2_max3,
1018 mixed_derivs_max1_max2_max3);
1020 spline_derivs_max2_max3_opt = std::nullopt;
1025 m_spline_builder1.batched_spline_domain(batched_interpolation_domain),
1027 ddc::
ChunkSpan const spline1 = spline1_alloc.span_view();
1029 m_spline_builder1(spline1, vals, derivs_min1, derivs_max1);
1031 m_spline_builder_2_3(
1033 spline1.span_cview(),
1034 spline_derivs_min2_opt,
1035 spline_derivs_max2_opt,
1036 spline_derivs_min3_opt,
1037 spline_derivs_max3_opt,
1038 spline_derivs_min2_min3_opt,
1039 spline_derivs_max2_min3_opt,
1040 spline_derivs_min2_max3_opt,
1041 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.
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(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.
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 & 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(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.
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.