diff options
author | 2018-08-06 17:06:46 -0700 | |
---|---|---|
committer | 2018-08-06 17:06:46 -0700 | |
commit | bad81f0916c37c8b956b22e8ed141d020c28459d (patch) | |
tree | c7767f23bd56b13bab5dd3c2d67987d2834ff36a /Source/WarpX.cpp | |
parent | e4a5472f0315f2871e81e18f9bb24acb017ff28a (diff) | |
download | WarpX-bad81f0916c37c8b956b22e8ed141d020c28459d.tar.gz WarpX-bad81f0916c37c8b956b22e8ed141d020c28459d.tar.zst WarpX-bad81f0916c37c8b956b22e8ed141d020c28459d.zip |
Allow the user to set prob_lo and prob_hi in the lab frame
Diffstat (limited to 'Source/WarpX.cpp')
-rw-r--r-- | Source/WarpX.cpp | 45 |
1 files changed, 18 insertions, 27 deletions
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index d550212e5..19bc1b5da 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; @@ -212,33 +213,23 @@ WarpX::ReadParameters () { ParmParse pp("warpx"); + for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) + { + amrex::Print() << geom[0].ProbLo(idim) << " "; + } + amrex::Print() << std::endl; + + for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) + { + amrex::Print() << geom[0].ProbHi(idim) << " "; + } + amrex::Print() << std::endl; + pp.query("cfl", cfl); 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 +253,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); |