aboutsummaryrefslogtreecommitdiff
path: root/Source/FieldSolver/SpectralSolver/SpectralFieldData.H
diff options
context:
space:
mode:
authorGravatar Remi Lehe <remi.lehe@normalesup.org> 2019-04-23 16:12:11 -0700
committerGravatar Remi Lehe <remi.lehe@normalesup.org> 2019-04-23 16:18:30 -0700
commit4a3265daf691f0a8fa7461322c7299016fd706bf (patch)
tree87960c3cf1af6f8ca94d734b8823aa44db8b18f5 /Source/FieldSolver/SpectralSolver/SpectralFieldData.H
parent37b3ec0d00f08869f67cd5f0c43db6e379121553 (diff)
downloadWarpX-4a3265daf691f0a8fa7461322c7299016fd706bf.tar.gz
WarpX-4a3265daf691f0a8fa7461322c7299016fd706bf.tar.zst
WarpX-4a3265daf691f0a8fa7461322c7299016fd706bf.zip
Add comments ; copy only to valid box
Diffstat (limited to 'Source/FieldSolver/SpectralSolver/SpectralFieldData.H')
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralFieldData.H15
1 files changed, 10 insertions, 5 deletions
diff --git a/Source/FieldSolver/SpectralSolver/SpectralFieldData.H b/Source/FieldSolver/SpectralSolver/SpectralFieldData.H
index be1765ca0..c62513de6 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralFieldData.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralFieldData.H
@@ -8,20 +8,23 @@
// Declare type for spectral fields
using SpectralField = amrex::FabArray< amrex::BaseFab <Complex> >;
-/* Fields that will be stored in spectral space */
+/* Index for the fields that will be stored in spectral space */
struct SpectralFieldIndex{
enum { Ex=0, Ey, Ez, Bx, By, Bz, Jx, Jy, Jz, rho_old, rho_new };
};
-/* \brief Class that stores the fields in spectral space
- * and performs the spectral transforms to/from real space
+/* \brief Class that stores the fields in spectral space, and performs the
+ * Fourier transforms between real space and spectral space
*/
class SpectralFieldData
{
friend class PsatdAlgorithm;
+ // 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
-// Add cuFFT-specific code
+ // Add cuFFT-specific code
#else
using FFTplans = amrex::LayoutData<fftw_plan>;
#endif
@@ -40,7 +43,9 @@ class SpectralFieldData
private:
SpectralField Ex, Ey, Ez, Bx, By, Bz, Jx, Jy, Jz, rho_old, rho_new;
- SpectralField tmpRealField, tmpSpectralField; // Store fields before/after transform
+ // tmpRealField and tmpSpectralField store fields
+ // right before/after the Fourier transform
+ SpectralField tmpRealField, tmpSpectralField;
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