Storage class of the static attributes of the discrete dimension. More...
#include <bsplines_non_uniform.hpp>
Public Types | |
using | knot_discrete_dimension_type = NonUniformBsplinesKnots< DDim > |
The type of the knots defining the B-splines. | |
using | discrete_dimension_type = NonUniformBSplines |
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 (std::initializer_list< ddc::Coordinate< CDim > > breaks) | |
Constructs an Impl using a brace-list, i.e. | |
Impl (std::vector< ddc::Coordinate< CDim > > const &breaks) | |
Constructs an Impl using a std::vector. | |
template<class RandomIt > | |
Impl (RandomIt breaks_begin, RandomIt breaks_end) | |
Constructs an Impl by iterating over a range of break points from begin to end. | |
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 first break point of the domain on which the B-splines are defined. | |
KOKKOS_INLINE_FUNCTION ddc::Coordinate< CDim > | rmax () const noexcept |
Returns the coordinate of the last break point 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 | npoints () const noexcept |
The number of 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 85 of file bsplines_non_uniform.hpp.
using ddc::NonUniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::knot_discrete_dimension_type = NonUniformBsplinesKnots<DDim> |
The type of the knots defining the B-splines.
Definition at line 92 of file bsplines_non_uniform.hpp.
using ddc::NonUniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::discrete_dimension_type = NonUniformBSplines |
The type of the discrete dimension representing the B-splines.
Definition at line 95 of file bsplines_non_uniform.hpp.
using ddc::NonUniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::discrete_domain_type = DiscreteDomain<DDim> |
The type of a DiscreteDomain whose elements identify the B-splines.
Definition at line 98 of file bsplines_non_uniform.hpp.
using ddc::NonUniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::discrete_element_type = DiscreteElement<DDim> |
The type of a DiscreteElement identifying a B-spline.
Definition at line 101 of file bsplines_non_uniform.hpp.
using ddc::NonUniformBSplines< 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 104 of file bsplines_non_uniform.hpp.
|
default |
|
inline |
Constructs an Impl using a brace-list, i.e.
Impl bsplines({0., 1.})
Constructs an Impl by iterating over a list of break points. Internally this constructor calls the constructor Impl(RandomIt breaks_begin, RandomIt breaks_end).
breaks | The std::initializer_list of the coordinates of break points. |
Definition at line 120 of file bsplines_non_uniform.hpp.
|
inlineexplicit |
Constructs an Impl using a std::vector.
Constructs an Impl by iterating over a list of break points. Internally this constructor calls the constructor Impl(RandomIt breaks_begin, RandomIt breaks_end).
breaks | The std::vector of the coordinates of break points. |
Definition at line 132 of file bsplines_non_uniform.hpp.
ddc::NonUniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::Impl | ( | RandomIt | breaks_begin, |
RandomIt | breaks_end | ||
) |
Constructs an Impl by iterating over a range of break points from begin to end.
The provided break points describe the separation between the cells on which the polynomials comprising a spline are defined. They are used to build a set of knots. There are 2*degree more knots than break points. In the non-periodic case the knots are defined as follows: \( k_i = b_0 \forall 0 \leq i < d \) \( k_{i+d} = b_i \forall 0 \leq i < n_b \) \( k_{i+d+n_b} = b_{n_b-1} \forall 0 \leq i < d \) where \(d\) is the degree of the polynomials, and \(n_b\) is the number of break points in the input pair of iterators. And in the periodic case: \( k_i = b_{n_b-1-d+i} \forall 0 \leq i < d \) \( k_{i+d} = b_i \forall 0 \leq i \leq n_b \) \( k_{i+d+n_b} = b_{i+1} \forall 0 \leq i < d \)
This constructor makes the knots accessible via a DiscreteSpace.
breaks_begin | The iterator which points at the beginning of the break points. |
breaks_end | The iterator which points at the end of the break points. |
Definition at line 419 of file bsplines_non_uniform.hpp.
|
inlineexplicit |
Copy-constructs from another Impl with a different Kokkos memory space.
impl | A reference to the other Impl. |
Definition at line 163 of file bsplines_non_uniform.hpp.
|
default |
Copy-constructs.
x | A reference to another Impl. |
|
default |
Move-constructs.
x | An rvalue to another Impl. |
|
default |
Destructs.
|
default |
|
default |
KOKKOS_INLINE_FUNCTION ddc::DiscreteElement< DDim > ddc::NonUniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::eval_basis | ( | DSpan1D | values, |
ddc::Coordinate< CDim > const & | x | ||
) | const |
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 463 of file bsplines_non_uniform.hpp.
KOKKOS_INLINE_FUNCTION ddc::DiscreteElement< DDim > ddc::NonUniformBSplines< 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 503 of file bsplines_non_uniform.hpp.
KOKKOS_INLINE_FUNCTION ddc::DiscreteElement< DDim > ddc::NonUniformBSplines< 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 563 of file bsplines_non_uniform.hpp.
KOKKOS_INLINE_FUNCTION ddc::ChunkSpan< double, ddc::DiscreteDomain< DDim >, Layout, MemorySpace2 > ddc::NonUniformBSplines< 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 702 of file bsplines_non_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 271 of file bsplines_non_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 287 of file bsplines_non_uniform.hpp.
|
inlinenoexcept |
Returns the coordinate of the first break point of the domain on which the B-splines are defined.
Definition at line 297 of file bsplines_non_uniform.hpp.
|
inlinenoexcept |
Returns the coordinate of the last break point of the domain on which the B-splines are defined.
Definition at line 306 of file bsplines_non_uniform.hpp.
|
inlinenoexcept |
Returns the length of the domain.
Definition at line 315 of file bsplines_non_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 328 of file bsplines_non_uniform.hpp.
|
inline |
Returns the discrete domain including eventual additional B-splines in the periodic case.
See size().
Definition at line 337 of file bsplines_non_uniform.hpp.
|
inline |
Returns the discrete domain which describes the break points.
Definition at line 347 of file bsplines_non_uniform.hpp.
|
inlinenoexcept |
The number of break points.
The number of break points or cell boundaries.
Definition at line 358 of file bsplines_non_uniform.hpp.
|
inlinenoexcept |
Returns the number of basis functions.
The number of functions in the spline basis.
Definition at line 369 of file bsplines_non_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 381 of file bsplines_non_uniform.hpp.
Definition at line 88 of file bsplines_non_uniform.hpp.