Merge pull request #4706 from atgeirr/fix-shadow-warning

Silence shadowing warning.
This commit is contained in:
Bård Skaflestad 2023-06-13 21:25:46 +02:00 committed by GitHub
commit ed591239a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1980,11 +1980,11 @@ namespace Opm
getPrimaryVars() const getPrimaryVars() const
{ {
const int num_seg = this->numberOfSegments(); const int num_seg = this->numberOfSegments();
constexpr int numWellEq = MSWEval::numWellEq; constexpr int num_eq = MSWEval::numWellEq;
std::vector<double> retval(num_seg * numWellEq); std::vector<double> retval(num_seg * num_eq);
for (int ii = 0; ii < num_seg; ++ii) { for (int ii = 0; ii < num_seg; ++ii) {
const auto& pv = this->primary_variables_.value(ii); const auto& pv = this->primary_variables_.value(ii);
std::copy(pv.begin(), pv.end(), retval.begin() + ii * numWellEq); std::copy(pv.begin(), pv.end(), retval.begin() + ii * num_eq);
} }
return retval; return retval;
} }
@ -1998,14 +1998,14 @@ namespace Opm
setPrimaryVars(std::vector<double>::const_iterator it) setPrimaryVars(std::vector<double>::const_iterator it)
{ {
const int num_seg = this->numberOfSegments(); const int num_seg = this->numberOfSegments();
constexpr int numWellEq = MSWEval::numWellEq; constexpr int num_eq = MSWEval::numWellEq;
std::array<double, numWellEq> tmp; std::array<double, num_eq> tmp;
for (int ii = 0; ii < num_seg; ++ii) { for (int ii = 0; ii < num_seg; ++ii) {
const auto start = it + num_seg * numWellEq; const auto start = it + num_seg * num_eq;
std::copy(start, start + numWellEq, tmp.begin()); std::copy(start, start + num_eq, tmp.begin());
this->primary_variables_.setValue(ii, tmp); this->primary_variables_.setValue(ii, tmp);
} }
return num_seg * numWellEq; return num_seg * num_eq;
} }