make ParserItems always defaultable

i.e. remove the defaultSet() method and its friends. this is required
to be able to specify defaults in DATA items like grid properties or
saturation tables. e.g.

SGL
10*0.1 10* 10*0.2 /

would not be possible without this. If no meaningful default for an
item is defined, float and double items get NaN, int items get -1 and
string ones get an empty string. The hope is that if these values get
used in the simulation, they will make the result obviously
incorrect. (Whether a data point of an item was defaulted can be
queried using item->defaultApplied(index).)
This commit is contained in:
Andreas Lauser
2014-09-12 12:23:37 +02:00
parent 539c7a23ae
commit b72df6f406
11 changed files with 69 additions and 56 deletions

View File

@@ -99,7 +99,7 @@ size_t MultiRecordTable::getNumFlatItems_(Opm::DeckRecordConstPtr deckRecord)
int result = 0;
for (unsigned i = 0; i < deckRecord->size(); ++ i) {
Opm::DeckItemConstPtr item(deckRecord->getItem(i));
if (i == 0 && !item->wasSetInDeck(0))
if (item->size() == 0 || item->defaultApplied(0))
return result;
result += item->size();
}