From 03b2fe60ff49748aaff8402824ea0457eef24d5c Mon Sep 17 00:00:00 2001 From: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> Date: Wed, 8 Mar 2023 20:52:56 -0800 Subject: 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 --- Source/FieldSolver/SpectralSolver/SpectralSolverRZ.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Source/FieldSolver/SpectralSolver/SpectralSolverRZ.cpp') 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& 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( - 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( - 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( - 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 -- cgit v1.2.3