3 #include "ddc_alias_inline_functions.hpp"
4 #include "ddc_aliases.hpp"
5 #include "geometry.hpp"
6 #include "i_interpolator_2d_rp.hpp"
14 template <
class RadialExtrapolationRule>
20 Kokkos::DefaultHostExecutionSpace,
26 RadialExtrapolationRule,
27 RadialExtrapolationRule,
28 ddc::PeriodicExtrapolationRule<Theta>,
29 ddc::PeriodicExtrapolationRule<Theta>,
34 SplineRThetaBuilder
const& m_builder;
38 mutable host_t<DFieldMem<IdxRangeBSRTheta>> m_coefs;
40 using r_deriv_type = host_t<DConstField<SplineRThetaBuilder::batched_derivs_domain_type1>>;
41 using p_deriv_type = host_t<DConstField<SplineRThetaBuilder::batched_derivs_domain_type2>>;
42 using mixed_deriv_type = host_t<DConstField<SplineRThetaBuilder::batched_derivs_domain_type>>;
52 , m_evaluator(evaluator)
53 , m_coefs(get_spline_idx_range(builder))
72 host_t<DFieldRTheta>
const inout_data,
73 host_t<Field<CoordRTheta const, IdxRangeRTheta>>
const coordinates)
const override
78 IdxRangeR r_idx_range = get_idx_range<GridR>(inout_data);
79 IdxRangeTheta theta_idx_range = get_idx_range<GridTheta>(inout_data);
80 if (ddc::coordinate(r_idx_range.front()) == 0) {
81 ddc::for_each(theta_idx_range, [&](IdxTheta
const ip) {
82 bool const unicity_center_point
83 = inout_data(r_idx_range.front(), ip)
84 == inout_data(r_idx_range.front(), theta_idx_range.front());
85 if (!unicity_center_point) {
86 std::printf(
"Unicity of the value at the center point is not verified.");
87 assert(unicity_center_point);
93 m_builder(get_field(m_coefs), get_const_field(inout_data));
94 m_evaluator(get_field(inout_data), coordinates, get_const_field(m_coefs));
108 template <
class RadialExtrapolationRule>
114 Kokkos::DefaultHostExecutionSpace,
120 RadialExtrapolationRule,
121 RadialExtrapolationRule,
122 ddc::PeriodicExtrapolationRule<Theta>,
123 ddc::PeriodicExtrapolationRule<Theta>,
128 SplineRThetaBuilder
const& m_builder;
139 SplineRThetaBuilder
const& builder,
142 , m_evaluator(evaluator)
155 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:110
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:125
PreallocatableSplineInterpolatorRTheta(SplineRThetaBuilder const &builder, evaluator_type const &evaluator)
Create an object capable of creating SplineInterpolatorRTheta objects.
Definition: spline_interpolator_2d_rp.hpp:138
std::unique_ptr< IInterpolatorRTheta > preallocate() const override
Create a pointer to an instance of the SplineInterpolatorRTheta class.
Definition: spline_interpolator_2d_rp.hpp:153
A class for interpolating a function using splines in polar coordinates.
Definition: spline_interpolator_2d_rp.hpp:16
SplineInterpolatorRTheta(SplineRThetaBuilder const &builder, evaluator_type const &evaluator)
Create a spline interpolator object.
Definition: spline_interpolator_2d_rp.hpp:50
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:71
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