From 1e7de3b536c974327513d17f9aee156d93030825 Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Mon, 19 Oct 2020 10:17:46 +0200 Subject: 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 --- Source/Parallelization/WarpXComm.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'Source/Parallelization/WarpXComm.cpp') diff --git a/Source/Parallelization/WarpXComm.cpp b/Source/Parallelization/WarpXComm.cpp index ac619a937..667be0696 100644 --- a/Source/Parallelization/WarpXComm.cpp +++ b/Source/Parallelization/WarpXComm.cpp @@ -14,6 +14,8 @@ #include #include +#include + using namespace amrex; void @@ -114,12 +116,13 @@ WarpX::UpdateAuxilaryDataStagToNodal () Array,3> Btmp; if (Bfield_cax[lev][0]) { for (int i = 0; i < 3; ++i) { - Btmp[i].reset(new MultiFab(*Bfield_cax[lev][i], amrex::make_alias, 0, 1)); + Btmp[i] = std::make_unique( + *Bfield_cax[lev][i], amrex::make_alias, 0, 1); } } else { IntVect ngtmp = Bfield_aux[lev-1][0]->nGrowVect(); for (int i = 0; i < 3; ++i) { - Btmp[i].reset(new MultiFab(cnba, dm, 1, ngtmp)); + Btmp[i] = std::make_unique(cnba, dm, 1, ngtmp); } } // ParallelCopy from coarse level @@ -162,12 +165,14 @@ WarpX::UpdateAuxilaryDataStagToNodal () Array,3> Etmp; if (Efield_cax[lev][0]) { for (int i = 0; i < 3; ++i) { - Etmp[i].reset(new MultiFab(*Efield_cax[lev][i], amrex::make_alias, 0, 1)); + Etmp[i] = std::make_unique( + *Efield_cax[lev][i], amrex::make_alias, 0, 1); } } else { IntVect ngtmp = Efield_aux[lev-1][0]->nGrowVect(); for (int i = 0; i < 3; ++i) { - Etmp[i].reset(new MultiFab(cnba, dm, 1, ngtmp)); + Etmp[i] = std::make_unique( + cnba, dm, 1, ngtmp); } } // ParallelCopy from coarse level -- cgit v1.2.3