diff options
author | 2018-08-10 17:31:25 -0700 | |
---|---|---|
committer | 2018-08-10 17:31:25 -0700 | |
commit | 3d1d1eabb87ae06dd4c96e9be1a4e04151d9098f (patch) | |
tree | 6d09779c79b3306577bdc5f89e7d7777449d6f60 /Source/WarpX.cpp | |
parent | 4a97495cc08c2ab1f07a3357c036c3380506b67c (diff) | |
parent | 3178c53b5a71b3daaedf4272f376bf48fad2bc35 (diff) | |
download | WarpX-3d1d1eabb87ae06dd4c96e9be1a4e04151d9098f.tar.gz WarpX-3d1d1eabb87ae06dd4c96e9be1a4e04151d9098f.tar.zst WarpX-3d1d1eabb87ae06dd4c96e9be1a4e04151d9098f.zip |
Merge branch 'master' of bitbucket.org:berkeleylab/warpx
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 d550212e5..227c0f439 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; @@ -216,29 +217,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); @@ -262,13 +241,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); |