diff --git a/opm/simulators/flow/Main.hpp b/opm/simulators/flow/Main.hpp index caaba2130..7a9785c5e 100644 --- a/opm/simulators/flow/Main.hpp +++ b/opm/simulators/flow/Main.hpp @@ -664,7 +664,7 @@ private: static int getNumThreads() { - int threads = 1; + int threads; #ifdef _OPENMP // This function is called before the parallel OpenMP stuff gets initialized. @@ -681,6 +681,8 @@ private: if (input_threads > 0) threads = input_threads; } +#else + threads = 1; #endif return threads; diff --git a/opm/simulators/flow/NonlinearSolverEbos.cpp b/opm/simulators/flow/NonlinearSolverEbos.cpp index 1ddd5b51f..60833c164 100644 --- a/opm/simulators/flow/NonlinearSolverEbos.cpp +++ b/opm/simulators/flow/NonlinearSolverEbos.cpp @@ -90,8 +90,7 @@ void stabilizeNonlinearUpdate(BVector& dx, BVector& dxOld, if (omega == 1.) { return; } - auto i = dx.size(); - for (i = 0; i < dx.size(); ++i) { + for (auto i = 0*dx.size(); i < dx.size(); ++i) { dx[i] *= omega; tempDxOld[i] *= (1.-omega); dx[i] += tempDxOld[i]; diff --git a/opm/simulators/wells/MultisegmentWell_impl.hpp b/opm/simulators/wells/MultisegmentWell_impl.hpp index 01225feab..143c99769 100644 --- a/opm/simulators/wells/MultisegmentWell_impl.hpp +++ b/opm/simulators/wells/MultisegmentWell_impl.hpp @@ -887,6 +887,7 @@ namespace Opm auto obtain = [this](const Eval& value) { if constexpr (std::is_same_v) { + static_cast(this); // suppress clang warning return getValue(value); } else { return this->extendEval(value); @@ -989,7 +990,7 @@ namespace Opm auto obtain = [this](const Eval& value) { if constexpr (std::is_same_v) { - (void)this; // suppress clang warning + static_cast(this); // suppress clang warning return getValue(value); } else { return this->extendEval(value); diff --git a/opm/simulators/wells/StandardWell_impl.hpp b/opm/simulators/wells/StandardWell_impl.hpp index 80172708a..ea3ceb457 100644 --- a/opm/simulators/wells/StandardWell_impl.hpp +++ b/opm/simulators/wells/StandardWell_impl.hpp @@ -129,6 +129,7 @@ namespace Opm auto obtain = [this](const Eval& value) { if constexpr (std::is_same_v) { + static_cast(this); // suppress clang warning return getValue(value); } else { return this->extendEval(value); @@ -145,6 +146,7 @@ namespace Opm auto zeroElem = [this]() { if constexpr (std::is_same_v) { + static_cast(this); // suppress clang warning return 0.0; } else { return Value{this->primary_variables_.numWellEq() + Indices::numEq, 0.0}; @@ -579,7 +581,7 @@ namespace Opm auto obtain = [this](const Eval& value) { if constexpr (std::is_same_v) { - (void)this; // suppress clang warning + static_cast(this); // suppress clang warning return getValue(value); } else { return this->extendEval(value); diff --git a/opm/simulators/wells/WellAssemble.cpp b/opm/simulators/wells/WellAssemble.cpp index 395bcf2e8..ad1c5fae3 100644 --- a/opm/simulators/wells/WellAssemble.cpp +++ b/opm/simulators/wells/WellAssemble.cpp @@ -214,7 +214,7 @@ assembleControlEqInj(const WellState& well_state, std::vector convert_coeff(well_.numPhases(), 1.0); well_.rateConverter().calcInjCoeff(/*fipreg*/ 0, well_.pvtRegionIdx(), convert_coeff); - double coeff = 1.0; + double coeff; switch (injectorType) { case InjectorType::WATER: {