aboutsummaryrefslogtreecommitdiff
path: root/Source/WarpX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WarpX.cpp')
-rw-r--r--Source/WarpX.cpp33
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);