Skip to content

Commit

Permalink
Bug fix for amrex::Subtract when called with interger nghost (#3634)
Browse files Browse the repository at this point in the history
## Summary
`amrex::Subtract` leads to an infinite recursion when invoked with an
integer value for nghost. To address this issue, explicit casting of the
integer to `IntVect` has been incorporated.

## Checklist

The proposed changes:
- [x] fix a bug or incorrect behavior in AMReX
- [ ] add new capabilities to AMReX
- [ ] changes answers in the test suite to more than roundoff level
- [ ] are likely to significantly affect the results of downstream AMReX
users
- [ ] include documentation in the code and/or rst files, if appropriate
  • Loading branch information
ankithadas authored Nov 16, 2023
1 parent d171635 commit d93f344
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Src/Base/AMReX_FabArrayUtility.H
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ template <class FAB,
void
Subtract (FabArray<FAB>& dst, FabArray<FAB> const& src, int srccomp, int dstcomp, int numcomp, int nghost)
{
Subtract(dst,src,srccomp,dstcomp,numcomp,nghost);
Subtract(dst,src,srccomp,dstcomp,numcomp,IntVect(nghost));
}

template <class FAB,
Expand Down

0 comments on commit d93f344

Please sign in to comment.