Skip to content

Commit

Permalink
Remove SLL splines
Browse files Browse the repository at this point in the history
Use DDC splines in the r-theta geometry and the polar splines. As a result SLL splines are unused. They are therefore removed. Fixes #172

See merge request gysela-developpers/gyselalibxx!410

--------------------------------------------

Co-authored-by: Alexander Hoffmann <[email protected]>
  • Loading branch information
EmilyBourne and alex-m-h committed Apr 2, 2024
1 parent 7be56cc commit 13203ff
Show file tree
Hide file tree
Showing 108 changed files with 1,312 additions and 9,380 deletions.
2 changes: 1 addition & 1 deletion ci_tools/reusable_ci_jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ setup_env_mr:
timeout: 2 hours
variables:
GIT_SUBMODULE_STRATEGY: recursive
GENERAL_CMAKE_OPTIONS: "-DKokkos_ENABLE_DEPRECATED_CODE_3=OFF -DKokkos_ENABLE_DEPRECATION_WARNINGS=OFF -DSLL_SPLINES_TEST_DEGREE_MIN=1 -DSLL_SPLINES_TEST_DEGREE_MAX=7 -DSLL_BUILD_TESTING=$SLL_BUILD_TESTING -DPOISSON_2D_BUILD_TESTING=$POISSON_2D_BUILD_TESTING"
GENERAL_CMAKE_OPTIONS: "-DKokkos_ENABLE_DEPRECATED_CODE_3=OFF -DKokkos_ENABLE_DEPRECATION_WARNINGS=OFF -DSLL_SPLINES_TEST_DEGREE_MIN=1 -DSLL_SPLINES_TEST_DEGREE_MAX=6 -DSLL_BUILD_TESTING=$SLL_BUILD_TESTING -DPOISSON_2D_BUILD_TESTING=$POISSON_2D_BUILD_TESTING"
2 changes: 1 addition & 1 deletion simulations/geometryRTheta/diocotron/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function (diocotron_executable PREDCORR_METHOD TIME_METHOD )

Eigen3::Eigen

sll::splines
sll::SLL
gslx::paraconfpp

gslx::poisson_RTheta
Expand Down
37 changes: 17 additions & 20 deletions simulations/geometryRTheta/diocotron/diocotron.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@

#include <ddc/ddc.hpp>

#include <sll/constant_extrapolation_boundary_value.hpp>
#include <sll/mapping/circular_to_cartesian.hpp>
#include <sll/mapping/czarny_to_cartesian.hpp>
#include <sll/mapping/discrete_mapping_to_cartesian.hpp>
#include <sll/null_boundary_value.hpp>
#include <sll/spline_builder_2d.hpp>
#include <sll/spline_evaluator_2d.hpp>

#include <paraconf.h>
#include <pdi.h>
Expand Down Expand Up @@ -47,7 +43,8 @@

