diff options
author | 2022-10-10 20:36:14 +0200 | |
---|---|---|
committer | 2022-10-10 11:36:14 -0700 | |
commit | e9cc65ffeb0684a97618b67c2164d95ea497226c (patch) | |
tree | ed65f7ac86cc4e8945021dc36a79c8bc246c150d /Source/FieldSolver | |
parent | 56e04c1b911f9399662c4ff9ecf6630d686cc220 (diff) | |
download | WarpX-e9cc65ffeb0684a97618b67c2164d95ea497226c.tar.gz WarpX-e9cc65ffeb0684a97618b67c2164d95ea497226c.tar.zst WarpX-e9cc65ffeb0684a97618b67c2164d95ea497226c.zip |
Partial refactoring of the utils directory (#3404)
* initial work to clean WarpX Utils
* remove AMRCore from Ionization tables
* progress
* refactoring of a part of the utils directory
* fix bug
* fixed bug
* fixed bug
* remove debug line accidentally slipped into the code
* remove debug line accidentally slipped into the code
* remove debug line accidentally slipped into the code
* cleaning
* fixed bug
Diffstat (limited to 'Source/FieldSolver')
5 files changed, 23 insertions, 22 deletions
diff --git a/Source/FieldSolver/ElectrostaticSolver.cpp b/Source/FieldSolver/ElectrostaticSolver.cpp index 3a16b8b70..64158d3a1 100644 --- a/Source/FieldSolver/ElectrostaticSolver.cpp +++ b/Source/FieldSolver/ElectrostaticSolver.cpp @@ -11,10 +11,10 @@ #include "Particles/MultiParticleContainer.H" #include "Particles/WarpXParticleContainer.H" #include "Python/WarpX_py.H" +#include "Utils/Parser/ParserUtils.H" #include "Utils/WarpXAlgorithmSelection.H" #include "Utils/WarpXConst.H" #include "Utils/TextMsg.H" -#include "Utils/WarpXUtil.H" #include "Utils/WarpXProfilerWrapper.H" #include <ablastr/fields/PoissonSolver.H> @@ -937,13 +937,13 @@ void ElectrostaticSolver::PoissonBoundaryHandler::definePhiBCs ( ) void ElectrostaticSolver::PoissonBoundaryHandler::buildParsers () { - potential_xlo_parser = makeParser(potential_xlo_str, {"t"}); - potential_xhi_parser = makeParser(potential_xhi_str, {"t"}); - potential_ylo_parser = makeParser(potential_ylo_str, {"t"}); - potential_yhi_parser = makeParser(potential_yhi_str, {"t"}); - potential_zlo_parser = makeParser(potential_zlo_str, {"t"}); - potential_zhi_parser = makeParser(potential_zhi_str, {"t"}); - potential_eb_parser = makeParser(potential_eb_str, {"x", "y", "z", "t"}); + potential_xlo_parser = utils::parser::makeParser(potential_xlo_str, {"t"}); + potential_xhi_parser = utils::parser::makeParser(potential_xhi_str, {"t"}); + potential_ylo_parser = utils::parser::makeParser(potential_ylo_str, {"t"}); + potential_yhi_parser = utils::parser::makeParser(potential_yhi_str, {"t"}); + potential_zlo_parser = utils::parser::makeParser(potential_zlo_str, {"t"}); + potential_zhi_parser = utils::parser::makeParser(potential_zhi_str, {"t"}); + potential_eb_parser = utils::parser::makeParser(potential_eb_str, {"x", "y", "z", "t"}); potential_xlo = potential_xlo_parser.compile<1>(); potential_xhi = potential_xhi_parser.compile<1>(); @@ -960,7 +960,7 @@ void ElectrostaticSolver::PoissonBoundaryHandler::buildParsers () phi_EB_only_t = false; } else { - potential_eb_parser = makeParser(potential_eb_str, {"t"}); + potential_eb_parser = utils::parser::makeParser(potential_eb_str, {"t"}); potential_eb_t = potential_eb_parser.compile<1>(); } } diff --git a/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/FieldAccessorFunctors.H b/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/FieldAccessorFunctors.H index 8b39296f9..58c0837a8 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/FieldAccessorFunctors.H +++ b/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/FieldAccessorFunctors.H @@ -10,7 +10,6 @@ #include "WarpX.H" #include "Utils/CoarsenIO.H" -#include "Utils/WarpXUtil.H" #include "FieldSolver/FiniteDifferenceSolver/MacroscopicProperties/MacroscopicProperties.H" #include <AMReX_Array.H> diff --git a/Source/FieldSolver/FiniteDifferenceSolver/MacroscopicEvolveE.cpp b/Source/FieldSolver/FiniteDifferenceSolver/MacroscopicEvolveE.cpp index 4b117aad3..7f0f99556 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/MacroscopicEvolveE.cpp +++ b/Source/FieldSolver/FiniteDifferenceSolver/MacroscopicEvolveE.cpp @@ -11,7 +11,6 @@ #include "Utils/CoarsenIO.H" #include "Utils/TextMsg.H" #include "Utils/WarpXAlgorithmSelection.H" -#include "Utils/WarpXUtil.H" #include "WarpX.H" #include <AMReX.H> diff --git a/Source/FieldSolver/FiniteDifferenceSolver/MacroscopicProperties/MacroscopicProperties.cpp b/Source/FieldSolver/FiniteDifferenceSolver/MacroscopicProperties/MacroscopicProperties.cpp index 438e237fb..0bd063beb 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/MacroscopicProperties/MacroscopicProperties.cpp +++ b/Source/FieldSolver/FiniteDifferenceSolver/MacroscopicProperties/MacroscopicProperties.cpp @@ -1,7 +1,7 @@ #include "MacroscopicProperties.H" +#include "Utils/Parser/ParserUtils.H" #include "Utils/TextMsg.H" -#include "Utils/WarpXUtil.H" #include "WarpX.H" #include <ablastr/warn_manager/WarnManager.H> @@ -43,7 +43,7 @@ MacroscopicProperties::ReadParameters () // Query input for material conductivity, sigma. bool sigma_specified = false; - if (queryWithParser(pp_macroscopic, "sigma", m_sigma)) { + if (utils::parser::queryWithParser(pp_macroscopic, "sigma", m_sigma)) { m_sigma_s = "constant"; sigma_specified = true; } @@ -60,13 +60,14 @@ MacroscopicProperties::ReadParameters () } // initialization of sigma (conductivity) with parser if (m_sigma_s == "parse_sigma_function") { - Store_parserString(pp_macroscopic, "sigma_function(x,y,z)", m_str_sigma_function); + utils::parser::Store_parserString( + pp_macroscopic, "sigma_function(x,y,z)", m_str_sigma_function); m_sigma_parser = std::make_unique<amrex::Parser>( - makeParser(m_str_sigma_function,{"x","y","z"})); + utils::parser::makeParser(m_str_sigma_function,{"x","y","z"})); } bool epsilon_specified = false; - if (queryWithParser(pp_macroscopic, "epsilon", m_epsilon)) { + if (utils::parser::queryWithParser(pp_macroscopic, "epsilon", m_epsilon)) { m_epsilon_s = "constant"; epsilon_specified = true; } @@ -84,14 +85,15 @@ MacroscopicProperties::ReadParameters () // initialization of epsilon (permittivity) with parser if (m_epsilon_s == "parse_epsilon_function") { - Store_parserString(pp_macroscopic, "epsilon_function(x,y,z)", m_str_epsilon_function); + utils::parser::Store_parserString( + pp_macroscopic, "epsilon_function(x,y,z)", m_str_epsilon_function); m_epsilon_parser = std::make_unique<amrex::Parser>( - makeParser(m_str_epsilon_function,{"x","y","z"})); + utils::parser::makeParser(m_str_epsilon_function,{"x","y","z"})); } // Query input for material permittivity, epsilon. bool mu_specified = false; - if (queryWithParser(pp_macroscopic, "mu", m_mu)) { + if (utils::parser::queryWithParser(pp_macroscopic, "mu", m_mu)) { m_mu_s = "constant"; mu_specified = true; } @@ -109,9 +111,10 @@ MacroscopicProperties::ReadParameters () // initialization of mu (permeability) with parser if (m_mu_s == "parse_mu_function") { - Store_parserString(pp_macroscopic, "mu_function(x,y,z)", m_str_mu_function); + utils::parser::Store_parserString( + pp_macroscopic, "mu_function(x,y,z)", m_str_mu_function); m_mu_parser = std::make_unique<amrex::Parser>( - makeParser(m_str_mu_function,{"x","y","z"})); + utils::parser::makeParser(m_str_mu_function,{"x","y","z"})); } } diff --git a/Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.cpp b/Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.cpp index 5a2f1d643..59d7fb70e 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.cpp +++ b/Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.cpp @@ -6,8 +6,8 @@ */ #include "SpectralFieldDataRZ.H" -#include "WarpX.H" #include "Utils/WarpXUtil.H" +#include "WarpX.H" #include <ablastr/warn_manager/WarnManager.H> |