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 <AMReX_FArrayBox.H>
11 #include "HankelTransform.H"
12 
13 /* \brief Object that allows to transform the fields back and forth between the
14  * spectral and interpolation grid.
15  *
16  * Attributes :
17  * - dht0, dhtm, dhtp : the discrete Hankel transform objects for the modes,
18  * operating along r
19 */
20 
22 {
23  public:
24 
26 
27  SpectralHankelTransformer (const int nr,
28  const int n_rz_azimuthal_modes,
29  const amrex::Real rmax);
30 
31  void
32  ExtractKrArray ();
33 
34  // Returns an array that holds the kr for all of the modes
35  HankelTransform::RealVector const & getKrArray () const {return m_kr;}
36 
37  // Converts a scalar field from the physical to the spectral space
38  void
39  PhysicalToSpectral_Scalar (amrex::FArrayBox const & F_physical,
40  amrex::FArrayBox & G_spectral);
41 
42  // Converts a vector field from the physical to the spectral space
43  void
44  PhysicalToSpectral_Vector (amrex::Box const & box,
45  amrex::FArrayBox & F_r_physical,
46  amrex::FArrayBox & F_t_physical,
47  amrex::FArrayBox & G_p_spectral,
48  amrex::FArrayBox & G_m_spectral);
49 
50  // Converts a scalar field from the spectral to the physical space
51  void
52  SpectralToPhysical_Scalar (amrex::FArrayBox const & G_spectral,
53  amrex::FArrayBox & F_physical);
54 
55  // Converts a vector field from the spectral to the physical space
56  void
57  SpectralToPhysical_Vector (amrex::Box const & box,
58  amrex::FArrayBox const & G_p_spectral,
59  amrex::FArrayBox const & G_m_spectral,
60  amrex::FArrayBox & F_r_physical,
61  amrex::FArrayBox & F_t_physical);
62 
63  private:
64 
65  int m_nr;
68 
69  amrex::Vector< std::unique_ptr<HankelTransform> > dht0;
70  amrex::Vector< std::unique_ptr<HankelTransform> > dhtm;
71  amrex::Vector< std::unique_ptr<HankelTransform> > dhtp;
72 };
73 
74 #endif
amrex::Vector< std::unique_ptr< HankelTransform > > dhtm
Definition: SpectralHankelTransformer.H:70
void SpectralToPhysical_Scalar(amrex::FArrayBox const &G_spectral, amrex::FArrayBox &F_physical)
Definition: SpectralHankelTransformer.cpp:129
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:156
Definition: SpectralHankelTransformer.H:21
HankelTransform::RealVector m_kr
Definition: SpectralHankelTransformer.H:67
amrex::Vector< std::unique_ptr< HankelTransform > > dht0
Definition: SpectralHankelTransformer.H:69
void ExtractKrArray()
Definition: SpectralHankelTransformer.cpp:33
amrex::Gpu::DeviceVector< amrex::Real > RealVector
Definition: HankelTransform.H:24
HankelTransform::RealVector const & getKrArray() const
Definition: SpectralHankelTransformer.H:35
void PhysicalToSpectral_Scalar(amrex::FArrayBox const &F_physical, amrex::FArrayBox &G_spectral)
Definition: SpectralHankelTransformer.cpp:57
int m_nr
Definition: SpectralHankelTransformer.H:65
SpectralHankelTransformer()
Definition: SpectralHankelTransformer.H:25
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:82
amrex::Vector< std::unique_ptr< HankelTransform > > dhtp
Definition: SpectralHankelTransformer.H:71
int m_n_rz_azimuthal_modes
Definition: SpectralHankelTransformer.H:66