aboutsummaryrefslogtreecommitdiff
path: root/Source/FieldSolver/SpectralSolver
diff options
context:
space:
mode:
Diffstat (limited to 'Source/FieldSolver/SpectralSolver')
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralFieldData.H8
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp12
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralSolver.H39
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralSolver.cpp7
4 files changed, 11 insertions, 55 deletions
diff --git a/Source/FieldSolver/SpectralSolver/SpectralFieldData.H b/Source/FieldSolver/SpectralSolver/SpectralFieldData.H
index 4f0ad1c20..fe856c236 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralFieldData.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralFieldData.H
@@ -124,13 +124,7 @@ class SpectralFieldData
void ForwardTransform (const int lev,
const amrex::MultiFab& mf, const int field_index,
- const int i_comp, const amrex::IntVect& stag);
- AMREX_FORCE_INLINE
- void ForwardTransform (const int lev,
- const amrex::MultiFab& mf, const int field_index, const int i_comp)
- {
- ForwardTransform(lev, mf, field_index, i_comp, mf.ixType().toIntVect());
- }
+ 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);
diff --git a/Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp b/Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp
index 3926df286..460e2cc3b 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp
+++ b/Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp
@@ -204,22 +204,22 @@ SpectralFieldData::~SpectralFieldData()
void
SpectralFieldData::ForwardTransform (const int lev,
const MultiFab& mf, const int field_index,
- const int i_comp, const IntVect& stag)
+ const int i_comp)
{
amrex::LayoutData<amrex::Real>* cost = WarpX::getCosts(lev);
bool do_costs = WarpXUtilLoadBalance::doCosts(cost, mf.boxArray(), mf.DistributionMap());
// Check field index type, in order to apply proper shift in spectral space
#if (AMREX_SPACEDIM >= 2)
- const bool is_nodal_x = (stag[0] == amrex::IndexType::NODE) ? true : false;
+ const bool is_nodal_x = mf.is_nodal(0);
#endif
#if defined(WARPX_DIM_3D)
- const bool is_nodal_y = (stag[1] == amrex::IndexType::NODE) ? true : false;
- const bool is_nodal_z = (stag[2] == amrex::IndexType::NODE) ? true : false;
+ const bool is_nodal_y = mf.is_nodal(1);
+ const bool is_nodal_z = mf.is_nodal(2);
#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
- const bool is_nodal_z = (stag[1] == amrex::IndexType::NODE) ? true : false;
+ const bool is_nodal_z = mf.is_nodal(1);
#elif defined(WARPX_DIM_1D_Z)
- const bool is_nodal_z = (stag[0] == amrex::IndexType::NODE) ? true : false;
+ const bool is_nodal_z = mf.is_nodal(0);
#endif
// Loop over boxes
diff --git a/Source/FieldSolver/SpectralSolver/SpectralSolver.H b/Source/FieldSolver/SpectralSolver/SpectralSolver.H
index 47ad47150..df9e9f0ff 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralSolver.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralSolver.H
@@ -93,48 +93,11 @@ class SpectralSolver
* \param[in] mf MultiFab that is transformed to Fourier space (component i_comp)
* \param[in] field_index index of the spectral field that stores the FFT result
* \param[in] i_comp component of the MultiFab mf that is transformed to Fourier space
- * \param[in] stag index type that needs to be used to perform the FFT operation
*/
void ForwardTransform (const int lev,
const amrex::MultiFab& mf,
const int field_index,
- const int i_comp,
- const amrex::IntVect& stag);
-
- /**
- * \brief Overload of ForwardTransform used if stag is not passed
- */
- AMREX_FORCE_INLINE
- void ForwardTransform (const int lev,
- const amrex::MultiFab& mf,
- const int field_index,
- const int i_comp)
- {
- ForwardTransform(lev, mf, field_index, i_comp, mf.ixType().toIntVect());
- }
-
- /**
- * \brief Overload of ForwardTransform used if i_comp is not passed
- */
- AMREX_FORCE_INLINE
- void ForwardTransform (const int lev,
- const amrex::MultiFab& mf,
- const int field_index,
- const amrex::IntVect& stag)
- {
- ForwardTransform(lev, mf, field_index, 0, stag);
- }
-
- /**
- * Overload of ForwardTransform used if both i_comp and stag are not passed
- */
- AMREX_FORCE_INLINE
- void ForwardTransform (const int lev,
- const amrex::MultiFab& mf,
- const int field_index)
- {
- ForwardTransform(lev, mf, field_index, 0, mf.ixType().toIntVect());
- }
+ const int i_comp = 0);
/**
* \brief Transform spectral field specified by `field_index` back to
diff --git a/Source/FieldSolver/SpectralSolver/SpectralSolver.cpp b/Source/FieldSolver/SpectralSolver/SpectralSolver.cpp
index 0f7804002..81cba183c 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralSolver.cpp
+++ b/Source/FieldSolver/SpectralSolver/SpectralSolver.cpp
@@ -89,14 +89,13 @@ SpectralSolver::SpectralSolver(
}
void
-SpectralSolver::ForwardTransform( const int lev,
+SpectralSolver::ForwardTransform (const int lev,
const amrex::MultiFab& mf,
const int field_index,
- const int i_comp,
- const amrex::IntVect& stag )
+ const int i_comp)
{
WARPX_PROFILE("SpectralSolver::ForwardTransform");
- field_data.ForwardTransform( lev, mf, field_index, i_comp, stag );
+ field_data.ForwardTransform(lev, mf, field_index, i_comp);
}
void