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 --- .../SpectralAlgorithms/PsatdAlgorithmComoving.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.cpp') 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& 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) -- cgit v1.2.3