aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralKSpace.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/FieldSolver/SpectralSolver/SpectralKSpace.cpp b/Source/FieldSolver/SpectralSolver/SpectralKSpace.cpp
index 2f11f84ca..6d31116b6 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralKSpace.cpp
+++ b/Source/FieldSolver/SpectralSolver/SpectralKSpace.cpp
@@ -266,7 +266,7 @@ SpectralKSpace::getModifiedKComponent( const DistributionMapping& dm,
} else {
// The other axes contains both positive and negative k ;
// the Nyquist frequency is in the middle of the array.
- if (i == N/2) {
+ if ( (N%2==0) && (i == N/2) ){
p_modified_k[i] = 0.0_rt;
}
}