From 6269c20a6c42037c85efd76bfa9ed162a312df96 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> Date: Thu, 8 Jul 2021 02:05:26 -0700 Subject: 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) --- .../SpectralAlgorithms/ComovingPsatdAlgorithm.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Source/FieldSolver/SpectralSolver/SpectralAlgorithms/ComovingPsatdAlgorithm.cpp') diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/ComovingPsatdAlgorithm.cpp b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/ComovingPsatdAlgorithm.cpp index 64920d325..d78ece8f5 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/ComovingPsatdAlgorithm.cpp +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/ComovingPsatdAlgorithm.cpp @@ -24,11 +24,12 @@ ComovingPsatdAlgorithm::ComovingPsatdAlgorithm (const SpectralKSpace& spectral_k const DistributionMapping& dm, const int norder_x, const int norder_y, const int norder_z, const bool nodal, + const amrex::IntVect& fill_guards, const amrex::Array& v_comoving, const amrex::Real dt, const bool update_with_rho) // Members initialization - : SpectralBaseAlgorithm(spectral_kspace, dm, norder_x, norder_y, norder_z, nodal), + : SpectralBaseAlgorithm(spectral_kspace, dm, norder_x, norder_y, norder_z, nodal, fill_guards), // Initialize the infinite-order k vectors (the argument n_order = -1 selects // the infinite order option, the argument nodal = false is then irrelevant) kx_vec(spectral_kspace.getModifiedKComponent(dm, 0, -1, false)), @@ -424,6 +425,8 @@ ComovingPsatdAlgorithm::CurrentCorrection (const int lev, field_data.ForwardTransform(lev, *rho, Idx::rho_old, 0); field_data.ForwardTransform(lev, *rho, Idx::rho_new, 1); + const amrex::IntVect& fill_guards = m_fill_guards; + // Loop over boxes for (amrex::MFIter mfi(field_data.fields); mfi.isValid(); ++mfi){ @@ -504,9 +507,9 @@ ComovingPsatdAlgorithm::CurrentCorrection (const int lev, } // Backward Fourier transform of J - field_data.BackwardTransform(lev, *current[0], Idx::Jx, 0); - field_data.BackwardTransform(lev, *current[1], Idx::Jy, 0); - field_data.BackwardTransform(lev, *current[2], Idx::Jz, 0); + field_data.BackwardTransform(lev, *current[0], Idx::Jx, 0, fill_guards); + field_data.BackwardTransform(lev, *current[1], Idx::Jy, 0, fill_guards); + field_data.BackwardTransform(lev, *current[2], Idx::Jz, 0, fill_guards); } void -- cgit v1.2.3