diff options
author | 2022-08-12 14:04:54 -0700 | |
---|---|---|
committer | 2022-08-12 14:04:54 -0700 | |
commit | 1ed58acbee55bfa93918e89d7dd618177fb314e8 (patch) | |
tree | cb4a0c7d3eed6780a1ec6a810e7c1a87c2181f5c /Source/FieldSolver/SpectralSolver/SpectralAlgorithms | |
parent | 7545b3c28acfa9d5ea8d3b8c600020a5bf4f3008 (diff) | |
download | WarpX-1ed58acbee55bfa93918e89d7dd618177fb314e8.tar.gz WarpX-1ed58acbee55bfa93918e89d7dd618177fb314e8.tar.zst WarpX-1ed58acbee55bfa93918e89d7dd618177fb314e8.zip |
Fill Guard Cells of Fields and Currents Independently (#3302)
* Fill Guard Cells of Fields and Currents Independently
* Fill Guard Cells of Averaged Fields as Regular Fields
Diffstat (limited to 'Source/FieldSolver/SpectralSolver/SpectralAlgorithms')
10 files changed, 9 insertions, 24 deletions
diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithm.H b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithm.H index 9139fa433..dd9c6a7fd 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithm.H +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithm.H @@ -38,7 +38,6 @@ class PsatdAlgorithm : public SpectralBaseAlgorithm * \param[in] norder_y order of the spectral solver along y * \param[in] norder_z order of the spectral solver along z * \param[in] nodal whether the E and B fields are defined on a fully nodal grid or a Yee grid - * \param[in] fill_guards Update the guard cells (in addition to the valid cells) when pushing the fields in time * \param[in] v_galilean Galilean velocity (three-dimensional array) * \param[in] dt time step of the simulation * \param[in] update_with_rho whether the update equation for E uses rho or not @@ -54,7 +53,6 @@ class PsatdAlgorithm : public SpectralBaseAlgorithm const int norder_y, const int norder_z, const bool nodal, - const amrex::IntVect& fill_guards, const amrex::Vector<amrex::Real>& v_galilean, const amrex::Real dt, const bool update_with_rho, diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithm.cpp b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithm.cpp index 6d9d684f5..1cbc27f0b 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithm.cpp +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithm.cpp @@ -35,7 +35,6 @@ PsatdAlgorithm::PsatdAlgorithm( const int norder_y, const int norder_z, const bool nodal, - const amrex::IntVect& fill_guards, const amrex::Vector<amrex::Real>& v_galilean, const amrex::Real dt, const bool update_with_rho, @@ -43,7 +42,7 @@ PsatdAlgorithm::PsatdAlgorithm( const bool dive_cleaning, const bool divb_cleaning) // Initializer list - : SpectralBaseAlgorithm(spectral_kspace, dm, spectral_index, norder_x, norder_y, norder_z, nodal, fill_guards), + : SpectralBaseAlgorithm(spectral_kspace, dm, spectral_index, norder_x, norder_y, norder_z, nodal), m_spectral_index(spectral_index), // Initialize the centered finite-order modified k vectors: // these are computed always with the assumption of centered grids diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.H b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.H index 6f8497f8f..bc7dc7699 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.H +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.H @@ -33,7 +33,6 @@ class PsatdAlgorithmComoving : public SpectralBaseAlgorithm const int norder_y, const int norder_z, const bool nodal, - const amrex::IntVect& fill_guards, const amrex::Vector<amrex::Real>& v_comoving, const amrex::Real dt, const bool update_with_rho); diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.cpp b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.cpp index 30a37345f..1d6248f8d 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.cpp +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.cpp @@ -26,12 +26,11 @@ PsatdAlgorithmComoving::PsatdAlgorithmComoving (const SpectralKSpace& spectral_k const SpectralFieldIndex& spectral_index, const int norder_x, const int norder_y, const int norder_z, const bool nodal, - const amrex::IntVect& fill_guards, const amrex::Vector<amrex::Real>& v_comoving, const amrex::Real dt, const bool update_with_rho) // Members initialization - : SpectralBaseAlgorithm(spectral_kspace, dm, spectral_index, norder_x, norder_y, norder_z, nodal, fill_guards), + : SpectralBaseAlgorithm(spectral_kspace, dm, spectral_index, norder_x, norder_y, norder_z, nodal), m_spectral_index(spectral_index), // Initialize the infinite-order k vectors (the argument n_order = -1 selects // the infinite order option, the argument nodal = false is then irrelevant) diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJLinearInTime.H b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJLinearInTime.H index 0689a7e49..e0eded5f5 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJLinearInTime.H +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJLinearInTime.H @@ -41,7 +41,6 @@ class PsatdAlgorithmJLinearInTime : public SpectralBaseAlgorithm * \param[in] norder_y order of the spectral solver along y * \param[in] norder_z order of the spectral solver along z * \param[in] nodal whether the E and B fields are defined on a fully nodal grid or a Yee grid - * \param[in] fill_guards Update the guard cells (in addition to the valid cells) when pushing the fields in time * \param[in] dt time step of the simulation * \param[in] time_averaging whether to use time averaging for large time steps * \param[in] dive_cleaning Update F as part of the field update, so that errors in divE=rho propagate away at the speed of light @@ -55,7 +54,6 @@ class PsatdAlgorithmJLinearInTime : public SpectralBaseAlgorithm const int norder_y, const int norder_z, const bool nodal, - const amrex::IntVect& fill_guards, const amrex::Real dt, const bool time_averaging, const bool dive_cleaning, diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJLinearInTime.cpp b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJLinearInTime.cpp index 30cc90549..bd9df977e 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJLinearInTime.cpp +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJLinearInTime.cpp @@ -35,13 +35,12 @@ PsatdAlgorithmJLinearInTime::PsatdAlgorithmJLinearInTime( const int norder_y, const int norder_z, const bool nodal, - const amrex::IntVect& fill_guards, const amrex::Real dt, const bool time_averaging, const bool dive_cleaning, const bool divb_cleaning) // Initializer list - : SpectralBaseAlgorithm(spectral_kspace, dm, spectral_index, norder_x, norder_y, norder_z, nodal, fill_guards), + : SpectralBaseAlgorithm(spectral_kspace, dm, spectral_index, norder_x, norder_y, norder_z, nodal), m_spectral_index(spectral_index), m_dt(dt), m_time_averaging(time_averaging), diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPml.H b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPml.H index 630c26260..0c1aeb885 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPml.H +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPml.H @@ -32,7 +32,6 @@ class PsatdAlgorithmPml : public SpectralBaseAlgorithm const SpectralFieldIndex& spectral_index, const int norder_x, const int norder_y, const int norder_z, const bool nodal, - const amrex::IntVect& fill_guards, const amrex::Real dt, const bool dive_cleaning, const bool divb_cleaning); diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPml.cpp b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPml.cpp index 69d8dc401..45a4d1580 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPml.cpp +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPml.cpp @@ -35,10 +35,10 @@ PsatdAlgorithmPml::PsatdAlgorithmPml(const SpectralKSpace& spectral_kspace, const SpectralFieldIndex& spectral_index, const int norder_x, const int norder_y, const int norder_z, const bool nodal, - const amrex::IntVect& fill_guards, const Real dt, + const Real dt, const bool dive_cleaning, const bool divb_cleaning) // Initialize members of base class - : SpectralBaseAlgorithm(spectral_kspace, dm, spectral_index, norder_x, norder_y, norder_z, nodal, fill_guards), + : SpectralBaseAlgorithm(spectral_kspace, dm, spectral_index, norder_x, norder_y, norder_z, nodal), m_spectral_index(spectral_index), m_dt(dt), m_dive_cleaning(dive_cleaning), diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.H b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.H index b4f70d5f5..ef08c4432 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.H +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.H @@ -71,8 +71,6 @@ class SpectralBaseAlgorithm protected: // Meant to be used in the subclasses - amrex::IntVect m_fill_guards; - using SpectralRealCoefficients = \ amrex::FabArray< amrex::BaseFab <amrex::Real> >; using SpectralComplexCoefficients = \ @@ -85,8 +83,7 @@ class SpectralBaseAlgorithm const amrex::DistributionMapping& dm, const SpectralFieldIndex& spectral_index, const int norder_x, const int norder_y, - const int norder_z, const bool nodal, - const amrex::IntVect& fill_guards); + const int norder_z, const bool nodal); SpectralFieldIndex m_spectral_index; diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.cpp b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.cpp index 4ecbb9000..1a2334cc6 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.cpp +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.cpp @@ -31,9 +31,7 @@ SpectralBaseAlgorithm::SpectralBaseAlgorithm(const SpectralKSpace& spectral_kspa const amrex::DistributionMapping& dm, const SpectralFieldIndex& spectral_index, const int norder_x, const int norder_y, - const int norder_z, const bool nodal, - const amrex::IntVect& fill_guards): - m_fill_guards(fill_guards), + const int norder_z, const bool nodal): m_spectral_index(spectral_index), // Compute and assign the modified k vectors modified_kx_vec(spectral_kspace.getModifiedKComponent(dm,0,norder_x,nodal)), @@ -66,8 +64,6 @@ SpectralBaseAlgorithm::ComputeSpectralDivE ( field_data.ForwardTransform(lev, *Efield[1], Idx.Ey, 0 ); field_data.ForwardTransform(lev, *Efield[2], Idx.Ez, 0 ); - const amrex::IntVect& fill_guards = m_fill_guards; - // Loop over boxes for (MFIter mfi(field_data.fields); mfi.isValid(); ++mfi){ @@ -107,5 +103,6 @@ SpectralBaseAlgorithm::ComputeSpectralDivE ( } // Backward Fourier transform - field_data.BackwardTransform(lev, divE, Idx.divE, 0, fill_guards); + const amrex::IntVect& fill_guards = amrex::IntVect(0); + field_data.BackwardTransform(lev, divE, Idx.divE, fill_guards, 0); } |