diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQConfig.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQConfig.cpp index bdca0d08e..4d907420e 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQConfig.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQConfig.cpp @@ -154,20 +154,26 @@ namespace Opm { std::vector UDQConfig::definitions() const { std::vector ret; - for (const auto& key : this->define_order) { - if (this->action_type(key) == UDQAction::DEFINE) - ret.push_back(this->m_definitions.at(key)); + for (const auto& index_pair : this->input_index) { + if (index_pair.second.action == UDQAction::DEFINE) { + const std::string& key = index_pair.first; + ret.push_back( this->m_definitions.at(key) ); + } } + return ret; } std::vector UDQConfig::definitions(UDQVarType var_type) const { std::vector filtered_defines; - for (const auto& key : this->define_order) { - const auto& udq_define = this->m_definitions.at(key); - if (udq_define.var_type() == var_type && this->action_type(key) == UDQAction::DEFINE) - filtered_defines.push_back(udq_define); + for (const auto& index_pair : this->input_index) { + if (index_pair.second.action == UDQAction::DEFINE) { + const std::string& key = index_pair.first; + const auto& udq_define = this->m_definitions.at(key); + if (udq_define.var_type() == var_type) + filtered_defines.push_back(udq_define); + } } return filtered_defines; } diff --git a/tests/parser/UDQTests.cpp b/tests/parser/UDQTests.cpp index 1a468977f..47243761d 100644 --- a/tests/parser/UDQTests.cpp +++ b/tests/parser/UDQTests.cpp @@ -1816,8 +1816,8 @@ BOOST_AUTO_TEST_CASE(UDQ_DEFINE_ORDER) { SCHEDULE UDQ ASSIGN FU_PAR1 1.0 / -ASSIGN FU_PAR2 0.0 / DEFINE FU_PAR3 FMWPR / +ASSIGN FU_PAR2 0.0 / DEFINE FU_PAR2 FU_PAR3 / / )";