mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-23 07:53:29 -06:00
Initialisation of EGLNUM (analogous to e.g SATNUM)
This commit is contained in:
parent
ca5b0eb16f
commit
d648917fcf
@ -312,23 +312,14 @@ namespace Opm
|
|||||||
{
|
{
|
||||||
std::vector<int> eqlnum;
|
std::vector<int> eqlnum;
|
||||||
if (newParserDeck->hasKeyword("EQLNUM")) {
|
if (newParserDeck->hasKeyword("EQLNUM")) {
|
||||||
const std::vector<int>& e = newParserDeck->getKeyword("EQLNUM")->getIntData();
|
eqlnum.resize(G.number_of_cells);
|
||||||
eqlnum.reserve(e.size());
|
const std::vector<int>& e =
|
||||||
if (newParserDeck->hasKeyword("ACTNUM")) {
|
newParserDeck->getKeyword("EQLNUM")->getIntData();
|
||||||
std::vector<int>::const_iterator actnum_begin =
|
const int* gc = G.global_cell;
|
||||||
newParserDeck->getKeyword("ACTNUM")->getIntData().begin();
|
for (int cell = 0; cell < G.number_of_cells; ++cell) {
|
||||||
std::transform(e.begin(), e.end(), actnum_begin, std::back_inserter(eqlnum),
|
const int deck_pos = (gc == NULL) ? cell : gc[cell];
|
||||||
[](int eql, int act){ return (act == 0) ? -1 : eql-1;});
|
eqlnum[cell] = e[deck_pos] - 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 {
|
else {
|
||||||
// No explicit equilibration region.
|
// No explicit equilibration region.
|
||||||
|
Loading…
Reference in New Issue
Block a user