WarpX
Source
FieldSolver
SpectralSolver
SpectralHankelTransform
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
22
class
SpectralHankelTransformer
23
{
24
public
:
25
26
SpectralHankelTransformer
() =
default
;
27
28
SpectralHankelTransformer
(
int
nr,
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
45
PhysicalToSpectral_Vector
(
amrex::Box
const
& box,
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
58
SpectralToPhysical_Vector
(
amrex::Box
const
& box,
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
;
67
int
m_n_rz_azimuthal_modes
;
68
HankelTransform::RealVector
m_kr
;
69
70
amrex::Vector< std::unique_ptr<HankelTransform>
>
dht0
;
71
amrex::Vector< std::unique_ptr<HankelTransform>
>
dhtm
;
72
amrex::Vector< std::unique_ptr<HankelTransform>
>
dhtp
;
73
};
74
75
#endif
AMReX_FArrayBox.H
HankelTransform.H
SpectralHankelTransformer
Definition:
SpectralHankelTransformer.H:23
SpectralHankelTransformer::SpectralHankelTransformer
SpectralHankelTransformer()=default
SpectralHankelTransformer::PhysicalToSpectral_Scalar
void PhysicalToSpectral_Scalar(amrex::FArrayBox const &F_physical, amrex::FArrayBox &G_spectral)
Definition:
SpectralHankelTransformer.cpp:60
SpectralHankelTransformer::m_nr
int m_nr
Definition:
SpectralHankelTransformer.H:66
SpectralHankelTransformer::SpectralToPhysical_Scalar
void SpectralToPhysical_Scalar(amrex::FArrayBox const &G_spectral, amrex::FArrayBox &F_physical)
Definition:
SpectralHankelTransformer.cpp:132
SpectralHankelTransformer::dhtp
amrex::Vector< std::unique_ptr< HankelTransform > > dhtp
Definition:
SpectralHankelTransformer.H:72
SpectralHankelTransformer::getKrArray
HankelTransform::RealVector const & getKrArray() const
Definition:
SpectralHankelTransformer.H:36
SpectralHankelTransformer::SpectralToPhysical_Vector
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
SpectralHankelTransformer::dht0
amrex::Vector< std::unique_ptr< HankelTransform > > dht0
Definition:
SpectralHankelTransformer.H:70
SpectralHankelTransformer::dhtm
amrex::Vector< std::unique_ptr< HankelTransform > > dhtm
Definition:
SpectralHankelTransformer.H:71
SpectralHankelTransformer::ExtractKrArray
void ExtractKrArray()
Definition:
SpectralHankelTransformer.cpp:36
SpectralHankelTransformer::PhysicalToSpectral_Vector
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
SpectralHankelTransformer::m_n_rz_azimuthal_modes
int m_n_rz_azimuthal_modes
Definition:
SpectralHankelTransformer.H:67
SpectralHankelTransformer::m_kr
HankelTransform::RealVector m_kr
Definition:
SpectralHankelTransformer.H:68
amrex::Box
amrex::FArrayBox
amrex::PODVector
amrex::Vector
Generated by
1.9.1