From bf535730cb6c170394da8375887b3ae57ad6ecf5 Mon Sep 17 00:00:00 2001 From: Roelof Groenewald <40245517+roelof-groenewald@users.noreply.github.com> Date: Mon, 7 Nov 2022 20:30:31 -0800 Subject: Allow `None` for Maxwell solver (#3504) * Add "None" as an option for the Maxwell solver * fixed some of the reasons for failing CI tests * no longer pass `do_electrostatic` to `GuardCellManager` * renamed `MaxwellSolverAlgo` to `ElectromagneticSolverAlgo` * rename `do_electrostatic` to `electrostatic_solver_id` * rename `maxwell_solver_id` to `electromagnetic_solver_id` * changes requested during PR review * remove `do_no_deposit` from tests without field evolution * Fix doc-string in `GuardCellManager.H` Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> --- Source/Utils/WarpXAlgorithmSelection.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'Source/Utils/WarpXAlgorithmSelection.cpp') diff --git a/Source/Utils/WarpXAlgorithmSelection.cpp b/Source/Utils/WarpXAlgorithmSelection.cpp index 1272c146a..b99459b46 100644 --- a/Source/Utils/WarpXAlgorithmSelection.cpp +++ b/Source/Utils/WarpXAlgorithmSelection.cpp @@ -22,12 +22,13 @@ // Define dictionary with correspondance between user-input strings, // and corresponding integer for use inside the code -const std::map maxwell_solver_algo_to_int = { - {"yee", MaxwellSolverAlgo::Yee }, - {"ckc", MaxwellSolverAlgo::CKC }, - {"psatd", MaxwellSolverAlgo::PSATD }, - {"ect", MaxwellSolverAlgo::ECT }, - {"default", MaxwellSolverAlgo::Yee } +const std::map electromagnetic_solver_algo_to_int = { + {"none", ElectromagneticSolverAlgo::None }, + {"yee", ElectromagneticSolverAlgo::Yee }, + {"ckc", ElectromagneticSolverAlgo::CKC }, + {"psatd", ElectromagneticSolverAlgo::PSATD }, + {"ect", ElectromagneticSolverAlgo::ECT }, + {"default", ElectromagneticSolverAlgo::Yee } }; const std::map electrostatic_solver_algo_to_int = { @@ -131,14 +132,14 @@ GetAlgorithmInteger( amrex::ParmParse& pp, const char* pp_search_key ){ // Pick the right dictionary std::map algo_to_int; if (0 == std::strcmp(pp_search_key, "maxwell_solver")) { - algo_to_int = maxwell_solver_algo_to_int; + algo_to_int = electromagnetic_solver_algo_to_int; } else if (0 == std::strcmp(pp_search_key, "do_electrostatic")) { algo_to_int = electrostatic_solver_algo_to_int; } else if (0 == std::strcmp(pp_search_key, "particle_pusher")) { algo_to_int = particle_pusher_algo_to_int; } else if (0 == std::strcmp(pp_search_key, "current_deposition")) { algo_to_int = current_deposition_algo_to_int; - if (WarpX::maxwell_solver_id == MaxwellSolverAlgo::PSATD) + if (WarpX::electromagnetic_solver_id == ElectromagneticSolverAlgo::PSATD) algo_to_int["default"] = CurrentDepositionAlgo::Direct; } else if (0 == std::strcmp(pp_search_key, "charge_deposition")) { algo_to_int = charge_deposition_algo_to_int; -- cgit v1.2.3