Skip to content

Commit

Permalink
fix index bug for case where ComputeVerticalAverage is called with in…
Browse files Browse the repository at this point in the history
…comp>0
  • Loading branch information
ajnonaka committed Jan 13, 2025
1 parent 1ee25e1 commit a9bb05a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src_common/ComputeAverages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ void ComputeVerticalAverage(const MultiFab& mf, MultiFab& mf_flat,

if (dir == 0) {

for (auto n = incomp; n<incomp+ncomp; ++n) {
for (auto n = 0; n<ncomp; ++n) {
for (auto k = lo.z; k <= hi.z; ++k) {
for (auto j = lo.y; j <= hi.y; ++j) {
for (auto i = lo.x; i <= hi.x; ++i) {
Expand All @@ -308,7 +308,7 @@ void ComputeVerticalAverage(const MultiFab& mf, MultiFab& mf_flat,

} else if (dir == 1) {

for (auto n = incomp; n<incomp+ncomp; ++n) {
for (auto n = 0; n<ncomp; ++n) {
for (auto k = lo.z; k <= hi.z; ++k) {
for (auto j = lo.y; j <= hi.y; ++j) {
for (auto i = lo.x; i <= hi.x; ++i) {
Expand All @@ -322,7 +322,7 @@ void ComputeVerticalAverage(const MultiFab& mf, MultiFab& mf_flat,

} else if (dir == 2) {

for (auto n = incomp; n<incomp+ncomp; ++n) {
for (auto n = 0; n<ncomp; ++n) {
for (auto k = lo.z; k <= hi.z; ++k) {
for (auto j = lo.y; j <= hi.y; ++j) {
for (auto i = lo.x; i <= hi.x; ++i) {
Expand Down

0 comments on commit a9bb05a

Please sign in to comment.