aboutsummaryrefslogtreecommitdiff
path: root/Source/FieldSolver/SpectralSolver
diff options
context:
space:
mode:
Diffstat (limited to 'Source/FieldSolver/SpectralSolver')
-rw-r--r--Source/FieldSolver/SpectralSolver/AnyFFT.H4
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.H14
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmFirstOrder.H16
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmGalileanRZ.H10
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJConstantInTime.H22
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJLinearInTime.H20
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPml.H12
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPmlRZ.H4
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmRZ.H16
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.H6
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithmRZ.H2
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralBinomialFilter.H12
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralFieldData.H32
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.H42
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.cpp2
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralHankelTransform/HankelTransform.H16
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralHankelTransform/SpectralHankelTransformer.H6
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralKSpace.H16
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralKSpaceRZ.H2
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralSolver.H42
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralSolverRZ.H42
21 files changed, 171 insertions, 167 deletions
diff --git a/Source/FieldSolver/SpectralSolver/AnyFFT.H b/Source/FieldSolver/SpectralSolver/AnyFFT.H
index 7ab740f8f..79dbdf0e0 100644
--- a/Source/FieldSolver/SpectralSolver/AnyFFT.H
+++ b/Source/FieldSolver/SpectralSolver/AnyFFT.H
@@ -96,8 +96,8 @@ namespace AnyFFT
* \param[in] dir direction, either R2C or C2R
* \param[in] dim direction, number of dimensions of the arrays. Must be <= AMREX_SPACEDIM.
*/
- FFTplan CreatePlan(const amrex::IntVect& real_size, amrex::Real * const real_array,
- Complex * const complex_array, const direction dir, const int dim);
+ FFTplan CreatePlan(const amrex::IntVect& real_size, amrex::Real* real_array,
+ Complex* complex_array, direction dir, int dim);
/** \brief Destroy library FFT plan.
* \param[out] fft_plan plan to destroy
diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.H b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.H
index d52b2c09b..be9dbf26b 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.H
@@ -29,13 +29,13 @@ class PsatdAlgorithmComoving : public SpectralBaseAlgorithm
PsatdAlgorithmComoving (const SpectralKSpace& spectral_kspace,
const amrex::DistributionMapping& dm,
const SpectralFieldIndex& spectral_index,
- const int norder_x,
- const int norder_y,
- const int norder_z,
- const short grid_type,
+ int norder_x,
+ int norder_y,
+ int norder_z,
+ short grid_type,
const amrex::Vector<amrex::Real>& v_comoving,
- const amrex::Real dt,
- const bool update_with_rho);
+ amrex::Real dt,
+ bool update_with_rho);
/**
* \brief Override the update equations in Fourier space
@@ -46,7 +46,7 @@ class PsatdAlgorithmComoving : public SpectralBaseAlgorithm
*/
void InitializeSpectralCoefficients (const SpectralKSpace& spectral_kspace,
const amrex::DistributionMapping& dm,
- const amrex::Real dt);
+ amrex::Real dt);
/**
* \brief Virtual function for current correction in Fourier space.
diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmFirstOrder.H b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmFirstOrder.H
index 3e20a2c4e..dea72bec3 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmFirstOrder.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmFirstOrder.H
@@ -47,14 +47,14 @@ class PsatdAlgorithmFirstOrder : public SpectralBaseAlgorithm
const SpectralKSpace& spectral_kspace,
const amrex::DistributionMapping& dm,
const SpectralFieldIndex& spectral_index,
- const int norder_x,
- const int norder_y,
- const int norder_z,
- const short grid_type,
- const amrex::Real dt,
- const bool div_cleaning,
- const int J_in_time,
- const int rho_in_time);
+ int norder_x,
+ int norder_y,
+ int norder_z,
+ short grid_type,
+ amrex::Real dt,
+ bool div_cleaning,
+ int J_in_time,
+ int rho_in_time);
/**
* \brief Updates E, B, F, and G fields in spectral space,
diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmGalileanRZ.H b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmGalileanRZ.H
index 59b307731..37d763739 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmGalileanRZ.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmGalileanRZ.H
@@ -19,11 +19,11 @@ class PsatdAlgorithmGalileanRZ : public SpectralBaseAlgorithmRZ
PsatdAlgorithmGalileanRZ (SpectralKSpaceRZ const & spectral_kspace,
amrex::DistributionMapping const & dm,
const SpectralFieldIndex& spectral_index,
- int const n_rz_azimuthal_modes, int const norder_z,
- short const grid_type,
+ int n_rz_azimuthal_modes, int norder_z,
+ short grid_type,
const amrex::Vector<amrex::Real>& v_galilean,
- amrex::Real const dt_step,
- bool const update_with_rho);
+ amrex::Real dt_step,
+ bool update_with_rho);
// Redefine functions from base class
virtual void pushSpectralFields (SpectralFieldDataRZ & f) override final;
@@ -53,7 +53,7 @@ class PsatdAlgorithmGalileanRZ : public SpectralBaseAlgorithmRZ
bool coefficients_initialized;
// Note that dt and v_galilean are saved to use in InitializeSpectralCoefficients
- amrex::Real const m_dt;
+ amrex::Real m_dt;
amrex::Vector<amrex::Real> m_v_galilean;
bool m_update_with_rho;
diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJConstantInTime.H b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJConstantInTime.H
index 742e9a116..ed293fd1e 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJConstantInTime.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJConstantInTime.H
@@ -49,16 +49,16 @@ class PsatdAlgorithmJConstantInTime : public SpectralBaseAlgorithm
const SpectralKSpace& spectral_kspace,
const amrex::DistributionMapping& dm,
const SpectralFieldIndex& spectral_index,
- const int norder_x,
- const int norder_y,
- const int norder_z,
- const short grid_type,
+ int norder_x,
+ int norder_y,
+ int norder_z,
+ short grid_type,
const amrex::Vector<amrex::Real>& v_galilean,
- const amrex::Real dt,
- const bool update_with_rho,
- const bool time_averaging,
- const bool dive_cleaning,
- const bool divb_cleaning);
+ amrex::Real dt,
+ bool update_with_rho,
+ bool time_averaging,
+ bool dive_cleaning,
+ bool divb_cleaning);
/**
* \brief Updates the E and B fields in spectral space, according to the relevant PSATD equations
@@ -77,7 +77,7 @@ class PsatdAlgorithmJConstantInTime : public SpectralBaseAlgorithm
void InitializeSpectralCoefficients (
const SpectralKSpace& spectral_kspace,
const amrex::DistributionMapping& dm,
- const amrex::Real dt);
+ amrex::Real dt);
/**
* \brief Initializes additional coefficients used in \c pushSpectralFields to update the E and B fields,
@@ -90,7 +90,7 @@ class PsatdAlgorithmJConstantInTime : public SpectralBaseAlgorithm
void InitializeSpectralCoefficientsAveraging (
const SpectralKSpace& spectral_kspace,
const amrex::DistributionMapping& dm,
- const amrex::Real dt);
+ amrex::Real dt);
/**
* \brief Virtual function for current correction in Fourier space
diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJLinearInTime.H b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJLinearInTime.H
index acabd69d3..94eda8a2f 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJLinearInTime.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJLinearInTime.H
@@ -50,14 +50,14 @@ class PsatdAlgorithmJLinearInTime : public SpectralBaseAlgorithm
const SpectralKSpace& spectral_kspace,
const amrex::DistributionMapping& dm,
const SpectralFieldIndex& spectral_index,
- const int norder_x,
- const int norder_y,
- const int norder_z,
- const short grid_type,
- const amrex::Real dt,
- const bool time_averaging,
- const bool dive_cleaning,
- const bool divb_cleaning);
+ int norder_x,
+ int norder_y,
+ int norder_z,
+ short grid_type,
+ amrex::Real dt,
+ bool time_averaging,
+ bool dive_cleaning,
+ bool divb_cleaning);
/**
* \brief Updates the E and B fields in spectral space, according to the multi-J PSATD equations
@@ -76,7 +76,7 @@ class PsatdAlgorithmJLinearInTime : public SpectralBaseAlgorithm
void InitializeSpectralCoefficients (
const SpectralKSpace& spectral_kspace,
const amrex::DistributionMapping& dm,
- const amrex::Real dt);
+ amrex::Real dt);
/**
* \brief Initialize additional coefficients used in \c pushSpectralFields to update E,B,
@@ -89,7 +89,7 @@ class PsatdAlgorithmJLinearInTime : public SpectralBaseAlgorithm
void InitializeSpectralCoefficientsAveraging (
const SpectralKSpace& spectral_kspace,
const amrex::DistributionMapping& dm,
- const amrex::Real dt);
+ amrex::Real dt);
/**
* \brief Virtual function for current correction in Fourier space
diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPml.H b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPml.H
index b9342ebfe..7f50d1cd8 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPml.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPml.H
@@ -30,16 +30,16 @@ class PsatdAlgorithmPml : public SpectralBaseAlgorithm
PsatdAlgorithmPml(const SpectralKSpace& spectral_kspace,
const amrex::DistributionMapping& dm,
const SpectralFieldIndex& spectral_index,
- const int norder_x, const int norder_y,
- const int norder_z, const short grid_type,
- const amrex::Real dt,
- const bool dive_cleaning,
- const bool divb_cleaning);
+ int norder_x, int norder_y,
+ int norder_z, short grid_type,
+ amrex::Real dt,
+ bool dive_cleaning,
+ bool divb_cleaning);
void InitializeSpectralCoefficients(
const SpectralKSpace& spectral_kspace,
const amrex::DistributionMapping& dm,
- const amrex::Real dt);
+ amrex::Real dt);
// Redefine functions from base class
virtual void pushSpectralFields(SpectralFieldData& f) const override final;
diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPmlRZ.H b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPmlRZ.H
index e347cf40e..33dafd382 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPmlRZ.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPmlRZ.H
@@ -19,8 +19,8 @@ class PsatdAlgorithmPmlRZ : public SpectralBaseAlgorithmRZ
PsatdAlgorithmPmlRZ (SpectralKSpaceRZ const & spectral_kspace,
amrex::DistributionMapping const & dm,
const SpectralFieldIndex& spectral_index,
- int const n_rz_azimuthal_modes, int const norder_z,
- short const grid_type, amrex::Real const dt_step);
+ int n_rz_azimuthal_modes, int norder_z,
+ short grid_type, amrex::Real dt_step);
// Redefine functions from base class
virtual void pushSpectralFields (SpectralFieldDataRZ & f) override final;
diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmRZ.H b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmRZ.H
index f8dd6bb78..5f02498f7 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmRZ.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmRZ.H
@@ -19,14 +19,14 @@ class PsatdAlgorithmRZ : public SpectralBaseAlgorithmRZ
PsatdAlgorithmRZ(SpectralKSpaceRZ const & spectral_kspace,
amrex::DistributionMapping const & dm,
const SpectralFieldIndex& spectral_index,
- int const n_rz_azimuthal_modes, int const norder_z,
- short const grid_type, amrex::Real const dt_step,
- bool const update_with_rho,
- const bool time_averaging,
- const int J_in_time,
- const int rho_in_time,
- const bool dive_cleaning,
- const bool divb_cleaning);
+ int n_rz_azimuthal_modes, int norder_z,
+ short grid_type, amrex::Real dt_step,
+ bool update_with_rho,
+ bool time_averaging,
+ int J_in_time,
+ int rho_in_time,
+ bool dive_cleaning,
+ bool divb_cleaning);
// Redefine functions from base class
virtual void pushSpectralFields(SpectralFieldDataRZ & f) override final;
diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.H b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.H
index fe624e9b8..22fc506cc 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.H
@@ -64,7 +64,7 @@ class SpectralBaseAlgorithm
/**
* \brief Compute spectral divergence of E
*/
- void ComputeSpectralDivE ( const int lev,
+ void ComputeSpectralDivE ( int lev,
SpectralFieldData& field_data,
const std::array<std::unique_ptr<amrex::MultiFab>,3>& Efield,
amrex::MultiFab& divE );
@@ -82,8 +82,8 @@ class SpectralBaseAlgorithm
SpectralBaseAlgorithm(const SpectralKSpace& spectral_kspace,
const amrex::DistributionMapping& dm,
const SpectralFieldIndex& spectral_index,
- const int norder_x, const int norder_y,
- const int norder_z, const short grid_type);
+ int norder_x, int norder_y,
+ int norder_z, short grid_type);
SpectralFieldIndex m_spectral_index;
diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithmRZ.H b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithmRZ.H
index 37bb862a9..5758f81e3 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithmRZ.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithmRZ.H
@@ -40,7 +40,7 @@ class SpectralBaseAlgorithmRZ
/**
* \brief Compute spectral divergence of E
*/
- void ComputeSpectralDivE ( const int lev,
+ void ComputeSpectralDivE ( int lev,
SpectralFieldDataRZ& field_data,
const std::array<std::unique_ptr<amrex::MultiFab>,3>& Efield,
amrex::MultiFab& divE );
diff --git a/Source/FieldSolver/SpectralSolver/SpectralBinomialFilter.H b/Source/FieldSolver/SpectralSolver/SpectralBinomialFilter.H
index 3dd3a59cd..ca30fb907 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralBinomialFilter.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralBinomialFilter.H
@@ -25,15 +25,15 @@ class SpectralBinomialFilter
SpectralBinomialFilter () {}
void InitFilterArray (RealKVector const & kvec,
- amrex::Real const dels,
- int const npasses,
- bool const compensation,
+ amrex::Real dels,
+ int npasses,
+ bool compensation,
KFilterArray & filter);
void InitFilterArray (RealKVector const & kr,
RealKVector const & kz,
- amrex::RealVect const dx,
- amrex::IntVect const filter_npass_each_dir,
- bool const compensation);
+ amrex::RealVect dx,
+ amrex::IntVect filter_npass_each_dir,
+ bool compensation);
KFilterArray const & getFilterArrayR () {return filter_r;}
KFilterArray const & getFilterArrayZ () {return filter_z;}
diff --git a/Source/FieldSolver/SpectralSolver/SpectralFieldData.H b/Source/FieldSolver/SpectralSolver/SpectralFieldData.H
index e86348484..8fd23fac7 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralFieldData.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralFieldData.H
@@ -56,14 +56,14 @@ class SpectralFieldIndex
* \param[in] pml_rz whether the indices are used to access spectral data
* for the RZ PML spectral solver
*/
- SpectralFieldIndex (const bool update_with_rho,
- const bool time_averaging,
- const int J_in_time,
- const int rho_in_time,
- const bool dive_cleaning,
- const bool divb_cleaning,
- const bool pml,
- const bool pml_rz = false);
+ SpectralFieldIndex (bool update_with_rho,
+ bool time_averaging,
+ int J_in_time,
+ int rho_in_time,
+ bool dive_cleaning,
+ bool divb_cleaning,
+ bool pml,
+ bool pml_rz = false);
/**
* \brief Default constructor
@@ -122,22 +122,22 @@ class SpectralFieldData
{
public:
- SpectralFieldData( const int lev,
+ SpectralFieldData( int lev,
const amrex::BoxArray& realspace_ba,
const SpectralKSpace& k_space,
const amrex::DistributionMapping& dm,
- const int n_field_required,
- const bool periodic_single_box);
+ int n_field_required,
+ bool periodic_single_box);
SpectralFieldData() = default; // Default constructor
SpectralFieldData& operator=(SpectralFieldData&& field_data) = default;
~SpectralFieldData();
- void ForwardTransform (const int lev,
- const amrex::MultiFab& mf, const int field_index,
- const int i_comp);
+ void ForwardTransform (int lev,
+ const amrex::MultiFab& mf, int field_index,
+ int i_comp);
- void BackwardTransform (const int lev, amrex::MultiFab& mf, const int field_index,
- const amrex::IntVect& fill_guards, const int i_comp);
+ void BackwardTransform (int lev, amrex::MultiFab& mf, int field_index,
+ const amrex::IntVect& fill_guards, int i_comp);
// `fields` stores fields in spectral space, as multicomponent FabArray
SpectralField fields;
diff --git a/Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.H b/Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.H
index 8b131894d..b966c7c3c 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.H
@@ -33,32 +33,32 @@ class SpectralFieldDataRZ
using BinomialFilter = amrex::LayoutData<SpectralBinomialFilter>;
- SpectralFieldDataRZ (const int lev,
+ SpectralFieldDataRZ (int lev,
const amrex::BoxArray& realspace_ba,
const SpectralKSpaceRZ& k_space,
const amrex::DistributionMapping& dm,
- const int n_field_required,
- const int n_modes);
+ int n_field_required,
+ int n_modes);
SpectralFieldDataRZ () = default; // Default constructor
SpectralFieldDataRZ& operator=(SpectralFieldDataRZ&& field_data) = default;
~SpectralFieldDataRZ ();
- void ForwardTransform (const int lev, const amrex::MultiFab& mf, const int field_index,
- const int i_comp=0);
- void ForwardTransform (const int lev, const amrex::MultiFab& mf_r, const int field_index_r,
- const amrex::MultiFab& mf_t, const int field_index_t);
- void BackwardTransform (const int lev, amrex::MultiFab& mf, const int field_index,
- const int i_comp=0);
- void BackwardTransform (const int lev, amrex::MultiFab& mf_r, const int field_index_r,
- amrex::MultiFab& mf_t, const int field_index_t);
+ void ForwardTransform (int lev, const amrex::MultiFab& mf, int field_index,
+ int i_comp=0);
+ void ForwardTransform (int lev, const amrex::MultiFab& mf_r, int field_index_r,
+ const amrex::MultiFab& mf_t, int field_index_t);
+ void BackwardTransform (int lev, amrex::MultiFab& mf, int field_index,
+ int i_comp=0);
+ void BackwardTransform (int lev, amrex::MultiFab& mf_r, int field_index_r,
+ amrex::MultiFab& mf_t, int field_index_t);
void FABZForwardTransform (amrex::MFIter const & mfi, amrex::Box const & realspace_bx,
amrex::MultiFab const & tempHTransformedSplit,
- int field_index, const bool is_nodal_z);
+ int field_index, bool is_nodal_z);
void FABZBackwardTransform (amrex::MFIter const & mfi, amrex::Box const & realspace_bx,
- const int field_index,
+ int field_index,
amrex::MultiFab & tempHTransformedSplit,
- const bool is_nodal_z);
+ bool is_nodal_z);
/**
* \brief Copy spectral data from component \c src_comp to component \c dest_comp
@@ -67,7 +67,7 @@ class SpectralFieldDataRZ
* \param[in] src_comp component of the source FabArray from which the data are copied
* \param[in] dest_comp component of the destination FabArray where the data are copied
*/
- void CopySpectralDataComp (const int src_comp, const int dest_comp)
+ void CopySpectralDataComp (int src_comp, int dest_comp)
{
// In spectral space fields of each mode are grouped together, so that the index
// of a field for a specific mode is given by field_index + mode*n_fields.
@@ -87,7 +87,7 @@ class SpectralFieldDataRZ
*
* \param[in] icomp component of the FabArray where the data are set to zero
*/
- void ZeroOutDataComp(const int icomp)
+ void ZeroOutDataComp(int icomp)
{
// In spectral space fields of each mode are grouped together, so that the index
// of a field for a specific mode is given by field_index + mode*n_fields.
@@ -107,7 +107,7 @@ class SpectralFieldDataRZ
* \param[in] icomp component of the FabArray where the data are scaled
* \param[in] scale_factor scale factor to use for scaling
*/
- void ScaleDataComp(const int icomp, const amrex::Real scale_factor)
+ void ScaleDataComp(int icomp, amrex::Real scale_factor)
{
// In spectral space fields of each mode are grouped together, so that the index
// of a field for a specific mode is given by field_index + mode*n_fields.
@@ -121,12 +121,12 @@ class SpectralFieldDataRZ
}
}
- void InitFilter (amrex::IntVect const & filter_npass_each_dir, bool const compensation,
+ void InitFilter (amrex::IntVect const & filter_npass_each_dir, bool compensation,
SpectralKSpaceRZ const & k_space);
- void ApplyFilter (const int lev, int const field_index);
- void ApplyFilter (const int lev, int const field_index1,
- int const field_index2, int const field_index3);
+ void ApplyFilter (int lev, int field_index);
+ void ApplyFilter (int lev, int field_index1,
+ int field_index2, int field_index3);
// Returns an array that holds the kr for all of the modes
HankelTransform::RealVector const & getKrArray (amrex::MFIter const & mfi) const {
diff --git a/Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.cpp b/Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.cpp
index 20d6f7a0a..debca3afa 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.cpp
+++ b/Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.cpp
@@ -202,7 +202,7 @@ SpectralFieldDataRZ::SpectralFieldDataRZ (const int lev,
SpectralFieldDataRZ::~SpectralFieldDataRZ()
{
- if (fields.size() > 0){
+ if (!fields.empty()){
for (amrex::MFIter mfi(fields); mfi.isValid(); ++mfi){
#if defined(AMREX_USE_CUDA)
// Destroy cuFFT plans.
diff --git a/Source/FieldSolver/SpectralSolver/SpectralHankelTransform/HankelTransform.H b/Source/FieldSolver/SpectralSolver/SpectralHankelTransform/HankelTransform.H
index a911a0627..e40ccc045 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralHankelTransform/HankelTransform.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralHankelTransform/HankelTransform.H
@@ -32,18 +32,18 @@ class HankelTransform
using RealVector = amrex::Gpu::DeviceVector<amrex::Real>;
// Constructor
- HankelTransform(const int hankel_order,
- const int azimuthal_mode,
- const int nr,
- const amrex::Real rmax);
+ HankelTransform(int hankel_order,
+ int azimuthal_mode,
+ int nr,
+ amrex::Real rmax);
const RealVector & getSpectralWavenumbers() {return m_kr;}
- void HankelForwardTransform(amrex::FArrayBox const& F, int const F_icomp,
- amrex::FArrayBox & G, int const G_icomp);
+ void HankelForwardTransform(amrex::FArrayBox const& F, int F_icomp,
+ amrex::FArrayBox & G, int G_icomp);
- void HankelInverseTransform(amrex::FArrayBox const& G, int const G_icomp,
- amrex::FArrayBox & F, int const F_icomp);
+ void HankelInverseTransform(amrex::FArrayBox const& G, int G_icomp,
+ amrex::FArrayBox & F, int F_icomp);
private:
// Even though nk == nr always, use a separate variable for clarity.
diff --git a/Source/FieldSolver/SpectralSolver/SpectralHankelTransform/SpectralHankelTransformer.H b/Source/FieldSolver/SpectralSolver/SpectralHankelTransform/SpectralHankelTransformer.H
index e6dddf60e..d14bb1668 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralHankelTransform/SpectralHankelTransformer.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralHankelTransform/SpectralHankelTransformer.H
@@ -25,9 +25,9 @@ class SpectralHankelTransformer
SpectralHankelTransformer () {}
- SpectralHankelTransformer (const int nr,
- const int n_rz_azimuthal_modes,
- const amrex::Real rmax);
+ SpectralHankelTransformer (int nr,
+ int n_rz_azimuthal_modes,
+ amrex::Real rmax);
void
ExtractKrArray ();
diff --git a/Source/FieldSolver/SpectralSolver/SpectralKSpace.H b/Source/FieldSolver/SpectralSolver/SpectralKSpace.H
index d5266b2a2..2a4dd3d15 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralKSpace.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralKSpace.H
@@ -49,19 +49,23 @@ class SpectralKSpace
public:
amrex::BoxArray spectralspace_ba;
SpectralKSpace() : dx(amrex::RealVect::Zero) {}
+
SpectralKSpace( const amrex::BoxArray& realspace_ba,
const amrex::DistributionMapping& dm,
- const amrex::RealVect realspace_dx );
+ amrex::RealVect realspace_dx );
+
KVectorComponent getKComponent(
const amrex::DistributionMapping& dm,
const amrex::BoxArray& realspace_ba,
- const int i_dim, const bool only_positive_k ) const;
+ int i_dim, bool only_positive_k ) const;
+
KVectorComponent getModifiedKComponent(
- const amrex::DistributionMapping& dm, const int i_dim,
- const int n_order, const short grid_type ) const;
+ const amrex::DistributionMapping& dm, int i_dim,
+ int n_order, short grid_type ) const;
+
SpectralShiftFactor getSpectralShiftFactor(
- const amrex::DistributionMapping& dm, const int i_dim,
- const int shift_type ) const;
+ const amrex::DistributionMapping& dm, int i_dim,
+ int shift_type ) const;
protected:
amrex::Array<KVectorComponent, AMREX_SPACEDIM> k_vec;
diff --git a/Source/FieldSolver/SpectralSolver/SpectralKSpaceRZ.H b/Source/FieldSolver/SpectralSolver/SpectralKSpaceRZ.H
index 594b06764..5b21df51d 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralKSpaceRZ.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralKSpaceRZ.H
@@ -22,7 +22,7 @@ class SpectralKSpaceRZ
public:
SpectralKSpaceRZ(const amrex::BoxArray& realspace_ba,
const amrex::DistributionMapping& dm,
- const amrex::RealVect realspace_dx);
+ amrex::RealVect realspace_dx);
KVectorComponent const & getKzArray () const {return k_vec[1];}
amrex::RealVect const & getCellSize () const {return dx;}
diff --git a/Source/FieldSolver/SpectralSolver/SpectralSolver.H b/Source/FieldSolver/SpectralSolver/SpectralSolver.H
index 4ff9654ed..9c74cdbea 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralSolver.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralSolver.H
@@ -69,24 +69,24 @@ class SpectralSolver
* \param[in] divb_cleaning whether to use div(B) cleaning to account for errors in
* div(B) = 0 law (new field G in the update equations)
*/
- SpectralSolver (const int lev,
+ SpectralSolver (int lev,
const amrex::BoxArray& realspace_ba,
const amrex::DistributionMapping& dm,
- const int norder_x, const int norder_y,
- const int norder_z, const short grid_type,
+ int norder_x, int norder_y,
+ int norder_z, short grid_type,
const amrex::Vector<amrex::Real>& v_galilean,
const amrex::Vector<amrex::Real>& v_comoving,
- const amrex::RealVect dx,
- const amrex::Real dt,
- const bool pml,
- const bool periodic_single_box,
- const bool update_with_rho,
- const bool fft_do_time_averaging,
- const int psatd_solution_type,
- const int J_in_time,
- const int rho_in_time,
- const bool dive_cleaning,
- const bool divb_cleaning);
+ amrex::RealVect dx,
+ amrex::Real dt,
+ bool pml,
+ bool periodic_single_box,
+ bool update_with_rho,
+ bool fft_do_time_averaging,
+ int psatd_solution_type,
+ int J_in_time,
+ int rho_in_time,
+ bool dive_cleaning,
+ bool divb_cleaning);
/**
* \brief Transform the component i_comp of the MultiFab mf to Fourier space,
@@ -97,20 +97,20 @@ class SpectralSolver
* \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
*/
- void ForwardTransform (const int lev,
+ void ForwardTransform (int lev,
const amrex::MultiFab& mf,
- const int field_index,
- const int i_comp = 0);
+ int field_index,
+ int i_comp = 0);
/**
* \brief Transform spectral field specified by `field_index` back to
* real space, and store it in the component `i_comp` of `mf`
*/
- void BackwardTransform( const int lev,
+ void BackwardTransform( int lev,
amrex::MultiFab& mf,
- const int field_index,
+ int field_index,
const amrex::IntVect& fill_guards,
- const int i_comp=0 );
+ int i_comp=0 );
/**
* \brief Update the fields in spectral space, over one timestep
@@ -121,7 +121,7 @@ class SpectralSolver
* \brief Public interface to call the member function ComputeSpectralDivE
* of the base class SpectralBaseAlgorithm from objects of class SpectralSolver
*/
- void ComputeSpectralDivE ( const int lev,
+ void ComputeSpectralDivE ( int lev,
const std::array<std::unique_ptr<amrex::MultiFab>,3>& Efield,
amrex::MultiFab& divE ) {
algorithm->ComputeSpectralDivE( lev, field_data, Efield, divE );
diff --git a/Source/FieldSolver/SpectralSolver/SpectralSolverRZ.H b/Source/FieldSolver/SpectralSolver/SpectralSolverRZ.H
index 4a6c15630..30bfe5cf1 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralSolverRZ.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralSolverRZ.H
@@ -27,45 +27,45 @@ class SpectralSolverRZ
// underlying classes `SpectralFieldData` and `PsatdAlgorithm`
// Constructor
- SpectralSolverRZ (const int lev,
+ SpectralSolverRZ (int lev,
amrex::BoxArray const & realspace_ba,
amrex::DistributionMapping const & dm,
- int const n_rz_azimuthal_modes,
- int const norder_z, short const grid_type,
+ int n_rz_azimuthal_modes,
+ int norder_z, short grid_type,
const amrex::Vector<amrex::Real>& v_galilean,
- amrex::RealVect const dx, amrex::Real const dt,
- bool const with_pml,
- bool const update_with_rho,
- const bool fft_do_time_averaging,
- const int J_in_time,
- const int rho_in_time,
- const bool dive_cleaning,
- const bool divb_cleaning);
+ amrex::RealVect dx, amrex::Real dt,
+ bool with_pml,
+ bool update_with_rho,
+ bool fft_do_time_averaging,
+ int J_in_time,
+ int rho_in_time,
+ bool dive_cleaning,
+ bool divb_cleaning);
/* \brief Transform the component `i_comp` of MultiFab `field_mf`
* to spectral space, and store the corresponding result internally
* (in the spectral field specified by `field_index`) */
- void ForwardTransform (const int lev, amrex::MultiFab const & field_mf, int const field_index,
- int const i_comp=0);
+ void ForwardTransform (int lev, amrex::MultiFab const & field_mf, int field_index,
+ int i_comp=0);
/* \brief Transform the two MultiFabs `field_mf1` and `field_mf2`
* to spectral space, and store the corresponding results internally
* (in the spectral field specified by `field_index1` and `field_index2`) */
- void ForwardTransform (const int lev, amrex::MultiFab const & field_mf1, int const field_index1,
- amrex::MultiFab const & field_mf2, int const field_index2);
+ void ForwardTransform (int lev, amrex::MultiFab const & field_mf1, int field_index1,
+ amrex::MultiFab const & field_mf2, int field_index2);
/* \brief Transform spectral field specified by `field_index` back to
* real space, and store it in the component `i_comp` of `field_mf` */
- void BackwardTransform (const int lev, amrex::MultiFab& field_mf, int const field_index,
- int const i_comp=0);
+ void BackwardTransform (int lev, amrex::MultiFab& field_mf, int field_index,
+ int i_comp=0);
/* \brief Transform spectral fields specified by `field_index1` and `field_index2`
* back to real space, and store it in `field_mf1` and `field_mf2`*/
- void BackwardTransform (const int lev, amrex::MultiFab& field_mf1, int const field_index1,
- amrex::MultiFab& field_mf2, int const field_index2);
+ void BackwardTransform (int lev, amrex::MultiFab& field_mf1, int field_index1,
+ amrex::MultiFab& field_mf2, int field_index2);
/* \brief Update the fields in spectral space, over one timestep */
- void pushSpectralFields (const bool doing_pml=false);
+ void pushSpectralFields (bool doing_pml=false);
/* \brief Initialize K space filtering arrays */
void InitFilter (amrex::IntVect const & filter_npass_each_dir,
@@ -91,7 +91,7 @@ class SpectralSolverRZ
* \brief Public interface to call the member function ComputeSpectralDivE
* of the base class SpectralBaseAlgorithmRZ from objects of class SpectralSolverRZ
*/
- void ComputeSpectralDivE (const int lev, const std::array<std::unique_ptr<amrex::MultiFab>,3>& Efield,
+ void ComputeSpectralDivE (int lev, const std::array<std::unique_ptr<amrex::MultiFab>,3>& Efield,
amrex::MultiFab& divE);
/**