Skip to content

ablastr: replace protected n_grow member with public nGrowVect()#6728

Merged
roelof-groenewald merged 1 commit intoBLAST-WarpX:developmentfrom
RemiLehe:fix/6642-fillboundary-n-grow-public-api
Mar 31, 2026
Merged

ablastr: replace protected n_grow member with public nGrowVect()#6728
roelof-groenewald merged 1 commit intoBLAST-WarpX:developmentfrom
RemiLehe:fix/6642-fillboundary-n-grow-public-api

Conversation

@RemiLehe
Copy link
Copy Markdown
Member

Summary

ablastr::utils::communication::FillBoundary(MultiFab&, ...) was reading the guard-cell vector via mf.n_grow, a protected data member of AMReX's FabArrayBase that is not part of the public API. Recent AMReX releases tightened encapsulation, causing build failures with newer AMReX snapshots. All other call sites in the same file already use the public accessor mf.nGrowVect().

Fix

Replace mf.n_grow with mf.nGrowVect().

Fixes #6642

Test plan

  • Builds cleanly against recent AMReX

🤖 Generated with Claude Code

FillBoundary (MultiFab&, ...) was reading the guard-cell vector via
mf.n_grow, a protected data member of AMReX's FabArrayBase that is
not part of the public API. Recent AMReX releases tightened
encapsulation, causing build failures. Replace with the public
accessor mf.nGrowVect(), which is already used everywhere else in
the same file.

Fixes BLAST-WarpX#6642

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@lucafedeli88 lucafedeli88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this in not actually a bug: n_grow is not a protected member of its class as Claude claims. However, the intent is probably to make it protected at some point, since there is this comment in the source file:

//#ifndef AMREX_USE_GPU
//protected:
//#endif

which means that mf.nGrowVect() may be preferable with respect to mf.n_grow . Can you confirm this, @WeiqunZhang ?

@WeiqunZhang
Copy link
Copy Markdown
Member

Yes

@RemiLehe RemiLehe changed the title ablastr: replace protected n_grow member with public nGrowVect() [WIP] ablastr: replace protected n_grow member with public nGrowVect() Mar 31, 2026
@RemiLehe RemiLehe changed the title [WIP] ablastr: replace protected n_grow member with public nGrowVect() ablastr: replace protected n_grow member with public nGrowVect() Mar 31, 2026
Copy link
Copy Markdown
Member

@lucafedeli88 lucafedeli88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll approve it, then.

@roelof-groenewald roelof-groenewald merged commit 2b43fcd into BLAST-WarpX:development Mar 31, 2026
48 of 49 checks passed
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.

FillBoundary helper uses private MultiFab::n_grow

4 participants