diff options
author | 2023-03-08 20:52:56 -0800 | |
---|---|---|
committer | 2023-03-09 04:52:56 +0000 | |
commit | 03b2fe60ff49748aaff8402824ea0457eef24d5c (patch) | |
tree | 1f29cb899516a03eecc5babd9e9a65f84a8f7dd4 /Source/Parallelization | |
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/Parallelization')
-rw-r--r-- | Source/Parallelization/GuardCellManager.H | 4 | ||||
-rw-r--r-- | Source/Parallelization/GuardCellManager.cpp | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/Source/Parallelization/GuardCellManager.H b/Source/Parallelization/GuardCellManager.H index 35df85514..bb0861975 100644 --- a/Source/Parallelization/GuardCellManager.H +++ b/Source/Parallelization/GuardCellManager.H @@ -28,7 +28,7 @@ public: * \param dx cell spacing * \param do_subcycling bool, whether to use subcycling * \param do_fdtd_nci_corr bool, whether to use Godfrey NCI corrector - * \param do_nodal bool, whether the field solver is nodal + * \param grid_type integer, whether the grid is collocated or staggered * \param do_moving_window bool, whether to use moving window * \param moving_window_dir direction of moving window * \param nox order of current deposition @@ -55,7 +55,7 @@ public: const amrex::RealVect dx, const bool do_subcycling, const bool do_fdtd_nci_corr, - const bool do_nodal, + const short grid_type, const bool do_moving_window, const int moving_window_dir, const int nox, diff --git a/Source/Parallelization/GuardCellManager.cpp b/Source/Parallelization/GuardCellManager.cpp index aa9d9f448..5c151412b 100644 --- a/Source/Parallelization/GuardCellManager.cpp +++ b/Source/Parallelization/GuardCellManager.cpp @@ -36,7 +36,7 @@ guardCellManager::Init ( const amrex::RealVect dx, const bool do_subcycling, const bool do_fdtd_nci_corr, - const bool do_nodal, + const short grid_type, const bool do_moving_window, const int moving_window_dir, const int nox, @@ -195,9 +195,9 @@ guardCellManager::Init ( // currents in the latter case). This does not seem to be necessary in x and y, // where it still seems fine to set half the number of guard cells of the nodal case. - int ngFFt_x = do_nodal ? nox_fft : nox_fft / 2; - int ngFFt_y = do_nodal ? noy_fft : noy_fft / 2; - int ngFFt_z = (do_nodal || galilean) ? noz_fft : noz_fft / 2; + int ngFFt_x = (grid_type == GridType::Collocated) ? nox_fft : nox_fft / 2; + int ngFFt_y = (grid_type == GridType::Collocated) ? noy_fft : noy_fft / 2; + int ngFFt_z = (grid_type == GridType::Collocated || galilean) ? noz_fft : noz_fft / 2; ParmParse pp_psatd("psatd"); utils::parser::queryWithParser(pp_psatd, "nx_guard", ngFFt_x); @@ -258,7 +258,7 @@ guardCellManager::Init ( } #else else { - if (do_nodal) { + if (grid_type == GridType::Collocated) { ng_FieldSolver = CartesianNodalAlgorithm::GetMaxGuardCell(); ng_FieldSolverF = CartesianNodalAlgorithm::GetMaxGuardCell(); ng_FieldSolverG = CartesianNodalAlgorithm::GetMaxGuardCell(); |