diff options
author | 2018-08-17 14:03:50 -0700 | |
---|---|---|
committer | 2018-08-17 14:03:50 -0700 | |
commit | d3e86a70d873c099267d075fe96903af912ab9db (patch) | |
tree | f5d900ba67866bc190fdaa339041919d773f2f18 /Source/WarpX.cpp | |
parent | 852daa5ee5531a87f8a69bcaa171e2610f3e67c2 (diff) | |
parent | 3d1d1eabb87ae06dd4c96e9be1a4e04151d9098f (diff) | |
download | WarpX-d3e86a70d873c099267d075fe96903af912ab9db.tar.gz WarpX-d3e86a70d873c099267d075fe96903af912ab9db.tar.zst WarpX-d3e86a70d873c099267d075fe96903af912ab9db.zip |
Merge branch 'master' into pml-2sc
Diffstat (limited to 'Source/WarpX.cpp')
-rw-r--r-- | Source/WarpX.cpp | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index 31f6bb73c..5a41e2054 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -16,6 +16,7 @@ #include <WarpX_f.H> #include <WarpXConst.H> #include <WarpXWrappers.h> +#include <WarpXUtil.H> using namespace amrex; @@ -25,7 +26,7 @@ int WarpX::do_moving_window = 0; Real WarpX::gamma_boost = 1.; Real WarpX::beta_boost = 0.; -Vector<Real> WarpX::boost_direction = {0,0,0}; +Vector<int> WarpX::boost_direction = {0,0,0}; long WarpX::current_deposition_algo = 3; long WarpX::charge_deposition_algo = 0; @@ -211,29 +212,7 @@ WarpX::ReadParameters () pp.query("verbose", verbose); pp.query("regrid_int", regrid_int); - // Boosted-frame parameters - pp.query("gamma_boost", gamma_boost); - beta_boost = std::sqrt(1.-1./pow(gamma_boost,2)); - if( gamma_boost > 1. ){ - // Read the boost direction - std::string s; - pp.get("boost_direction", s); - if (s == "x" || s == "X") { - boost_direction[0] = 1.; - } -#if (AMREX_SPACEDIM == 3) - else if (s == "y" || s == "Y") { - boost_direction[1] = 1.; - } -#endif - else if (s == "z" || s == "Z") { - boost_direction[2] = 1.; - } - else { - const std::string msg = "Unknown boost_dir: "+s; - amrex::Abort(msg.c_str()); - } - } + ReadBoostedFrameParameters(gamma_boost, beta_boost, boost_direction); pp.queryarr("B_external", B_external); @@ -257,13 +236,13 @@ WarpX::ReadParameters () const std::string msg = "Unknown moving_window_dir: "+s; amrex::Abort(msg.c_str()); } - + moving_window_x = geom[0].ProbLo(moving_window_dir); - + pp.get("moving_window_v", moving_window_v); moving_window_v *= PhysConst::c; } - + pp.query("do_plasma_injection", do_plasma_injection); if (do_plasma_injection) { pp.get("num_injected_species", num_injected_species); |