13#include <Kokkos_Core.hpp>
22
23
24
25
26
27
28
29
30
31
32
33
34
35
42 using continuous_dimension_type =
typename BSplines::continuous_dimension_type;
46
47
48
49
50 template <
typename Sampling,
typename U = BSplines>
53 if constexpr (U::is_uniform()) {
54 return std::get<0>(Sampling::
55 init(
ddc::discrete_space<BSplines>().rmin(),
56 ddc::discrete_space<BSplines>().rmax(),
58 ddc::discrete_space<BSplines>().ncells() + 1)));
60 using SamplingImpl =
typename Sampling::
template Impl<Sampling, Kokkos::HostSpace>;
61 std::vector<
double> knots(
ddc::discrete_space<BSplines>().npoints());
63 ddc::discrete_space<BSplines>().break_point_domain());
66 [&](
ddc::DiscreteElement<knot_discrete_dimension_t<BSplines>> ik) {
67 knots[ik - break_point_domain.front()] =
ddc::coordinate(ik);
69 return SamplingImpl(knots);
74 using interpolation_discrete_dimension_type = std::conditional_t<
75 is_uniform_bsplines_v<BSplines>,
80
81
82
83
84 template <
typename Sampling>
87 int const npoints =
ddc::discrete_space<BSplines>().ncells() + !BSplines::is_periodic();
89 ddc::DiscreteElement<Sampling>(0),
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.
static auto get_sampling()
Get the UniformPointSampling defining 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.
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.
@ 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.
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.