diff options
Diffstat (limited to 'Source/Diagnostics/FieldIO.cpp')
-rw-r--r-- | Source/Diagnostics/FieldIO.cpp | 14 |
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; |