WarpX
SpectralHankelTransformer.H
Go to the documentation of this file.
1 /* Copyright 2019-2020 David Grote
2  *
3  * This file is part of WarpX.
4  *
5  * License: BSD-3-Clause-LBNL
6  */
7 #ifndef WARPX_SPECTRALHANKELTRANSFORMER_H_
8 #define WARPX_SPECTRALHANKELTRANSFORMER_H_
9 
10 #include "HankelTransform.H"
11 
12 #include <AMReX_FArrayBox.H>
13 
14 /* \brief Object that allows to transform the fields back and forth between the
15  * spectral and interpolation grid.
16  *
17  * Attributes :
18  * - dht0, dhtm, dhtp : the discrete Hankel transform objects for the modes,
19  * operating along r
20 */
21 
23 {
24  public:
25 
27 
29  int n_rz_azimuthal_modes,
30  amrex::Real rmax);
31 
32  void
33  ExtractKrArray ();
34 
35  // Returns an array that holds the kr for all of the modes
36  [[nodiscard]] HankelTransform::RealVector const & getKrArray () const {return m_kr;}
37 
38  // Converts a scalar field from the physical to the spectral space
39  void
40  PhysicalToSpectral_Scalar (amrex::FArrayBox const & F_physical,
41  amrex::FArrayBox & G_spectral);
42 
43  // Converts a vector field from the physical to the spectral space
44  void
46  amrex::FArrayBox & F_r_physical,
47  amrex::FArrayBox & F_t_physical,
48  amrex::FArrayBox & G_p_spectral,
49  amrex::FArrayBox & G_m_spectral);
50 
51  // Converts a scalar field from the spectral to the physical space
52  void
53  SpectralToPhysical_Scalar (amrex::FArrayBox const & G_spectral,
54  amrex::FArrayBox & F_physical);
55 
56  // Converts a vector field from the spectral to the physical space
57  void
59  amrex::FArrayBox const & G_p_spectral,
60  amrex::FArrayBox const & G_m_spectral,
61  amrex::FArrayBox & F_r_physical,
62  amrex::FArrayBox & F_t_physical);
63 
64  private:
65 
66  int m_nr;
69 
73 };
74 
75 #endif
Definition: SpectralHankelTransformer.H:23
SpectralHankelTransformer()=default
void PhysicalToSpectral_Scalar(amrex::FArrayBox const &F_physical, amrex::FArrayBox &G_spectral)
Definition: SpectralHankelTransformer.cpp:60
int m_nr
Definition: SpectralHankelTransformer.H:66
void SpectralToPhysical_Scalar(amrex::FArrayBox const &G_spectral, amrex::FArrayBox &F_physical)
Definition: SpectralHankelTransformer.cpp:132
amrex::Vector< std::unique_ptr< HankelTransform > > dhtp
Definition: SpectralHankelTransformer.H:72
HankelTransform::RealVector const & getKrArray() const
Definition: SpectralHankelTransformer.H:36
void SpectralToPhysical_Vector(amrex::Box const &box, amrex::FArrayBox const &G_p_spectral, amrex::FArrayBox const &G_m_spectral, amrex::FArrayBox &F_r_physical, amrex::FArrayBox &F_t_physical)
Definition: SpectralHankelTransformer.cpp:159
amrex::Vector< std::unique_ptr< HankelTransform > > dht0
Definition: SpectralHankelTransformer.H:70
amrex::Vector< std::unique_ptr< HankelTransform > > dhtm
Definition: SpectralHankelTransformer.H:71
void ExtractKrArray()
Definition: SpectralHankelTransformer.cpp:36
void PhysicalToSpectral_Vector(amrex::Box const &box, amrex::FArrayBox &F_r_physical, amrex::FArrayBox &F_t_physical, amrex::FArrayBox &G_p_spectral, amrex::FArrayBox &G_m_spectral)
Definition: SpectralHankelTransformer.cpp:85
int m_n_rz_azimuthal_modes
Definition: SpectralHankelTransformer.H:67
HankelTransform::RealVector m_kr
Definition: SpectralHankelTransformer.H:68