DDC 0.0.0

a discrete domain computation library

ddc::SplineBuilder2D< ExecSpace, MemorySpace, BSpline1, BSpline2, IDimI1, IDimI2, BcXmin1, BcXmax1, BcXmin2, BcXmax2, Solver, IDimX > Class Template Reference

A class for creating a 2D spline approximation of a function. More...

Public Types

using exec_space = ExecSpace
 
using memory_space = MemorySpace
 
using builder_type1
 
using builder_type2
 
using builder_deriv_type1
 
using bsplines_type1 = typename builder_type1::bsplines_type
 The type of the BSplines in the first dimension which are compatible with this class.
 
using bsplines_type2 = typename builder_type2::bsplines_type
 The type of the BSplines in the second dimension which are compatible with this class.
 
using deriv_type1 = typename builder_type1::deriv_type
 
using deriv_type2 = typename builder_type2::deriv_type
 
using interpolation_mesh_type1 = typename builder_type1::interpolation_mesh_type
 The type of the interpolation mesh in the first dimension used by this class.
 
using interpolation_mesh_type2 = typename builder_type2::interpolation_mesh_type
 The type of the interpolation mesh in the second dimension used by this class.
 
using interpolation_domain_type1 = typename builder_type1::interpolation_mesh_type
 The type of the domain for the interpolation mesh is the first dimension used by this class.
 
using interpolation_domain_type2 = typename builder_type2::interpolation_mesh_type
 The type of the domain for the interpolation mesh is the second dimension used by this class.
 
using interpolation_domain_type = ddc::DiscreteDomain<interpolation_mesh_type1, interpolation_mesh_type2>
 The type of the domain for the interpolation mesh is the 2D dimension used by this class.
 
using batched_interpolation_domain_type = ddc::DiscreteDomain<IDimX...>
 
using batch_domain_type
 
using batched_spline_domain_type
 
using batched_derivs_domain_type1 = typename builder_type1::batched_derivs_domain_type
 
using batched_derivs_domain_type2
 
using batched_derivs_domain_type
 

Public Member Functions

 SplineBuilder2D (batched_interpolation_domain_type const &batched_interpolation_domain, std::optional< int > cols_per_chunk=std::nullopt, std::optional< unsigned int > preconditionner_max_block_size=std::nullopt)
 Create a new SplineBuilder2D.
 
 SplineBuilder2D (SplineBuilder2D const &x)=delete
 Create a new SplineBuilder2D by copy.
 
 SplineBuilder2D (SplineBuilder2D &&x)=default
 Create a new SplineBuilder2D by copy.
 
 ~SplineBuilder2D ()=default
 
SplineBuilder2Doperator= (SplineBuilder2D const &x)=delete
 
SplineBuilder2Doperator= (SplineBuilder2D &&x)=default
 Copy a SplineBuilder2D.
 
batched_interpolation_domain_type batched_interpolation_domain () const noexcept
 
interpolation_domain_type interpolation_domain () const noexcept
 Get the 2D dimension domain from which the approximation is defined.
 
batch_domain_type batch_domain () const noexcept
 
ddc::DiscreteDomain< bsplines_type1, bsplines_type2spline_domain () const noexcept
 Get the 2D domain on which the approximation is defined.
 
batched_spline_domain_type batched_spline_domain () const noexcept
 
template<class Layout >
void operator() (ddc::ChunkSpan< double, batched_spline_domain_type, Layout, memory_space > spline, ddc::ChunkSpan< double const, batched_interpolation_domain_type, Layout, memory_space > vals, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type1, Layout, memory_space > > const derivs_min1=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type1, Layout, memory_space > > const derivs_max1=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type2, Layout, memory_space > > const derivs_min2=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type2, Layout, memory_space > > const derivs_max2=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type, Layout, memory_space > > const mixed_derivs_min1_min2=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type, Layout, memory_space > > const mixed_derivs_max1_min2=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type, Layout, memory_space > > const mixed_derivs_min1_max2=std::nullopt, std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type, Layout, memory_space > > const mixed_derivs_max1_max2=std::nullopt) const
 Build a 2D spline approximation of a function.
 

