Skip to content

Fix index typo in z-lo direction_dependent MAC velocity BC. - #196

Open
WeiqunZhang wants to merge 1 commit into
AMReX-Fluids:developmentfrom
WeiqunZhang:fix-zlo-direction-dependent-mac-bc
Open

Fix index typo in z-lo direction_dependent MAC velocity BC.#196
WeiqunZhang wants to merge 1 commit into
AMReX-Fluids:developmentfrom
WeiqunZhang:fix-zlo-direction-dependent-mac-bc

Conversation

@WeiqunZhang

Copy link
Copy Markdown
Member

The inflow test read cc_arr(1,j,k-1,2) with a literal x-index 1 instead of the loop index i, so the decision for face (i,j,dlo.z) was made from the ghost w in the x=1 column, and the read went outside the FAB on any box whose grown x-range excludes 1. Use cc_arr(i,j,k-1,2), the same ghost cell that is assigned to wmac_arr(i,j,k), matching the x-lo, y-lo and z-hi blocks.

Fixes #195.

The inflow test read cc_arr(1,j,k-1,2) with a literal x-index 1 instead
of the loop index i, so the decision for face (i,j,dlo.z) was made from
the ghost w in the x=1 column, and the read went outside the FAB on any
box whose grown x-range excludes 1.  Use cc_arr(i,j,k-1,2), the same
ghost cell that is assigned to wmac_arr(i,j,k), matching the x-lo, y-lo
and z-hi blocks.

Fixes AMReX-Fluids#195.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

z-lo direction_dependent MAC BC reads cc_arr(1,j,k-1,2) instead of (i,j,k-1,2) — OOB read

1 participant