The SimpleTable class is initialized with a DeckItem instance containing
all the date for the table, instead of a DeckRecord (or DeckKeyword). As
a consequence the getFlatXxxx() methods have been removed.
- Introduce a very simple class ParseMode which will become a simple
value object which can be used to control the behavior when errors
and inconsistencies are encountered in the parse and EclipseState
construction phases.
- Added ParseMode instance as second argument to all parseXXX()
methods.
since tables can be tricky, we now enforce that the compiler bails out
if the user tries to instantiate a table class manually.
Note that a bit of trickery is needed to keep the low-level unit
tests working...
for some kinds of tables this means linear interpolation for some
columns, constant for other columns and some tables do not allow to
specify default. Since there is no clear rule, this patch involved
checking the reference manual for every single f****** table keyword
plus some guess-work if the reference manual is unclear about
monotonicity and/or defaults.
... and constant interpolation at the fringes. this kind of evaluation
in between sampling point only makes sense for tables where the first
column is strictly monotonic, though.
the idea is to create a lightweight wrapper objects around
DeckKeywords which allow more convenient and more readable access to
the data. E.g. instead of
std::vector outerColumnNames{"RV", "P", "BG", "MUG"};
std::vector innerColumnNames{"P", "BG", "MUG"};
Opm::FullTable pvtgTable(deck->getKeyword("PVTG"),
outerColumnNames, innerColumnNames);
pvtgTable->getOuterTable()->getColumn(1);
one now better uses
Opm::PvtgTable pvtgTable(deck->getKeyword("PVTG"));
pvtgTable->getOuterTable()->getPressureColumn();
the idea for the other keywords is similar.
This is intended for keywords like SWOF which currently is a big
vector of doubles but one needs to use the data in a column oriented
way.
This class is intended to be used like this:
Opm::DeckKeywordConstPtr swofKeyword = newParserDeck->getKeyword("SWOF");
Opm::SimpleTable swofTable(swofKeyword,
/*columns=*/std::vector<std::string>{"SW", "KRW", "KROW", "PCOW"},
/*recordIdx=*/table_num);
const std::vector<double>& sw = swofTable.getColumn(0);
// ...
what might be useful is to move the column names into the JSON
description of the keywords, but I could not find a way to go back to
the parser from the deck/keyword. maybe this is not even desireable as
decks might also be created by other means...
Also, a multi-record variant of the class is available. That one is
intended for keywords like PVTO where the first few items of each
record form a table (in the case of PVTO: Rs, pressure, Bo, and
viscosity for staturated oil) and the next entries constitute another
table (in the case of PVTO: pressure, Bo and viscosity for
undersaturated oil with the same RS factor as the first entry).
The second kind of tables can be constructed using the item-based
variant of SimpleTable.