3#include "ddc_alias_inline_functions.hpp"
4#include "ddc_aliases.hpp"
6#include "i_interpolator_2d_rp.hpp"
14template <
class RadialExtrapolationRule>
20 Kokkos::DefaultHostExecutionSpace,
26 RadialExtrapolationRule,
27 RadialExtrapolationRule,
28 ddc::PeriodicExtrapolationRule<Theta>,
29 ddc::PeriodicExtrapolationRule<Theta>,
34 SplineRThetaBuilder_host
const& m_builder;
38 mutable host_t<DFieldMem<IdxRangeBSRTheta>> m_coefs;
40 using r_deriv_type = host_t<DConstField<SplineRThetaBuilder_host::batched_derivs_domain_type1>>;
41 using p_deriv_type = host_t<DConstField<SplineRThetaBuilder_host::batched_derivs_domain_type2>>;
42 using mixed_deriv_type
43 = host_t<DConstField<SplineRThetaBuilder_host::batched_derivs_domain_type>>;
52 SplineRThetaBuilder_host
const& builder,
55 , m_evaluator(evaluator)
56 , m_coefs(get_spline_idx_range(builder))
75 host_t<DFieldRTheta>
const inout_data,
76 host_t<Field<CoordRTheta const, IdxRangeRTheta>>
const coordinates)
const override
81 IdxRangeR r_idx_range = get_idx_range<GridR>(inout_data);
82 IdxRangeTheta theta_idx_range = get_idx_range<GridTheta>(inout_data);
83 if (ddc::coordinate(r_idx_range.front()) == 0) {
84 ddc::for_each(theta_idx_range, [&](IdxTheta
const ip) {
85 bool const unicity_center_point
86 = inout_data(r_idx_range.front(), ip)
87 == inout_data(r_idx_range.front(), theta_idx_range.front());
88 if (!unicity_center_point) {
89 std::printf(
"Unicity of the value at the center point is not verified.");
90 assert(unicity_center_point);
96 m_builder(get_field(m_coefs), get_const_field(inout_data));
97 m_evaluator(get_field(inout_data), coordinates, get_const_field(m_coefs));
111template <
class RadialExtrapolationRule>
117 Kokkos::DefaultHostExecutionSpace,
123 RadialExtrapolationRule,
124 RadialExtrapolationRule,
125 ddc::PeriodicExtrapolationRule<Theta>,
126 ddc::PeriodicExtrapolationRule<Theta>,
131 SplineRThetaBuilder_host
const& m_builder;
142 SplineRThetaBuilder_host
const& builder,
145 , m_evaluator(evaluator)
158 return std::make_unique<
A class which provides an interpolating function.
Definition i_interpolator_2d_rp.hpp:18
A class which provides access to an interpolating function which can be preallocated where useful.
Definition i_interpolator_2d_rp.hpp:55
A class which stores information necessary to create a pointer to an instance of the SplineInterpolat...
Definition spline_interpolator_2d_rp.hpp:113
ddc::SplineEvaluator2D< Kokkos::DefaultHostExecutionSpace, Kokkos::HostSpace, BSplinesR, BSplinesTheta, GridR, GridTheta, RadialExtrapolationRule, RadialExtrapolationRule, ddc::PeriodicExtrapolationRule< Theta >, ddc::PeriodicExtrapolationRule< Theta >, GridR, GridTheta > evaluator_type
The type of the 2D Spline Evaluator used by this class.
Definition spline_interpolator_2d_rp.hpp:128
std::unique_ptr< IInterpolatorRTheta > preallocate() const override
Create a pointer to an instance of the SplineInterpolatorRTheta class.
Definition spline_interpolator_2d_rp.hpp:156
PreallocatableSplineInterpolatorRTheta(SplineRThetaBuilder_host const &builder, evaluator_type const &evaluator)
Create an object capable of creating SplineInterpolatorRTheta objects.
Definition spline_interpolator_2d_rp.hpp:141
A class for interpolating a function using splines in polar coordinates.
Definition spline_interpolator_2d_rp.hpp:16
SplineInterpolatorRTheta(SplineRThetaBuilder_host const &builder, evaluator_type const &evaluator)
Create a spline interpolator object.
Definition spline_interpolator_2d_rp.hpp:51
host_t< DFieldRTheta > operator()(host_t< DFieldRTheta > const inout_data, host_t< Field< CoordRTheta const, IdxRangeRTheta > > const coordinates) const override
Approximate the value of a function at a set of polar coordinates using the current values at a known...
Definition spline_interpolator_2d_rp.hpp:74
ddc::SplineEvaluator2D< Kokkos::DefaultHostExecutionSpace, Kokkos::HostSpace, BSplinesR, BSplinesTheta, GridR, GridTheta, RadialExtrapolationRule, RadialExtrapolationRule, ddc::PeriodicExtrapolationRule< Theta >, ddc::PeriodicExtrapolationRule< Theta >, GridR, GridTheta > evaluator_type
The type of the 2D Spline Evaluator used by this class.
Definition spline_interpolator_2d_rp.hpp:31
Definition geometry.hpp:93
Definition geometry.hpp:100
Definition geometry.hpp:116
Definition geometry.hpp:119