aboutsummaryrefslogtreecommitdiff
path: root/Source/Diagnostics/FieldIO.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/Diagnostics/FieldIO.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/Diagnostics/FieldIO.cpp')
-rw-r--r--Source/Diagnostics/FieldIO.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/Source/Diagnostics/FieldIO.cpp b/Source/Diagnostics/FieldIO.cpp
index 10195eb99..b1c5c27cf 100644
--- a/Source/Diagnostics/FieldIO.cpp
+++ b/Source/Diagnostics/FieldIO.cpp
@@ -20,6 +20,8 @@
#include <AMReX.H>
+#include <memory>
+
using namespace amrex;
/** \brief
@@ -121,15 +123,15 @@ AverageAndPackVectorField( MultiFab& mf_avg,
if (vector_field[0]->nComp() > 1) {
// With the RZ solver, if there are more than one component, the total
// fields needs to be constructed in temporary MultiFabs.
- vector_total[0].reset(new MultiFab(vector_field[0]->boxArray(), dm, 1, vector_field[0]->nGrowVect()));
- vector_total[1].reset(new MultiFab(vector_field[1]->boxArray(), dm, 1, vector_field[1]->nGrowVect()));
- vector_total[2].reset(new MultiFab(vector_field[2]->boxArray(), dm, 1, vector_field[2]->nGrowVect()));
+ vector_total[0] = std::make_unique<MultiFab>(vector_field[0]->boxArray(), dm, 1, vector_field[0]->nGrowVect());
+ vector_total[1] = std::make_unique<MultiFab>(vector_field[1]->boxArray(), dm, 1, vector_field[1]->nGrowVect());
+ vector_total[2] = std::make_unique<MultiFab>(vector_field[2]->boxArray(), dm, 1, vector_field[2]->nGrowVect());
ConstructTotalRZVectorField(vector_total, vector_field);
} else {
// Create aliases of the MultiFabs
- vector_total[0].reset(new MultiFab(*vector_field[0], amrex::make_alias, 0, 1));
- vector_total[1].reset(new MultiFab(*vector_field[1], amrex::make_alias, 0, 1));
- vector_total[2].reset(new MultiFab(*vector_field[2], amrex::make_alias, 0, 1));
+ vector_total[0] = std::make_unique<MultiFab>(*vector_field[0], amrex::make_alias, 0, 1);
+ vector_total[1] = std::make_unique<MultiFab>(*vector_field[1], amrex::make_alias, 0, 1);
+ vector_total[2] = std::make_unique<MultiFab>(*vector_field[2], amrex::make_alias, 0, 1);
}
#else
const std::array<std::unique_ptr<MultiFab>,3> &vector_total = vector_field;