diff options
Diffstat (limited to 'Source/Parallelization')
-rw-r--r-- | Source/Parallelization/GuardCellManager.H | 6 | ||||
-rw-r--r-- | Source/Parallelization/GuardCellManager.cpp | 23 | ||||
-rw-r--r-- | Source/Parallelization/WarpXComm.cpp | 2 | ||||
-rw-r--r-- | Source/Parallelization/WarpXRegrid.cpp | 10 | ||||
-rw-r--r-- | Source/Parallelization/WarpXSumGuardCells.H | 4 |
5 files changed, 21 insertions, 24 deletions
diff --git a/Source/Parallelization/GuardCellManager.H b/Source/Parallelization/GuardCellManager.H index c122aaa96..248a3dabf 100644 --- a/Source/Parallelization/GuardCellManager.H +++ b/Source/Parallelization/GuardCellManager.H @@ -36,12 +36,11 @@ public: * \param noy_fft order of PSATD in y direction * \param noz_fft order of PSATD in z direction * \param nci_corr_stencil stencil of NCI corrector - * \param maxwell_solver_id if of Maxwell solver + * \param electromagnetic_solver_id Integer corresponding to the type of Maxwell solver * \param max_level max level of the simulation * \param v_galilean Velocity used in the Galilean PSATD scheme * \param v_comoving Velocity used in the comoving PSATD scheme * \param safe_guard_cells Run in safe mode, exchanging more guard cells, and more often in the PIC loop (for debugging). - * \param do_electrostatic Whether to run in electrostatic mode i.e. solving the Poisson equation instead of the Maxwell equations. * \param do_multi_J Whether to use the multi-J PSATD scheme * \param fft_do_time_averaging Whether to average the E and B field in time (with PSATD) before interpolating them onto the macro-particles * \param do_pml whether pml is turned on (only used by RZ PSATD) @@ -60,12 +59,11 @@ public: 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, 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; } diff --git a/Source/Parallelization/WarpXComm.cpp b/Source/Parallelization/WarpXComm.cpp index 396b0f24b..fed81f2fc 100644 --- a/Source/Parallelization/WarpXComm.cpp +++ b/Source/Parallelization/WarpXComm.cpp @@ -65,7 +65,7 @@ void WarpX::UpdateAuxilaryDataStagToNodal () { #ifndef WARPX_USE_PSATD - if (maxwell_solver_id == MaxwellSolverAlgo::PSATD) { + if (electromagnetic_solver_id == ElectromagneticSolverAlgo::PSATD) { WARPX_ALWAYS_ASSERT_WITH_MESSAGE( false, "WarpX::UpdateAuxilaryDataStagToNodal: PSATD solver requires " "WarpX build with spectral solver support."); diff --git a/Source/Parallelization/WarpXRegrid.cpp b/Source/Parallelization/WarpXRegrid.cpp index 794a48a5b..99885f619 100644 --- a/Source/Parallelization/WarpXRegrid.cpp +++ b/Source/Parallelization/WarpXRegrid.cpp @@ -181,12 +181,10 @@ WarpX::RemakeLevel (int lev, Real /*time*/, const BoxArray& ba, const Distributi RemakeMultiFab(Bfield_avg_fp[lev][idim], dm, true); } #ifdef AMREX_USE_EB - if (WarpX::maxwell_solver_id == MaxwellSolverAlgo::Yee || - WarpX::maxwell_solver_id == MaxwellSolverAlgo::ECT || - WarpX::maxwell_solver_id == MaxwellSolverAlgo::CKC){ + if (WarpX::electromagnetic_solver_id != ElectromagneticSolverAlgo::PSATD) { RemakeMultiFab(m_edge_lengths[lev][idim], dm, false); RemakeMultiFab(m_face_areas[lev][idim], dm, false); - if(WarpX::maxwell_solver_id == MaxwellSolverAlgo::ECT){ + if(WarpX::electromagnetic_solver_id == ElectromagneticSolverAlgo::ECT){ RemakeMultiFab(Venl[lev][idim], dm, false); RemakeMultiFab(m_flag_info_face[lev][idim], dm, false); RemakeMultiFab(m_flag_ext_face[lev][idim], dm, false); @@ -218,7 +216,7 @@ WarpX::RemakeLevel (int lev, Real /*time*/, const BoxArray& ba, const Distributi #endif #ifdef WARPX_USE_PSATD - if (maxwell_solver_id == MaxwellSolverAlgo::PSATD) { + if (electromagnetic_solver_id == ElectromagneticSolverAlgo::PSATD) { if (spectral_solver_fp[lev] != nullptr) { // Get the cell-centered box BoxArray realspace_ba = ba; // Copy box @@ -282,7 +280,7 @@ WarpX::RemakeLevel (int lev, Real /*time*/, const BoxArray& ba, const Distributi RemakeMultiFab(rho_cp[lev], dm, false); #ifdef WARPX_USE_PSATD - if (maxwell_solver_id == MaxwellSolverAlgo::PSATD) { + if (electromagnetic_solver_id == ElectromagneticSolverAlgo::PSATD) { if (spectral_solver_cp[lev] != nullptr) { BoxArray cba = ba; cba.coarsen(refRatio(lev-1)); diff --git a/Source/Parallelization/WarpXSumGuardCells.H b/Source/Parallelization/WarpXSumGuardCells.H index 1bfbf5162..425ce3208 100644 --- a/Source/Parallelization/WarpXSumGuardCells.H +++ b/Source/Parallelization/WarpXSumGuardCells.H @@ -34,7 +34,7 @@ WarpXSumGuardCells(amrex::MultiFab& mf, const amrex::Periodicity& period, amrex::IntVect n_updated_guards; // Update both valid cells and guard cells - if (WarpX::maxwell_solver_id == MaxwellSolverAlgo::PSATD) + if (WarpX::electromagnetic_solver_id == ElectromagneticSolverAlgo::PSATD) n_updated_guards = mf.nGrowVect(); else // Update only the valid cells n_updated_guards = amrex::IntVect::TheZeroVector(); @@ -65,7 +65,7 @@ WarpXSumGuardCells(amrex::MultiFab& dst, amrex::MultiFab& src, amrex::IntVect n_updated_guards; // Update both valid cells and guard cells - if (WarpX::maxwell_solver_id == MaxwellSolverAlgo::PSATD) + if (WarpX::electromagnetic_solver_id == ElectromagneticSolverAlgo::PSATD) n_updated_guards = dst.nGrowVect(); else // Update only the valid cells n_updated_guards = amrex::IntVect::TheZeroVector(); |