ARTEMIS
PML_RZ.H
Go to the documentation of this file.
1 /* Copyright 2021 David Grote
2  *
3  *
4  * This file is part of WarpX.
5  *
6  * License: BSD-3-Clause-LBNL
7  */
8 #ifndef WARPX_PML_RZ_H_
9 #define WARPX_PML_RZ_H_
10 
11 #include "PML_RZ_fwd.H"
12 
13 #ifdef WARPX_USE_PSATD
15 #endif
16 
17 #include <AMReX_MultiFab.H>
18 #include <AMReX_BoxArray.H>
19 #include <AMReX_Config.H>
20 #include <AMReX_REAL.H>
21 
22 #include <AMReX_BaseFwd.H>
23 
24 #include <array>
25 #include <string>
26 
27 enum struct PatchType : int;
28 
29 class PML_RZ
30 {
31 public:
32  PML_RZ (const int lev, const amrex::BoxArray& grid_ba, const amrex::DistributionMapping& grid_dm,
33  const amrex::Geometry* geom, const int ncell, const int do_pml_in_domain);
34 
35  void ApplyDamping(amrex::MultiFab* Et_fp, amrex::MultiFab* Ez_fp,
36  amrex::MultiFab* Bt_fp, amrex::MultiFab* Bz_fp,
37  amrex::Real dt);
38 
39  std::array<amrex::MultiFab*,2> GetE_fp ();
40  std::array<amrex::MultiFab*,2> GetB_fp ();
41 
42 #ifdef WARPX_USE_PSATD
43  void PushPSATD (const int lev);
44 #endif
45 
46  void FillBoundaryE ();
47  void FillBoundaryB ();
48  void FillBoundaryE (PatchType patch_type);
49  void FillBoundaryB (PatchType patch_type);
50 
51  void CheckPoint (const std::string& dir) const;
52  void Restart (const std::string& dir);
53 
54  ~PML_RZ () = default;
55 
56 private:
57 
58  const int m_ncell;
59  const int m_do_pml_in_domain;
61 
62  // Only contains Er and Et, and Br and Bt
63  std::array<std::unique_ptr<amrex::MultiFab>,2> pml_E_fp;
64  std::array<std::unique_ptr<amrex::MultiFab>,2> pml_B_fp;
65 
66 #ifdef WARPX_USE_PSATD
67  void PushPMLPSATDSinglePatchRZ ( const int lev,
68  SpectralSolverRZ& solver,
69  std::array<std::unique_ptr<amrex::MultiFab>,2>& pml_E,
70  std::array<std::unique_ptr<amrex::MultiFab>,2>& pml_B);
71 #endif
72 
73 };
74 
75 #endif
PatchType
Definition: WarpX.H:74
Definition: PML_RZ.H:30
const int m_do_pml_in_domain
Definition: PML_RZ.H:59
void PushPSATD(const int lev)
Definition: PML_RZ.cpp:195
std::array< std::unique_ptr< amrex::MultiFab >, 2 > pml_E_fp
Definition: PML_RZ.H:63
void FillBoundaryB()
Definition: PML_RZ.cpp:153
PML_RZ(const int lev, const amrex::BoxArray &grid_ba, const amrex::DistributionMapping &grid_dm, const amrex::Geometry *geom, const int ncell, const int do_pml_in_domain)
Definition: PML_RZ.cpp:37
std::array< amrex::MultiFab *, 2 > GetB_fp()
Definition: PML_RZ.cpp:130
void ApplyDamping(amrex::MultiFab *Et_fp, amrex::MultiFab *Ez_fp, amrex::MultiFab *Bt_fp, amrex::MultiFab *Bz_fp, amrex::Real dt)
Definition: PML_RZ.cpp:61
void FillBoundaryE()
Definition: PML_RZ.cpp:136
const amrex::Geometry * m_geom
Definition: PML_RZ.H:60
std::array< amrex::MultiFab *, 2 > GetE_fp()
Definition: PML_RZ.cpp:124
~PML_RZ()=default
const int m_ncell
Definition: PML_RZ.H:58
std::array< std::unique_ptr< amrex::MultiFab >, 2 > pml_B_fp
Definition: PML_RZ.H:64
Definition: SpectralSolverRZ.H:22
const int[]
int dt
Definition: stencil.py:440