aboutsummaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorGravatar Maxence Thévenet <mthevenet@lbl.gov> 2018-07-14 11:41:02 -0700
committerGravatar Maxence Thévenet <mthevenet@lbl.gov> 2018-07-14 11:41:02 -0700
commitd75e586fd23dd1ecfd0f02fe689dcbb05f3808ef (patch)
treed71c44bc513b16e792566d4009adac61cc734855 /Source
parent1b1338bb6ae871aa02bd073ccf394234b757922c (diff)
downloadWarpX-d75e586fd23dd1ecfd0f02fe689dcbb05f3808ef.tar.gz
WarpX-d75e586fd23dd1ecfd0f02fe689dcbb05f3808ef.tar.zst
WarpX-d75e586fd23dd1ecfd0f02fe689dcbb05f3808ef.zip
make maxwell_fdtd_solver an optional parameter. Default is yee
Diffstat (limited to 'Source')
-rw-r--r--Source/WarpX.cpp23
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