diff --git a/opm/parser/eclipse/EclipseState/EclipseState.cpp b/opm/parser/eclipse/EclipseState/EclipseState.cpp index 5ae8e275d..126f5d7f4 100644 --- a/opm/parser/eclipse/EclipseState/EclipseState.cpp +++ b/opm/parser/eclipse/EclipseState/EclipseState.cpp @@ -875,7 +875,7 @@ namespace Opm { if (enabledTypes & DoubleProperties) { std::shared_ptr > property = m_doubleGridProperties->getKeyword( field ); - double siShiftValue = shiftValue * getSIScaling(property->getKeywordInfo().getDimensionString()); + double siShiftValue = shiftValue * getSIScaling(property->getDimensionString()); property->add(siShiftValue , boxManager.getActiveBox() ); } } else if (!m_intGridProperties->supportsKeyword(field) && diff --git a/opm/parser/eclipse/EclipseState/Grid/GridProperty.cpp b/opm/parser/eclipse/EclipseState/Grid/GridProperty.cpp index be2bd1647..e6ba85522 100644 --- a/opm/parser/eclipse/EclipseState/Grid/GridProperty.cpp +++ b/opm/parser/eclipse/EclipseState/Grid/GridProperty.cpp @@ -55,6 +55,16 @@ bool GridProperty::containsNaN( ) const { } return return_value; } + +template<> +const std::string& GridProperty::getDimensionString() const { + throw std::logic_error("Only grid properties have dimension"); +} + +template<> +const std::string& GridProperty::getDimensionString() const { + return m_kwInfo.getDimensionString(); +} } diff --git a/opm/parser/eclipse/EclipseState/Grid/GridProperty.hpp b/opm/parser/eclipse/EclipseState/Grid/GridProperty.hpp index 293dbb829..6d6b737f2 100644 --- a/opm/parser/eclipse/EclipseState/Grid/GridProperty.hpp +++ b/opm/parser/eclipse/EclipseState/Grid/GridProperty.hpp @@ -207,6 +207,8 @@ public: bool containsNaN() const; + const std::string& getDimensionString() const; + void multiplyWith(const GridProperty& other) { if ((m_nx == other.m_nx) && (m_ny == other.m_ny) && (m_nz == other.m_nz)) { for (size_t g=0; g < m_data.size(); g++) @@ -224,7 +226,7 @@ public: return m_data; } - + void maskedSet(T value, const std::vector& mask) { for (size_t g = 0; g < getCartesianSize(); g++) { if (mask[g]) @@ -373,8 +375,6 @@ public: } - - private: Opm::DeckItemConstPtr getDeckItem(Opm::DeckKeywordConstPtr deckKeyword) { if (deckKeyword->size() != 1)