Initialisation of EGLNUM (analogous to e.g SATNUM)

This commit is contained in:
osae 2014-05-06 12:47:24 +02:00 committed by Andreas Lauser
parent 6f3a03c072
commit bc558f3818

View File

@ -312,23 +312,14 @@ namespace Opm
{
std::vector<int> eqlnum;
if (newParserDeck->hasKeyword("EQLNUM")) {
const std::vector<int>& e = newParserDeck->getKeyword("EQLNUM")->getIntData();
eqlnum.reserve(e.size());
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());
eqlnum.resize(G.number_of_cells);
const std::vector<int>& e =
newParserDeck->getKeyword("EQLNUM")->getIntData();
const int* gc = G.global_cell;
for (int cell = 0; cell < G.number_of_cells; ++cell) {
const int deck_pos = (gc == NULL) ? cell : gc[cell];
eqlnum[cell] = e[deck_pos] - 1;
}
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.