Skip to content

Commit

Permalink
EB: don't abort for no-op case in unsupported addFineLevels functions (
Browse files Browse the repository at this point in the history
…#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.
  • Loading branch information
baperry2 authored Sep 2, 2024
1 parent ebd9a11 commit b788490
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions Src/EB/AMReX_EB2_IndexSpace_STL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,12 @@ IndexSpaceSTL::getGeometry (const Box& dom) const
}

void
IndexSpaceSTL::addFineLevels (int /*num_new_fine_levels*/)
IndexSpaceSTL::addFineLevels (int num_new_fine_levels)
{
amrex::Abort("IndexSpaceSTL::addFineLevels: todo");
// This function is a no op if not adding levels, otherwise TODO
if (num_new_fine_levels > 0) {
amrex::Abort("IndexSpaceSTL::addFineLevels: todo");
}
}

void
Expand Down
7 changes: 5 additions & 2 deletions Src/EB/AMReX_EB2_IndexSpace_chkpt_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,12 @@ IndexSpaceChkptFile::getGeometry (const Box& dom) const
}

void
IndexSpaceChkptFile::addFineLevels (int /*num_new_fine_levels*/)
IndexSpaceChkptFile::addFineLevels (int num_new_fine_levels)
{
amrex::Abort("IndexSpaceChkptFile::addFineLevels: not supported");
// This function is a no op if not adding levels, otherwise TODO
if (num_new_fine_levels > 0) {
amrex::Abort("IndexSpaceChkptFile::addFineLevels: not supported");
}
}

void
Expand Down

0 comments on commit b788490

Please sign in to comment.