diff --git a/opm/models/io/structuredgridvanguard.hh b/opm/models/io/structuredgridvanguard.hh index 8b41e03375..bc0c4d0ee9 100644 --- a/opm/models/io/structuredgridvanguard.hh +++ b/opm/models/io/structuredgridvanguard.hh @@ -65,22 +65,25 @@ struct StructuredGridVanguard {}; // GRIDDIM is only set by the finger problem #ifndef GRIDDIM -static const int dim = 2; +static constexpr int dim = 2; #else -static const int dim = GRIDDIM; +static constexpr int dim = GRIDDIM; #endif // set the Grid and Vanguard properties #if HAVE_DUNE_ALUGRID template -struct Grid { using type = Dune::ALUGrid< dim, dim, Dune::cube, Dune::nonconforming >; }; +struct Grid +{ using type = Dune::ALUGrid< dim, dim, Dune::cube, Dune::nonconforming >; }; #else template -struct Grid { using type = Dune::YaspGrid< dim >; }; +struct Grid +{ using type = Dune::YaspGrid< dim >; }; #endif template -struct Vanguard { using type = Opm::StructuredGridVanguard; }; +struct Vanguard +{ using type = Opm::StructuredGridVanguard; }; } // namespace Opm::Properties @@ -116,7 +119,7 @@ public: ("The size of the domain in x direction"); Parameters::Register ("The number of intervalls in x direction"); - if (dim > 1) { + if constexpr (dim > 1) { Parameters::Register> ("The size of the domain in y direction"); Parameters::Register @@ -153,23 +156,23 @@ public: } std::stringstream dgffile; - dgffile << "DGF" << std::endl; - dgffile << "INTERVAL" << std::endl; - dgffile << lowerLeft << std::endl; - dgffile << upperRight << std::endl; - dgffile << cellRes << std::endl; - dgffile << "#" << std::endl; - dgffile << "GridParameter" << std::endl; - dgffile << "overlap 1" << std::endl; - dgffile << "#" << std::endl; - dgffile << "Simplex" << std::endl; - dgffile << "#" << std::endl; + dgffile << "DGF" << '\n' + << "INTERVAL" << '\n' + << lowerLeft << '\n' + << upperRight << '\n' + << cellRes << '\n' + << "#" << '\n' + << "GridParameter" << '\n' + << "overlap 1" << '\n' + << "#" << '\n' + << "Simplex" << '\n' + << "#" << '\n'; // use DGF parser to create a grid from interval block - gridPtr_.reset( Dune::GridPtr< Grid >( dgffile ).release() ); + gridPtr_.reset(Dune::GridPtr(dgffile).release()); - unsigned numRefinements = Parameters::Get(); - gridPtr_->globalRefine(static_cast(numRefinements)); + const int numRefinements = Parameters::Get(); + gridPtr_->globalRefine(numRefinements); this->finalizeInit_(); }