diff --git a/CMakeLists.txt b/CMakeLists.txt index 47cad7d8..1295c057 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,7 @@ if(NOT CMAKE_BUILD_TYPE) endif() # Set compiler flags -set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra -pedantic -Wno-unused -Wno-psabi") +set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra -Wpedantic -Wno-unused -Wno-psabi -Wfloat-conversion") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -mtune=generic -Wno-psabi") # Set coverage compiler flags - must come before any targets are defined diff --git a/include/InputFunctions/SourceTerms/cartesianR2_Poisson_CircularGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_Poisson_CircularGeometry.h index a467e308..92cc7500 100644 --- a/include/InputFunctions/SourceTerms/cartesianR2_Poisson_CircularGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR2_Poisson_CircularGeometry.h @@ -4,15 +4,17 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR2_Poisson_CircularGeometry : public SourceTerm { public: - CartesianR2_Poisson_CircularGeometry() = default; - explicit CartesianR2_Poisson_CircularGeometry(double Rmax); + explicit CartesianR2_Poisson_CircularGeometry(PolarGrid const& grid, double Rmax); virtual ~CartesianR2_Poisson_CircularGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; }; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_Poisson_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_Poisson_CzarnyGeometry.h index c88efc1d..4ceafc86 100644 --- a/include/InputFunctions/SourceTerms/cartesianR2_Poisson_CzarnyGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR2_Poisson_CzarnyGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR2_Poisson_CzarnyGeometry : public SourceTerm { public: - CartesianR2_Poisson_CzarnyGeometry() = default; - explicit CartesianR2_Poisson_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, double ellipticity_e); + explicit CartesianR2_Poisson_CzarnyGeometry(PolarGrid const& grid, double Rmax, double inverse_aspect_ratio_epsilon, + double ellipticity_e); virtual ~CartesianR2_Poisson_CzarnyGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double inverse_aspect_ratio_epsilon = 0.3; const double ellipticity_e = 1.4; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_Poisson_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_Poisson_ShafranovGeometry.h index ec5fea84..c9c829fb 100644 --- a/include/InputFunctions/SourceTerms/cartesianR2_Poisson_ShafranovGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR2_Poisson_ShafranovGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR2_Poisson_ShafranovGeometry : public SourceTerm { public: - CartesianR2_Poisson_ShafranovGeometry() = default; - explicit CartesianR2_Poisson_ShafranovGeometry(double Rmax, double elongation_kappa, double shift_delta); + explicit CartesianR2_Poisson_ShafranovGeometry(PolarGrid const& grid, double Rmax, double elongation_kappa, + double shift_delta); virtual ~CartesianR2_Poisson_ShafranovGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double elongation_kappa = 0.3; const double shift_delta = 0.2; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CircularGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CircularGeometry.h index a9697801..a6dd8ba4 100644 --- a/include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CircularGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CircularGeometry.h @@ -4,15 +4,17 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR2_SonnendruckerGyro_CircularGeometry : public SourceTerm { public: - CartesianR2_SonnendruckerGyro_CircularGeometry() = default; - explicit CartesianR2_SonnendruckerGyro_CircularGeometry(double Rmax); + explicit CartesianR2_SonnendruckerGyro_CircularGeometry(PolarGrid const& grid, double Rmax); virtual ~CartesianR2_SonnendruckerGyro_CircularGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; }; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CzarnyGeometry.h index 66acb388..bf2585f8 100644 --- a/include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CzarnyGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CzarnyGeometry.h @@ -4,17 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR2_SonnendruckerGyro_CzarnyGeometry : public SourceTerm { public: - CartesianR2_SonnendruckerGyro_CzarnyGeometry() = default; - explicit CartesianR2_SonnendruckerGyro_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, - double ellipticity_e); + explicit CartesianR2_SonnendruckerGyro_CzarnyGeometry(PolarGrid const& grid, double Rmax, + double inverse_aspect_ratio_epsilon, double ellipticity_e); virtual ~CartesianR2_SonnendruckerGyro_CzarnyGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double inverse_aspect_ratio_epsilon = 0.3; const double ellipticity_e = 1.4; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_ShafranovGeometry.h index 5e431cc6..2e7c7495 100644 --- a/include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_ShafranovGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_ShafranovGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR2_SonnendruckerGyro_ShafranovGeometry : public SourceTerm { public: - CartesianR2_SonnendruckerGyro_ShafranovGeometry() = default; - explicit CartesianR2_SonnendruckerGyro_ShafranovGeometry(double Rmax, double elongation_kappa, double shift_delta); + explicit CartesianR2_SonnendruckerGyro_ShafranovGeometry(PolarGrid const& grid, double Rmax, + double elongation_kappa, double shift_delta); virtual ~CartesianR2_SonnendruckerGyro_ShafranovGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double elongation_kappa = 0.3; const double shift_delta = 0.2; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CircularGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CircularGeometry.h index e4fab6e5..8ef2d3a7 100644 --- a/include/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CircularGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CircularGeometry.h @@ -4,15 +4,17 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR2_Sonnendrucker_CircularGeometry : public SourceTerm { public: - CartesianR2_Sonnendrucker_CircularGeometry() = default; - explicit CartesianR2_Sonnendrucker_CircularGeometry(double Rmax); + explicit CartesianR2_Sonnendrucker_CircularGeometry(PolarGrid const& grid, double Rmax); virtual ~CartesianR2_Sonnendrucker_CircularGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; }; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CzarnyGeometry.h index 285cea22..5b6d2dc4 100644 --- a/include/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CzarnyGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CzarnyGeometry.h @@ -4,17 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR2_Sonnendrucker_CzarnyGeometry : public SourceTerm { public: - CartesianR2_Sonnendrucker_CzarnyGeometry() = default; - explicit CartesianR2_Sonnendrucker_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, - double ellipticity_e); + explicit CartesianR2_Sonnendrucker_CzarnyGeometry(PolarGrid const& grid, double Rmax, + double inverse_aspect_ratio_epsilon, double ellipticity_e); virtual ~CartesianR2_Sonnendrucker_CzarnyGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double inverse_aspect_ratio_epsilon = 0.3; const double ellipticity_e = 1.4; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_ShafranovGeometry.h index 1581c44b..28e75aba 100644 --- a/include/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_ShafranovGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_ShafranovGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR2_Sonnendrucker_ShafranovGeometry : public SourceTerm { public: - CartesianR2_Sonnendrucker_ShafranovGeometry() = default; - explicit CartesianR2_Sonnendrucker_ShafranovGeometry(double Rmax, double elongation_kappa, double shift_delta); + explicit CartesianR2_Sonnendrucker_ShafranovGeometry(PolarGrid const& grid, double Rmax, double elongation_kappa, + double shift_delta); virtual ~CartesianR2_Sonnendrucker_ShafranovGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double elongation_kappa = 0.3; const double shift_delta = 0.2; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CircularGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CircularGeometry.h index 255bfbfd..7fb72da6 100644 --- a/include/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CircularGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CircularGeometry.h @@ -4,15 +4,17 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR2_ZoniGyro_CircularGeometry : public SourceTerm { public: - CartesianR2_ZoniGyro_CircularGeometry() = default; - explicit CartesianR2_ZoniGyro_CircularGeometry(double Rmax); + explicit CartesianR2_ZoniGyro_CircularGeometry(PolarGrid const& grid, double Rmax); virtual ~CartesianR2_ZoniGyro_CircularGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; }; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CzarnyGeometry.h index d359a57e..f37061bf 100644 --- a/include/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CzarnyGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CzarnyGeometry.h @@ -4,17 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR2_ZoniGyro_CzarnyGeometry : public SourceTerm { public: - CartesianR2_ZoniGyro_CzarnyGeometry() = default; - explicit CartesianR2_ZoniGyro_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, - double ellipticity_e); + explicit CartesianR2_ZoniGyro_CzarnyGeometry(PolarGrid const& grid, double Rmax, + double inverse_aspect_ratio_epsilon, double ellipticity_e); virtual ~CartesianR2_ZoniGyro_CzarnyGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double inverse_aspect_ratio_epsilon = 0.3; const double ellipticity_e = 1.4; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_ShafranovGeometry.h index 598007b2..f0ccebb5 100644 --- a/include/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_ShafranovGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_ShafranovGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR2_ZoniGyro_ShafranovGeometry : public SourceTerm { public: - CartesianR2_ZoniGyro_ShafranovGeometry() = default; - explicit CartesianR2_ZoniGyro_ShafranovGeometry(double Rmax, double elongation_kappa, double shift_delta); + explicit CartesianR2_ZoniGyro_ShafranovGeometry(PolarGrid const& grid, double Rmax, double elongation_kappa, + double shift_delta); virtual ~CartesianR2_ZoniGyro_ShafranovGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double elongation_kappa = 0.3; const double shift_delta = 0.2; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CircularGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CircularGeometry.h index 02e8e36a..603cc7fc 100644 --- a/include/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CircularGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CircularGeometry.h @@ -4,15 +4,17 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR2_ZoniShiftedGyro_CircularGeometry : public SourceTerm { public: - CartesianR2_ZoniShiftedGyro_CircularGeometry() = default; - explicit CartesianR2_ZoniShiftedGyro_CircularGeometry(double Rmax); + explicit CartesianR2_ZoniShiftedGyro_CircularGeometry(PolarGrid const& grid, double Rmax); virtual ~CartesianR2_ZoniShiftedGyro_CircularGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; }; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CzarnyGeometry.h index 3bef4fbe..66204c6a 100644 --- a/include/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CzarnyGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CzarnyGeometry.h @@ -4,17 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR2_ZoniShiftedGyro_CzarnyGeometry : public SourceTerm { public: - CartesianR2_ZoniShiftedGyro_CzarnyGeometry() = default; - explicit CartesianR2_ZoniShiftedGyro_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, - double ellipticity_e); + explicit CartesianR2_ZoniShiftedGyro_CzarnyGeometry(PolarGrid const& grid, double Rmax, + double inverse_aspect_ratio_epsilon, double ellipticity_e); virtual ~CartesianR2_ZoniShiftedGyro_CzarnyGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double inverse_aspect_ratio_epsilon = 0.3; const double ellipticity_e = 1.4; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_ShafranovGeometry.h index c27fa256..c9a8393e 100644 --- a/include/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_ShafranovGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_ShafranovGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR2_ZoniShiftedGyro_ShafranovGeometry : public SourceTerm { public: - CartesianR2_ZoniShiftedGyro_ShafranovGeometry() = default; - explicit CartesianR2_ZoniShiftedGyro_ShafranovGeometry(double Rmax, double elongation_kappa, double shift_delta); + explicit CartesianR2_ZoniShiftedGyro_ShafranovGeometry(PolarGrid const& grid, double Rmax, double elongation_kappa, + double shift_delta); virtual ~CartesianR2_ZoniShiftedGyro_ShafranovGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double elongation_kappa = 0.3; const double shift_delta = 0.2; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CircularGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CircularGeometry.h index b7cd5a67..b9f4236e 100644 --- a/include/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CircularGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CircularGeometry.h @@ -4,15 +4,17 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR2_ZoniShifted_CircularGeometry : public SourceTerm { public: - CartesianR2_ZoniShifted_CircularGeometry() = default; - explicit CartesianR2_ZoniShifted_CircularGeometry(double Rmax); + explicit CartesianR2_ZoniShifted_CircularGeometry(PolarGrid const& grid, double Rmax); virtual ~CartesianR2_ZoniShifted_CircularGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; }; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CzarnyGeometry.h index 51d2d09f..3a682580 100644 --- a/include/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CzarnyGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CzarnyGeometry.h @@ -4,17 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR2_ZoniShifted_CzarnyGeometry : public SourceTerm { public: - CartesianR2_ZoniShifted_CzarnyGeometry() = default; - explicit CartesianR2_ZoniShifted_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, - double ellipticity_e); + explicit CartesianR2_ZoniShifted_CzarnyGeometry(PolarGrid const& grid, double Rmax, + double inverse_aspect_ratio_epsilon, double ellipticity_e); virtual ~CartesianR2_ZoniShifted_CzarnyGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double inverse_aspect_ratio_epsilon = 0.3; const double ellipticity_e = 1.4; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_ShafranovGeometry.h index 8b4b7712..c60f11d8 100644 --- a/include/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_ShafranovGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_ShafranovGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR2_ZoniShifted_ShafranovGeometry : public SourceTerm { public: - CartesianR2_ZoniShifted_ShafranovGeometry() = default; - explicit CartesianR2_ZoniShifted_ShafranovGeometry(double Rmax, double elongation_kappa, double shift_delta); + explicit CartesianR2_ZoniShifted_ShafranovGeometry(PolarGrid const& grid, double Rmax, double elongation_kappa, + double shift_delta); virtual ~CartesianR2_ZoniShifted_ShafranovGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double elongation_kappa = 0.3; const double shift_delta = 0.2; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_Zoni_CircularGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_Zoni_CircularGeometry.h index 5ef10fbf..c763e6b3 100644 --- a/include/InputFunctions/SourceTerms/cartesianR2_Zoni_CircularGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR2_Zoni_CircularGeometry.h @@ -4,15 +4,17 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR2_Zoni_CircularGeometry : public SourceTerm { public: - CartesianR2_Zoni_CircularGeometry() = default; - explicit CartesianR2_Zoni_CircularGeometry(double Rmax); + explicit CartesianR2_Zoni_CircularGeometry(PolarGrid const& grid, double Rmax); virtual ~CartesianR2_Zoni_CircularGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; }; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_Zoni_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_Zoni_CzarnyGeometry.h index 60e05865..25596679 100644 --- a/include/InputFunctions/SourceTerms/cartesianR2_Zoni_CzarnyGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR2_Zoni_CzarnyGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR2_Zoni_CzarnyGeometry : public SourceTerm { public: - CartesianR2_Zoni_CzarnyGeometry() = default; - explicit CartesianR2_Zoni_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, double ellipticity_e); + explicit CartesianR2_Zoni_CzarnyGeometry(PolarGrid const& grid, double Rmax, double inverse_aspect_ratio_epsilon, + double ellipticity_e); virtual ~CartesianR2_Zoni_CzarnyGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double inverse_aspect_ratio_epsilon = 0.3; const double ellipticity_e = 1.4; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_Zoni_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_Zoni_ShafranovGeometry.h index dfe49922..a2a3d5ff 100644 --- a/include/InputFunctions/SourceTerms/cartesianR2_Zoni_ShafranovGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR2_Zoni_ShafranovGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR2_Zoni_ShafranovGeometry : public SourceTerm { public: - CartesianR2_Zoni_ShafranovGeometry() = default; - explicit CartesianR2_Zoni_ShafranovGeometry(double Rmax, double elongation_kappa, double shift_delta); + explicit CartesianR2_Zoni_ShafranovGeometry(PolarGrid const& grid, double Rmax, double elongation_kappa, + double shift_delta); virtual ~CartesianR2_Zoni_ShafranovGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double elongation_kappa = 0.3; const double shift_delta = 0.2; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_Poisson_CircularGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_Poisson_CircularGeometry.h index fdeace8b..de145f72 100644 --- a/include/InputFunctions/SourceTerms/cartesianR6_Poisson_CircularGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR6_Poisson_CircularGeometry.h @@ -4,15 +4,17 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR6_Poisson_CircularGeometry : public SourceTerm { public: - CartesianR6_Poisson_CircularGeometry() = default; - explicit CartesianR6_Poisson_CircularGeometry(double Rmax); + explicit CartesianR6_Poisson_CircularGeometry(PolarGrid const& grid, double Rmax); virtual ~CartesianR6_Poisson_CircularGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; }; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_Poisson_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_Poisson_CzarnyGeometry.h index 5f788eda..1a0f7743 100644 --- a/include/InputFunctions/SourceTerms/cartesianR6_Poisson_CzarnyGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR6_Poisson_CzarnyGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR6_Poisson_CzarnyGeometry : public SourceTerm { public: - CartesianR6_Poisson_CzarnyGeometry() = default; - explicit CartesianR6_Poisson_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, double ellipticity_e); + explicit CartesianR6_Poisson_CzarnyGeometry(PolarGrid const& grid, double Rmax, double inverse_aspect_ratio_epsilon, + double ellipticity_e); virtual ~CartesianR6_Poisson_CzarnyGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double inverse_aspect_ratio_epsilon = 0.3; const double ellipticity_e = 1.4; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_Poisson_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_Poisson_ShafranovGeometry.h index e437d28d..bab604b9 100644 --- a/include/InputFunctions/SourceTerms/cartesianR6_Poisson_ShafranovGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR6_Poisson_ShafranovGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR6_Poisson_ShafranovGeometry : public SourceTerm { public: - CartesianR6_Poisson_ShafranovGeometry() = default; - explicit CartesianR6_Poisson_ShafranovGeometry(double Rmax, double elongation_kappa, double shift_delta); + explicit CartesianR6_Poisson_ShafranovGeometry(PolarGrid const& grid, double Rmax, double elongation_kappa, + double shift_delta); virtual ~CartesianR6_Poisson_ShafranovGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double elongation_kappa = 0.3; const double shift_delta = 0.2; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CircularGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CircularGeometry.h index 03a40d2e..9b83913f 100644 --- a/include/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CircularGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CircularGeometry.h @@ -4,15 +4,17 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR6_SonnendruckerGyro_CircularGeometry : public SourceTerm { public: - CartesianR6_SonnendruckerGyro_CircularGeometry() = default; - explicit CartesianR6_SonnendruckerGyro_CircularGeometry(double Rmax); + explicit CartesianR6_SonnendruckerGyro_CircularGeometry(PolarGrid const& grid, double Rmax); virtual ~CartesianR6_SonnendruckerGyro_CircularGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; }; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CzarnyGeometry.h index fbba8664..03ebd62b 100644 --- a/include/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CzarnyGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CzarnyGeometry.h @@ -4,17 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR6_SonnendruckerGyro_CzarnyGeometry : public SourceTerm { public: - CartesianR6_SonnendruckerGyro_CzarnyGeometry() = default; - explicit CartesianR6_SonnendruckerGyro_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, - double ellipticity_e); + explicit CartesianR6_SonnendruckerGyro_CzarnyGeometry(PolarGrid const& grid, double Rmax, + double inverse_aspect_ratio_epsilon, double ellipticity_e); virtual ~CartesianR6_SonnendruckerGyro_CzarnyGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double inverse_aspect_ratio_epsilon = 0.3; const double ellipticity_e = 1.4; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_ShafranovGeometry.h index 11b3c41d..0af32921 100644 --- a/include/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_ShafranovGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_ShafranovGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR6_SonnendruckerGyro_ShafranovGeometry : public SourceTerm { public: - CartesianR6_SonnendruckerGyro_ShafranovGeometry() = default; - explicit CartesianR6_SonnendruckerGyro_ShafranovGeometry(double Rmax, double elongation_kappa, double shift_delta); + explicit CartesianR6_SonnendruckerGyro_ShafranovGeometry(PolarGrid const& grid, double Rmax, + double elongation_kappa, double shift_delta); virtual ~CartesianR6_SonnendruckerGyro_ShafranovGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double elongation_kappa = 0.3; const double shift_delta = 0.2; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CircularGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CircularGeometry.h index ec1d4621..fcf9e660 100644 --- a/include/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CircularGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CircularGeometry.h @@ -4,15 +4,17 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR6_Sonnendrucker_CircularGeometry : public SourceTerm { public: - CartesianR6_Sonnendrucker_CircularGeometry() = default; - explicit CartesianR6_Sonnendrucker_CircularGeometry(double Rmax); + explicit CartesianR6_Sonnendrucker_CircularGeometry(PolarGrid const& grid, double Rmax); virtual ~CartesianR6_Sonnendrucker_CircularGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; }; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CzarnyGeometry.h index b63902cc..91c3d813 100644 --- a/include/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CzarnyGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CzarnyGeometry.h @@ -4,17 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR6_Sonnendrucker_CzarnyGeometry : public SourceTerm { public: - CartesianR6_Sonnendrucker_CzarnyGeometry() = default; - explicit CartesianR6_Sonnendrucker_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, - double ellipticity_e); + explicit CartesianR6_Sonnendrucker_CzarnyGeometry(PolarGrid const& grid, double Rmax, + double inverse_aspect_ratio_epsilon, double ellipticity_e); virtual ~CartesianR6_Sonnendrucker_CzarnyGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double inverse_aspect_ratio_epsilon = 0.3; const double ellipticity_e = 1.4; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_ShafranovGeometry.h index 79180d92..f87e24cf 100644 --- a/include/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_ShafranovGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_ShafranovGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR6_Sonnendrucker_ShafranovGeometry : public SourceTerm { public: - CartesianR6_Sonnendrucker_ShafranovGeometry() = default; - explicit CartesianR6_Sonnendrucker_ShafranovGeometry(double Rmax, double elongation_kappa, double shift_delta); + explicit CartesianR6_Sonnendrucker_ShafranovGeometry(PolarGrid const& grid, double Rmax, double elongation_kappa, + double shift_delta); virtual ~CartesianR6_Sonnendrucker_ShafranovGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double elongation_kappa = 0.3; const double shift_delta = 0.2; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CircularGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CircularGeometry.h index 5445bdfa..9000eb6c 100644 --- a/include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CircularGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CircularGeometry.h @@ -4,15 +4,17 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR6_ZoniGyro_CircularGeometry : public SourceTerm { public: - CartesianR6_ZoniGyro_CircularGeometry() = default; - explicit CartesianR6_ZoniGyro_CircularGeometry(double Rmax); + explicit CartesianR6_ZoniGyro_CircularGeometry(PolarGrid const& grid, double Rmax); virtual ~CartesianR6_ZoniGyro_CircularGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; }; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CzarnyGeometry.h index 9735b714..0398223f 100644 --- a/include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CzarnyGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CzarnyGeometry.h @@ -4,17 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR6_ZoniGyro_CzarnyGeometry : public SourceTerm { public: - CartesianR6_ZoniGyro_CzarnyGeometry() = default; - explicit CartesianR6_ZoniGyro_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, - double ellipticity_e); + explicit CartesianR6_ZoniGyro_CzarnyGeometry(PolarGrid const& grid, double Rmax, + double inverse_aspect_ratio_epsilon, double ellipticity_e); virtual ~CartesianR6_ZoniGyro_CzarnyGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double inverse_aspect_ratio_epsilon = 0.3; const double ellipticity_e = 1.4; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_ShafranovGeometry.h index 8b8ac616..467a6f6d 100644 --- a/include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_ShafranovGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_ShafranovGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR6_ZoniGyro_ShafranovGeometry : public SourceTerm { public: - CartesianR6_ZoniGyro_ShafranovGeometry() = default; - explicit CartesianR6_ZoniGyro_ShafranovGeometry(double Rmax, double elongation_kappa, double shift_delta); + explicit CartesianR6_ZoniGyro_ShafranovGeometry(PolarGrid const& grid, double Rmax, double elongation_kappa, + double shift_delta); virtual ~CartesianR6_ZoniGyro_ShafranovGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double elongation_kappa = 0.3; const double shift_delta = 0.2; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CircularGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CircularGeometry.h index 099648ae..7f735dc1 100644 --- a/include/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CircularGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CircularGeometry.h @@ -4,15 +4,17 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR6_ZoniShiftedGyro_CircularGeometry : public SourceTerm { public: - CartesianR6_ZoniShiftedGyro_CircularGeometry() = default; - explicit CartesianR6_ZoniShiftedGyro_CircularGeometry(double Rmax); + explicit CartesianR6_ZoniShiftedGyro_CircularGeometry(PolarGrid const& grid, double Rmax); virtual ~CartesianR6_ZoniShiftedGyro_CircularGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; }; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CzarnyGeometry.h index 06fb1f14..b7443c06 100644 --- a/include/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CzarnyGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CzarnyGeometry.h @@ -4,17 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR6_ZoniShiftedGyro_CzarnyGeometry : public SourceTerm { public: - CartesianR6_ZoniShiftedGyro_CzarnyGeometry() = default; - explicit CartesianR6_ZoniShiftedGyro_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, - double ellipticity_e); + explicit CartesianR6_ZoniShiftedGyro_CzarnyGeometry(PolarGrid const& grid, double Rmax, + double inverse_aspect_ratio_epsilon, double ellipticity_e); virtual ~CartesianR6_ZoniShiftedGyro_CzarnyGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double inverse_aspect_ratio_epsilon = 0.3; const double ellipticity_e = 1.4; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_ShafranovGeometry.h index 65e18bd4..3c8ce41e 100644 --- a/include/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_ShafranovGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_ShafranovGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR6_ZoniShiftedGyro_ShafranovGeometry : public SourceTerm { public: - CartesianR6_ZoniShiftedGyro_ShafranovGeometry() = default; - explicit CartesianR6_ZoniShiftedGyro_ShafranovGeometry(double Rmax, double elongation_kappa, double shift_delta); + explicit CartesianR6_ZoniShiftedGyro_ShafranovGeometry(PolarGrid const& grid, double Rmax, double elongation_kappa, + double shift_delta); virtual ~CartesianR6_ZoniShiftedGyro_ShafranovGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double elongation_kappa = 0.3; const double shift_delta = 0.2; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CircularGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CircularGeometry.h index 280d1789..ddd8a5b6 100644 --- a/include/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CircularGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CircularGeometry.h @@ -4,15 +4,17 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR6_ZoniShifted_CircularGeometry : public SourceTerm { public: - CartesianR6_ZoniShifted_CircularGeometry() = default; - explicit CartesianR6_ZoniShifted_CircularGeometry(double Rmax); + explicit CartesianR6_ZoniShifted_CircularGeometry(PolarGrid const& grid, double Rmax); virtual ~CartesianR6_ZoniShifted_CircularGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; }; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CzarnyGeometry.h index 30d11bef..53bb2160 100644 --- a/include/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CzarnyGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CzarnyGeometry.h @@ -4,17 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR6_ZoniShifted_CzarnyGeometry : public SourceTerm { public: - CartesianR6_ZoniShifted_CzarnyGeometry() = default; - explicit CartesianR6_ZoniShifted_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, - double ellipticity_e); + explicit CartesianR6_ZoniShifted_CzarnyGeometry(PolarGrid const& grid, double Rmax, + double inverse_aspect_ratio_epsilon, double ellipticity_e); virtual ~CartesianR6_ZoniShifted_CzarnyGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double inverse_aspect_ratio_epsilon = 0.3; const double ellipticity_e = 1.4; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_ShafranovGeometry.h index 4b5fc472..bec36bc6 100644 --- a/include/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_ShafranovGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_ShafranovGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR6_ZoniShifted_ShafranovGeometry : public SourceTerm { public: - CartesianR6_ZoniShifted_ShafranovGeometry() = default; - explicit CartesianR6_ZoniShifted_ShafranovGeometry(double Rmax, double elongation_kappa, double shift_delta); + explicit CartesianR6_ZoniShifted_ShafranovGeometry(PolarGrid const& grid, double Rmax, double elongation_kappa, + double shift_delta); virtual ~CartesianR6_ZoniShifted_ShafranovGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double elongation_kappa = 0.3; const double shift_delta = 0.2; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_Zoni_CircularGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_Zoni_CircularGeometry.h index 93840b23..c660c209 100644 --- a/include/InputFunctions/SourceTerms/cartesianR6_Zoni_CircularGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR6_Zoni_CircularGeometry.h @@ -4,15 +4,17 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR6_Zoni_CircularGeometry : public SourceTerm { public: - CartesianR6_Zoni_CircularGeometry() = default; - explicit CartesianR6_Zoni_CircularGeometry(double Rmax); + explicit CartesianR6_Zoni_CircularGeometry(PolarGrid const& grid, double Rmax); virtual ~CartesianR6_Zoni_CircularGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; }; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_Zoni_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_Zoni_CzarnyGeometry.h index a102dbc2..64c9ed4c 100644 --- a/include/InputFunctions/SourceTerms/cartesianR6_Zoni_CzarnyGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR6_Zoni_CzarnyGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR6_Zoni_CzarnyGeometry : public SourceTerm { public: - CartesianR6_Zoni_CzarnyGeometry() = default; - explicit CartesianR6_Zoni_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, double ellipticity_e); + explicit CartesianR6_Zoni_CzarnyGeometry(PolarGrid const& grid, double Rmax, double inverse_aspect_ratio_epsilon, + double ellipticity_e); virtual ~CartesianR6_Zoni_CzarnyGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double inverse_aspect_ratio_epsilon = 0.3; const double ellipticity_e = 1.4; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_Zoni_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_Zoni_ShafranovGeometry.h index 847d6682..860fcd96 100644 --- a/include/InputFunctions/SourceTerms/cartesianR6_Zoni_ShafranovGeometry.h +++ b/include/InputFunctions/SourceTerms/cartesianR6_Zoni_ShafranovGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class CartesianR6_Zoni_ShafranovGeometry : public SourceTerm { public: - CartesianR6_Zoni_ShafranovGeometry() = default; - explicit CartesianR6_Zoni_ShafranovGeometry(double Rmax, double elongation_kappa, double shift_delta); + explicit CartesianR6_Zoni_ShafranovGeometry(PolarGrid const& grid, double Rmax, double elongation_kappa, + double shift_delta); virtual ~CartesianR6_Zoni_ShafranovGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double elongation_kappa = 0.3; const double shift_delta = 0.2; diff --git a/include/InputFunctions/SourceTerms/polarR6_Poisson_CircularGeometry.h b/include/InputFunctions/SourceTerms/polarR6_Poisson_CircularGeometry.h index cdcf3f92..cb62750f 100644 --- a/include/InputFunctions/SourceTerms/polarR6_Poisson_CircularGeometry.h +++ b/include/InputFunctions/SourceTerms/polarR6_Poisson_CircularGeometry.h @@ -4,15 +4,17 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class PolarR6_Poisson_CircularGeometry : public SourceTerm { public: - PolarR6_Poisson_CircularGeometry() = default; - explicit PolarR6_Poisson_CircularGeometry(double Rmax); + explicit PolarR6_Poisson_CircularGeometry(PolarGrid const& grid, double Rmax); virtual ~PolarR6_Poisson_CircularGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; }; diff --git a/include/InputFunctions/SourceTerms/polarR6_Poisson_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/polarR6_Poisson_CzarnyGeometry.h index cd066ac8..d2395e53 100644 --- a/include/InputFunctions/SourceTerms/polarR6_Poisson_CzarnyGeometry.h +++ b/include/InputFunctions/SourceTerms/polarR6_Poisson_CzarnyGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class PolarR6_Poisson_CzarnyGeometry : public SourceTerm { public: - PolarR6_Poisson_CzarnyGeometry() = default; - explicit PolarR6_Poisson_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, double ellipticity_e); + explicit PolarR6_Poisson_CzarnyGeometry(PolarGrid const& grid, double Rmax, double inverse_aspect_ratio_epsilon, + double ellipticity_e); virtual ~PolarR6_Poisson_CzarnyGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double inverse_aspect_ratio_epsilon = 0.3; const double ellipticity_e = 1.4; diff --git a/include/InputFunctions/SourceTerms/polarR6_Poisson_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/polarR6_Poisson_ShafranovGeometry.h index 98723842..2da921c4 100644 --- a/include/InputFunctions/SourceTerms/polarR6_Poisson_ShafranovGeometry.h +++ b/include/InputFunctions/SourceTerms/polarR6_Poisson_ShafranovGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class PolarR6_Poisson_ShafranovGeometry : public SourceTerm { public: - PolarR6_Poisson_ShafranovGeometry() = default; - explicit PolarR6_Poisson_ShafranovGeometry(double Rmax, double elongation_kappa, double shift_delta); + explicit PolarR6_Poisson_ShafranovGeometry(PolarGrid const& grid, double Rmax, double elongation_kappa, + double shift_delta); virtual ~PolarR6_Poisson_ShafranovGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double elongation_kappa = 0.3; const double shift_delta = 0.2; diff --git a/include/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CircularGeometry.h b/include/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CircularGeometry.h index a32abb6f..153b3c12 100644 --- a/include/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CircularGeometry.h +++ b/include/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CircularGeometry.h @@ -4,15 +4,17 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class PolarR6_SonnendruckerGyro_CircularGeometry : public SourceTerm { public: - PolarR6_SonnendruckerGyro_CircularGeometry() = default; - explicit PolarR6_SonnendruckerGyro_CircularGeometry(double Rmax); + explicit PolarR6_SonnendruckerGyro_CircularGeometry(PolarGrid const& grid, double Rmax); virtual ~PolarR6_SonnendruckerGyro_CircularGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; }; diff --git a/include/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CzarnyGeometry.h index 295c01c2..43533ddd 100644 --- a/include/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CzarnyGeometry.h +++ b/include/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CzarnyGeometry.h @@ -4,17 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class PolarR6_SonnendruckerGyro_CzarnyGeometry : public SourceTerm { public: - PolarR6_SonnendruckerGyro_CzarnyGeometry() = default; - explicit PolarR6_SonnendruckerGyro_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, - double ellipticity_e); + explicit PolarR6_SonnendruckerGyro_CzarnyGeometry(PolarGrid const& grid, double Rmax, + double inverse_aspect_ratio_epsilon, double ellipticity_e); virtual ~PolarR6_SonnendruckerGyro_CzarnyGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double inverse_aspect_ratio_epsilon = 0.3; const double ellipticity_e = 1.4; diff --git a/include/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_ShafranovGeometry.h index 09440a9c..265e1029 100644 --- a/include/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_ShafranovGeometry.h +++ b/include/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_ShafranovGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class PolarR6_SonnendruckerGyro_ShafranovGeometry : public SourceTerm { public: - PolarR6_SonnendruckerGyro_ShafranovGeometry() = default; - explicit PolarR6_SonnendruckerGyro_ShafranovGeometry(double Rmax, double elongation_kappa, double shift_delta); + explicit PolarR6_SonnendruckerGyro_ShafranovGeometry(PolarGrid const& grid, double Rmax, double elongation_kappa, + double shift_delta); virtual ~PolarR6_SonnendruckerGyro_ShafranovGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double elongation_kappa = 0.3; const double shift_delta = 0.2; diff --git a/include/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CircularGeometry.h b/include/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CircularGeometry.h index 9557e614..ca937cd5 100644 --- a/include/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CircularGeometry.h +++ b/include/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CircularGeometry.h @@ -4,15 +4,17 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class PolarR6_Sonnendrucker_CircularGeometry : public SourceTerm { public: - PolarR6_Sonnendrucker_CircularGeometry() = default; - explicit PolarR6_Sonnendrucker_CircularGeometry(double Rmax); + explicit PolarR6_Sonnendrucker_CircularGeometry(PolarGrid const& grid, double Rmax); virtual ~PolarR6_Sonnendrucker_CircularGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; }; diff --git a/include/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CzarnyGeometry.h index e237860d..abe57421 100644 --- a/include/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CzarnyGeometry.h +++ b/include/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CzarnyGeometry.h @@ -4,17 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class PolarR6_Sonnendrucker_CzarnyGeometry : public SourceTerm { public: - PolarR6_Sonnendrucker_CzarnyGeometry() = default; - explicit PolarR6_Sonnendrucker_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, - double ellipticity_e); + explicit PolarR6_Sonnendrucker_CzarnyGeometry(PolarGrid const& grid, double Rmax, + double inverse_aspect_ratio_epsilon, double ellipticity_e); virtual ~PolarR6_Sonnendrucker_CzarnyGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double inverse_aspect_ratio_epsilon = 0.3; const double ellipticity_e = 1.4; diff --git a/include/InputFunctions/SourceTerms/polarR6_Sonnendrucker_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/polarR6_Sonnendrucker_ShafranovGeometry.h index 9821ecc9..86332104 100644 --- a/include/InputFunctions/SourceTerms/polarR6_Sonnendrucker_ShafranovGeometry.h +++ b/include/InputFunctions/SourceTerms/polarR6_Sonnendrucker_ShafranovGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class PolarR6_Sonnendrucker_ShafranovGeometry : public SourceTerm { public: - PolarR6_Sonnendrucker_ShafranovGeometry() = default; - explicit PolarR6_Sonnendrucker_ShafranovGeometry(double Rmax, double elongation_kappa, double shift_delta); + explicit PolarR6_Sonnendrucker_ShafranovGeometry(PolarGrid const& grid, double Rmax, double elongation_kappa, + double shift_delta); virtual ~PolarR6_Sonnendrucker_ShafranovGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double elongation_kappa = 0.3; const double shift_delta = 0.2; diff --git a/include/InputFunctions/SourceTerms/polarR6_ZoniGyro_CircularGeometry.h b/include/InputFunctions/SourceTerms/polarR6_ZoniGyro_CircularGeometry.h index 12bb7b0d..a7d6bf7b 100644 --- a/include/InputFunctions/SourceTerms/polarR6_ZoniGyro_CircularGeometry.h +++ b/include/InputFunctions/SourceTerms/polarR6_ZoniGyro_CircularGeometry.h @@ -4,15 +4,17 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class PolarR6_ZoniGyro_CircularGeometry : public SourceTerm { public: - PolarR6_ZoniGyro_CircularGeometry() = default; - explicit PolarR6_ZoniGyro_CircularGeometry(double Rmax); + explicit PolarR6_ZoniGyro_CircularGeometry(PolarGrid const& grid, double Rmax); virtual ~PolarR6_ZoniGyro_CircularGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; }; diff --git a/include/InputFunctions/SourceTerms/polarR6_ZoniGyro_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/polarR6_ZoniGyro_CzarnyGeometry.h index 1f24acc4..0a5d87e7 100644 --- a/include/InputFunctions/SourceTerms/polarR6_ZoniGyro_CzarnyGeometry.h +++ b/include/InputFunctions/SourceTerms/polarR6_ZoniGyro_CzarnyGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class PolarR6_ZoniGyro_CzarnyGeometry : public SourceTerm { public: - PolarR6_ZoniGyro_CzarnyGeometry() = default; - explicit PolarR6_ZoniGyro_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, double ellipticity_e); + explicit PolarR6_ZoniGyro_CzarnyGeometry(PolarGrid const& grid, double Rmax, double inverse_aspect_ratio_epsilon, + double ellipticity_e); virtual ~PolarR6_ZoniGyro_CzarnyGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double inverse_aspect_ratio_epsilon = 0.3; const double ellipticity_e = 1.4; diff --git a/include/InputFunctions/SourceTerms/polarR6_ZoniGyro_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/polarR6_ZoniGyro_ShafranovGeometry.h index bd07d64d..5bf5e1c1 100644 --- a/include/InputFunctions/SourceTerms/polarR6_ZoniGyro_ShafranovGeometry.h +++ b/include/InputFunctions/SourceTerms/polarR6_ZoniGyro_ShafranovGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class PolarR6_ZoniGyro_ShafranovGeometry : public SourceTerm { public: - PolarR6_ZoniGyro_ShafranovGeometry() = default; - explicit PolarR6_ZoniGyro_ShafranovGeometry(double Rmax, double elongation_kappa, double shift_delta); + explicit PolarR6_ZoniGyro_ShafranovGeometry(PolarGrid const& grid, double Rmax, double elongation_kappa, + double shift_delta); virtual ~PolarR6_ZoniGyro_ShafranovGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double elongation_kappa = 0.3; const double shift_delta = 0.2; diff --git a/include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CircularGeometry.h b/include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CircularGeometry.h index 409f4bd2..ce1176d0 100644 --- a/include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CircularGeometry.h +++ b/include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CircularGeometry.h @@ -4,15 +4,17 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class PolarR6_ZoniShiftedGyro_CircularGeometry : public SourceTerm { public: - PolarR6_ZoniShiftedGyro_CircularGeometry() = default; - explicit PolarR6_ZoniShiftedGyro_CircularGeometry(double Rmax); + explicit PolarR6_ZoniShiftedGyro_CircularGeometry(PolarGrid const& grid, double Rmax); virtual ~PolarR6_ZoniShiftedGyro_CircularGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; }; diff --git a/include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CulhamGeometry.h b/include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CulhamGeometry.h index 6398edf9..5ed4d3c8 100644 --- a/include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CulhamGeometry.h +++ b/include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CulhamGeometry.h @@ -4,15 +4,17 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class PolarR6_ZoniShiftedGyro_CulhamGeometry : public SourceTerm { public: - PolarR6_ZoniShiftedGyro_CulhamGeometry() = default; - explicit PolarR6_ZoniShiftedGyro_CulhamGeometry(double Rmax); + explicit PolarR6_ZoniShiftedGyro_CulhamGeometry(PolarGrid const& grid, double Rmax); virtual ~PolarR6_ZoniShiftedGyro_CulhamGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; }; diff --git a/include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CzarnyGeometry.h index 357d7507..edaff8e3 100644 --- a/include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CzarnyGeometry.h +++ b/include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CzarnyGeometry.h @@ -4,17 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class PolarR6_ZoniShiftedGyro_CzarnyGeometry : public SourceTerm { public: - PolarR6_ZoniShiftedGyro_CzarnyGeometry() = default; - explicit PolarR6_ZoniShiftedGyro_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, - double ellipticity_e); + explicit PolarR6_ZoniShiftedGyro_CzarnyGeometry(PolarGrid const& grid, double Rmax, + double inverse_aspect_ratio_epsilon, double ellipticity_e); virtual ~PolarR6_ZoniShiftedGyro_CzarnyGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double inverse_aspect_ratio_epsilon = 0.3; const double ellipticity_e = 1.4; diff --git a/include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_ShafranovGeometry.h index 79cbcef5..8bcc218f 100644 --- a/include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_ShafranovGeometry.h +++ b/include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_ShafranovGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class PolarR6_ZoniShiftedGyro_ShafranovGeometry : public SourceTerm { public: - PolarR6_ZoniShiftedGyro_ShafranovGeometry() = default; - explicit PolarR6_ZoniShiftedGyro_ShafranovGeometry(double Rmax, double elongation_kappa, double shift_delta); + explicit PolarR6_ZoniShiftedGyro_ShafranovGeometry(PolarGrid const& grid, double Rmax, double elongation_kappa, + double shift_delta); virtual ~PolarR6_ZoniShiftedGyro_ShafranovGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double elongation_kappa = 0.3; const double shift_delta = 0.2; diff --git a/include/InputFunctions/SourceTerms/polarR6_ZoniShifted_CircularGeometry.h b/include/InputFunctions/SourceTerms/polarR6_ZoniShifted_CircularGeometry.h index f24a2be0..92bbc214 100644 --- a/include/InputFunctions/SourceTerms/polarR6_ZoniShifted_CircularGeometry.h +++ b/include/InputFunctions/SourceTerms/polarR6_ZoniShifted_CircularGeometry.h @@ -4,15 +4,17 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class PolarR6_ZoniShifted_CircularGeometry : public SourceTerm { public: - PolarR6_ZoniShifted_CircularGeometry() = default; - explicit PolarR6_ZoniShifted_CircularGeometry(double Rmax); + explicit PolarR6_ZoniShifted_CircularGeometry(PolarGrid const& grid, double Rmax); virtual ~PolarR6_ZoniShifted_CircularGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; }; diff --git a/include/InputFunctions/SourceTerms/polarR6_ZoniShifted_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/polarR6_ZoniShifted_CzarnyGeometry.h index 5c917b73..7eec04bb 100644 --- a/include/InputFunctions/SourceTerms/polarR6_ZoniShifted_CzarnyGeometry.h +++ b/include/InputFunctions/SourceTerms/polarR6_ZoniShifted_CzarnyGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class PolarR6_ZoniShifted_CzarnyGeometry : public SourceTerm { public: - PolarR6_ZoniShifted_CzarnyGeometry() = default; - explicit PolarR6_ZoniShifted_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, double ellipticity_e); + explicit PolarR6_ZoniShifted_CzarnyGeometry(PolarGrid const& grid, double Rmax, double inverse_aspect_ratio_epsilon, + double ellipticity_e); virtual ~PolarR6_ZoniShifted_CzarnyGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double inverse_aspect_ratio_epsilon = 0.3; const double ellipticity_e = 1.4; diff --git a/include/InputFunctions/SourceTerms/polarR6_ZoniShifted_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/polarR6_ZoniShifted_ShafranovGeometry.h index e380d8e4..f2420f9f 100644 --- a/include/InputFunctions/SourceTerms/polarR6_ZoniShifted_ShafranovGeometry.h +++ b/include/InputFunctions/SourceTerms/polarR6_ZoniShifted_ShafranovGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class PolarR6_ZoniShifted_ShafranovGeometry : public SourceTerm { public: - PolarR6_ZoniShifted_ShafranovGeometry() = default; - explicit PolarR6_ZoniShifted_ShafranovGeometry(double Rmax, double elongation_kappa, double shift_delta); + explicit PolarR6_ZoniShifted_ShafranovGeometry(PolarGrid const& grid, double Rmax, double elongation_kappa, + double shift_delta); virtual ~PolarR6_ZoniShifted_ShafranovGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double elongation_kappa = 0.3; const double shift_delta = 0.2; diff --git a/include/InputFunctions/SourceTerms/polarR6_Zoni_CircularGeometry.h b/include/InputFunctions/SourceTerms/polarR6_Zoni_CircularGeometry.h index 84171adf..b4993ce8 100644 --- a/include/InputFunctions/SourceTerms/polarR6_Zoni_CircularGeometry.h +++ b/include/InputFunctions/SourceTerms/polarR6_Zoni_CircularGeometry.h @@ -4,15 +4,17 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class PolarR6_Zoni_CircularGeometry : public SourceTerm { public: - PolarR6_Zoni_CircularGeometry() = default; - explicit PolarR6_Zoni_CircularGeometry(double Rmax); + explicit PolarR6_Zoni_CircularGeometry(PolarGrid const& grid, double Rmax); virtual ~PolarR6_Zoni_CircularGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; }; diff --git a/include/InputFunctions/SourceTerms/polarR6_Zoni_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/polarR6_Zoni_CzarnyGeometry.h index f0a1891d..6f204a60 100644 --- a/include/InputFunctions/SourceTerms/polarR6_Zoni_CzarnyGeometry.h +++ b/include/InputFunctions/SourceTerms/polarR6_Zoni_CzarnyGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class PolarR6_Zoni_CzarnyGeometry : public SourceTerm { public: - PolarR6_Zoni_CzarnyGeometry() = default; - explicit PolarR6_Zoni_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, double ellipticity_e); + explicit PolarR6_Zoni_CzarnyGeometry(PolarGrid const& grid, double Rmax, double inverse_aspect_ratio_epsilon, + double ellipticity_e); virtual ~PolarR6_Zoni_CzarnyGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double inverse_aspect_ratio_epsilon = 0.3; const double ellipticity_e = 1.4; diff --git a/include/InputFunctions/SourceTerms/polarR6_Zoni_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/polarR6_Zoni_ShafranovGeometry.h index 4dac8754..b7b020f8 100644 --- a/include/InputFunctions/SourceTerms/polarR6_Zoni_ShafranovGeometry.h +++ b/include/InputFunctions/SourceTerms/polarR6_Zoni_ShafranovGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class PolarR6_Zoni_ShafranovGeometry : public SourceTerm { public: - PolarR6_Zoni_ShafranovGeometry() = default; - explicit PolarR6_Zoni_ShafranovGeometry(double Rmax, double elongation_kappa, double shift_delta); + explicit PolarR6_Zoni_ShafranovGeometry(PolarGrid const& grid, double Rmax, double elongation_kappa, + double shift_delta); virtual ~PolarR6_Zoni_ShafranovGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double elongation_kappa = 0.3; const double shift_delta = 0.2; diff --git a/include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CircularGeometry.h b/include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CircularGeometry.h index 78b4fb31..a729340d 100644 --- a/include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CircularGeometry.h +++ b/include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CircularGeometry.h @@ -4,15 +4,17 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class Refined_ZoniShiftedGyro_CircularGeometry : public SourceTerm { public: - Refined_ZoniShiftedGyro_CircularGeometry() = default; - explicit Refined_ZoniShiftedGyro_CircularGeometry(double Rmax); + explicit Refined_ZoniShiftedGyro_CircularGeometry(PolarGrid const& grid, double Rmax); virtual ~Refined_ZoniShiftedGyro_CircularGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; }; diff --git a/include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CulhamGeometry.h b/include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CulhamGeometry.h index d670e0b3..b11ce702 100644 --- a/include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CulhamGeometry.h +++ b/include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CulhamGeometry.h @@ -4,15 +4,17 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class Refined_ZoniShiftedGyro_CulhamGeometry : public SourceTerm { public: - Refined_ZoniShiftedGyro_CulhamGeometry() = default; - explicit Refined_ZoniShiftedGyro_CulhamGeometry(double Rmax); + explicit Refined_ZoniShiftedGyro_CulhamGeometry(PolarGrid const& grid, double Rmax); virtual ~Refined_ZoniShiftedGyro_CulhamGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; }; diff --git a/include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CzarnyGeometry.h index ef92c26d..75bacf59 100644 --- a/include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CzarnyGeometry.h +++ b/include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CzarnyGeometry.h @@ -4,17 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class Refined_ZoniShiftedGyro_CzarnyGeometry : public SourceTerm { public: - Refined_ZoniShiftedGyro_CzarnyGeometry() = default; - explicit Refined_ZoniShiftedGyro_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, - double ellipticity_e); + explicit Refined_ZoniShiftedGyro_CzarnyGeometry(PolarGrid const& grid, double Rmax, + double inverse_aspect_ratio_epsilon, double ellipticity_e); virtual ~Refined_ZoniShiftedGyro_CzarnyGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double inverse_aspect_ratio_epsilon = 0.3; const double ellipticity_e = 1.4; diff --git a/include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_ShafranovGeometry.h index 6f84f9cd..026caae3 100644 --- a/include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_ShafranovGeometry.h +++ b/include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_ShafranovGeometry.h @@ -4,16 +4,19 @@ #include "../sourceTerm.h" +#include "../../PolarGrid/polargrid.h" + class Refined_ZoniShiftedGyro_ShafranovGeometry : public SourceTerm { public: - Refined_ZoniShiftedGyro_ShafranovGeometry() = default; - explicit Refined_ZoniShiftedGyro_ShafranovGeometry(double Rmax, double elongation_kappa, double shift_delta); + explicit Refined_ZoniShiftedGyro_ShafranovGeometry(PolarGrid const& grid, double Rmax, double elongation_kappa, + double shift_delta); virtual ~Refined_ZoniShiftedGyro_ShafranovGeometry() = default; - double rhs_f(double r, double theta) const override; + double operator()(std::size_t i_r, std::size_t i_theta) const override; private: + PolarGrid const& grid_; const double Rmax = 1.3; const double elongation_kappa = 0.3; const double shift_delta = 0.2; diff --git a/include/InputFunctions/sourceTerm.h b/include/InputFunctions/sourceTerm.h index 5d005d9e..96f544aa 100644 --- a/include/InputFunctions/sourceTerm.h +++ b/include/InputFunctions/sourceTerm.h @@ -6,5 +6,5 @@ class SourceTerm SourceTerm() = default; virtual ~SourceTerm() = default; - virtual double rhs_f(double r, double theta) const = 0; + virtual double operator()(std::size_t i_r, std::size_t i_theta) const = 0; }; diff --git a/src/ConfigParser/select_test_case.cpp b/src/ConfigParser/select_test_case.cpp index 821afe02..f1951c9a 100644 --- a/src/ConfigParser/select_test_case.cpp +++ b/src/ConfigParser/select_test_case.cpp @@ -177,15 +177,15 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble switch (alpha_type) { case AlphaCoeff::POISSON: - source_term_ = std::make_unique(Rmax); + source_term_ = std::make_unique(grid_, Rmax); break; case AlphaCoeff::SONNENDRUCKER: switch (beta_type) { case BetaCoeff::ZERO: - source_term_ = std::make_unique(Rmax); + source_term_ = std::make_unique(grid_, Rmax); break; case BetaCoeff::ALPHA_INVERSE: - source_term_ = std::make_unique(Rmax); + source_term_ = std::make_unique(grid_, Rmax); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -194,10 +194,10 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble case AlphaCoeff::ZONI: switch (beta_type) { case BetaCoeff::ZERO: - source_term_ = std::make_unique(Rmax); + source_term_ = std::make_unique(grid_, Rmax); break; case BetaCoeff::ALPHA_INVERSE: - source_term_ = std::make_unique(Rmax); + source_term_ = std::make_unique(grid_, Rmax); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -206,10 +206,10 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble case AlphaCoeff::ZONI_SHIFTED: switch (beta_type) { case BetaCoeff::ZERO: - source_term_ = std::make_unique(Rmax); + source_term_ = std::make_unique(grid_, Rmax); break; case BetaCoeff::ALPHA_INVERSE: - source_term_ = std::make_unique(Rmax); + source_term_ = std::make_unique(grid_, Rmax); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -224,17 +224,17 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble switch (alpha_type) { case AlphaCoeff::POISSON: - source_term_ = std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; case AlphaCoeff::SONNENDRUCKER: switch (beta_type) { case BetaCoeff::ZERO: source_term_ = - std::make_unique(Rmax, kappa_eps, delta_e); + std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; case BetaCoeff::ALPHA_INVERSE: - source_term_ = - std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = std::make_unique( + grid_, Rmax, kappa_eps, delta_e); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -243,10 +243,12 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble case AlphaCoeff::ZONI: switch (beta_type) { case BetaCoeff::ZERO: - source_term_ = std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = + std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; case BetaCoeff::ALPHA_INVERSE: - source_term_ = std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = + std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -256,11 +258,11 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble switch (beta_type) { case BetaCoeff::ZERO: source_term_ = - std::make_unique(Rmax, kappa_eps, delta_e); + std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; case BetaCoeff::ALPHA_INVERSE: - source_term_ = - std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = std::make_unique(grid_, Rmax, + kappa_eps, delta_e); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -275,16 +277,17 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble switch (alpha_type) { case AlphaCoeff::POISSON: - source_term_ = std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; case AlphaCoeff::SONNENDRUCKER: switch (beta_type) { case BetaCoeff::ZERO: - source_term_ = std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = + std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; case BetaCoeff::ALPHA_INVERSE: source_term_ = - std::make_unique(Rmax, kappa_eps, delta_e); + std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -293,10 +296,11 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble case AlphaCoeff::ZONI: switch (beta_type) { case BetaCoeff::ZERO: - source_term_ = std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; case BetaCoeff::ALPHA_INVERSE: - source_term_ = std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = + std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -305,11 +309,12 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble case AlphaCoeff::ZONI_SHIFTED: switch (beta_type) { case BetaCoeff::ZERO: - source_term_ = std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = + std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; case BetaCoeff::ALPHA_INVERSE: source_term_ = - std::make_unique(Rmax, kappa_eps, delta_e); + std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -332,15 +337,15 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble switch (alpha_type) { case AlphaCoeff::POISSON: - source_term_ = std::make_unique(Rmax); + source_term_ = std::make_unique(grid_, Rmax); break; case AlphaCoeff::SONNENDRUCKER: switch (beta_type) { case BetaCoeff::ZERO: - source_term_ = std::make_unique(Rmax); + source_term_ = std::make_unique(grid_, Rmax); break; case BetaCoeff::ALPHA_INVERSE: - source_term_ = std::make_unique(Rmax); + source_term_ = std::make_unique(grid_, Rmax); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -349,10 +354,10 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble case AlphaCoeff::ZONI: switch (beta_type) { case BetaCoeff::ZERO: - source_term_ = std::make_unique(Rmax); + source_term_ = std::make_unique(grid_, Rmax); break; case BetaCoeff::ALPHA_INVERSE: - source_term_ = std::make_unique(Rmax); + source_term_ = std::make_unique(grid_, Rmax); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -361,10 +366,10 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble case AlphaCoeff::ZONI_SHIFTED: switch (beta_type) { case BetaCoeff::ZERO: - source_term_ = std::make_unique(Rmax); + source_term_ = std::make_unique(grid_, Rmax); break; case BetaCoeff::ALPHA_INVERSE: - source_term_ = std::make_unique(Rmax); + source_term_ = std::make_unique(grid_, Rmax); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -379,17 +384,17 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble switch (alpha_type) { case AlphaCoeff::POISSON: - source_term_ = std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; case AlphaCoeff::SONNENDRUCKER: switch (beta_type) { case BetaCoeff::ZERO: source_term_ = - std::make_unique(Rmax, kappa_eps, delta_e); + std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; case BetaCoeff::ALPHA_INVERSE: - source_term_ = - std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = std::make_unique( + grid_, Rmax, kappa_eps, delta_e); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -398,10 +403,12 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble case AlphaCoeff::ZONI: switch (beta_type) { case BetaCoeff::ZERO: - source_term_ = std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = + std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; case BetaCoeff::ALPHA_INVERSE: - source_term_ = std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = + std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -411,11 +418,11 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble switch (beta_type) { case BetaCoeff::ZERO: source_term_ = - std::make_unique(Rmax, kappa_eps, delta_e); + std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; case BetaCoeff::ALPHA_INVERSE: - source_term_ = - std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = std::make_unique(grid_, Rmax, + kappa_eps, delta_e); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -430,16 +437,17 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble switch (alpha_type) { case AlphaCoeff::POISSON: - source_term_ = std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; case AlphaCoeff::SONNENDRUCKER: switch (beta_type) { case BetaCoeff::ZERO: - source_term_ = std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = + std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; case BetaCoeff::ALPHA_INVERSE: source_term_ = - std::make_unique(Rmax, kappa_eps, delta_e); + std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -448,10 +456,11 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble case AlphaCoeff::ZONI: switch (beta_type) { case BetaCoeff::ZERO: - source_term_ = std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; case BetaCoeff::ALPHA_INVERSE: - source_term_ = std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = + std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -460,11 +469,12 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble case AlphaCoeff::ZONI_SHIFTED: switch (beta_type) { case BetaCoeff::ZERO: - source_term_ = std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = + std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; case BetaCoeff::ALPHA_INVERSE: source_term_ = - std::make_unique(Rmax, kappa_eps, delta_e); + std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -487,15 +497,15 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble switch (alpha_type) { case AlphaCoeff::POISSON: - source_term_ = std::make_unique(Rmax); + source_term_ = std::make_unique(grid_, Rmax); break; case AlphaCoeff::SONNENDRUCKER: switch (beta_type) { case BetaCoeff::ZERO: - source_term_ = std::make_unique(Rmax); + source_term_ = std::make_unique(grid_, Rmax); break; case BetaCoeff::ALPHA_INVERSE: - source_term_ = std::make_unique(Rmax); + source_term_ = std::make_unique(grid_, Rmax); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -504,10 +514,10 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble case AlphaCoeff::ZONI: switch (beta_type) { case BetaCoeff::ZERO: - source_term_ = std::make_unique(Rmax); + source_term_ = std::make_unique(grid_, Rmax); break; case BetaCoeff::ALPHA_INVERSE: - source_term_ = std::make_unique(Rmax); + source_term_ = std::make_unique(grid_, Rmax); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -516,10 +526,10 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble case AlphaCoeff::ZONI_SHIFTED: switch (beta_type) { case BetaCoeff::ZERO: - source_term_ = std::make_unique(Rmax); + source_term_ = std::make_unique(grid_, Rmax); break; case BetaCoeff::ALPHA_INVERSE: - source_term_ = std::make_unique(Rmax); + source_term_ = std::make_unique(grid_, Rmax); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -534,16 +544,17 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble switch (alpha_type) { case AlphaCoeff::POISSON: - source_term_ = std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; case AlphaCoeff::SONNENDRUCKER: switch (beta_type) { case BetaCoeff::ZERO: - source_term_ = std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = + std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; case BetaCoeff::ALPHA_INVERSE: source_term_ = - std::make_unique(Rmax, kappa_eps, delta_e); + std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -552,10 +563,11 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble case AlphaCoeff::ZONI: switch (beta_type) { case BetaCoeff::ZERO: - source_term_ = std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; case BetaCoeff::ALPHA_INVERSE: - source_term_ = std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = + std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -564,11 +576,12 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble case AlphaCoeff::ZONI_SHIFTED: switch (beta_type) { case BetaCoeff::ZERO: - source_term_ = std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = + std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; case BetaCoeff::ALPHA_INVERSE: source_term_ = - std::make_unique(Rmax, kappa_eps, delta_e); + std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -583,15 +596,17 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble switch (alpha_type) { case AlphaCoeff::POISSON: - source_term_ = std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; case AlphaCoeff::SONNENDRUCKER: switch (beta_type) { case BetaCoeff::ZERO: - source_term_ = std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = + std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; case BetaCoeff::ALPHA_INVERSE: - source_term_ = std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = + std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -600,10 +615,10 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble case AlphaCoeff::ZONI: switch (beta_type) { case BetaCoeff::ZERO: - source_term_ = std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; case BetaCoeff::ALPHA_INVERSE: - source_term_ = std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -612,10 +627,12 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble case AlphaCoeff::ZONI_SHIFTED: switch (beta_type) { case BetaCoeff::ZERO: - source_term_ = std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = + std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; case BetaCoeff::ALPHA_INVERSE: - source_term_ = std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = + std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; default: throw std::runtime_error("Invalid beta.\n"); @@ -631,7 +648,7 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble case AlphaCoeff::ZONI_SHIFTED: switch (beta_type) { case BetaCoeff::ALPHA_INVERSE: - source_term_ = std::make_unique(Rmax); + source_term_ = std::make_unique(grid_, Rmax); break; default: throw std::runtime_error("Invalid beta for configuration.\n"); @@ -656,7 +673,7 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble case AlphaCoeff::ZONI_SHIFTED: switch (beta_type) { case BetaCoeff::ALPHA_INVERSE: - source_term_ = std::make_unique(Rmax); + source_term_ = std::make_unique(grid_, Rmax); break; default: throw std::runtime_error("Invalid beta for configuration.\n"); @@ -674,7 +691,7 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble switch (beta_type) { case BetaCoeff::ALPHA_INVERSE: source_term_ = - std::make_unique(Rmax, kappa_eps, delta_e); + std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; default: throw std::runtime_error("Invalid beta for configuration.\n"); @@ -691,7 +708,8 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble case AlphaCoeff::ZONI_SHIFTED: switch (beta_type) { case BetaCoeff::ALPHA_INVERSE: - source_term_ = std::make_unique(Rmax, kappa_eps, delta_e); + source_term_ = + std::make_unique(grid_, Rmax, kappa_eps, delta_e); break; default: throw std::runtime_error("Invalid beta for configuration.\n"); @@ -708,7 +726,7 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble case AlphaCoeff::ZONI_SHIFTED: switch (beta_type) { case BetaCoeff::ALPHA_INVERSE: - source_term_ = std::make_unique(Rmax); + source_term_ = std::make_unique(grid_, Rmax); break; default: throw std::runtime_error("Invalid beta for configuration.\n"); @@ -727,4 +745,4 @@ void ConfigParser::selectTestCase(GeometryType geometry_type, ProblemType proble default: throw std::runtime_error("Invalid problem.\n"); } -} \ No newline at end of file +} diff --git a/src/DirectSolver/DirectSolver-COO-MUMPS-Give/applySymmetryShift.cpp b/src/DirectSolver/DirectSolver-COO-MUMPS-Give/applySymmetryShift.cpp index e729c530..4cdcdf40 100644 --- a/src/DirectSolver/DirectSolver-COO-MUMPS-Give/applySymmetryShift.cpp +++ b/src/DirectSolver/DirectSolver-COO-MUMPS-Give/applySymmetryShift.cpp @@ -123,7 +123,7 @@ void DirectSolverGive::applySymmetryShiftOuterBoundary(Vector x) const // clang-format off void DirectSolverGive::applySymmetryShift(Vector x) const { - assert(x.size() == grid_.numberOfNodes()); + assert(x.size() == static_cast(grid_.numberOfNodes())); assert(grid_.nr() >= 4); if (num_omp_threads_ == 1) { diff --git a/src/DirectSolver/DirectSolver-COO-MUMPS-Take/applySymmetryShift.cpp b/src/DirectSolver/DirectSolver-COO-MUMPS-Take/applySymmetryShift.cpp index e78ee456..b6384f07 100644 --- a/src/DirectSolver/DirectSolver-COO-MUMPS-Take/applySymmetryShift.cpp +++ b/src/DirectSolver/DirectSolver-COO-MUMPS-Take/applySymmetryShift.cpp @@ -80,7 +80,7 @@ void DirectSolverTake::applySymmetryShiftOuterBoundary(Vector x) const void DirectSolverTake::applySymmetryShift(Vector x) const { - assert(x.size() == grid_.numberOfNodes()); + assert(x.size() == static_cast(grid_.numberOfNodes())); assert(grid_.nr() >= 4); if (num_omp_threads_ == 1) { diff --git a/src/GMGPolar/build_rhs_f.cpp b/src/GMGPolar/build_rhs_f.cpp index c97b640e..3f5e45a6 100644 --- a/src/GMGPolar/build_rhs_f.cpp +++ b/src/GMGPolar/build_rhs_f.cpp @@ -18,7 +18,7 @@ void GMGPolar::build_rhs_f(const Level& level, Vector rhs_f, const Bound double theta = grid.theta(i_theta); if ((0 < i_r && i_r < grid.nr() - 1) || (i_r == 0 && !DirBC_Interior_)) { - rhs_f[grid.index(i_r, i_theta)] = source_term.rhs_f(r, theta); + rhs_f[grid.index(i_r, i_theta)] = source_term(i_r, i_theta); } else if (i_r == 0 && DirBC_Interior_) { rhs_f[grid.index(i_r, i_theta)] = boundary_conditions.u_D_Interior(r, theta); @@ -39,7 +39,7 @@ void GMGPolar::build_rhs_f(const Level& level, Vector rhs_f, const Bound for (int i_r = grid.numberSmootherCircles(); i_r < grid.nr(); i_r++) { double r = grid.radius(i_r); if ((0 < i_r && i_r < grid.nr() - 1) || (i_r == 0 && !DirBC_Interior_)) { - rhs_f[grid.index(i_r, i_theta)] = source_term.rhs_f(r, theta); + rhs_f[grid.index(i_r, i_theta)] = source_term(i_r, i_theta); } else if (i_r == 0 && DirBC_Interior_) { rhs_f[grid.index(i_r, i_theta)] = boundary_conditions.u_D_Interior(r, theta); diff --git a/src/InputFunctions/SourceTerms/cartesianR2_Poisson_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_Poisson_CircularGeometry.cpp index b801c850..4919d98a 100644 --- a/src/InputFunctions/SourceTerms/cartesianR2_Poisson_CircularGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR2_Poisson_CircularGeometry.cpp @@ -1,12 +1,15 @@ #include "../include/InputFunctions/SourceTerms/cartesianR2_Poisson_CircularGeometry.h" -CartesianR2_Poisson_CircularGeometry::CartesianR2_Poisson_CircularGeometry(double Rmax) - : Rmax(Rmax) +CartesianR2_Poisson_CircularGeometry::CartesianR2_Poisson_CircularGeometry(PolarGrid const& grid, double Rmax) + : grid_(grid) + , Rmax(Rmax) { } -double CartesianR2_Poisson_CircularGeometry::rhs_f(double r, double theta) const +double CartesianR2_Poisson_CircularGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return 8.0 * M_PI * (r / Rmax) * sin_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) * diff --git a/src/InputFunctions/SourceTerms/cartesianR2_Poisson_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_Poisson_CzarnyGeometry.cpp index 9a333901..fdb129c1 100644 --- a/src/InputFunctions/SourceTerms/cartesianR2_Poisson_CzarnyGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR2_Poisson_CzarnyGeometry.cpp @@ -5,17 +5,21 @@ void CartesianR2_Poisson_CzarnyGeometry::initializeGeometry() factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); } -CartesianR2_Poisson_CzarnyGeometry::CartesianR2_Poisson_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, +CartesianR2_Poisson_CzarnyGeometry::CartesianR2_Poisson_CzarnyGeometry(PolarGrid const& grid, double Rmax, + double inverse_aspect_ratio_epsilon, double ellipticity_e) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) , ellipticity_e(ellipticity_e) { initializeGeometry(); } -double CartesianR2_Poisson_CzarnyGeometry::rhs_f(double r, double theta) const +double CartesianR2_Poisson_CzarnyGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); double temp = diff --git a/src/InputFunctions/SourceTerms/cartesianR2_Poisson_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_Poisson_ShafranovGeometry.cpp index dc353da2..e395dd49 100644 --- a/src/InputFunctions/SourceTerms/cartesianR2_Poisson_ShafranovGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR2_Poisson_ShafranovGeometry.cpp @@ -1,15 +1,19 @@ #include "../include/InputFunctions/SourceTerms/cartesianR2_Poisson_ShafranovGeometry.h" -CartesianR2_Poisson_ShafranovGeometry::CartesianR2_Poisson_ShafranovGeometry(double Rmax, double elongation_kappa, +CartesianR2_Poisson_ShafranovGeometry::CartesianR2_Poisson_ShafranovGeometry(PolarGrid const& grid, double Rmax, + double elongation_kappa, double shift_delta) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , elongation_kappa(elongation_kappa) , shift_delta(shift_delta) { } -double CartesianR2_Poisson_ShafranovGeometry::rhs_f(double r, double theta) const +double CartesianR2_Poisson_ShafranovGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return (-(2.0 * shift_delta * (r / Rmax) * (elongation_kappa - 1.0) * diff --git a/src/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CircularGeometry.cpp index 546a5a9f..4ce2b440 100644 --- a/src/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CircularGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CircularGeometry.cpp @@ -1,12 +1,16 @@ #include "../include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CircularGeometry.h" -CartesianR2_SonnendruckerGyro_CircularGeometry::CartesianR2_SonnendruckerGyro_CircularGeometry(double Rmax) - : Rmax(Rmax) +CartesianR2_SonnendruckerGyro_CircularGeometry::CartesianR2_SonnendruckerGyro_CircularGeometry(PolarGrid const& grid, + double Rmax) + : grid_(grid) + , Rmax(Rmax) { } -double CartesianR2_SonnendruckerGyro_CircularGeometry::rhs_f(double r, double theta) const +double CartesianR2_SonnendruckerGyro_CircularGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * diff --git a/src/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CzarnyGeometry.cpp index ec19612b..a4c9e4f1 100644 --- a/src/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CzarnyGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CzarnyGeometry.cpp @@ -6,16 +6,19 @@ void CartesianR2_SonnendruckerGyro_CzarnyGeometry::initializeGeometry() } CartesianR2_SonnendruckerGyro_CzarnyGeometry::CartesianR2_SonnendruckerGyro_CzarnyGeometry( - double Rmax, double inverse_aspect_ratio_epsilon, double ellipticity_e) - : Rmax(Rmax) + PolarGrid const& grid, double Rmax, double inverse_aspect_ratio_epsilon, double ellipticity_e) + : grid_(grid) + , Rmax(Rmax) , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) , ellipticity_e(ellipticity_e) { initializeGeometry(); } -double CartesianR2_SonnendruckerGyro_CzarnyGeometry::rhs_f(double r, double theta) const +double CartesianR2_SonnendruckerGyro_CzarnyGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); double temp = diff --git a/src/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_ShafranovGeometry.cpp index a0cdfc93..9b47817e 100644 --- a/src/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_ShafranovGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_ShafranovGeometry.cpp @@ -1,15 +1,18 @@ #include "../include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_ShafranovGeometry.h" CartesianR2_SonnendruckerGyro_ShafranovGeometry::CartesianR2_SonnendruckerGyro_ShafranovGeometry( - double Rmax, double elongation_kappa, double shift_delta) - : Rmax(Rmax) + PolarGrid const& grid, double Rmax, double elongation_kappa, double shift_delta) + : grid_(grid) + , Rmax(Rmax) , elongation_kappa(elongation_kappa) , shift_delta(shift_delta) { } -double CartesianR2_SonnendruckerGyro_ShafranovGeometry::rhs_f(double r, double theta) const +double CartesianR2_SonnendruckerGyro_ShafranovGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return (1.0 - (r / Rmax) * (r / Rmax)) * diff --git a/src/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CircularGeometry.cpp index c772f1ef..fc82badd 100644 --- a/src/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CircularGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CircularGeometry.cpp @@ -1,12 +1,16 @@ #include "../include/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CircularGeometry.h" -CartesianR2_Sonnendrucker_CircularGeometry::CartesianR2_Sonnendrucker_CircularGeometry(double Rmax) - : Rmax(Rmax) +CartesianR2_Sonnendrucker_CircularGeometry::CartesianR2_Sonnendrucker_CircularGeometry(PolarGrid const& grid, + double Rmax) + : grid_(grid) + , Rmax(Rmax) { } -double CartesianR2_Sonnendrucker_CircularGeometry::rhs_f(double r, double theta) const +double CartesianR2_Sonnendrucker_CircularGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return (-((r / Rmax) * diff --git a/src/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CzarnyGeometry.cpp index 174e9bd1..81ffcc9b 100644 --- a/src/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CzarnyGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CzarnyGeometry.cpp @@ -5,18 +5,21 @@ void CartesianR2_Sonnendrucker_CzarnyGeometry::initializeGeometry() factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); } -CartesianR2_Sonnendrucker_CzarnyGeometry::CartesianR2_Sonnendrucker_CzarnyGeometry(double Rmax, +CartesianR2_Sonnendrucker_CzarnyGeometry::CartesianR2_Sonnendrucker_CzarnyGeometry(PolarGrid const& grid, double Rmax, double inverse_aspect_ratio_epsilon, double ellipticity_e) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) , ellipticity_e(ellipticity_e) { initializeGeometry(); } -double CartesianR2_Sonnendrucker_CzarnyGeometry::rhs_f(double r, double theta) const +double CartesianR2_Sonnendrucker_CzarnyGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); double temp = diff --git a/src/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_ShafranovGeometry.cpp index c65bf4e9..6eeb5aee 100644 --- a/src/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_ShafranovGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_ShafranovGeometry.cpp @@ -1,16 +1,20 @@ #include "../include/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_ShafranovGeometry.h" -CartesianR2_Sonnendrucker_ShafranovGeometry::CartesianR2_Sonnendrucker_ShafranovGeometry(double Rmax, +CartesianR2_Sonnendrucker_ShafranovGeometry::CartesianR2_Sonnendrucker_ShafranovGeometry(PolarGrid const& grid, + double Rmax, double elongation_kappa, double shift_delta) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , elongation_kappa(elongation_kappa) , shift_delta(shift_delta) { } -double CartesianR2_Sonnendrucker_ShafranovGeometry::rhs_f(double r, double theta) const +double CartesianR2_Sonnendrucker_ShafranovGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return (-(2.0 * shift_delta * (r / Rmax) * diff --git a/src/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CircularGeometry.cpp index cf048209..448862d2 100644 --- a/src/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CircularGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CircularGeometry.cpp @@ -1,12 +1,15 @@ #include "../include/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CircularGeometry.h" -CartesianR2_ZoniGyro_CircularGeometry::CartesianR2_ZoniGyro_CircularGeometry(double Rmax) - : Rmax(Rmax) +CartesianR2_ZoniGyro_CircularGeometry::CartesianR2_ZoniGyro_CircularGeometry(PolarGrid const& grid, double Rmax) + : grid_(grid) + , Rmax(Rmax) { } -double CartesianR2_ZoniGyro_CircularGeometry::rhs_f(double r, double theta) const +double CartesianR2_ZoniGyro_CircularGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return (1.0 - (r / Rmax) * (r / Rmax)) * exp(tanh(10.0 * (r / Rmax) - 5.0)) * diff --git a/src/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CzarnyGeometry.cpp index ea66057d..66009f5b 100644 --- a/src/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CzarnyGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CzarnyGeometry.cpp @@ -5,18 +5,21 @@ void CartesianR2_ZoniGyro_CzarnyGeometry::initializeGeometry() factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); } -CartesianR2_ZoniGyro_CzarnyGeometry::CartesianR2_ZoniGyro_CzarnyGeometry(double Rmax, +CartesianR2_ZoniGyro_CzarnyGeometry::CartesianR2_ZoniGyro_CzarnyGeometry(PolarGrid const& grid, double Rmax, double inverse_aspect_ratio_epsilon, double ellipticity_e) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) , ellipticity_e(ellipticity_e) { initializeGeometry(); } -double CartesianR2_ZoniGyro_CzarnyGeometry::rhs_f(double r, double theta) const +double CartesianR2_ZoniGyro_CzarnyGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); double temp = diff --git a/src/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_ShafranovGeometry.cpp index eae49e84..7754b649 100644 --- a/src/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_ShafranovGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_ShafranovGeometry.cpp @@ -1,15 +1,19 @@ #include "../include/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_ShafranovGeometry.h" -CartesianR2_ZoniGyro_ShafranovGeometry::CartesianR2_ZoniGyro_ShafranovGeometry(double Rmax, double elongation_kappa, +CartesianR2_ZoniGyro_ShafranovGeometry::CartesianR2_ZoniGyro_ShafranovGeometry(PolarGrid const& grid, double Rmax, + double elongation_kappa, double shift_delta) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , elongation_kappa(elongation_kappa) , shift_delta(shift_delta) { } -double CartesianR2_ZoniGyro_ShafranovGeometry::rhs_f(double r, double theta) const +double CartesianR2_ZoniGyro_ShafranovGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return (1.0 - (r / Rmax) * (r / Rmax)) * exp(tanh(10.0 * (r / Rmax) - 5.0)) * diff --git a/src/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CircularGeometry.cpp index a95c6da1..f7653022 100644 --- a/src/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CircularGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CircularGeometry.cpp @@ -1,12 +1,16 @@ #include "../include/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CircularGeometry.h" -CartesianR2_ZoniShiftedGyro_CircularGeometry::CartesianR2_ZoniShiftedGyro_CircularGeometry(double Rmax) - : Rmax(Rmax) +CartesianR2_ZoniShiftedGyro_CircularGeometry::CartesianR2_ZoniShiftedGyro_CircularGeometry(PolarGrid const& grid, + double Rmax) + : grid_(grid) + , Rmax(Rmax) { } -double CartesianR2_ZoniShiftedGyro_CircularGeometry::rhs_f(double r, double theta) const +double CartesianR2_ZoniShiftedGyro_CircularGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return (1.0 - (r / Rmax) * (r / Rmax)) * exp(tanh(20.0 * (r / Rmax) - 14.0)) * diff --git a/src/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CzarnyGeometry.cpp index 75de65fe..58068ca1 100644 --- a/src/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CzarnyGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CzarnyGeometry.cpp @@ -6,16 +6,19 @@ void CartesianR2_ZoniShiftedGyro_CzarnyGeometry::initializeGeometry() } CartesianR2_ZoniShiftedGyro_CzarnyGeometry::CartesianR2_ZoniShiftedGyro_CzarnyGeometry( - double Rmax, double inverse_aspect_ratio_epsilon, double ellipticity_e) - : Rmax(Rmax) + PolarGrid const& grid, double Rmax, double inverse_aspect_ratio_epsilon, double ellipticity_e) + : grid_(grid) + , Rmax(Rmax) , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) , ellipticity_e(ellipticity_e) { initializeGeometry(); } -double CartesianR2_ZoniShiftedGyro_CzarnyGeometry::rhs_f(double r, double theta) const +double CartesianR2_ZoniShiftedGyro_CzarnyGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); double temp = diff --git a/src/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_ShafranovGeometry.cpp index c159b747..e019d50f 100644 --- a/src/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_ShafranovGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_ShafranovGeometry.cpp @@ -1,16 +1,20 @@ #include "../include/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_ShafranovGeometry.h" -CartesianR2_ZoniShiftedGyro_ShafranovGeometry::CartesianR2_ZoniShiftedGyro_ShafranovGeometry(double Rmax, +CartesianR2_ZoniShiftedGyro_ShafranovGeometry::CartesianR2_ZoniShiftedGyro_ShafranovGeometry(PolarGrid const& grid, + double Rmax, double elongation_kappa, double shift_delta) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , elongation_kappa(elongation_kappa) , shift_delta(shift_delta) { } -double CartesianR2_ZoniShiftedGyro_ShafranovGeometry::rhs_f(double r, double theta) const +double CartesianR2_ZoniShiftedGyro_ShafranovGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return (1.0 - (r / Rmax) * (r / Rmax)) * exp(tanh(20.0 * (r / Rmax) - 14.0)) * diff --git a/src/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CircularGeometry.cpp index 1c5fb43b..5d5abe67 100644 --- a/src/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CircularGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CircularGeometry.cpp @@ -1,12 +1,15 @@ #include "../include/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CircularGeometry.h" -CartesianR2_ZoniShifted_CircularGeometry::CartesianR2_ZoniShifted_CircularGeometry(double Rmax) - : Rmax(Rmax) +CartesianR2_ZoniShifted_CircularGeometry::CartesianR2_ZoniShifted_CircularGeometry(PolarGrid const& grid, double Rmax) + : grid_(grid) + , Rmax(Rmax) { } -double CartesianR2_ZoniShifted_CircularGeometry::rhs_f(double r, double theta) const +double CartesianR2_ZoniShifted_CircularGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return (-((r / Rmax) * (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * diff --git a/src/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CzarnyGeometry.cpp index 6a04448f..3485a87c 100644 --- a/src/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CzarnyGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CzarnyGeometry.cpp @@ -5,18 +5,21 @@ void CartesianR2_ZoniShifted_CzarnyGeometry::initializeGeometry() factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); } -CartesianR2_ZoniShifted_CzarnyGeometry::CartesianR2_ZoniShifted_CzarnyGeometry(double Rmax, +CartesianR2_ZoniShifted_CzarnyGeometry::CartesianR2_ZoniShifted_CzarnyGeometry(PolarGrid const& grid, double Rmax, double inverse_aspect_ratio_epsilon, double ellipticity_e) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) , ellipticity_e(ellipticity_e) { initializeGeometry(); } -double CartesianR2_ZoniShifted_CzarnyGeometry::rhs_f(double r, double theta) const +double CartesianR2_ZoniShifted_CzarnyGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); double temp = diff --git a/src/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_ShafranovGeometry.cpp index 0b6a9753..e8335bc2 100644 --- a/src/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_ShafranovGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_ShafranovGeometry.cpp @@ -1,16 +1,19 @@ #include "../include/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_ShafranovGeometry.h" -CartesianR2_ZoniShifted_ShafranovGeometry::CartesianR2_ZoniShifted_ShafranovGeometry(double Rmax, +CartesianR2_ZoniShifted_ShafranovGeometry::CartesianR2_ZoniShifted_ShafranovGeometry(PolarGrid const& grid, double Rmax, double elongation_kappa, double shift_delta) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , elongation_kappa(elongation_kappa) , shift_delta(shift_delta) { } -double CartesianR2_ZoniShifted_ShafranovGeometry::rhs_f(double r, double theta) const +double CartesianR2_ZoniShifted_ShafranovGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return (-(2.0 * shift_delta * (r / Rmax) * (elongation_kappa - 1.0) * diff --git a/src/InputFunctions/SourceTerms/cartesianR2_Zoni_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_Zoni_CircularGeometry.cpp index bfea1fa6..ca27473b 100644 --- a/src/InputFunctions/SourceTerms/cartesianR2_Zoni_CircularGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR2_Zoni_CircularGeometry.cpp @@ -1,12 +1,15 @@ #include "../include/InputFunctions/SourceTerms/cartesianR2_Zoni_CircularGeometry.h" -CartesianR2_Zoni_CircularGeometry::CartesianR2_Zoni_CircularGeometry(double Rmax) - : Rmax(Rmax) +CartesianR2_Zoni_CircularGeometry::CartesianR2_Zoni_CircularGeometry(PolarGrid const& grid, double Rmax) + : grid_(grid) + , Rmax(Rmax) { } -double CartesianR2_Zoni_CircularGeometry::rhs_f(double r, double theta) const +double CartesianR2_Zoni_CircularGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return (-((r / Rmax) * (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * diff --git a/src/InputFunctions/SourceTerms/cartesianR2_Zoni_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_Zoni_CzarnyGeometry.cpp index 84077fb0..6dd6f313 100644 --- a/src/InputFunctions/SourceTerms/cartesianR2_Zoni_CzarnyGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR2_Zoni_CzarnyGeometry.cpp @@ -5,17 +5,21 @@ void CartesianR2_Zoni_CzarnyGeometry::initializeGeometry() factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); } -CartesianR2_Zoni_CzarnyGeometry::CartesianR2_Zoni_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, +CartesianR2_Zoni_CzarnyGeometry::CartesianR2_Zoni_CzarnyGeometry(PolarGrid const& grid, double Rmax, + double inverse_aspect_ratio_epsilon, double ellipticity_e) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) , ellipticity_e(ellipticity_e) { initializeGeometry(); } -double CartesianR2_Zoni_CzarnyGeometry::rhs_f(double r, double theta) const +double CartesianR2_Zoni_CzarnyGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); double temp = diff --git a/src/InputFunctions/SourceTerms/cartesianR2_Zoni_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_Zoni_ShafranovGeometry.cpp index 07558c05..73a4a666 100644 --- a/src/InputFunctions/SourceTerms/cartesianR2_Zoni_ShafranovGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR2_Zoni_ShafranovGeometry.cpp @@ -1,15 +1,18 @@ #include "../include/InputFunctions/SourceTerms/cartesianR2_Zoni_ShafranovGeometry.h" -CartesianR2_Zoni_ShafranovGeometry::CartesianR2_Zoni_ShafranovGeometry(double Rmax, double elongation_kappa, - double shift_delta) - : Rmax(Rmax) +CartesianR2_Zoni_ShafranovGeometry::CartesianR2_Zoni_ShafranovGeometry(PolarGrid const& grid, double Rmax, + double elongation_kappa, double shift_delta) + : grid_(grid) + , Rmax(Rmax) , elongation_kappa(elongation_kappa) , shift_delta(shift_delta) { } -double CartesianR2_Zoni_ShafranovGeometry::rhs_f(double r, double theta) const +double CartesianR2_Zoni_ShafranovGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return (-(2.0 * shift_delta * (r / Rmax) * (elongation_kappa - 1.0) * diff --git a/src/InputFunctions/SourceTerms/cartesianR6_Poisson_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_Poisson_CircularGeometry.cpp index 648715ea..1d6372a9 100644 --- a/src/InputFunctions/SourceTerms/cartesianR6_Poisson_CircularGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR6_Poisson_CircularGeometry.cpp @@ -1,12 +1,15 @@ #include "../include/InputFunctions/SourceTerms/cartesianR6_Poisson_CircularGeometry.h" -CartesianR6_Poisson_CircularGeometry::CartesianR6_Poisson_CircularGeometry(double Rmax) - : Rmax(Rmax) +CartesianR6_Poisson_CircularGeometry::CartesianR6_Poisson_CircularGeometry(PolarGrid const& grid, double Rmax) + : grid_(grid) + , Rmax(Rmax) { } -double CartesianR6_Poisson_CircularGeometry::rhs_f(double r, double theta) const +double CartesianR6_Poisson_CircularGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return (-((-1.6384) * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * diff --git a/src/InputFunctions/SourceTerms/cartesianR6_Poisson_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_Poisson_CzarnyGeometry.cpp index b9df6250..22258835 100644 --- a/src/InputFunctions/SourceTerms/cartesianR6_Poisson_CzarnyGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR6_Poisson_CzarnyGeometry.cpp @@ -5,17 +5,21 @@ void CartesianR6_Poisson_CzarnyGeometry::initializeGeometry() factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); } -CartesianR6_Poisson_CzarnyGeometry::CartesianR6_Poisson_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, +CartesianR6_Poisson_CzarnyGeometry::CartesianR6_Poisson_CzarnyGeometry(PolarGrid const& grid, double Rmax, + double inverse_aspect_ratio_epsilon, double ellipticity_e) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) , ellipticity_e(ellipticity_e) { initializeGeometry(); } -double CartesianR6_Poisson_CzarnyGeometry::rhs_f(double r, double theta) const +double CartesianR6_Poisson_CzarnyGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); double temp = diff --git a/src/InputFunctions/SourceTerms/cartesianR6_Poisson_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_Poisson_ShafranovGeometry.cpp index 4bf8ab26..68c9b942 100644 --- a/src/InputFunctions/SourceTerms/cartesianR6_Poisson_ShafranovGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR6_Poisson_ShafranovGeometry.cpp @@ -1,15 +1,19 @@ #include "../include/InputFunctions/SourceTerms/cartesianR6_Poisson_ShafranovGeometry.h" -CartesianR6_Poisson_ShafranovGeometry::CartesianR6_Poisson_ShafranovGeometry(double Rmax, double elongation_kappa, +CartesianR6_Poisson_ShafranovGeometry::CartesianR6_Poisson_ShafranovGeometry(PolarGrid const& grid, double Rmax, + double elongation_kappa, double shift_delta) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , elongation_kappa(elongation_kappa) , shift_delta(shift_delta) { } -double CartesianR6_Poisson_ShafranovGeometry::rhs_f(double r, double theta) const +double CartesianR6_Poisson_ShafranovGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return (-(2.0 * shift_delta * (r / Rmax) * (elongation_kappa - 1.0) * diff --git a/src/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CircularGeometry.cpp index 3883e3b3..991fd192 100644 --- a/src/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CircularGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CircularGeometry.cpp @@ -1,12 +1,16 @@ #include "../include/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CircularGeometry.h" -CartesianR6_SonnendruckerGyro_CircularGeometry::CartesianR6_SonnendruckerGyro_CircularGeometry(double Rmax) - : Rmax(Rmax) +CartesianR6_SonnendruckerGyro_CircularGeometry::CartesianR6_SonnendruckerGyro_CircularGeometry(PolarGrid const& grid, + double Rmax) + : grid_(grid) + , Rmax(Rmax) { } -double CartesianR6_SonnendruckerGyro_CircularGeometry::rhs_f(double r, double theta) const +double CartesianR6_SonnendruckerGyro_CircularGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * diff --git a/src/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CzarnyGeometry.cpp index 0098f7c0..70969494 100644 --- a/src/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CzarnyGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CzarnyGeometry.cpp @@ -6,16 +6,19 @@ void CartesianR6_SonnendruckerGyro_CzarnyGeometry::initializeGeometry() } CartesianR6_SonnendruckerGyro_CzarnyGeometry::CartesianR6_SonnendruckerGyro_CzarnyGeometry( - double Rmax, double inverse_aspect_ratio_epsilon, double ellipticity_e) - : Rmax(Rmax) + PolarGrid const& grid, double Rmax, double inverse_aspect_ratio_epsilon, double ellipticity_e) + : grid_(grid) + , Rmax(Rmax) , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) , ellipticity_e(ellipticity_e) { initializeGeometry(); } -double CartesianR6_SonnendruckerGyro_CzarnyGeometry::rhs_f(double r, double theta) const +double CartesianR6_SonnendruckerGyro_CzarnyGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); double temp = diff --git a/src/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_ShafranovGeometry.cpp index aab47f60..87be80e7 100644 --- a/src/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_ShafranovGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_ShafranovGeometry.cpp @@ -1,15 +1,18 @@ #include "../include/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_ShafranovGeometry.h" CartesianR6_SonnendruckerGyro_ShafranovGeometry::CartesianR6_SonnendruckerGyro_ShafranovGeometry( - double Rmax, double elongation_kappa, double shift_delta) - : Rmax(Rmax) + PolarGrid const& grid, double Rmax, double elongation_kappa, double shift_delta) + : grid_(grid) + , Rmax(Rmax) , elongation_kappa(elongation_kappa) , shift_delta(shift_delta) { } -double CartesianR6_SonnendruckerGyro_ShafranovGeometry::rhs_f(double r, double theta) const +double CartesianR6_SonnendruckerGyro_ShafranovGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * diff --git a/src/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CircularGeometry.cpp index 6302dcff..d196ba09 100644 --- a/src/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CircularGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CircularGeometry.cpp @@ -1,12 +1,16 @@ #include "../include/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CircularGeometry.h" -CartesianR6_Sonnendrucker_CircularGeometry::CartesianR6_Sonnendrucker_CircularGeometry(double Rmax) - : Rmax(Rmax) +CartesianR6_Sonnendrucker_CircularGeometry::CartesianR6_Sonnendrucker_CircularGeometry(PolarGrid const& grid, + double Rmax) + : grid_(grid) + , Rmax(Rmax) { } -double CartesianR6_Sonnendrucker_CircularGeometry::rhs_f(double r, double theta) const +double CartesianR6_Sonnendrucker_CircularGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return (-((r / Rmax) * diff --git a/src/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CzarnyGeometry.cpp index ad40bc2e..d1368b36 100644 --- a/src/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CzarnyGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CzarnyGeometry.cpp @@ -5,18 +5,21 @@ void CartesianR6_Sonnendrucker_CzarnyGeometry::initializeGeometry() factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); } -CartesianR6_Sonnendrucker_CzarnyGeometry::CartesianR6_Sonnendrucker_CzarnyGeometry(double Rmax, +CartesianR6_Sonnendrucker_CzarnyGeometry::CartesianR6_Sonnendrucker_CzarnyGeometry(PolarGrid const& grid, double Rmax, double inverse_aspect_ratio_epsilon, double ellipticity_e) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) , ellipticity_e(ellipticity_e) { initializeGeometry(); } -double CartesianR6_Sonnendrucker_CzarnyGeometry::rhs_f(double r, double theta) const +double CartesianR6_Sonnendrucker_CzarnyGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); double temp = diff --git a/src/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_ShafranovGeometry.cpp index 30676c8e..d2699bbd 100644 --- a/src/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_ShafranovGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_ShafranovGeometry.cpp @@ -1,16 +1,20 @@ #include "../include/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_ShafranovGeometry.h" -CartesianR6_Sonnendrucker_ShafranovGeometry::CartesianR6_Sonnendrucker_ShafranovGeometry(double Rmax, +CartesianR6_Sonnendrucker_ShafranovGeometry::CartesianR6_Sonnendrucker_ShafranovGeometry(PolarGrid const& grid, + double Rmax, double elongation_kappa, double shift_delta) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , elongation_kappa(elongation_kappa) , shift_delta(shift_delta) { } -double CartesianR6_Sonnendrucker_ShafranovGeometry::rhs_f(double r, double theta) const +double CartesianR6_Sonnendrucker_ShafranovGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return (-(2.0 * shift_delta * (r / Rmax) * diff --git a/src/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CircularGeometry.cpp index cf3b22fb..f049e296 100644 --- a/src/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CircularGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CircularGeometry.cpp @@ -1,12 +1,15 @@ #include "../include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CircularGeometry.h" -CartesianR6_ZoniGyro_CircularGeometry::CartesianR6_ZoniGyro_CircularGeometry(double Rmax) - : Rmax(Rmax) +CartesianR6_ZoniGyro_CircularGeometry::CartesianR6_ZoniGyro_CircularGeometry(PolarGrid const& grid, double Rmax) + : grid_(grid) + , Rmax(Rmax) { } -double CartesianR6_ZoniGyro_CircularGeometry::rhs_f(double r, double theta) const +double CartesianR6_ZoniGyro_CircularGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * exp(tanh(10.0 * (r / Rmax) - 5.0)) * diff --git a/src/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CzarnyGeometry.cpp index a0520cd9..dbd536a3 100644 --- a/src/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CzarnyGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CzarnyGeometry.cpp @@ -5,18 +5,21 @@ void CartesianR6_ZoniGyro_CzarnyGeometry::initializeGeometry() factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); } -CartesianR6_ZoniGyro_CzarnyGeometry::CartesianR6_ZoniGyro_CzarnyGeometry(double Rmax, +CartesianR6_ZoniGyro_CzarnyGeometry::CartesianR6_ZoniGyro_CzarnyGeometry(PolarGrid const& grid, double Rmax, double inverse_aspect_ratio_epsilon, double ellipticity_e) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) , ellipticity_e(ellipticity_e) { initializeGeometry(); } -double CartesianR6_ZoniGyro_CzarnyGeometry::rhs_f(double r, double theta) const +double CartesianR6_ZoniGyro_CzarnyGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); double temp = diff --git a/src/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_ShafranovGeometry.cpp index df58c6f3..98e378ec 100644 --- a/src/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_ShafranovGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_ShafranovGeometry.cpp @@ -1,15 +1,19 @@ #include "../include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_ShafranovGeometry.h" -CartesianR6_ZoniGyro_ShafranovGeometry::CartesianR6_ZoniGyro_ShafranovGeometry(double Rmax, double elongation_kappa, +CartesianR6_ZoniGyro_ShafranovGeometry::CartesianR6_ZoniGyro_ShafranovGeometry(PolarGrid const& grid, double Rmax, + double elongation_kappa, double shift_delta) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , elongation_kappa(elongation_kappa) , shift_delta(shift_delta) { } -double CartesianR6_ZoniGyro_ShafranovGeometry::rhs_f(double r, double theta) const +double CartesianR6_ZoniGyro_ShafranovGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * exp(tanh(10.0 * (r / Rmax) - 5.0)) * diff --git a/src/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CircularGeometry.cpp index 3c627cd3..53fbcaaa 100644 --- a/src/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CircularGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CircularGeometry.cpp @@ -1,12 +1,16 @@ #include "../include/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CircularGeometry.h" -CartesianR6_ZoniShiftedGyro_CircularGeometry::CartesianR6_ZoniShiftedGyro_CircularGeometry(double Rmax) - : Rmax(Rmax) +CartesianR6_ZoniShiftedGyro_CircularGeometry::CartesianR6_ZoniShiftedGyro_CircularGeometry(PolarGrid const& grid, + double Rmax) + : grid_(grid) + , Rmax(Rmax) { } -double CartesianR6_ZoniShiftedGyro_CircularGeometry::rhs_f(double r, double theta) const +double CartesianR6_ZoniShiftedGyro_CircularGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * exp(tanh(20.0 * (r / Rmax) - 14.0)) * diff --git a/src/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CzarnyGeometry.cpp index fb6bc182..8c1edfb4 100644 --- a/src/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CzarnyGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CzarnyGeometry.cpp @@ -6,16 +6,19 @@ void CartesianR6_ZoniShiftedGyro_CzarnyGeometry::initializeGeometry() } CartesianR6_ZoniShiftedGyro_CzarnyGeometry::CartesianR6_ZoniShiftedGyro_CzarnyGeometry( - double Rmax, double inverse_aspect_ratio_epsilon, double ellipticity_e) - : Rmax(Rmax) + PolarGrid const& grid, double Rmax, double inverse_aspect_ratio_epsilon, double ellipticity_e) + : grid_(grid) + , Rmax(Rmax) , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) , ellipticity_e(ellipticity_e) { initializeGeometry(); } -double CartesianR6_ZoniShiftedGyro_CzarnyGeometry::rhs_f(double r, double theta) const +double CartesianR6_ZoniShiftedGyro_CzarnyGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); double temp = diff --git a/src/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_ShafranovGeometry.cpp index 1ad8e174..4d5dcb56 100644 --- a/src/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_ShafranovGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_ShafranovGeometry.cpp @@ -1,16 +1,20 @@ #include "../include/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_ShafranovGeometry.h" -CartesianR6_ZoniShiftedGyro_ShafranovGeometry::CartesianR6_ZoniShiftedGyro_ShafranovGeometry(double Rmax, +CartesianR6_ZoniShiftedGyro_ShafranovGeometry::CartesianR6_ZoniShiftedGyro_ShafranovGeometry(PolarGrid const& grid, + double Rmax, double elongation_kappa, double shift_delta) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , elongation_kappa(elongation_kappa) , shift_delta(shift_delta) { } -double CartesianR6_ZoniShiftedGyro_ShafranovGeometry::rhs_f(double r, double theta) const +double CartesianR6_ZoniShiftedGyro_ShafranovGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * exp(tanh(20.0 * (r / Rmax) - 14.0)) * diff --git a/src/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CircularGeometry.cpp index f5cae1e1..b1fbb43d 100644 --- a/src/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CircularGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CircularGeometry.cpp @@ -1,12 +1,15 @@ #include "../include/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CircularGeometry.h" -CartesianR6_ZoniShifted_CircularGeometry::CartesianR6_ZoniShifted_CircularGeometry(double Rmax) - : Rmax(Rmax) +CartesianR6_ZoniShifted_CircularGeometry::CartesianR6_ZoniShifted_CircularGeometry(PolarGrid const& grid, double Rmax) + : grid_(grid) + , Rmax(Rmax) { } -double CartesianR6_ZoniShifted_CircularGeometry::rhs_f(double r, double theta) const +double CartesianR6_ZoniShifted_CircularGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return (-((r / Rmax) * (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * diff --git a/src/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CzarnyGeometry.cpp index 40d4befc..8a14899f 100644 --- a/src/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CzarnyGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CzarnyGeometry.cpp @@ -5,18 +5,21 @@ void CartesianR6_ZoniShifted_CzarnyGeometry::initializeGeometry() factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); } -CartesianR6_ZoniShifted_CzarnyGeometry::CartesianR6_ZoniShifted_CzarnyGeometry(double Rmax, +CartesianR6_ZoniShifted_CzarnyGeometry::CartesianR6_ZoniShifted_CzarnyGeometry(PolarGrid const& grid, double Rmax, double inverse_aspect_ratio_epsilon, double ellipticity_e) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) , ellipticity_e(ellipticity_e) { initializeGeometry(); } -double CartesianR6_ZoniShifted_CzarnyGeometry::rhs_f(double r, double theta) const +double CartesianR6_ZoniShifted_CzarnyGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); double temp = diff --git a/src/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_ShafranovGeometry.cpp index 5ad406d0..664b7208 100644 --- a/src/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_ShafranovGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_ShafranovGeometry.cpp @@ -1,16 +1,19 @@ #include "../include/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_ShafranovGeometry.h" -CartesianR6_ZoniShifted_ShafranovGeometry::CartesianR6_ZoniShifted_ShafranovGeometry(double Rmax, +CartesianR6_ZoniShifted_ShafranovGeometry::CartesianR6_ZoniShifted_ShafranovGeometry(PolarGrid const& grid, double Rmax, double elongation_kappa, double shift_delta) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , elongation_kappa(elongation_kappa) , shift_delta(shift_delta) { } -double CartesianR6_ZoniShifted_ShafranovGeometry::rhs_f(double r, double theta) const +double CartesianR6_ZoniShifted_ShafranovGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return (-(2.0 * shift_delta * (r / Rmax) * (elongation_kappa - 1.0) * diff --git a/src/InputFunctions/SourceTerms/cartesianR6_Zoni_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_Zoni_CircularGeometry.cpp index 4c44d58a..68ecffc0 100644 --- a/src/InputFunctions/SourceTerms/cartesianR6_Zoni_CircularGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR6_Zoni_CircularGeometry.cpp @@ -1,12 +1,15 @@ #include "../include/InputFunctions/SourceTerms/cartesianR6_Zoni_CircularGeometry.h" -CartesianR6_Zoni_CircularGeometry::CartesianR6_Zoni_CircularGeometry(double Rmax) - : Rmax(Rmax) +CartesianR6_Zoni_CircularGeometry::CartesianR6_Zoni_CircularGeometry(PolarGrid const& grid, double Rmax) + : grid_(grid) + , Rmax(Rmax) { } -double CartesianR6_Zoni_CircularGeometry::rhs_f(double r, double theta) const +double CartesianR6_Zoni_CircularGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return (-((r / Rmax) * (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * diff --git a/src/InputFunctions/SourceTerms/cartesianR6_Zoni_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_Zoni_CzarnyGeometry.cpp index f546a226..4efdd032 100644 --- a/src/InputFunctions/SourceTerms/cartesianR6_Zoni_CzarnyGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR6_Zoni_CzarnyGeometry.cpp @@ -5,17 +5,21 @@ void CartesianR6_Zoni_CzarnyGeometry::initializeGeometry() factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); } -CartesianR6_Zoni_CzarnyGeometry::CartesianR6_Zoni_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, +CartesianR6_Zoni_CzarnyGeometry::CartesianR6_Zoni_CzarnyGeometry(PolarGrid const& grid, double Rmax, + double inverse_aspect_ratio_epsilon, double ellipticity_e) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) , ellipticity_e(ellipticity_e) { initializeGeometry(); } -double CartesianR6_Zoni_CzarnyGeometry::rhs_f(double r, double theta) const +double CartesianR6_Zoni_CzarnyGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); double temp = diff --git a/src/InputFunctions/SourceTerms/cartesianR6_Zoni_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_Zoni_ShafranovGeometry.cpp index a1d85e55..aeb9d4ed 100644 --- a/src/InputFunctions/SourceTerms/cartesianR6_Zoni_ShafranovGeometry.cpp +++ b/src/InputFunctions/SourceTerms/cartesianR6_Zoni_ShafranovGeometry.cpp @@ -1,15 +1,18 @@ #include "../include/InputFunctions/SourceTerms/cartesianR6_Zoni_ShafranovGeometry.h" -CartesianR6_Zoni_ShafranovGeometry::CartesianR6_Zoni_ShafranovGeometry(double Rmax, double elongation_kappa, - double shift_delta) - : Rmax(Rmax) +CartesianR6_Zoni_ShafranovGeometry::CartesianR6_Zoni_ShafranovGeometry(PolarGrid const& grid, double Rmax, + double elongation_kappa, double shift_delta) + : grid_(grid) + , Rmax(Rmax) , elongation_kappa(elongation_kappa) , shift_delta(shift_delta) { } -double CartesianR6_Zoni_ShafranovGeometry::rhs_f(double r, double theta) const +double CartesianR6_Zoni_ShafranovGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return (-(2.0 * shift_delta * (r / Rmax) * (elongation_kappa - 1.0) * diff --git a/src/InputFunctions/SourceTerms/polarR6_Poisson_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_Poisson_CircularGeometry.cpp index 81abe5f8..145e4bac 100644 --- a/src/InputFunctions/SourceTerms/polarR6_Poisson_CircularGeometry.cpp +++ b/src/InputFunctions/SourceTerms/polarR6_Poisson_CircularGeometry.cpp @@ -1,12 +1,15 @@ #include "../include/InputFunctions/SourceTerms/polarR6_Poisson_CircularGeometry.h" -PolarR6_Poisson_CircularGeometry::PolarR6_Poisson_CircularGeometry(double Rmax) - : Rmax(Rmax) +PolarR6_Poisson_CircularGeometry::PolarR6_Poisson_CircularGeometry(PolarGrid const& grid, double Rmax) + : grid_(grid) + , Rmax(Rmax) { } -double PolarR6_Poisson_CircularGeometry::rhs_f(double r, double theta) const +double PolarR6_Poisson_CircularGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); return (-pow((r / Rmax), 4.0)) * (14.7456 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 1.0 * (r / Rmax) * (12.288 * (r / Rmax) * pow(((r / Rmax) - 1.0), 4.0) * cos(11.0 * theta) + diff --git a/src/InputFunctions/SourceTerms/polarR6_Poisson_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_Poisson_CzarnyGeometry.cpp index f882e349..863cdac9 100644 --- a/src/InputFunctions/SourceTerms/polarR6_Poisson_CzarnyGeometry.cpp +++ b/src/InputFunctions/SourceTerms/polarR6_Poisson_CzarnyGeometry.cpp @@ -5,17 +5,21 @@ void PolarR6_Poisson_CzarnyGeometry::initializeGeometry() factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); } -PolarR6_Poisson_CzarnyGeometry::PolarR6_Poisson_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, +PolarR6_Poisson_CzarnyGeometry::PolarR6_Poisson_CzarnyGeometry(PolarGrid const& grid, double Rmax, + double inverse_aspect_ratio_epsilon, double ellipticity_e) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) , ellipticity_e(ellipticity_e) { initializeGeometry(); } -double PolarR6_Poisson_CzarnyGeometry::rhs_f(double r, double theta) const +double PolarR6_Poisson_CzarnyGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); double temp = diff --git a/src/InputFunctions/SourceTerms/polarR6_Poisson_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_Poisson_ShafranovGeometry.cpp index c23acfa2..67496448 100644 --- a/src/InputFunctions/SourceTerms/polarR6_Poisson_ShafranovGeometry.cpp +++ b/src/InputFunctions/SourceTerms/polarR6_Poisson_ShafranovGeometry.cpp @@ -1,15 +1,18 @@ #include "../include/InputFunctions/SourceTerms/polarR6_Poisson_ShafranovGeometry.h" -PolarR6_Poisson_ShafranovGeometry::PolarR6_Poisson_ShafranovGeometry(double Rmax, double elongation_kappa, - double shift_delta) - : Rmax(Rmax) +PolarR6_Poisson_ShafranovGeometry::PolarR6_Poisson_ShafranovGeometry(PolarGrid const& grid, double Rmax, + double elongation_kappa, double shift_delta) + : grid_(grid) + , Rmax(Rmax) , elongation_kappa(elongation_kappa) , shift_delta(shift_delta) { } -double PolarR6_Poisson_ShafranovGeometry::rhs_f(double r, double theta) const +double PolarR6_Poisson_ShafranovGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return (-pow((r / Rmax), 4.0)) * diff --git a/src/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CircularGeometry.cpp index 35738e29..60c3cc12 100644 --- a/src/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CircularGeometry.cpp +++ b/src/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CircularGeometry.cpp @@ -1,12 +1,16 @@ #include "../include/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CircularGeometry.h" -PolarR6_SonnendruckerGyro_CircularGeometry::PolarR6_SonnendruckerGyro_CircularGeometry(double Rmax) - : Rmax(Rmax) +PolarR6_SonnendruckerGyro_CircularGeometry::PolarR6_SonnendruckerGyro_CircularGeometry(PolarGrid const& grid, + double Rmax) + : grid_(grid) + , Rmax(Rmax) { } -double PolarR6_SonnendruckerGyro_CircularGeometry::rhs_f(double r, double theta) const +double PolarR6_SonnendruckerGyro_CircularGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); return 0.4096 * pow((r / Rmax), 6.0) * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta) / (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) - pow((r / Rmax), 4.0) * diff --git a/src/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CzarnyGeometry.cpp index 348164e7..219d5470 100644 --- a/src/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CzarnyGeometry.cpp +++ b/src/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CzarnyGeometry.cpp @@ -5,18 +5,21 @@ void PolarR6_SonnendruckerGyro_CzarnyGeometry::initializeGeometry() factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); } -PolarR6_SonnendruckerGyro_CzarnyGeometry::PolarR6_SonnendruckerGyro_CzarnyGeometry(double Rmax, +PolarR6_SonnendruckerGyro_CzarnyGeometry::PolarR6_SonnendruckerGyro_CzarnyGeometry(PolarGrid const& grid, double Rmax, double inverse_aspect_ratio_epsilon, double ellipticity_e) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) , ellipticity_e(ellipticity_e) { initializeGeometry(); } -double PolarR6_SonnendruckerGyro_CzarnyGeometry::rhs_f(double r, double theta) const +double PolarR6_SonnendruckerGyro_CzarnyGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); double temp = diff --git a/src/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_ShafranovGeometry.cpp index a47509da..23ac7aa7 100644 --- a/src/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_ShafranovGeometry.cpp +++ b/src/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_ShafranovGeometry.cpp @@ -1,16 +1,20 @@ #include "../include/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_ShafranovGeometry.h" -PolarR6_SonnendruckerGyro_ShafranovGeometry::PolarR6_SonnendruckerGyro_ShafranovGeometry(double Rmax, +PolarR6_SonnendruckerGyro_ShafranovGeometry::PolarR6_SonnendruckerGyro_ShafranovGeometry(PolarGrid const& grid, + double Rmax, double elongation_kappa, double shift_delta) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , elongation_kappa(elongation_kappa) , shift_delta(shift_delta) { } -double PolarR6_SonnendruckerGyro_ShafranovGeometry::rhs_f(double r, double theta) const +double PolarR6_SonnendruckerGyro_ShafranovGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return 0.4096 * pow((r / Rmax), 6.0) * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta) / diff --git a/src/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CircularGeometry.cpp index da832fc0..701d4b62 100644 --- a/src/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CircularGeometry.cpp +++ b/src/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CircularGeometry.cpp @@ -1,12 +1,15 @@ #include "../include/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CircularGeometry.h" -PolarR6_Sonnendrucker_CircularGeometry::PolarR6_Sonnendrucker_CircularGeometry(double Rmax) - : Rmax(Rmax) +PolarR6_Sonnendrucker_CircularGeometry::PolarR6_Sonnendrucker_CircularGeometry(PolarGrid const& grid, double Rmax) + : grid_(grid) + , Rmax(Rmax) { } -double PolarR6_Sonnendrucker_CircularGeometry::rhs_f(double r, double theta) const +double PolarR6_Sonnendrucker_CircularGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); return (-pow((r / Rmax), 4.0)) * ((r / Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * diff --git a/src/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CzarnyGeometry.cpp index 9500fa43..e2c0cb22 100644 --- a/src/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CzarnyGeometry.cpp +++ b/src/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CzarnyGeometry.cpp @@ -5,18 +5,21 @@ void PolarR6_Sonnendrucker_CzarnyGeometry::initializeGeometry() factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); } -PolarR6_Sonnendrucker_CzarnyGeometry::PolarR6_Sonnendrucker_CzarnyGeometry(double Rmax, +PolarR6_Sonnendrucker_CzarnyGeometry::PolarR6_Sonnendrucker_CzarnyGeometry(PolarGrid const& grid, double Rmax, double inverse_aspect_ratio_epsilon, double ellipticity_e) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) , ellipticity_e(ellipticity_e) { initializeGeometry(); } -double PolarR6_Sonnendrucker_CzarnyGeometry::rhs_f(double r, double theta) const +double PolarR6_Sonnendrucker_CzarnyGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); double temp = diff --git a/src/InputFunctions/SourceTerms/polarR6_Sonnendrucker_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_Sonnendrucker_ShafranovGeometry.cpp index 79d07cac..e912dbef 100644 --- a/src/InputFunctions/SourceTerms/polarR6_Sonnendrucker_ShafranovGeometry.cpp +++ b/src/InputFunctions/SourceTerms/polarR6_Sonnendrucker_ShafranovGeometry.cpp @@ -1,15 +1,19 @@ #include "../include/InputFunctions/SourceTerms/polarR6_Sonnendrucker_ShafranovGeometry.h" -PolarR6_Sonnendrucker_ShafranovGeometry::PolarR6_Sonnendrucker_ShafranovGeometry(double Rmax, double elongation_kappa, +PolarR6_Sonnendrucker_ShafranovGeometry::PolarR6_Sonnendrucker_ShafranovGeometry(PolarGrid const& grid, double Rmax, + double elongation_kappa, double shift_delta) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , elongation_kappa(elongation_kappa) , shift_delta(shift_delta) { } -double PolarR6_Sonnendrucker_ShafranovGeometry::rhs_f(double r, double theta) const +double PolarR6_Sonnendrucker_ShafranovGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return (-pow((r / Rmax), 4.0)) * diff --git a/src/InputFunctions/SourceTerms/polarR6_ZoniGyro_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_ZoniGyro_CircularGeometry.cpp index 05744358..ddef297c 100644 --- a/src/InputFunctions/SourceTerms/polarR6_ZoniGyro_CircularGeometry.cpp +++ b/src/InputFunctions/SourceTerms/polarR6_ZoniGyro_CircularGeometry.cpp @@ -1,12 +1,15 @@ #include "../include/InputFunctions/SourceTerms/polarR6_ZoniGyro_CircularGeometry.h" -PolarR6_ZoniGyro_CircularGeometry::PolarR6_ZoniGyro_CircularGeometry(double Rmax) - : Rmax(Rmax) +PolarR6_ZoniGyro_CircularGeometry::PolarR6_ZoniGyro_CircularGeometry(PolarGrid const& grid, double Rmax) + : grid_(grid) + , Rmax(Rmax) { } -double PolarR6_ZoniGyro_CircularGeometry::rhs_f(double r, double theta) const +double PolarR6_ZoniGyro_CircularGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); return 0.4096 * pow((r / Rmax), 6.0) * pow(((r / Rmax) - 1.0), 6.0) * exp(tanh(10.0 * (r / Rmax) - 5.0)) * cos(11.0 * theta) - pow((r / Rmax), 4.0) * diff --git a/src/InputFunctions/SourceTerms/polarR6_ZoniGyro_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_ZoniGyro_CzarnyGeometry.cpp index c006ad4f..e19c1470 100644 --- a/src/InputFunctions/SourceTerms/polarR6_ZoniGyro_CzarnyGeometry.cpp +++ b/src/InputFunctions/SourceTerms/polarR6_ZoniGyro_CzarnyGeometry.cpp @@ -5,17 +5,21 @@ void PolarR6_ZoniGyro_CzarnyGeometry::initializeGeometry() factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); } -PolarR6_ZoniGyro_CzarnyGeometry::PolarR6_ZoniGyro_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, +PolarR6_ZoniGyro_CzarnyGeometry::PolarR6_ZoniGyro_CzarnyGeometry(PolarGrid const& grid, double Rmax, + double inverse_aspect_ratio_epsilon, double ellipticity_e) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) , ellipticity_e(ellipticity_e) { initializeGeometry(); } -double PolarR6_ZoniGyro_CzarnyGeometry::rhs_f(double r, double theta) const +double PolarR6_ZoniGyro_CzarnyGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); double temp = diff --git a/src/InputFunctions/SourceTerms/polarR6_ZoniGyro_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_ZoniGyro_ShafranovGeometry.cpp index 04201499..98268057 100644 --- a/src/InputFunctions/SourceTerms/polarR6_ZoniGyro_ShafranovGeometry.cpp +++ b/src/InputFunctions/SourceTerms/polarR6_ZoniGyro_ShafranovGeometry.cpp @@ -1,15 +1,18 @@ #include "../include/InputFunctions/SourceTerms/polarR6_ZoniGyro_ShafranovGeometry.h" -PolarR6_ZoniGyro_ShafranovGeometry::PolarR6_ZoniGyro_ShafranovGeometry(double Rmax, double elongation_kappa, - double shift_delta) - : Rmax(Rmax) +PolarR6_ZoniGyro_ShafranovGeometry::PolarR6_ZoniGyro_ShafranovGeometry(PolarGrid const& grid, double Rmax, + double elongation_kappa, double shift_delta) + : grid_(grid) + , Rmax(Rmax) , elongation_kappa(elongation_kappa) , shift_delta(shift_delta) { } -double PolarR6_ZoniGyro_ShafranovGeometry::rhs_f(double r, double theta) const +double PolarR6_ZoniGyro_ShafranovGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return 0.4096 * pow((r / Rmax), 6.0) * pow(((r / Rmax) - 1.0), 6.0) * exp(tanh(10.0 * (r / Rmax) - 5.0)) * diff --git a/src/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CircularGeometry.cpp index 84d3dbaa..5be3dc70 100644 --- a/src/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CircularGeometry.cpp +++ b/src/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CircularGeometry.cpp @@ -1,12 +1,15 @@ #include "../include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CircularGeometry.h" -PolarR6_ZoniShiftedGyro_CircularGeometry::PolarR6_ZoniShiftedGyro_CircularGeometry(double Rmax) - : Rmax(Rmax) +PolarR6_ZoniShiftedGyro_CircularGeometry::PolarR6_ZoniShiftedGyro_CircularGeometry(PolarGrid const& grid, double Rmax) + : grid_(grid) + , Rmax(Rmax) { } -double PolarR6_ZoniShiftedGyro_CircularGeometry::rhs_f(double r, double theta) const +double PolarR6_ZoniShiftedGyro_CircularGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); return 0.4096 * pow((r / Rmax), 6.0) * pow(((r / Rmax) - 1.0), 6.0) * exp(tanh(20.0 * (r / Rmax) - 14.0)) * cos(11.0 * theta) - pow((r / Rmax), 4.0) * diff --git a/src/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CulhamGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CulhamGeometry.cpp index d79abacf..c3d0dfc7 100644 --- a/src/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CulhamGeometry.cpp +++ b/src/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CulhamGeometry.cpp @@ -1,12 +1,15 @@ #include "../include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CulhamGeometry.h" -PolarR6_ZoniShiftedGyro_CulhamGeometry::PolarR6_ZoniShiftedGyro_CulhamGeometry(double Rmax) - : Rmax(Rmax) +PolarR6_ZoniShiftedGyro_CulhamGeometry::PolarR6_ZoniShiftedGyro_CulhamGeometry(PolarGrid const& grid, double Rmax) + : grid_(grid) + , Rmax(Rmax) { } -double PolarR6_ZoniShiftedGyro_CulhamGeometry::rhs_f(double r, double theta) const +double PolarR6_ZoniShiftedGyro_CulhamGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return 0.4096 * pow((r / Rmax), 6.0) * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta); diff --git a/src/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CzarnyGeometry.cpp index 798f3ff9..5dd99e19 100644 --- a/src/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CzarnyGeometry.cpp +++ b/src/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CzarnyGeometry.cpp @@ -5,18 +5,21 @@ void PolarR6_ZoniShiftedGyro_CzarnyGeometry::initializeGeometry() factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); } -PolarR6_ZoniShiftedGyro_CzarnyGeometry::PolarR6_ZoniShiftedGyro_CzarnyGeometry(double Rmax, +PolarR6_ZoniShiftedGyro_CzarnyGeometry::PolarR6_ZoniShiftedGyro_CzarnyGeometry(PolarGrid const& grid, double Rmax, double inverse_aspect_ratio_epsilon, double ellipticity_e) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) , ellipticity_e(ellipticity_e) { initializeGeometry(); } -double PolarR6_ZoniShiftedGyro_CzarnyGeometry::rhs_f(double r, double theta) const +double PolarR6_ZoniShiftedGyro_CzarnyGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); double temp = diff --git a/src/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_ShafranovGeometry.cpp index ae718480..af9867d5 100644 --- a/src/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_ShafranovGeometry.cpp +++ b/src/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_ShafranovGeometry.cpp @@ -1,16 +1,19 @@ #include "../include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_ShafranovGeometry.h" -PolarR6_ZoniShiftedGyro_ShafranovGeometry::PolarR6_ZoniShiftedGyro_ShafranovGeometry(double Rmax, +PolarR6_ZoniShiftedGyro_ShafranovGeometry::PolarR6_ZoniShiftedGyro_ShafranovGeometry(PolarGrid const& grid, double Rmax, double elongation_kappa, double shift_delta) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , elongation_kappa(elongation_kappa) , shift_delta(shift_delta) { } -double PolarR6_ZoniShiftedGyro_ShafranovGeometry::rhs_f(double r, double theta) const +double PolarR6_ZoniShiftedGyro_ShafranovGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return 0.4096 * pow((r / Rmax), 6.0) * pow(((r / Rmax) - 1.0), 6.0) * exp(tanh(20.0 * (r / Rmax) - 14.0)) * diff --git a/src/InputFunctions/SourceTerms/polarR6_ZoniShifted_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_ZoniShifted_CircularGeometry.cpp index 27a512e7..d218f6f2 100644 --- a/src/InputFunctions/SourceTerms/polarR6_ZoniShifted_CircularGeometry.cpp +++ b/src/InputFunctions/SourceTerms/polarR6_ZoniShifted_CircularGeometry.cpp @@ -1,12 +1,15 @@ #include "../include/InputFunctions/SourceTerms/polarR6_ZoniShifted_CircularGeometry.h" -PolarR6_ZoniShifted_CircularGeometry::PolarR6_ZoniShifted_CircularGeometry(double Rmax) - : Rmax(Rmax) +PolarR6_ZoniShifted_CircularGeometry::PolarR6_ZoniShifted_CircularGeometry(PolarGrid const& grid, double Rmax) + : grid_(grid) + , Rmax(Rmax) { } -double PolarR6_ZoniShifted_CircularGeometry::rhs_f(double r, double theta) const +double PolarR6_ZoniShifted_CircularGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); return (-pow((r / Rmax), 4.0)) * ((r / Rmax) * (12.288 * (r / Rmax) * pow(((r / Rmax) - 1.0), 4.0) * cos(11.0 * theta) + diff --git a/src/InputFunctions/SourceTerms/polarR6_ZoniShifted_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_ZoniShifted_CzarnyGeometry.cpp index 5a16d935..5db6c59c 100644 --- a/src/InputFunctions/SourceTerms/polarR6_ZoniShifted_CzarnyGeometry.cpp +++ b/src/InputFunctions/SourceTerms/polarR6_ZoniShifted_CzarnyGeometry.cpp @@ -5,17 +5,21 @@ void PolarR6_ZoniShifted_CzarnyGeometry::initializeGeometry() factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); } -PolarR6_ZoniShifted_CzarnyGeometry::PolarR6_ZoniShifted_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, +PolarR6_ZoniShifted_CzarnyGeometry::PolarR6_ZoniShifted_CzarnyGeometry(PolarGrid const& grid, double Rmax, + double inverse_aspect_ratio_epsilon, double ellipticity_e) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) , ellipticity_e(ellipticity_e) { initializeGeometry(); } -double PolarR6_ZoniShifted_CzarnyGeometry::rhs_f(double r, double theta) const +double PolarR6_ZoniShifted_CzarnyGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); double temp = diff --git a/src/InputFunctions/SourceTerms/polarR6_ZoniShifted_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_ZoniShifted_ShafranovGeometry.cpp index 277790e0..a4381cd5 100644 --- a/src/InputFunctions/SourceTerms/polarR6_ZoniShifted_ShafranovGeometry.cpp +++ b/src/InputFunctions/SourceTerms/polarR6_ZoniShifted_ShafranovGeometry.cpp @@ -1,15 +1,19 @@ #include "../include/InputFunctions/SourceTerms/polarR6_ZoniShifted_ShafranovGeometry.h" -PolarR6_ZoniShifted_ShafranovGeometry::PolarR6_ZoniShifted_ShafranovGeometry(double Rmax, double elongation_kappa, +PolarR6_ZoniShifted_ShafranovGeometry::PolarR6_ZoniShifted_ShafranovGeometry(PolarGrid const& grid, double Rmax, + double elongation_kappa, double shift_delta) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , elongation_kappa(elongation_kappa) , shift_delta(shift_delta) { } -double PolarR6_ZoniShifted_ShafranovGeometry::rhs_f(double r, double theta) const +double PolarR6_ZoniShifted_ShafranovGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return (-pow((r / Rmax), 4.0)) * diff --git a/src/InputFunctions/SourceTerms/polarR6_Zoni_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_Zoni_CircularGeometry.cpp index 9acc93ac..84f318e1 100644 --- a/src/InputFunctions/SourceTerms/polarR6_Zoni_CircularGeometry.cpp +++ b/src/InputFunctions/SourceTerms/polarR6_Zoni_CircularGeometry.cpp @@ -1,12 +1,15 @@ #include "../include/InputFunctions/SourceTerms/polarR6_Zoni_CircularGeometry.h" -PolarR6_Zoni_CircularGeometry::PolarR6_Zoni_CircularGeometry(double Rmax) - : Rmax(Rmax) +PolarR6_Zoni_CircularGeometry::PolarR6_Zoni_CircularGeometry(PolarGrid const& grid, double Rmax) + : grid_(grid) + , Rmax(Rmax) { } -double PolarR6_Zoni_CircularGeometry::rhs_f(double r, double theta) const +double PolarR6_Zoni_CircularGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); return (-pow((r / Rmax), 4.0)) * ((r / Rmax) * (12.288 * (r / Rmax) * pow(((r / Rmax) - 1.0), 4.0) * cos(11.0 * theta) + diff --git a/src/InputFunctions/SourceTerms/polarR6_Zoni_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_Zoni_CzarnyGeometry.cpp index 95a364b9..33165b7b 100644 --- a/src/InputFunctions/SourceTerms/polarR6_Zoni_CzarnyGeometry.cpp +++ b/src/InputFunctions/SourceTerms/polarR6_Zoni_CzarnyGeometry.cpp @@ -5,17 +5,20 @@ void PolarR6_Zoni_CzarnyGeometry::initializeGeometry() factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); } -PolarR6_Zoni_CzarnyGeometry::PolarR6_Zoni_CzarnyGeometry(double Rmax, double inverse_aspect_ratio_epsilon, - double ellipticity_e) - : Rmax(Rmax) +PolarR6_Zoni_CzarnyGeometry::PolarR6_Zoni_CzarnyGeometry(PolarGrid const& grid, double Rmax, + double inverse_aspect_ratio_epsilon, double ellipticity_e) + : grid_(grid) + , Rmax(Rmax) , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) , ellipticity_e(ellipticity_e) { initializeGeometry(); } -double PolarR6_Zoni_CzarnyGeometry::rhs_f(double r, double theta) const +double PolarR6_Zoni_CzarnyGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); double temp = diff --git a/src/InputFunctions/SourceTerms/polarR6_Zoni_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_Zoni_ShafranovGeometry.cpp index 112afc13..02a4143b 100644 --- a/src/InputFunctions/SourceTerms/polarR6_Zoni_ShafranovGeometry.cpp +++ b/src/InputFunctions/SourceTerms/polarR6_Zoni_ShafranovGeometry.cpp @@ -1,14 +1,18 @@ #include "../include/InputFunctions/SourceTerms/polarR6_Zoni_ShafranovGeometry.h" -PolarR6_Zoni_ShafranovGeometry::PolarR6_Zoni_ShafranovGeometry(double Rmax, double elongation_kappa, double shift_delta) - : Rmax(Rmax) +PolarR6_Zoni_ShafranovGeometry::PolarR6_Zoni_ShafranovGeometry(PolarGrid const& grid, double Rmax, + double elongation_kappa, double shift_delta) + : grid_(grid) + , Rmax(Rmax) , elongation_kappa(elongation_kappa) , shift_delta(shift_delta) { } -double PolarR6_Zoni_ShafranovGeometry::rhs_f(double r, double theta) const +double PolarR6_Zoni_ShafranovGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return (-pow((r / Rmax), 4.0)) * diff --git a/src/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CircularGeometry.cpp index 47c53cde..8703aa2c 100644 --- a/src/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CircularGeometry.cpp +++ b/src/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CircularGeometry.cpp @@ -1,12 +1,15 @@ #include "../include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CircularGeometry.h" -Refined_ZoniShiftedGyro_CircularGeometry::Refined_ZoniShiftedGyro_CircularGeometry(double Rmax) - : Rmax(Rmax) +Refined_ZoniShiftedGyro_CircularGeometry::Refined_ZoniShiftedGyro_CircularGeometry(PolarGrid const& grid, double Rmax) + : grid_(grid) + , Rmax(Rmax) { } -double Refined_ZoniShiftedGyro_CircularGeometry::rhs_f(double r, double theta) const +double Refined_ZoniShiftedGyro_CircularGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); return 1.0 * (((-3.33823779536505e-15) * ((r / Rmax) * (r / Rmax)) - 0.0 * (r / Rmax) - 0.0 + exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * diff --git a/src/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CulhamGeometry.cpp b/src/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CulhamGeometry.cpp index 0abfe8ed..b73a7184 100644 --- a/src/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CulhamGeometry.cpp +++ b/src/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CulhamGeometry.cpp @@ -1,12 +1,15 @@ #include "../include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CulhamGeometry.h" -Refined_ZoniShiftedGyro_CulhamGeometry::Refined_ZoniShiftedGyro_CulhamGeometry(double Rmax) - : Rmax(Rmax) +Refined_ZoniShiftedGyro_CulhamGeometry::Refined_ZoniShiftedGyro_CulhamGeometry(PolarGrid const& grid, double Rmax) + : grid_(grid) + , Rmax(Rmax) { } -double Refined_ZoniShiftedGyro_CulhamGeometry::rhs_f(double r, double theta) const +double Refined_ZoniShiftedGyro_CulhamGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return ((-3.33823779536505e-15) * ((r / Rmax) * (r / Rmax)) - 0.0 * (r / Rmax) - 0.0 + diff --git a/src/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CzarnyGeometry.cpp index 31831d9c..5a1f289a 100644 --- a/src/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CzarnyGeometry.cpp +++ b/src/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CzarnyGeometry.cpp @@ -5,18 +5,21 @@ void Refined_ZoniShiftedGyro_CzarnyGeometry::initializeGeometry() factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); } -Refined_ZoniShiftedGyro_CzarnyGeometry::Refined_ZoniShiftedGyro_CzarnyGeometry(double Rmax, +Refined_ZoniShiftedGyro_CzarnyGeometry::Refined_ZoniShiftedGyro_CzarnyGeometry(PolarGrid const& grid, double Rmax, double inverse_aspect_ratio_epsilon, double ellipticity_e) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) , ellipticity_e(ellipticity_e) { initializeGeometry(); } -double Refined_ZoniShiftedGyro_CzarnyGeometry::rhs_f(double r, double theta) const +double Refined_ZoniShiftedGyro_CzarnyGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); double temp = diff --git a/src/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_ShafranovGeometry.cpp index 8a778d3b..e8d48fe7 100644 --- a/src/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_ShafranovGeometry.cpp +++ b/src/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_ShafranovGeometry.cpp @@ -1,16 +1,19 @@ #include "../include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_ShafranovGeometry.h" -Refined_ZoniShiftedGyro_ShafranovGeometry::Refined_ZoniShiftedGyro_ShafranovGeometry(double Rmax, +Refined_ZoniShiftedGyro_ShafranovGeometry::Refined_ZoniShiftedGyro_ShafranovGeometry(PolarGrid const& grid, double Rmax, double elongation_kappa, double shift_delta) - : Rmax(Rmax) + : grid_(grid) + , Rmax(Rmax) , elongation_kappa(elongation_kappa) , shift_delta(shift_delta) { } -double Refined_ZoniShiftedGyro_ShafranovGeometry::rhs_f(double r, double theta) const +double Refined_ZoniShiftedGyro_ShafranovGeometry::operator()(std::size_t i_r, std::size_t i_theta) const { + double r = grid_.radius(i_r); + double theta = grid_.theta(i_theta); double sin_theta = std::sin(theta); double cos_theta = std::cos(theta); return 1.0 * diff --git a/src/convergence_order.cpp b/src/convergence_order.cpp index 4425a1ab..1c6c4389 100644 --- a/src/convergence_order.cpp +++ b/src/convergence_order.cpp @@ -57,7 +57,6 @@ int main(int argc, char* argv[]) ShafranovGeometry domain_geometry(Rmax, elongation_kappa, shift_delta); ZoniGyroCoefficients coefficients(Rmax, alpha_jump); PolarR6_Boundary_ShafranovGeometry boundary_conditions(Rmax, elongation_kappa, shift_delta); - PolarR6_ZoniGyro_ShafranovGeometry source_term(Rmax, elongation_kappa, shift_delta); PolarR6_ShafranovGeometry exact_solution(Rmax, elongation_kappa, shift_delta); /* Example 2: Cartesian Solution -> Lower Order 3.5 */ @@ -65,7 +64,6 @@ int main(int argc, char* argv[]) // 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_SonnendruckerGyro_CzarnyGeometry source_term(Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); // CartesianR2_CzarnyGeometry exact_solution(Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); /* Example 3: Refined Solution -> Lower Order 3.5 */ @@ -73,7 +71,6 @@ int main(int argc, char* argv[]) // ShafranovGeometry domain_geometry(Rmax, elongation_kappa, shift_delta); // ZoniShiftedGyroCoefficients coefficients(Rmax, alpha_jump); // Refined_Boundary_ShafranovGeometry boundary_conditions(Rmax, elongation_kappa, shift_delta); - // Refined_ZoniShiftedGyro_ShafranovGeometry source_term(Rmax, elongation_kappa, shift_delta); // Refined_ShafranovGeometry exact_solution(Rmax, elongation_kappa, shift_delta); std::vector table_nr(MAX_DIVIDE_BY_2); @@ -94,6 +91,10 @@ int main(int argc, char* argv[]) splitting_radius); GMGPolar solver(grid, domain_geometry, coefficients); + PolarR6_ZoniGyro_ShafranovGeometry source_term(grid, Rmax, elongation_kappa, shift_delta); + // CartesianR2_SonnendruckerGyro_CzarnyGeometry source_term(grid, Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); + // Refined_ZoniShiftedGyro_ShafranovGeometry source_term(grid, Rmax, elongation_kappa, shift_delta); + solver.verbose(verbose); solver.paraview(paraview); diff --git a/src/strong_scaling.cpp b/src/strong_scaling.cpp index 351cfcc0..a13c06cd 100644 --- a/src/strong_scaling.cpp +++ b/src/strong_scaling.cpp @@ -23,7 +23,6 @@ void runTest(int maxOpenMPThreads, int divideBy2, std::ofstream& outfile) // ShafranovGeometry domain_geometry(Rmax, elongation_kappa, shift_delta); // ZoniGyroCoefficients coefficients(Rmax, alpha_jump); // PolarR6_Boundary_ShafranovGeometry boundary_conditions(Rmax, elongation_kappa, shift_delta); - // PolarR6_ZoniGyro_ShafranovGeometry source_term(Rmax, elongation_kappa, shift_delta); // PolarR6_ShafranovGeometry exact_solution(Rmax, elongation_kappa, shift_delta); /* Example 2: Cartesian Solution -> Lower Order 3.5 */ @@ -31,7 +30,6 @@ void runTest(int maxOpenMPThreads, int divideBy2, std::ofstream& outfile) 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_SonnendruckerGyro_CzarnyGeometry source_term(Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); CartesianR2_CzarnyGeometry exact_solution(Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); /* Example 3: Refined Solution -> Lower Order 3.5 */ @@ -39,7 +37,6 @@ void runTest(int maxOpenMPThreads, int divideBy2, std::ofstream& outfile) // ShafranovGeometry domain_geometry(Rmax, elongation_kappa, shift_delta); // ZoniShiftedGyroCoefficients coefficients(Rmax, alpha_jump); // Refined_Boundary_ShafranovGeometry boundary_conditions(Rmax, elongation_kappa, shift_delta); - // Refined_ZoniShiftedGyro_ShafranovGeometry source_term(Rmax, elongation_kappa, shift_delta); // Refined_ShafranovGeometry exact_solution(Rmax, elongation_kappa, shift_delta); std::string geometry_string = ""; @@ -94,6 +91,10 @@ void runTest(int maxOpenMPThreads, int divideBy2, std::ofstream& outfile) PolarGrid grid(R0, Rmax, nr_exp, ntheta_exp, refinement_radius, anisotropic_factor, divideBy2, splitting_radius); GMGPolar solver(grid, domain_geometry, coefficients); + // PolarR6_ZoniGyro_ShafranovGeometry source_term(grid, Rmax, elongation_kappa, shift_delta); + CartesianR2_SonnendruckerGyro_CzarnyGeometry source_term(grid, Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); + // Refined_ZoniShiftedGyro_ShafranovGeometry source_term(grid, Rmax, elongation_kappa, shift_delta); + solver.verbose(verbose); solver.paraview(paraview); diff --git a/src/weak_scaling.cpp b/src/weak_scaling.cpp index cccd5f50..8616dd97 100644 --- a/src/weak_scaling.cpp +++ b/src/weak_scaling.cpp @@ -22,7 +22,6 @@ void runTest(int maxOpenMPThreads, int divideBy2, std::ofstream& outfile) // ShafranovGeometry domain_geometry(Rmax, elongation_kappa, shift_delta); // ZoniGyroCoefficients coefficients(Rmax, alpha_jump); // PolarR6_Boundary_ShafranovGeometry boundary_conditions(Rmax, elongation_kappa, shift_delta); - // PolarR6_ZoniGyro_ShafranovGeometry source_term(Rmax, elongation_kappa, shift_delta); // PolarR6_ShafranovGeometry exact_solution(Rmax, elongation_kappa, shift_delta); /* Example 2: Cartesian Solution -> Lower Order 3.5 */ @@ -30,7 +29,6 @@ void runTest(int maxOpenMPThreads, int divideBy2, std::ofstream& outfile) 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_SonnendruckerGyro_CzarnyGeometry source_term(Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); CartesianR2_CzarnyGeometry exact_solution(Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); /* Example 3: Refined Solution -> Lower Order 3.5 */ @@ -38,7 +36,6 @@ void runTest(int maxOpenMPThreads, int divideBy2, std::ofstream& outfile) // ShafranovGeometry domain_geometry(Rmax, elongation_kappa, shift_delta); // ZoniShiftedGyroCoefficients coefficients(Rmax, alpha_jump); // Refined_Boundary_ShafranovGeometry boundary_conditions(Rmax, elongation_kappa, shift_delta); - // Refined_ZoniShiftedGyro_ShafranovGeometry source_term(Rmax, elongation_kappa, shift_delta); // Refined_ShafranovGeometry exact_solution(Rmax, elongation_kappa, shift_delta); std::string geometry_string = ""; @@ -93,6 +90,10 @@ void runTest(int maxOpenMPThreads, int divideBy2, std::ofstream& outfile) PolarGrid grid(R0, Rmax, nr_exp, ntheta_exp, refinement_radius, anisotropic_factor, divideBy2, splitting_radius); GMGPolar solver(grid, domain_geometry, coefficients); + // PolarR6_ZoniGyro_ShafranovGeometry source_term(grid, Rmax, elongation_kappa, shift_delta); + CartesianR2_SonnendruckerGyro_CzarnyGeometry source_term(grid, Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); + // Refined_ZoniShiftedGyro_ShafranovGeometry source_term(grid, Rmax, elongation_kappa, shift_delta); + solver.verbose(verbose); solver.paraview(paraview); diff --git a/tests/DirectSolver/directSolver.cpp b/tests/DirectSolver/directSolver.cpp index 84e8c5a3..c08674bd 100644 --- a/tests/DirectSolver/directSolver.cpp +++ b/tests/DirectSolver/directSolver.cpp @@ -82,8 +82,6 @@ TEST(DirectSolverTest, directSolver_DirBC_Interior) std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = true; int maxOpenMPThreads = 16; @@ -96,6 +94,8 @@ TEST(DirectSolverTest, directSolver_DirBC_Interior) 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), ExtrapolationType::NONE, false); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverTake directSolverGive_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -137,8 +137,6 @@ TEST(DirectSolverTest, directSolver_AcrossOrigin) std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = false; int maxOpenMPThreads = 16; @@ -151,6 +149,8 @@ TEST(DirectSolverTest, directSolver_AcrossOrigin) 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGive directSolverGive_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -196,7 +196,6 @@ TEST(DirectSolverTest_CircularGeometry, SequentialDirectSolverDirBC_Interior_Cir std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); bool DirBC_Interior = true; int maxOpenMPThreads = 1; @@ -207,6 +206,8 @@ TEST(DirectSolverTest_CircularGeometry, SequentialDirectSolverDirBC_Interior_Cir 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverGive solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -241,7 +242,6 @@ TEST(DirectSolverTest_CircularGeometry, ParallelDirectSolverDirBC_Interior_Circu std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); bool DirBC_Interior = true; int maxOpenMPThreads = 16; @@ -252,6 +252,8 @@ TEST(DirectSolverTest_CircularGeometry, ParallelDirectSolverDirBC_Interior_Circu 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverGive solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -286,7 +288,6 @@ TEST(DirectSolverTest_CircularGeometry, SequentialDirectSolverAcrossOrigin_Circu std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); bool DirBC_Interior = false; int maxOpenMPThreads = 1; @@ -297,6 +298,8 @@ TEST(DirectSolverTest_CircularGeometry, SequentialDirectSolverAcrossOrigin_Circu 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverGive solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -331,7 +334,6 @@ TEST(DirectSolverTest_CircularGeometry, ParallelDirectSolverAcrossOrigin_Circula std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); bool DirBC_Interior = false; int maxOpenMPThreads = 16; @@ -342,6 +344,8 @@ TEST(DirectSolverTest_CircularGeometry, ParallelDirectSolverAcrossOrigin_Circula 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverGive solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -381,8 +385,6 @@ TEST(DirectSolverTest_ShafranovGeometry, DirectSolverDirBC_Interior_ShafranovGeo std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = true; int maxOpenMPThreads = 16; @@ -393,6 +395,8 @@ TEST(DirectSolverTest_ShafranovGeometry, DirectSolverDirBC_Interior_ShafranovGeo 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGive solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -428,8 +432,6 @@ TEST(DirectSolverTest_ShafranovGeometry, DirectSolverAcrossOrigin_ShafranovGeome std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = false; int maxOpenMPThreads = 16; @@ -440,6 +442,8 @@ TEST(DirectSolverTest_ShafranovGeometry, DirectSolverAcrossOrigin_ShafranovGeome 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGive solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -480,8 +484,6 @@ TEST(DirectSolverTest_CzarnyGeometry, DirectSolverDirBC_Interior_CzarnyGeometry) std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = true; int maxOpenMPThreads = 16; @@ -492,6 +494,8 @@ TEST(DirectSolverTest_CzarnyGeometry, DirectSolverDirBC_Interior_CzarnyGeometry) 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGive solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -528,8 +532,6 @@ TEST(DirectSolverTest_CzarnyGeometry, DirectSolverAcrossOrigin_CzarnyGeometry) std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = false; int maxOpenMPThreads = 16; @@ -540,6 +542,8 @@ TEST(DirectSolverTest_CzarnyGeometry, DirectSolverAcrossOrigin_CzarnyGeometry) 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGive solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -577,7 +581,6 @@ TEST(DirectSolverTest_CulhamGeometry, DirectSolverDirBC_Interior_CulhamGeometry) std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); bool DirBC_Interior = true; int maxOpenMPThreads = 16; @@ -588,6 +591,8 @@ TEST(DirectSolverTest_CulhamGeometry, DirectSolverDirBC_Interior_CulhamGeometry) 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverGive solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -621,7 +626,6 @@ TEST(DirectSolverTest_CulhamGeometry, DirectSolverAcrossOrigin_CulhamGeometry) std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); bool DirBC_Interior = false; int maxOpenMPThreads = 16; @@ -632,6 +636,8 @@ TEST(DirectSolverTest_CulhamGeometry, DirectSolverAcrossOrigin_CulhamGeometry) 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverGive solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -678,7 +684,6 @@ TEST(DirectSolverTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecision_ std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); bool DirBC_Interior = false; int maxOpenMPThreads = 1; @@ -689,6 +694,8 @@ TEST(DirectSolverTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecision_ 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverGive solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -723,7 +730,6 @@ TEST(DirectSolverTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecision2 std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); bool DirBC_Interior = false; int maxOpenMPThreads = 1; @@ -734,6 +740,8 @@ TEST(DirectSolverTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecision2 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverGive solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -769,7 +777,6 @@ TEST(DirectSolverTakeTest_CircularGeometry, SequentialDirectSolverDirBC_Interior std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); bool DirBC_Interior = true; int maxOpenMPThreads = 1; @@ -780,6 +787,8 @@ TEST(DirectSolverTakeTest_CircularGeometry, SequentialDirectSolverDirBC_Interior 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverTake solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -814,7 +823,6 @@ TEST(DirectSolverTakeTest_CircularGeometry, ParallelDirectSolverDirBC_Interior_C std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); bool DirBC_Interior = true; int maxOpenMPThreads = 16; @@ -825,6 +833,8 @@ TEST(DirectSolverTakeTest_CircularGeometry, ParallelDirectSolverDirBC_Interior_C 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverTake solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -859,7 +869,6 @@ TEST(DirectSolverTakeTest_CircularGeometry, SequentialDirectSolverAcrossOrigin_C std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); bool DirBC_Interior = false; int maxOpenMPThreads = 1; @@ -870,6 +879,8 @@ TEST(DirectSolverTakeTest_CircularGeometry, SequentialDirectSolverAcrossOrigin_C 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverTake solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -904,7 +915,6 @@ TEST(DirectSolverTakeTest_CircularGeometry, ParallelDirectSolverAcrossOrigin_Cir std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); bool DirBC_Interior = false; int maxOpenMPThreads = 16; @@ -915,6 +925,8 @@ TEST(DirectSolverTakeTest_CircularGeometry, ParallelDirectSolverAcrossOrigin_Cir 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverTake solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -954,8 +966,6 @@ TEST(DirectSolverTakeTest_ShafranovGeometry, DirectSolverDirBC_Interior_Shafrano std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = true; int maxOpenMPThreads = 16; @@ -966,6 +976,8 @@ TEST(DirectSolverTakeTest_ShafranovGeometry, DirectSolverDirBC_Interior_Shafrano 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverTake solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -1001,8 +1013,6 @@ TEST(DirectSolverTakeTest_ShafranovGeometry, DirectSolverAcrossOrigin_ShafranovG std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = false; int maxOpenMPThreads = 16; @@ -1013,6 +1023,8 @@ TEST(DirectSolverTakeTest_ShafranovGeometry, DirectSolverAcrossOrigin_ShafranovG 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverTake solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -1053,8 +1065,6 @@ TEST(DirectSolverTakeTest_CzarnyGeometry, DirectSolverDirBC_Interior_CzarnyGeome std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = true; int maxOpenMPThreads = 16; @@ -1065,6 +1075,8 @@ TEST(DirectSolverTakeTest_CzarnyGeometry, DirectSolverDirBC_Interior_CzarnyGeome 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverTake solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -1101,8 +1113,6 @@ TEST(DirectSolverTakeTest_CzarnyGeometry, DirectSolverAcrossOrigin_CzarnyGeometr std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = false; int maxOpenMPThreads = 16; @@ -1113,6 +1123,8 @@ TEST(DirectSolverTakeTest_CzarnyGeometry, DirectSolverAcrossOrigin_CzarnyGeometr 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverTake solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -1150,7 +1162,6 @@ TEST(DirectSolverTakeTest_CulhamGeometry, DirectSolverDirBC_Interior_CulhamGeome std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); bool DirBC_Interior = true; int maxOpenMPThreads = 16; @@ -1161,6 +1172,8 @@ TEST(DirectSolverTakeTest_CulhamGeometry, DirectSolverDirBC_Interior_CulhamGeome 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverTake solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -1194,7 +1207,6 @@ TEST(DirectSolverTakeTest_CulhamGeometry, DirectSolverAcrossOrigin_CulhamGeometr std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); bool DirBC_Interior = false; int maxOpenMPThreads = 16; @@ -1205,6 +1217,8 @@ TEST(DirectSolverTakeTest_CulhamGeometry, DirectSolverAcrossOrigin_CulhamGeometr 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverTake solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -1249,7 +1263,6 @@ TEST(DirectSolverTakeTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecis std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); bool DirBC_Interior = false; int maxOpenMPThreads = 1; @@ -1260,6 +1273,8 @@ TEST(DirectSolverTakeTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecis 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverTake solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -1294,7 +1309,6 @@ TEST(DirectSolverTakeTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecis std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); bool DirBC_Interior = false; int maxOpenMPThreads = 1; @@ -1305,6 +1319,8 @@ TEST(DirectSolverTakeTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecis 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverTake solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); diff --git a/tests/DirectSolver/directSolverNoMumps.cpp b/tests/DirectSolver/directSolverNoMumps.cpp index 49207283..8463764e 100644 --- a/tests/DirectSolver/directSolverNoMumps.cpp +++ b/tests/DirectSolver/directSolverNoMumps.cpp @@ -75,13 +75,13 @@ TEST(DirectSolverTestNoMumps, directSolver_DirBC_Interior) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = true; int maxOpenMPThreads = 16; @@ -90,10 +90,11 @@ TEST(DirectSolverTestNoMumps, 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), ExtrapolationType::NONE, false); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverTakeCustomLU directSolverGive_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -130,13 +131,13 @@ TEST(DirectSolverTestNoMumps, directSolver_AcrossOrigin) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = false; int maxOpenMPThreads = 16; @@ -145,10 +146,11 @@ TEST(DirectSolverTestNoMumps, 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGiveCustomLU directSolverGive_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -189,22 +191,23 @@ TEST(DirectSolverTestNoMumps_CircularGeometry, SequentialDirectSolverDirBC_Inter CircularGeometry domain_geometry(Rmax); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.66 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); - bool DirBC_Interior = true; int maxOpenMPThreads = 1; 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -234,22 +237,23 @@ TEST(DirectSolverTestNoMumps_CircularGeometry, ParallelDirectSolverDirBC_Interio CircularGeometry domain_geometry(Rmax); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.66 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); - bool DirBC_Interior = true; int maxOpenMPThreads = 16; 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -279,22 +283,23 @@ TEST(DirectSolverTestNoMumps_CircularGeometry, SequentialDirectSolverAcrossOrigi CircularGeometry domain_geometry(Rmax); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.66 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); - bool DirBC_Interior = false; int maxOpenMPThreads = 1; 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -324,22 +329,23 @@ TEST(DirectSolverTestNoMumps_CircularGeometry, ParallelDirectSolverAcrossOrigin_ CircularGeometry domain_geometry(Rmax); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.66 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); - bool DirBC_Interior = false; int maxOpenMPThreads = 16; 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -375,22 +381,23 @@ TEST(DirectSolverTestNoMumps_ShafranovGeometry, DirectSolverDirBC_Interior_Shafr ShafranovGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.4837 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = true; int maxOpenMPThreads = 16; 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -422,22 +429,23 @@ TEST(DirectSolverTestNoMumps_ShafranovGeometry, DirectSolverAcrossOrigin_Shafran ShafranovGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.4837 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = false; int maxOpenMPThreads = 16; 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -473,23 +481,24 @@ TEST(DirectSolverTestNoMumps_CzarnyGeometry, DirectSolverDirBC_Interior_CzarnyGe CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = true; int maxOpenMPThreads = 16; 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -521,23 +530,24 @@ TEST(DirectSolverTestNoMumps_CzarnyGeometry, DirectSolverAcrossOrigin_CzarnyGeom CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = false; int maxOpenMPThreads = 16; 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -571,21 +581,22 @@ TEST(DirectSolverTestNoMumps_CulhamGeometry, DirectSolverDirBC_Interior_CulhamGe CulhamGeometry domain_geometry(Rmax); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); - - bool DirBC_Interior = true; - int maxOpenMPThreads = 16; - bool cache_density_rpofile_coefficients = true; - bool cache_domain_geometry = false; + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -615,21 +626,22 @@ TEST(DirectSolverTestNoMumps_CulhamGeometry, DirectSolverAcrossOrigin_CulhamGeom CulhamGeometry domain_geometry(Rmax); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; - bool DirBC_Interior = false; - int maxOpenMPThreads = 16; - 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -671,22 +683,23 @@ TEST(DirectSolverTestNoMumps_CircularGeometry, DirectSolverAcrossOriginHigherPre CircularGeometry domain_geometry(Rmax); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.66 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); - bool DirBC_Interior = false; int maxOpenMPThreads = 1; 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -716,22 +729,23 @@ TEST(DirectSolverTestNoMumps_CircularGeometry, DirectSolverAcrossOriginHigherPre CircularGeometry domain_geometry(Rmax); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.66 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); - bool DirBC_Interior = false; int maxOpenMPThreads = 1; 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -762,22 +776,23 @@ TEST(DirectSolverTakeCustomLUTest_CircularGeometry, SequentialDirectSolverDirBC_ CircularGeometry domain_geometry(Rmax); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.66 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); - bool DirBC_Interior = true; int maxOpenMPThreads = 1; 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -807,22 +822,23 @@ TEST(DirectSolverTakeCustomLUTest_CircularGeometry, ParallelDirectSolverDirBC_In CircularGeometry domain_geometry(Rmax); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.66 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); - bool DirBC_Interior = true; int maxOpenMPThreads = 16; 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -852,22 +868,23 @@ TEST(DirectSolverTakeCustomLUTest_CircularGeometry, SequentialDirectSolverAcross CircularGeometry domain_geometry(Rmax); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.66 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); - bool DirBC_Interior = false; int maxOpenMPThreads = 1; 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -897,22 +914,23 @@ TEST(DirectSolverTakeCustomLUTest_CircularGeometry, ParallelDirectSolverAcrossOr CircularGeometry domain_geometry(Rmax); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.66 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); - bool DirBC_Interior = false; int maxOpenMPThreads = 16; 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -948,22 +966,23 @@ TEST(DirectSolverTakeCustomLUTest_ShafranovGeometry, DirectSolverDirBC_Interior_ ShafranovGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.4837 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = true; int maxOpenMPThreads = 16; 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -995,22 +1014,23 @@ TEST(DirectSolverTakeCustomLUTest_ShafranovGeometry, DirectSolverAcrossOrigin_Sh ShafranovGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.4837 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = false; int maxOpenMPThreads = 16; 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -1046,23 +1066,24 @@ TEST(DirectSolverTakeCustomLUTest_CzarnyGeometry, DirectSolverDirBC_Interior_Cza CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = true; int maxOpenMPThreads = 16; 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -1094,23 +1115,24 @@ TEST(DirectSolverTakeCustomLUTest_CzarnyGeometry, DirectSolverAcrossOrigin_Czarn CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = false; int maxOpenMPThreads = 16; 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -1144,21 +1166,22 @@ TEST(DirectSolverTakeCustomLUTest_CulhamGeometry, DirectSolverDirBC_Interior_Cul CulhamGeometry domain_geometry(Rmax); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); - - bool DirBC_Interior = true; - int maxOpenMPThreads = 16; - bool cache_density_rpofile_coefficients = true; - bool cache_domain_geometry = true; + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -1188,21 +1211,22 @@ TEST(DirectSolverTakeCustomLUTest_CulhamGeometry, DirectSolverAcrossOrigin_Culha CulhamGeometry domain_geometry(Rmax); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; - bool DirBC_Interior = false; - int maxOpenMPThreads = 16; - 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -1242,22 +1266,23 @@ TEST(DirectSolverTakeCustomLUTest_CircularGeometry, DirectSolverAcrossOriginHigh CircularGeometry domain_geometry(Rmax); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.66 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); - bool DirBC_Interior = false; int maxOpenMPThreads = 1; 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -1287,22 +1312,23 @@ TEST(DirectSolverTakeCustomLUTest_CircularGeometry, DirectSolverAcrossOriginHigh CircularGeometry domain_geometry(Rmax); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.66 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax); - std::unique_ptr source_term = std::make_unique(Rmax); - bool DirBC_Interior = false; int maxOpenMPThreads = 1; 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax); DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); diff --git a/tests/ExtrapolatedSmoother/extrapolated_smoother.cpp b/tests/ExtrapolatedSmoother/extrapolated_smoother.cpp index 90729ec6..e4a8a922 100644 --- a/tests/ExtrapolatedSmoother/extrapolated_smoother.cpp +++ b/tests/ExtrapolatedSmoother/extrapolated_smoother.cpp @@ -57,13 +57,13 @@ TEST(ExtrapolatedSmootherTest, extrapolatedSmoother_DirBC_Interior) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = true; int maxOpenMPThreads = 16; @@ -72,10 +72,11 @@ TEST(ExtrapolatedSmootherTest, extrapolatedSmoother_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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); ExtrapolatedSmootherGive smootherGive_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -117,13 +118,13 @@ TEST(ExtrapolatedSmootherTest, extrapolatedSmoother_AcossOrigin) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = false; int maxOpenMPThreads = 16; @@ -132,10 +133,11 @@ TEST(ExtrapolatedSmootherTest, extrapolatedSmoother_AcossOrigin) 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); ExtrapolatedSmootherGive smootherGive_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -179,13 +181,13 @@ TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherDirBC_Interior) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = true; int maxOpenMPThreads = 1; @@ -193,10 +195,11 @@ TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherDirBC_Interior) 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), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -263,13 +266,13 @@ TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherDirBC_Interior) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = true; int maxOpenMPThreads = 16; @@ -277,10 +280,11 @@ TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherDirBC_Interior) 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), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -347,13 +351,13 @@ TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherAcrossOrigin) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = false; int maxOpenMPThreads = 1; @@ -361,10 +365,11 @@ TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherAcrossOrigin) 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), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -433,13 +438,13 @@ TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherAcrossOrigin) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = false; int maxOpenMPThreads = 16; @@ -447,10 +452,11 @@ TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherAcrossOrigin) 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), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -518,13 +524,13 @@ TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherDirBC_Interior_Smal CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = true; int maxOpenMPThreads = 1; @@ -532,10 +538,11 @@ TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherDirBC_Interior_Smal 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), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -603,13 +610,13 @@ TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherDirBC_Interior_Smalle CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = true; int maxOpenMPThreads = 16; @@ -617,10 +624,11 @@ TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherDirBC_Interior_Smalle 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), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -688,13 +696,13 @@ TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherAcrossOrigin_Smalle CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = false; int maxOpenMPThreads = 1; @@ -702,10 +710,11 @@ TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherAcrossOrigin_Smalle 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), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -771,13 +780,13 @@ TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherAcrossOrigin_Smallest CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = false; int maxOpenMPThreads = 16; @@ -785,10 +794,11 @@ TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherAcrossOrigin_Smallest 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), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -857,13 +867,13 @@ TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherTakeDirBC_Interior) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = true; int maxOpenMPThreads = 1; @@ -871,10 +881,11 @@ TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherTakeDirBC_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), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -943,13 +954,13 @@ TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherTakeDirBC_Interior) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = true; int maxOpenMPThreads = 16; @@ -957,10 +968,11 @@ TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherTakeDirBC_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), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -1027,13 +1039,13 @@ TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherTakeAcrossOrigin) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = false; int maxOpenMPThreads = 1; @@ -1041,10 +1053,11 @@ TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherTakeAcrossOrigin) 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), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -1111,13 +1124,13 @@ TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherTakeAcrossOrigin) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = false; int maxOpenMPThreads = 16; @@ -1125,10 +1138,11 @@ TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherTakeAcrossOrigin) 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), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -1194,13 +1208,13 @@ TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherTakeDirBC_Interior_ CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = true; int maxOpenMPThreads = 1; @@ -1208,10 +1222,11 @@ TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherTakeDirBC_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), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -1277,13 +1292,13 @@ TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherTakeDirBC_Interior_Sm CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = true; int maxOpenMPThreads = 16; @@ -1291,10 +1306,11 @@ TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherTakeDirBC_Interior_Sm 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), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -1360,13 +1376,13 @@ TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherTakeAcrossOrigin_Sm CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = false; int maxOpenMPThreads = 1; @@ -1374,10 +1390,11 @@ TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherTakeAcrossOrigin_Sm 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), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -1443,13 +1460,13 @@ TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherTakeAcrossOrigin_Smal CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = false; int maxOpenMPThreads = 16; @@ -1457,10 +1474,11 @@ TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherTakeAcrossOrigin_Smal 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), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); diff --git a/tests/GMGPolar/convergence_order.cpp b/tests/GMGPolar/convergence_order.cpp index 145d21b0..57f9b40e 100644 --- a/tests/GMGPolar/convergence_order.cpp +++ b/tests/GMGPolar/convergence_order.cpp @@ -212,12 +212,6 @@ void test_convergence(double non_uniformity) double delta_e = 1.4; CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); - const double alpha_jump = 0.0; // Unused value - typename TestFixture::DensityProfileCoefficients coefficients(Rmax, alpha_jump); - typename TestFixture::BoundaryConditions boundary_conditions(Rmax, kappa_eps, delta_e); - typename TestFixture::SourceTerm source_term(Rmax, kappa_eps, delta_e); - typename TestFixture::ExactSolution solution(Rmax, kappa_eps, delta_e); - // For extrapolation, we need a uniform refinement std::vector non_uniform_radii = get_non_uniform_points(1e-8, Rmax, n_r / 2 + 1, non_uniformity); std::vector non_uniform_angles = get_non_uniform_points(0.0, 2 * M_PI, n_angles / 2 + 1, non_uniformity); @@ -228,12 +222,21 @@ void test_convergence(double non_uniformity) std::vector radii_refined = refine(radii); std::vector angles_refined = refine(angles); - auto [euclid_error, inf_error] = - get_gmgpolar_error(PolarGrid(radii, angles), domain_geometry, coefficients, boundary_conditions, source_term, - solution, TestFixture::extrapolation); + PolarGrid grid(radii, angles); + PolarGrid grid_refined(radii_refined, angles_refined); + + const double alpha_jump = 0.0; // Unused value + typename TestFixture::DensityProfileCoefficients coefficients(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); + typename TestFixture::ExactSolution solution(Rmax, kappa_eps, delta_e); + + 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(PolarGrid(radii_refined, angles_refined), domain_geometry, coefficients, boundary_conditions, - source_term, solution, TestFixture::extrapolation); + get_gmgpolar_error(grid_refined, domain_geometry, coefficients, 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/solve_tests.cpp b/tests/GMGPolar/solve_tests.cpp index 7a69eb0f..c4009f8b 100644 --- a/tests/GMGPolar/solve_tests.cpp +++ b/tests/GMGPolar/solve_tests.cpp @@ -529,7 +529,7 @@ void run_gmgpolar() typename TestFixture::DensityProfileCoefficients profile_coefficients(TestFixture::Rmax, 0.0); typename TestFixture::BoundaryConditions boundary_conditions(TestFixture::Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); - typename TestFixture::SourceTerm source_term(TestFixture::Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); + typename TestFixture::SourceTerm source_term(grid, TestFixture::Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); typename TestFixture::ExactSolution exact_solution(TestFixture::Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); GMGPolar solver(grid, domain, profile_coefficients); diff --git a/tests/Residual/residual.cpp b/tests/Residual/residual.cpp index 7522f8c3..46011723 100644 --- a/tests/Residual/residual.cpp +++ b/tests/Residual/residual.cpp @@ -56,8 +56,6 @@ TEST(OperatorATest, applyA_DirBC_Interior) std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = true; int maxOpenMPThreads = 16; @@ -70,6 +68,8 @@ TEST(OperatorATest, applyA_DirBC_Interior) 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), ExtrapolationType::NONE, false); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); ResidualGive residualGive_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -112,8 +112,6 @@ TEST(OperatorATest, applyA_AcrossOrigin) std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = false; int maxOpenMPThreads = 16; @@ -126,6 +124,8 @@ TEST(OperatorATest, applyA_AcrossOrigin) 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), ExtrapolationType::NONE, false); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); ResidualGive residualGive_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); diff --git a/tests/Smoother/smoother.cpp b/tests/Smoother/smoother.cpp index 40ea3003..9b697f3d 100644 --- a/tests/Smoother/smoother.cpp +++ b/tests/Smoother/smoother.cpp @@ -55,13 +55,13 @@ TEST(SmootherTest, smoother_DirBC_Interior) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = true; int maxOpenMPThreads = 16; @@ -70,10 +70,11 @@ TEST(SmootherTest, smoother_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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); SmootherGive smootherGive_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -114,13 +115,13 @@ TEST(SmootherTest, smoother_AcrossOrigin) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = false; int maxOpenMPThreads = 16; @@ -129,10 +130,11 @@ TEST(SmootherTest, smoother_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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); SmootherGive smootherGive_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -176,13 +178,13 @@ TEST(SmootherTest, SequentialSmootherDirBC_Interior) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = true; int maxOpenMPThreads = 1; @@ -190,10 +192,11 @@ TEST(SmootherTest, SequentialSmootherDirBC_Interior) 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -255,13 +258,13 @@ TEST(SmootherTest, ParallelSmootherDirBC_Interior) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = true; int maxOpenMPThreads = 16; @@ -269,10 +272,11 @@ TEST(SmootherTest, ParallelSmootherDirBC_Interior) 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -334,13 +338,13 @@ TEST(SmootherTest, SequentialSmootherAcrossOrigin) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = false; int maxOpenMPThreads = 1; @@ -348,10 +352,11 @@ TEST(SmootherTest, SequentialSmootherAcrossOrigin) 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -413,13 +418,13 @@ TEST(SmootherTest, ParallelSmootherAcrossOrigin) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = false; int maxOpenMPThreads = 16; @@ -427,10 +432,11 @@ TEST(SmootherTest, ParallelSmootherAcrossOrigin) 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -491,13 +497,13 @@ TEST(SmootherTest, SequentialSmootherDirBC_Interior_SmallestGrid) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = true; int maxOpenMPThreads = 1; @@ -505,10 +511,11 @@ TEST(SmootherTest, SequentialSmootherDirBC_Interior_SmallestGrid) 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -569,13 +576,13 @@ TEST(SmootherTest, ParallelSmootherDirBC_Interior_SmallestGrid) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = true; int maxOpenMPThreads = 16; @@ -583,10 +590,11 @@ TEST(SmootherTest, ParallelSmootherDirBC_Interior_SmallestGrid) 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -647,13 +655,13 @@ TEST(SmootherTest, SequentialSmootherAcrossOrigin_SmallestGrid) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = false; int maxOpenMPThreads = 1; @@ -661,10 +669,11 @@ TEST(SmootherTest, SequentialSmootherAcrossOrigin_SmallestGrid) 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -725,13 +734,13 @@ TEST(SmootherTest, ParallelSmootherAcrossOrigin_SmallestGrid) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = false; int maxOpenMPThreads = 16; @@ -739,10 +748,11 @@ TEST(SmootherTest, ParallelSmootherAcrossOrigin_SmallestGrid) 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -806,13 +816,13 @@ TEST(SmootherTest, SequentialSmootherTakeDirBC_Interior) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = true; int maxOpenMPThreads = 1; @@ -820,10 +830,11 @@ TEST(SmootherTest, SequentialSmootherTakeDirBC_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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -885,13 +896,13 @@ TEST(SmootherTest, ParallelSmootherTakeDirBC_Interior) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = true; int maxOpenMPThreads = 16; @@ -899,10 +910,11 @@ TEST(SmootherTest, ParallelSmootherTakeDirBC_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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -964,13 +976,13 @@ TEST(SmootherTest, SequentialSmootherTakeAcrossOrigin) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = false; int maxOpenMPThreads = 1; @@ -978,10 +990,11 @@ TEST(SmootherTest, SequentialSmootherTakeAcrossOrigin) 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -1043,13 +1056,13 @@ TEST(SmootherTest, ParallelSmootherTakeAcrossOrigin) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = false; int maxOpenMPThreads = 16; @@ -1057,10 +1070,11 @@ TEST(SmootherTest, ParallelSmootherTakeAcrossOrigin) 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -1121,13 +1135,13 @@ TEST(SmootherTest, SequentialSmootherTakeDirBC_Interior_SmallestGrid) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = true; int maxOpenMPThreads = 1; @@ -1135,10 +1149,11 @@ TEST(SmootherTest, SequentialSmootherTakeDirBC_Interior_SmallestGrid) 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -1199,13 +1214,13 @@ TEST(SmootherTest, ParallelSmootherTakeDirBC_Interior_SmallestGrid) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = true; int maxOpenMPThreads = 16; @@ -1213,10 +1228,11 @@ TEST(SmootherTest, ParallelSmootherTakeDirBC_Interior_SmallestGrid) 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -1277,13 +1293,13 @@ TEST(SmootherTest, SequentialSmootherTakeAcrossOrigin_SmallestGrid) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = false; int maxOpenMPThreads = 1; @@ -1291,10 +1307,11 @@ TEST(SmootherTest, SequentialSmootherTakeAcrossOrigin_SmallestGrid) 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads); @@ -1355,13 +1372,13 @@ TEST(SmootherTest, ParallelSmootherTakeAcrossOrigin_SmallestGrid) CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + auto grid = std::make_unique(radii, angles); + double alpha_jump = 0.678 * Rmax; std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); std::unique_ptr boundary_conditions = std::make_unique(Rmax, kappa_eps, delta_e); - std::unique_ptr source_term = - std::make_unique(Rmax, kappa_eps, delta_e); bool DirBC_Interior = false; int maxOpenMPThreads = 16; @@ -1369,10 +1386,11 @@ TEST(SmootherTest, ParallelSmootherTakeAcrossOrigin_SmallestGrid) 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), ExtrapolationType::NONE, 0); + std::unique_ptr source_term = + std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, maxOpenMPThreads);