Detailed Description

template<class ExecSpace, class MemorySpace, class BSpline1, class BSpline2, class IDimI1, class IDimI2, ddc::BoundCond BcXmin1, ddc::BoundCond BcXmax1, ddc::BoundCond BcXmin2, ddc::BoundCond BcXmax2, ddc::SplineSolver Solver, class... IDimX>
class ddc::SplineBuilder2D< ExecSpace, MemorySpace, BSpline1, BSpline2, IDimI1, IDimI2, BcXmin1, BcXmax1, BcXmin2, BcXmax2, Solver, IDimX >

A class for creating a 2D spline approximation of a function.

A class which contains an operator () which can be used to build a 2D spline approximation of a function. A 2D spline approximation uses a cross-product between two 1D spline builder.

See also
SplineBuilder

Member Typedef Documentation

◆ exec_space

◆ memory_space

◆ builder_type1

Initial value:
IDimX...>
A class for creating a spline approximation of a function.
Definition spline_builder.hpp:48
constexpr bool enable_chunk
Definition chunk_traits.hpp:16

◆ builder_type2

◆ builder_deriv_type1

◆ bsplines_type1

The type of the BSplines in the first dimension which are compatible with this class.

◆ bsplines_type2

The type of the BSplines in the second dimension which are compatible with this class.

◆ deriv_type1

◆ deriv_type2

◆ interpolation_mesh_type1

The type of the interpolation mesh in the first dimension used by this class.

◆ interpolation_mesh_type2

The type of the interpolation mesh in the second dimension used by this class.

◆ interpolation_domain_type1

The type of the domain for the interpolation mesh is the first dimension used by this class.

◆ interpolation_domain_type2

The type of the domain for the interpolation mesh is the second dimension used by this class.

◆ interpolation_domain_type

The type of the domain for the interpolation mesh is the 2D dimension used by this class.

◆ batched_interpolation_domain_type

◆ batch_domain_type

Initial value:
ddc::detail::convert_type_seq_to_discrete_domain<ddc::type_seq_remove_t<
ddc::detail::TypeSeq<IDimX...>,
ddc::detail::TypeSeq<interpolation_mesh_type1, interpolation_mesh_type2>>>

◆ batched_spline_domain_type

Initial value:
ddc::detail::convert_type_seq_to_discrete_domain<ddc::type_seq_replace_t<
ddc::detail::TypeSeq<IDimX...>,
ddc::detail::TypeSeq<interpolation_mesh_type1, interpolation_mesh_type2>,
ddc::detail::TypeSeq<bsplines_type1, bsplines_type2>>>

◆ batched_derivs_domain_type1

◆ batched_derivs_domain_type2

Initial value:
ddc::detail::convert_type_seq_to_discrete_domain<ddc::type_seq_replace_t<
ddc::detail::TypeSeq<IDimX...>,
ddc::detail::TypeSeq<interpolation_mesh_type2>,
ddc::detail::TypeSeq<deriv_type2>>>

◆ batched_derivs_domain_type

Initial value:
ddc::detail::convert_type_seq_to_discrete_domain<ddc::type_seq_replace_t<
ddc::detail::TypeSeq<IDimX...>,
ddc::detail::TypeSeq<interpolation_mesh_type1, interpolation_mesh_type2>,
ddc::detail::TypeSeq<deriv_type1, deriv_type2>>>

Constructor & Destructor Documentation

◆ SplineBuilder2D() [1/3]

ddc::SplineBuilder2D< ExecSpace, MemorySpace, BSpline1, BSpline2, IDimI1, IDimI2, BcXmin1, BcXmax1, BcXmin2, BcXmax2, Solver, IDimX >::SplineBuilder2D ( batched_interpolation_domain_type const & batched_interpolation_domain,
std::optional< int > cols_per_chunk = std::nullopt,
std::optional< unsigned int > preconditionner_max_block_size = std::nullopt )
inlineexplicit

