mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Refactored loop which applies the EDITNCC.
This commit is contained in:
parent
7a4b817010
commit
7c2f6d9275
@ -530,6 +530,7 @@ private:
|
|||||||
|
|
||||||
// editNNC is supposed to only reference non-neighboring connections and not
|
// editNNC is supposed to only reference non-neighboring connections and not
|
||||||
// neighboring connections. Use all entries for scaling if there is an NNC.
|
// neighboring connections. Use all entries for scaling if there is an NNC.
|
||||||
|
// variable nnc incremented in loop body.
|
||||||
for (auto nnc = editNNC.data().begin(), end = editNNC.data().end(); nnc != end; )
|
for (auto nnc = editNNC.data().begin(), end = editNNC.data().end(); nnc != end; )
|
||||||
{
|
{
|
||||||
auto c1 = nnc->cell1, c2 = nnc->cell2;
|
auto c1 = nnc->cell1, c2 = nnc->cell2;
|
||||||
@ -539,22 +540,24 @@ private:
|
|||||||
std::swap(low, high);
|
std::swap(low, high);
|
||||||
}
|
}
|
||||||
auto candidate = trans_.find(isId_(low, high));
|
auto candidate = trans_.find(isId_(low, high));
|
||||||
do
|
|
||||||
{
|
if ( candidate == trans_.end() )
|
||||||
if ( candidate != trans_.end() )
|
|
||||||
{
|
|
||||||
// NNC exists
|
|
||||||
candidate->second *= nnc->trans;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
|
++nnc;
|
||||||
std::ostringstream sstr;
|
std::ostringstream sstr;
|
||||||
sstr << "Cannot edit NNC from " << nnc->cell1 << " to " << nnc->cell2
|
sstr << "Cannot edit NNC from " << nnc->cell1 << " to " << nnc->cell2
|
||||||
<< " as it does not exist";
|
<< " as it does not exist";
|
||||||
Opm::OpmLog::warning(sstr.str());
|
Opm::OpmLog::warning(sstr.str());
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// NNC exists
|
||||||
|
while ( nnc!= end && c1==nnc->cell1 && c2==nnc->cell2 )
|
||||||
|
{
|
||||||
|
candidate->second *= nnc->trans;
|
||||||
++nnc;
|
++nnc;
|
||||||
} while ( nnc!= end && c1==nnc->cell1 && c2==nnc->cell2 );
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user