Verified behaviour of defaults (i.e. *) for multivalued items.

This commit is contained in:
Joakim Hove
2014-04-10 22:41:00 +02:00
parent f59fd25668
commit d5bf1726f2
5 changed files with 25 additions and 14 deletions

View File

@@ -131,13 +131,12 @@ namespace Opm
DeckDoubleItemPtr deckItem(new DeckDoubleItem(name() , scalar()));
double defaultValue = m_default;
if (sizeType() == ALL) { // This can probably not be combined with a default value ....
// The '*' should be interpreted as a multiplication sign
if (sizeType() == ALL) {
while (rawRecord->size() > 0) {
std::string token = rawRecord->pop_front();
if (tokenContainsStar( token )) {
StarToken<double> st(token);
double value = defaultValue; // This probably does never apply
double value = defaultValue;
if (st.hasValue())
value = st.value();
deckItem->push_backMultiple( value , st.multiplier() );

View File

@@ -131,13 +131,12 @@ namespace Opm
DeckFloatItemPtr deckItem(new DeckFloatItem(name() , scalar()));
float defaultValue = m_default;
if (sizeType() == ALL) { // This can probably not be combined with a default value ....
// The '*' should be interpreted as a multiplication sign
if (sizeType() == ALL) {
while (rawRecord->size() > 0) {
std::string token = rawRecord->pop_front();
if (tokenContainsStar( token )) {
StarToken<float> st(token);
float value = defaultValue; // This probably does never apply
float value = defaultValue;
if (st.hasValue())
value = st.value();
deckItem->push_backMultiple( value , st.multiplier() );

View File

@@ -66,13 +66,13 @@ namespace Opm {
int defaultValue = m_default;
if (sizeType() == ALL) {
// This can probably not be combined with a default value ....
// The '*' should be interpreted as a multiplication sign
// The '*' should be interpreted either as a default indicator in the cases '*' and '5*'
// or as multiplier in the case: '5*99'.
while (rawRecord->size() > 0) {
std::string token = rawRecord->pop_front();
if (tokenContainsStar( token )) {
StarToken<int> st(token);
int value = defaultValue; // This probably does never apply
int value = defaultValue;
if (st.hasValue())
value = st.value();
deckItem->push_backMultiple( value , st.multiplier() );

View File

@@ -67,13 +67,12 @@ namespace Opm {
DeckStringItemPtr deckItem(new DeckStringItem(name() , scalar()));
std::string defaultValue = m_default;
if (sizeType() == ALL) { // This can probably not be combined with a default value ....
// The '*' should be interpreted as a multiplication sign
if (sizeType() == ALL) {
while (rawRecord->size() > 0) {
std::string token = rawRecord->pop_front();
if (tokenContainsStar( token )) {
StarToken<std::string> st(token);
std::string value = defaultValue; // This probably does never apply
std::string value = defaultValue;
if (st.hasValue())
value = st.value();
deckItem->push_backMultiple( value , st.multiplier() );