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 = builder_type1::continuous_dimension_type;
74 using continuous_dimension_type2 = builder_type_2_3::continuous_dimension_type1;
77 using continuous_dimension_type3 = builder_type_2_3::continuous_dimension_type2;
80 using interpolation_discrete_dimension_type1
81 = builder_type1::interpolation_discrete_dimension_type;
84 using interpolation_discrete_dimension_type2
85 = builder_type_2_3::interpolation_discrete_dimension_type1;
88 using interpolation_discrete_dimension_type3
89 = builder_type_2_3::interpolation_discrete_dimension_type2;
92 using bsplines_type1 = builder_type1::bsplines_type;
95 using bsplines_type2 = builder_type_2_3::bsplines_type1;
98 using bsplines_type3 = builder_type_2_3::bsplines_type2;
101 using deriv_type1 = builder_type1::deriv_type;
104 using deriv_type2 = builder_type_2_3::deriv_type1;
107 using deriv_type3 = builder_type_2_3::deriv_type2;
110 using interpolation_domain_type1 = builder_type1::interpolation_discrete_dimension_type;
113 using interpolation_domain_type2 = builder_type_2_3::interpolation_discrete_dimension_type1;
116 using interpolation_domain_type3 = builder_type_2_3::interpolation_discrete_dimension_type2;
120 interpolation_discrete_dimension_type1,
121 interpolation_discrete_dimension_type2,
122 interpolation_discrete_dimension_type3>;
125
126
127
128
129 template <concepts::discrete_domain BatchedInterpolationDDom>
130 using batched_interpolation_domain_type = BatchedInterpolationDDom;
133
134
135
136
137
138
139
140
141 template <concepts::discrete_domain BatchedInterpolationDDom>
142 using batch_domain_type =
ddc::remove_dims_of_t<
143 BatchedInterpolationDDom,
144 interpolation_discrete_dimension_type1,
145 interpolation_discrete_dimension_type2,
146 interpolation_discrete_dimension_type3>;
149
150
151
152
153
154
155
156
157 template <concepts::discrete_domain BatchedInterpolationDDom>
158 using batched_spline_domain_type
159 =
ddc::detail::convert_type_seq_to_discrete_domain_t<
ddc::type_seq_replace_t<
160 ddc::to_type_seq_t<BatchedInterpolationDDom>,
161 ddc::detail::TypeSeq<
162 interpolation_discrete_dimension_type1,
163 interpolation_discrete_dimension_type2,
164 interpolation_discrete_dimension_type3>,
165 ddc::detail::TypeSeq<bsplines_type1, bsplines_type2, bsplines_type3>>>;
168
169
170
171
172
173
174
175
176 template <concepts::discrete_domain BatchedInterpolationDDom>
177 using batched_derivs_domain_type1 =
ddc::replace_dim_of_t<
178 BatchedInterpolationDDom,
179 interpolation_discrete_dimension_type1,
183
184
185
186
187
188
189
190
191 template <concepts::discrete_domain BatchedInterpolationDDom>
192 using batched_derivs_domain_type2 =
ddc::replace_dim_of_t<
193 BatchedInterpolationDDom,
194 interpolation_discrete_dimension_type2,
198
199
200
201
202
203
204
205
206 template <concepts::discrete_domain BatchedInterpolationDDom>
207 using batched_derivs_domain_type3 =
ddc::replace_dim_of_t<
208 BatchedInterpolationDDom,
209 interpolation_discrete_dimension_type3,
213
214
215
216
217
218
219
220
221
222 template <concepts::discrete_domain BatchedInterpolationDDom>
223 using batched_derivs_domain_type1_2 =
ddc::replace_dim_of_t<
224 ddc::replace_dim_of_t<
225 BatchedInterpolationDDom,
226 interpolation_discrete_dimension_type1,
228 interpolation_domain_type2,
232
233
234
235
236
237
238
239
240
241 template <concepts::discrete_domain BatchedInterpolationDDom>
242 using batched_derivs_domain_type2_3 =
ddc::replace_dim_of_t<
243 ddc::replace_dim_of_t<
244 BatchedInterpolationDDom,
245 interpolation_discrete_dimension_type2,
247 interpolation_domain_type3,
251
252
253
254
255
256
257
258
259
260 template <concepts::discrete_domain BatchedInterpolationDDom>
261 using batched_derivs_domain_type1_3 =
ddc::replace_dim_of_t<
262 ddc::replace_dim_of_t<
263 BatchedInterpolationDDom,
264 interpolation_discrete_dimension_type1,
266 interpolation_domain_type3,
270
271
272
273
274
275
276
277
278 template <concepts::discrete_domain BatchedInterpolationDDom>
279 using batched_derivs_domain_type
280 =
ddc::detail::convert_type_seq_to_discrete_domain_t<
ddc::type_seq_replace_t<
281 ddc::to_type_seq_t<BatchedInterpolationDDom>,
282 ddc::detail::TypeSeq<
283 interpolation_discrete_dimension_type1,
284 interpolation_discrete_dimension_type2,
285 interpolation_discrete_dimension_type3>,
286 ddc::detail::TypeSeq<deriv_type1, deriv_type2, deriv_type3>>>;
289 builder_type1 m_spline_builder1;
290 builder_type_2_3 m_spline_builder_2_3;
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
310 interpolation_domain_type
const& interpolation_domain,
311 std::optional<std::size_t> cols_per_chunk = std::nullopt,
312 std::optional<
unsigned int> preconditioner_max_block_size = std::nullopt)
313 : m_spline_builder1(interpolation_domain, cols_per_chunk, preconditioner_max_block_size)
314 , m_spline_builder_2_3(interpolation_domain, cols_per_chunk, preconditioner_max_block_size)
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334 template <
concepts::discrete_domain BatchedInterpolationDDom>
336 BatchedInterpolationDDom
const& batched_interpolation_domain,
337 std::optional<std::size_t> cols_per_chunk = std::nullopt,
338 std::optional<
unsigned int> preconditioner_max_block_size = std::nullopt)
340 interpolation_domain_type(batched_interpolation_domain),
342 preconditioner_max_block_size)
350
351
352
353
363
364
365
366
370
371
372
373
374
375
379 interpolation_domain_type1,
380 interpolation_domain_type2,
381 interpolation_domain_type3>(
382 m_spline_builder1.interpolation_domain(),
383 m_spline_builder_2_3.interpolation_domain());
387
388
389
390
391
392
393
394
395
396 template <
concepts::discrete_domain BatchedInterpolationDDom>
398 BatchedInterpolationDDom
const& batched_interpolation_domain)
const noexcept
401 return batched_interpolation_domain;
405
406
407
408
409
410
411
412
413 template <
concepts::discrete_domain BatchedInterpolationDDom>
414 batch_domain_type<BatchedInterpolationDDom>
batch_domain(
415 BatchedInterpolationDDom
const& batched_interpolation_domain)
const noexcept
422
423
424
425
426
427
432 ddc::discrete_space<bsplines_type1>().full_domain(),
433 ddc::discrete_space<bsplines_type2>().full_domain(),
434 ddc::discrete_space<bsplines_type3>().full_domain());
438
439
440
441
442
443
444
445
446 template <
concepts::discrete_domain BatchedInterpolationDDom>
448 BatchedInterpolationDDom
const& batched_interpolation_domain)
const noexcept
451 return ddc::replace_dim_of<interpolation_discrete_dimension_type1, bsplines_type1>(
452 ddc::replace_dim_of<interpolation_discrete_dimension_type2, bsplines_type2>(
454 interpolation_discrete_dimension_type3,
461
462
463
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 template <
class Layout,
class BatchedInterpolationDDom>
532 batched_spline_domain_type<BatchedInterpolationDDom>,
534 memory_space> spline,
535 ddc::
ChunkSpan<
double const, BatchedInterpolationDDom, Layout, memory_space> vals,
538 batched_derivs_domain_type1<BatchedInterpolationDDom>,
540 memory_space>> derivs_min1
544 batched_derivs_domain_type1<BatchedInterpolationDDom>,
546 memory_space>> derivs_max1
550 batched_derivs_domain_type2<BatchedInterpolationDDom>,
552 memory_space>> derivs_min2
556 batched_derivs_domain_type2<BatchedInterpolationDDom>,
558 memory_space>> derivs_max2
562 batched_derivs_domain_type3<BatchedInterpolationDDom>,
564 memory_space>> derivs_min3
568 batched_derivs_domain_type3<BatchedInterpolationDDom>,
570 memory_space>> derivs_max3
574 batched_derivs_domain_type1_2<BatchedInterpolationDDom>,
576 memory_space>> mixed_derivs_min1_min2
580 batched_derivs_domain_type1_2<BatchedInterpolationDDom>,
582 memory_space>> mixed_derivs_max1_min2
586 batched_derivs_domain_type1_2<BatchedInterpolationDDom>,
588 memory_space>> mixed_derivs_min1_max2
592 batched_derivs_domain_type1_2<BatchedInterpolationDDom>,
594 memory_space>> mixed_derivs_max1_max2
598 batched_derivs_domain_type2_3<BatchedInterpolationDDom>,
600 memory_space>> mixed_derivs_min2_min3
604 batched_derivs_domain_type2_3<BatchedInterpolationDDom>,
606 memory_space>> mixed_derivs_max2_min3
610 batched_derivs_domain_type2_3<BatchedInterpolationDDom>,
612 memory_space>> mixed_derivs_min2_max3
616 batched_derivs_domain_type2_3<BatchedInterpolationDDom>,
618 memory_space>> mixed_derivs_max2_max3
622 batched_derivs_domain_type1_3<BatchedInterpolationDDom>,
624 memory_space>> mixed_derivs_min1_min3
628 batched_derivs_domain_type1_3<BatchedInterpolationDDom>,
630 memory_space>> mixed_derivs_max1_min3
634 batched_derivs_domain_type1_3<BatchedInterpolationDDom>,
636 memory_space>> mixed_derivs_min1_max3
640 batched_derivs_domain_type1_3<BatchedInterpolationDDom>,
642 memory_space>> mixed_derivs_max1_max3
646 batched_derivs_domain_type<BatchedInterpolationDDom>,
648 memory_space>> mixed_derivs_min1_min2_min3
652 batched_derivs_domain_type<BatchedInterpolationDDom>,
654 memory_space>> mixed_derivs_max1_min2_min3
658 batched_derivs_domain_type<BatchedInterpolationDDom>,
660 memory_space>> mixed_derivs_min1_max2_min3
664 batched_derivs_domain_type<BatchedInterpolationDDom>,
666 memory_space>> mixed_derivs_max1_max2_min3
670 batched_derivs_domain_type<BatchedInterpolationDDom>,
672 memory_space>> mixed_derivs_min1_min2_max3
676 batched_derivs_domain_type<BatchedInterpolationDDom>,
678 memory_space>> mixed_derivs_max1_min2_max3
682 batched_derivs_domain_type<BatchedInterpolationDDom>,
684 memory_space>> mixed_derivs_min1_max2_max3
688 batched_derivs_domain_type<BatchedInterpolationDDom>,
690 memory_space>> mixed_derivs_max1_max2_max3
691 = std::nullopt)
const;
711template <
class Layout,
class BatchedInterpolationDDom>
731 batched_spline_domain_type<BatchedInterpolationDDom>,
733 memory_space> spline,
734 ddc::
ChunkSpan<
double const, BatchedInterpolationDDom, Layout, memory_space> vals,
737 batched_derivs_domain_type1<BatchedInterpolationDDom>,
739 memory_space>> derivs_min1,
742 batched_derivs_domain_type1<BatchedInterpolationDDom>,
744 memory_space>> derivs_max1,
747 batched_derivs_domain_type2<BatchedInterpolationDDom>,
749 memory_space>> derivs_min2,
752 batched_derivs_domain_type2<BatchedInterpolationDDom>,
754 memory_space>> derivs_max2,
757 batched_derivs_domain_type3<BatchedInterpolationDDom>,
759 memory_space>> derivs_min3,
762 batched_derivs_domain_type3<BatchedInterpolationDDom>,
764 memory_space>> derivs_max3,
767 batched_derivs_domain_type1_2<BatchedInterpolationDDom>,
769 memory_space>> mixed_derivs_min1_min2,
772 batched_derivs_domain_type1_2<BatchedInterpolationDDom>,
774 memory_space>> mixed_derivs_max1_min2,
777 batched_derivs_domain_type1_2<BatchedInterpolationDDom>,
779 memory_space>> mixed_derivs_min1_max2,
782 batched_derivs_domain_type1_2<BatchedInterpolationDDom>,
784 memory_space>> mixed_derivs_max1_max2,
787 batched_derivs_domain_type2_3<BatchedInterpolationDDom>,
789 memory_space>> mixed_derivs_min2_min3,
792 batched_derivs_domain_type2_3<BatchedInterpolationDDom>,
794 memory_space>> mixed_derivs_max2_min3,
797 batched_derivs_domain_type2_3<BatchedInterpolationDDom>,
799 memory_space>> mixed_derivs_min2_max3,
802 batched_derivs_domain_type2_3<BatchedInterpolationDDom>,
804 memory_space>> mixed_derivs_max2_max3,
807 batched_derivs_domain_type1_3<BatchedInterpolationDDom>,
809 memory_space>> mixed_derivs_min1_min3,
812 batched_derivs_domain_type1_3<BatchedInterpolationDDom>,
814 memory_space>> mixed_derivs_max1_min3,
817 batched_derivs_domain_type1_3<BatchedInterpolationDDom>,
819 memory_space>> mixed_derivs_min1_max3,
822 batched_derivs_domain_type1_3<BatchedInterpolationDDom>,
824 memory_space>> mixed_derivs_max1_max3,
827 batched_derivs_domain_type<BatchedInterpolationDDom>,
829 memory_space>> mixed_derivs_min1_min2_min3,
832 batched_derivs_domain_type<BatchedInterpolationDDom>,
834 memory_space>> mixed_derivs_max1_min2_min3,
837 batched_derivs_domain_type<BatchedInterpolationDDom>,
839 memory_space>> mixed_derivs_min1_max2_min3,
842 batched_derivs_domain_type<BatchedInterpolationDDom>,
844 memory_space>> mixed_derivs_max1_max2_min3,
847 batched_derivs_domain_type<BatchedInterpolationDDom>,
849 memory_space>> mixed_derivs_min1_min2_max3,
852 batched_derivs_domain_type<BatchedInterpolationDDom>,
854 memory_space>> mixed_derivs_max1_min2_max3,
857 batched_derivs_domain_type<BatchedInterpolationDDom>,
859 memory_space>> mixed_derivs_min1_max2_max3,
862 batched_derivs_domain_type<BatchedInterpolationDDom>,
864 memory_space>> mixed_derivs_max1_max2_max3)
const
866 auto const batched_interpolation_domain = vals.domain();
869 assert(batch_domain_type<BatchedInterpolationDDom>(batched_interpolation_domain)
870 == batch_domain_type<BatchedInterpolationDDom>(spline.domain()));
872 if (batch_domain(batched_interpolation_domain).empty()) {
877 auto const batched_interpolation_deriv_domain2
878 =
ddc::replace_dim_of<interpolation_discrete_dimension_type2, deriv_type2>(
879 batched_interpolation_domain,
881 ddc::DiscreteElement<deriv_type2>(BSpline2::degree() % 2),
884 ddc::
Chunk spline_derivs_min2_alloc(
885 m_spline_builder1.batched_spline_domain(batched_interpolation_deriv_domain2),
887 auto spline_derivs_min2 = spline_derivs_min2_alloc.span_view();
888 auto spline_derivs_min2_opt = std::optional(spline_derivs_min2.span_cview());
893 mixed_derivs_min1_min2,
894 mixed_derivs_max1_min2);
896 spline_derivs_min2_opt = std::nullopt;
899 ddc::
Chunk spline_derivs_max2_alloc(
900 m_spline_builder1.batched_spline_domain(batched_interpolation_deriv_domain2),
902 auto spline_derivs_max2 = spline_derivs_max2_alloc.span_view();
903 auto spline_derivs_max2_opt = std::optional(spline_derivs_max2.span_cview());
908 mixed_derivs_min1_max2,
909 mixed_derivs_max1_max2);
911 spline_derivs_max2_opt = std::nullopt;
915 auto const batched_interpolation_deriv_domain3
916 =
ddc::replace_dim_of<interpolation_discrete_dimension_type3, deriv_type3>(
917 batched_interpolation_domain,
919 ddc::DiscreteElement<deriv_type3>(BSpline3::degree() % 2),
922 ddc::
Chunk spline_derivs_min3_alloc(
923 m_spline_builder1.batched_spline_domain(batched_interpolation_deriv_domain3),
925 auto spline_derivs_min3 = spline_derivs_min3_alloc.span_view();
926 auto spline_derivs_min3_opt = std::optional(spline_derivs_min3.span_cview());
931 mixed_derivs_min1_min3,
932 mixed_derivs_max1_min3);
934 spline_derivs_min3_opt = std::nullopt;
937 ddc::
Chunk spline_derivs_max3_alloc(
938 m_spline_builder1.batched_spline_domain(batched_interpolation_deriv_domain3),
940 auto spline_derivs_max3 = spline_derivs_max3_alloc.span_view();
941 auto spline_derivs_max3_opt = std::optional(spline_derivs_max3.span_cview());
946 mixed_derivs_min1_max3,
947 mixed_derivs_max1_max3);
949 spline_derivs_max3_opt = std::nullopt;
953 auto batched_interpolation_deriv_domain2_3
954 =
ddc::replace_dim_of<interpolation_discrete_dimension_type3, deriv_type3>(
955 batched_interpolation_deriv_domain2,
957 ddc::DiscreteElement<deriv_type3>(BSpline3::degree() % 2),
960 ddc::
Chunk spline_derivs_min2_min3_alloc(
961 m_spline_builder1.batched_spline_domain(batched_interpolation_deriv_domain2_3),
963 auto spline_derivs_min2_min3 = spline_derivs_min2_min3_alloc.span_view();
964 auto spline_derivs_min2_min3_opt = std::optional(spline_derivs_min2_min3.span_cview());
967 spline_derivs_min2_min3,
968 *mixed_derivs_min2_min3,
969 mixed_derivs_min1_min2_min3,
970 mixed_derivs_max1_min2_min3);
972 spline_derivs_min2_min3_opt = std::nullopt;
975 ddc::
Chunk spline_derivs_min2_max3_alloc(
976 m_spline_builder1.batched_spline_domain(batched_interpolation_deriv_domain2_3),
978 auto spline_derivs_min2_max3 = spline_derivs_min2_max3_alloc.span_view();
979 auto spline_derivs_min2_max3_opt = std::optional(spline_derivs_min2_max3.span_cview());
982 spline_derivs_min2_max3,
983 *mixed_derivs_min2_max3,
984 mixed_derivs_min1_min2_max3,
985 mixed_derivs_max1_min2_max3);
987 spline_derivs_min2_max3_opt = std::nullopt;
990 ddc::
Chunk spline_derivs_max2_min3_alloc(
991 m_spline_builder1.batched_spline_domain(batched_interpolation_deriv_domain2_3),
993 auto spline_derivs_max2_min3 = spline_derivs_max2_min3_alloc.span_view();
994 auto spline_derivs_max2_min3_opt = std::optional(spline_derivs_max2_min3.span_cview());
997 spline_derivs_max2_min3,
998 *mixed_derivs_max2_min3,
999 mixed_derivs_min1_max2_min3,
1000 mixed_derivs_max1_max2_min3);
1002 spline_derivs_max2_min3_opt = std::nullopt;
1005 ddc::
Chunk spline_derivs_max2_max3_alloc(
1006 m_spline_builder1.batched_spline_domain(batched_interpolation_deriv_domain2_3),
1008 auto spline_derivs_max2_max3 = spline_derivs_max2_max3_alloc.span_view();
1009 auto spline_derivs_max2_max3_opt = std::optional(spline_derivs_max2_max3.span_cview());
1012 spline_derivs_max2_max3,
1013 *mixed_derivs_max2_max3,
1014 mixed_derivs_min1_max2_max3,
1015 mixed_derivs_max1_max2_max3);
1017 spline_derivs_max2_max3_opt = std::nullopt;
1022 m_spline_builder1.batched_spline_domain(batched_interpolation_domain),
1024 ddc::
ChunkSpan const spline1 = spline1_alloc.span_view();
1026 m_spline_builder1(spline1, vals, derivs_min1, derivs_max1);
1028 m_spline_builder_2_3(
1030 spline1.span_cview(),
1031 spline_derivs_min2_opt,
1032 spline_derivs_max2_opt,
1033 spline_derivs_min3_opt,
1034 spline_derivs_max3_opt,
1035 spline_derivs_min2_min3_opt,
1036 spline_derivs_max2_min3_opt,
1037 spline_derivs_min2_max3_opt,
1038 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.