diff options
author | 2022-11-07 20:30:31 -0800 | |
---|---|---|
committer | 2022-11-07 20:30:31 -0800 | |
commit | bf535730cb6c170394da8375887b3ae57ad6ecf5 (patch) | |
tree | de7b2122acbc7e40d5f97c11afa779be689985c9 /Source/Parallelization/GuardCellManager.cpp | |
parent | ada6fc49cf16f40d1764d3a95c8338126360f329 (diff) | |
download | WarpX-bf535730cb6c170394da8375887b3ae57ad6ecf5.tar.gz WarpX-bf535730cb6c170394da8375887b3ae57ad6ecf5.tar.zst WarpX-bf535730cb6c170394da8375887b3ae57ad6ecf5.zip |
Allow `None` for Maxwell solver (#3504)
* Add "None" as an option for the Maxwell solver
* fixed some of the reasons for failing CI tests
* no longer pass `do_electrostatic` to `GuardCellManager`
* renamed `MaxwellSolverAlgo` to `ElectromagneticSolverAlgo`
* rename `do_electrostatic` to `electrostatic_solver_id`
* rename `maxwell_solver_id` to `electromagnetic_solver_id`
* changes requested during PR review
* remove `do_no_deposit` from tests without field evolution
* Fix doc-string in `GuardCellManager.H`
Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
Diffstat (limited to 'Source/Parallelization/GuardCellManager.cpp')
-rw-r--r-- | Source/Parallelization/GuardCellManager.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/Source/Parallelization/GuardCellManager.cpp b/Source/Parallelization/GuardCellManager.cpp index d01230e4b..aa9d9f448 100644 --- a/Source/Parallelization/GuardCellManager.cpp +++ b/Source/Parallelization/GuardCellManager.cpp @@ -42,12 +42,11 @@ guardCellManager::Init ( const int nox, const int nox_fft, const int noy_fft, const int noz_fft, const int nci_corr_stencil, - const int maxwell_solver_id, + const int electromagnetic_solver_id, const int max_level, const amrex::Vector<amrex::Real> v_galilean, const amrex::Vector<amrex::Real> v_comoving, const bool safe_guard_cells, - const int do_electrostatic, const int do_multi_J, const bool fft_do_time_averaging, const bool do_pml, @@ -135,7 +134,7 @@ guardCellManager::Init ( // Electromagnetic simulations: account for change in particle positions within half a time step // for current deposition and within one time step for charge deposition (since rho is needed // both at the beginning and at the end of the PIC iteration) - if (do_electrostatic == ElectrostaticSolverAlgo::None) + if (electromagnetic_solver_id != ElectromagneticSolverAlgo::None) { for (int i = 0; i < AMREX_SPACEDIM; i++) { @@ -170,7 +169,7 @@ guardCellManager::Init ( // After pushing particle int ng_alloc_F_int = (do_moving_window) ? 2 : 0; // CKC solver requires one additional guard cell - if (maxwell_solver_id == MaxwellSolverAlgo::CKC) ng_alloc_F_int = std::max( ng_alloc_F_int, 1 ); + if (electromagnetic_solver_id == ElectromagneticSolverAlgo::CKC) ng_alloc_F_int = std::max( ng_alloc_F_int, 1 ); ng_alloc_F = IntVect(AMREX_D_DECL(ng_alloc_F_int, ng_alloc_F_int, ng_alloc_F_int)); // Used if warpx.do_divb_cleaning = 1 @@ -178,7 +177,7 @@ guardCellManager::Init ( // TODO Does the CKC solver require one additional guard cell (as for F)? ng_alloc_G = IntVect(AMREX_D_DECL(ng_alloc_G_int, ng_alloc_G_int, ng_alloc_G_int)); - if (maxwell_solver_id == MaxwellSolverAlgo::PSATD) + if (electromagnetic_solver_id == ElectromagneticSolverAlgo::PSATD) { // The number of guard cells should be enough to contain the stencil of the FFT solver. // @@ -245,13 +244,14 @@ guardCellManager::Init ( } // Compute number of cells required for Field Solver - if (maxwell_solver_id == MaxwellSolverAlgo::PSATD) { + if (electromagnetic_solver_id == ElectromagneticSolverAlgo::PSATD) { ng_FieldSolver = ng_alloc_EB; ng_FieldSolverF = ng_alloc_EB; ng_FieldSolverG = ng_alloc_EB; } #ifdef WARPX_DIM_RZ - else if (maxwell_solver_id == MaxwellSolverAlgo::Yee) { + else if (electromagnetic_solver_id == ElectromagneticSolverAlgo::None || + electromagnetic_solver_id == ElectromagneticSolverAlgo::Yee) { ng_FieldSolver = CylindricalYeeAlgorithm::GetMaxGuardCell(); ng_FieldSolverF = CylindricalYeeAlgorithm::GetMaxGuardCell(); ng_FieldSolverG = CylindricalYeeAlgorithm::GetMaxGuardCell(); @@ -262,12 +262,13 @@ guardCellManager::Init ( ng_FieldSolver = CartesianNodalAlgorithm::GetMaxGuardCell(); ng_FieldSolverF = CartesianNodalAlgorithm::GetMaxGuardCell(); ng_FieldSolverG = CartesianNodalAlgorithm::GetMaxGuardCell(); - } else if (maxwell_solver_id == MaxwellSolverAlgo::Yee - || maxwell_solver_id == MaxwellSolverAlgo::ECT) { + } else if (electromagnetic_solver_id == ElectromagneticSolverAlgo::None || + electromagnetic_solver_id == ElectromagneticSolverAlgo::Yee || + electromagnetic_solver_id == ElectromagneticSolverAlgo::ECT) { ng_FieldSolver = CartesianYeeAlgorithm::GetMaxGuardCell(); ng_FieldSolverF = CartesianYeeAlgorithm::GetMaxGuardCell(); ng_FieldSolverG = CartesianYeeAlgorithm::GetMaxGuardCell(); - } else if (maxwell_solver_id == MaxwellSolverAlgo::CKC) { + } else if (electromagnetic_solver_id == ElectromagneticSolverAlgo::CKC) { ng_FieldSolver = CartesianCKCAlgorithm::GetMaxGuardCell(); ng_FieldSolverF = CartesianCKCAlgorithm::GetMaxGuardCell(); ng_FieldSolverG = CartesianCKCAlgorithm::GetMaxGuardCell(); @@ -281,7 +282,7 @@ guardCellManager::Init ( ng_alloc_F.max( ng_FieldSolverF ); ng_alloc_G.max( ng_FieldSolverG ); - if (do_moving_window && maxwell_solver_id == MaxwellSolverAlgo::PSATD) { + if (do_moving_window && electromagnetic_solver_id == ElectromagneticSolverAlgo::PSATD) { ng_afterPushPSATD = ng_alloc_EB; } |