diff --git a/src/geometryRTheta/advection_field/advection_field_rp.hpp b/src/geometryRTheta/advection_field/advection_field_rp.hpp index f9b152805..578dce584 100644 --- a/src/geometryRTheta/advection_field/advection_field_rp.hpp +++ b/src/geometryRTheta/advection_field/advection_field_rp.hpp @@ -98,7 +98,7 @@ class AdvectionFieldFinder private: Mapping const& m_mapping; - PolarSplineEvaluator const + PolarSplineEvaluator const m_polar_spline_evaluator; SplineRThetaEvaluatorNullBound const m_spline_evaluator; @@ -188,7 +188,7 @@ class AdvectionFieldFinder * The advection field on the physical axis. */ void operator()( - SplinePolar& electrostatic_potential_coef, + host_t& electrostatic_potential_coef, host_t> advection_field_xy) const { compute_advection_field_XY( @@ -223,7 +223,8 @@ class AdvectionFieldFinder Evaluator, PolarSplineEvaluator< PolarBSplinesRTheta, - ddc::NullExtrapolationRule>> && std::is_same_v)); + ddc::NullExtrapolationRule, + Kokkos::HostSpace>> && std::is_same_v>)); IdxRangeRTheta const grid = get_idx_range(advection_field_xy); host_t> electric_field(grid); @@ -412,7 +413,7 @@ class AdvectionFieldFinder * The advection field on the physical axis at the O-point. */ void operator()( - SplinePolar& electrostatic_potential_coef, + host_t& electrostatic_potential_coef, host_t> advection_field_rp, CoordXY& advection_field_xy_center) const { @@ -453,7 +454,8 @@ class AdvectionFieldFinder Evaluator, PolarSplineEvaluator< PolarBSplinesRTheta, - ddc::NullExtrapolationRule>> && std::is_same_v)); + ddc::NullExtrapolationRule, + Kokkos::HostSpace>> && std::is_same_v>)); IdxRangeRTheta const grid_without_Opoint = get_idx_range(advection_field_rp); diff --git a/src/geometryRTheta/poisson/polarpoissonlikesolver.hpp b/src/geometryRTheta/poisson/polarpoissonlikesolver.hpp index 17396d557..c96acf6ab 100644 --- a/src/geometryRTheta/poisson/polarpoissonlikesolver.hpp +++ b/src/geometryRTheta/poisson/polarpoissonlikesolver.hpp @@ -186,7 +186,8 @@ class PolarSplineFEMPoissonLikeSolver host_t> int_volume; - PolarSplineEvaluator m_polar_spline_evaluator; + PolarSplineEvaluator + m_polar_spline_evaluator; std::unique_ptr> m_gko_matrix; const int batch_idx {0}; @@ -653,7 +654,7 @@ class PolarSplineFEMPoissonLikeSolver * The spline representation of the solution @f$\phi@f$. */ template - void operator()(RHSFunction const& rhs, SplinePolar& spline) const + void operator()(RHSFunction const& rhs, host_t& spline) const { const int b_size = ddc::discrete_space().nbasis() - ddc::discrete_space().nbasis(); @@ -806,7 +807,7 @@ class PolarSplineFEMPoissonLikeSolver { IdxRangeBSTheta_Polar polar_idx_range( ddc::discrete_space().full_domain()); - SplinePolar + host_t spline(PolarBSplinesRTheta::singular_idx_range(), IdxRangeBSRTheta(radial_bsplines, polar_idx_range)); diff --git a/src/geometryRTheta/time_solver/bsl_predcorr.hpp b/src/geometryRTheta/time_solver/bsl_predcorr.hpp index e9bba40d4..8a52a9f04 100644 --- a/src/geometryRTheta/time_solver/bsl_predcorr.hpp +++ b/src/geometryRTheta/time_solver/bsl_predcorr.hpp @@ -123,11 +123,11 @@ class BslPredCorrRTheta : public ITimeSolverRTheta IdxStep {PolarBSplinesRTheta::continuity + 1})); IdxRangeBSTheta polar_idx_range(ddc::discrete_space().full_domain()); - SplinePolar electrostatic_potential_coef( + host_t electrostatic_potential_coef( PolarBSplinesRTheta::singular_idx_range(), IdxRangeBSRTheta(radial_bsplines, polar_idx_range)); ddc::NullExtrapolationRule extrapolation_rule; - PolarSplineEvaluator + PolarSplineEvaluator polar_spline_evaluator(extrapolation_rule); diff --git a/src/geometryRTheta/time_solver/bsl_predcorr_second_order_explicit.hpp b/src/geometryRTheta/time_solver/bsl_predcorr_second_order_explicit.hpp index b715c8e15..b05802784 100644 --- a/src/geometryRTheta/time_solver/bsl_predcorr_second_order_explicit.hpp +++ b/src/geometryRTheta/time_solver/bsl_predcorr_second_order_explicit.hpp @@ -158,12 +158,12 @@ class BslExplicitPredCorrRTheta : public ITimeSolverRTheta // --- Electrostatic potential (phi). ------------------------------------------------------------- host_t electrical_potential(grid); - SplinePolar electrostatic_potential_coef( + host_t electrostatic_potential_coef( PolarBSplinesRTheta::singular_idx_range(), IdxRangeBSRTheta(radial_bsplines, polar_idx_range)); ddc::NullExtrapolationRule extrapolation_rule; - PolarSplineEvaluator + PolarSplineEvaluator polar_spline_evaluator(extrapolation_rule); // --- For the computation of advection field from the electrostatic potential (phi): ------------- diff --git a/src/geometryRTheta/time_solver/bsl_predcorr_second_order_implicit.hpp b/src/geometryRTheta/time_solver/bsl_predcorr_second_order_implicit.hpp index 117557349..73a45c0a7 100644 --- a/src/geometryRTheta/time_solver/bsl_predcorr_second_order_implicit.hpp +++ b/src/geometryRTheta/time_solver/bsl_predcorr_second_order_implicit.hpp @@ -158,12 +158,12 @@ class BslImplicitPredCorrRTheta : public ITimeSolverRTheta // --- Electrostatic potential (phi). ------------------------------------------------------------- host_t electrical_potential(grid); - SplinePolar electrostatic_potential_coef( + host_t electrostatic_potential_coef( PolarBSplinesRTheta::singular_idx_range(), IdxRangeBSRTheta(radial_bsplines, polar_idx_range)); ddc::NullExtrapolationRule extrapolation_rule; - PolarSplineEvaluator + PolarSplineEvaluator polar_spline_evaluator(extrapolation_rule); // --- For the computation of advection field from the electrostatic potential (phi): ------------- diff --git a/src/utils/ddc_alias_inline_functions.hpp b/src/utils/ddc_alias_inline_functions.hpp index 40b1d9838..1ecf36a53 100644 --- a/src/utils/ddc_alias_inline_functions.hpp +++ b/src/utils/ddc_alias_inline_functions.hpp @@ -82,17 +82,19 @@ inline constexpr bool template inline constexpr bool enable_mem_type> = true; -template -inline constexpr bool enable_data_access_methods> = true; +template +inline constexpr bool enable_data_access_methods> = true; -template -inline constexpr bool enable_data_access_methods> = true; +template +inline constexpr bool + enable_data_access_methods> = true; -template -inline constexpr bool enable_data_access_methods> = true; +template +inline constexpr bool + enable_data_access_methods> = true; -template -inline constexpr bool enable_mem_type> = true; +template +inline constexpr bool enable_mem_type> = true; template static constexpr bool has_idx_range_v = detail::HasIdxRange::value; diff --git a/src/utils/ddc_helper.hpp b/src/utils/ddc_helper.hpp index dd06ba9b1..0be138765 100644 --- a/src/utils/ddc_helper.hpp +++ b/src/utils/ddc_helper.hpp @@ -7,6 +7,8 @@ #include +#include + #include "ddc_aliases.hpp" #include "directional_tag.hpp" #include "transpose.hpp" @@ -313,6 +315,20 @@ struct OnMemorySpace< using type = VectorField; }; +/** + * @brief Get a new `PolarSpline` type with the same parametrisation + * except in the memory space which is set to NewMemorySpace. + * @tparam NewMemorySpace The new memory space. + * @tparam PolarSplineType Type of the B-splines. + * @tparam MemorySpace The original memory space of the chunk of the VectorFieldMem. + * @see VectorField + */ +template +struct OnMemorySpace> +{ + using type = PolarSpline; +}; + template