DDC 0.0.0

a discrete domain computation library

knots_as_interpolation_points.hpp
1// Copyright (C) The DDC development team, see COPYRIGHT.md file
2//
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
7#include <vector>
8
9#include <ddc/ddc.hpp>
10
11#include "spline_boundary_conditions.hpp"
12
13namespace ddc {
14
26template <class BSplines, ddc::BoundCond BcXmin, ddc::BoundCond BcXmax>
28{
29 static_assert(BcXmin != ddc::BoundCond::GREVILLE);
30 static_assert(BcXmax != ddc::BoundCond::GREVILLE);
31
32 using tag_type = typename BSplines::tag_type;
33
34public:
40 template <typename Sampling, typename U = BSplines>
41 static auto get_sampling()
42 {
43 if constexpr (U::is_uniform()) {
44 return std::get<0>(Sampling::
48 ddc::discrete_space<BSplines>().ncells() + 1)));
49 } else {
50 using SamplingImpl = typename Sampling::template Impl<Sampling, Kokkos::HostSpace>;
51 std::vector<double> knots(ddc::discrete_space<BSplines>().npoints());
52 for (int i(0); i < ddc::discrete_space<BSplines>().npoints(); ++i) {
54 }
55 return SamplingImpl(knots);
56 }
57 }
58
60 using interpolation_mesh_type = std::conditional_t<
64
70 template <typename Sampling>
72 {
73 int const npoints = ddc::discrete_space<BSplines>().ncells() + !BSplines::is_periodic();
77 }
78};
79} // namespace ddc
Definition discrete_domain.hpp:51
A DiscreteElement identifies an element of the discrete dimension.
Definition discrete_element.hpp:146
A DiscreteVector is a vector in the discrete dimension.
Definition discrete_vector.hpp:254
Helper class for the initialisation of the mesh of interpolation points.
Definition knots_as_interpolation_points.hpp:28
std::conditional_t< is_uniform_bsplines_v< BSplines >, ddc::UniformPointSampling< tag_type >, ddc::NonUniformPointSampling< tag_type > > interpolation_mesh_type
The DDC type of the sampling for the interpolation points.
Definition knots_as_interpolation_points.hpp:60
static auto get_sampling()
Get the sampling of interpolation points.
Definition knots_as_interpolation_points.hpp:41
static ddc::DiscreteDomain< Sampling > get_domain()
Get the domain which can be used to access the interpolation points in the sampling.
Definition knots_as_interpolation_points.hpp:71
NonUniformPointSampling models a non-uniform discretization of the CDim segment .
Definition non_uniform_point_sampling.hpp:34
UniformPointSampling models a uniform discretization of the provided continuous dimension.
Definition uniform_point_sampling.hpp:36
The top-level namespace of DDC.
Definition aligned_allocator.hpp:11
constexpr bool enable_chunk
Definition chunk_traits.hpp:16
KOKKOS_FUNCTION Coordinate< typename DDim::continuous_dimension_type > rmax(DiscreteDomain< DDim > const &d)
Definition non_uniform_point_sampling.hpp:182
KOKKOS_FUNCTION Coordinate< typename DDim::continuous_dimension_type > rmin(DiscreteDomain< DDim > const &d)
Definition non_uniform_point_sampling.hpp:175