aboutsummaryrefslogtreecommitdiff
path: root/Source/FieldSolver/SpectralSolver/PsatdAlgorithm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/FieldSolver/SpectralSolver/PsatdAlgorithm.cpp')
-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 17414c4bf..ada7506c3 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;
@@ -126,10 +128,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};