Skip to content

Commit

Permalink
Fix allocateSlice for EB (#3391)
Browse files Browse the repository at this point in the history
The slice data has a different BoxArray, so we cannot use the original
Factory.

## 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
WeiqunZhang authored Jul 15, 2023
1 parent 36f42ea commit 5376bf8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Src/Base/AMReX_MultiFabUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ namespace {
}
BoxArray slice_ba(&boxes[0], static_cast<int>(boxes.size()));
DistributionMapping slice_dmap(std::move(procs));
std::unique_ptr<MultiFab> slice(new MultiFab(slice_ba, slice_dmap, ncomp, 0,
MFInfo(), cell_centered_data.Factory()));
return slice;

return std::make_unique<MultiFab>(slice_ba, slice_dmap, ncomp, 0,
MFInfo(), FArrayBoxFactory());
}
}

Expand Down

0 comments on commit 5376bf8

Please sign in to comment.