diff options
author | 2020-01-27 15:55:22 -0800 | |
---|---|---|
committer | 2020-01-27 15:55:22 -0800 | |
commit | 6d77161d6e80b943230c2969c15674fe044cdb30 (patch) | |
tree | 37bbf756000df5f015f211b7ee2d15132ec6d166 /Source/Parallelization/GuardCellManager.H | |
parent | 658c6888a1cf1de2828a187d6d051a6bc5a2f4cb (diff) | |
parent | 6a06d68c805e81e7f942716c07873d07f9b668e7 (diff) | |
download | WarpX-6d77161d6e80b943230c2969c15674fe044cdb30.tar.gz WarpX-6d77161d6e80b943230c2969c15674fe044cdb30.tar.zst WarpX-6d77161d6e80b943230c2969c15674fe044cdb30.zip |
Merge branch 'dev' into templated_fdtd_solver
Diffstat (limited to 'Source/Parallelization/GuardCellManager.H')
-rw-r--r-- | Source/Parallelization/GuardCellManager.H | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/Source/Parallelization/GuardCellManager.H b/Source/Parallelization/GuardCellManager.H new file mode 100644 index 000000000..c57745b84 --- /dev/null +++ b/Source/Parallelization/GuardCellManager.H @@ -0,0 +1,76 @@ +#ifndef GUARDCELLMANAGER_H_ +#define GUARDCELLMANAGER_H_ + +#include <AMReX_IntVect.H> + +/** + * \brief This class computes and stores the number of guard cells needed for + * the allocation of the MultiFabs and required for each part of the PIC loop. + */ +class guardCellManager{ + +public: + + /** + * \brief Initialize number of guard cells depending on the options used. + * + * \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 do_moving_window bool, whether to use moving window + * \param do_fft_mpi_dec bool, whether to do parallel FFTs for PSATD + * \param aux_is_nodal bool, true if the aux grid is nodal + * \param moving_window_dir direction of moving window + * \param nox order of current deposition + * \param nox_fft order of PSATD in x direction + * \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_fdtd_solver_id if of Maxwell solver + * \param max_level max level of the simulation + */ + void Init( + const bool do_subcycling, + const bool do_fdtd_nci_corr, + const bool do_nodal, + const bool do_moving_window, + const bool do_fft_mpi_dec, + const bool aux_is_nodal, + const int moving_window_dir, + const int nox, + const int nox_fft, const int noy_fft, const int noz_fft, + const int nci_corr_stencil, + const int maxwell_fdtd_solver_id, + const int max_level, + const bool exchange_all_guard_cells); + + // Guard cells allocated for MultiFabs E and B + amrex::IntVect ng_alloc_EB = amrex::IntVect::TheZeroVector(); + // Guard cells allocated for MultiFab J + amrex::IntVect ng_alloc_J = amrex::IntVect::TheZeroVector(); + // Guard cells allocated for MultiFab Rho + amrex::IntVect ng_alloc_Rho = amrex::IntVect::TheZeroVector(); + // Guard cells allocated for MultiFab F + amrex::IntVect ng_alloc_F = amrex::IntVect::TheZeroVector(); + + // Guard cells exchanged for specific parts of the PIC loop + + // Number of guard cells of E and B that must exchanged before Field Solver + amrex::IntVect ng_FieldSolver = amrex::IntVect::TheZeroVector(); + // Number of guard cells of F that must exchanged before Field Solver + amrex::IntVect ng_FieldSolverF = amrex::IntVect::TheZeroVector(); + // Number of guard cells of E and B that must exchanged before Field Gather + amrex::IntVect ng_FieldGather = amrex::IntVect::TheZeroVector(); + // Number of guard cells of E and B that must exchanged before updating the Aux grid + amrex::IntVect ng_UpdateAux = amrex::IntVect::TheZeroVector(); + // Number of guard cells of all MultiFabs that must exchanged before moving window + amrex::IntVect ng_MovingWindow = amrex::IntVect::TheZeroVector(); + + // When the auxiliary grid is nodal but the field solver is staggered + // (typically with momentum-conserving gather with FDTD Yee solver), + // An extra guard cell is needed on the fine grid to do the interpolation + // for E and B. + amrex::IntVect ng_Extra = amrex::IntVect::TheZeroVector(); +}; + +#endif // GUARDCELLMANAGER_H_ |