WarpX
GuardCellManager.H
Go to the documentation of this file.
1 /* Copyright 2019-2020 Maxence Thevenet
2  *
3  * This file is part of WarpX.
4  *
5  * License: BSD-3-Clause-LBNL
6  */
7 #ifndef GUARDCELLMANAGER_H_
8 #define GUARDCELLMANAGER_H_
9 
10 #include <AMReX_IntVect.H>
11 
17 
18 public:
19 
37  void Init(
38  const bool do_subcycling,
39  const bool do_fdtd_nci_corr,
40  const bool do_nodal,
41  const bool do_moving_window,
42  const bool aux_is_nodal,
43  const int moving_window_dir,
44  const int nox,
45  const int nox_fft, const int noy_fft, const int noz_fft,
46  const int nci_corr_stencil,
47  const int maxwell_solver_id,
48  const int max_level,
49  const amrex::Array<amrex::Real,3> v_galilean,
50  const bool safe_guard_cells);
51 
52  // Guard cells allocated for MultiFabs E and B
53  amrex::IntVect ng_alloc_EB = amrex::IntVect::TheZeroVector();
54  // Guard cells allocated for MultiFab J
55  amrex::IntVect ng_alloc_J = amrex::IntVect::TheZeroVector();
56  // Guard cells allocated for MultiFab Rho
57  amrex::IntVect ng_alloc_Rho = amrex::IntVect::TheZeroVector();
58  // Guard cells allocated for MultiFab F
59  amrex::IntVect ng_alloc_F = amrex::IntVect::TheZeroVector();
60 
61  // Guard cells exchanged for specific parts of the PIC loop
62 
63  // Number of guard cells of E and B that must exchanged before Field Solver
64  amrex::IntVect ng_FieldSolver = amrex::IntVect::TheZeroVector();
65  // Number of guard cells of F that must exchanged before Field Solver
66  amrex::IntVect ng_FieldSolverF = amrex::IntVect::TheZeroVector();
67  // Number of guard cells of E and B that must exchanged before Field Gather
68  amrex::IntVect ng_FieldGather = amrex::IntVect::TheZeroVector();
69  // Number of guard cells of E and B that must exchanged before updating the Aux grid
70  amrex::IntVect ng_UpdateAux = amrex::IntVect::TheZeroVector();
71  // Number of guard cells of all MultiFabs that must exchanged before moving window
72  amrex::IntVect ng_MovingWindow = amrex::IntVect::TheZeroVector();
73 
74  // When the auxiliary grid is nodal but the field solver is staggered
75  // (typically with momentum-conserving gather with FDTD Yee solver),
76  // An extra guard cell is needed on the fine grid to do the interpolation
77  // for E and B.
78  amrex::IntVect ng_Extra = amrex::IntVect::TheZeroVector();
79 
80  // Number of guard cells for local deposition of J and rho
81  amrex::IntVect ng_depos_J = amrex::IntVect::TheZeroVector();
82  amrex::IntVect ng_depos_rho = amrex::IntVect::TheZeroVector();
83 };
84 
85 #endif // GUARDCELLMANAGER_H_
amrex::IntVect ng_FieldSolverF
Definition: GuardCellManager.H:66
amrex::IntVect ng_depos_rho
Definition: GuardCellManager.H:82
amrex::IntVect ng_alloc_J
Definition: GuardCellManager.H:55
amrex::IntVect ng_alloc_Rho
Definition: GuardCellManager.H:57
amrex::IntVect ng_alloc_F
Definition: GuardCellManager.H:59
void Init(const bool do_subcycling, const bool do_fdtd_nci_corr, const bool do_nodal, const bool do_moving_window, 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_solver_id, const int max_level, const amrex::Array< amrex::Real, 3 > v_galilean, const bool safe_guard_cells)
Initialize number of guard cells depending on the options used.
Definition: GuardCellManager.cpp:18
amrex::IntVect ng_FieldGather
Definition: GuardCellManager.H:68
amrex::IntVect ng_alloc_EB
Definition: GuardCellManager.H:53
amrex::IntVect ng_Extra
Definition: GuardCellManager.H:78
amrex::IntVect ng_UpdateAux
Definition: GuardCellManager.H:70
amrex::IntVect ng_MovingWindow
Definition: GuardCellManager.H:72
amrex::IntVect ng_FieldSolver
Definition: GuardCellManager.H:64
This class computes and stores the number of guard cells needed for the allocation of the MultiFabs a...
Definition: GuardCellManager.H:16
amrex::IntVect ng_depos_J
Definition: GuardCellManager.H:81