From 5376bf85b83fd8f23bd983dea52d828c86dc8f67 Mon Sep 17 00:00:00 2001 From: Weiqun Zhang Date: Sat, 15 Jul 2023 10:54:36 -0700 Subject: [PATCH] Fix allocateSlice for EB (#3391) 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 --- Src/Base/AMReX_MultiFabUtil.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Src/Base/AMReX_MultiFabUtil.cpp b/Src/Base/AMReX_MultiFabUtil.cpp index f89ca418c99..52c719a140d 100644 --- a/Src/Base/AMReX_MultiFabUtil.cpp +++ b/Src/Base/AMReX_MultiFabUtil.cpp @@ -47,9 +47,9 @@ namespace { } BoxArray slice_ba(&boxes[0], static_cast(boxes.size())); DistributionMapping slice_dmap(std::move(procs)); - std::unique_ptr slice(new MultiFab(slice_ba, slice_dmap, ncomp, 0, - MFInfo(), cell_centered_data.Factory())); - return slice; + + return std::make_unique(slice_ba, slice_dmap, ncomp, 0, + MFInfo(), FArrayBoxFactory()); } }