23using CoefficientFieldMem1D = DFieldMem<IdxRange<Grid1D>,
typename ExecSpace::memory_space>;
25using CoefficientField1D = DField<IdxRange<Grid1D>,
typename ExecSpace::memory_space>;
52 IdxRange<Grid1D>
const& idx_range,
53 SplineBuilder
const& builder)
55 constexpr int nbc_xmin = SplineBuilder::s_nbc_xmin;
56 constexpr int nbc_xmax = SplineBuilder::s_nbc_xmax;
58 SplineBuilder::s_bc_xmin == ddc::BoundCond::HERMITE,
59 "The neumann spline quadrature requires a builder which uses Hermite boundary "
62 SplineBuilder::s_bc_xmax == ddc::BoundCond::HERMITE,
63 "The neumann spline quadrature requires a builder which uses Hermite boundary "
67 "The neumann spline quadrature requires a builder which uses the value of the "
71 "The neumann spline quadrature requires a builder which uses the value of the "
73 assert(idx_range.size()
74 == ddc::discrete_space<typename SplineBuilder::bsplines_type>().nbasis() - nbc_xmin
77 DFieldMem<IdxRange<Grid1D>,
typename SplineBuilder::memory_space> quadrature_coefficients(
78 builder.interpolation_domain());
82 std::tie(std::ignore, quadrature_coefficients, std::ignore) = builder.quadrature_coefficients();
83 DFieldMem<IdxRange<Grid1D>,
typename ExecSpace::memory_space> output_quad_coefficients(
85 ddc::parallel_deepcopy(output_quad_coefficients, quadrature_coefficients[idx_range]);
86 return output_quad_coefficients;
108 IdxRange<DDims...>
const& idx_range,
109 SplineBuilders
const&... builders)
111 assert((std::is_same_v<
112 typename DDims::continuous_dimension_type,
113 typename SplineBuilders::continuous_dimension_type> and ...));
116 std::tuple<CoefficientFieldMem1D<Kokkos::DefaultHostExecutionSpace, DDims>...>
117 current_dim_coeffs_alloc(
119 Kokkos::DefaultHostExecutionSpace>(ddc::select<DDims>(idx_range), builders)...);
120 std::tuple<CoefficientField1D<Kokkos::DefaultHostExecutionSpace, DDims>...> current_dim_coeffs(
121 get_field(std::get<CoefficientFieldMem1D<Kokkos::DefaultHostExecutionSpace, DDims>>(
122 current_dim_coeffs_alloc))...);
124 DFieldMem<IdxRange<DDims...>,
typename ExecSpace::memory_space> coefficients_alloc(idx_range);
125 auto coefficients_alloc_host = ddc::create_mirror(get_field(coefficients_alloc));
126 host_t<DField<IdxRange<DDims...>>> coefficients(get_field(coefficients_alloc_host));
129 ddc::for_each(idx_range, [&](Idx<DDims...>
const idim) {
132 = (std::get<CoefficientField1D<Kokkos::DefaultHostExecutionSpace, DDims>>(
133 current_dim_coeffs)(ddc::select<DDims>(idim))
136 ddc::parallel_deepcopy(coefficients_alloc, coefficients_alloc_host);
137 return coefficients_alloc;
DFieldMem< IdxRange< Grid1D >, typename ExecSpace::memory_space > neumann_spline_quadrature_coefficients_1d(IdxRange< Grid1D > const &idx_range, SplineBuilder const &builder)
Get the spline quadrature coefficients in 1D.
Definition neumann_spline_quadrature.hpp:51
DFieldMem< IdxRange< DDims... >, typename ExecSpace::memory_space > neumann_spline_quadrature_coefficients(IdxRange< DDims... > const &idx_range, SplineBuilders const &... builders)
Get the spline quadrature coefficients in ND from N 1D quadrature coefficient.
Definition neumann_spline_quadrature.hpp:107