Merge pull request #4724 from akva2/janitoring

Some janitoring
This commit is contained in:
Arne Morten Kvarving 2023-06-27 15:08:48 +02:00 committed by GitHub
commit 1205a38802
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 6 deletions

View File

@ -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;

View File

@ -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];

View File

@ -887,6 +887,7 @@ namespace Opm
auto obtain = [this](const Eval& value)
{
if constexpr (std::is_same_v<Value, Scalar>) {
static_cast<void>(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<Value, Scalar>) {
(void)this; // suppress clang warning
static_cast<void>(this); // suppress clang warning
return getValue(value);
} else {
return this->extendEval(value);

View File

@ -129,6 +129,7 @@ namespace Opm
auto obtain = [this](const Eval& value)
{
if constexpr (std::is_same_v<Value, Scalar>) {
static_cast<void>(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<Value, Scalar>) {
static_cast<void>(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<Value, Scalar>) {
(void)this; // suppress clang warning
static_cast<void>(this); // suppress clang warning
return getValue(value);
} else {
return this->extendEval(value);

View File

@ -214,7 +214,7 @@ assembleControlEqInj(const WellState& well_state,
std::vector<double> 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: {