aboutsummaryrefslogtreecommitdiff
path: root/Source/FieldSolver/SpectralSolver/SpectralFieldData.H
diff options
context:
space:
mode:
authorGravatar Remi Lehe <remi.lehe@normalesup.org> 2019-04-29 16:11:59 -0700
committerGravatar GitHub <noreply@github.com> 2019-04-29 16:11:59 -0700
commit9a7a87fcd64d7faab8c57cbc769840f8ee74454a (patch)
treea0a3efd28d7666c6a23c4b91b050ffbb12fec313 /Source/FieldSolver/SpectralSolver/SpectralFieldData.H
parent515b3464b0c6c6bbc5120ca70bb755a18d19c337 (diff)
parentce517d68ee28cf4870a4f84963682284a7513d14 (diff)
downloadWarpX-9a7a87fcd64d7faab8c57cbc769840f8ee74454a.tar.gz
WarpX-9a7a87fcd64d7faab8c57cbc769840f8ee74454a.tar.zst
WarpX-9a7a87fcd64d7faab8c57cbc769840f8ee74454a.zip
Merge pull request #108 from ECP-WarpX/multicomp_spectral
Store spectral fields in a multi-component FABArray
Diffstat (limited to 'Source/FieldSolver/SpectralSolver/SpectralFieldData.H')
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralFieldData.H13
1 files changed, 7 insertions, 6 deletions
diff --git a/Source/FieldSolver/SpectralSolver/SpectralFieldData.H b/Source/FieldSolver/SpectralSolver/SpectralFieldData.H
index c62513de6..9e31ac5b8 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralFieldData.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralFieldData.H
@@ -9,8 +9,9 @@
using SpectralField = amrex::FabArray< amrex::BaseFab <Complex> >;
/* 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 };
+struct SpectralFieldIndex {
+ enum { Ex=0, Ey, Ez, Bx, By, Bz, Jx, Jy, Jz, rho_old, rho_new, n_fields };
+ // n_fields is automatically the total number of fields
};
/* \brief Class that stores the fields in spectral space, and performs the
@@ -37,12 +38,13 @@ class SpectralFieldData
SpectralFieldData& operator=(SpectralFieldData&& field_data) = default;
~SpectralFieldData();
void ForwardTransform( const amrex::MultiFab& mf,
- const int field_index, const int i_comp );
+ const int field_index, const int i_comp);
void BackwardTransform( amrex::MultiFab& mf,
- const int field_index, const int i_comp );
+ const int field_index, const int i_comp);
private:
- SpectralField Ex, Ey, Ez, Bx, By, Bz, Jx, Jy, Jz, rho_old, rho_new;
+ // `fields` stores fields in spectral space, as multicomponent FabArray
+ SpectralField fields;
// tmpRealField and tmpSpectralField store fields
// right before/after the Fourier transform
SpectralField tmpRealField, tmpSpectralField;
@@ -54,7 +56,6 @@ class SpectralFieldData
#if (AMREX_SPACEDIM==3)
SpectralShiftFactor yshift_FFTfromCell, yshift_FFTtoCell;
#endif
- SpectralField& getSpectralField( const int field_index );
};
#endif // WARPX_SPECTRAL_FIELD_DATA_H_