From 3fde18912506bbfeeeaacc255f0c8a66ab2e2a05 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Fri, 11 Dec 2020 09:16:54 -0800 Subject: PSATD Runtime Control (#1300) * Docs: PSATD Runtime Option * Tests: PSATD Runtime Option Add new runtime option to PSATD regression test matrix. * PICMI: PSATD runtime option * Source: PSATD Runtime Option --- Source/Utils/WarpXAlgorithmSelection.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'Source/Utils/WarpXAlgorithmSelection.cpp') diff --git a/Source/Utils/WarpXAlgorithmSelection.cpp b/Source/Utils/WarpXAlgorithmSelection.cpp index de7944a7f..869f3b462 100644 --- a/Source/Utils/WarpXAlgorithmSelection.cpp +++ b/Source/Utils/WarpXAlgorithmSelection.cpp @@ -6,6 +6,7 @@ * * License: BSD-3-Clause-LBNL */ +#include "WarpX.H" #include "WarpXAlgorithmSelection.H" #include @@ -18,9 +19,8 @@ const std::map maxwell_solver_algo_to_int = { {"yee", MaxwellSolverAlgo::Yee }, -#ifndef WARPX_DIM_RZ // Not available in RZ {"ckc", MaxwellSolverAlgo::CKC }, -#endif + {"psatd", MaxwellSolverAlgo::PSATD }, {"default", MaxwellSolverAlgo::Yee } }; @@ -42,11 +42,7 @@ const std::map current_deposition_algo_to_int = { {"esirkepov", CurrentDepositionAlgo::Esirkepov }, {"direct", CurrentDepositionAlgo::Direct }, {"vay", CurrentDepositionAlgo::Vay }, -#ifdef WARPX_USE_PSATD - {"default", CurrentDepositionAlgo::Direct } -#else - {"default", CurrentDepositionAlgo::Esirkepov } -#endif + {"default", CurrentDepositionAlgo::Esirkepov } // NOTE: overwritten for PSATD below }; const std::map charge_deposition_algo_to_int = { @@ -97,6 +93,8 @@ GetAlgorithmInteger( amrex::ParmParse& pp, const char* pp_search_key ){ 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) + algo_to_int["default"] = CurrentDepositionAlgo::Direct; } else if (0 == std::strcmp(pp_search_key, "charge_deposition")) { algo_to_int = charge_deposition_algo_to_int; } else if (0 == std::strcmp(pp_search_key, "field_gathering")) { -- cgit v1.2.3