DDC 0.1.0
Loading...
Searching...
No Matches
ddc::UniformBSplines< CDim, D >::Impl< DDim, MemorySpace > Class Template Reference

Storage class of the static attributes of the discrete dimension. More...

#include <bsplines_uniform.hpp>

Collaboration diagram for ddc::UniformBSplines< CDim, D >::Impl< DDim, MemorySpace >:
Collaboration graph

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.
 
Imploperator= (Impl const &x)=default
 Copy-assigns.
 
Imploperator= (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, MemorySpace2integrals (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_typeget_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_typeget_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< CDimrmin () const noexcept
 Returns the coordinate of the lower bound of the domain on which the B-splines are defined.
 
KOKKOS_INLINE_FUNCTION ddc::Coordinate< CDimrmax () 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_typebreak_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
 

Detailed Description

template<class CDim, std::size_t D>
template<class DDim, class MemorySpace>
class ddc::UniformBSplines< CDim, D >::Impl< DDim, MemorySpace >

Storage class of the static attributes of the discrete dimension.

Template Parameters
DDimThe name of the discrete dimension.
MemorySpaceThe Kokkos memory space where the attributes are being stored.

Definition at line 90 of file bsplines_uniform.hpp.

Member Typedef Documentation

◆ knot_discrete_dimension_type

template<class CDim , std::size_t D>
template<class DDim , class MemorySpace >
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.

◆ discrete_dimension_type

template<class CDim , std::size_t D>
template<class DDim , class MemorySpace >
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.

◆ discrete_domain_type

template<class CDim , std::size_t D>
template<class DDim , class MemorySpace >
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.

◆ discrete_element_type

template<class CDim , std::size_t D>
template<class DDim , class MemorySpace >
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.

◆ discrete_vector_type

template<class CDim , std::size_t D>
template<class DDim , class MemorySpace >
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.

Constructor & Destructor Documentation

◆ Impl() [1/5]

template<class CDim , std::size_t D>
template<class DDim , class MemorySpace >
ddc::UniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::Impl ( )
default

◆ Impl() [2/5]

template<class CDim , std::size_t D>
template<class DDim , class MemorySpace >
ddc::UniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::Impl ( ddc::Coordinate< CDim rmin,
ddc::Coordinate< CDim rmax,
std::size_t  ncells 
)
inlineexplicit

Constructs a spline basis (B-splines) with n equidistant knots over \([a, b]\).

Parameters
rminThe real ddc::coordinate of the first knot.
rmaxThe real ddc::coordinate of the last knot.
ncellsThe number of cells in the range [rmin, rmax].

Definition at line 130 of file bsplines_uniform.hpp.

◆ Impl() [3/5]

template<class CDim , std::size_t D>
template<class DDim , class MemorySpace >
ddc::UniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::Impl ( Impl< DDim, OriginMemorySpace > const impl)
inlineexplicit

Copy-constructs from another Impl with a different Kokkos memory space.

Parameters
implA reference to the other Impl.

Definition at line 151 of file bsplines_uniform.hpp.

◆ Impl() [4/5]

template<class CDim , std::size_t D>
template<class DDim , class MemorySpace >
ddc::UniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::Impl ( Impl< DDim, MemorySpace > const x)
default

Copy-constructs.

Parameters
xA reference to another Impl.

◆ Impl() [5/5]

template<class CDim , std::size_t D>
template<class DDim , class MemorySpace >
ddc::UniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::Impl ( Impl< DDim, MemorySpace > &&  x)
default

Move-constructs.

Parameters
xAn rvalue to another Impl.

◆ ~Impl()

template<class CDim , std::size_t D>
template<class DDim , class MemorySpace >
ddc::UniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::~Impl ( )
default

Destructs.

Member Function Documentation

◆ operator=() [1/2]

template<class CDim , std::size_t D>
template<class DDim , class MemorySpace >
Impl & ddc::UniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::operator= ( Impl< DDim, MemorySpace > const x)
default

Copy-assigns.

Parameters
xA reference to another Impl.
Returns
A reference to the copied Impl.

◆ operator=() [2/2]

template<class CDim , std::size_t D>
template<class DDim , class MemorySpace >
Impl & ddc::UniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::operator= ( Impl< DDim, MemorySpace > &&  x)
default

Move-assigns.

Parameters
xAn rvalue to another Impl.
Returns
A reference to this object.

◆ eval_basis()

template<class CDim , std::size_t D>
template<class DDim , class MemorySpace >
KOKKOS_INLINE_FUNCTION discrete_element_type ddc::UniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::eval_basis ( DSpan1D  values,
ddc::Coordinate< CDim > const x 
) const
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.

Parameters
[out]valuesThe values of the B-splines evaluated at coordinate x. It has to be a 1D mdspan with (degree+1) elements.
[in]xThe coordinate where B-splines are evaluated. It has to be in the range of break points coordinates.
Returns
The index of the first B-spline which is evaluated.

Definition at line 199 of file bsplines_uniform.hpp.

◆ eval_deriv()

template<class CDim , std::size_t D>
template<class DDim , class MemorySpace >
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.

Parameters
[out]derivsThe derivatives of the B-splines evaluated at coordinate x. It has to be a 1D mdspan with (degree+1) elements.
[in]xThe coordinate where B-spline derivatives are evaluated. It has to be in the range of break points coordinates.
Returns
The index of the first B-spline which is evaluated.

Definition at line 435 of file bsplines_uniform.hpp.

◆ eval_basis_and_n_derivs()

template<class CDim , std::size_t D>
template<class DDim , class MemorySpace >
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.

Parameters
[out]derivsThe 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]xThe coordinate where B-spline derivatives are evaluated. It has to be in the range of break points coordinates.
[in]nThe number of derivatives to evaluate (in addition to the B-spline values themselves).
Returns
The index of the first B-spline which is evaluated.

Definition at line 480 of file bsplines_uniform.hpp.

◆ integrals()

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.

Deprecated:
Use integrals instead.
Parameters
[out]int_valsThe values of the integrals. It has to be a 1D Chunkspan of size (nbasis).
Returns
The values of the integrals.

Definition at line 605 of file bsplines_uniform.hpp.

◆ get_first_support_knot()

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.

Parameters
[in]ixDiscreteElement identifying the B-spline.
Returns
DiscreteElement of the lower bound of the support of the B-spline.

Definition at line 263 of file bsplines_uniform.hpp.

◆ get_last_support_knot()

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.

Parameters
[in]ixDiscreteElement identifying the B-spline.
Returns
DiscreteElement of the upper bound of the support of the B-spline.

Definition at line 279 of file bsplines_uniform.hpp.

◆ rmin()

template<class CDim , std::size_t D>
template<class DDim , class MemorySpace >
KOKKOS_INLINE_FUNCTION ddc::Coordinate< CDim > ddc::UniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::rmin ( ) const
inlinenoexcept

Returns the coordinate of the lower bound of the domain on which the B-splines are defined.

Returns
Coordinate of the lower bound of the domain.

Definition at line 289 of file bsplines_uniform.hpp.

◆ rmax()

template<class CDim , std::size_t D>
template<class DDim , class MemorySpace >
KOKKOS_INLINE_FUNCTION ddc::Coordinate< CDim > ddc::UniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::rmax ( ) const
inlinenoexcept

Returns the coordinate of the upper bound of the domain on which the B-splines are defined.

Returns
Coordinate of the upper bound of the domain.

Definition at line 298 of file bsplines_uniform.hpp.

◆ length()

template<class CDim , std::size_t D>
template<class DDim , class MemorySpace >
KOKKOS_INLINE_FUNCTION double ddc::UniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::length ( ) const
inlinenoexcept

Returns the length of the domain.

Returns
The length of the domain.

Definition at line 307 of file bsplines_uniform.hpp.

◆ size()

template<class CDim , std::size_t D>
template<class DDim , class MemorySpace >
KOKKOS_INLINE_FUNCTION std::size_t ddc::UniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::size ( ) const
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).

