diff options
author | 2021-07-08 02:05:26 -0700 | |
---|---|---|
committer | 2021-07-08 02:05:26 -0700 | |
commit | 6269c20a6c42037c85efd76bfa9ed162a312df96 (patch) | |
tree | 0a12767ff0c56c598f6d684625981fec99f75db7 /Source/WarpX.cpp | |
parent | ecbe32dca65ace0faa092afaf75a3725c65a42e5 (diff) | |
download | WarpX-6269c20a6c42037c85efd76bfa9ed162a312df96.tar.gz WarpX-6269c20a6c42037c85efd76bfa9ed162a312df96.tar.zst WarpX-6269c20a6c42037c85efd76bfa9ed162a312df96.zip |
Do Not Fill Guard Cells with Inverse FFTs, Unless for Field Damping (#2045)
* Do Not Always Fill Guard Cells with Inverse FFTs
* Query psatd.fill_guards from Inputs
* Clean Up and Reduce Style Changes
* Fix Bug for Periodic Single Box
* Clean Up and Reduce Style Changes
* Fix Bug for RZ PSATD
* Remove Input Parameter, Default 0 Unless Damping
* Fix CI Tests (2D)
* Fix CI Tests (3D)
Diffstat (limited to 'Source/WarpX.cpp')
-rw-r--r-- | Source/WarpX.cpp | 15 |
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, |