WarpX
SpectralKSpace.H
Go to the documentation of this file.
1 /* Copyright 2019 David Grote, Maxence Thevenet, Remi Lehe
2  *
3  *
4  * This file is part of WarpX.
5  *
6  * License: BSD-3-Clause-LBNL
7  */
8 #ifndef WARPX_SPECTRAL_K_SPACE_H_
9 #define WARPX_SPECTRAL_K_SPACE_H_
10 
11 #include "SpectralKSpace_fwd.H"
12 
13 #include "Utils/WarpX_Complex.H"
14 
15 #include <AMReX_Array.H>
16 #include <AMReX_BoxArray.H>
17 #include <AMReX_Config.H>
18 #include <AMReX_GpuContainers.H>
19 #include <AMReX_LayoutData.H>
20 #include <AMReX_REAL.H>
21 #include <AMReX_RealVect.H>
22 #include <AMReX_Vector.H>
23 
24 #include <AMReX_BaseFwd.H>
25 
26 // `KVectorComponent` and `SpectralShiftFactor` hold one 1D array
27 // ("DeviceVector") for each box ("LayoutData"). The arrays are
28 // only allocated if the corresponding box is owned by the local MPI rank.
33 
34 // Indicate the type of correction "shift" factor to apply
35 // when the FFT is performed from/to a cell-centered grid in real space.
36 struct ShiftType {
38 };
39 
48 {
49  public:
51  SpectralKSpace() : dx(amrex::RealVect::Zero) {}
52 
53  SpectralKSpace( const amrex::BoxArray& realspace_ba,
55  amrex::RealVect realspace_dx );
56 
59  const amrex::BoxArray& realspace_ba,
60  int i_dim, bool only_positive_k ) const;
61 
63  const amrex::DistributionMapping& dm, int i_dim,
64  int n_order, short grid_type ) const;
65 
67  const amrex::DistributionMapping& dm, int i_dim,
68  int shift_type ) const;
69 
70  protected:
72  // 3D: k_vec is an Array of 3 components, corresponding to kx, ky, kz
73  // 2D: k_vec is an Array of 2 components, corresponding to kx, kz
75 };
76 
77 #endif
Class that represents the spectral space.
Definition: SpectralKSpace.H:48
KVectorComponent getKComponent(const amrex::DistributionMapping &dm, const amrex::BoxArray &realspace_ba, int i_dim, bool only_positive_k) const
Definition: SpectralKSpace.cpp:83
amrex::RealVect dx
Definition: SpectralKSpace.H:74
amrex::BoxArray spectralspace_ba
Definition: SpectralKSpace.H:50
SpectralKSpace()
Definition: SpectralKSpace.H:51
SpectralShiftFactor getSpectralShiftFactor(const amrex::DistributionMapping &dm, int i_dim, int shift_type) const
Definition: SpectralKSpace.cpp:144
KVectorComponent getModifiedKComponent(const amrex::DistributionMapping &dm, int i_dim, int n_order, short grid_type) const
Definition: SpectralKSpace.cpp:191
amrex::Array< KVectorComponent, AMREX_SPACEDIM > k_vec
Definition: SpectralKSpace.H:71
std::array< T, N > Array
Definition: SpectralKSpace.H:36
@ TransformToCellCentered
Definition: SpectralKSpace.H:37
@ TransformFromCellCentered
Definition: SpectralKSpace.H:37