WarpX
PsatdAlgorithmPml.H
Go to the documentation of this file.
1 /* Copyright 2019 Axel Huebl, Remi Lehe
2  *
3  * This file is part of WarpX.
4  *
5  * License: BSD-3-Clause-LBNL
6  */
7 #ifndef WARPX_PSATD_ALGORITHM_PML_H_
8 #define WARPX_PSATD_ALGORITHM_PML_H_
9 
10 #include "SpectralBaseAlgorithm.H"
11 
14 
15 #include <AMReX_REAL.H>
16 
17 #include <AMReX_BaseFwd.H>
18 
19 #include <array>
20 #include <memory>
21 
22 #if WARPX_USE_PSATD
23 
24 /*
25  * \brief Class that updates the field in spectral space
26  * and stores the coefficients of the corresponding update equation.
27  */
29 {
30  public:
31 
48  const SpectralKSpace& spectral_kspace,
50  const SpectralFieldIndex& spectral_index,
51  int norder_x,
52  int norder_y,
53  int norder_z,
54  short grid_type,
55  const amrex::Vector<amrex::Real>& v_galilean,
56  amrex::Real dt,
57  bool dive_cleaning,
58  bool divb_cleaning);
59 
68  const SpectralKSpace& spectral_kspace,
69  const amrex::DistributionMapping& dm);
70 
77  void pushSpectralFields(SpectralFieldData& f) const final;
78 
88  void CurrentCorrection (SpectralFieldData& field_data) final;
89 
99  void VayDeposition (SpectralFieldData& field_data) final;
100 
101  private:
102 
105  // Centered modified finite-order k vectors
107 #if defined(WARPX_DIM_3D)
108  KVectorComponent modified_ky_vec_centered;
109 #endif
112  amrex::Real m_dt;
116 };
117 
118 #endif // WARPX_USE_PSATD
119 #endif // WARPX_PSATD_ALGORITHM_PML_H_
Definition: PsatdAlgorithmPml.H:29
amrex::Real m_dt
Definition: PsatdAlgorithmPml.H:112
KVectorComponent modified_kz_vec_centered
Definition: PsatdAlgorithmPml.H:110
void pushSpectralFields(SpectralFieldData &f) const final
Updates the E and B fields in spectral space, according to the relevant PSATD equations.
Definition: PsatdAlgorithmPml.cpp:78
void InitializeSpectralCoefficients(const SpectralKSpace &spectral_kspace, const amrex::DistributionMapping &dm)
Initializes the coefficients used in pushSpectralFields to update the E and B fields.
Definition: PsatdAlgorithmPml.cpp:376
void VayDeposition(SpectralFieldData &field_data) final
Virtual function for Vay current deposition in Fourier space (Vay et al, 2013). This function overrid...
Definition: PsatdAlgorithmPml.cpp:464
KVectorComponent modified_kx_vec_centered
Definition: PsatdAlgorithmPml.H:106
SpectralComplexCoefficients T2_coef
Definition: PsatdAlgorithmPml.H:104
amrex::Vector< amrex::Real > m_v_galilean
Definition: PsatdAlgorithmPml.H:111
bool m_is_galilean
Definition: PsatdAlgorithmPml.H:115
PsatdAlgorithmPml(const SpectralKSpace &spectral_kspace, const amrex::DistributionMapping &dm, const SpectralFieldIndex &spectral_index, int norder_x, int norder_y, int norder_z, short grid_type, const amrex::Vector< amrex::Real > &v_galilean, amrex::Real dt, bool dive_cleaning, bool divb_cleaning)
Constructor of the class PsatdAlgorithmPml.
Definition: PsatdAlgorithmPml.cpp:33
void CurrentCorrection(SpectralFieldData &field_data) final
Virtual function for current correction in Fourier space (Vay et al, 2013). This function overrides t...
Definition: PsatdAlgorithmPml.cpp:459
bool m_divb_cleaning
Definition: PsatdAlgorithmPml.H:114
bool m_dive_cleaning
Definition: PsatdAlgorithmPml.H:113
SpectralRealCoefficients inv_k2_coef
Definition: PsatdAlgorithmPml.H:103
SpectralRealCoefficients S_ck_coef
Definition: PsatdAlgorithmPml.H:103
SpectralRealCoefficients C_coef
Definition: PsatdAlgorithmPml.H:103
Definition: SpectralBaseAlgorithm.H:36
Class that stores the fields in spectral space, and performs the Fourier transforms between real spac...
Definition: SpectralFieldData.H:143
Definition: SpectralFieldData.H:34
Class that represents the spectral space.
Definition: SpectralKSpace.H:48
float dt
Definition: stencil.py:442