Skip to content

Commit b788490

Browse files
authored
EB: don't abort for no-op case in unsupported addFineLevels functions (#4123)
## Summary The `addFineLevels` function is not supported for EB2 for chk_file and stl geometries. However, it may be called in some for some trivial cases where it is adding 0 levels, in which case it is a no-op. There is no reason to abort in those cases. ## Additional background For PeleC, a work-around was put in to not call the function in the trivial cases (AMReX-Combustion/PeleC#771). I was thinking about adding the same work around to address the same thing in PeleLMeX (AMReX-Combustion/PeleLMeX#407), but maybe it would be better to simply allow the function to be called in trivial cases. If there's a reason not to do this, I'll just put the workaround in for PeleLMeX.
1 parent ebd9a11 commit b788490

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Src/EB/AMReX_EB2_IndexSpace_STL.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,12 @@ IndexSpaceSTL::getGeometry (const Box& dom) const
8383
}
8484

8585
void
86-
IndexSpaceSTL::addFineLevels (int /*num_new_fine_levels*/)
86+
IndexSpaceSTL::addFineLevels (int num_new_fine_levels)
8787
{
88-
amrex::Abort("IndexSpaceSTL::addFineLevels: todo");
88+
// This function is a no op if not adding levels, otherwise TODO
89+
if (num_new_fine_levels > 0) {
90+
amrex::Abort("IndexSpaceSTL::addFineLevels: todo");
91+
}
8992
}
9093

9194
void

Src/EB/AMReX_EB2_IndexSpace_chkpt_file.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,12 @@ IndexSpaceChkptFile::getGeometry (const Box& dom) const
7878
}
7979

8080
void
81-
IndexSpaceChkptFile::addFineLevels (int /*num_new_fine_levels*/)
81+
IndexSpaceChkptFile::addFineLevels (int num_new_fine_levels)
8282
{
83-
amrex::Abort("IndexSpaceChkptFile::addFineLevels: not supported");
83+
// This function is a no op if not adding levels, otherwise TODO
84+
if (num_new_fine_levels > 0) {
85+
amrex::Abort("IndexSpaceChkptFile::addFineLevels: not supported");
86+
}
8487
}
8588

8689
void

0 commit comments

Comments
 (0)