aboutsummaryrefslogtreecommitdiff
path: root/Source/Parallelization/WarpXComm.cpp
diff options
context:
space:
mode:
authorGravatar Luca Fedeli <luca.fedeli@cea.fr> 2020-10-19 10:17:46 +0200
committerGravatar GitHub <noreply@github.com> 2020-10-19 01:17:46 -0700
commit1e7de3b536c974327513d17f9aee156d93030825 (patch)
treefb5885e8fbbbfdd51d5d9efcc53c597a41b2fa1d /Source/Parallelization/WarpXComm.cpp
parent1f8f4f74adf7d460c593752a83e3574cc5cc0589 (diff)
downloadWarpX-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/Parallelization/WarpXComm.cpp')
-rw-r--r--Source/Parallelization/WarpXComm.cpp13
1 files changed, 9 insertions, 4 deletions
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 <algorithm>
#include <cstdlib>
+#include <memory>
+
using namespace amrex;
void
@@ -114,12 +116,13 @@ WarpX::UpdateAuxilaryDataStagToNodal ()
Array<std::unique_ptr<MultiFab>,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<MultiFab>(
+ *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<MultiFab>(cnba, dm, 1, ngtmp);
}
}
// ParallelCopy from coarse level
@@ -162,12 +165,14 @@ WarpX::UpdateAuxilaryDataStagToNodal ()
Array<std::unique_ptr<MultiFab>,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<MultiFab>(
+ *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<MultiFab>(
+ cnba, dm, 1, ngtmp);
}
}
// ParallelCopy from coarse level