diff options
Diffstat (limited to 'Source/Diagnostics/ComputeDiagFunctors/BackTransformFunctor.cpp')
-rw-r--r-- | Source/Diagnostics/ComputeDiagFunctors/BackTransformFunctor.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Source/Diagnostics/ComputeDiagFunctors/BackTransformFunctor.cpp b/Source/Diagnostics/ComputeDiagFunctors/BackTransformFunctor.cpp index 298a74c2b..f38373862 100644 --- a/Source/Diagnostics/ComputeDiagFunctors/BackTransformFunctor.cpp +++ b/Source/Diagnostics/ComputeDiagFunctors/BackTransformFunctor.cpp @@ -1,7 +1,11 @@ #include "BackTransformFunctor.H" #include "WarpX.H" + #include <AMReX_MultiFabUtil.H> #include <AMReX_MultiFabUtil_C.H> + +#include <memory> + using namespace amrex; BackTransformFunctor::BackTransformFunctor (amrex::MultiFab const * mf_src, int lev, @@ -50,8 +54,8 @@ BackTransformFunctor::operator ()(amrex::MultiFab& mf_dst, int /*dcomp*/, const // Define MultiFab with the distribution map of the destination multifab and // containing all ten components that were in the slice generated from m_mf_src. std::unique_ptr< amrex::MultiFab > tmp_slice_ptr = nullptr; - tmp_slice_ptr.reset( new MultiFab ( slice_ba, mf_dst.DistributionMap(), - slice->nComp(), 0) ); + tmp_slice_ptr = std::make_unique<MultiFab> ( slice_ba, mf_dst.DistributionMap(), + slice->nComp(), 0 ); // Parallel copy the lab-frame data from "slice" MultiFab with // ncomp=10 and boosted-frame dmap to "tmp_slice_ptr" MultiFab with // ncomp=10 and dmap of the destination Multifab, which will store the final data @@ -96,11 +100,8 @@ BackTransformFunctor::operator ()(amrex::MultiFab& mf_dst, int /*dcomp*/, const } // Reset the temporary MultiFabs generated - slice.reset(new MultiFab); - slice.reset(nullptr); - tmp_slice_ptr.reset(new MultiFab); - tmp_slice_ptr.reset(nullptr); - + slice = nullptr; + tmp_slice_ptr = nullptr; } } |