mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
use std::make_unique where applicable
This commit is contained in:
@@ -230,7 +230,7 @@ public:
|
||||
{
|
||||
typedef GlobalIndexDataHandle<GridView> DataHandle ;
|
||||
assert(&grid_ == &gridView.grid());
|
||||
return std::unique_ptr<DataHandle>(new DataHandle(gridView, cartesianIndex_));
|
||||
return std::make_unique<DataHandle>(gridView, cartesianIndex_);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
@@ -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<Opm::ParseContext> parseContext(new Opm::ParseContext(tmp));
|
||||
auto parseContext = std::make_unique<Opm::ParseContext>(tmp);
|
||||
|
||||
const std::string ignoredKeywords = EWOMS_GET_PARAM(TypeTag, std::string, IgnoreKeywords);
|
||||
if (ignoredKeywords.size() > 0) {
|
||||
|
||||
@@ -69,7 +69,7 @@ int main(int argc, char **argv)
|
||||
|
||||
std::unique_ptr<Opm::ParseContext> parseContext
|
||||
= Opm::ebosBlackOilCreateParseContext(argc, argv);
|
||||
std::unique_ptr<Opm::ErrorGuard> errorGuard(new Opm::ErrorGuard);
|
||||
auto errorGuard = std::make_unique<Opm::ErrorGuard>();
|
||||
|
||||
// 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<Opm::Deck> deck(new Opm::Deck(parser.parseFile(deckFileName, *parseContext, *errorGuard)));
|
||||
auto deck = std::make_unique<Opm::Deck>(parser.parseFile(deckFileName, *parseContext, *errorGuard));
|
||||
|
||||
// TODO: check which variant ought to be used
|
||||
bool waterActive = deck->hasKeyword("WATER");
|
||||
|
||||
Reference in New Issue
Block a user