aboutsummaryrefslogtreecommitdiff
path: root/Source/FieldSolver/SpectralSolver/SpectralFieldData.H
diff options
context:
space:
mode:
authorGravatar Remi Lehe <remi.lehe@normalesup.org> 2019-04-29 12:01:12 -0700
committerGravatar Remi Lehe <remi.lehe@normalesup.org> 2019-04-29 12:01:12 -0700
commitba4cb44e38be3f1e8b1cd5f0c34966044db082b5 (patch)
tree7125c4242a4b3d762c3942b91261bd798091bc78 /Source/FieldSolver/SpectralSolver/SpectralFieldData.H
parentdb115f923353e4fe483f13c5de50e9fe9dc701a9 (diff)
downloadWarpX-ba4cb44e38be3f1e8b1cd5f0c34966044db082b5.tar.gz
WarpX-ba4cb44e38be3f1e8b1cd5f0c34966044db082b5.tar.zst
WarpX-ba4cb44e38be3f1e8b1cd5f0c34966044db082b5.zip
Update structure for storing spectral fields
Diffstat (limited to 'Source/FieldSolver/SpectralSolver/SpectralFieldData.H')
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralFieldData.H14
1 files changed, 7 insertions, 7 deletions
diff --git a/Source/FieldSolver/SpectralSolver/SpectralFieldData.H b/Source/FieldSolver/SpectralSolver/SpectralFieldData.H
index c62513de6..983f0da16 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralFieldData.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralFieldData.H
@@ -9,9 +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 };
-};
+enum struct SpectralFieldIndex: int
+{ 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
* Fourier transforms between real space and spectral space
@@ -37,12 +37,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 +55,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_