Skip to content

Commit

Permalink
Merge branch 'ebourne_remove_unused_test_files' into 'main'
Browse files Browse the repository at this point in the history
Remove unused test files

See merge request gysela-developpers/gyselalibxx!833

--------------------------------------------
  • Loading branch information
EmilyBourne committed Jan 9, 2025
1 parent 7c25702 commit ea53d18
Show file tree
Hide file tree
Showing 26 changed files with 176 additions and 145 deletions.
15 changes: 9 additions & 6 deletions simulations/geometryRTheta/diocotron/diocotron.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ using PoissonSolver = PolarSplineFEMPoissonLikeSolver<
GridR,
GridTheta,
PolarBSplinesRTheta,
SplineRThetaEvaluatorNullBound>;
using DiscreteMappingBuilder
= DiscreteToCartesianBuilder<X, Y, SplineRThetaBuilder, SplineRThetaEvaluatorConstBound>;
SplineRThetaEvaluatorNullBound_host>;
using DiscreteMappingBuilder = DiscreteToCartesianBuilder<
X,
Y,
SplineRThetaBuilder_host,
SplineRThetaEvaluatorConstBound_host>;
using LogicalToPhysicalMapping = CircularToCartesian<R, Theta, X, Y>;

namespace fs = std::filesystem;
Expand Down Expand Up @@ -101,15 +104,15 @@ int main(int argc, char** argv)


// OPERATORS ======================================================================================
SplineRThetaBuilder const builder(mesh_rp);
SplineRThetaBuilder_host const builder(mesh_rp);

// --- Define the mapping. ------------------------------------------------------------------------
ddc::ConstantExtrapolationRule<R, Theta> boundary_condition_r_left(
ddc::coordinate(mesh_r.front()));
ddc::ConstantExtrapolationRule<R, Theta> boundary_condition_r_right(
ddc::coordinate(mesh_r.back()));

