Fix to make EQLNUM consistent with ACTNUM.

This should eventually be integrated in the parser.
This commit is contained in:
osae 2014-05-05 11:23:43 +02:00
parent 0cdc32d213
commit bd38a577ae

View File

@ -314,8 +314,21 @@ namespace Opm
if (newParserDeck->hasKeyword("EQLNUM")) {
const std::vector<int>& e = newParserDeck->getKeyword("EQLNUM")->getIntData();
eqlnum.reserve(e.size());
std::transform(e.begin(), e.end(), std::back_inserter(eqlnum),
std::bind2nd(std::minus<int>(), 1));
if (newParserDeck->hasKeyword("ACTNUM")) {
std::vector<int>::const_iterator actnum_begin =
newParserDeck->getKeyword("ACTNUM")->getIntData().begin();
std::transform(e.begin(), e.end(), actnum_begin, std::back_inserter(eqlnum),
[](int eql, int act){ return (act == 0) ? -1 : eql-1;});
eqlnum.erase(std::remove_if(eqlnum.begin(), eqlnum.end(),
std::bind2nd(std::less<int>(), 0)),
eqlnum.end());
}
else {
std::transform(e.begin(), e.end(), std::back_inserter(eqlnum),
std::bind2nd(std::minus<int>(), 1));
}
if (eqlnum.size() != G.number_of_cells)
OPM_THROW(std::runtime_error, "Keyword EQLNUM: inconsistent array size.");
}
else {
// No explicit equilibration region.