Returns
The number of elements necessary to construct a spline representation of a function.

Definition at line 320 of file bsplines_uniform.hpp.

◆ full_domain()

template<class CDim , std::size_t D>
template<class DDim , class MemorySpace >
KOKKOS_INLINE_FUNCTION discrete_domain_type ddc::UniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::full_domain ( ) const
inline

Returns the discrete domain including eventual additional B-splines in the periodic case.

See size().

Returns
The discrete domain including eventual additional B-splines.

Definition at line 329 of file bsplines_uniform.hpp.

◆ break_point_domain()

template<class CDim , std::size_t D>
template<class DDim , class MemorySpace >
KOKKOS_INLINE_FUNCTION ddc::DiscreteDomain< knot_discrete_dimension_type > ddc::UniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::break_point_domain ( ) const
inline

Returns the discrete domain which describes the break points.

Returns
The discrete domain describing the break points.

Definition at line 339 of file bsplines_uniform.hpp.

◆ nbasis()

template<class CDim , std::size_t D>
template<class DDim , class MemorySpace >
KOKKOS_INLINE_FUNCTION std::size_t ddc::UniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::nbasis ( ) const
inlinenoexcept

Returns the number of basis functions.

The number of functions in the spline basis.

Returns
The number of basis functions.

Definition at line 350 of file bsplines_uniform.hpp.

◆ ncells()

template<class CDim , std::size_t D>
template<class DDim , class MemorySpace >
KOKKOS_INLINE_FUNCTION std::size_t ddc::UniformBSplines< CDim, D >::Impl< DDim, MemorySpace >::ncells ( ) const
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.

Returns
The number of cells over which the B-splines are defined.

Definition at line 362 of file bsplines_uniform.hpp.

Friends And Related Symbol Documentation

◆ Impl

template<class CDim , std::size_t D>
template<class DDim , class MemorySpace >
template<class ODDim , class OMemorySpace >
friend class Impl
friend

Definition at line 93 of file bsplines_uniform.hpp.


The documentation for this class was generated from the following file: