Skip to content

Guard the cell-volume product by dimension in massDensity. - #200

Merged
WeiqunZhang merged 1 commit into
AMReX-Fluids:developmentfrom
WeiqunZhang:fix-massdensity-2d-oob
Aug 19, 2026
Merged

Guard the cell-volume product by dimension in massDensity.#200
WeiqunZhang merged 1 commit into
AMReX-Fluids:developmentfrom
WeiqunZhang:fix-massdensity-2d-oob

Conversation

@WeiqunZhang

Copy link
Copy Markdown
Member

dxi is a GpuArray with SPACEDIM entries, so dxi[0]*dxi[1]*dxi[2] read past the end in 2D builds. AMREX_D_TERM gives the inverse cell area in 2D and leaves 3D unchanged.

Fixes #168.

dxi is a GpuArray with SPACEDIM entries, so dxi[0]*dxi[1]*dxi[2] read past the end in 2D builds. AMREX_D_TERM gives the inverse cell area in 2D and leaves 3D unchanged.

Fixes AMReX-Fluids#168.
@WeiqunZhang
WeiqunZhang merged commit 747ed00 into AMReX-Fluids:development Aug 19, 2026
12 checks passed
@WeiqunZhang
WeiqunZhang deleted the fix-massdensity-2d-oob branch August 19, 2026 02:02
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.

incflo_PC::massDensity reads dxi[2] out of bounds in 2D builds (GpuArray has SPACEDIM entries)

2 participants