aboutsummaryrefslogtreecommitdiff
path: root/Source/FieldSolver/SpectralSolver/SpectralSolverRZ.cpp
diff options
context:
space:
mode:
authorGravatar Edoardo Zoni <59625522+EZoni@users.noreply.github.com> 2023-03-08 20:52:56 -0800
committerGravatar GitHub <noreply@github.com> 2023-03-09 04:52:56 +0000
commit03b2fe60ff49748aaff8402824ea0457eef24d5c (patch)
tree1f29cb899516a03eecc5babd9e9a65f84a8f7dd4 /Source/FieldSolver/SpectralSolver/SpectralSolverRZ.cpp
parent92013ab8403512a0d42ee3ba49f474b72d1ed88f (diff)
downloadWarpX-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/SpectralSolverRZ.cpp')
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralSolverRZ.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/FieldSolver/SpectralSolver/SpectralSolverRZ.cpp b/Source/FieldSolver/SpectralSolver/SpectralSolverRZ.cpp
index 23d93fe04..9b0d2f21f 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralSolverRZ.cpp
+++ b/Source/FieldSolver/SpectralSolver/SpectralSolverRZ.cpp
@@ -20,7 +20,7 @@
*
* \param n_rz_azimuthal_modes Number of azimuthal modes
* \param norder_z Order of accuracy of the spatial derivatives along z
- * \param nodal Whether the solver is applied to a nodal or staggered grid
+ * \param grid_type Type of grid (collocated or not)
* \param dx Cell size along each dimension
* \param dt Time step
* \param with_pml Whether PML boundary will be used
@@ -29,7 +29,7 @@ SpectralSolverRZ::SpectralSolverRZ (const int lev,
amrex::BoxArray const & realspace_ba,
amrex::DistributionMapping const & dm,
int const n_rz_azimuthal_modes,
- int const norder_z, bool const nodal,
+ int const norder_z, short const grid_type,
const amrex::Vector<amrex::Real>& v_galilean,
amrex::RealVect const dx, amrex::Real const dt,
bool const with_pml,
@@ -56,17 +56,17 @@ SpectralSolverRZ::SpectralSolverRZ (const int lev,
// Initialize the corresponding coefficients over k space
if (with_pml) {
PML_algorithm = std::make_unique<PsatdAlgorithmPmlRZ>(
- k_space, dm, m_spectral_index, n_rz_azimuthal_modes, norder_z, nodal, dt);
+ k_space, dm, m_spectral_index, n_rz_azimuthal_modes, norder_z, grid_type, dt);
}
if (v_galilean[2] == 0) {
// v_galilean is 0: use standard PSATD algorithm
algorithm = std::make_unique<PsatdAlgorithmRZ>(
- k_space, dm, m_spectral_index, n_rz_azimuthal_modes, norder_z, nodal, dt,
+ k_space, dm, m_spectral_index, n_rz_azimuthal_modes, norder_z, grid_type, dt,
update_with_rho, fft_do_time_averaging, J_in_time, rho_in_time, dive_cleaning, divb_cleaning);
} else {
// Otherwise: use the Galilean algorithm
algorithm = std::make_unique<PsatdAlgorithmGalileanRZ>(
- k_space, dm, m_spectral_index, n_rz_azimuthal_modes, norder_z, nodal, v_galilean, dt, update_with_rho);
+ k_space, dm, m_spectral_index, n_rz_azimuthal_modes, norder_z, grid_type, v_galilean, dt, update_with_rho);
}
// - Initialize arrays for fields in spectral space + FFT plans