aboutsummaryrefslogtreecommitdiff
path: root/Source/FieldSolver/SpectralSolver
diff options
context:
space:
mode:
Diffstat (limited to 'Source/FieldSolver/SpectralSolver')
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithm.H2
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithm.cpp3
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.H1
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.cpp3
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJLinearInTime.H2
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJLinearInTime.cpp3
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPml.H1
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPml.cpp4
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.H5
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.cpp9
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralFieldData.H2
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp4
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralSolver.H3
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralSolver.cpp14
14 files changed, 19 insertions, 37 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);
}
diff --git a/Source/FieldSolver/SpectralSolver/SpectralFieldData.H b/Source/FieldSolver/SpectralSolver/SpectralFieldData.H
index fe856c236..811fdd4d7 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralFieldData.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralFieldData.H
@@ -127,7 +127,7 @@ class SpectralFieldData
const int i_comp);
void BackwardTransform (const int lev, amrex::MultiFab& mf, const int field_index,
- const int i_comp, const amrex::IntVect& fill_guards);
+ const amrex::IntVect& fill_guards, const int i_comp);
// `fields` stores fields in spectral space, as multicomponent FabArray
SpectralField fields;
diff --git a/Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp b/Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp
index 460e2cc3b..00346a2c7 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp
+++ b/Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp
@@ -310,8 +310,8 @@ void
SpectralFieldData::BackwardTransform (const int lev,
MultiFab& mf,
const int field_index,
- const int i_comp,
- const amrex::IntVect& fill_guards)
+ const amrex::IntVect& fill_guards,
+ const int i_comp)
{
amrex::LayoutData<amrex::Real>* cost = WarpX::getCosts(lev);
bool do_costs = WarpXUtilLoadBalance::doCosts(cost, mf.boxArray(), mf.DistributionMap());
diff --git a/Source/FieldSolver/SpectralSolver/SpectralSolver.H b/Source/FieldSolver/SpectralSolver/SpectralSolver.H
index df9e9f0ff..684cf9586 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralSolver.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralSolver.H
@@ -47,7 +47,6 @@ class SpectralSolver
* \param[in] norder_y spectral order along y
* \param[in] norder_z spectral order along z
* \param[in] nodal whether the spectral solver is applied to a nodal or staggered 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 three-dimensional vector containing the components of the Galilean
* velocity for the standard or averaged Galilean PSATD solvers
* \param[in] v_comoving three-dimensional vector containing the components of the comoving
@@ -72,7 +71,6 @@ class SpectralSolver
const amrex::DistributionMapping& dm,
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_galilean,
const amrex::Vector<amrex::Real>& v_comoving,
const amrex::RealVect dx,
@@ -106,6 +104,7 @@ class SpectralSolver
void BackwardTransform( const int lev,
amrex::MultiFab& mf,
const int field_index,
+ const amrex::IntVect& fill_guards,
const int i_comp=0 );
/**
diff --git a/Source/FieldSolver/SpectralSolver/SpectralSolver.cpp b/Source/FieldSolver/SpectralSolver/SpectralSolver.cpp
index 81cba183c..75c82319c 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralSolver.cpp
+++ b/Source/FieldSolver/SpectralSolver/SpectralSolver.cpp
@@ -24,7 +24,6 @@ SpectralSolver::SpectralSolver(
const amrex::DistributionMapping& dm,
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_galilean,
const amrex::Vector<amrex::Real>& v_comoving,
const amrex::RealVect dx, const amrex::Real dt,
@@ -52,7 +51,7 @@ SpectralSolver::SpectralSolver(
{
algorithm = std::make_unique<PsatdAlgorithmPml>(
k_space, dm, m_spectral_index, norder_x, norder_y, norder_z, nodal,
- fill_guards, dt, dive_cleaning, divb_cleaning);
+ dt, dive_cleaning, divb_cleaning);
}
else // PSATD equations in the regulard grids
{
@@ -61,7 +60,7 @@ SpectralSolver::SpectralSolver(
{
algorithm = std::make_unique<PsatdAlgorithmComoving>(
k_space, dm, m_spectral_index, norder_x, norder_y, norder_z, nodal,
- fill_guards, v_comoving, dt, update_with_rho);
+ v_comoving, dt, update_with_rho);
}
else // PSATD algorithms: standard, Galilean, averaged Galilean, multi-J
{
@@ -69,13 +68,13 @@ SpectralSolver::SpectralSolver(
{
algorithm = std::make_unique<PsatdAlgorithmJLinearInTime>(
k_space, dm, m_spectral_index, norder_x, norder_y, norder_z, nodal,
- fill_guards, dt, fft_do_time_averaging, dive_cleaning, divb_cleaning);
+ dt, fft_do_time_averaging, dive_cleaning, divb_cleaning);
}
else // standard, Galilean, averaged Galilean
{
algorithm = std::make_unique<PsatdAlgorithm>(
k_space, dm, m_spectral_index, norder_x, norder_y, norder_z, nodal,
- fill_guards, v_galilean, dt, update_with_rho, fft_do_time_averaging,
+ v_galilean, dt, update_with_rho, fft_do_time_averaging,
dive_cleaning, divb_cleaning);
}
}
@@ -84,8 +83,6 @@ SpectralSolver::SpectralSolver(
// - Initialize arrays for fields in spectral space + FFT plans
field_data = SpectralFieldData(lev, realspace_ba, k_space, dm,
m_spectral_index.n_fields, periodic_single_box);
-
- m_fill_guards = fill_guards;
}
void
@@ -102,10 +99,11 @@ void
SpectralSolver::BackwardTransform( const int lev,
amrex::MultiFab& mf,
const int field_index,
+ const amrex::IntVect& fill_guards,
const int i_comp )
{
WARPX_PROFILE("SpectralSolver::BackwardTransform");
- field_data.BackwardTransform(lev, mf, field_index, i_comp, m_fill_guards);
+ field_data.BackwardTransform(lev, mf, field_index, fill_guards, i_comp);
}
void