diff options
-rw-r--r-- | Source/WarpX.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index c9dfe2980..9b428ea43 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -397,15 +397,20 @@ WarpX::ReadParameters () pp.query("charge_deposition", charge_deposition_algo); pp.query("field_gathering", field_gathering_algo); pp.query("particle_pusher", particle_pusher_algo); - std::string s_solver; - pp.get("maxwell_fdtd_solver", s_solver); - if (s_solver == "yee") { - maxwell_fdtd_solver_id = 0; - } else if (s_solver == "ckc") { - maxwell_fdtd_solver_id = 1; - } else { - amrex::Abort("Unknown FDTD Solver type " + s_solver); - } + std::string s_solver = ""; + pp.query("maxwell_fdtd_solver", s_solver); + // if maxwell_fdtd_solver is specified, set the value + // of maxwell_fdtd_solver_id accordingly. + // Otherwise keep the default value maxwell_fdtd_solver_id=0 + if (s_solver != "") { + if (s_solver == "yee") { + maxwell_fdtd_solver_id = 0; + } else if (s_solver == "ckc") { + maxwell_fdtd_solver_id = 1; + } else { + amrex::Abort("Unknown FDTD Solver type " + s_solver); + } + } } #ifdef WARPX_USE_PSATD |