namespace {
using PoissonSolver = PolarSplineFEMPoissonSolver;
using DiscreteMapping = DiscreteToCartesian<RDimX, RDimY, SplineRPBuilder>;
using DiscreteMapping
= DiscreteToCartesian<RDimX, RDimY, SplineRPBuilder, SplineRPEvaluatorConstBound>;
using Mapping = CircularToCartesian<RDimX, RDimY, RDimR, RDimP>;

namespace fs = std::filesystem;
Expand Down Expand Up @@ -146,16 +143,14 @@ int main(int argc, char** argv)
SplineRPBuilder const builder(grid);

// --- Define the mapping. ------------------------------------------------------------------------
ConstantExtrapolationBoundaryValue2D<BSplinesR, BSplinesP, RDimR> boundary_condition_r_left(
r_min);
ConstantExtrapolationBoundaryValue2D<BSplinesR, BSplinesP, RDimR> boundary_condition_r_right(
r_max);
ddc::ConstantExtrapolationRule<RDimR, RDimP> boundary_condition_r_left(r_min);
ddc::ConstantExtrapolationRule<RDimR, RDimP> boundary_condition_r_right(r_max);

SplineRPEvaluator spline_evaluator_extrapol(
SplineRPEvaluatorConstBound spline_evaluator_extrapol(
boundary_condition_r_left,
boundary_condition_r_right,
g_null_boundary_2d<BSplinesR, BSplinesP>,
g_null_boundary_2d<BSplinesR, BSplinesP>);
ddc::PeriodicExtrapolationRule<RDimP>(),
ddc::PeriodicExtrapolationRule<RDimP>());

const Mapping mapping;
DiscreteMapping const discrete_mapping
Expand Down Expand Up @@ -185,11 +180,13 @@ int main(int argc, char** argv)


// --- Advection operator -------------------------------------------------------------------------
SplineRPEvaluator spline_evaluator(
g_null_boundary_2d<BSplinesR, BSplinesP>,
g_null_boundary_2d<BSplinesR, BSplinesP>,
g_null_boundary_2d<BSplinesR, BSplinesP>,
g_null_boundary_2d<BSplinesR, BSplinesP>);
ddc::NullExtrapolationRule r_extrapolation_rule;
ddc::PeriodicExtrapolationRule<RDimP> p_extrapolation_rule;
SplineRPEvaluatorNullBound spline_evaluator(
r_extrapolation_rule,
r_extrapolation_rule,
p_extrapolation_rule,
p_extrapolation_rule);

PreallocatableSplineInterpolatorRP interpolator(builder, spline_evaluator);

Expand All @@ -214,8 +211,8 @@ int main(int argc, char** argv)
Spline2D coeff_alpha_spline(dom_bsplinesRP);
Spline2D coeff_beta_spline(dom_bsplinesRP);

builder(coeff_alpha_spline, coeff_alpha);
builder(coeff_beta_spline, coeff_beta);
builder(coeff_alpha_spline.span_view(), coeff_alpha.span_cview());
builder(coeff_beta_spline.span_view(), coeff_beta.span_cview());

PoissonSolver poisson_solver(coeff_alpha_spline, coeff_beta_spline, discrete_mapping);

Expand Down Expand Up @@ -314,7 +311,7 @@ int main(int argc, char** argv)
// Compute phi equilibrium phi_eq from Poisson solver. ***********
DFieldRP phi_eq(grid);
Spline2D rho_coef_eq(dom_bsplinesRP);
builder(rho_coef_eq, rho_eq);
builder(rho_coef_eq.span_view(), rho_eq.span_cview());
PoissonRHSFunction poisson_rhs_eq(rho_coef_eq, spline_evaluator);
poisson_solver(poisson_rhs_eq, coords.span_cview(), phi_eq.span_view());

Expand Down
2 changes: 1 addition & 1 deletion simulations/geometryRTheta/vortex_merger/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ target_link_libraries(vortex_merger

Eigen3::Eigen

sll::splines
sll::SLL
gslx::paraconfpp

gslx::poisson_RTheta
Expand Down
39 changes: 18 additions & 21 deletions simulations/geometryRTheta/vortex_merger/vortex_merger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@

#include <ddc/ddc.hpp>

#include <sll/constant_extrapolation_boundary_value.hpp>
#include <sll/mapping/circular_to_cartesian.hpp>
#include <sll/mapping/czarny_to_cartesian.hpp>
#include <sll/mapping/discrete_mapping_to_cartesian.hpp>
#include <sll/null_boundary_value.hpp>
#include <sll/spline_builder_2d.hpp>
#include <sll/spline_evaluator_2d.hpp>

#include <paraconf.h>
#include <pdi.h>
Expand Down Expand Up @@ -48,7 +44,8 @@

namespace {
using PoissonSolver = PolarSplineFEMPoissonSolver;
using DiscreteMapping = DiscreteToCartesian<RDimX, RDimY, SplineRPBuilder>;
using DiscreteMapping
= DiscreteToCartesian<RDimX, RDimY, SplineRPBuilder, SplineRPEvaluatorConstBound>;
using CircularMapping = CircularToCartesian<RDimX, RDimY, RDimR, RDimP>;

} // end namespace
Expand Down Expand Up @@ -141,16 +138,14 @@ int main(int argc, char** argv)
SplineRPBuilder const builder(grid);

// --- Define the mapping. ------------------------------------------------------------------------
ConstantExtrapolationBoundaryValue2D<BSplinesR, BSplinesP, RDimR> boundary_condition_r_left(
r_min);
ConstantExtrapolationBoundaryValue2D<BSplinesR, BSplinesP, RDimR> boundary_condition_r_right(
r_max);
ddc::ConstantExtrapolationRule<RDimR, RDimP> boundary_condition_r_left(r_min);
ddc::ConstantExtrapolationRule<RDimR, RDimP> boundary_condition_r_right(r_max);

SplineRPEvaluator spline_evaluator_extrapol(
SplineRPEvaluatorConstBound spline_evaluator_extrapol(
boundary_condition_r_left,
boundary_condition_r_right,
g_null_boundary_2d<BSplinesR, BSplinesP>,
g_null_boundary_2d<BSplinesR, BSplinesP>);
ddc::PeriodicExtrapolationRule<RDimP>(),
ddc::PeriodicExtrapolationRule<RDimP>());

const CircularMapping mapping;
DiscreteMapping const discrete_mapping
Expand All @@ -166,11 +161,13 @@ int main(int argc, char** argv)


// --- Advection operator -------------------------------------------------------------------------
SplineRPEvaluator spline_evaluator(
g_null_boundary_2d<BSplinesR, BSplinesP>,
g_null_boundary_2d<BSplinesR, BSplinesP>,
g_null_boundary_2d<BSplinesR, BSplinesP>,
g_null_boundary_2d<BSplinesR, BSplinesP>);
ddc::NullExtrapolationRule r_extrapolation_rule;
ddc::PeriodicExtrapolationRule<RDimP> p_extrapolation_rule;
SplineRPEvaluatorNullBound spline_evaluator(
r_extrapolation_rule,
r_extrapolation_rule,
p_extrapolation_rule,
p_extrapolation_rule);

PreallocatableSplineInterpolatorRP interpolator(builder, spline_evaluator);

Expand All @@ -195,8 +192,8 @@ int main(int argc, char** argv)
Spline2D coeff_alpha_spline(dom_bsplinesRP);
Spline2D coeff_beta_spline(dom_bsplinesRP);

builder(coeff_alpha_spline, coeff_alpha);
builder(coeff_beta_spline, coeff_beta);
builder(coeff_alpha_spline.span_view(), coeff_alpha.span_cview());
builder(coeff_beta_spline.span_view(), coeff_beta.span_cview());

PoissonSolver poisson_solver(coeff_alpha_spline, coeff_beta_spline, discrete_mapping);

Expand Down Expand Up @@ -279,8 +276,8 @@ int main(int argc, char** argv)
// Compute phi equilibrium phi_eq from Poisson solver. ***********
DFieldRP phi_eq(grid);
Spline2D rho_coef_eq(dom_bsplinesRP);
builder(rho_coef_eq, rho_eq);
PoissonRHSFunction poisson_rhs_eq(rho_coef_eq, spline_evaluator);
builder(rho_coef_eq.span_view(), rho_eq.span_cview());
PoissonRHSFunction poisson_rhs_eq(rho_coef_eq.span_view(), spline_evaluator);
poisson_solver(poisson_rhs_eq, coords.span_cview(), phi_eq.span_view());


Expand Down
2 changes: 1 addition & 1 deletion src/advection/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ target_include_directories("advection"
target_link_libraries("advection"
INTERFACE
DDC::DDC
sll::splines
sll::SLL
gslx::interpolation
gslx::speciesinfo
gslx::utils
Expand Down
2 changes: 1 addition & 1 deletion src/geometry5D/geometry/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ target_include_directories("geometry5D"
)
target_link_libraries("geometry5D" INTERFACE
DDC::DDC
sll::splines
sll::SLL
gslx::speciesinfo
gslx::utils
)
Expand Down
2 changes: 1 addition & 1 deletion src/geometryRTheta/advection/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ target_include_directories(advection_rp
target_link_libraries(advection_rp
INTERFACE
DDC::DDC
sll::splines
sll::SLL
Eigen3::Eigen
gslx::interpolation_2D_rp
gslx::geometry_RTheta
Expand Down
4 changes: 2 additions & 2 deletions src/geometryRTheta/advection/advection_domain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ class AdvectionPseudoCartesianDomain : public AdvectionDomain<Mapping>
VectorDViewRP<RDimX_adv, RDimY_adv> const& advection_field,
double const dt) const
{
assert(typeid(m_mapping) != typeid(CircularToCartesian<RDimX, RDimY, RDimR, RDimP>));
static_assert(!std::is_same_v<Mapping, CircularToCartesian<RDimX, RDimY, RDimR, RDimP>>);
auto const rp_dom = advection_field.domain();

CircularToCartesian<RDimX_adv, RDimY_adv, RDimR, RDimP> const pseudo_Cartesian_mapping;
Expand Down Expand Up @@ -357,7 +357,7 @@ class AdvectionPseudoCartesianDomain : public AdvectionDomain<Mapping>
VectorDViewRP<RDimX, RDimY> advection_field,
VectorDSpanRP<RDimX_adv, RDimY_adv> advection_field_pseudo_Cart) const
{
assert(typeid(m_mapping) != typeid(CircularToCartesian<RDimX, RDimY, RDimR, RDimP>));
static_assert(!std::is_same_v<Mapping, CircularToCartesian<RDimX, RDimY, RDimR, RDimP>>);

IDomainRP const rp_dom = advection_field.domain();
CircularToCartesian<RDimX_adv, RDimY_adv, RDimR, RDimP> const pseudo_Cartesian_mapping;
Expand Down
5 changes: 3 additions & 2 deletions src/geometryRTheta/advection/bsl_advection_rp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ template <class FootFinder, class Mapping>
class BslAdvectionRP : public IAdvectionRP
{
private:
PreallocatableSplineInterpolatorRP const& m_interpolator;
PreallocatableSplineInterpolatorRP<ddc::NullExtrapolationRule> const& m_interpolator;

FootFinder const& m_find_feet;

Expand All @@ -84,7 +84,8 @@ class BslAdvectionRP : public IAdvectionRP
* A child class of IFootFinder.
*/
BslAdvectionRP(
PreallocatableSplineInterpolatorRP const& function_interpolator,
PreallocatableSplineInterpolatorRP<ddc::NullExtrapolationRule> const&
function_interpolator,
FootFinder const& foot_finder,
Mapping const& mapping)
: m_interpolator(function_interpolator)
Expand Down
8 changes: 4 additions & 4 deletions src/geometryRTheta/advection/spline_foot_finder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class SplineFootFinder : public IFootFinder
AdvectionDomain const& m_advection_domain;

SplineRPBuilder const& m_builder_advection_field;
SplineRPEvaluator const& m_evaluator_advection_field;
SplineRPEvaluatorConstBound const& m_evaluator_advection_field;


public:
Expand Down Expand Up @@ -64,7 +64,7 @@ class SplineFootFinder : public IFootFinder
TimeStepper const& time_stepper,
AdvectionDomain const& advection_domain,
SplineRPBuilder const& builder_advection_field,
SplineRPEvaluator const& evaluator_advection_field)
SplineRPEvaluatorConstBound const& evaluator_advection_field)
: m_time_stepper(time_stepper)
, m_advection_domain(advection_domain)
, m_builder_advection_field(builder_advection_field)
Expand Down Expand Up @@ -105,10 +105,10 @@ class SplineFootFinder : public IFootFinder
// Get the coefficients of the advection field in the advection domain.
m_builder_advection_field(
ddcHelper::get<RDimX_adv>(advection_field_in_adv_dom_coefs),
ddcHelper::get<RDimX_adv>(advection_field_in_adv_dom));
ddcHelper::get<RDimX_adv>(advection_field_in_adv_dom.span_cview()));
m_builder_advection_field(
ddcHelper::get<RDimY_adv>(advection_field_in_adv_dom_coefs),
ddcHelper::get<RDimY_adv>(advection_field_in_adv_dom));
ddcHelper::get<RDimY_adv>(advection_field_in_adv_dom.span_cview()));


// The function describing how the derivative of the evolve function is calculated.
Expand Down
4 changes: 2 additions & 2 deletions src/geometryRTheta/advection_field/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ target_include_directories("advection_field_RTheta"
)
target_link_libraries("advection_field_RTheta" INTERFACE
DDC::DDC
sll::splines
sll::SLL
gslx::speciesinfo
gslx::utils
gslx::poisson_RTheta
)
add_library("gslx::advection_field_RTheta" ALIAS "advection_field_RTheta")
add_library("gslx::advection_field_RTheta" ALIAS "advection_field_RTheta")
Loading

0 comments on commit 13203ff

Please sign in to comment.