Skip to content

Commit

Permalink
Fix #3549 (#3551)
Browse files Browse the repository at this point in the history
Area fractions are stored in MultiCutFabs that we must check if a fab is
OK in MFIter for loop.

Additionally, we could skip the call to extendDataOutsideDomain if the
EB is all regular.
  • Loading branch information
WeiqunZhang authored Sep 17, 2023
1 parent dda5268 commit 9c75779
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Src/EB/AMReX_EBDataCollection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ EBDataCollection::EBDataCollection (const EB2::Level& a_level,
a_level.fillCutCellMask(*m_cutcellmask, m_geom);
}

extendDataOutsideDomain(a_level.nGrowVect());
if (! a_level.isAllRegular()) {
extendDataOutsideDomain(a_level.nGrowVect());
}
}

void EBDataCollection::extendDataOutsideDomain (IntVect const& level_ng)
Expand Down Expand Up @@ -192,7 +194,7 @@ void EBDataCollection::extendDataOutsideDomain (IntVect const& level_ng)
});

for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) {
if (m_areafrac[idim]) {
if (m_areafrac[idim] && m_areafrac[idim]->ok(mfi)) {
auto const& ap = m_areafrac[idim]->array(mfi);
Box apbx = Box(ap);
if (apbx.smallEnd(idim) == nbx.smallEnd(idim)) {
Expand Down

0 comments on commit 9c75779

Please sign in to comment.