SplineRThetaEvaluatorConstBound spline_evaluator_extrapol(
SplineRThetaEvaluatorConstBound_host spline_evaluator_extrapol(
boundary_condition_r_left,
boundary_condition_r_right,
ddc::PeriodicExtrapolationRule<Theta>(),
Expand Down Expand Up @@ -157,7 +160,7 @@ int main(int argc, char** argv)
// --- Advection operator -------------------------------------------------------------------------
ddc::NullExtrapolationRule r_extrapolation_rule;
ddc::PeriodicExtrapolationRule<Theta> p_extrapolation_rule;
SplineRThetaEvaluatorNullBound spline_evaluator(
SplineRThetaEvaluatorNullBound_host spline_evaluator(
r_extrapolation_rule,
r_extrapolation_rule,
p_extrapolation_rule,
Expand Down
15 changes: 9 additions & 6 deletions simulations/geometryRTheta/vortex_merger/vortex_merger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ using PoissonSolver = PolarSplineFEMPoissonLikeSolver<
GridR,
GridTheta,
PolarBSplinesRTheta,
SplineRThetaEvaluatorNullBound>;
using DiscreteMappingBuilder
= DiscreteToCartesianBuilder<X, Y, SplineRThetaBuilder, SplineRThetaEvaluatorConstBound>;
SplineRThetaEvaluatorNullBound_host>;
using DiscreteMappingBuilder = DiscreteToCartesianBuilder<
X,
Y,
SplineRThetaBuilder_host,
SplineRThetaEvaluatorConstBound_host>;
using LogicalToPhysicalMapping = CircularToCartesian<R, Theta, X, Y>;

} // end namespace
Expand Down Expand Up @@ -96,15 +99,15 @@ int main(int argc, char** argv)


// OPERATORS ======================================================================================
SplineRThetaBuilder const builder(grid);
SplineRThetaBuilder_host const builder(grid);

// --- Define the mapping. ------------------------------------------------------------------------
ddc::ConstantExtrapolationRule<R, Theta> boundary_condition_r_left(
ddc::coordinate(mesh_r.front()));
ddc::ConstantExtrapolationRule<R, Theta> boundary_condition_r_right(
ddc::coordinate(mesh_r.back()));

SplineRThetaEvaluatorConstBound spline_evaluator_extrapol(
SplineRThetaEvaluatorConstBound_host spline_evaluator_extrapol(
boundary_condition_r_left,
boundary_condition_r_right,
ddc::PeriodicExtrapolationRule<Theta>(),
Expand Down Expand Up @@ -132,7 +135,7 @@ int main(int argc, char** argv)
// --- Advection operator -------------------------------------------------------------------------
ddc::NullExtrapolationRule r_extrapolation_rule;
ddc::PeriodicExtrapolationRule<Theta> p_extrapolation_rule;
SplineRThetaEvaluatorNullBound spline_evaluator(
SplineRThetaEvaluatorNullBound_host spline_evaluator(
r_extrapolation_rule,
r_extrapolation_rule,
p_extrapolation_rule,
Expand Down
10 changes: 5 additions & 5 deletions src/geometryRTheta/advection/spline_foot_finder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class SplineFootFinder : public IFootFinder
AdvectionDomain const& m_advection_domain;
InvAdvectionMapping m_mapping;

SplineRThetaBuilder const& m_builder_advection_field;
SplineRThetaEvaluatorConstBound const& m_evaluator_advection_field;
SplineRThetaBuilder_host const& m_builder_advection_field;
SplineRThetaEvaluatorConstBound_host const& m_evaluator_advection_field;


public:
Expand Down Expand Up @@ -79,8 +79,8 @@ class SplineFootFinder : public IFootFinder
TimeStepper const& time_stepper,
AdvectionDomain const& advection_domain,
Mapping const& mapping,
SplineRThetaBuilder const& builder_advection_field,
SplineRThetaEvaluatorConstBound const& evaluator_advection_field,
SplineRThetaBuilder_host const& builder_advection_field,
SplineRThetaEvaluatorConstBound_host const& evaluator_advection_field,
double epsilon = 1e-12)
: m_time_stepper(time_stepper)
, m_advection_domain(advection_domain)
Expand Down Expand Up @@ -220,7 +220,7 @@ class SplineFootFinder : public IFootFinder
* The table of values we want to unify at the central point.
*/
template <class T>
void unify_value_at_center_pt(FieldRTheta<T> values) const
void unify_value_at_center_pt(Field<T, IdxRangeRTheta, Kokkos::HostSpace> values) const
{
IdxRangeR const r_idx_range = get_idx_range<GridR>(values);
IdxRangeTheta const theta_idx_range = get_idx_range<GridTheta>(values);
Expand Down
10 changes: 5 additions & 5 deletions src/geometryRTheta/advection_field/advection_field_rp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class AdvectionFieldFinder
PolarSplineEvaluator<PolarBSplinesRTheta, ddc::NullExtrapolationRule, Kokkos::HostSpace> const
m_polar_spline_evaluator;

SplineRThetaEvaluatorNullBound const m_spline_evaluator;
SplineRThetaEvaluatorNullBound_host const m_spline_evaluator;

double const m_epsilon;

Expand Down Expand Up @@ -145,7 +145,7 @@ class AdvectionFieldFinder
IdxRangeRTheta const grid = get_idx_range(advection_field_xy);

// Compute the spline representation of the electrostatic potential
SplineRThetaBuilder const builder(grid);
SplineRThetaBuilder_host const builder(grid);
IdxRangeBSRTheta const idx_range_bsplinesRTheta = get_spline_idx_range(builder);
host_t<Spline2DMem> electrostatic_potential_coef(idx_range_bsplinesRTheta);
builder(get_field(electrostatic_potential_coef), get_const_field(electrostatic_potential));
Expand Down Expand Up @@ -215,7 +215,7 @@ class AdvectionFieldFinder
static_assert(
(std::is_same_v<
Evaluator,
SplineRThetaEvaluatorNullBound> && std::is_same_v<SplineType, host_t<Spline2D>>)
SplineRThetaEvaluatorNullBound_host> && std::is_same_v<SplineType, host_t<Spline2D>>)
|| (std::is_same_v<
Evaluator,
PolarSplineEvaluator<
Expand Down Expand Up @@ -362,7 +362,7 @@ class AdvectionFieldFinder
IdxRangeRTheta const grid = get_idx_range(electrostatic_potential);

// Compute the spline representation of the electrostatic potential
SplineRThetaBuilder const builder(grid);
SplineRThetaBuilder_host const builder(grid);
IdxRangeBSRTheta const idx_range_bsplinesRTheta = get_spline_idx_range(builder);
host_t<Spline2DMem> electrostatic_potential_coef(idx_range_bsplinesRTheta);
builder(get_field(electrostatic_potential_coef), get_const_field(electrostatic_potential));
Expand Down Expand Up @@ -446,7 +446,7 @@ class AdvectionFieldFinder
static_assert(
(std::is_same_v<
Evaluator,
SplineRThetaEvaluatorNullBound> && std::is_same_v<SplineType, host_t<Spline2D>>)
SplineRThetaEvaluatorNullBound_host> && std::is_same_v<SplineType, host_t<Spline2D>>)
|| (std::is_same_v<
Evaluator,
PolarSplineEvaluator<
Expand Down
9 changes: 4 additions & 5 deletions src/geometryRTheta/geometry/geometry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ struct GridTheta : SplineInterpPointsTheta::interpolation_discrete_dimension_typ
};

// --- Operators
using SplineRThetaBuilder = ddc::SplineBuilder2D<
using SplineRThetaBuilder_host = ddc::SplineBuilder2D<
Kokkos::DefaultHostExecutionSpace,
Kokkos::HostSpace,
BSplinesR,
Expand All @@ -135,7 +135,7 @@ using SplineRThetaBuilder = ddc::SplineBuilder2D<
GridR,
GridTheta>;

using SplineRThetaEvaluatorConstBound = ddc::SplineEvaluator2D<
using SplineRThetaEvaluatorConstBound_host = ddc::SplineEvaluator2D<
Kokkos::DefaultHostExecutionSpace,
Kokkos::HostSpace,
BSplinesR,
Expand All @@ -149,7 +149,7 @@ using SplineRThetaEvaluatorConstBound = ddc::SplineEvaluator2D<
GridR,
GridTheta>;

using SplineRThetaEvaluatorNullBound = ddc::SplineEvaluator2D<
using SplineRThetaEvaluatorNullBound_host = ddc::SplineEvaluator2D<
Kokkos::DefaultHostExecutionSpace,
Kokkos::HostSpace,
BSplinesR,
Expand Down Expand Up @@ -206,9 +206,8 @@ using FieldR = Field<ElementType, IdxRangeR>;
template <class ElementType>
using FieldTheta = Field<ElementType, IdxRangeTheta>;

// Equivalent to host_t<Field<ElementType, IdxRangeRTheta>> but used for type deductions
template <class ElementType>
using FieldRTheta = Field<ElementType, IdxRangeRTheta, Kokkos::HostSpace>;
using FieldRTheta = Field<ElementType, IdxRangeRTheta>;

using DFieldR = FieldR<double>;
using DFieldTheta = FieldTheta<double>;
Expand Down
12 changes: 6 additions & 6 deletions src/geometryRTheta/initialization/vortex_merger_equilibrium.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ class VortexMergerEquilibria
private:
Mapping const& m_mapping;
IdxRangeRTheta const& m_grid;
SplineRThetaBuilder const& m_builder;
SplineRThetaEvaluatorNullBound const& m_evaluator;
SplineRThetaBuilder_host const& m_builder;
SplineRThetaEvaluatorNullBound_host const& m_evaluator;
PolarSplineFEMPoissonLikeSolver<
GridR,
GridTheta,
PolarBSplinesRTheta,
SplineRThetaEvaluatorNullBound> const& m_poisson_solver;
SplineRThetaEvaluatorNullBound_host> const& m_poisson_solver;

public:
/**
Expand All @@ -54,13 +54,13 @@ class VortexMergerEquilibria
VortexMergerEquilibria(
Mapping const& mapping,
IdxRangeRTheta const& grid,
SplineRThetaBuilder const& builder,
SplineRThetaEvaluatorNullBound const& evaluator,
SplineRThetaBuilder_host const& builder,
SplineRThetaEvaluatorNullBound_host const& evaluator,
PolarSplineFEMPoissonLikeSolver<
GridR,
GridTheta,
PolarBSplinesRTheta,
SplineRThetaEvaluatorNullBound> const& poisson_solver)
SplineRThetaEvaluatorNullBound_host> const& poisson_solver)
: m_mapping(mapping)
, m_grid(grid)
, m_builder(builder)
Expand Down
17 changes: 10 additions & 7 deletions src/geometryRTheta/interpolation/spline_interpolator_2d_rp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,26 @@ class SplineInterpolatorRTheta : public IInterpolatorRTheta
GridTheta>;

private:
SplineRThetaBuilder const& m_builder;
SplineRThetaBuilder_host const& m_builder;

evaluator_type const& m_evaluator;

mutable host_t<DFieldMem<IdxRangeBSRTheta>> m_coefs;

using r_deriv_type = host_t<DConstField<SplineRThetaBuilder::batched_derivs_domain_type1>>;
using p_deriv_type = host_t<DConstField<SplineRThetaBuilder::batched_derivs_domain_type2>>;
using mixed_deriv_type = host_t<DConstField<SplineRThetaBuilder::batched_derivs_domain_type>>;
using r_deriv_type = host_t<DConstField<SplineRThetaBuilder_host::batched_derivs_domain_type1>>;
using p_deriv_type = host_t<DConstField<SplineRThetaBuilder_host::batched_derivs_domain_type2>>;
using mixed_deriv_type
= host_t<DConstField<SplineRThetaBuilder_host::batched_derivs_domain_type>>;

public:
/**
* @brief Create a spline interpolator object.
* @param[in] builder An operator which builds spline coefficients from the values of a function at known interpolation points.
* @param[in] evaluator An operator which evaluates the value of a spline at requested coordinates.
*/
SplineInterpolatorRTheta(SplineRThetaBuilder const& builder, evaluator_type const& evaluator)
SplineInterpolatorRTheta(
SplineRThetaBuilder_host const& builder,
evaluator_type const& evaluator)
: m_builder(builder)
, m_evaluator(evaluator)
, m_coefs(get_spline_idx_range(builder))
Expand Down Expand Up @@ -125,7 +128,7 @@ class PreallocatableSplineInterpolatorRTheta : public IPreallocatableInterpolato
GridTheta>;

private:
SplineRThetaBuilder const& m_builder;
SplineRThetaBuilder_host const& m_builder;

evaluator_type const& m_evaluator;

Expand All @@ -136,7 +139,7 @@ class PreallocatableSplineInterpolatorRTheta : public IPreallocatableInterpolato
* @param[in] evaluator An operator which evaluates the value of a spline at requested coordinates.
*/
PreallocatableSplineInterpolatorRTheta(
SplineRThetaBuilder const& builder,
SplineRThetaBuilder_host const& builder,
evaluator_type const& evaluator)
: m_builder(builder)
, m_evaluator(evaluator)
Expand Down
12 changes: 6 additions & 6 deletions src/geometryRTheta/time_solver/bsl_predcorr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ class BslPredCorrRTheta : public ITimeSolverRTheta
GridR,
GridTheta,
PolarBSplinesRTheta,
SplineRThetaEvaluatorNullBound> const& m_poisson_solver;
SplineRThetaEvaluatorNullBound_host> const& m_poisson_solver;

SplineRThetaBuilder const& m_builder;
SplineRThetaEvaluatorNullBound const& m_spline_evaluator;
SplineRThetaBuilder_host const& m_builder;
SplineRThetaEvaluatorNullBound_host const& m_spline_evaluator;


public:
Expand All @@ -93,13 +93,13 @@ class BslPredCorrRTheta : public ITimeSolverRTheta
BslPredCorrRTheta(
Mapping const& mapping,
BslAdvectionRTheta<FootFinder, Mapping> const& advection_solver,
SplineRThetaBuilder const& builder,
SplineRThetaEvaluatorNullBound const& rhs_evaluator,
SplineRThetaBuilder_host const& builder,
SplineRThetaEvaluatorNullBound_host const& rhs_evaluator,
PolarSplineFEMPoissonLikeSolver<
GridR,
GridTheta,
PolarBSplinesRTheta,
SplineRThetaEvaluatorNullBound> const& poisson_solver)
SplineRThetaEvaluatorNullBound_host> const& poisson_solver)
: m_mapping(mapping)
, m_advection_solver(advection_solver)
, m_poisson_solver(poisson_solver)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ class BslExplicitPredCorrRTheta : public ITimeSolverRTheta
GridR,
GridTheta,
PolarBSplinesRTheta,
SplineRThetaEvaluatorNullBound> const& m_poisson_solver;
SplineRThetaEvaluatorNullBound_host> const& m_poisson_solver;

SplineRThetaBuilder const& m_builder;
SplineRThetaEvaluatorConstBound const& m_evaluator;
SplineRThetaBuilder_host const& m_builder;
SplineRThetaEvaluatorConstBound_host const& m_evaluator;



Expand Down Expand Up @@ -122,14 +122,14 @@ class BslExplicitPredCorrRTheta : public ITimeSolverRTheta
Mapping const& mapping,
BslAdvectionRTheta<SplineFootFinderType, Mapping>& advection_solver,
IdxRangeRTheta const& grid,
SplineRThetaBuilder const& builder,
SplineRThetaEvaluatorNullBound const& rhs_evaluator,
SplineRThetaBuilder_host const& builder,
SplineRThetaEvaluatorNullBound_host const& rhs_evaluator,
PolarSplineFEMPoissonLikeSolver<
GridR,
GridTheta,
PolarBSplinesRTheta,
SplineRThetaEvaluatorNullBound> const& poisson_solver,
SplineRThetaEvaluatorConstBound const& advection_evaluator)
SplineRThetaEvaluatorNullBound_host> const& poisson_solver,
SplineRThetaEvaluatorConstBound_host const& advection_evaluator)
: m_mapping(mapping)
, m_advection_solver(advection_solver)
, m_euler(grid)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ class BslImplicitPredCorrRTheta : public ITimeSolverRTheta
GridR,
GridTheta,
PolarBSplinesRTheta,
SplineRThetaEvaluatorNullBound> const& m_poisson_solver;
SplineRThetaEvaluatorNullBound_host> const& m_poisson_solver;

SplineRThetaBuilder const& m_builder;
SplineRThetaEvaluatorConstBound const& m_evaluator;
SplineRThetaBuilder_host const& m_builder;
SplineRThetaEvaluatorConstBound_host const& m_evaluator;



Expand Down Expand Up @@ -121,14 +121,14 @@ class BslImplicitPredCorrRTheta : public ITimeSolverRTheta
Mapping const& mapping,
BslAdvectionRTheta<SplineFootFinderType, Mapping> const& advection_solver,
IdxRangeRTheta const& grid,
SplineRThetaBuilder const& builder,
SplineRThetaEvaluatorNullBound const& rhs_evaluator,
SplineRThetaBuilder_host const& builder,
SplineRThetaEvaluatorNullBound_host const& rhs_evaluator,
PolarSplineFEMPoissonLikeSolver<
GridR,
GridTheta,
PolarBSplinesRTheta,
SplineRThetaEvaluatorNullBound> const& poisson_solver,
SplineRThetaEvaluatorConstBound const& advection_evaluator)
SplineRThetaEvaluatorNullBound_host> const& poisson_solver,
SplineRThetaEvaluatorConstBound_host const& advection_evaluator)
: m_mapping(mapping)
, m_advection_solver(advection_solver)
, m_euler(grid)
Expand Down
Loading

0 comments on commit ea53d18

Please sign in to comment.