diff options
author | 2023-03-08 20:52:56 -0800 | |
---|---|---|
committer | 2023-03-09 04:52:56 +0000 | |
commit | 03b2fe60ff49748aaff8402824ea0457eef24d5c (patch) | |
tree | 1f29cb899516a03eecc5babd9e9a65f84a8f7dd4 /Source/FieldSolver/SpectralSolver/SpectralAlgorithms | |
parent | 92013ab8403512a0d42ee3ba49f474b72d1ed88f (diff) | |
download | WarpX-03b2fe60ff49748aaff8402824ea0457eef24d5c.tar.gz WarpX-03b2fe60ff49748aaff8402824ea0457eef24d5c.tar.zst WarpX-03b2fe60ff49748aaff8402824ea0457eef24d5c.zip |
New user input for grid type (collocated, staggered, hybrid) (#3683)
* Introduce `warpx.grid_type` parameter
* Replace `or` with `||`
* Update examples with new user input syntax
* Fix `if` condition
* Improve error message
* Fix `if` condition
* Fix bugs
* Fix warning
* Fix RZ
* Debugging
* Fix RZ
* Fix bug
* Clean up
* More changes:
- set default algo parameters with hybrid grid
- all hybrid input parameters under warpx name
* Set default field gathering algo for hybrid grids
* Update documentation
Diffstat (limited to 'Source/FieldSolver/SpectralSolver/SpectralAlgorithms')
19 files changed, 51 insertions, 49 deletions
diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.H b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.H index bc7dc7699..bb9775e1c 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.H +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.H @@ -32,7 +32,7 @@ class PsatdAlgorithmComoving : public SpectralBaseAlgorithm const int norder_x, const int norder_y, const int norder_z, - const bool nodal, + const short grid_type, 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 dfd7ffe92..8f576dad7 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.cpp +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.cpp @@ -1,6 +1,7 @@ #include "PsatdAlgorithmComoving.H" #include "Utils/TextMsg.H" +#include "Utils/WarpXAlgorithmSelection.H" #include "Utils/WarpXConst.H" #include "Utils/WarpX_Complex.H" @@ -25,21 +26,21 @@ PsatdAlgorithmComoving::PsatdAlgorithmComoving (const SpectralKSpace& spectral_k const DistributionMapping& dm, const SpectralFieldIndex& spectral_index, const int norder_x, const int norder_y, - const int norder_z, const bool nodal, + const int norder_z, const short grid_type, 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), + : SpectralBaseAlgorithm(spectral_kspace, dm, spectral_index, norder_x, norder_y, norder_z, grid_type), 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) - kx_vec(spectral_kspace.getModifiedKComponent(dm, 0, -1, false)), + // the infinite order option, the argument grid_type=GridType::Staggered is then irrelevant) + kx_vec(spectral_kspace.getModifiedKComponent(dm, 0, -1, GridType::Staggered)), #if defined(WARPX_DIM_3D) - ky_vec(spectral_kspace.getModifiedKComponent(dm, 1, -1, false)), - kz_vec(spectral_kspace.getModifiedKComponent(dm, 2, -1, false)), + ky_vec(spectral_kspace.getModifiedKComponent(dm, 1, -1, GridType::Staggered)), + kz_vec(spectral_kspace.getModifiedKComponent(dm, 2, -1, GridType::Staggered)), #else - kz_vec(spectral_kspace.getModifiedKComponent(dm, 1, -1, false)), + kz_vec(spectral_kspace.getModifiedKComponent(dm, 1, -1, GridType::Staggered)), #endif m_v_comoving(v_comoving), m_dt(dt) diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmFirstOrder.H b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmFirstOrder.H index c90b19e1a..512c4f489 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmFirstOrder.H +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmFirstOrder.H @@ -37,7 +37,7 @@ class PsatdAlgorithmFirstOrder : public SpectralBaseAlgorithm * \param[in] norder_x order of the spectral solver along x * \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] grid_type type of grid (collocated or not) * \param[in] dt time step of the simulation * \param[in] div_cleaning whether to use divergence correction for both E and B (thus, F and G) * \param[in] J_in_time time dependency of J (currently supported: constant, linear) @@ -50,7 +50,7 @@ class PsatdAlgorithmFirstOrder : public SpectralBaseAlgorithm const int norder_x, const int norder_y, const int norder_z, - const bool nodal, + const short grid_type, const amrex::Real dt, const bool div_cleaning, const int J_in_time, diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmFirstOrder.cpp b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmFirstOrder.cpp index d32604760..3701fb889 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmFirstOrder.cpp +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmFirstOrder.cpp @@ -35,13 +35,13 @@ PsatdAlgorithmFirstOrder::PsatdAlgorithmFirstOrder( const int norder_x, const int norder_y, const int norder_z, - const bool nodal, + const short grid_type, const amrex::Real dt, const bool div_cleaning, const int J_in_time, const int rho_in_time) // Initializer list - : SpectralBaseAlgorithm(spectral_kspace, dm, spectral_index, norder_x, norder_y, norder_z, nodal), + : SpectralBaseAlgorithm(spectral_kspace, dm, spectral_index, norder_x, norder_y, norder_z, grid_type), m_spectral_index(spectral_index), m_dt(dt), m_div_cleaning(div_cleaning), diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmGalileanRZ.H b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmGalileanRZ.H index d3c519c94..aee8bc5ed 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmGalileanRZ.H +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmGalileanRZ.H @@ -20,7 +20,7 @@ class PsatdAlgorithmGalileanRZ : public SpectralBaseAlgorithmRZ amrex::DistributionMapping const & dm, const SpectralFieldIndex& spectral_index, int const n_rz_azimuthal_modes, int const norder_z, - bool const nodal, + short const grid_type, const amrex::Vector<amrex::Real>& v_galilean, amrex::Real const dt_step, bool const update_with_rho); diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmGalileanRZ.cpp b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmGalileanRZ.cpp index af3e2e336..75f0e49d1 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmGalileanRZ.cpp +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmGalileanRZ.cpp @@ -21,12 +21,12 @@ PsatdAlgorithmGalileanRZ::PsatdAlgorithmGalileanRZ (SpectralKSpaceRZ const & spe amrex::DistributionMapping const & dm, const SpectralFieldIndex& spectral_index, int const n_rz_azimuthal_modes, int const norder_z, - bool const nodal, + short const grid_type, const amrex::Vector<amrex::Real>& v_galilean, amrex::Real const dt, bool const update_with_rho) // Initialize members of base class - : SpectralBaseAlgorithmRZ(spectral_kspace, dm, spectral_index, norder_z, nodal), + : SpectralBaseAlgorithmRZ(spectral_kspace, dm, spectral_index, norder_z, grid_type), m_spectral_index(spectral_index), m_dt(dt), m_v_galilean(v_galilean), diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJConstantInTime.H b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJConstantInTime.H index 0d2d67434..0dd3d179d 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJConstantInTime.H +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJConstantInTime.H @@ -37,7 +37,7 @@ class PsatdAlgorithmJConstantInTime : public SpectralBaseAlgorithm * \param[in] norder_x order of the spectral solver along x * \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] grid_type type of grid (collocated or not) * \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 @@ -52,7 +52,7 @@ class PsatdAlgorithmJConstantInTime : public SpectralBaseAlgorithm const int norder_x, const int norder_y, const int norder_z, - const bool nodal, + const short grid_type, const amrex::Vector<amrex::Real>& v_galilean, const amrex::Real dt, const bool update_with_rho, diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJConstantInTime.cpp b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJConstantInTime.cpp index c52437bf8..8c28c42b2 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJConstantInTime.cpp +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJConstantInTime.cpp @@ -7,6 +7,7 @@ #include "PsatdAlgorithmJConstantInTime.H" #include "Utils/TextMsg.H" +#include "Utils/WarpXAlgorithmSelection.H" #include "Utils/WarpXConst.H" #include "Utils/WarpX_Complex.H" @@ -34,7 +35,7 @@ PsatdAlgorithmJConstantInTime::PsatdAlgorithmJConstantInTime( const int norder_x, const int norder_y, const int norder_z, - const bool nodal, + const short grid_type, const amrex::Vector<amrex::Real>& v_galilean, const amrex::Real dt, const bool update_with_rho, @@ -42,17 +43,17 @@ PsatdAlgorithmJConstantInTime::PsatdAlgorithmJConstantInTime( const bool dive_cleaning, const bool divb_cleaning) // Initializer list - : SpectralBaseAlgorithm(spectral_kspace, dm, spectral_index, norder_x, norder_y, norder_z, nodal), + : SpectralBaseAlgorithm(spectral_kspace, dm, spectral_index, norder_x, norder_y, norder_z, grid_type), m_spectral_index(spectral_index), // Initialize the centered finite-order modified k vectors: // these are computed always with the assumption of centered grids - // (argument nodal = true), for both nodal and staggered simulations - modified_kx_vec_centered(spectral_kspace.getModifiedKComponent(dm, 0, norder_x, true)), + // (argument grid_type=GridType::Collocated), for both collocated and staggered grids + modified_kx_vec_centered(spectral_kspace.getModifiedKComponent(dm, 0, norder_x, GridType::Collocated)), #if defined(WARPX_DIM_3D) - modified_ky_vec_centered(spectral_kspace.getModifiedKComponent(dm, 1, norder_y, true)), - modified_kz_vec_centered(spectral_kspace.getModifiedKComponent(dm, 2, norder_z, true)), + modified_ky_vec_centered(spectral_kspace.getModifiedKComponent(dm, 1, norder_y, GridType::Collocated)), + modified_kz_vec_centered(spectral_kspace.getModifiedKComponent(dm, 2, norder_z, GridType::Collocated)), #else - modified_kz_vec_centered(spectral_kspace.getModifiedKComponent(dm, 1, norder_z, true)), + modified_kz_vec_centered(spectral_kspace.getModifiedKComponent(dm, 1, norder_z, GridType::Collocated)), #endif m_v_galilean(v_galilean), m_dt(dt), @@ -419,8 +420,8 @@ void PsatdAlgorithmJConstantInTime::InitializeSpectralCoefficients ( const amrex::Real dt2 = std::pow(dt, 2); // Calculate the dot product of the k vector with the Galilean velocity. - // This has to be computed always with the centered (that is, nodal) finite-order - // modified k vectors, to work correctly for both nodal and staggered simulations. + // This has to be computed always with the centered (collocated) finite-order + // modified k vectors, to work correctly for both collocated and staggered grids. // w_c = 0 always with standard PSATD (zero Galilean velocity). const amrex::Real w_c = kx_c[i]*vg_x + #if defined(WARPX_DIM_3D) @@ -580,8 +581,8 @@ void PsatdAlgorithmJConstantInTime::InitializeSpectralCoefficientsAveraging ( const amrex::Real dt2 = std::pow(dt, 2); // Calculate the dot product of the k vector with the Galilean velocity. - // This has to be computed always with the centered (that is, nodal) finite-order - // modified k vectors, to work correctly for both nodal and staggered simulations. + // This has to be computed always with the centered (collocated) finite-order + // modified k vectors, to work correctly for both collocated and staggered grids. // w_c = 0 always with standard PSATD (zero Galilean velocity). const amrex::Real w_c = kx_c[i]*vg_x + #if defined(WARPX_DIM_3D) diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJLinearInTime.H b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJLinearInTime.H index e0eded5f5..13db64b74 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJLinearInTime.H +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJLinearInTime.H @@ -40,7 +40,7 @@ class PsatdAlgorithmJLinearInTime : public SpectralBaseAlgorithm * \param[in] norder_x order of the spectral solver along x * \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] grid_type type of grid (collocated or not) * \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 @@ -53,7 +53,7 @@ class PsatdAlgorithmJLinearInTime : public SpectralBaseAlgorithm const int norder_x, const int norder_y, const int norder_z, - const bool nodal, + const short grid_type, 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 861001c78..b0580422b 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJLinearInTime.cpp +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJLinearInTime.cpp @@ -34,13 +34,13 @@ PsatdAlgorithmJLinearInTime::PsatdAlgorithmJLinearInTime( const int norder_x, const int norder_y, const int norder_z, - const bool nodal, + const short grid_type, 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), + : SpectralBaseAlgorithm(spectral_kspace, dm, spectral_index, norder_x, norder_y, norder_z, grid_type), 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 0c1aeb885..e858dc1bf 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPml.H +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPml.H @@ -31,7 +31,7 @@ class PsatdAlgorithmPml : public 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 int norder_z, const short grid_type, 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 45a4d1580..217998d18 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPml.cpp +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPml.cpp @@ -34,11 +34,11 @@ PsatdAlgorithmPml::PsatdAlgorithmPml(const SpectralKSpace& spectral_kspace, const DistributionMapping& dm, const SpectralFieldIndex& spectral_index, const int norder_x, const int norder_y, - const int norder_z, const bool nodal, + const int norder_z, const short grid_type, 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), + : SpectralBaseAlgorithm(spectral_kspace, dm, spectral_index, norder_x, norder_y, norder_z, grid_type), m_spectral_index(spectral_index), m_dt(dt), m_dive_cleaning(dive_cleaning), diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPmlRZ.H b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPmlRZ.H index 6ea63c5a2..255b645ba 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPmlRZ.H +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPmlRZ.H @@ -20,7 +20,7 @@ class PsatdAlgorithmPmlRZ : public SpectralBaseAlgorithmRZ amrex::DistributionMapping const & dm, const SpectralFieldIndex& spectral_index, int const n_rz_azimuthal_modes, int const norder_z, - bool const nodal, amrex::Real const dt_step); + short const grid_type, amrex::Real const dt_step); // Redefine functions from base class virtual void pushSpectralFields (SpectralFieldDataRZ & f) override final; diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPmlRZ.cpp b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPmlRZ.cpp index ca85648ac..60f7209de 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPmlRZ.cpp +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmPmlRZ.cpp @@ -21,9 +21,9 @@ PsatdAlgorithmPmlRZ::PsatdAlgorithmPmlRZ (SpectralKSpaceRZ const & spectral_kspa amrex::DistributionMapping const & dm, const SpectralFieldIndex& spectral_index, int const n_rz_azimuthal_modes, int const norder_z, - bool const nodal, amrex::Real const dt) + short const grid_type, amrex::Real const dt) // Initialize members of base class - : SpectralBaseAlgorithmRZ(spectral_kspace, dm, spectral_index, norder_z, nodal), + : SpectralBaseAlgorithmRZ(spectral_kspace, dm, spectral_index, norder_z, grid_type), m_spectral_index(spectral_index), m_dt(dt) { diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmRZ.H b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmRZ.H index 097a1a9d6..350db81c3 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmRZ.H +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmRZ.H @@ -20,7 +20,7 @@ class PsatdAlgorithmRZ : public SpectralBaseAlgorithmRZ amrex::DistributionMapping const & dm, const SpectralFieldIndex& spectral_index, int const n_rz_azimuthal_modes, int const norder_z, - bool const nodal, amrex::Real const dt_step, + short const grid_type, amrex::Real const dt_step, bool const update_with_rho, const bool time_averaging, const int J_in_time, diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmRZ.cpp b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmRZ.cpp index effb1cc2b..46ac2c0b8 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmRZ.cpp +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmRZ.cpp @@ -21,7 +21,7 @@ PsatdAlgorithmRZ::PsatdAlgorithmRZ (SpectralKSpaceRZ const & spectral_kspace, amrex::DistributionMapping const & dm, const SpectralFieldIndex& spectral_index, int const n_rz_azimuthal_modes, int const norder_z, - bool const nodal, amrex::Real const dt, + short const grid_type, amrex::Real const dt, bool const update_with_rho, const bool time_averaging, const int J_in_time, @@ -29,7 +29,7 @@ PsatdAlgorithmRZ::PsatdAlgorithmRZ (SpectralKSpaceRZ const & spectral_kspace, const bool dive_cleaning, const bool divb_cleaning) // Initialize members of base class - : SpectralBaseAlgorithmRZ(spectral_kspace, dm, spectral_index, norder_z, nodal), + : SpectralBaseAlgorithmRZ(spectral_kspace, dm, spectral_index, norder_z, grid_type), m_spectral_index(spectral_index), m_dt(dt), m_update_with_rho(update_with_rho), diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.H b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.H index ef08c4432..fe624e9b8 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.H +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.H @@ -83,7 +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 int norder_z, const short grid_type); SpectralFieldIndex m_spectral_index; diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.cpp b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.cpp index 1a2334cc6..099f6edf3 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.cpp +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.cpp @@ -31,15 +31,15 @@ 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 int norder_z, const short grid_type): m_spectral_index(spectral_index), // Compute and assign the modified k vectors - modified_kx_vec(spectral_kspace.getModifiedKComponent(dm,0,norder_x,nodal)), + modified_kx_vec(spectral_kspace.getModifiedKComponent(dm,0,norder_x,grid_type)), #if defined(WARPX_DIM_3D) - modified_ky_vec(spectral_kspace.getModifiedKComponent(dm,1,norder_y,nodal)), - modified_kz_vec(spectral_kspace.getModifiedKComponent(dm,2,norder_z,nodal)) + modified_ky_vec(spectral_kspace.getModifiedKComponent(dm,1,norder_y,grid_type)), + modified_kz_vec(spectral_kspace.getModifiedKComponent(dm,2,norder_z,grid_type)) #else - modified_kz_vec(spectral_kspace.getModifiedKComponent(dm,1,norder_z,nodal)) + modified_kz_vec(spectral_kspace.getModifiedKComponent(dm,1,norder_z,grid_type)) #endif { #if !defined(WARPX_DIM_3D) diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithmRZ.H b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithmRZ.H index a2e293dc2..37bb862a9 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithmRZ.H +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithmRZ.H @@ -63,10 +63,10 @@ class SpectralBaseAlgorithmRZ SpectralBaseAlgorithmRZ(SpectralKSpaceRZ const & spectral_kspace, amrex::DistributionMapping const & dm, const SpectralFieldIndex& spectral_index, - int const norder_z, bool const nodal) + int const norder_z, short const grid_type) // Compute and assign the modified k vectors : m_spectral_index(spectral_index), - modified_kz_vec(spectral_kspace.getModifiedKComponent(dm, 1, norder_z, nodal)) + modified_kz_vec(spectral_kspace.getModifiedKComponent(dm, 1, norder_z, grid_type)) {} SpectralFieldIndex m_spectral_index; |