From 8292a23f94db9b9c2cb444c254e82f7e899ec36f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 19 Aug 2022 06:13:22 -0400 Subject: [PATCH] fix array indexing bugs flagged by compiler warnings --- src/fix_ave_grid.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fix_ave_grid.cpp b/src/fix_ave_grid.cpp index e1ceb03e58..93d3afcf78 100644 --- a/src/fix_ave_grid.cpp +++ b/src/fix_ave_grid.cpp @@ -715,7 +715,7 @@ void FixAveGrid::end_of_step() else norm = 1.0/count; vec2d[iy][ix] *= norm; - count2d[iy][iz] *= invrepeat; + count2d[iy][ix] *= invrepeat; } } } else { @@ -734,7 +734,7 @@ void FixAveGrid::end_of_step() norm = 1.0/count; array2d[iy][ix][m] *= norm; } - count2d[iy][iz] *= invrepeat; + count2d[iy][ix] *= invrepeat; } } } @@ -754,7 +754,7 @@ void FixAveGrid::end_of_step() else norm = 1.0/count; vec3d[iz][iy][ix] *= norm; - count3d[iz][iy][iz] *= invrepeat; + count3d[iz][iy][ix] *= invrepeat; } } } else { @@ -774,7 +774,7 @@ void FixAveGrid::end_of_step() norm = 1.0/count; array3d[iz][iy][ix][m] *= norm; } - count3d[iz][iy][iz] *= invrepeat; + count3d[iz][iy][ix] *= invrepeat; } } }