avoid dead stores

This commit is contained in:
Arne Morten Kvarving 2023-06-27 13:40:54 +02:00
parent a31f1cefd5
commit adfe80cba0
3 changed files with 5 additions and 4 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

@ -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: {