WarpX
PsatdAlgorithmComoving.H
Go to the documentation of this file.
1 #ifndef WARPX_PSATD_ALGORITHM_COMOVING_H_
2 #define WARPX_PSATD_ALGORITHM_COMOVING_H_
3 
7 
8 #include <AMReX_Array.H>
9 #include <AMReX_Config.H>
10 #include <AMReX_REAL.H>
11 
12 #include <AMReX_BaseFwd.H>
13 
14 #include <array>
15 #include <memory>
16 
17 #if WARPX_USE_PSATD
18 
19 /* \brief Class that updates the field in spectral space and stores the coefficients
20  * of the corresponding update equation, according to the comoving spectral scheme.
21  */
23 {
24  public:
25 
29  PsatdAlgorithmComoving (const SpectralKSpace& spectral_kspace,
31  const SpectralFieldIndex& spectral_index,
32  int norder_x,
33  int norder_y,
34  int norder_z,
35  short grid_type,
36  const amrex::Vector<amrex::Real>& v_comoving,
37  amrex::Real dt,
38  bool update_with_rho);
39 
43  void pushSpectralFields (SpectralFieldData& f) const final;
44 
45  /* \brief Initialize the coefficients needed in the update equations
46  */
47  void InitializeSpectralCoefficients (const SpectralKSpace& spectral_kspace,
49  amrex::Real dt);
50 
59  void CurrentCorrection (SpectralFieldData& field_data) final;
60 
69  void VayDeposition (SpectralFieldData& field_data) final;
70 
71  private:
72 
73  // Real and complex spectral coefficients
76 
77  // k vectors
79 #if defined(WARPX_DIM_3D)
80  KVectorComponent ky_vec;
81 #endif
83 
84  // Additional member variables
86  amrex::Real m_dt;
87 };
88 
89 #endif // WARPX_USE_PSATD
90 #endif // WARPX_PSATD_ALGORITHM_COMOVING_H_
Definition: PsatdAlgorithmComoving.H:23
amrex::Vector< amrex::Real > m_v_comoving
Definition: PsatdAlgorithmComoving.H:85
SpectralComplexCoefficients X2_coef
Definition: PsatdAlgorithmComoving.H:75
KVectorComponent kx_vec
Definition: PsatdAlgorithmComoving.H:78
void InitializeSpectralCoefficients(const SpectralKSpace &spectral_kspace, const amrex::DistributionMapping &dm, amrex::Real dt)
Definition: PsatdAlgorithmComoving.cpp:159
SpectralComplexCoefficients Theta2_coef
Definition: PsatdAlgorithmComoving.H:75
void pushSpectralFields(SpectralFieldData &f) const final
Override the update equations in Fourier space.
Definition: PsatdAlgorithmComoving.cpp:68
KVectorComponent kz_vec
Definition: PsatdAlgorithmComoving.H:82
void CurrentCorrection(SpectralFieldData &field_data) final
Virtual function for current correction in Fourier space. This function overrides the virtual functio...
Definition: PsatdAlgorithmComoving.cpp:414
amrex::Real m_dt
Definition: PsatdAlgorithmComoving.H:86
PsatdAlgorithmComoving(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_comoving, amrex::Real dt, bool update_with_rho)
Class constructor.
Definition: PsatdAlgorithmComoving.cpp:26
SpectralRealCoefficients C_coef
Definition: PsatdAlgorithmComoving.H:74
void VayDeposition(SpectralFieldData &field_data) final
Virtual function for Vay current deposition in Fourier space. This function overrides the virtual fun...
Definition: PsatdAlgorithmComoving.cpp:502
SpectralComplexCoefficients X1_coef
Definition: PsatdAlgorithmComoving.H:75
SpectralRealCoefficients S_ck_coef
Definition: PsatdAlgorithmComoving.H:74
SpectralComplexCoefficients X3_coef
Definition: PsatdAlgorithmComoving.H:75
SpectralComplexCoefficients X4_coef
Definition: PsatdAlgorithmComoving.H:75
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