aboutsummaryrefslogtreecommitdiff
path: root/Source/WarpX.cpp
diff options
context:
space:
mode:
authorGravatar Remi Lehe <remi.lehe@normalesup.org> 2017-11-28 00:34:27 +0000
committerGravatar Andrew Myers <atmyers2@gmail.com> 2017-11-28 00:34:27 +0000
commit1aaf6025b3b4850e15ff830cf7904b6200558e2d (patch)
tree9556ccc455af1ca51b22ea3e435b28812873fb20 /Source/WarpX.cpp
parent07371917c9ae3ccc89957a3ef6b60bdc93f34ee5 (diff)
parent289e66d7cbc4082bd51b745e0b9a4dc950930e68 (diff)
downloadWarpX-1aaf6025b3b4850e15ff830cf7904b6200558e2d.tar.gz
WarpX-1aaf6025b3b4850e15ff830cf7904b6200558e2d.tar.zst
WarpX-1aaf6025b3b4850e15ff830cf7904b6200558e2d.zip
Merged in boosted_injection (pull request #44)
Generalize plasma injection, for boosted-frame simulations
Diffstat (limited to 'Source/WarpX.cpp')
-rw-r--r--Source/WarpX.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp
index a72c176b5..6a68c473e 100644
--- a/Source/WarpX.cpp
+++ b/Source/WarpX.cpp
@@ -236,6 +236,13 @@ WarpX::ReadParameters ()
injected_plasma_species.resize(num_injected_species);
pp.getarr("injected_plasma_species", injected_plasma_species,
0, num_injected_species);
+ if (moving_window_v >= 0){
+ // Inject particles continuously from the right end of the box
+ current_injection_position = geom[0].ProbHi(moving_window_dir);
+ } else {
+ // Inject particles continuously from the left end of the box
+ current_injection_position = geom[0].ProbLo(moving_window_dir);
+ }
}
pp.query("do_boosted_frame_diagnostic", do_boosted_frame_diagnostic);
@@ -457,11 +464,18 @@ WarpX::CellSize (int lev)
#endif
}
-std::array<Real,3>
-WarpX::LowerCorner(const Box& bx, int lev)
+amrex::RealBox
+WarpX::getRealBox(const Box& bx, int lev)
{
const auto& gm = GetInstance().Geom(lev);
const RealBox grid_box{bx, gm.CellSize(), gm.ProbLo()};
+ return( grid_box );
+}
+
+std::array<Real,3>
+WarpX::LowerCorner(const Box& bx, int lev)
+{
+ const RealBox grid_box = getRealBox( bx, lev );
const Real* xyzmin = grid_box.lo();
#if (BL_SPACEDIM == 3)
return { xyzmin[0], xyzmin[1], xyzmin[2] };
@@ -473,8 +487,7 @@ WarpX::LowerCorner(const Box& bx, int lev)
std::array<Real,3>
WarpX::UpperCorner(const Box& bx, int lev)
{
- const auto& gm = GetInstance().Geom(lev);
- const RealBox grid_box{bx, gm.CellSize(), gm.ProbLo()};
+ const RealBox grid_box = getRealBox( bx, lev );
const Real* xyzmax = grid_box.hi();
#if (BL_SPACEDIM == 3)
return { xyzmax[0], xyzmax[1], xyzmax[2] };