13#include "math_tools.hpp"
21struct UniformBsplinesKnots : UniformPointSampling<typename T::tag_type>
25struct UniformBSplinesBase
40template <
class Tag, std::
size_t D>
43 static_assert(
D > 0,
"Parameter `D` must be positive");
84 template <
class DDim,
class MemorySpace>
87 template <
class ODDim,
class OMemorySpace>
91 using mesh_type = detail::UniformBsplinesKnots<DDim>;
125 mesh_type::template init<
133 template <
class OriginMemorySpace>
217 std::size_t
n)
const;
226 template <
class Layout,
class MemorySpace2>
359 return m_domain.
size() - 1;
391template <
class Tag, std::
size_t D>
392template <
class DDim,
class MemorySpace>
410 for (std::size_t
j = 1;
j <
values.size(); ++
j) {
413 for (std::size_t
r = 0;
r <
j; ++
r) {
422 return discrete_element_type(
jmin);
425template <
class Tag, std::
size_t D>
426template <
class DDim,
class MemorySpace>
442 for (std::size_t
j = 1;
j < degree(); ++
j) {
445 for (std::size_t
r = 0;
r <
j; ++
r) {
458 for (std::size_t
j = 1;
j < degree(); ++
j) {
468template <
class Tag, std::
size_t D>
469template <
class DDim,
class MemorySpace>
474 std::size_t
const n)
const
477 std::experimental::mdspan<
479 std::experimental::extents<std::size_t, degree() + 1, degree() + 1>>
const
483 mdspan<
double, std::experimental::extents<std::size_t, degree() + 1, 2>>
const a(
504 for (std::size_t
j = 1;
j < degree() + 1; ++
j) {
507 for (std::size_t
r = 0;
r <
j; ++
r) {
515 for (std::size_t
i = 0;
i <
ndu.extent(1); ++
i) {
519 for (
int r = 0;
r <
int(degree() + 1); ++
r) {
523 for (
int k = 1;
k <
int(
n + 1); ++
k) {
525 int const rk =
r -
k;
526 int const pk = degree() -
k;
528 a(0,
s2) = a(0,
s1) / (
pk + 1);
531 int const j1 =
rk > -1 ? 1 : (-
rk);
532 int const j2 = (
r - 1) <=
pk ?
k : (degree() -
r + 1);
533 for (
int j =
j1;
j <
j2; ++
j) {
538 a(
k,
s2) = -a(
k - 1,
s1) / (
pk + 1);
542 Kokkos::kokkos_swap(
s1,
s2);
549 double const inv_dx = inv_step();
551 for (
int k = 1;
k <
int(
n + 1); ++
k) {
552 for (std::size_t
i = 0;
i <
derivs.extent(0); ++
i) {
561template <
class Tag, std::
size_t D>
562template <
class DDim,
class MemorySpace>
571 double const inv_dx = inv_step();
575 }
else if (
x ==
rmax()) {
576 icell = ncells() - 1;
586 icell = ncells() - 1;
592template <
class Tag, std::
size_t D>
593template <
class DDim,
class MemorySpace>
594template <
class Layout,
class MemorySpace2>
599 if constexpr (is_periodic()) {
606 if constexpr (is_periodic()) {
629 mdspan<
double, std::experimental::extents<std::size_t, degree() + 2>>
const
636 for (std::size_t
i = 0;
i < degree(); ++
i) {
Definition discrete_domain.hpp:51
KOKKOS_FUNCTION constexpr std::size_t size() const
Definition discrete_domain.hpp:137
KOKKOS_FUNCTION constexpr discrete_element_type front() const noexcept
Definition discrete_domain.hpp:154
KOKKOS_FUNCTION constexpr DiscreteDomain remove(mlength_type n1, mlength_type n2) const
Definition discrete_domain.hpp:184
KOKKOS_FUNCTION constexpr discrete_element_type back() const noexcept
Definition discrete_domain.hpp:159
A DiscreteVector is a vector in the discrete dimension.
Definition discrete_vector.hpp:254
The top-level namespace of DDC.
Definition aligned_allocator.hpp:11
constexpr bool enable_chunk
Definition chunk_traits.hpp:16
KOKKOS_FUNCTION Coordinate< typename DDim::continuous_dimension_type > rmax(DiscreteDomain< DDim > const &d)
Definition non_uniform_point_sampling.hpp:182
constexpr bool is_uniform_bsplines_v
Indicates if a tag corresponds to uniform B-splines or not.
Definition bsplines_uniform.hpp:389
ddc::Span2D< double > DSpan2D
Definition view.hpp:128
ddc::Span1D< double > DSpan1D
Definition view.hpp:126
KOKKOS_FUNCTION Coordinate< typename DDim::continuous_dimension_type... > coordinate(DiscreteElement< DDim... > const &c)
Definition coordinate.hpp:29
KOKKOS_FUNCTION Coordinate< typename DDim::continuous_dimension_type > rmin(DiscreteDomain< DDim > const &d)
Definition non_uniform_point_sampling.hpp:175
detail::TaggedVector< CoordinateElement, CDims... > Coordinate
A Coordinate represents a coordinate in the continuous space.
Definition coordinate.hpp:26
Definition chunk_span.hpp:30