diff options
author | 2019-10-21 12:39:42 -0700 | |
---|---|---|
committer | 2019-10-21 12:39:42 -0700 | |
commit | 366f46aa9a4b9ea56f0846795aa3900b99791923 (patch) | |
tree | 87b66011a2f359e8aa9859b99efe663b1ee5b9f4 /Source/WarpX.cpp | |
parent | 80f2d85117bf99c256d416a3a21fb4618e82fe8b (diff) | |
parent | f6a98e00fd77064ce4a1ff05f5aca77fa6ed6c66 (diff) | |
download | WarpX-366f46aa9a4b9ea56f0846795aa3900b99791923.tar.gz WarpX-366f46aa9a4b9ea56f0846795aa3900b99791923.tar.zst WarpX-366f46aa9a4b9ea56f0846795aa3900b99791923.zip |
Merge pull request #197 from RevathiJambunathan/SliceInLabFrameForBoostedSim
Slice in lab frame for boosted sim
Diffstat (limited to 'Source/WarpX.cpp')
-rw-r--r-- | Source/WarpX.cpp | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index 14d0e7a2e..d94541f17 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -68,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; @@ -77,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) @@ -87,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) @@ -97,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); @@ -254,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); @@ -593,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 ); + } + } + } } @@ -917,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] ) ); |