Skip to content

Commit

Permalink
Fix FillPatcher after enforcing PhysBCFunct operator() fills nghost (#…
Browse files Browse the repository at this point in the history
…3941)

grow cells (PR 3914)

Also assert in operator that mf has nghost grow cells to fill.
  • Loading branch information
cgilet committed May 13, 2024
1 parent af6e772 commit 8eff86d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Src/AmrCore/AMReX_FillPatcher.H
Expand Up @@ -390,7 +390,7 @@ FillPatcher<MF>::fillCoarseFineBoundary (MF& mf, IntVect const& nghost, Real tim
}
Gpu::streamSynchronize();

cbc(*m_cf_crse_data_tmp, 0, ncomp, nghost, time, cbccomp);
cbc(*m_cf_crse_data_tmp, 0, ncomp, m_cf_crse_data_tmp->nGrowVect(), time, cbccomp);

detail::call_interp_hook(pre_interp, *m_cf_crse_data_tmp, 0, ncomp);

Expand Down Expand Up @@ -593,7 +593,7 @@ void FillPatcher<MF>::fillRK (int stage, int iteration, int ncycle,
}
Gpu::streamSynchronize();

cbc(*m_cf_crse_data_tmp, 0, m_ncomp, m_nghost, time, 0);
cbc(*m_cf_crse_data_tmp, 0, m_ncomp, m_cf_crse_data_tmp->nGrowVect(), time, 0);

if (m_cf_fine_data == nullptr) {
m_cf_fine_data = std::make_unique<MF>(detail::make_mf_fine_patch<MF>(fpc, m_ncomp));
Expand Down
2 changes: 2 additions & 0 deletions Src/Base/AMReX_PhysBCFunct.H
Expand Up @@ -153,6 +153,8 @@ public:

BL_PROFILE("PhysBCFunct::()");

AMREX_ASSERT(nghost.allLE(mf.nGrowVect()));

//! create a grown domain box containing valid + periodic cells
const Box& domain = m_geom.Domain();
Box gdomain = amrex::convert(domain, mf.boxArray().ixType());
Expand Down

0 comments on commit 8eff86d

Please sign in to comment.