diff --git a/opm/simulators/wells/MultisegmentWellAssemble.cpp b/opm/simulators/wells/MultisegmentWellAssemble.cpp index 0743c9491..7dc61949b 100644 --- a/opm/simulators/wells/MultisegmentWellAssemble.cpp +++ b/opm/simulators/wells/MultisegmentWellAssemble.cpp @@ -121,7 +121,7 @@ assembleControlEq(const WellState& well_state, } else if (well_.isInjector() ) { // Find scaling factor to get injection rate, const InjectorType injectorType = inj_controls.injector_type; - double scaling = 1.0; + double scaling; const auto& pu = well_.phaseUsage(); switch (injectorType) { case InjectorType::WATER: diff --git a/tests/test_preconditionerfactory.cpp b/tests/test_preconditionerfactory.cpp index 468b94926..c8bb7d524 100644 --- a/tests/test_preconditionerfactory.cpp +++ b/tests/test_preconditionerfactory.cpp @@ -110,7 +110,7 @@ testPrec(const Opm::PropertyTree& prm, const std::string& matrix_filename, const void test1(const Opm::PropertyTree& prm) { - const int bz = 1; + constexpr int bz = 1; auto sol = testPrec(prm, "matr33.txt", "rhs3.txt"); Dune::BlockVector> expected {-1.62493, -1.76435e-06, @@ -131,7 +131,7 @@ void test1(const Opm::PropertyTree& prm) void test3(const Opm::PropertyTree& prm) { - const int bz = 3; + constexpr int bz = 3; auto sol = testPrec(prm, "matr33.txt", "rhs3.txt"); Dune::BlockVector> expected {{-1.62493, -1.76435e-06, 1.86991e-10}, {-458.542, 2.28308e-06, -2.45341e-07}, @@ -176,13 +176,13 @@ BOOST_AUTO_TEST_CASE(TestAddingPreconditioner) // Test with 1x1 block solvers. { - const int bz = 1; + constexpr int bz = 1; BOOST_CHECK_THROW(testPrec(prm, "matr33.txt", "rhs3.txt"), std::invalid_argument); } // Test with 3x3 block solvers. { - const int bz = 3; + constexpr int bz = 3; BOOST_CHECK_THROW(testPrec(prm, "matr33.txt", "rhs3.txt"), std::invalid_argument); } @@ -199,7 +199,7 @@ BOOST_AUTO_TEST_CASE(TestAddingPreconditioner) // Test with 3x3 block solvers. { - const int bz = 3; + constexpr int bz = 3; BOOST_CHECK_THROW(testPrec(prm, "matr33.txt", "rhs3.txt"), std::invalid_argument); } @@ -316,7 +316,7 @@ testPrecRepeating(const Opm::PropertyTree& prm, const std::string& matrix_filena void test1rep(const Opm::PropertyTree& prm) { - const int bz = 1; + constexpr int bz = 1; auto sol = testPrecRepeating(prm, "matr33rep.txt", "rhs3rep.txt"); Dune::BlockVector> expected {0.285714285714286, 0.285714285714286, @@ -337,7 +337,7 @@ void test1rep(const Opm::PropertyTree& prm) void test3rep(const Opm::PropertyTree& prm) { - const int bz = 3; + constexpr int bz = 3; auto sol = testPrecRepeating(prm, "matr33rep.txt", "rhs3rep.txt"); Dune::BlockVector> expected { {0.285714285714286, 0.285714285714286, 0.285714285714286},