aboutsummaryrefslogtreecommitdiff
path: root/Source/FieldSolver/SpectralSolver/SpectralSolver.cpp
diff options
context:
space:
mode:
authorGravatar Remi Lehe <remi.lehe@normalesup.org> 2019-04-29 11:39:07 -0700
committerGravatar Remi Lehe <remi.lehe@normalesup.org> 2019-04-30 09:41:56 -0700
commitf0456518f3a1c1168e37c5498a6595d44395bb2b (patch)
tree194f4ee29b64b75cf1fccabc7bc951ff04ac277d /Source/FieldSolver/SpectralSolver/SpectralSolver.cpp
parent9e8aca63877e32463a912cd6b3fafb660e898f15 (diff)
downloadWarpX-f0456518f3a1c1168e37c5498a6595d44395bb2b.tar.gz
WarpX-f0456518f3a1c1168e37c5498a6595d44395bb2b.tar.zst
WarpX-f0456518f3a1c1168e37c5498a6595d44395bb2b.zip
Add separate file for constructor
Diffstat (limited to 'Source/FieldSolver/SpectralSolver/SpectralSolver.cpp')
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralSolver.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/Source/FieldSolver/SpectralSolver/SpectralSolver.cpp b/Source/FieldSolver/SpectralSolver/SpectralSolver.cpp
new file mode 100644
index 000000000..a04a68d2c
--- /dev/null
+++ b/Source/FieldSolver/SpectralSolver/SpectralSolver.cpp
@@ -0,0 +1,30 @@
+#include <SpectralKSpace.H>
+#include <SpectralSolver.H>
+#include <PsatdAlgorithm.H>
+
+/* \brief TODO Description
+ */
+SpectralSolver( const amrex::BoxArray& realspace_ba,
+ const amrex::DistributionMapping& dm,
+ const int norder_x, const int norder_y,
+ const int norder_z, const bool nodal,
+ const amrex::RealVect dx, const amrex::Real dt ) {
+
+ // Initialize all structures using the same distribution mapping dm
+
+ // - Initialize k space object (Contains info about the size of
+ // the spectral space corresponding to each box in `realspace_ba`,
+ // as well as the value of the corresponding k coordinates)
+ const SpectralKSpace k_space= SpectralKSpace(realspace_ba, dm, dx);
+
+ // - Select the algorithm depending on the input parameters
+ // Initialize the corresponding coefficients over k space
+ // TODO: Add more algorithms + selection depending on input parameters
+ // For the moment, this only uses the standard PsatdAlgorithm
+ algorithm = std::unique_ptr<PsatdAlgorithm>( new PsatdAlgorithm(
+ k_space, dm, norder_x, norder_y, norder_z, nodal, dt ) );
+
+ // - Initialize arrays for fields in spectral space + FFT plans
+ field_data = SpectralFieldData( realspace_ba, k_space, dm );
+
+};