diff options
Diffstat (limited to 'Source/WarpX.cpp')
-rw-r--r-- | Source/WarpX.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index a844e7aa0..116600c8b 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -103,7 +103,7 @@ IntVect WarpX::jz_nodal_flag(1,0); // z is the second dimension to 2D AMReX IntVect WarpX::filter_npass_each_dir(1); -int WarpX::n_field_gather_buffer = 0; +int WarpX::n_field_gather_buffer = -1; int WarpX::n_current_deposition_buffer = -1; int WarpX::do_nodal = false; @@ -149,8 +149,8 @@ WarpX::WarpX () #endif t_new.resize(nlevs_max, 0.0); - t_old.resize(nlevs_max, -1.e100); - dt.resize(nlevs_max, 1.e100); + t_old.resize(nlevs_max, std::numeric_limits<Real>::lowest()); + dt.resize(nlevs_max, std::numeric_limits<Real>::max()); // Particle Container mypc = std::unique_ptr<MultiParticleContainer> (new MultiParticleContainer(this)); @@ -730,11 +730,19 @@ WarpX::AllocLevelData (int lev, const BoxArray& ba, const DistributionMapping& d if (mypc->nSpeciesDepositOnMainGrid() && n_current_deposition_buffer == 0) { n_current_deposition_buffer = 1; + // This forces the allocation of buffers and allows the code associated + // with buffers to run. But the buffer size of `1` is in fact not used, + // `deposit_on_main_grid` forces all particles (whether or not they + // are in buffers) to deposition on the main grid. } if (n_current_deposition_buffer < 0) { n_current_deposition_buffer = ngJ.max(); } + if (n_field_gather_buffer < 0) { + // Field gather buffer should be larger than current deposition buffers + n_field_gather_buffer = n_current_deposition_buffer + 1; + } int ngF = (do_moving_window) ? 2 : 0; // CKC solver requires one additional guard cell @@ -988,7 +996,7 @@ WarpX::LowerCorner(const Box& bx, int lev) #if (AMREX_SPACEDIM == 3) return { xyzmin[0], xyzmin[1], xyzmin[2] }; #elif (AMREX_SPACEDIM == 2) - return { xyzmin[0], -1.e100, xyzmin[1] }; + return { xyzmin[0], std::numeric_limits<Real>::lowest(), xyzmin[1] }; #endif } @@ -1000,7 +1008,7 @@ WarpX::UpperCorner(const Box& bx, int lev) #if (AMREX_SPACEDIM == 3) return { xyzmax[0], xyzmax[1], xyzmax[2] }; #elif (AMREX_SPACEDIM == 2) - return { xyzmax[0], 1.e100, xyzmax[1] }; + return { xyzmax[0], std::numeric_limits<Real>::max(), xyzmax[1] }; #endif } |