From ef8390343193e87991f91b672aae1f1220ff1e6a Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Mon, 10 Aug 2026 15:21:06 +0200 Subject: [PATCH 1/7] Remove default constructor --- .../DensityProfileCoefficients/poissonCoefficients.h | 1 - .../DensityProfileCoefficients/sonnendruckerCoefficients.h | 1 - .../DensityProfileCoefficients/sonnendruckerGyroCoefficients.h | 1 - .../InputFunctions/DensityProfileCoefficients/zoniCoefficients.h | 1 - .../DensityProfileCoefficients/zoniGyroCoefficients.h | 1 - .../DensityProfileCoefficients/zoniShiftedCoefficients.h | 1 - .../DensityProfileCoefficients/zoniShiftedGyroCoefficients.h | 1 - 7 files changed, 7 deletions(-) diff --git a/include/InputFunctions/DensityProfileCoefficients/poissonCoefficients.h b/include/InputFunctions/DensityProfileCoefficients/poissonCoefficients.h index 6f5d2e97..f6ea3d39 100644 --- a/include/InputFunctions/DensityProfileCoefficients/poissonCoefficients.h +++ b/include/InputFunctions/DensityProfileCoefficients/poissonCoefficients.h @@ -11,7 +11,6 @@ namespace gmgpolar class PoissonCoefficients { public: - PoissonCoefficients() = default; explicit PoissonCoefficients(double Rmax, double alpha); KOKKOS_FUNCTION double alpha(double r, double theta) const; diff --git a/include/InputFunctions/DensityProfileCoefficients/sonnendruckerCoefficients.h b/include/InputFunctions/DensityProfileCoefficients/sonnendruckerCoefficients.h index 2b8953b8..db58b285 100644 --- a/include/InputFunctions/DensityProfileCoefficients/sonnendruckerCoefficients.h +++ b/include/InputFunctions/DensityProfileCoefficients/sonnendruckerCoefficients.h @@ -11,7 +11,6 @@ namespace gmgpolar class SonnendruckerCoefficients { public: - SonnendruckerCoefficients() = default; explicit SonnendruckerCoefficients(double Rmax, double alpha); KOKKOS_FUNCTION double alpha(double r, double theta) const; diff --git a/include/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.h b/include/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.h index 6207372e..99efbbb1 100644 --- a/include/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.h +++ b/include/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.h @@ -11,7 +11,6 @@ namespace gmgpolar class SonnendruckerGyroCoefficients { public: - SonnendruckerGyroCoefficients() = default; explicit SonnendruckerGyroCoefficients(double Rmax, double alpha); KOKKOS_FUNCTION double alpha(double r, double theta) const; diff --git a/include/InputFunctions/DensityProfileCoefficients/zoniCoefficients.h b/include/InputFunctions/DensityProfileCoefficients/zoniCoefficients.h index d4845af1..4030d3a4 100644 --- a/include/InputFunctions/DensityProfileCoefficients/zoniCoefficients.h +++ b/include/InputFunctions/DensityProfileCoefficients/zoniCoefficients.h @@ -11,7 +11,6 @@ namespace gmgpolar class ZoniCoefficients { public: - ZoniCoefficients() = default; explicit ZoniCoefficients(double Rmax, double alpha); KOKKOS_FUNCTION double alpha(double r, double theta) const; diff --git a/include/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.h b/include/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.h index 9f48a6ee..e2b11240 100644 --- a/include/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.h +++ b/include/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.h @@ -11,7 +11,6 @@ namespace gmgpolar class ZoniGyroCoefficients { public: - ZoniGyroCoefficients() = default; explicit ZoniGyroCoefficients(double Rmax, double alpha); KOKKOS_FUNCTION double alpha(double r, double theta) const; diff --git a/include/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.h b/include/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.h index 3a590a23..46873d47 100644 --- a/include/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.h +++ b/include/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.h @@ -11,7 +11,6 @@ namespace gmgpolar class ZoniShiftedCoefficients { public: - ZoniShiftedCoefficients() = default; explicit ZoniShiftedCoefficients(double Rmax, double alpha); KOKKOS_FUNCTION double alpha(double r, double theta) const; diff --git a/include/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.h b/include/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.h index 9f18ea0d..50347ec6 100644 --- a/include/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.h +++ b/include/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.h @@ -11,7 +11,6 @@ namespace gmgpolar class ZoniShiftedGyroCoefficients { public: - ZoniShiftedGyroCoefficients() = default; explicit ZoniShiftedGyroCoefficients(double Rmax, double alpha); KOKKOS_FUNCTION double alpha(double r, double theta) const; From 3eaf86ab4b0f4daea7b94398d13698c110bc87f9 Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Mon, 10 Aug 2026 15:34:48 +0200 Subject: [PATCH 2/7] Add PolarGrid element to DensityProfileCoefficients --- .../DensityProfileCoefficients/poissonCoefficients.h | 4 +++- .../DensityProfileCoefficients/sonnendruckerCoefficients.h | 4 +++- .../sonnendruckerGyroCoefficients.h | 4 +++- .../DensityProfileCoefficients/zoniCoefficients.h | 4 +++- .../DensityProfileCoefficients/zoniGyroCoefficients.h | 4 +++- .../DensityProfileCoefficients/zoniShiftedCoefficients.h | 4 +++- .../DensityProfileCoefficients/zoniShiftedGyroCoefficients.h | 4 +++- .../DensityProfileCoefficients/poissonCoefficients.cpp | 5 +++-- .../DensityProfileCoefficients/sonnendruckerCoefficients.cpp | 5 +++-- .../sonnendruckerGyroCoefficients.cpp | 5 +++-- .../DensityProfileCoefficients/zoniCoefficients.cpp | 5 +++-- .../DensityProfileCoefficients/zoniGyroCoefficients.cpp | 5 +++-- .../DensityProfileCoefficients/zoniShiftedCoefficients.cpp | 5 +++-- .../zoniShiftedGyroCoefficients.cpp | 5 +++-- 14 files changed, 42 insertions(+), 21 deletions(-) diff --git a/include/InputFunctions/DensityProfileCoefficients/poissonCoefficients.h b/include/InputFunctions/DensityProfileCoefficients/poissonCoefficients.h index f6ea3d39..b66ef0a0 100644 --- a/include/InputFunctions/DensityProfileCoefficients/poissonCoefficients.h +++ b/include/InputFunctions/DensityProfileCoefficients/poissonCoefficients.h @@ -1,4 +1,5 @@ #pragma once +#include "../../PolarGrid/polargrid.h" #include #include @@ -11,7 +12,7 @@ namespace gmgpolar class PoissonCoefficients { public: - explicit PoissonCoefficients(double Rmax, double alpha); + explicit PoissonCoefficients(const PolarGrid& grid, double Rmax, double alpha); KOKKOS_FUNCTION double alpha(double r, double theta) const; KOKKOS_FUNCTION double beta(double r, double theta) const; @@ -19,6 +20,7 @@ class PoissonCoefficients KOKKOS_FUNCTION double getAlphaJump() const; private: + PolarGrid grid_; const double Rmax = 1.3; const double alpha_jump = 0.5 * 1.3; }; diff --git a/include/InputFunctions/DensityProfileCoefficients/sonnendruckerCoefficients.h b/include/InputFunctions/DensityProfileCoefficients/sonnendruckerCoefficients.h index db58b285..3f70cbaf 100644 --- a/include/InputFunctions/DensityProfileCoefficients/sonnendruckerCoefficients.h +++ b/include/InputFunctions/DensityProfileCoefficients/sonnendruckerCoefficients.h @@ -1,4 +1,5 @@ #pragma once +#include "../../PolarGrid/polargrid.h" #include #include @@ -11,7 +12,7 @@ namespace gmgpolar class SonnendruckerCoefficients { public: - explicit SonnendruckerCoefficients(double Rmax, double alpha); + explicit SonnendruckerCoefficients(const PolarGrid& grid, double Rmax, double alpha); KOKKOS_FUNCTION double alpha(double r, double theta) const; KOKKOS_FUNCTION double beta(double r, double theta) const; @@ -19,6 +20,7 @@ class SonnendruckerCoefficients KOKKOS_FUNCTION double getAlphaJump() const; private: + PolarGrid grid_; const double Rmax = 1.3; const double alpha_jump = 0.66 * 1.3; }; diff --git a/include/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.h b/include/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.h index 99efbbb1..dd3295ac 100644 --- a/include/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.h +++ b/include/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.h @@ -1,4 +1,5 @@ #pragma once +#include "../../PolarGrid/polargrid.h" #include #include @@ -11,7 +12,7 @@ namespace gmgpolar class SonnendruckerGyroCoefficients { public: - explicit SonnendruckerGyroCoefficients(double Rmax, double alpha); + explicit SonnendruckerGyroCoefficients(const PolarGrid& grid, double Rmax, double alpha); KOKKOS_FUNCTION double alpha(double r, double theta) const; KOKKOS_FUNCTION double beta(double r, double theta) const; @@ -19,6 +20,7 @@ class SonnendruckerGyroCoefficients KOKKOS_FUNCTION double getAlphaJump() const; private: + PolarGrid grid_; const double Rmax = 1.3; const double alpha_jump = 0.66 * 1.3; }; diff --git a/include/InputFunctions/DensityProfileCoefficients/zoniCoefficients.h b/include/InputFunctions/DensityProfileCoefficients/zoniCoefficients.h index 4030d3a4..9cd72fb7 100644 --- a/include/InputFunctions/DensityProfileCoefficients/zoniCoefficients.h +++ b/include/InputFunctions/DensityProfileCoefficients/zoniCoefficients.h @@ -1,4 +1,5 @@ #pragma once +#include "../../PolarGrid/polargrid.h" #include #include @@ -11,7 +12,7 @@ namespace gmgpolar class ZoniCoefficients { public: - explicit ZoniCoefficients(double Rmax, double alpha); + explicit ZoniCoefficients(const PolarGrid& grid, double Rmax, double alpha); KOKKOS_FUNCTION double alpha(double r, double theta) const; KOKKOS_FUNCTION double beta(double r, double theta) const; @@ -19,6 +20,7 @@ class ZoniCoefficients KOKKOS_FUNCTION double getAlphaJump() const; private: + PolarGrid grid_; const double Rmax = 1.3; const double alpha_jump = 0.4837 * 1.3; }; diff --git a/include/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.h b/include/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.h index e2b11240..1da050a6 100644 --- a/include/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.h +++ b/include/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.h @@ -1,4 +1,5 @@ #pragma once +#include "../../PolarGrid/polargrid.h" #include #include @@ -11,7 +12,7 @@ namespace gmgpolar class ZoniGyroCoefficients { public: - explicit ZoniGyroCoefficients(double Rmax, double alpha); + explicit ZoniGyroCoefficients(const PolarGrid& grid, double Rmax, double alpha); KOKKOS_FUNCTION double alpha(double r, double theta) const; KOKKOS_FUNCTION double beta(double r, double theta) const; @@ -19,6 +20,7 @@ class ZoniGyroCoefficients KOKKOS_FUNCTION double getAlphaJump() const; private: + PolarGrid grid_; const double Rmax = 1.3; const double alpha_jump = 0.4837 * 1.3; }; diff --git a/include/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.h b/include/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.h index 46873d47..42faf15b 100644 --- a/include/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.h +++ b/include/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.h @@ -1,4 +1,5 @@ #pragma once +#include "../../PolarGrid/polargrid.h" #include #include @@ -11,7 +12,7 @@ namespace gmgpolar class ZoniShiftedCoefficients { public: - explicit ZoniShiftedCoefficients(double Rmax, double alpha); + explicit ZoniShiftedCoefficients(const PolarGrid& grid, double Rmax, double alpha); KOKKOS_FUNCTION double alpha(double r, double theta) const; KOKKOS_FUNCTION double beta(double r, double theta) const; @@ -19,6 +20,7 @@ class ZoniShiftedCoefficients KOKKOS_FUNCTION double getAlphaJump() const; private: + PolarGrid grid_; const double Rmax = 1.3; const double alpha_jump = 0.678 * 1.3; }; diff --git a/include/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.h b/include/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.h index 50347ec6..604c7921 100644 --- a/include/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.h +++ b/include/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.h @@ -1,4 +1,5 @@ #pragma once +#include "../../PolarGrid/polargrid.h" #include #include @@ -11,7 +12,7 @@ namespace gmgpolar class ZoniShiftedGyroCoefficients { public: - explicit ZoniShiftedGyroCoefficients(double Rmax, double alpha); + explicit ZoniShiftedGyroCoefficients(const PolarGrid& grid, double Rmax, double alpha); KOKKOS_FUNCTION double alpha(double r, double theta) const; KOKKOS_FUNCTION double beta(double r, double theta) const; @@ -19,6 +20,7 @@ class ZoniShiftedGyroCoefficients KOKKOS_FUNCTION double getAlphaJump() const; private: + PolarGrid grid_; const double Rmax = 1.3; const double alpha_jump = 0.678 * 1.3; }; diff --git a/src/InputFunctions/DensityProfileCoefficients/poissonCoefficients.cpp b/src/InputFunctions/DensityProfileCoefficients/poissonCoefficients.cpp index 0d6adc6f..5cddbb58 100644 --- a/src/InputFunctions/DensityProfileCoefficients/poissonCoefficients.cpp +++ b/src/InputFunctions/DensityProfileCoefficients/poissonCoefficients.cpp @@ -1,8 +1,9 @@ #include using namespace gmgpolar; -PoissonCoefficients::PoissonCoefficients(double Rmax, double alpha_jump) - : Rmax(Rmax) +PoissonCoefficients::PoissonCoefficients(const PolarGrid& grid, double Rmax, double alpha_jump) + : grid_(grid) + , Rmax(Rmax) , alpha_jump(alpha_jump) { } diff --git a/src/InputFunctions/DensityProfileCoefficients/sonnendruckerCoefficients.cpp b/src/InputFunctions/DensityProfileCoefficients/sonnendruckerCoefficients.cpp index b5c2cda9..274b04fe 100644 --- a/src/InputFunctions/DensityProfileCoefficients/sonnendruckerCoefficients.cpp +++ b/src/InputFunctions/DensityProfileCoefficients/sonnendruckerCoefficients.cpp @@ -1,8 +1,9 @@ #include using namespace gmgpolar; -SonnendruckerCoefficients::SonnendruckerCoefficients(double Rmax, double alpha_jump) - : Rmax(Rmax) +SonnendruckerCoefficients::SonnendruckerCoefficients(const PolarGrid& grid, double Rmax, double alpha_jump) + : grid_(grid) + , Rmax(Rmax) , alpha_jump(alpha_jump) { } diff --git a/src/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.cpp b/src/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.cpp index 7add013c..57509d30 100644 --- a/src/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.cpp +++ b/src/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.cpp @@ -1,8 +1,9 @@ #include using namespace gmgpolar; -SonnendruckerGyroCoefficients::SonnendruckerGyroCoefficients(double _Rmax, double _alpha_jump) - : Rmax(_Rmax) +SonnendruckerGyroCoefficients::SonnendruckerGyroCoefficients(const PolarGrid& grid, double _Rmax, double _alpha_jump) + : grid_(grid) + , Rmax(_Rmax) , alpha_jump(_alpha_jump) { } diff --git a/src/InputFunctions/DensityProfileCoefficients/zoniCoefficients.cpp b/src/InputFunctions/DensityProfileCoefficients/zoniCoefficients.cpp index fb01e3a5..fc7fe4cb 100644 --- a/src/InputFunctions/DensityProfileCoefficients/zoniCoefficients.cpp +++ b/src/InputFunctions/DensityProfileCoefficients/zoniCoefficients.cpp @@ -1,8 +1,9 @@ #include using namespace gmgpolar; -ZoniCoefficients::ZoniCoefficients(double Rmax, double alpha_jump) - : Rmax(Rmax) +ZoniCoefficients::ZoniCoefficients(const PolarGrid& grid, double Rmax, double alpha_jump) + : grid_(grid) + , Rmax(Rmax) , alpha_jump(alpha_jump) { } diff --git a/src/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.cpp b/src/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.cpp index 3ef74da8..cac10275 100644 --- a/src/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.cpp +++ b/src/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.cpp @@ -1,8 +1,9 @@ #include using namespace gmgpolar; -ZoniGyroCoefficients::ZoniGyroCoefficients(double Rmax, double alpha_jump) - : Rmax(Rmax) +ZoniGyroCoefficients::ZoniGyroCoefficients(const PolarGrid& grid, double Rmax, double alpha_jump) + : grid_(grid) + , Rmax(Rmax) , alpha_jump(alpha_jump) { } diff --git a/src/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.cpp b/src/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.cpp index 7c0d8fda..004eb9e3 100644 --- a/src/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.cpp +++ b/src/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.cpp @@ -1,8 +1,9 @@ #include #include using namespace gmgpolar; -ZoniShiftedCoefficients::ZoniShiftedCoefficients(double Rmax, double alpha_jump) - : Rmax(Rmax) +ZoniShiftedCoefficients::ZoniShiftedCoefficients(const PolarGrid& grid, double Rmax, double alpha_jump) + : grid_(grid) + , Rmax(Rmax) , alpha_jump(alpha_jump) { } diff --git a/src/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.cpp b/src/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.cpp index 5503e964..5d04d232 100644 --- a/src/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.cpp +++ b/src/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.cpp @@ -1,8 +1,9 @@ #include using namespace gmgpolar; -ZoniShiftedGyroCoefficients::ZoniShiftedGyroCoefficients(double Rmax, double alpha_jump) - : Rmax(Rmax) +ZoniShiftedGyroCoefficients::ZoniShiftedGyroCoefficients(const PolarGrid& grid, double Rmax, double alpha_jump) + : grid_(grid) + , Rmax(Rmax) , alpha_jump(alpha_jump) { } From 2fb91c9bc56351f83c72287b4c7f8b123431e92e Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Mon, 10 Aug 2026 15:55:42 +0200 Subject: [PATCH 3/7] Update constructor calls --- src/ConfigParser/select_test_case.cpp | 14 +-- src/convergence_order.cpp | 7 +- src/strong_scaling.cpp | 7 +- src/weak_scaling.cpp | 6 +- tests/DirectSolver/directSolver.cpp | 110 +++++++++++------- .../extrapolated_smoother.cpp | 20 ++-- tests/GMGPolar/convergence_order.cpp | 7 +- tests/GMGPolar/pcg_tests.cpp | 2 +- tests/GMGPolar/solve_tests.cpp | 2 +- tests/Residual/residual.cpp | 4 +- tests/Smoother/smoother.cpp | 20 ++-- 11 files changed, 113 insertions(+), 86 deletions(-) diff --git a/src/ConfigParser/select_test_case.cpp b/src/ConfigParser/select_test_case.cpp index d11b1ba1..d03cda2f 100644 --- a/src/ConfigParser/select_test_case.cpp +++ b/src/ConfigParser/select_test_case.cpp @@ -65,18 +65,18 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble switch (alpha_type) { case AlphaCoeff::POISSON: density_profile_coefficients_ = - std::make_unique(PoissonCoefficients(Rmax, alpha_jump)); + std::make_unique(PoissonCoefficients(grid_, Rmax, alpha_jump)); break; case AlphaCoeff::SONNENDRUCKER: switch (beta_type) { case BetaCoeff::ZERO: density_profile_coefficients_ = - std::make_unique(SonnendruckerCoefficients(Rmax, alpha_jump)); + std::make_unique(SonnendruckerCoefficients(grid_, Rmax, alpha_jump)); break; case BetaCoeff::ALPHA_INVERSE: density_profile_coefficients_ = - std::make_unique(SonnendruckerGyroCoefficients(Rmax, alpha_jump)); + std::make_unique(SonnendruckerGyroCoefficients(grid_, Rmax, alpha_jump)); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -87,11 +87,11 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble switch (beta_type) { case BetaCoeff::ZERO: density_profile_coefficients_ = - std::make_unique(ZoniCoefficients(Rmax, alpha_jump)); + std::make_unique(ZoniCoefficients(grid_, Rmax, alpha_jump)); break; case BetaCoeff::ALPHA_INVERSE: density_profile_coefficients_ = - std::make_unique(ZoniGyroCoefficients(Rmax, alpha_jump)); + std::make_unique(ZoniGyroCoefficients(grid_, Rmax, alpha_jump)); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -102,11 +102,11 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble switch (beta_type) { case BetaCoeff::ZERO: density_profile_coefficients_ = - std::make_unique(ZoniShiftedCoefficients(Rmax, alpha_jump)); + std::make_unique(ZoniShiftedCoefficients(grid_, Rmax, alpha_jump)); break; case BetaCoeff::ALPHA_INVERSE: density_profile_coefficients_ = - std::make_unique(ZoniShiftedGyroCoefficients(Rmax, alpha_jump)); + std::make_unique(ZoniShiftedGyroCoefficients(grid_, Rmax, alpha_jump)); break; default: throw std::runtime_error("Invalid beta.\n"); diff --git a/src/convergence_order.cpp b/src/convergence_order.cpp index e63d68b1..7aab0b52 100644 --- a/src/convergence_order.cpp +++ b/src/convergence_order.cpp @@ -53,23 +53,23 @@ int main(int argc, char* argv[]) /* Example 1: Polar Solution -> Higher Order 4.0 */ const double alpha_jump = 0.4837 * Rmax; ShafranovGeometry domain_geometry(Rmax, elongation_kappa, shift_delta); - ZoniGyroCoefficients coefficients(Rmax, alpha_jump); PolarR6_Boundary_ShafranovGeometry boundary_conditions(Rmax, elongation_kappa, shift_delta); PolarR6_ShafranovGeometry exact_solution(Rmax, elongation_kappa, shift_delta); + using DensityProfileCoefficients = ZoniGyroCoefficients; /* Example 2: Cartesian Solution -> Lower Order 3.5 */ // const double alpha_jump = 0.66 * Rmax; // CzarnyGeometry domain_geometry(Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); - // SonnendruckerGyroCoefficients coefficients(Rmax, alpha_jump); // CartesianR2_Boundary_CzarnyGeometry boundary_conditions(Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); // CartesianR2_CzarnyGeometry exact_solution(Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); + // using DensityProfileCoefficients = SonnendruckerGyroCoefficients; /* Example 3: Refined Solution -> Lower Order 3.5 */ // const double alpha_jump = 0.9 * Rmax; // Refinement where the solution is most complex // ShafranovGeometry domain_geometry(Rmax, elongation_kappa, shift_delta); - // ZoniShiftedGyroCoefficients coefficients(Rmax, alpha_jump); // Refined_Boundary_ShafranovGeometry boundary_conditions(Rmax, elongation_kappa, shift_delta); // Refined_ShafranovGeometry exact_solution(Rmax, elongation_kappa, shift_delta); + // using DensityProfileCoefficients = ZoniShiftedGyroCoefficients; std::vector table_nr(MAX_DIVIDE_BY_2); std::vector table_ntheta(MAX_DIVIDE_BY_2); @@ -87,6 +87,7 @@ int main(int argc, char* argv[]) std::optional splitting_radius = std::nullopt; PolarGrid grid(R0, Rmax, nr_exp, ntheta_exp, refinement_radius, anisotropic_factor, divideBy2, splitting_radius); + DensityProfileCoefficients coefficients(grid, Rmax, alpha_jump); GMGPolar solver(grid, domain_geometry, coefficients); PolarR6_ZoniGyro_ShafranovGeometry source_term(grid, Rmax, elongation_kappa, shift_delta); diff --git a/src/strong_scaling.cpp b/src/strong_scaling.cpp index f5ed1f7e..dbd9d89c 100644 --- a/src/strong_scaling.cpp +++ b/src/strong_scaling.cpp @@ -18,23 +18,23 @@ void runTest(int divideBy2, std::ostream& outfile) /* Example 1: Polar Solution -> Higher Order 4.0 */ // const double alpha_jump = 0.4837 * Rmax; // ShafranovGeometry domain_geometry(Rmax, elongation_kappa, shift_delta); - // ZoniGyroCoefficients coefficients(Rmax, alpha_jump); // PolarR6_Boundary_ShafranovGeometry boundary_conditions(Rmax, elongation_kappa, shift_delta); // PolarR6_ShafranovGeometry exact_solution(Rmax, elongation_kappa, shift_delta); + // using DensityProfileCoefficients = ZoniGyroCoefficients; /* Example 2: Cartesian Solution -> Lower Order 3.5 */ const double alpha_jump = 0.66 * Rmax; CzarnyGeometry domain_geometry(Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); - SonnendruckerGyroCoefficients coefficients(Rmax, alpha_jump); CartesianR2_Boundary_CzarnyGeometry boundary_conditions(Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); CartesianR2_CzarnyGeometry exact_solution(Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); + using DensityProfileCoefficients = SonnendruckerGyroCoefficients; /* Example 3: Refined Solution -> Lower Order 3.5 */ // const double alpha_jump = 0.9 * Rmax; // Refinement where the solution is most complex // ShafranovGeometry domain_geometry(Rmax, elongation_kappa, shift_delta); - // ZoniShiftedGyroCoefficients coefficients(Rmax, alpha_jump); // Refined_Boundary_ShafranovGeometry boundary_conditions(Rmax, elongation_kappa, shift_delta); // Refined_ShafranovGeometry exact_solution(Rmax, elongation_kappa, shift_delta); + // using DensityProfileCoefficients = ZoniShiftedGyroCoefficients; std::string geometry_string = ""; if (typeid(domain_geometry) == typeid(CircularGeometry)) { @@ -84,6 +84,7 @@ void runTest(int divideBy2, std::ostream& outfile) double refinement_radius = alpha_jump; std::optional splitting_radius = std::nullopt; PolarGrid grid(R0, Rmax, nr_exp, ntheta_exp, refinement_radius, anisotropic_factor, divideBy2, splitting_radius); + DensityProfileCoefficients coefficients(grid, Rmax, alpha_jump); GMGPolar solver(grid, domain_geometry, coefficients); // PolarR6_ZoniGyro_ShafranovGeometry source_term(grid, Rmax, elongation_kappa, shift_delta); diff --git a/src/weak_scaling.cpp b/src/weak_scaling.cpp index 9f07e604..ff07b1a3 100644 --- a/src/weak_scaling.cpp +++ b/src/weak_scaling.cpp @@ -21,20 +21,21 @@ void runTest(int divideBy2, std::ostream& outfile) // ZoniGyroCoefficients coefficients(Rmax, alpha_jump); // PolarR6_Boundary_ShafranovGeometry boundary_conditions(Rmax, elongation_kappa, shift_delta); // PolarR6_ShafranovGeometry exact_solution(Rmax, elongation_kappa, shift_delta); + // using DensityProfileCoefficients = ZoniGyroCoefficients; /* Example 2: Cartesian Solution -> Lower Order 3.5 */ const double alpha_jump = 0.66 * Rmax; CzarnyGeometry domain_geometry(Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); - SonnendruckerGyroCoefficients coefficients(Rmax, alpha_jump); CartesianR2_Boundary_CzarnyGeometry boundary_conditions(Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); CartesianR2_CzarnyGeometry exact_solution(Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); + using DensityProfileCoefficients = SonnendruckerGyroCoefficients; /* Example 3: Refined Solution -> Lower Order 3.5 */ // const double alpha_jump = 0.9 * Rmax; // Refinement where the solution is most complex // ShafranovGeometry domain_geometry(Rmax, elongation_kappa, shift_delta); - // ZoniShiftedGyroCoefficients coefficients(Rmax, alpha_jump); // Refined_Boundary_ShafranovGeometry boundary_conditions(Rmax, elongation_kappa, shift_delta); // Refined_ShafranovGeometry exact_solution(Rmax, elongation_kappa, shift_delta); + // using DensityProfileCoefficients = ZoniShiftedGyroCoefficients; std::string geometry_string = ""; if (typeid(domain_geometry) == typeid(CircularGeometry)) { @@ -84,6 +85,7 @@ void runTest(int divideBy2, std::ostream& outfile) double refinement_radius = alpha_jump; std::optional splitting_radius = std::nullopt; PolarGrid grid(R0, Rmax, nr_exp, ntheta_exp, refinement_radius, anisotropic_factor, divideBy2, splitting_radius); + DensityProfileCoefficients coefficients(grid, Rmax, alpha_jump); GMGPolar solver(grid, domain_geometry, coefficients); // PolarR6_ZoniGyro_ShafranovGeometry source_term(grid, Rmax, elongation_kappa, shift_delta); diff --git a/tests/DirectSolver/directSolver.cpp b/tests/DirectSolver/directSolver.cpp index 8c1b2e9d..fe5b702c 100644 --- a/tests/DirectSolver/directSolver.cpp +++ b/tests/DirectSolver/directSolver.cpp @@ -49,12 +49,14 @@ TEST(DirectSolverTest, directSolver_DirBC_Interior) double kappa_eps = 0.3; double delta_e = 1.4; + auto grid = std::make_unique(radii, angles); + using DomainGeometryType = CzarnyGeometry; DomainGeometryType domain_geometry(Rmax, kappa_eps, delta_e); double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = true; @@ -62,7 +64,6 @@ TEST(DirectSolverTest, directSolver_DirBC_Interior) bool cache_density_rpofile_coefficients = true; bool cache_domain_geometry = true; - auto grid = std::make_unique(radii, angles); auto levelCache = std::make_unique>( *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); Level level(0, std::move(grid), std::move(levelCache), @@ -97,6 +98,8 @@ TEST(DirectSolverTest, directSolver_AcrossOrigin) std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + auto grid = std::make_unique(radii, angles); + double Rmax = radii.back(); double kappa_eps = 0.3; double delta_e = 1.4; @@ -106,7 +109,7 @@ TEST(DirectSolverTest, directSolver_AcrossOrigin) double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = false; @@ -114,7 +117,6 @@ TEST(DirectSolverTest, directSolver_AcrossOrigin) bool cache_density_rpofile_coefficients = true; bool cache_domain_geometry = true; - auto grid = std::make_unique(radii, angles); auto levelCache = std::make_unique>( *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); Level level(0, std::move(grid), std::move(levelCache), @@ -157,18 +159,19 @@ TEST(DirectSolverTest_CircularGeometry, DirectSolverDirBC_Interior_CircularGeome 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; double Rmax = radii.back(); + auto grid = std::make_unique(radii, angles); + using DomainGeometryType = CircularGeometry; DomainGeometryType domain_geometry(Rmax); double alpha_jump = 0.66 * Rmax; using DensityProfileCoefficientsType = SonnendruckerGyroCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = true; bool cache_density_rpofile_coefficients = true; bool cache_domain_geometry = false; - auto grid = std::make_unique(radii, angles); auto levelCache = std::make_unique>( *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); Level level(0, std::move(grid), std::move(levelCache), @@ -196,6 +199,8 @@ TEST(DirectSolverTest_CircularGeometry, DirectSolverAcrossOrigin_CircularGeometr std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + auto grid = std::make_unique(radii, angles); + double Rmax = radii.back(); using DomainGeometryType = CircularGeometry; @@ -203,13 +208,12 @@ TEST(DirectSolverTest_CircularGeometry, DirectSolverAcrossOrigin_CircularGeometr double alpha_jump = 0.66 * Rmax; using DensityProfileCoefficientsType = SonnendruckerGyroCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = false; bool cache_density_rpofile_coefficients = true; bool cache_domain_geometry = false; - auto grid = std::make_unique(radii, angles); auto levelCache = std::make_unique>( *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); Level level(0, std::move(grid), std::move(levelCache), @@ -241,6 +245,8 @@ TEST(DirectSolverTest_ShafranovGeometry, DirectSolverDirBC_Interior_ShafranovGeo std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + auto grid = std::make_unique(radii, angles); + double Rmax = radii.back(); double kappa_eps = 0.3; double delta_e = 0.2; @@ -250,13 +256,12 @@ TEST(DirectSolverTest_ShafranovGeometry, DirectSolverDirBC_Interior_ShafranovGeo double alpha_jump = 0.4837 * Rmax; using DensityProfileCoefficientsType = ZoniGyroCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = true; bool cache_density_rpofile_coefficients = true; bool cache_domain_geometry = false; - auto grid = std::make_unique(radii, angles); auto levelCache = std::make_unique>( *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); Level level(0, std::move(grid), std::move(levelCache), @@ -284,6 +289,8 @@ TEST(DirectSolverTest_ShafranovGeometry, DirectSolverAcrossOrigin_ShafranovGeome std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + auto grid = std::make_unique(radii, angles); + double Rmax = radii.back(); double kappa_eps = 0.3; double delta_e = 0.2; @@ -293,13 +300,12 @@ TEST(DirectSolverTest_ShafranovGeometry, DirectSolverAcrossOrigin_ShafranovGeome double alpha_jump = 0.4837 * Rmax; using DensityProfileCoefficientsType = ZoniGyroCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = false; bool cache_density_rpofile_coefficients = true; bool cache_domain_geometry = false; - auto grid = std::make_unique(radii, angles); auto levelCache = std::make_unique>( *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); Level level(0, std::move(grid), std::move(levelCache), @@ -331,6 +337,8 @@ TEST(DirectSolverTest_CzarnyGeometry, DirectSolverDirBC_Interior_CzarnyGeometry) std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + auto grid = std::make_unique(radii, angles); + double Rmax = radii.back(); double kappa_eps = 0.3; double delta_e = 1.4; @@ -340,13 +348,12 @@ TEST(DirectSolverTest_CzarnyGeometry, DirectSolverDirBC_Interior_CzarnyGeometry) double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = true; bool cache_density_rpofile_coefficients = true; bool cache_domain_geometry = false; - auto grid = std::make_unique(radii, angles); auto levelCache = std::make_unique>( *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); Level level(0, std::move(grid), std::move(levelCache), @@ -374,6 +381,8 @@ TEST(DirectSolverTest_CzarnyGeometry, DirectSolverAcrossOrigin_CzarnyGeometry) std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + auto grid = std::make_unique(radii, angles); + double Rmax = radii.back(); double kappa_eps = 0.3; double delta_e = 1.4; @@ -383,13 +392,12 @@ TEST(DirectSolverTest_CzarnyGeometry, DirectSolverAcrossOrigin_CzarnyGeometry) double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = false; bool cache_density_rpofile_coefficients = true; bool cache_domain_geometry = false; - auto grid = std::make_unique(radii, angles); auto levelCache = std::make_unique>( *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); Level level(0, std::move(grid), std::move(levelCache), @@ -421,6 +429,8 @@ TEST(DirectSolverTest_CulhamGeometry, DirectSolverDirBC_Interior_CulhamGeometry) std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + auto grid = std::make_unique(radii, angles); + double Rmax = radii.back(); using DomainGeometryType = CulhamGeometry; @@ -428,13 +438,12 @@ TEST(DirectSolverTest_CulhamGeometry, DirectSolverDirBC_Interior_CulhamGeometry) double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedGyroCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = true; bool cache_density_rpofile_coefficients = true; bool cache_domain_geometry = false; - auto grid = std::make_unique(radii, angles); auto levelCache = std::make_unique>( *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); Level level(0, std::move(grid), std::move(levelCache), @@ -462,6 +471,8 @@ TEST(DirectSolverTest_CulhamGeometry, DirectSolverAcrossOrigin_CulhamGeometry) std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + auto grid = std::make_unique(radii, angles); + double Rmax = radii.back(); using DomainGeometryType = CulhamGeometry; @@ -469,13 +480,12 @@ TEST(DirectSolverTest_CulhamGeometry, DirectSolverAcrossOrigin_CulhamGeometry) double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedGyroCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = false; bool cache_density_rpofile_coefficients = true; bool cache_domain_geometry = false; - auto grid = std::make_unique(radii, angles); auto levelCache = std::make_unique>( *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); Level level(0, std::move(grid), std::move(levelCache), @@ -515,6 +525,8 @@ TEST(DirectSolverTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecision_ std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + auto grid = std::make_unique(radii, angles); + double Rmax = radii.back(); using DomainGeometryType = CircularGeometry; @@ -522,13 +534,12 @@ TEST(DirectSolverTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecision_ double alpha_jump = 0.66 * Rmax; using DensityProfileCoefficientsType = SonnendruckerGyroCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = false; bool cache_density_rpofile_coefficients = true; bool cache_domain_geometry = false; - auto grid = std::make_unique(radii, angles); auto levelCache = std::make_unique>( *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); Level level(0, std::move(grid), std::move(levelCache), @@ -556,6 +567,8 @@ TEST(DirectSolverTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecision2 std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + auto grid = std::make_unique(radii, angles); + double Rmax = radii.back(); using DomainGeometryType = CircularGeometry; @@ -563,13 +576,12 @@ TEST(DirectSolverTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecision2 double alpha_jump = 0.66 * Rmax; using DensityProfileCoefficientsType = SonnendruckerGyroCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = false; bool cache_density_rpofile_coefficients = true; bool cache_domain_geometry = false; - auto grid = std::make_unique(radii, angles); auto levelCache = std::make_unique>( *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); Level level(0, std::move(grid), std::move(levelCache), @@ -600,18 +612,19 @@ TEST(DirectSolverTakeTest_CircularGeometry, DirectSolverDirBC_Interior_CircularG 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; double Rmax = radii.back(); + auto grid = std::make_unique(radii, angles); + using DomainGeometryType = CircularGeometry; DomainGeometryType domain_geometry(Rmax); double alpha_jump = 0.66 * Rmax; using DensityProfileCoefficientsType = SonnendruckerGyroCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = true; bool cache_density_rpofile_coefficients = true; bool cache_domain_geometry = true; - auto grid = std::make_unique(radii, angles); auto levelCache = std::make_unique>( *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); Level level(0, std::move(grid), std::move(levelCache), @@ -639,6 +652,8 @@ TEST(DirectSolverTakeTest_CircularGeometry, DirectSolverAcrossOrigin_CircularGeo std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + auto grid = std::make_unique(radii, angles); + double Rmax = radii.back(); using DomainGeometryType = CircularGeometry; @@ -646,13 +661,12 @@ TEST(DirectSolverTakeTest_CircularGeometry, DirectSolverAcrossOrigin_CircularGeo double alpha_jump = 0.66 * Rmax; using DensityProfileCoefficientsType = SonnendruckerGyroCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = false; bool cache_density_rpofile_coefficients = true; bool cache_domain_geometry = true; - auto grid = std::make_unique(radii, angles); auto levelCache = std::make_unique>( *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); Level level(0, std::move(grid), std::move(levelCache), @@ -684,6 +698,8 @@ TEST(DirectSolverTakeTest_ShafranovGeometry, DirectSolverDirBC_Interior_Shafrano std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + auto grid = std::make_unique(radii, angles); + double Rmax = radii.back(); double kappa_eps = 0.3; double delta_e = 0.2; @@ -693,13 +709,12 @@ TEST(DirectSolverTakeTest_ShafranovGeometry, DirectSolverDirBC_Interior_Shafrano double alpha_jump = 0.4837 * Rmax; using DensityProfileCoefficientsType = ZoniGyroCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = true; bool cache_density_rpofile_coefficients = true; bool cache_domain_geometry = true; - auto grid = std::make_unique(radii, angles); auto levelCache = std::make_unique>( *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); Level level(0, std::move(grid), std::move(levelCache), @@ -727,6 +742,8 @@ TEST(DirectSolverTakeTest_ShafranovGeometry, DirectSolverAcrossOrigin_ShafranovG std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + auto grid = std::make_unique(radii, angles); + double Rmax = radii.back(); double kappa_eps = 0.3; double delta_e = 0.2; @@ -736,13 +753,12 @@ TEST(DirectSolverTakeTest_ShafranovGeometry, DirectSolverAcrossOrigin_ShafranovG double alpha_jump = 0.4837 * Rmax; using DensityProfileCoefficientsType = ZoniGyroCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = false; bool cache_density_rpofile_coefficients = true; bool cache_domain_geometry = true; - auto grid = std::make_unique(radii, angles); auto levelCache = std::make_unique>( *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); Level level(0, std::move(grid), std::move(levelCache), @@ -774,6 +790,8 @@ TEST(DirectSolverTakeTest_CzarnyGeometry, DirectSolverDirBC_Interior_CzarnyGeome std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + auto grid = std::make_unique(radii, angles); + double Rmax = radii.back(); double kappa_eps = 0.3; double delta_e = 1.4; @@ -783,13 +801,12 @@ TEST(DirectSolverTakeTest_CzarnyGeometry, DirectSolverDirBC_Interior_CzarnyGeome double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = true; bool cache_density_rpofile_coefficients = true; bool cache_domain_geometry = true; - auto grid = std::make_unique(radii, angles); auto levelCache = std::make_unique>( *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); Level level(0, std::move(grid), std::move(levelCache), @@ -817,6 +834,8 @@ TEST(DirectSolverTakeTest_CzarnyGeometry, DirectSolverAcrossOrigin_CzarnyGeometr std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + auto grid = std::make_unique(radii, angles); + double Rmax = radii.back(); double kappa_eps = 0.3; double delta_e = 1.4; @@ -826,13 +845,12 @@ TEST(DirectSolverTakeTest_CzarnyGeometry, DirectSolverAcrossOrigin_CzarnyGeometr double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = false; bool cache_density_rpofile_coefficients = true; bool cache_domain_geometry = true; - auto grid = std::make_unique(radii, angles); auto levelCache = std::make_unique>( *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); Level level(0, std::move(grid), std::move(levelCache), @@ -864,6 +882,8 @@ TEST(DirectSolverTakeTest_CulhamGeometry, DirectSolverDirBC_Interior_CulhamGeome std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + auto grid = std::make_unique(radii, angles); + double Rmax = radii.back(); using DomainGeometryType = CulhamGeometry; @@ -871,13 +891,12 @@ TEST(DirectSolverTakeTest_CulhamGeometry, DirectSolverDirBC_Interior_CulhamGeome double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedGyroCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = true; bool cache_density_rpofile_coefficients = true; bool cache_domain_geometry = true; - auto grid = std::make_unique(radii, angles); auto levelCache = std::make_unique>( *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); Level level(0, std::move(grid), std::move(levelCache), @@ -905,6 +924,8 @@ TEST(DirectSolverTakeTest_CulhamGeometry, DirectSolverAcrossOrigin_CulhamGeometr std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + auto grid = std::make_unique(radii, angles); + double Rmax = radii.back(); using DomainGeometryType = CulhamGeometry; @@ -912,13 +933,12 @@ TEST(DirectSolverTakeTest_CulhamGeometry, DirectSolverAcrossOrigin_CulhamGeometr double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedGyroCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = false; bool cache_density_rpofile_coefficients = true; bool cache_domain_geometry = true; - auto grid = std::make_unique(radii, angles); auto levelCache = std::make_unique>( *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); Level level(0, std::move(grid), std::move(levelCache), @@ -956,6 +976,8 @@ TEST(DirectSolverTakeTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecis std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + auto grid = std::make_unique(radii, angles); + double Rmax = radii.back(); using DomainGeometryType = CircularGeometry; @@ -963,13 +985,12 @@ TEST(DirectSolverTakeTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecis double alpha_jump = 0.66 * Rmax; using DensityProfileCoefficientsType = SonnendruckerGyroCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = false; bool cache_density_rpofile_coefficients = true; bool cache_domain_geometry = true; - auto grid = std::make_unique(radii, angles); auto levelCache = std::make_unique>( *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); Level level(0, std::move(grid), std::move(levelCache), @@ -997,6 +1018,8 @@ TEST(DirectSolverTakeTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecis std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + auto grid = std::make_unique(radii, angles); + double Rmax = radii.back(); using DomainGeometryType = CircularGeometry; @@ -1004,13 +1027,12 @@ TEST(DirectSolverTakeTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecis double alpha_jump = 0.66 * Rmax; using DensityProfileCoefficientsType = SonnendruckerGyroCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = false; bool cache_density_rpofile_coefficients = true; bool cache_domain_geometry = true; - auto grid = std::make_unique(radii, angles); auto levelCache = std::make_unique>( *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); Level level(0, std::move(grid), std::move(levelCache), diff --git a/tests/ExtrapolatedSmoother/extrapolated_smoother.cpp b/tests/ExtrapolatedSmoother/extrapolated_smoother.cpp index abaea91f..6d335317 100644 --- a/tests/ExtrapolatedSmoother/extrapolated_smoother.cpp +++ b/tests/ExtrapolatedSmoother/extrapolated_smoother.cpp @@ -45,7 +45,7 @@ TEST(ExtrapolatedSmootherTest, extrapolatedSmoother_DirBC_Interior) double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*tmp_grid, Rmax, alpha_jump); bool DirBC_Interior = true; @@ -106,7 +106,7 @@ TEST(ExtrapolatedSmootherTest, extrapolatedSmoother_AcossOrigin) double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*tmp_grid, Rmax, alpha_jump); bool DirBC_Interior = false; @@ -168,7 +168,7 @@ void ExtrapolatedSmootherTest_ExtrapolatedSmootherDirBC_Interior() double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*tmp_grid, Rmax, alpha_jump); bool DirBC_Interior = true; @@ -259,7 +259,7 @@ void ExtrapolatedSmootherTest_ExtrapolatedSmootherAcrossOrigin() double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*tmp_grid, Rmax, alpha_jump); bool DirBC_Interior = false; @@ -351,7 +351,7 @@ void ExtrapolatedSmootherTest_ExtrapolatedSmootherDirBC_Interior_SmallestGrid() double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*tmp_grid, Rmax, alpha_jump); bool DirBC_Interior = true; @@ -443,7 +443,7 @@ void ExtrapolatedSmootherTest_ExtrapolatedSmootherAcrossOrigin_SmallestGrid() double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*tmp_grid, Rmax, alpha_jump); bool DirBC_Interior = false; @@ -536,7 +536,7 @@ void ExtrapolatedSmootherTest_ExtrapolatedSmootherTakeDirBC_Interior() double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*tmp_grid, Rmax, alpha_jump); bool DirBC_Interior = true; @@ -627,7 +627,7 @@ void ExtrapolatedSmootherTest_ExtrapolatedSmootherTakeAcrossOrigin() double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*tmp_grid, Rmax, alpha_jump); bool DirBC_Interior = false; @@ -717,7 +717,7 @@ void ExtrapolatedSmootherTest_ExtrapolatedSmootherTakeDirBC_Interior_SmallestGri double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*tmp_grid, Rmax, alpha_jump); bool DirBC_Interior = true; @@ -807,7 +807,7 @@ void ExtrapolatedSmootherTest_ExtrapolatedSmootherTakeAcrossOrigin_SmallestGrid( double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*tmp_grid, Rmax, alpha_jump); bool DirBC_Interior = false; diff --git a/tests/GMGPolar/convergence_order.cpp b/tests/GMGPolar/convergence_order.cpp index c2c6a77f..1e83f56d 100644 --- a/tests/GMGPolar/convergence_order.cpp +++ b/tests/GMGPolar/convergence_order.cpp @@ -228,7 +228,8 @@ void test_convergence(double non_uniformity) PolarGrid grid_refined(radii_refined, angles_refined); const double alpha_jump = 0.0; // Unused value - typename TestFixture::DensityProfileCoefficients coefficients(Rmax, alpha_jump); + typename TestFixture::DensityProfileCoefficients coefficients(grid, Rmax, alpha_jump); + typename TestFixture::DensityProfileCoefficients coefficients_refined(grid_refined, Rmax, alpha_jump); typename TestFixture::BoundaryConditions boundary_conditions(Rmax, kappa_eps, delta_e); typename TestFixture::SourceTerm source_term(grid, Rmax, kappa_eps, delta_e); typename TestFixture::SourceTerm source_term_refined(grid_refined, Rmax, kappa_eps, delta_e); @@ -237,8 +238,8 @@ void test_convergence(double non_uniformity) auto [euclid_error, inf_error] = get_gmgpolar_error(grid, domain_geometry, coefficients, boundary_conditions, source_term, solution, TestFixture::extrapolation); auto [euclid_error_refined, inf_error_refined] = - get_gmgpolar_error(grid_refined, domain_geometry, coefficients, boundary_conditions, source_term_refined, - solution, TestFixture::extrapolation); + get_gmgpolar_error(grid_refined, domain_geometry, coefficients_refined, boundary_conditions, + source_term_refined, solution, TestFixture::extrapolation); double euclid_order = log(euclid_error / euclid_error_refined) / log(2); double inf_order = log(inf_error / inf_error_refined) / log(2); diff --git a/tests/GMGPolar/pcg_tests.cpp b/tests/GMGPolar/pcg_tests.cpp index c89a1eed..f6f4e8e8 100644 --- a/tests/GMGPolar/pcg_tests.cpp +++ b/tests/GMGPolar/pcg_tests.cpp @@ -637,7 +637,7 @@ void run_gmgpolar() const double ellipticity_e = 1.4; typename TestFixture::DomainGeometry domain(TestFixture::Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); - typename TestFixture::DensityProfileCoefficients profile_coefficients(TestFixture::Rmax, 0.0); + typename TestFixture::DensityProfileCoefficients profile_coefficients(grid, TestFixture::Rmax, 0.0); typename TestFixture::BoundaryConditions boundary_conditions(TestFixture::Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); typename TestFixture::SourceTerm source_term(grid, TestFixture::Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); diff --git a/tests/GMGPolar/solve_tests.cpp b/tests/GMGPolar/solve_tests.cpp index 3dd836d7..55bf49da 100644 --- a/tests/GMGPolar/solve_tests.cpp +++ b/tests/GMGPolar/solve_tests.cpp @@ -646,7 +646,7 @@ void run_gmgpolar() const double ellipticity_e = 1.4; typename TestFixture::DomainGeometry domain(TestFixture::Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); - typename TestFixture::DensityProfileCoefficients profile_coefficients(TestFixture::Rmax, 0.0); + typename TestFixture::DensityProfileCoefficients profile_coefficients(grid, TestFixture::Rmax, 0.0); typename TestFixture::BoundaryConditions boundary_conditions(TestFixture::Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); typename TestFixture::SourceTerm source_term(grid, TestFixture::Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); diff --git a/tests/Residual/residual.cpp b/tests/Residual/residual.cpp index 926cf3a9..17c9ae2a 100644 --- a/tests/Residual/residual.cpp +++ b/tests/Residual/residual.cpp @@ -38,7 +38,6 @@ TEST(OperatorATest, applyA_DirBC_Interior) double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedCoefficients; - ZoniShiftedCoefficients coefficients(Rmax, alpha_jump); bool DirBC_Interior = true; @@ -47,6 +46,7 @@ TEST(OperatorATest, applyA_DirBC_Interior) bool cache_domain_geometry = true; auto grid = std::make_unique(radii, angles); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); auto levelCache = std::make_unique>( *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); Level level(0, std::move(grid), std::move(levelCache), @@ -93,7 +93,6 @@ TEST(OperatorATest, applyA_AcrossOrigin) double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); bool DirBC_Interior = false; @@ -102,6 +101,7 @@ TEST(OperatorATest, applyA_AcrossOrigin) bool cache_domain_geometry = true; auto grid = std::make_unique(radii, angles); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); auto levelCache = std::make_unique>( *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); Level level(0, std::move(grid), std::move(levelCache), diff --git a/tests/Smoother/smoother.cpp b/tests/Smoother/smoother.cpp index 726502ef..4057c2e1 100644 --- a/tests/Smoother/smoother.cpp +++ b/tests/Smoother/smoother.cpp @@ -44,7 +44,7 @@ void SmootherTest_smoother_DirBC_Interior() double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = true; @@ -107,7 +107,7 @@ void SmootherTest_smoother_AcrossOrigin() double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = false; @@ -173,7 +173,7 @@ void SmootherTest_SmootherDirBC_Interior() double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = true; bool cache_density_rpofile_coefficients = true; @@ -250,7 +250,7 @@ void SmootherTest_SmootherAcrossOrigin() double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = false; bool cache_density_rpofile_coefficients = true; @@ -326,7 +326,7 @@ void SmootherTest_SmootherDirBC_Interior_SmallestGrid() double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = true; bool cache_density_rpofile_coefficients = true; @@ -402,7 +402,7 @@ void SmootherTest_SmootherAcrossOrigin_SmallestGrid() double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = false; bool cache_density_rpofile_coefficients = true; @@ -481,7 +481,7 @@ void SmootherTest_SmootherTakeDirBC_Interior() double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = true; bool cache_density_rpofile_coefficients = true; @@ -558,7 +558,7 @@ void SmootherTest_SmootherTakeAcrossOrigin() double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = false; bool cache_density_rpofile_coefficients = true; @@ -634,7 +634,7 @@ void SmootherTest_SmootherTakeDirBC_Interior_SmallestGrid() double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = true; bool cache_density_rpofile_coefficients = true; @@ -710,7 +710,7 @@ void SmootherTest_SmootherTakeAcrossOrigin_SmallestGrid() double alpha_jump = 0.678 * Rmax; using DensityProfileCoefficientsType = ZoniShiftedCoefficients; - DensityProfileCoefficientsType coefficients(Rmax, alpha_jump); + DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); bool DirBC_Interior = false; bool cache_density_rpofile_coefficients = true; From 96ce97a77d581b8e1a4fff818ea4114c3e44a611 Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Mon, 10 Aug 2026 15:58:30 +0200 Subject: [PATCH 4/7] Update alpha/beta interface to use indices --- .../DensityProfileCoefficients/poissonCoefficients.h | 4 ++-- .../sonnendruckerCoefficients.h | 4 ++-- .../sonnendruckerGyroCoefficients.h | 4 ++-- .../DensityProfileCoefficients/zoniCoefficients.h | 4 ++-- .../DensityProfileCoefficients/zoniGyroCoefficients.h | 4 ++-- .../zoniShiftedCoefficients.h | 4 ++-- .../zoniShiftedGyroCoefficients.h | 4 ++-- include/InputFunctions/densityProfileCoefficients.h | 6 +++--- include/Level/level.h | 4 ++-- include/Level/levelCache.inl | 10 ++++------ .../DensityProfileCoefficients/poissonCoefficients.cpp | 4 ++-- .../sonnendruckerCoefficients.cpp | 5 +++-- .../sonnendruckerGyroCoefficients.cpp | 6 ++++-- .../DensityProfileCoefficients/zoniCoefficients.cpp | 5 +++-- .../zoniGyroCoefficients.cpp | 6 ++++-- .../zoniShiftedCoefficients.cpp | 5 +++-- .../zoniShiftedGyroCoefficients.cpp | 6 ++++-- 17 files changed, 46 insertions(+), 39 deletions(-) diff --git a/include/InputFunctions/DensityProfileCoefficients/poissonCoefficients.h b/include/InputFunctions/DensityProfileCoefficients/poissonCoefficients.h index b66ef0a0..d3e00d8c 100644 --- a/include/InputFunctions/DensityProfileCoefficients/poissonCoefficients.h +++ b/include/InputFunctions/DensityProfileCoefficients/poissonCoefficients.h @@ -14,8 +14,8 @@ class PoissonCoefficients public: explicit PoissonCoefficients(const PolarGrid& grid, double Rmax, double alpha); - KOKKOS_FUNCTION double alpha(double r, double theta) const; - KOKKOS_FUNCTION double beta(double r, double theta) const; + KOKKOS_FUNCTION double alpha(int i_r, int i_theta) const; + KOKKOS_FUNCTION double beta(int i_r, int i_theta) const; KOKKOS_FUNCTION double getAlphaJump() const; diff --git a/include/InputFunctions/DensityProfileCoefficients/sonnendruckerCoefficients.h b/include/InputFunctions/DensityProfileCoefficients/sonnendruckerCoefficients.h index 3f70cbaf..842a75b1 100644 --- a/include/InputFunctions/DensityProfileCoefficients/sonnendruckerCoefficients.h +++ b/include/InputFunctions/DensityProfileCoefficients/sonnendruckerCoefficients.h @@ -14,8 +14,8 @@ class SonnendruckerCoefficients public: explicit SonnendruckerCoefficients(const PolarGrid& grid, double Rmax, double alpha); - KOKKOS_FUNCTION double alpha(double r, double theta) const; - KOKKOS_FUNCTION double beta(double r, double theta) const; + KOKKOS_FUNCTION double alpha(int i_r, int i_theta) const; + KOKKOS_FUNCTION double beta(int i_r, int i_theta) const; KOKKOS_FUNCTION double getAlphaJump() const; diff --git a/include/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.h b/include/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.h index dd3295ac..6926663a 100644 --- a/include/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.h +++ b/include/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.h @@ -14,8 +14,8 @@ class SonnendruckerGyroCoefficients public: explicit SonnendruckerGyroCoefficients(const PolarGrid& grid, double Rmax, double alpha); - KOKKOS_FUNCTION double alpha(double r, double theta) const; - KOKKOS_FUNCTION double beta(double r, double theta) const; + KOKKOS_FUNCTION double alpha(int i_r, int i_theta) const; + KOKKOS_FUNCTION double beta(int i_r, int i_theta) const; KOKKOS_FUNCTION double getAlphaJump() const; diff --git a/include/InputFunctions/DensityProfileCoefficients/zoniCoefficients.h b/include/InputFunctions/DensityProfileCoefficients/zoniCoefficients.h index 9cd72fb7..462d3dcd 100644 --- a/include/InputFunctions/DensityProfileCoefficients/zoniCoefficients.h +++ b/include/InputFunctions/DensityProfileCoefficients/zoniCoefficients.h @@ -14,8 +14,8 @@ class ZoniCoefficients public: explicit ZoniCoefficients(const PolarGrid& grid, double Rmax, double alpha); - KOKKOS_FUNCTION double alpha(double r, double theta) const; - KOKKOS_FUNCTION double beta(double r, double theta) const; + KOKKOS_FUNCTION double alpha(int i_r, int i_theta) const; + KOKKOS_FUNCTION double beta(int i_r, int i_theta) const; KOKKOS_FUNCTION double getAlphaJump() const; diff --git a/include/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.h b/include/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.h index 1da050a6..d0ac8e84 100644 --- a/include/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.h +++ b/include/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.h @@ -14,8 +14,8 @@ class ZoniGyroCoefficients public: explicit ZoniGyroCoefficients(const PolarGrid& grid, double Rmax, double alpha); - KOKKOS_FUNCTION double alpha(double r, double theta) const; - KOKKOS_FUNCTION double beta(double r, double theta) const; + KOKKOS_FUNCTION double alpha(int i_r, int i_theta) const; + KOKKOS_FUNCTION double beta(int i_r, int i_theta) const; KOKKOS_FUNCTION double getAlphaJump() const; diff --git a/include/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.h b/include/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.h index 42faf15b..b203de5c 100644 --- a/include/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.h +++ b/include/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.h @@ -14,8 +14,8 @@ class ZoniShiftedCoefficients public: explicit ZoniShiftedCoefficients(const PolarGrid& grid, double Rmax, double alpha); - KOKKOS_FUNCTION double alpha(double r, double theta) const; - KOKKOS_FUNCTION double beta(double r, double theta) const; + KOKKOS_FUNCTION double alpha(int i_r, int i_theta) const; + KOKKOS_FUNCTION double beta(int i_r, int i_theta) const; KOKKOS_FUNCTION double getAlphaJump() const; diff --git a/include/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.h b/include/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.h index 604c7921..473cb1ed 100644 --- a/include/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.h +++ b/include/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.h @@ -14,8 +14,8 @@ class ZoniShiftedGyroCoefficients public: explicit ZoniShiftedGyroCoefficients(const PolarGrid& grid, double Rmax, double alpha); - KOKKOS_FUNCTION double alpha(double r, double theta) const; - KOKKOS_FUNCTION double beta(double r, double theta) const; + KOKKOS_FUNCTION double alpha(int i_r, int i_theta) const; + KOKKOS_FUNCTION double beta(int i_r, int i_theta) const; KOKKOS_FUNCTION double getAlphaJump() const; diff --git a/include/InputFunctions/densityProfileCoefficients.h b/include/InputFunctions/densityProfileCoefficients.h index 86aa4ad3..4aeb757e 100644 --- a/include/InputFunctions/densityProfileCoefficients.h +++ b/include/InputFunctions/densityProfileCoefficients.h @@ -4,9 +4,9 @@ namespace concepts { template -concept DensityProfileCoefficients = requires(const T coeffs, double r, double theta) { - { coeffs.alpha(r, theta) } -> std::convertible_to; - { coeffs.beta(r, theta) } -> std::convertible_to; +concept DensityProfileCoefficients = requires(const T coeffs, int i_r, int i_theta) { + { coeffs.alpha(i_r, i_theta) } -> std::convertible_to; + { coeffs.beta(i_r, i_theta) } -> std::convertible_to; { coeffs.getAlphaJump() } -> std::convertible_to; }; diff --git a/include/Level/level.h b/include/Level/level.h index 7b8a8d8a..a0b8772c 100644 --- a/include/Level/level.h +++ b/include/Level/level.h @@ -156,7 +156,7 @@ class LevelCache double& detDF) const { coeff_beta = cache_density_profile_coefficients_ ? coeff_beta_[global_index] - : density_profile_coefficients_.beta(r, theta); + : density_profile_coefficients_.beta(i_r, i_theta); if (cache_domain_geometry_) { arr = arr_[global_index]; @@ -166,7 +166,7 @@ class LevelCache } else { double coeff_alpha = cache_density_profile_coefficients_ ? coeff_alpha_[global_index] - : density_profile_coefficients_.alpha(r, theta); + : density_profile_coefficients_.alpha(i_r, i_theta); compute_jacobian_elements(domain_geometry_, r, theta, coeff_alpha, arr, att, art, detDF); } diff --git a/include/Level/levelCache.inl b/include/Level/levelCache.inl index cd8273f3..c3e1f178 100644 --- a/include/Level/levelCache.inl +++ b/include/Level/levelCache.inl @@ -16,13 +16,11 @@ static void cache_density_profile_coefficients(const PolarGrid& grid, ), // Kokkos lambda function to execute for each point in the index space KOKKOS_LAMBDA(const int i_r, const int i_theta) { - const double r = grid.radius(i_r); - const double theta = grid.theta(i_theta); const int index = grid.index(i_r, i_theta); if (!cache_domain_geometry) { - coeff_alpha(index) = density_profile_coefficients.alpha(r, theta); + coeff_alpha(index) = density_profile_coefficients.alpha(i_r, i_theta); } - coeff_beta(index) = density_profile_coefficients.beta(r, theta); + coeff_beta(index) = density_profile_coefficients.beta(i_r, i_theta); }); } @@ -47,7 +45,7 @@ static void cache_domain_geometry(const PolarGrid& grid, const DensityProfileCoe const double r = grid.radius(i_r); const double theta = grid.theta(i_theta); const int index = grid.index(i_r, i_theta); - const double coeff_alpha = density_profile_coefficients.alpha(r, theta); + const double coeff_alpha = density_profile_coefficients.alpha(i_r, i_theta); double arr, att, art, detDF; compute_jacobian_elements(domain_geometry, r, theta, coeff_alpha, arr, att, art, detDF); @@ -68,7 +66,7 @@ static void cache_domain_geometry(const PolarGrid& grid, const DensityProfileCoe const double theta = grid.theta(i_theta); const double r = grid.radius(i_r); const int index = grid.index(i_r, i_theta); - const double coeff_alpha = density_profile_coefficients.alpha(r, theta); + const double coeff_alpha = density_profile_coefficients.alpha(i_r, i_theta); double arr, att, art, detDF; compute_jacobian_elements(domain_geometry, r, theta, coeff_alpha, arr, att, art, detDF); diff --git a/src/InputFunctions/DensityProfileCoefficients/poissonCoefficients.cpp b/src/InputFunctions/DensityProfileCoefficients/poissonCoefficients.cpp index 5cddbb58..4108147d 100644 --- a/src/InputFunctions/DensityProfileCoefficients/poissonCoefficients.cpp +++ b/src/InputFunctions/DensityProfileCoefficients/poissonCoefficients.cpp @@ -8,12 +8,12 @@ PoissonCoefficients::PoissonCoefficients(const PolarGrid& grid, double Rmax, dou { } -KOKKOS_FUNCTION double PoissonCoefficients::alpha(double r, double theta) const +KOKKOS_FUNCTION double PoissonCoefficients::alpha(int i_r, int i_theta) const { return 1.0; } -KOKKOS_FUNCTION double PoissonCoefficients::beta(double r, double theta) const +KOKKOS_FUNCTION double PoissonCoefficients::beta(int i_r, int i_theta) const { return 0.0; } diff --git a/src/InputFunctions/DensityProfileCoefficients/sonnendruckerCoefficients.cpp b/src/InputFunctions/DensityProfileCoefficients/sonnendruckerCoefficients.cpp index 274b04fe..cdb699a0 100644 --- a/src/InputFunctions/DensityProfileCoefficients/sonnendruckerCoefficients.cpp +++ b/src/InputFunctions/DensityProfileCoefficients/sonnendruckerCoefficients.cpp @@ -8,12 +8,13 @@ SonnendruckerCoefficients::SonnendruckerCoefficients(const PolarGrid& grid, doub { } -KOKKOS_FUNCTION double SonnendruckerCoefficients::alpha(double r, double theta) const +KOKKOS_FUNCTION double SonnendruckerCoefficients::alpha(int i_r, int i_theta) const { + double r = grid_.radius(i_r); return 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111); } -KOKKOS_FUNCTION double SonnendruckerCoefficients::beta(double r, double theta) const +KOKKOS_FUNCTION double SonnendruckerCoefficients::beta(int i_r, int i_theta) const { return 0.0; } diff --git a/src/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.cpp b/src/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.cpp index 57509d30..85f34978 100644 --- a/src/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.cpp +++ b/src/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.cpp @@ -8,13 +8,15 @@ SonnendruckerGyroCoefficients::SonnendruckerGyroCoefficients(const PolarGrid& gr { } -KOKKOS_FUNCTION double SonnendruckerGyroCoefficients::alpha(double r, double theta) const +KOKKOS_FUNCTION double SonnendruckerGyroCoefficients::alpha(int i_r, int i_theta) const { + double r = grid_.radius(i_r); return 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111); } -KOKKOS_FUNCTION double SonnendruckerGyroCoefficients::beta(double r, double theta) const +KOKKOS_FUNCTION double SonnendruckerGyroCoefficients::beta(int i_r, int i_theta) const { + double r = grid_.radius(i_r); return pow((0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)), (double)((-1))); } diff --git a/src/InputFunctions/DensityProfileCoefficients/zoniCoefficients.cpp b/src/InputFunctions/DensityProfileCoefficients/zoniCoefficients.cpp index fc7fe4cb..dd5a30ed 100644 --- a/src/InputFunctions/DensityProfileCoefficients/zoniCoefficients.cpp +++ b/src/InputFunctions/DensityProfileCoefficients/zoniCoefficients.cpp @@ -8,12 +8,13 @@ ZoniCoefficients::ZoniCoefficients(const PolarGrid& grid, double Rmax, double al { } -KOKKOS_FUNCTION double ZoniCoefficients::alpha(double r, double theta) const +KOKKOS_FUNCTION double ZoniCoefficients::alpha(int i_r, int i_theta) const { + double r = grid_.radius(i_r); return exp(-tanh(10.0 * (r / Rmax) - 5.0)); } -KOKKOS_FUNCTION double ZoniCoefficients::beta(double r, double theta) const +KOKKOS_FUNCTION double ZoniCoefficients::beta(int i_r, int i_theta) const { return 0.0; } diff --git a/src/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.cpp b/src/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.cpp index cac10275..c0ccf662 100644 --- a/src/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.cpp +++ b/src/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.cpp @@ -8,13 +8,15 @@ ZoniGyroCoefficients::ZoniGyroCoefficients(const PolarGrid& grid, double Rmax, d { } -KOKKOS_FUNCTION double ZoniGyroCoefficients::alpha(double r, double theta) const +KOKKOS_FUNCTION double ZoniGyroCoefficients::alpha(int i_r, int i_theta) const { + double r = grid_.radius(i_r); return exp(-tanh(10.0 * (r / Rmax) - 5.0)); } -KOKKOS_FUNCTION double ZoniGyroCoefficients::beta(double r, double theta) const +KOKKOS_FUNCTION double ZoniGyroCoefficients::beta(int i_r, int i_theta) const { + double r = grid_.radius(i_r); return exp(tanh(10.0 * (r / Rmax) - 5.0)); } diff --git a/src/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.cpp b/src/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.cpp index 004eb9e3..70ee74a4 100644 --- a/src/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.cpp +++ b/src/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.cpp @@ -8,12 +8,13 @@ ZoniShiftedCoefficients::ZoniShiftedCoefficients(const PolarGrid& grid, double R { } -KOKKOS_FUNCTION double ZoniShiftedCoefficients::alpha(double r, double theta) const +KOKKOS_FUNCTION double ZoniShiftedCoefficients::alpha(int i_r, int i_theta) const { + double r = grid_.radius(i_r); return exp(-tanh(20.0 * (r / Rmax) - 14.0)); } -KOKKOS_FUNCTION double ZoniShiftedCoefficients::beta(double r, double theta) const +KOKKOS_FUNCTION double ZoniShiftedCoefficients::beta(int i_r, int i_theta) const { return 0.0; } diff --git a/src/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.cpp b/src/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.cpp index 5d04d232..e81f626a 100644 --- a/src/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.cpp +++ b/src/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.cpp @@ -8,13 +8,15 @@ ZoniShiftedGyroCoefficients::ZoniShiftedGyroCoefficients(const PolarGrid& grid, { } -KOKKOS_FUNCTION double ZoniShiftedGyroCoefficients::alpha(double r, double theta) const +KOKKOS_FUNCTION double ZoniShiftedGyroCoefficients::alpha(int i_r, int i_theta) const { + double r = grid_.radius(i_r); return exp(-tanh(20.0 * (r / Rmax) - 14.0)); } -KOKKOS_FUNCTION double ZoniShiftedGyroCoefficients::beta(double r, double theta) const +KOKKOS_FUNCTION double ZoniShiftedGyroCoefficients::beta(int i_r, int i_theta) const { + double r = grid_.radius(i_r); return exp(tanh(20.0 * (r / Rmax) - 14.0)); } From df48d6622732e08c5188b219b5e417ce3b9ae87f Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Mon, 10 Aug 2026 17:10:11 +0200 Subject: [PATCH 5/7] Clang format --- include/Level/level.h | 5 +-- include/Level/levelCache.inl | 2 +- src/ConfigParser/select_test_case.cpp | 8 ++--- tests/DirectSolver/directSolver.cpp | 44 +++++++++++++-------------- tests/Residual/residual.cpp | 4 +-- 5 files changed, 32 insertions(+), 31 deletions(-) diff --git a/include/Level/level.h b/include/Level/level.h index a0b8772c..5f5a837c 100644 --- a/include/Level/level.h +++ b/include/Level/level.h @@ -165,8 +165,9 @@ class LevelCache detDF = detDF_[global_index]; } else { - double coeff_alpha = cache_density_profile_coefficients_ ? coeff_alpha_[global_index] - : density_profile_coefficients_.alpha(i_r, i_theta); + double coeff_alpha = cache_density_profile_coefficients_ + ? coeff_alpha_[global_index] + : density_profile_coefficients_.alpha(i_r, i_theta); compute_jacobian_elements(domain_geometry_, r, theta, coeff_alpha, arr, att, art, detDF); } diff --git a/include/Level/levelCache.inl b/include/Level/levelCache.inl index c3e1f178..49f71e97 100644 --- a/include/Level/levelCache.inl +++ b/include/Level/levelCache.inl @@ -16,7 +16,7 @@ static void cache_density_profile_coefficients(const PolarGrid& grid, ), // Kokkos lambda function to execute for each point in the index space KOKKOS_LAMBDA(const int i_r, const int i_theta) { - const int index = grid.index(i_r, i_theta); + const int index = grid.index(i_r, i_theta); if (!cache_domain_geometry) { coeff_alpha(index) = density_profile_coefficients.alpha(i_r, i_theta); } diff --git a/src/ConfigParser/select_test_case.cpp b/src/ConfigParser/select_test_case.cpp index d03cda2f..e2bb1317 100644 --- a/src/ConfigParser/select_test_case.cpp +++ b/src/ConfigParser/select_test_case.cpp @@ -75,8 +75,8 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble std::make_unique(SonnendruckerCoefficients(grid_, Rmax, alpha_jump)); break; case BetaCoeff::ALPHA_INVERSE: - density_profile_coefficients_ = - std::make_unique(SonnendruckerGyroCoefficients(grid_, Rmax, alpha_jump)); + density_profile_coefficients_ = std::make_unique( + SonnendruckerGyroCoefficients(grid_, Rmax, alpha_jump)); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -105,8 +105,8 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble std::make_unique(ZoniShiftedCoefficients(grid_, Rmax, alpha_jump)); break; case BetaCoeff::ALPHA_INVERSE: - density_profile_coefficients_ = - std::make_unique(ZoniShiftedGyroCoefficients(grid_, Rmax, alpha_jump)); + density_profile_coefficients_ = std::make_unique( + ZoniShiftedGyroCoefficients(grid_, Rmax, alpha_jump)); break; default: throw std::runtime_error("Invalid beta.\n"); diff --git a/tests/DirectSolver/directSolver.cpp b/tests/DirectSolver/directSolver.cpp index fe5b702c..1e156529 100644 --- a/tests/DirectSolver/directSolver.cpp +++ b/tests/DirectSolver/directSolver.cpp @@ -49,7 +49,7 @@ TEST(DirectSolverTest, directSolver_DirBC_Interior) double kappa_eps = 0.3; double delta_e = 1.4; - auto grid = std::make_unique(radii, angles); + auto grid = std::make_unique(radii, angles); using DomainGeometryType = CzarnyGeometry; DomainGeometryType domain_geometry(Rmax, kappa_eps, delta_e); @@ -98,7 +98,7 @@ TEST(DirectSolverTest, directSolver_AcrossOrigin) std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; - auto grid = std::make_unique(radii, angles); + auto grid = std::make_unique(radii, angles); double Rmax = radii.back(); double kappa_eps = 0.3; @@ -159,7 +159,7 @@ TEST(DirectSolverTest_CircularGeometry, DirectSolverDirBC_Interior_CircularGeome 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; double Rmax = radii.back(); - auto grid = std::make_unique(radii, angles); + auto grid = std::make_unique(radii, angles); using DomainGeometryType = CircularGeometry; DomainGeometryType domain_geometry(Rmax); @@ -199,7 +199,7 @@ TEST(DirectSolverTest_CircularGeometry, DirectSolverAcrossOrigin_CircularGeometr std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; - auto grid = std::make_unique(radii, angles); + auto grid = std::make_unique(radii, angles); double Rmax = radii.back(); @@ -245,7 +245,7 @@ TEST(DirectSolverTest_ShafranovGeometry, DirectSolverDirBC_Interior_ShafranovGeo std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; - auto grid = std::make_unique(radii, angles); + auto grid = std::make_unique(radii, angles); double Rmax = radii.back(); double kappa_eps = 0.3; @@ -289,7 +289,7 @@ TEST(DirectSolverTest_ShafranovGeometry, DirectSolverAcrossOrigin_ShafranovGeome std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; - auto grid = std::make_unique(radii, angles); + auto grid = std::make_unique(radii, angles); double Rmax = radii.back(); double kappa_eps = 0.3; @@ -337,7 +337,7 @@ TEST(DirectSolverTest_CzarnyGeometry, DirectSolverDirBC_Interior_CzarnyGeometry) std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; - auto grid = std::make_unique(radii, angles); + auto grid = std::make_unique(radii, angles); double Rmax = radii.back(); double kappa_eps = 0.3; @@ -381,7 +381,7 @@ TEST(DirectSolverTest_CzarnyGeometry, DirectSolverAcrossOrigin_CzarnyGeometry) std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; - auto grid = std::make_unique(radii, angles); + auto grid = std::make_unique(radii, angles); double Rmax = radii.back(); double kappa_eps = 0.3; @@ -429,7 +429,7 @@ TEST(DirectSolverTest_CulhamGeometry, DirectSolverDirBC_Interior_CulhamGeometry) std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; - auto grid = std::make_unique(radii, angles); + auto grid = std::make_unique(radii, angles); double Rmax = radii.back(); @@ -471,7 +471,7 @@ TEST(DirectSolverTest_CulhamGeometry, DirectSolverAcrossOrigin_CulhamGeometry) std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; - auto grid = std::make_unique(radii, angles); + auto grid = std::make_unique(radii, angles); double Rmax = radii.back(); @@ -525,7 +525,7 @@ TEST(DirectSolverTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecision_ std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; - auto grid = std::make_unique(radii, angles); + auto grid = std::make_unique(radii, angles); double Rmax = radii.back(); @@ -567,7 +567,7 @@ TEST(DirectSolverTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecision2 std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; - auto grid = std::make_unique(radii, angles); + auto grid = std::make_unique(radii, angles); double Rmax = radii.back(); @@ -612,7 +612,7 @@ TEST(DirectSolverTakeTest_CircularGeometry, DirectSolverDirBC_Interior_CircularG 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; double Rmax = radii.back(); - auto grid = std::make_unique(radii, angles); + auto grid = std::make_unique(radii, angles); using DomainGeometryType = CircularGeometry; DomainGeometryType domain_geometry(Rmax); @@ -652,7 +652,7 @@ TEST(DirectSolverTakeTest_CircularGeometry, DirectSolverAcrossOrigin_CircularGeo std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; - auto grid = std::make_unique(radii, angles); + auto grid = std::make_unique(radii, angles); double Rmax = radii.back(); @@ -698,7 +698,7 @@ TEST(DirectSolverTakeTest_ShafranovGeometry, DirectSolverDirBC_Interior_Shafrano std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; - auto grid = std::make_unique(radii, angles); + auto grid = std::make_unique(radii, angles); double Rmax = radii.back(); double kappa_eps = 0.3; @@ -742,7 +742,7 @@ TEST(DirectSolverTakeTest_ShafranovGeometry, DirectSolverAcrossOrigin_ShafranovG std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; - auto grid = std::make_unique(radii, angles); + auto grid = std::make_unique(radii, angles); double Rmax = radii.back(); double kappa_eps = 0.3; @@ -790,7 +790,7 @@ TEST(DirectSolverTakeTest_CzarnyGeometry, DirectSolverDirBC_Interior_CzarnyGeome std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; - auto grid = std::make_unique(radii, angles); + auto grid = std::make_unique(radii, angles); double Rmax = radii.back(); double kappa_eps = 0.3; @@ -834,7 +834,7 @@ TEST(DirectSolverTakeTest_CzarnyGeometry, DirectSolverAcrossOrigin_CzarnyGeometr std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; - auto grid = std::make_unique(radii, angles); + auto grid = std::make_unique(radii, angles); double Rmax = radii.back(); double kappa_eps = 0.3; @@ -882,7 +882,7 @@ TEST(DirectSolverTakeTest_CulhamGeometry, DirectSolverDirBC_Interior_CulhamGeome std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; - auto grid = std::make_unique(radii, angles); + auto grid = std::make_unique(radii, angles); double Rmax = radii.back(); @@ -924,7 +924,7 @@ TEST(DirectSolverTakeTest_CulhamGeometry, DirectSolverAcrossOrigin_CulhamGeometr std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; - auto grid = std::make_unique(radii, angles); + auto grid = std::make_unique(radii, angles); double Rmax = radii.back(); @@ -976,7 +976,7 @@ TEST(DirectSolverTakeTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecis std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; - auto grid = std::make_unique(radii, angles); + auto grid = std::make_unique(radii, angles); double Rmax = radii.back(); @@ -1018,7 +1018,7 @@ TEST(DirectSolverTakeTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecis std::vector angles = { 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; - auto grid = std::make_unique(radii, angles); + auto grid = std::make_unique(radii, angles); double Rmax = radii.back(); diff --git a/tests/Residual/residual.cpp b/tests/Residual/residual.cpp index 17c9ae2a..0c6d2b29 100644 --- a/tests/Residual/residual.cpp +++ b/tests/Residual/residual.cpp @@ -45,7 +45,7 @@ TEST(OperatorATest, applyA_DirBC_Interior) bool cache_density_rpofile_coefficients = true; bool cache_domain_geometry = true; - auto grid = std::make_unique(radii, angles); + auto grid = std::make_unique(radii, angles); DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); auto levelCache = std::make_unique>( *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); @@ -100,7 +100,7 @@ TEST(OperatorATest, applyA_AcrossOrigin) bool cache_density_rpofile_coefficients = true; bool cache_domain_geometry = true; - auto grid = std::make_unique(radii, angles); + auto grid = std::make_unique(radii, angles); DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); auto levelCache = std::make_unique>( *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); From 3f0fdac7592f6a3623fd13c1d3bbf24a18a8ea5a Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Mon, 10 Aug 2026 17:27:04 +0200 Subject: [PATCH 6/7] Must use global indexing --- include/Level/level.h | 11 +++++++---- include/Level/levelCache.inl | 29 ++++++++++++++++++----------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/include/Level/level.h b/include/Level/level.h index 5f5a837c..101a37f9 100644 --- a/include/Level/level.h +++ b/include/Level/level.h @@ -136,7 +136,7 @@ class LevelCache public: explicit LevelCache(const PolarGrid& grid, const DensityProfileCoefficients& density_profile_coefficients, const DomainGeometry& domain_geometry, const bool cache_density_profile_coefficients, - const bool cache_domain_geometry); + const bool cache_domain_geometry, const int level_depth); const DomainGeometry& domainGeometry() const; const DensityProfileCoefficients& densityProfileCoefficients() const; @@ -155,8 +155,10 @@ class LevelCache double theta, double& coeff_beta, double& arr, double& att, double& art, double& detDF) const { - coeff_beta = cache_density_profile_coefficients_ ? coeff_beta_[global_index] - : density_profile_coefficients_.beta(i_r, i_theta); + const int i_r_glob = i_r << level_depth_; + const int i_theta_glob = i_theta << level_depth_; + coeff_beta = cache_density_profile_coefficients_ ? coeff_beta_[global_index] + : density_profile_coefficients_.beta(i_r_glob, i_theta_glob); if (cache_domain_geometry_) { arr = arr_[global_index]; @@ -167,13 +169,14 @@ class LevelCache else { double coeff_alpha = cache_density_profile_coefficients_ ? coeff_alpha_[global_index] - : density_profile_coefficients_.alpha(i_r, i_theta); + : density_profile_coefficients_.alpha(i_r_glob, i_theta_glob); compute_jacobian_elements(domain_geometry_, r, theta, coeff_alpha, arr, att, art, detDF); } } private: + const int level_depth_; const DomainGeometry domain_geometry_; const DensityProfileCoefficients density_profile_coefficients_; diff --git a/include/Level/levelCache.inl b/include/Level/levelCache.inl index 49f71e97..20a66e1d 100644 --- a/include/Level/levelCache.inl +++ b/include/Level/levelCache.inl @@ -6,7 +6,7 @@ template static void cache_density_profile_coefficients(const PolarGrid& grid, const DensityProfileCoefficients& density_profile_coefficients, const Vector& coeff_alpha, const Vector& coeff_beta, - const bool cache_domain_geometry) + const bool cache_domain_geometry, int level_depth) { Kokkos::parallel_for( "Cache density profile coefficients", @@ -16,11 +16,13 @@ static void cache_density_profile_coefficients(const PolarGrid& grid, ), // Kokkos lambda function to execute for each point in the index space KOKKOS_LAMBDA(const int i_r, const int i_theta) { - const int index = grid.index(i_r, i_theta); + const int index = grid.index(i_r, i_theta); + const int i_r_glob = i_r << level_depth; + const int i_theta_glob = i_theta << level_depth; if (!cache_domain_geometry) { - coeff_alpha(index) = density_profile_coefficients.alpha(i_r, i_theta); + coeff_alpha(index) = density_profile_coefficients.alpha(i_r_glob, i_theta_glob); } - coeff_beta(index) = density_profile_coefficients.beta(i_r, i_theta); + coeff_beta(index) = density_profile_coefficients.beta(i_r_glob, i_theta_glob); }); } @@ -28,7 +30,7 @@ template & vec_arr, const Vector& vec_att, const Vector& vec_art, - const Vector& vec_detDF) + const Vector& vec_detDF, int level_depth) { // We split the loops into two regions to better respect the // access patterns of the smoother and improve cache locality @@ -45,7 +47,9 @@ static void cache_domain_geometry(const PolarGrid& grid, const DensityProfileCoe const double r = grid.radius(i_r); const double theta = grid.theta(i_theta); const int index = grid.index(i_r, i_theta); - const double coeff_alpha = density_profile_coefficients.alpha(i_r, i_theta); + const int i_r_glob = i_r << level_depth; + const int i_theta_glob = i_theta << level_depth; + const double coeff_alpha = density_profile_coefficients.alpha(i_r_glob, i_theta_glob); double arr, att, art, detDF; compute_jacobian_elements(domain_geometry, r, theta, coeff_alpha, arr, att, art, detDF); @@ -66,7 +70,9 @@ static void cache_domain_geometry(const PolarGrid& grid, const DensityProfileCoe const double theta = grid.theta(i_theta); const double r = grid.radius(i_r); const int index = grid.index(i_r, i_theta); - const double coeff_alpha = density_profile_coefficients.alpha(i_r, i_theta); + const int i_r_glob = i_r << level_depth; + const int i_theta_glob = i_theta << level_depth; + const double coeff_alpha = density_profile_coefficients.alpha(i_r_glob, i_theta_glob); double arr, att, art, detDF; compute_jacobian_elements(domain_geometry, r, theta, coeff_alpha, arr, att, art, detDF); @@ -83,8 +89,9 @@ template ::LevelCache( const PolarGrid& grid, const DensityProfileCoefficients& density_profile_coefficients, const DomainGeometry& domain_geometry, const bool cache_density_profile_coefficients, - const bool cache_domain_geometry) - : domain_geometry_(domain_geometry) + const bool cache_domain_geometry, const int level_depth) + : level_depth_(level_depth) + , domain_geometry_(domain_geometry) , density_profile_coefficients_(density_profile_coefficients) , cache_density_profile_coefficients_(cache_density_profile_coefficients) // If the domain geometry is cached, we don't need to cache the alpha coefficient @@ -101,14 +108,14 @@ LevelCache::LevelCache( // repeated expensive evaluations during runtime computations if (cache_density_profile_coefficients_) { level_cache_helpers::cache_density_profile_coefficients(grid, density_profile_coefficients, coeff_alpha_, - coeff_beta_, cache_domain_geometry); + coeff_beta_, cache_domain_geometry, level_depth); } // Pre-compute and store Jacobian matrix elements (arr, att, art, detDF) at all grid nodes // to avoid repeated coordinate transformation calculations during domain operations if (cache_domain_geometry_) { level_cache_helpers::cache_domain_geometry(grid, density_profile_coefficients, domain_geometry, arr_, att_, - art_, detDF_); + art_, detDF_, level_depth); } Kokkos::fence(); } From 3c27bcdce3d30172a72e3e2448d6578ec84cc43c Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Mon, 10 Aug 2026 17:44:07 +0200 Subject: [PATCH 7/7] Pass level depth to LevelCache --- include/GMGPolar/setup.h | 4 +- tests/DirectSolver/directSolver.cpp | 44 +++++++++---------- .../extrapolated_smoother.cpp | 20 ++++----- tests/Residual/residual.cpp | 4 +- tests/Smoother/smoother.cpp | 20 ++++----- 5 files changed, 46 insertions(+), 46 deletions(-) diff --git a/include/GMGPolar/setup.h b/include/GMGPolar/setup.h index abcdcb14..250ef397 100644 --- a/include/GMGPolar/setup.h +++ b/include/GMGPolar/setup.h @@ -42,14 +42,14 @@ void GMGPolar::setup() auto finest_levelCache = std::make_unique>( *finest_grid, density_profile_coefficients_, domain_geometry_, cache_density_profile_coefficients_, - cache_domain_geometry_); + cache_domain_geometry_, 0); levels_.emplace_back(0, std::move(finest_grid), std::move(finest_levelCache), extrapolation_, FMG_, PCG_FMG_); for (int level_depth = 1; level_depth < number_of_levels_; level_depth++) { auto current_grid = std::make_unique(coarseningGrid(levels_[level_depth - 1].grid())); auto current_levelCache = std::make_unique>( *current_grid, density_profile_coefficients_, domain_geometry_, cache_density_profile_coefficients_, - cache_domain_geometry_); + cache_domain_geometry_, level_depth); levels_.emplace_back(level_depth, std::move(current_grid), std::move(current_levelCache), extrapolation_, FMG_, PCG_FMG_); } diff --git a/tests/DirectSolver/directSolver.cpp b/tests/DirectSolver/directSolver.cpp index 1e156529..d4ab15d7 100644 --- a/tests/DirectSolver/directSolver.cpp +++ b/tests/DirectSolver/directSolver.cpp @@ -65,7 +65,7 @@ TEST(DirectSolverTest, directSolver_DirBC_Interior) bool cache_domain_geometry = true; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, false); @@ -118,7 +118,7 @@ TEST(DirectSolverTest, directSolver_AcrossOrigin) bool cache_domain_geometry = true; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -173,7 +173,7 @@ TEST(DirectSolverTest_CircularGeometry, DirectSolverDirBC_Interior_CircularGeome bool cache_domain_geometry = false; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -215,7 +215,7 @@ TEST(DirectSolverTest_CircularGeometry, DirectSolverAcrossOrigin_CircularGeometr bool cache_domain_geometry = false; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -263,7 +263,7 @@ TEST(DirectSolverTest_ShafranovGeometry, DirectSolverDirBC_Interior_ShafranovGeo bool cache_domain_geometry = false; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -307,7 +307,7 @@ TEST(DirectSolverTest_ShafranovGeometry, DirectSolverAcrossOrigin_ShafranovGeome bool cache_domain_geometry = false; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -355,7 +355,7 @@ TEST(DirectSolverTest_CzarnyGeometry, DirectSolverDirBC_Interior_CzarnyGeometry) bool cache_domain_geometry = false; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -399,7 +399,7 @@ TEST(DirectSolverTest_CzarnyGeometry, DirectSolverAcrossOrigin_CzarnyGeometry) bool cache_domain_geometry = false; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -445,7 +445,7 @@ TEST(DirectSolverTest_CulhamGeometry, DirectSolverDirBC_Interior_CulhamGeometry) bool cache_domain_geometry = false; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -487,7 +487,7 @@ TEST(DirectSolverTest_CulhamGeometry, DirectSolverAcrossOrigin_CulhamGeometry) bool cache_domain_geometry = false; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -541,7 +541,7 @@ TEST(DirectSolverTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecision_ bool cache_domain_geometry = false; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -583,7 +583,7 @@ TEST(DirectSolverTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecision2 bool cache_domain_geometry = false; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -626,7 +626,7 @@ TEST(DirectSolverTakeTest_CircularGeometry, DirectSolverDirBC_Interior_CircularG bool cache_domain_geometry = true; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -668,7 +668,7 @@ TEST(DirectSolverTakeTest_CircularGeometry, DirectSolverAcrossOrigin_CircularGeo bool cache_domain_geometry = true; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -716,7 +716,7 @@ TEST(DirectSolverTakeTest_ShafranovGeometry, DirectSolverDirBC_Interior_Shafrano bool cache_domain_geometry = true; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -760,7 +760,7 @@ TEST(DirectSolverTakeTest_ShafranovGeometry, DirectSolverAcrossOrigin_ShafranovG bool cache_domain_geometry = true; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -808,7 +808,7 @@ TEST(DirectSolverTakeTest_CzarnyGeometry, DirectSolverDirBC_Interior_CzarnyGeome bool cache_domain_geometry = true; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -852,7 +852,7 @@ TEST(DirectSolverTakeTest_CzarnyGeometry, DirectSolverAcrossOrigin_CzarnyGeometr bool cache_domain_geometry = true; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -898,7 +898,7 @@ TEST(DirectSolverTakeTest_CulhamGeometry, DirectSolverDirBC_Interior_CulhamGeome bool cache_domain_geometry = true; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -940,7 +940,7 @@ TEST(DirectSolverTakeTest_CulhamGeometry, DirectSolverAcrossOrigin_CulhamGeometr bool cache_domain_geometry = true; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -992,7 +992,7 @@ TEST(DirectSolverTakeTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecis bool cache_domain_geometry = true; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -1034,7 +1034,7 @@ TEST(DirectSolverTakeTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecis bool cache_domain_geometry = true; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); diff --git a/tests/ExtrapolatedSmoother/extrapolated_smoother.cpp b/tests/ExtrapolatedSmoother/extrapolated_smoother.cpp index 6d335317..3b57cef3 100644 --- a/tests/ExtrapolatedSmoother/extrapolated_smoother.cpp +++ b/tests/ExtrapolatedSmoother/extrapolated_smoother.cpp @@ -54,7 +54,7 @@ TEST(ExtrapolatedSmootherTest, extrapolatedSmoother_DirBC_Interior) bool cache_domain_geometry = true; auto levelCache = std::make_unique>( - *tmp_grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *tmp_grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(tmp_grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -115,7 +115,7 @@ TEST(ExtrapolatedSmootherTest, extrapolatedSmoother_AcossOrigin) bool cache_domain_geometry = true; auto levelCache = std::make_unique>( - *tmp_grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *tmp_grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(tmp_grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -176,7 +176,7 @@ void ExtrapolatedSmootherTest_ExtrapolatedSmootherDirBC_Interior() bool cache_domain_geometry = false; auto levelCache = std::make_unique>( - *tmp_grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *tmp_grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(tmp_grid), std::move(levelCache), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); @@ -267,7 +267,7 @@ void ExtrapolatedSmootherTest_ExtrapolatedSmootherAcrossOrigin() bool cache_domain_geometry = false; auto levelCache = std::make_unique>( - *tmp_grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *tmp_grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(tmp_grid), std::move(levelCache), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); @@ -359,7 +359,7 @@ void ExtrapolatedSmootherTest_ExtrapolatedSmootherDirBC_Interior_SmallestGrid() bool cache_domain_geometry = false; auto levelCache = std::make_unique>( - *tmp_grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *tmp_grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(tmp_grid), std::move(levelCache), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); @@ -451,7 +451,7 @@ void ExtrapolatedSmootherTest_ExtrapolatedSmootherAcrossOrigin_SmallestGrid() bool cache_domain_geometry = false; auto levelCache = std::make_unique>( - *tmp_grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *tmp_grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(tmp_grid), std::move(levelCache), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); @@ -544,7 +544,7 @@ void ExtrapolatedSmootherTest_ExtrapolatedSmootherTakeDirBC_Interior() bool cache_domain_geometry = true; auto levelCache = std::make_unique>( - *tmp_grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *tmp_grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(tmp_grid), std::move(levelCache), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); @@ -635,7 +635,7 @@ void ExtrapolatedSmootherTest_ExtrapolatedSmootherTakeAcrossOrigin() bool cache_domain_geometry = true; auto levelCache = std::make_unique>( - *tmp_grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *tmp_grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(tmp_grid), std::move(levelCache), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); @@ -725,7 +725,7 @@ void ExtrapolatedSmootherTest_ExtrapolatedSmootherTakeDirBC_Interior_SmallestGri bool cache_domain_geometry = true; auto levelCache = std::make_unique>( - *tmp_grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *tmp_grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(tmp_grid), std::move(levelCache), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); @@ -815,7 +815,7 @@ void ExtrapolatedSmootherTest_ExtrapolatedSmootherTakeAcrossOrigin_SmallestGrid( bool cache_domain_geometry = true; auto levelCache = std::make_unique>( - *tmp_grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *tmp_grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(tmp_grid), std::move(levelCache), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); diff --git a/tests/Residual/residual.cpp b/tests/Residual/residual.cpp index 0c6d2b29..5ebdc7ff 100644 --- a/tests/Residual/residual.cpp +++ b/tests/Residual/residual.cpp @@ -48,7 +48,7 @@ TEST(OperatorATest, applyA_DirBC_Interior) auto grid = std::make_unique(radii, angles); DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, false); @@ -103,7 +103,7 @@ TEST(OperatorATest, applyA_AcrossOrigin) auto grid = std::make_unique(radii, angles); DensityProfileCoefficientsType coefficients(*grid, Rmax, alpha_jump); auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, false); diff --git a/tests/Smoother/smoother.cpp b/tests/Smoother/smoother.cpp index 4057c2e1..43425290 100644 --- a/tests/Smoother/smoother.cpp +++ b/tests/Smoother/smoother.cpp @@ -53,7 +53,7 @@ void SmootherTest_smoother_DirBC_Interior() bool cache_domain_geometry = true; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -116,7 +116,7 @@ void SmootherTest_smoother_AcrossOrigin() bool cache_domain_geometry = true; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -180,7 +180,7 @@ void SmootherTest_SmootherDirBC_Interior() bool cache_domain_geometry = false; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -257,7 +257,7 @@ void SmootherTest_SmootherAcrossOrigin() bool cache_domain_geometry = false; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -333,7 +333,7 @@ void SmootherTest_SmootherDirBC_Interior_SmallestGrid() bool cache_domain_geometry = false; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -409,7 +409,7 @@ void SmootherTest_SmootherAcrossOrigin_SmallestGrid() bool cache_domain_geometry = false; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -488,7 +488,7 @@ void SmootherTest_SmootherTakeDirBC_Interior() bool cache_domain_geometry = true; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -565,7 +565,7 @@ void SmootherTest_SmootherTakeAcrossOrigin() bool cache_domain_geometry = true; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -641,7 +641,7 @@ void SmootherTest_SmootherTakeDirBC_Interior_SmallestGrid() bool cache_domain_geometry = true; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); @@ -717,7 +717,7 @@ void SmootherTest_SmootherTakeAcrossOrigin_SmallestGrid() bool cache_domain_geometry = true; auto levelCache = std::make_unique>( - *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry); + *grid, coefficients, domain_geometry, cache_density_rpofile_coefficients, cache_domain_geometry, 0); Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0);