aboutsummaryrefslogtreecommitdiff
path: root/Source/Initialization/WarpXInitData.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/Initialization/WarpXInitData.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/Initialization/WarpXInitData.cpp')
-rw-r--r--Source/Initialization/WarpXInitData.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/Source/Initialization/WarpXInitData.cpp b/Source/Initialization/WarpXInitData.cpp
index 43bd597bd..cf5eda4ea 100644
--- a/Source/Initialization/WarpXInitData.cpp
+++ b/Source/Initialization/WarpXInitData.cpp
@@ -267,14 +267,15 @@ WarpX::PrintMainPICparameters ()
}
#endif // WARPX_USE_PSATD
- if (do_nodal==1){
- amrex::Print() << " | - nodal mode \n";
+ if (grid_type == GridType::Collocated){
+ amrex::Print() << " | - collocated grid \n";
}
#ifdef WARPX_USE_PSATD
- if ( (do_nodal==0) && (field_gathering_algo == GatheringAlgo::EnergyConserving) ){
- amrex::Print()<<" | - staggered mode " << "\n";
+ if ( (grid_type == GridType::Staggered) && (field_gathering_algo == GatheringAlgo::EnergyConserving) ){
+ amrex::Print()<<" | - staggered grid " << "\n";
}
- else if ( (do_nodal==0) && (field_gathering_algo == GatheringAlgo::MomentumConserving) ){
+ else if ( (grid_type == GridType::Hybrid) && (field_gathering_algo == GatheringAlgo::MomentumConserving) ){
+ amrex::Print()<<" | - hybrid grid " << "\n";
if (dims=="3"){
amrex::Print() << " | - field_centering_nox = " << WarpX::field_centering_nox << "\n";
amrex::Print() << " | - field_centering_noy = " << WarpX::field_centering_noy << "\n";
@@ -490,7 +491,7 @@ WarpX::InitPML ()
// to the PML, for example in the presence of mesh refinement patches)
pml[0] = std::make_unique<PML>(0, boxArray(0), DistributionMap(0), &Geom(0), nullptr,
pml_ncell, pml_delta, amrex::IntVect::TheZeroVector(),
- dt[0], nox_fft, noy_fft, noz_fft, do_nodal,
+ dt[0], nox_fft, noy_fft, noz_fft, grid_type,
do_moving_window, pml_has_particles, do_pml_in_domain,
psatd_solution_type, J_in_time, rho_in_time,
do_pml_dive_cleaning, do_pml_divb_cleaning,
@@ -527,7 +528,7 @@ WarpX::InitPML ()
pml[lev] = std::make_unique<PML>(lev, boxArray(lev), DistributionMap(lev),
&Geom(lev), &Geom(lev-1),
pml_ncell, pml_delta, refRatio(lev-1),
- dt[lev], nox_fft, noy_fft, noz_fft, do_nodal,
+ dt[lev], nox_fft, noy_fft, noz_fft, grid_type,
do_moving_window, pml_has_particles, do_pml_in_domain,
psatd_solution_type, J_in_time, rho_in_time, do_pml_dive_cleaning, do_pml_divb_cleaning,
amrex::IntVect(0), amrex::IntVect(0),