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