aboutsummaryrefslogtreecommitdiff
path: root/Source/FieldSolver/SpectralSolver/SpectralFieldData.H
diff options
context:
space:
mode:
authorGravatar MaxThevenet <mthevenet@lbl.gov> 2020-05-29 10:55:32 -0700
committerGravatar GitHub <noreply@github.com> 2020-05-29 10:55:32 -0700
commit27376e25415950018d4be93dfccb44d122e68f36 (patch)
treec9cfa1eb19c192b3a70b2300c3cb8ecd8f48a35d /Source/FieldSolver/SpectralSolver/SpectralFieldData.H
parent36c337d1dd00dc4945802a4a4da6e23aee86355e (diff)
downloadWarpX-27376e25415950018d4be93dfccb44d122e68f36.tar.gz
WarpX-27376e25415950018d4be93dfccb44d122e68f36.tar.zst
WarpX-27376e25415950018d4be93dfccb44d122e68f36.zip
Encapsulate FFTs (#1055)
* wrap fft libraries * implementation in cpp to avoid duplicate symbole * delete some fftw code * further cleaning * typo * pass fft plans by reference * fix bug due to typo. Dammit, macros sometimes make it hard * FFT wrapper also support cuFFT (not tested yet) * eol * further cleaning * fix cuFFT, tested on Summit * clean WarpX Complex checks * pass directly the IntVect instead of the components (what were you thinking?) * add some amrex prefix * add a few const * Should not need an FFT library to compile FDTD * gather all FFT header files into one. * eol * minor changes in code comments. * let dimension be chosen at runtime instead of at compile-time * fix compilation on GPU * add description to the wrapper namespace
Diffstat (limited to 'Source/FieldSolver/SpectralSolver/SpectralFieldData.H')
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralFieldData.H17
1 files changed, 3 insertions, 14 deletions
diff --git a/Source/FieldSolver/SpectralSolver/SpectralFieldData.H b/Source/FieldSolver/SpectralSolver/SpectralFieldData.H
index d80ed9c96..f618fda35 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralFieldData.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralFieldData.H
@@ -10,6 +10,8 @@
#include "Utils/WarpX_Complex.H"
#include "SpectralKSpace.H"
+#include "AnyFFT.H"
+
#include <AMReX_MultiFab.H>
#include <string>
@@ -38,19 +40,6 @@ struct SpectralPMLIndex {
class SpectralFieldData
{
- // Define the FFTplans type, which holds one fft plan per box
- // (plans are only initialized for the boxes that are owned by
- // the local MPI rank)
-#ifdef AMREX_USE_GPU
- using FFTplans = amrex::LayoutData<cufftHandle>;
-#else
-# ifdef AMREX_USE_FLOAT
- using FFTplans = amrex::LayoutData<fftwf_plan>;
-# else
- using FFTplans = amrex::LayoutData<fftw_plan>;
-# endif
-#endif
-
public:
SpectralFieldData( const amrex::BoxArray& realspace_ba,
const SpectralKSpace& k_space,
@@ -72,7 +61,7 @@ class SpectralFieldData
// right before/after the Fourier transform
SpectralField tmpSpectralField; // contains Complexs
amrex::MultiFab tmpRealField; // contains Reals
- FFTplans forward_plan, backward_plan;
+ AnyFFT::FFTplans forward_plan, backward_plan;
// Correcting "shift" factors when performing FFT from/to
// a cell-centered grid in real space, instead of a nodal grid
SpectralShiftFactor xshift_FFTfromCell, xshift_FFTtoCell,