diff options
author | 2019-04-19 10:43:18 -0700 | |
---|---|---|
committer | 2019-04-23 12:43:53 -0700 | |
commit | 551e934fdee50f2321076b0dd1882a74cc92fb30 (patch) | |
tree | 4cf460bd13bc6061cb51da902df15e527858b645 /Source/FieldSolver/SpectralSolver/SpectralSolver.H | |
parent | 84cf3b88ad82fa25183f9281136fe154eaa00992 (diff) | |
download | WarpX-551e934fdee50f2321076b0dd1882a74cc92fb30.tar.gz WarpX-551e934fdee50f2321076b0dd1882a74cc92fb30.tar.zst WarpX-551e934fdee50f2321076b0dd1882a74cc92fb30.zip |
Link spectral solver to the rest of the code
Diffstat (limited to 'Source/FieldSolver/SpectralSolver/SpectralSolver.H')
-rw-r--r-- | Source/FieldSolver/SpectralSolver/SpectralSolver.H | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/Source/FieldSolver/SpectralSolver/SpectralSolver.H b/Source/FieldSolver/SpectralSolver/SpectralSolver.H index cde1fccd2..521e558ba 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralSolver.H +++ b/Source/FieldSolver/SpectralSolver/SpectralSolver.H @@ -1,24 +1,39 @@ #ifndef WARPX_SPECTRAL_SOLVER_H_ #define WARPX_SPECTRAL_SOLVER_H_ +#include <SpectralKSpace.H> +#include <PsatdAlgorithm.H> +#include <SpectralFieldData.H> + /* \brief * TODO */ class SpectralSolver { private: - SpectralKSpace k_space; // Contains size of each box in spectral space, - // and corresponding values of the k vectors SpectralFieldData field_data; // Store field in spectral space // and perform the Fourier transforms PsatdAlgorithm algorithm; // Contains Psatd coefficients // and field update equation public: - SpectralSolver(); - void ForwardTransform( const MultiFab& mf, const int field_index ){ + SpectralSolver( const amrex::BoxArray& realspace_ba, + const amrex::DistributionMapping& dm, + const int norder_x, const int norder_y, const int norder_z, + const amrex::Array<amrex::Real,3> dx, const amrex::Real dt ) + { + // Initialize all structures using the same distribution mapping dm + // - Initialize k space (Contains size of each box in spectral space, + // and corresponding values of the k vectors) + const SpectralKSpace k_space = SpectralKSpace( realspace_ba, dm, dx ); + // - Initialize algorithm (coefficients) over this space + algorithm = PsatdAlgorithm( k_space, dm, norder_x, norder_y, norder_z, dt ); + // - Initialize arrays for fields in Fourier space + FFT plans + field_data = SpectralFieldData( realspace_ba, k_space, dm ); + }; + void ForwardTransform( const amrex::MultiFab& mf, const int field_index ){ field_data.ForwardTransform( mf, field_index ); }; - void BackwardTransform( MultiFab& mf, const int field_index ){ + void BackwardTransform( amrex::MultiFab& mf, const int field_index ){ field_data.BackwardTransform( mf, field_index ); }; void pushSpectralFields(){ @@ -26,19 +41,4 @@ class SpectralSolver }; }; -SpectralSolver::SpectralSolver( const SpectralKSpace& realspace_ba, - const DistributionMapping& dm, - const int norder_x, const int norder_y, - const int norder_z, const Real* dx, - const Real dt ) -{ - // Initialize all structures using the same distribution mapping dm - // - Initialize k space values - k_space = SpectralKSpace( realspace_ba, dm, dx ); - // - Initialize algorithm (coefficients) over this space - algorithm = PsatdAlgorithm( k_space, dm, norder_x, norder_y, norder_z ); - // - Initialize arrays for fields in Fourier space + FFT plans - field_data = SpectralFieldData( realspace_ba, k_space, dm ); -}; - #endif // WARPX_SPECTRAL_SOLVER_H_ |