aboutsummaryrefslogtreecommitdiff
path: root/Source/WarpX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WarpX.cpp')
-rw-r--r--Source/WarpX.cpp40
1 files changed, 27 insertions, 13 deletions
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp
index 5a51d7d13..d94541f17 100644
--- a/Source/WarpX.cpp
+++ b/Source/WarpX.cpp
@@ -25,6 +25,7 @@
using namespace amrex;
Vector<Real> WarpX::B_external(3, 0.0);
+Vector<Real> WarpX::E_external(3, 0.0);
int WarpX::do_moving_window = 0;
int WarpX::moving_window_dir = -1;
@@ -67,6 +68,9 @@ Real WarpX::dt_snapshots_lab = std::numeric_limits<Real>::lowest();
bool WarpX::do_boosted_frame_fields = true;
bool WarpX::do_boosted_frame_particles = true;
+int WarpX::num_slice_snapshots_lab = 0;
+Real WarpX::dt_slice_snapshots_lab;
+
bool WarpX::do_dynamic_scheduling = true;
int WarpX::do_subcycling = 0;
@@ -76,9 +80,9 @@ IntVect WarpX::Bx_nodal_flag(1,0,0);
IntVect WarpX::By_nodal_flag(0,1,0);
IntVect WarpX::Bz_nodal_flag(0,0,1);
#elif (AMREX_SPACEDIM == 2)
-IntVect WarpX::Bx_nodal_flag(1,0); // x is the first dimension to AMReX
-IntVect WarpX::By_nodal_flag(0,0); // y is the missing dimension to 2D AMReX
-IntVect WarpX::Bz_nodal_flag(0,1); // z is the second dimension to 2D AMReX
+IntVect WarpX::Bx_nodal_flag(1,0);// x is the first dimension to AMReX
+IntVect WarpX::By_nodal_flag(0,0);// y is the missing dimension to 2D AMReX
+IntVect WarpX::Bz_nodal_flag(0,1);// z is the second dimension to 2D AMReX
#endif
#if (AMREX_SPACEDIM == 3)
@@ -86,9 +90,9 @@ IntVect WarpX::Ex_nodal_flag(0,1,1);
IntVect WarpX::Ey_nodal_flag(1,0,1);
IntVect WarpX::Ez_nodal_flag(1,1,0);
#elif (AMREX_SPACEDIM == 2)
-IntVect WarpX::Ex_nodal_flag(0,1); // x is the first dimension to AMReX
-IntVect WarpX::Ey_nodal_flag(1,1); // y is the missing dimension to 2D AMReX
-IntVect WarpX::Ez_nodal_flag(1,0); // z is the second dimension to 2D AMReX
+IntVect WarpX::Ex_nodal_flag(0,1);// x is the first dimension to AMReX
+IntVect WarpX::Ey_nodal_flag(1,1);// y is the missing dimension to 2D AMReX
+IntVect WarpX::Ez_nodal_flag(1,0);// z is the second dimension to 2D AMReX
#endif
#if (AMREX_SPACEDIM == 3)
@@ -96,9 +100,9 @@ IntVect WarpX::jx_nodal_flag(0,1,1);
IntVect WarpX::jy_nodal_flag(1,0,1);
IntVect WarpX::jz_nodal_flag(1,1,0);
#elif (AMREX_SPACEDIM == 2)
-IntVect WarpX::jx_nodal_flag(0,1); // x is the first dimension to AMReX
-IntVect WarpX::jy_nodal_flag(1,1); // y is the missing dimension to 2D AMReX
-IntVect WarpX::jz_nodal_flag(1,0); // z is the second dimension to 2D AMReX
+IntVect WarpX::jx_nodal_flag(0,1);// x is the first dimension to AMReX
+IntVect WarpX::jy_nodal_flag(1,1);// y is the missing dimension to 2D AMReX
+IntVect WarpX::jz_nodal_flag(1,0);// z is the second dimension to 2D AMReX
#endif
IntVect WarpX::filter_npass_each_dir(1);
@@ -253,13 +257,13 @@ void
WarpX::ReadParameters ()
{
{
- ParmParse pp; // Traditionally, max_step and stop_time do not have prefix.
+ ParmParse pp;// Traditionally, max_step and stop_time do not have prefix.
pp.query("max_step", max_step);
pp.query("stop_time", stop_time);
}
{
- ParmParse pp("amr"); // Traditionally, these have prefix, amr.
+ ParmParse pp("amr");// Traditionally, these have prefix, amr.
pp.query("check_file", check_file);
pp.query("check_int", check_int);
@@ -291,6 +295,7 @@ WarpX::ReadParameters ()
zmax_plasma_to_compute_max_step);
pp.queryarr("B_external", B_external);
+ pp.queryarr("E_external", E_external);
pp.query("do_moving_window", do_moving_window);
if (do_moving_window)
@@ -591,6 +596,15 @@ WarpX::ReadParameters ()
}
}
+ if (do_boosted_frame_diagnostic) {
+ AMREX_ALWAYS_ASSERT_WITH_MESSAGE(gamma_boost > 1.0,
+ "gamma_boost must be > 1 to use the boost frame diagnostic");
+ pp.query("num_slice_snapshots_lab", num_slice_snapshots_lab);
+ if (num_slice_snapshots_lab > 0) {
+ pp.get("dt_slice_snapshots_lab", dt_slice_snapshots_lab );
+ }
+ }
+
}
}
@@ -915,8 +929,8 @@ WarpX::AllocLevelMFs (int lev, const BoxArray& ba, const DistributionMapping& dm
RealVect cdx_vect(cdx[0], cdx[2]);
#endif
// Get the cell-centered box, with guard cells
- BoxArray realspace_ba = cba; // Copy box
- realspace_ba.enclosedCells().grow(ngE); // cell-centered + guard cells
+ BoxArray realspace_ba = cba;// Copy box
+ realspace_ba.enclosedCells().grow(ngE);// cell-centered + guard cells
// Define spectral solver
spectral_solver_cp[lev].reset( new SpectralSolver( realspace_ba, dm,
nox_fft, noy_fft, noz_fft, do_nodal, cdx_vect, dt[lev] ) );