Storage class of the static attributes of the discrete dimension. More...
#include <bsplines_uniform.hpp>
Public Types | |
using | knot_discrete_dimension_type = UniformBsplinesKnots< DDim > |
The type of the knots defining the B-splines. | |
using | discrete_dimension_type = UniformBSplines |
The type of the discrete dimension representing the B-splines. | |
using | discrete_domain_type = DiscreteDomain< DDim > |
The type of a DiscreteDomain whose elements identify the B-splines. | |
using | discrete_element_type = DiscreteElement< DDim > |
The type of a DiscreteElement identifying a B-spline. | |
using | discrete_vector_type = DiscreteVector< DDim > |
The type of a DiscreteVector representing an "index displacement" between two B-splines. | |
Public Member Functions | |
Impl ()=default | |
Impl (ddc::Coordinate< CDim > rmin, ddc::Coordinate< CDim > rmax, std::size_t ncells) | |
Constructs a spline basis (B-splines) with n equidistant knots over \([a, b]\). | |
template<class OriginMemorySpace > | |
Impl (Impl< DDim, OriginMemorySpace > const &impl) | |
Copy-constructs from another Impl with a different Kokkos memory space. | |
Impl (Impl const &x)=default | |
Copy-constructs. | |
Impl (Impl &&x)=default | |
Move-constructs. | |
~Impl ()=default | |
Destructs. | |
Impl & | operator= (Impl const &x)=default |
Copy-assigns. | |
Impl & | operator= (Impl &&x)=default |
Move-assigns. | |
KOKKOS_INLINE_FUNCTION discrete_element_type | eval_basis (DSpan1D values, ddc::Coordinate< CDim > const &x) const |
Evaluates non-zero B-splines at a given coordinate. | |
KOKKOS_INLINE_FUNCTION discrete_element_type | eval_deriv (DSpan1D derivs, ddc::Coordinate< CDim > const &x) const |
Evaluates non-zero B-spline derivatives at a given coordinate. | |
KOKKOS_INLINE_FUNCTION discrete_element_type | eval_basis_and_n_derivs (ddc::DSpan2D derivs, ddc::Coordinate< CDim > const &x, std::size_t n) const |
Evaluates non-zero B-spline values and \(n\) derivatives at a given coordinate. | |
template<class Layout , class MemorySpace2 > | |
KOKKOS_INLINE_FUNCTION ddc::ChunkSpan< double, ddc::DiscreteDomain< DDim >, Layout, MemorySpace2 > | integrals (ddc::ChunkSpan< double, discrete_domain_type, Layout, MemorySpace2 > int_vals) const |
Compute the integrals of the B-splines. | |
KOKKOS_INLINE_FUNCTION ddc::DiscreteElement< knot_discrete_dimension_type > | get_first_support_knot (discrete_element_type const &ix) const |
Returns the coordinate of the first support knot associated to a DiscreteElement identifying a B-spline. | |
KOKKOS_INLINE_FUNCTION ddc::DiscreteElement< knot_discrete_dimension_type > | get_last_support_knot (discrete_element_type const &ix) const |
Returns the coordinate of the last support knot associated to a DiscreteElement identifying a B-spline. | |
KOKKOS_INLINE_FUNCTION ddc::Coordinate< CDim > | rmin () const noexcept |
Returns the coordinate of the lower bound of the domain on which the B-splines are defined. | |
KOKKOS_INLINE_FUNCTION ddc::Coordinate< CDim > | rmax () const noexcept |
Returns the coordinate of the upper bound of the domain on which the B-splines are defined. | |
KOKKOS_INLINE_FUNCTION double | length () const noexcept |
Returns the length of the domain. | |
KOKKOS_INLINE_FUNCTION std::size_t | size () const noexcept |
Returns the number of elements necessary to construct a spline representation of a function. | |
KOKKOS_INLINE_FUNCTION discrete_domain_type | full_domain () const |
Returns the discrete domain including eventual additional B-splines in the periodic case. | |
KOKKOS_INLINE_FUNCTION ddc::DiscreteDomain< knot_discrete_dimension_type > | break_point_domain () const |
Returns the discrete domain which describes the break points. | |
KOKKOS_INLINE_FUNCTION std::size_t | nbasis () const noexcept |
Returns the number of basis functions. | |
KOKKOS_INLINE_FUNCTION std::size_t | ncells () const noexcept |
Returns the number of cells over which the B-splines are defined. | |
Friends | |
template<class ODDim , class OMemorySpace > | |
class | Impl |
Storage class of the static attributes of the discrete dimension.
DDim | The name of the discrete dimension. |
MemorySpace | The Kokkos memory space where the attributes are being stored. |
Definition at line 90 of file bsplines_uniform.hpp.
using ddc::UniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::knot_discrete_dimension_type = UniformBsplinesKnots<DDim> |
The type of the knots defining the B-splines.
Definition at line 102 of file bsplines_uniform.hpp.
using ddc::UniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::discrete_dimension_type = UniformBSplines |
The type of the discrete dimension representing the B-splines.
Definition at line 105 of file bsplines_uniform.hpp.
using ddc::UniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::discrete_domain_type = DiscreteDomain<DDim> |
The type of a DiscreteDomain whose elements identify the B-splines.
Definition at line 108 of file bsplines_uniform.hpp.
using ddc::UniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::discrete_element_type = DiscreteElement<DDim> |
The type of a DiscreteElement identifying a B-spline.
Definition at line 111 of file bsplines_uniform.hpp.
using ddc::UniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::discrete_vector_type = DiscreteVector<DDim> |
The type of a DiscreteVector representing an "index displacement" between two B-splines.
Definition at line 114 of file bsplines_uniform.hpp.
|
default |
|
inlineexplicit |
Constructs a spline basis (B-splines) with n equidistant knots over \([a, b]\).
rmin | The real ddc::coordinate of the first knot. |
rmax | The real ddc::coordinate of the last knot. |
ncells | The number of cells in the range [rmin, rmax]. |
Definition at line 130 of file bsplines_uniform.hpp.
|
inlineexplicit |
Copy-constructs from another Impl with a different Kokkos memory space.
impl | A reference to the other Impl. |
Definition at line 151 of file bsplines_uniform.hpp.
|
default |
Copy-constructs.
x | A reference to another Impl. |
|
default |
Move-constructs.
x | An rvalue to another Impl. |
|
default |
Destructs.
|
default |
|
default |
|
inline |
Evaluates non-zero B-splines at a given coordinate.
The values are computed for every B-spline with support at the given coordinate x. There are only (degree+1) B-splines which are non-zero at any given point. It is these B-splines which are evaluated. This can be useful to calculate a spline approximation of a function. A spline approximation at coordinate x is a linear combination of these B-spline evaluations weighted with the spline coefficients of the spline-transformed initial discrete function.
[out] | values | The values of the B-splines evaluated at coordinate x. It has to be a 1D mdspan with (degree+1) elements. |
[in] | x | The coordinate where B-splines are evaluated. It has to be in the range of break points coordinates. |
Definition at line 199 of file bsplines_uniform.hpp.
KOKKOS_INLINE_FUNCTION ddc::DiscreteElement< DDim > ddc::UniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::eval_deriv | ( | DSpan1D | derivs, |
ddc::Coordinate< CDim > const & | x | ||
) | const |
Evaluates non-zero B-spline derivatives at a given coordinate.
The derivatives are computed for every B-spline with support at the given coordinate x. There are only (degree+1) B-splines which are non-zero at any given point. It is these B-splines which are derivated. A spline approximation of a derivative at coordinate x is a linear combination of those B-spline derivatives weighted with the spline coefficients of the spline-transformed initial discrete function.
[out] | derivs | The derivatives of the B-splines evaluated at coordinate x. It has to be a 1D mdspan with (degree+1) elements. |
[in] | x | The coordinate where B-spline derivatives are evaluated. It has to be in the range of break points coordinates. |
Definition at line 435 of file bsplines_uniform.hpp.
KOKKOS_INLINE_FUNCTION ddc::DiscreteElement< DDim > ddc::UniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::eval_basis_and_n_derivs | ( | ddc::DSpan2D | derivs, |
ddc::Coordinate< CDim > const & | x, | ||
std::size_t | n | ||
) | const |
Evaluates non-zero B-spline values and \(n\) derivatives at a given coordinate.
The values and derivatives are computed for every B-spline with support at the given coordinate x. There are only (degree+1) B-splines which are non-zero at any given point. It is these B-splines which are evaluated and derivated. A spline approximation of a derivative at coordinate x is a linear combination of those B-spline derivatives weighted with spline coefficients of the spline-transformed initial discrete function.
[out] | derivs | The values and \(n\) derivatives of the B-splines evaluated at coordinate x. It has to be a 2D mdspan of sizes (degree+1, n+1). |
[in] | x | The coordinate where B-spline derivatives are evaluated. It has to be in the range of break points coordinates. |
[in] | n | The number of derivatives to evaluate (in addition to the B-spline values themselves). |
Definition at line 480 of file bsplines_uniform.hpp.
KOKKOS_INLINE_FUNCTION ddc::ChunkSpan< double, ddc::DiscreteDomain< DDim >, Layout, MemorySpace2 > ddc::UniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::integrals | ( | ddc::ChunkSpan< double, discrete_domain_type, Layout, MemorySpace2 > | int_vals | ) | const |
Compute the integrals of the B-splines.
The integral of each of the B-splines over their support within the domain on which this basis was defined.
[out] | int_vals | The values of the integrals. It has to be a 1D Chunkspan of size (nbasis). |
Definition at line 605 of file bsplines_uniform.hpp.
|
inline |
Returns the coordinate of the first support knot associated to a DiscreteElement identifying a B-spline.
Each B-spline has a support defined over (degree+2) knots. For a B-spline identified by the provided DiscreteElement, this function returns the first knot in the support of the B-spline. In other words it returns the lower bound of the support.
[in] | ix | DiscreteElement identifying the B-spline. |
Definition at line 263 of file bsplines_uniform.hpp.
|
inline |
Returns the coordinate of the last support knot associated to a DiscreteElement identifying a B-spline.
Each B-spline has a support defined over (degree+2) knots. For a B-spline identified by the provided DiscreteElement, this function returns the last knot in the support of the B-spline. In other words it returns the upper bound of the support.
[in] | ix | DiscreteElement identifying the B-spline. |
Definition at line 279 of file bsplines_uniform.hpp.
|
inlinenoexcept |
Returns the coordinate of the lower bound of the domain on which the B-splines are defined.
Definition at line 289 of file bsplines_uniform.hpp.
|
inlinenoexcept |
Returns the coordinate of the upper bound of the domain on which the B-splines are defined.
Definition at line 298 of file bsplines_uniform.hpp.
|
inlinenoexcept |
Returns the length of the domain.
Definition at line 307 of file bsplines_uniform.hpp.
|
inlinenoexcept |
Returns the number of elements necessary to construct a spline representation of a function.
For a non-periodic domain the number of elements necessary to construct a spline representation of a function is equal to the number of basis functions. However in the periodic case it additionally includes degree additional elements which allow the first B-splines to be evaluated close to rmax (where they also appear due to the periodicity).
Definition at line 320 of file bsplines_uniform.hpp.
|
inline |
Returns the discrete domain including eventual additional B-splines in the periodic case.
See size().
Definition at line 329 of file bsplines_uniform.hpp.
|
inline |
Returns the discrete domain which describes the break points.
Definition at line 339 of file bsplines_uniform.hpp.
|
inlinenoexcept |
Returns the number of basis functions.
The number of functions in the spline basis.
Definition at line 350 of file bsplines_uniform.hpp.
|
inlinenoexcept |
Returns the number of cells over which the B-splines are defined.
The number of cells over which the B-splines and any spline representation are defined. In other words the number of polynomials that comprise a spline representation on the domain where the basis is defined.
Definition at line 362 of file bsplines_uniform.hpp.
Definition at line 93 of file bsplines_uniform.hpp.