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 <ablastr/utils/Enums.H>
16 
17 #include <AMReX_Array.H>
18 #include <AMReX_BoxArray.H>
19 #include <AMReX_Config.H>
20 #include <AMReX_GpuContainers.H>
21 #include <AMReX_LayoutData.H>
22 #include <AMReX_REAL.H>
23 #include <AMReX_RealVect.H>
24 #include <AMReX_Vector.H>
25 
26 #include <AMReX_BaseFwd.H>
27 
28 // `KVectorComponent` and `SpectralShiftFactor` hold one 1D array
29 // ("DeviceVector") for each box ("LayoutData"). The arrays are
30 // only allocated if the corresponding box is owned by the local MPI rank.
35 
36 // Indicate the type of correction "shift" factor to apply
37 // when the FFT is performed from/to a cell-centered grid in real space.
38 struct ShiftType {
40 };
41 
50 {
51  public:
53  SpectralKSpace() : dx(amrex::RealVect::Zero) {}
54 
55  SpectralKSpace( const amrex::BoxArray& realspace_ba,
57  amrex::RealVect realspace_dx );
58 
61  const amrex::BoxArray& realspace_ba,
62  int i_dim, bool only_positive_k ) const;
63 
66  int i_dim,
67  int n_order,
68  ablastr::utils::enums::GridType grid_type) const;
69 
71  const amrex::DistributionMapping& dm, int i_dim,
72  int shift_type ) const;
73 
74  protected:
76  // 3D: k_vec is an Array of 3 components, corresponding to kx, ky, kz
77  // 2D: k_vec is an Array of 2 components, corresponding to kx, kz
79 };
80 
81 #endif
Class that represents the spectral space.
Definition: SpectralKSpace.H:50
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:78
amrex::BoxArray spectralspace_ba
Definition: SpectralKSpace.H:52
SpectralKSpace()
Definition: SpectralKSpace.H:53
KVectorComponent getModifiedKComponent(const amrex::DistributionMapping &dm, int i_dim, int n_order, ablastr::utils::enums::GridType grid_type) const
Definition: SpectralKSpace.cpp:191
SpectralShiftFactor getSpectralShiftFactor(const amrex::DistributionMapping &dm, int i_dim, int shift_type) const
Definition: SpectralKSpace.cpp:144
amrex::Array< KVectorComponent, AMREX_SPACEDIM > k_vec
Definition: SpectralKSpace.H:75
GridType
Definition: Enums.H:17
std::array< T, N > Array
Definition: SpectralKSpace.H:38
@ TransformToCellCentered
Definition: SpectralKSpace.H:39
@ TransformFromCellCentered
Definition: SpectralKSpace.H:39