aboutsummaryrefslogtreecommitdiff
path: root/Source/FieldSolver/SpectralSolver
diff options
context:
space:
mode:
authorGravatar Remi Lehe <remi.lehe@normalesup.org> 2019-04-28 14:32:57 -0700
committerGravatar Remi Lehe <remi.lehe@normalesup.org> 2019-04-28 14:32:57 -0700
commita75f2ac4a0870440a6825e8b05efbca0d4b03e43 (patch)
tree5c5273c9665184de65e9eadacc5eeb908c7b7e56 /Source/FieldSolver/SpectralSolver
parent178d50896b3da55874d8601934341c725ce041d6 (diff)
downloadWarpX-a75f2ac4a0870440a6825e8b05efbca0d4b03e43.tar.gz
WarpX-a75f2ac4a0870440a6825e8b05efbca0d4b03e43.tar.zst
WarpX-a75f2ac4a0870440a6825e8b05efbca0d4b03e43.zip
Fix 2D bugs
Diffstat (limited to 'Source/FieldSolver/SpectralSolver')
-rw-r--r--Source/FieldSolver/SpectralSolver/PsatdAlgorithm.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/FieldSolver/SpectralSolver/PsatdAlgorithm.cpp b/Source/FieldSolver/SpectralSolver/PsatdAlgorithm.cpp
index 56e58bcc4..51259df81 100644
--- a/Source/FieldSolver/SpectralSolver/PsatdAlgorithm.cpp
+++ b/Source/FieldSolver/SpectralSolver/PsatdAlgorithm.cpp
@@ -56,8 +56,10 @@ PsatdAlgorithm::PsatdAlgorithm(const SpectralKSpace& spectral_kspace,
std::pow(modified_kx[i], 2) +
#if (AMREX_SPACEDIM==3)
std::pow(modified_ky[j], 2) +
-#endif
std::pow(modified_kz[k], 2));
+#else
+ std::pow(modified_kz[j], 2));
+#endif
// Calculate coefficients
constexpr Real c = PhysConst::c;
@@ -136,10 +138,11 @@ PsatdAlgorithm::pushSpectralFields(SpectralFieldData& f) const{
const Real kx = modified_kx_arr[i];
#if (AMREX_SPACEDIM==3)
const Real ky = modified_ky_arr[j];
+ const Real kz = modified_kz_arr[k];
#else
constexpr Real ky = 0;
+ const Real kz = modified_kz_arr[j];
#endif
- const Real kz = modified_kz_arr[k];
constexpr Real c2 = PhysConst::c*PhysConst::c;
constexpr Real inv_ep0 = 1./PhysConst::ep0;
constexpr Complex I = Complex{0,1};