61 IdxRange<Grid1D>
const& idx_range,
62 SplineBuilder
const& builder)
65 SplineBuilder::s_nbc_xmin == 0,
66 "The spline quadrature requires a builder which can construct the coefficients using "
67 "only the values at the interpolation points.");
69 SplineBuilder::s_nbc_xmax == 0,
70 "The spline quadrature requires a builder which can construct the coefficients using "
71 "only the values at the interpolation points.");
75 (std::is_same_v<typename SplineBuilder::memory_space, Kokkos::HostSpace>),
76 "SplineBuilder must be host allocated.");
78 DFieldMem<IdxRange<Grid1D>,
typename SplineBuilder::memory_space> quadrature_coefficients(
79 builder.interpolation_domain());
80 std::tie(std::ignore, quadrature_coefficients, std::ignore) = builder.quadrature_coefficients();
81 return ddc::create_mirror_and_copy(quadrature_coefficients[idx_range]);
100 IdxRange<DDims...>
const& idx_range,
101 SplineBuilders
const&... builders)
103 assert((std::is_same_v<
104 typename DDims::continuous_dimension_type,
105 typename SplineBuilders::continuous_dimension_type> and ...));
108 std::tuple<CoefficientFieldMem1D_host<DDims>...> current_dim_coeffs(
112 DFieldMem<IdxRange<DDims...>,
typename ExecSpace::memory_space> coefficients(idx_range);
113 auto coefficients_host = ddc::create_mirror(get_field(coefficients));
116 ddc::for_each(idx_range, [&](Idx<DDims...>
const idim) {
118 coefficients_host(idim)
119 = (std::get<CoefficientFieldMem1D_host<DDims>>(current_dim_coeffs)(
120 ddc::select<DDims>(idim))
123 ddc::parallel_deepcopy(coefficients, coefficients_host);
DFieldMem< IdxRange< DDims... >, typename ExecSpace::memory_space > spline_quadrature_coefficients(IdxRange< DDims... > const &idx_range, SplineBuilders const &... builders)
Get the spline quadrature coefficients in ND from N 1D quadrature coefficient.
Definition spline_quadrature.hpp:99
host_t< DFieldMem< IdxRange< Grid1D > > > spline_quadrature_coefficients_1d(IdxRange< Grid1D > const &idx_range, SplineBuilder const &builder)
Get the spline quadrature coefficients.
Definition spline_quadrature.hpp:60