aboutsummaryrefslogtreecommitdiff
path: root/Source/WarpX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WarpX.cpp')
-rw-r--r--Source/WarpX.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp
index 0745b0941..3c5604a8b 100644
--- a/Source/WarpX.cpp
+++ b/Source/WarpX.cpp
@@ -99,6 +99,8 @@ Real WarpX::moving_window_v = std::numeric_limits<amrex::Real>::max();
bool WarpX::fft_do_time_averaging = false;
+amrex::IntVect WarpX::fill_guards = amrex::IntVect(0);
+
Real WarpX::quantum_xi_c2 = PhysConst::xi_c2;
Real WarpX::gamma_boost = 1._rt;
Real WarpX::beta_boost = 0._rt;
@@ -1089,6 +1091,18 @@ WarpX::ReadParameters ()
"field boundary in both lo and hi must be set to Damped for PSATD"
);
}
+
+ // Whether to fill the guard cells with inverse FFTs:
+ // WarpX::fill_guards = amrex::IntVect(0) by default,
+ // except for non-periodic directions with damping.
+ for (int dir = 0; dir < AMREX_SPACEDIM; dir++)
+ {
+ if (WarpX::field_boundary_lo[dir] == FieldBoundaryType::Damped ||
+ WarpX::field_boundary_hi[dir] == FieldBoundaryType::Damped)
+ {
+ WarpX::fill_guards[dir] = 1;
+ }
+ }
}
if (maxwell_solver_id != MaxwellSolverAlgo::PSATD ) {
@@ -1846,6 +1860,7 @@ void WarpX::AllocLevelSpectralSolver (amrex::Vector<std::unique_ptr<SpectralSolv
noy_fft,
noz_fft,
do_nodal,
+ WarpX::fill_guards,
m_v_galilean,
m_v_comoving,
dx_vect,