diff --git a/ebos/alucartesianindexmapper.hh b/ebos/alucartesianindexmapper.hh index 754a60f7d..6a0873d89 100644 --- a/ebos/alucartesianindexmapper.hh +++ b/ebos/alucartesianindexmapper.hh @@ -230,7 +230,7 @@ public: { typedef GlobalIndexDataHandle DataHandle ; assert(&grid_ == &gridView.grid()); - return std::unique_ptr(new DataHandle(gridView, cartesianIndex_)); + return std::make_unique(gridView, cartesianIndex_); } protected: diff --git a/ebos/eclbasevanguard.hh b/ebos/eclbasevanguard.hh index a39922a72..f18a9e52e 100644 --- a/ebos/eclbasevanguard.hh +++ b/ebos/eclbasevanguard.hh @@ -239,7 +239,7 @@ public: tmp.emplace_back(Opm::ParseContext::SUMMARY_UNKNOWN_GROUP, Opm::InputError::WARN); tmp.emplace_back(Opm::ParseContext::PARSE_EXTRA_RECORDS, Opm::InputError::WARN); - std::unique_ptr parseContext(new Opm::ParseContext(tmp)); + auto parseContext = std::make_unique(tmp); const std::string ignoredKeywords = EWOMS_GET_PARAM(TypeTag, std::string, IgnoreKeywords); if (ignoredKeywords.size() > 0) { diff --git a/ebos/mebos_main.cc b/ebos/mebos_main.cc index 9e08ef8b7..c8927dc93 100644 --- a/ebos/mebos_main.cc +++ b/ebos/mebos_main.cc @@ -69,7 +69,7 @@ int main(int argc, char **argv) std::unique_ptr parseContext = Opm::ebosBlackOilCreateParseContext(argc, argv); - std::unique_ptr errorGuard(new Opm::ErrorGuard); + auto errorGuard = std::make_unique(); // deal with parallel runs int myRank = Dune::MPIHelper::instance(argc, argv).rank(); @@ -78,7 +78,7 @@ int main(int argc, char **argv) // parse the deck file if (myRank == 0) std::cout << "Parsing deck file \"" << deckFileName << "\"" << std::endl; - std::unique_ptr deck(new Opm::Deck(parser.parseFile(deckFileName, *parseContext, *errorGuard))); + auto deck = std::make_unique(parser.parseFile(deckFileName, *parseContext, *errorGuard)); // TODO: check which variant ought to be used bool waterActive = deck->hasKeyword("WATER"); diff --git a/opm/simulators/flow/SimulatorFullyImplicitBlackoilEbos.hpp b/opm/simulators/flow/SimulatorFullyImplicitBlackoilEbos.hpp index 1e900b991..83dbd3893 100644 --- a/opm/simulators/flow/SimulatorFullyImplicitBlackoilEbos.hpp +++ b/opm/simulators/flow/SimulatorFullyImplicitBlackoilEbos.hpp @@ -330,12 +330,12 @@ protected: std::unique_ptr createSolver(WellModel& wellModel) { - auto model = std::unique_ptr(new Model(ebosSimulator_, - modelParam_, - wellModel, - terminalOutput_)); + auto model = std::make_unique(ebosSimulator_, + modelParam_, + wellModel, + terminalOutput_); - return std::unique_ptr(new Solver(solverParam_, std::move(model))); + return std::make_unique(solverParam_, std::move(model)); } void outputTimestampFIP(const SimulatorTimer& timer, const std::string version) diff --git a/opm/simulators/linalg/BlackoilAmg.hpp b/opm/simulators/linalg/BlackoilAmg.hpp index 1d88d5cc9..86235ccd7 100644 --- a/opm/simulators/linalg/BlackoilAmg.hpp +++ b/opm/simulators/linalg/BlackoilAmg.hpp @@ -122,7 +122,7 @@ scaleMatrixDRS(const Operator& op, std::size_t pressureEqnIndex, const Vector& w using Matrix = typename Operator::matrix_type; using Block = typename Matrix::block_type; using BlockVector = typename Vector::block_type; - std::unique_ptr matrix(new Matrix(op.getmat())); + auto matrix = std::make_unique(op.getmat()); if (param.cpr_use_drs_) { const auto endi = matrix->end(); for (auto i = matrix->begin(); i != endi; ++i) { diff --git a/opm/simulators/linalg/ISTLSolverEbos.hpp b/opm/simulators/linalg/ISTLSolverEbos.hpp index dc324e583..fa315877e 100644 --- a/opm/simulators/linalg/ISTLSolverEbos.hpp +++ b/opm/simulators/linalg/ISTLSolverEbos.hpp @@ -517,7 +517,7 @@ DenseMatrix transposeDenseMatrix(const DenseMatrix& M) const MILU_VARIANT ilu_milu = parameters_.ilu_milu_; const bool ilu_redblack = parameters_.ilu_redblack_; const bool ilu_reorder_spheres = parameters_.ilu_reorder_sphere_; - std::unique_ptr precond(new SeqPreconditioner(opA.getmat(), ilu_fillin, relax, ilu_milu, ilu_redblack, ilu_reorder_spheres)); + auto precond = std::make_unique(opA.getmat(), ilu_fillin, relax, ilu_milu, ilu_redblack, ilu_reorder_spheres); return precond; } diff --git a/opm/simulators/timestepping/AdaptiveSimulatorTimer.cpp b/opm/simulators/timestepping/AdaptiveSimulatorTimer.cpp index 26c0037c6..8e0b30d1a 100644 --- a/opm/simulators/timestepping/AdaptiveSimulatorTimer.cpp +++ b/opm/simulators/timestepping/AdaptiveSimulatorTimer.cpp @@ -167,7 +167,7 @@ AdaptiveSimulatorTimer& AdaptiveSimulatorTimer::operator++ () std::unique_ptr< SimulatorTimerInterface > AdaptiveSimulatorTimer::clone() const { - return std::unique_ptr< SimulatorTimerInterface > (new AdaptiveSimulatorTimer( *this )); + return std::make_unique(*this); } diff --git a/opm/simulators/timestepping/SimulatorTimer.cpp b/opm/simulators/timestepping/SimulatorTimer.cpp index 6efa3a7ed..a5b441260 100644 --- a/opm/simulators/timestepping/SimulatorTimer.cpp +++ b/opm/simulators/timestepping/SimulatorTimer.cpp @@ -165,7 +165,7 @@ namespace Opm std::unique_ptr< SimulatorTimerInterface > SimulatorTimer::clone() const { - return std::unique_ptr< SimulatorTimerInterface > (new SimulatorTimer( *this )); + return std::make_unique(*this); } diff --git a/opm/simulators/wells/RateConverter.hpp b/opm/simulators/wells/RateConverter.hpp index 8e5986465..910290255 100644 --- a/opm/simulators/wells/RateConverter.hpp +++ b/opm/simulators/wells/RateConverter.hpp @@ -169,7 +169,7 @@ namespace Opm { using VT = typename AttributeMap::value_type; for (const auto& r : rmap.activeRegions()) { - auto v = std::unique_ptr(new Value(attr)); + auto v = std::make_unique(attr); const auto stat = attr_.insert(VT(r, std::move(v)));