Create a new SplineBuilder2D.

Parameters
batched_interpolation_domainThe 2D domain on which points will be provided in order to create the 2D spline approximation.
cols_per_chunkThe number of columns in the rhs passed to the underlying linear solver.
preconditionner_max_block_sizeThe block size of in the block Jacobi preconditioner.

◆ SplineBuilder2D() [2/3]

◆ SplineBuilder2D() [3/3]

◆ ~SplineBuilder2D()

Member Function Documentation

◆ operator=() [1/2]

◆ operator=() [2/2]

◆ batched_interpolation_domain()

◆ interpolation_domain()

Get the 2D dimension domain from which the approximation is defined.

Get the 2D dimension domain on which values of the function must be provided in order to build a spline approximation of the function.

Returns
The 2D dimension domain for the grid points.

◆ batch_domain()

◆ spline_domain()

Get the 2D domain on which the approximation is defined.

Get the 2D domain of the basis-splines for which the coefficients of the spline approximation must be calculated.

Returns
The 2D domain for the splines.

◆ batched_spline_domain()

◆ operator()()

template<class Layout >
void ddc::SplineBuilder2D< ExecSpace, MemorySpace, BSpline1, BSpline2, IDimI1, IDimI2, BcXmin1, BcXmax1, BcXmin2, BcXmax2, Solver, IDimX >::operator() ( ddc::ChunkSpan< double, batched_spline_domain_type, Layout, memory_space > spline,
ddc::ChunkSpan< double const, batched_interpolation_domain_type, Layout, memory_space > vals,
std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type1, Layout, memory_space > > const derivs_min1 = std::nullopt,
std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type1, Layout, memory_space > > const derivs_max1 = std::nullopt,
std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type2, Layout, memory_space > > const derivs_min2 = std::nullopt,
std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type2, Layout, memory_space > > const derivs_max2 = std::nullopt,
std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type, Layout, memory_space > > const mixed_derivs_min1_min2 = std::nullopt,
std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type, Layout, memory_space > > const mixed_derivs_max1_min2 = std::nullopt,
std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type, Layout, memory_space > > const mixed_derivs_min1_max2 = std::nullopt,
std::optional< ddc::ChunkSpan< double const, batched_derivs_domain_type, Layout, memory_space > > const mixed_derivs_max1_max2 = std::nullopt ) const

Build a 2D spline approximation of a function.

Use the values of a function at known grid points (as specified by SplineBuilder2D::interpolation_domain_type) and the derivatives of the function at the boundaries (if necessary for the chosen boundary conditions) to calculate a 2D spline approximation of a function.

The spline approximation is stored as a ChunkSpan of coefficients associated with basis-splines.

Parameters
[out]splineThe coefficients of the spline calculated by the function.
[in]valsThe values of the function at the grid points.
[in]derivs_min1The values of the derivatives at the lower boundary in the first dimension.
[in]derivs_max1The values of the derivatives at the upper boundary in the first dimension.
[in]derivs_min2The values of the derivatives at the lower boundary in the second dimension.
[in]derivs_max2The values of the derivatives at the upper boundary in the second dimension.
[in]mixed_derivs_min1_min2The values of the the cross-derivatives at the lower boundary in the first dimension and the lower boundary in the second dimension.
[in]mixed_derivs_max1_min2The values of the the cross-derivatives at the upper boundary in the first dimension and the lower boundary in the second dimension.
[in]mixed_derivs_min1_max2The values of the the cross-derivatives at the lower boundary in the first dimension and the upper boundary in the second dimension.
[in]mixed_derivs_max1_max2The values of the the cross-derivatives at the upper boundary in the first dimension and the upper boundary in the second dimension.

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