diff options
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; } |