From f88bf5738817156ec70352edd0a3286f470a534c Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 21 Jun 2023 08:54:53 +0200 Subject: [PATCH 1/4] use temporary helper variable --- opm/simulators/wells/BlackoilWellModel_impl.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opm/simulators/wells/BlackoilWellModel_impl.hpp b/opm/simulators/wells/BlackoilWellModel_impl.hpp index 6b6031589..c77a9fc7b 100644 --- a/opm/simulators/wells/BlackoilWellModel_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModel_impl.hpp @@ -1621,7 +1621,7 @@ namespace Opm { this->wellState(), B_avg, local_deferredLogger, - iterationIdx > param_.strict_outer_iter_wells_); + relax_tolerance); } else { ConvergenceReport report; using CR = ConvergenceReport; From 2327768db6971471b433c0330a148aeb9a16059e Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 21 Jun 2023 08:55:11 +0200 Subject: [PATCH 2/4] anonymize unused parameter --- opm/simulators/wells/BlackoilWellModel_impl.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opm/simulators/wells/BlackoilWellModel_impl.hpp b/opm/simulators/wells/BlackoilWellModel_impl.hpp index c77a9fc7b..8718af754 100644 --- a/opm/simulators/wells/BlackoilWellModel_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModel_impl.hpp @@ -1042,7 +1042,7 @@ namespace Opm { template void BlackoilWellModel:: - assembleDomain(const int iterationIdx, + assembleDomain(const int /*iterationIdx*/, const double dt, const Domain& domain) { From c8924d67ca781169a86035033eac19903128431d Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 21 Jun 2023 08:59:03 +0200 Subject: [PATCH 3/4] PreconditionerAdapter: use override --- opm/simulators/linalg/cuistl/PreconditionerAdapter.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opm/simulators/linalg/cuistl/PreconditionerAdapter.hpp b/opm/simulators/linalg/cuistl/PreconditionerAdapter.hpp index f4f382538..5014074f2 100644 --- a/opm/simulators/linalg/cuistl/PreconditionerAdapter.hpp +++ b/opm/simulators/linalg/cuistl/PreconditionerAdapter.hpp @@ -97,7 +97,7 @@ public: //! Category of the preconditioner (see SolverCategory::Category) - virtual Dune::SolverCategory::Category category() const + Dune::SolverCategory::Category category() const override { return m_underlyingPreconditioner->category(); } From 3c566a9e4edbdc4a23040eb53ef38df5c34c5b15 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 21 Jun 2023 08:59:16 +0200 Subject: [PATCH 4/4] avoid dead store --- opm/simulators/wells/MultisegmentWellAssemble.cpp | 2 +- tests/test_preconditionerfactory.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) 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},