diff options
author | 2020-10-19 10:17:46 +0200 | |
---|---|---|
committer | 2020-10-19 01:17:46 -0700 | |
commit | 1e7de3b536c974327513d17f9aee156d93030825 (patch) | |
tree | fb5885e8fbbbfdd51d5d9efcc53c597a41b2fa1d /Source/Diagnostics/ComputeDiagFunctors/BackTransformFunctor.cpp | |
parent | 1f8f4f74adf7d460c593752a83e3574cc5cc0589 (diff) | |
download | WarpX-1e7de3b536c974327513d17f9aee156d93030825.tar.gz WarpX-1e7de3b536c974327513d17f9aee156d93030825.tar.zst WarpX-1e7de3b536c974327513d17f9aee156d93030825.zip |
Replace wherever possible '.reset(new' with '= make_unique' (#1429)
* replace wherever possible .reset(new with = make_unique
* fixed bug
* fixed bug
* revert WarpXOpenPMD.cpp to the original version
* removed another .reset(new
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; } } |