ARTEMIS
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  SpectralKSpace( const amrex::BoxArray& realspace_ba,
54  const amrex::RealVect realspace_dx );
57  const amrex::BoxArray& realspace_ba,
58  const int i_dim, const bool only_positive_k ) const;
60  const amrex::DistributionMapping& dm, const int i_dim,
61  const int n_order, const short grid_type ) const;
63  const amrex::DistributionMapping& dm, const int i_dim,
64  const int shift_type ) const;
65 
66  protected:
68  // 3D: k_vec is an Array of 3 components, corresponding to kx, ky, kz
69  // 2D: k_vec is an Array of 2 components, corresponding to kx, kz
71 };
72 
73 #endif
Class that represents the spectral space.
Definition: SpectralKSpace.H:48
SpectralShiftFactor getSpectralShiftFactor(const amrex::DistributionMapping &dm, const int i_dim, const int shift_type) const
Definition: SpectralKSpace.cpp:149
amrex::RealVect dx
Definition: SpectralKSpace.H:70
amrex::BoxArray spectralspace_ba
Definition: SpectralKSpace.H:50
SpectralKSpace()
Definition: SpectralKSpace.H:51
KVectorComponent getKComponent(const amrex::DistributionMapping &dm, const amrex::BoxArray &realspace_ba, const int i_dim, const bool only_positive_k) const
Definition: SpectralKSpace.cpp:88
KVectorComponent getModifiedKComponent(const amrex::DistributionMapping &dm, const int i_dim, const int n_order, const short grid_type) const
Definition: SpectralKSpace.cpp:196
amrex::Array< KVectorComponent, AMREX_SPACEDIM > k_vec
Definition: SpectralKSpace.H:67
std::array< T, N > Array
Definition: SpectralKSpace.H:36
@ TransformToCellCentered
Definition: SpectralKSpace.H:37
@ TransformFromCellCentered
Definition: SpectralKSpace.H:37