diff --git a/include/ddc/kernels/splines/spline_builder.hpp b/include/ddc/kernels/splines/spline_builder.hpp index 73f5a046e..7d79a5520 100644 --- a/include/ddc/kernels/splines/spline_builder.hpp +++ b/include/ddc/kernels/splines/spline_builder.hpp @@ -11,10 +11,28 @@ #include "splines_linear_problem_maker.hpp" namespace ddc { + +/** + * @brief An enum determining the backend solver of a SplineBuilder or SplineBuilder2d. + * + * An enum determining the backend solver of a SplineBuilder or SplineBuilder2d. + */ enum class SplineSolver { - GINKGO -}; // Only GINKGO available atm, other solvers will be implemented in the futur + GINKGO ///< Enum member to identify the Ginkgo-based solver (iterative method) +}; +/** + * @brief A helper giving the uniform/non_uniform status of a spline interpolation mesh according to its attributes. + * + * A helper giving the uniform/non_uniform status of a spline interpolation mesh according to its attributes. + * + * @param is_uniform A boolean giving the presumed status before considering boundary conditions. + * @param BcXmin The lower boundary condition. + * @param BcXmax The upper boundary condition. + * @param degree The degree of the spline. + * + * @return A boolean giving the uniform/non_uniform status. + */ constexpr bool is_spline_interpolation_mesh_uniform( bool const is_uniform, ddc::BoundCond const BcXmin, @@ -32,9 +50,17 @@ constexpr bool is_spline_interpolation_mesh_uniform( * * A class which contains an operator () which can be used to build a spline approximation * of a function. A spline approximation is represented by coefficients stored in a Chunk - * of BSplines. The spline is constructed such that it respects the boundary conditions + * of B-splines. The spline is constructed such that it respects the boundary conditions * BcXmin and BcXmax, and it interpolates the function at the points on the interpolation_mesh * associated with interpolation_mesh_type. + * @tparam ExecSpace The Kokkos execution space on which the spline approximation is performed. + * @tparam MemorySpace The Kokkos memory space on which the data (interpolation function and splines coefficients) is stored. + * @tparam BSplines The discrete dimension representing the B-splines. + * @tparam InterpolationMesh The discrete dimension on which interpolation points are defined. + * @tparam BcXmin The lower boundary condition. + * @tparam BcXmax The upper boundary condition. + * @tparam Solver The SplineSolver giving the backend used to perform the spline approximation. + * @tparam IDimX A variadic template of all the discrete dimensions forming the full space (InterpolationMesh + batched dimensions). */ template < class ExecSpace, @@ -57,40 +83,60 @@ class SplineBuilder using tag_type = typename InterpolationMesh::continuous_dimension_type; public: + /// @brief The type of the Kokkos execution space used by this class. using exec_space = ExecSpace; + /// @brief The type of the Kokkos memory space used by this class. using memory_space = MemorySpace; - /** - * @brief The type of the interpolation mesh used by this class. - */ + /// @brief The type of the interpolation discrete dimension (discrete dimension of interest) used by this class. using interpolation_mesh_type = InterpolationMesh; - /** - * @brief The type of the BSplines which are compatible with this class. - */ + /// @brief The discrete dimension representing the B-splines. using bsplines_type = BSplines; + /// @brief The type of the Deriv dimension at the boundaries. using deriv_type = ddc::Deriv; - /** - * @brief The type of the domain for the interpolation mesh used by this class. - */ + /// @brief The type of the domain for the 1D interpolation mesh used by this class. using interpolation_domain_type = ddc::DiscreteDomain; + /// @brief The type of the whole domain representing interpolation points. using batched_interpolation_domain_type = ddc::DiscreteDomain; + /** + * @brief The type of the batch domain (obtained by removing the dimension of interest + * from the whole domain). + * + * Example: For batched_interpolation_domain_type = DiscreteDomain and a dimension of interest Y, + * this is DiscreteDomain + */ using batch_domain_type = typename ddc::detail::convert_type_seq_to_discrete_domain, ddc::detail::TypeSeq>>; + /** + * @brief The type of the whole spline domain (cartesian product of 1D spline domain + * and batch domain) preserving the underlying memory layout (order of dimensions). + * + * Example: For batched_interpolation_domain_type = DiscreteDomain and a dimension of interest Y + * (associated to a B-splines tag BSplinesY), this is DiscreteDomain. + */ using batched_spline_domain_type = typename ddc::detail::convert_type_seq_to_discrete_domain, ddc::detail::TypeSeq, ddc::detail::TypeSeq>>; +private: + /** + * @brief The type of the whole spline domain (cartesian product of the 1D spline domain + * and the batch domain) with 1D spline dimension being the leading dimension. + * + * Example: For batched_interpolation_domain_type = DiscreteDomain and a dimension of interest Y + * (associated to a B-splines tag BSplinesY), this is DiscreteDomain. + */ using batched_spline_tr_domain_type = typename ddc::detail::convert_type_seq_to_discrete_domain, @@ -98,35 +144,33 @@ class SplineBuilder ddc::detail::TypeSeq, ddc::detail::TypeSeq>>>; +public: + /** + * @brief The type of the whole Deriv domain (cartesian product of 1D Deriv domain + * and batch domain) preserving the underlying memory layout (order of dimensions). + * + * Example: For batched_interpolation_domain_type = DiscreteDomain and a dimension of interest Y, + * this is DiscreteDomain,Z> + */ using batched_derivs_domain_type = typename ddc::detail::convert_type_seq_to_discrete_domain, ddc::detail::TypeSeq, ddc::detail::TypeSeq>>; - /** - * @brief Indicates if the degree of the splines is odd or even. - */ + /// @brief Indicates if the degree of the splines is odd or even. static constexpr bool s_odd = BSplines::degree() % 2; - /** - * @brief The number of equations which define the boundary conditions at the lower bound. - */ + /// @brief The number of equations defining the boundary condition at the lower bound. static constexpr int s_nbc_xmin = n_boundary_equations(BcXmin, BSplines::degree()); - /** - * @brief The number of equations which define the boundary conditions at the upper bound. - */ + /// @brief The number of equations defining the boundary condition at the upper bound. static constexpr int s_nbc_xmax = n_boundary_equations(BcXmax, BSplines::degree()); - /** - * @brief The boundary condition implemented at the lower bound. - */ + /// @brief The boundary condition implemented at the lower bound. static constexpr ddc::BoundCond s_bc_xmin = BcXmin; - /** - * @brief The boundary condition implemented at the upper bound. - */ + /// @brief The boundary condition implemented at the upper bound. static constexpr ddc::BoundCond s_bc_xmax = BcXmax; private: @@ -143,6 +187,22 @@ class SplineBuilder int compute_offset(interpolation_domain_type const& interpolation_domain); public: + /** + * @brief Build a SplineBuilder acting on batched_interpolation_domain. + * + * @param batched_interpolation_domain The domain on which the interpolation points are defined. + * + * @param cols_per_chunk A parameter used by the slicer (internal to the solver) to define the size + * of a chunk of right-hand sides of the linear problem to be computed in parallel (chunks are treated + * by the linear solver one-after-the-other). + * This value is optional. If no value is provided then the default value is chosen by the requested solver. + * + * @param preconditionner_max_block_size A parameter used by the slicer (internal to the solver) to + * define the size of a block used by the Block-Jacobi preconditioner. + * This value is optional. If no value is provided then the default value is chosen by the requested solver. + * + * @see MatrixSparse + */ explicit SplineBuilder( batched_interpolation_domain_type const& batched_interpolation_domain, std::optional cols_per_chunk = std::nullopt, @@ -170,62 +230,83 @@ class SplineBuilder preconditionner_max_block_size); } + /// @brief Copy-constructor is deleted SplineBuilder(SplineBuilder const& x) = delete; - /** - * @brief Create a new SplineBuilder by copy + /** @brief Move-constructs * - * @param x The SplineBuilder being copied. + * @param x An rvalue to another SplineBuilder. */ SplineBuilder(SplineBuilder&& x) = default; + /// @brief Destructs ~SplineBuilder() = default; + /// @brief Copy-assignment is deleted SplineBuilder& operator=(SplineBuilder const& x) = delete; - /** - * @brief Copy a SplineBuilder. + /** @brief Move-assigns * - * @param x The SplineBuilder being copied. - * @returns A reference to this object. + * @param x An rvalue to another SplineBuilder. + * @return A reference to this object. */ SplineBuilder& operator=(SplineBuilder&& x) = default; - batched_interpolation_domain_type batched_interpolation_domain() const noexcept + /** + * @brief Get the domain for the 1D interpolation mesh used by this class. + * + * This is 1D because it is defined along the dimension of interest. + * + * @return The 1D domain for the interpolation mesh. + */ + interpolation_domain_type interpolation_domain() const noexcept { - return m_batched_interpolation_domain; + return interpolation_domain_type(m_batched_interpolation_domain); } /** - * @brief Get the domain from which the approximation is defined. + * @brief Get the whole domain representing interpolation points. * - * Get the domain on which values of the function must be provided in order - * to build a spline approximation of the function. + * Values of the function must be provided on this domain in order + * to build a spline representation of the function (cartesian product of 1D interpolation_domain and batch_domain). * - * @return The domain for the grid points. + * @return The domain for the interpolation mesh. */ - interpolation_domain_type interpolation_domain() const noexcept + batched_interpolation_domain_type batched_interpolation_domain() const noexcept { - return interpolation_domain_type(batched_interpolation_domain()); + return m_batched_interpolation_domain; } + /** + * @brief Get the batch domain. + * + * Obtained by removing the dimension of interest from the whole interpolation domain. + * + * @return The batch domain. + */ batch_domain_type batch_domain() const noexcept { return ddc::remove_dims_of(batched_interpolation_domain(), interpolation_domain()); } + /** + * @brief Get the 1D domain on which spline coefficients are defined. + * + * The 1D spline domain corresponding to the dimension of interest. + * + * @return The 1D domain for the spline coefficients. + */ ddc::DiscreteDomain spline_domain() const noexcept { return ddc::discrete_space().full_domain(); } /** - * @brief Get the domain on which the approximation is defined. + * @brief Get the whole domain on which spline coefficients are defined. * - * Get the domain of the basis-splines for which the coefficients of the spline - * approximation must be calculated. + * Spline approximations (spline-transformed functions) are computed on this domain. * - * @return The domain for the splines. + * @return The domain for the spline coefficients. */ batched_spline_domain_type batched_spline_domain() const noexcept { @@ -234,11 +315,27 @@ class SplineBuilder bsplines_type>(batched_interpolation_domain(), spline_domain()); } +private: + /** + * @brief Get the whole domain on which spline coefficients are defined, with the dimension of interest being the leading dimension. + * + * This is used internally due to solver limitation and because it may be beneficial to computation performance. + * + * @return The (transposed) domain for the spline coefficients. + */ batched_spline_tr_domain_type batched_spline_tr_domain() const noexcept { return batched_spline_tr_domain_type(spline_domain(), batch_domain()); } +public: + /** + * @brief Get the whole domain on which derivatives on lower boundary are defined. + * + * This is only used with BoundCond::HERMITE boundary conditions. + * + * @return The domain for the Derivs values. + */ batched_derivs_domain_type batched_derivs_xmin_domain() const noexcept { return ddc::replace_dim_of( @@ -248,6 +345,13 @@ class SplineBuilder ddc::DiscreteVector(s_nbc_xmin))); } + /** + * @brief Get the whole domain on which derivatives on upper boundary are defined. + * + * This is only used with BoundCond::HERMITE boundary conditions. + * + * @return The domain for the Derivs values. + */ batched_derivs_domain_type batched_derivs_xmax_domain() const noexcept { return ddc::replace_dim_of( @@ -260,9 +364,13 @@ class SplineBuilder /** * @brief Get the interpolation matrix. * - * Get the interpolation matrix. This can be useful for debugging (as it allows + * This can be useful for debugging (as it allows * one to print the matrix) or for more complex quadrature schemes. * + * Warning: the returned detail::Matrix class is not supposed to be exposed + * to user, which means its usage is not supported out of the scope of current class. + * Use at your own risk. + * * @return A reference to the interpolation matrix. */ const ddc::detail::SplinesLinearProblem& get_interpolation_matrix() const noexcept @@ -271,20 +379,23 @@ class SplineBuilder } /** - * @brief Build a spline approximation of a function. + * @brief Compute a spline approximation of a function. * - * Use the values of a function at known grid points (as specified by - * SplineBuilder::interpolation_domain) and the derivatives of the - * function at the boundaries (if necessary for the chosen boundary - * conditions) to calculate a spline approximation of a function. + * Use the values of a function (defined on + * SplineBuilder::batched_interpolation_domain) and the derivatives of the + * function at the boundaries (in the case of BoundCond::HERMITE only, defined + * on SplineBuilder::batched_derivs_xmin_domain and SplineBuilder::batched_derivs_xmax_domain) + * to calculate a spline approximation of this function. * * The spline approximation is stored as a ChunkSpan of coefficients - * associated with basis-splines. + * associated with B-splines. * - * @param[out] spline The coefficients of the spline calculated by the function. - * @param[in] vals The values of the function at the grid points. - * @param[in] derivs_xmin The values of the derivatives at the lower boundary. - * @param[in] derivs_xmax The values of the derivatives at the upper boundary. + * @param[out] spline The coefficients of the spline computed by this SplineBuilder. + * @param[in] vals The values of the function on the interpolation mesh. + * @param[in] derivs_xmin The values of the derivatives at the lower boundary + * (used only with BoundCond::HERMITE lower boundary condition). + * @param[in] derivs_xmax The values of the derivatives at the upper boundary + * (used only with BoundCond::HERMITE upper boundary condition). */ template void operator()( diff --git a/include/ddc/kernels/splines/spline_builder_2d.hpp b/include/ddc/kernels/splines/spline_builder_2d.hpp index 1dcf486d2..342d9340d 100644 --- a/include/ddc/kernels/splines/spline_builder_2d.hpp +++ b/include/ddc/kernels/splines/spline_builder_2d.hpp @@ -12,7 +12,7 @@ namespace ddc { * @brief 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. + * of a function. A 2D spline approximation uses a cross-product between two 1D SplineBuilder. * * @see SplineBuilder */ @@ -32,10 +32,13 @@ template < class SplineBuilder2D { public: + /// @brief The type of the Kokkos execution space used by this class. using exec_space = ExecSpace; + /// @brief The type of the Kokkos memory space used by this class. using memory_space = MemorySpace; + /// @brief The type of the SplineBuilder used by this class to spline-approximate along first dimension. using builder_type1 = ddc::SplineBuilder< ExecSpace, MemorySpace, @@ -45,6 +48,8 @@ class SplineBuilder2D BcXmax1, Solver, IDimX...>; + + /// @brief The type of the SplineBuilder used by this class to spline-approximate along second dimension. using builder_type2 = ddc::SplineBuilder< ExecSpace, MemorySpace, @@ -54,6 +59,8 @@ class SplineBuilder2D BcXmax2, Solver, std::conditional_t, BSpline1, IDimX>...>; + + /// @brief The type of the SplineBuilder used by this class to spline-approximate the second-dimension-derivatives along first dimension. using builder_deriv_type1 = ddc::SplineBuilder< ExecSpace, MemorySpace, @@ -68,70 +75,98 @@ class SplineBuilder2D IDimX>...>; private: - /** - * @brief Tag the dimension of the first 1D SplineBuilder. - */ + /// @brief Tag the dimension of the first 1D SplineBuilder. using tag_type1 = typename builder_type1::bsplines_type::tag_type; - /** - * @brief Tag the dimension of the second 1D SplineBuilder. - */ + + /// @brief Tag the dimension of the second 1D SplineBuilder. using tag_type2 = typename builder_type2::bsplines_type::tag_type; public: - /** - * @brief The type of the BSplines in the first dimension which are compatible with this class. - */ + /// @brief The type of the B-splines in the first dimension. using bsplines_type1 = typename builder_type1::bsplines_type; - /** - * @brief The type of the BSplines in the second dimension which are compatible with this class. - */ + + /// @brief The type of the B-splines in the second dimension. using bsplines_type2 = typename builder_type2::bsplines_type; + /// @brief The type of the Deriv domain on boundaries in the first dimension. using deriv_type1 = typename builder_type1::deriv_type; + + /// @brief The type of the Deriv domain on boundaries in the second dimension. using deriv_type2 = typename builder_type2::deriv_type; - /** - * @brief The type of the interpolation mesh in the first dimension used by this class. - */ + /// @brief The type of the interpolation mesh in the first dimension. using interpolation_mesh_type1 = typename builder_type1::interpolation_mesh_type; - /** - * @brief The type of the interpolation mesh in the second dimension used by this class. - */ + + /// @brief The type of the interpolation mesh in the second dimension. using interpolation_mesh_type2 = typename builder_type2::interpolation_mesh_type; - /** - * @brief The type of the domain for the interpolation mesh is the first dimension used by this class. - */ + /// @brief The type of the domain for the interpolation mesh in the first dimension. using interpolation_domain_type1 = typename builder_type1::interpolation_mesh_type; - /** - * @brief The type of the domain for the interpolation mesh is the second dimension used by this class. - */ + + /// @brief The type of the domain for the interpolation mesh in the second dimension. using interpolation_domain_type2 = typename builder_type2::interpolation_mesh_type; - /** - * @brief The type of the domain for the interpolation mesh is the 2D dimension used by this class. - */ + + /// @brief The type of the domain for the interpolation mesh in the 2D dimension. using interpolation_domain_type = ddc::DiscreteDomain; + /// @brief The type of the whole domain representing interpolation points. using batched_interpolation_domain_type = ddc::DiscreteDomain; + /** + * @brief The type of the batch domain (obtained by removing the dimensions of interest + * from the whole domain). + * + * Example: For batched_interpolation_domain_type = DiscreteDomain and dimensions of interest X and Y, + * this is DiscreteDomain. + */ using batch_domain_type = ddc::detail::convert_type_seq_to_discrete_domain, ddc::detail::TypeSeq>>; + /** + * @brief The type of the whole spline domain (cartesian product of 2D spline domain + * and batch domain) preserving the order of dimensions. + * + * Example: For batched_interpolation_domain_type = DiscreteDomain and dimensions of interest X and Y + * (associated to B-splines tags BSplinesX and BSplinesY), this is DiscreteDomain + */ using batched_spline_domain_type = ddc::detail::convert_type_seq_to_discrete_domain, ddc::detail::TypeSeq, ddc::detail::TypeSeq>>; + /** + * @brief The type of the whole Derivs domain (cartesian product of the 1D Deriv domain + * and the associated batch domain) in the first dimension, preserving the order of dimensions. + * + * Example: For batched_interpolation_domain_type = DiscreteDomain and dimensions of interest X and Y, + * this is DiscreteDomain, Y, Z>. + */ using batched_derivs_domain_type1 = typename builder_type1::batched_derivs_domain_type; + + /** + * @brief The type of the whole Derivs domain (cartesian product of the 1D Deriv domain + * and the associated batch domain) in the second dimension, preserving the order of dimensions. + * + * Example: For batched_interpolation_domain_type = DiscreteDomain and dimensions of interest X and Y, + * this is DiscreteDomain, Z>. + */ using batched_derivs_domain_type2 = ddc::detail::convert_type_seq_to_discrete_domain, ddc::detail::TypeSeq, ddc::detail::TypeSeq>>; + + /** + * @brief The type of the whole Derivs domain (cartesian product of the 2D Deriv domain + * and the batch domain) in the second dimension, preserving the order of dimensions. + * + * Example: For batched_interpolation_domain_type = DiscreteDomain and dimensions of interest X and Y, + * this is DiscreteDomain, Deriv, Z>. + */ using batched_derivs_domain_type = ddc::detail::convert_type_seq_to_discrete_domain, @@ -145,13 +180,20 @@ class SplineBuilder2D public: /** - * @brief Create a new SplineBuilder2D. + * @brief Build a SplineBuilder2D acting on batched_interpolation_domain. + * + * @param batched_interpolation_domain The domain on which the interpolation points are defined. + * + * @param cols_per_chunk A parameter used by the slicer (internal to the solver) to define the size + * of a chunk of right-hand-sides of the linear problem to be computed in parallel (chunks are treated + * by the linear solver one-after-the-other). + * This value is optional. If no value is provided then the default value is chosen by the requested solver. * - * @param batched_interpolation_domain - * The 2D domain on which points will be provided in order to - * create the 2D spline approximation. - * @param cols_per_chunk The number of columns in the rhs passed to the underlying linear solver. - * @param preconditionner_max_block_size The block size of in the block Jacobi preconditioner. + * @param preconditionner_max_block_size A parameter used by the slicer (internal to the solver) to + * define the size of a block used by the Block-Jacobi preconditioner. + * This value is optional. If no value is provided then the default value is chosen by the requested solver. + * + * @see SplinesLinearProblemSparse */ explicit SplineBuilder2D( batched_interpolation_domain_type const& batched_interpolation_domain, @@ -173,48 +215,35 @@ class SplineBuilder2D { } - /** - * @brief Create a new SplineBuilder2D by copy - * - * @param x - * The SplineBuilder2D being copied. - */ + /// @brief Copy-constructor is deleted SplineBuilder2D(SplineBuilder2D const& x) = delete; /** - * @brief Create a new SplineBuilder2D by copy + * @brief Move-constructs * - * @param x - * The temporary SplineBuilder2D being copied. + * @param x An rvalue to another SplineBuilder2D. */ SplineBuilder2D(SplineBuilder2D&& x) = default; + /// @brief Destructs ~SplineBuilder2D() = default; + /// @brief Copy-assignment is deleted SplineBuilder2D& operator=(SplineBuilder2D const& x) = delete; - - /** - * @brief Copy a SplineBuilder2D. + /** @brief Move-assigns * - * @param x - * The temporary SplineBuilder2D being copied. - * @returns A reference to this object. + * @param x An rvalue to another SplineBuilder. + * @return A reference to this object. */ SplineBuilder2D& operator=(SplineBuilder2D&& x) = default; - batched_interpolation_domain_type batched_interpolation_domain() const noexcept - { - return m_spline_builder1.batched_interpolation_domain(); - } - /** - * @brief Get the 2D dimension domain from which the approximation is defined. + * @brief Get the domain for the 2D interpolation mesh used by this class. * - * Get the 2D dimension domain on which values of the function must be provided in order - * to build a spline approximation of the function. + * This is 2D because it is defined along the dimensions of interest. * - * @return The 2D dimension domain for the grid points. + * @return The 2D domain for the interpolation mesh. */ interpolation_domain_type interpolation_domain() const noexcept { @@ -223,27 +252,52 @@ class SplineBuilder2D m_spline_builder2.interpolation_domain()); } + /** + * @brief Get the whole domain representing interpolation points. + * + * Values of the function must be provided on this domain in order + * to build a spline representation of the function (cartesian product of 2D interpolation_domain and batch_domain). + * + * @return The domain for the interpolation mesh. + */ + batched_interpolation_domain_type batched_interpolation_domain() const noexcept + { + return m_spline_builder1.batched_interpolation_domain(); + } + + /** + * @brief Get the batch domain. + * + * Obtained by removing the dimensions of interest from the whole interpolation domain. + * + * @return The batch domain. + */ batch_domain_type batch_domain() const noexcept { return ddc::remove_dims_of(batched_interpolation_domain(), interpolation_domain()); } /** - * @brief Get the 2D domain on which the approximation is defined. + * @brief Get the 2D domain on which spline coefficients are defined. * - * Get the 2D domain of the basis-splines for which the coefficients of the spline - * approximation must be calculated. + * The 2D spline domain corresponding to the dimensions of interest. * - * @return The 2D domain for the splines. + * @return The 2D domain for the spline coefficients. */ - ddc::DiscreteDomain spline_domain() - const noexcept // TODO : clarify name + ddc::DiscreteDomain spline_domain() const noexcept { return ddc::DiscreteDomain( ddc::discrete_space().full_domain(), ddc::discrete_space().full_domain()); } + /** + * @brief Get the whole domain on which spline coefficients are defined. + * + * Spline approximations (spline-transformed functions) are computed on this domain. + * + * @return The domain for the spline coefficients. + */ batched_spline_domain_type batched_spline_domain() const noexcept { return ddc::replace_dim_of( @@ -254,20 +308,20 @@ class SplineBuilder2D } /** - * @brief Build a 2D spline approximation of a function. + * @brief Compute 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. + * Use the values of a function (defined on + * SplineBuilder2D::batched_interpolation_domain) and the derivatives of the + * function at the boundaries (in the case of BoundCond::HERMITE only) + * to calculate a 2D spline approximation of this function. * * The spline approximation is stored as a ChunkSpan of coefficients - * associated with basis-splines. + * associated with B-splines. * * @param[out] spline - * The coefficients of the spline calculated by the function. + * The coefficients of the spline computed by this SplineBuilder. * @param[in] vals - * The values of the function at the grid points. + * The values of the function at the interpolation mesh. * @param[in] derivs_min1 * The values of the derivatives at the lower boundary in the first dimension. * @param[in] derivs_max1 @@ -417,7 +471,7 @@ operator()( memory_space>> const mixed_derivs_max1_max2) const { // TODO: perform computations along dimension 1 on different streams ? - // Spline1-transform derivs_min2 (to spline1_deriv_min) + // Spline1-approximate derivs_min2 (to spline1_deriv_min) ddc::Chunk spline1_deriv_min_alloc( m_spline_builder_deriv1.batched_spline_domain(), ddc::KokkosAllocator()); @@ -433,7 +487,7 @@ operator()( spline1_deriv_min_opt = std::nullopt; } - // Spline1-transform vals (to spline1) + // Spline1-approximate vals (to spline1) ddc::Chunk spline1_alloc( m_spline_builder1.batched_spline_domain(), ddc::KokkosAllocator()); @@ -441,7 +495,7 @@ operator()( m_spline_builder1(spline1, vals, derivs_min1, derivs_max1); - // Spline1-transform derivs_max2 (to spline1_deriv_max) + // Spline1-approximate derivs_max2 (to spline1_deriv_max) ddc::Chunk spline1_deriv_max_alloc( m_spline_builder_deriv1.batched_spline_domain(), ddc::KokkosAllocator()); @@ -457,7 +511,7 @@ operator()( spline1_deriv_max_opt = std::nullopt; } - // Spline2-transform spline1 + // Spline2-approximate spline1 m_spline_builder2(spline, spline1.span_cview(), spline1_deriv_min_opt, spline1_deriv_max_opt); } } // namespace ddc