Using OrderedMap as container for groups

This commit is contained in:
Joakim Hove
2018-03-18 19:33:58 +01:00
parent 0dbabc19ca
commit f5a80f807f
3 changed files with 14 additions and 8 deletions

View File

@@ -1542,7 +1542,7 @@ namespace Opm {
}
void Schedule::addGroup(const std::string& groupName, size_t timeStep) {
m_groups.emplace( groupName, Group { groupName, m_timeMap, timeStep } );
m_groups.insert( groupName, Group { groupName, m_timeMap, timeStep } );
m_events.addEvent( ScheduleEvents::NEW_GROUP , timeStep );
}
@@ -1551,7 +1551,7 @@ namespace Opm {
}
bool Schedule::hasGroup(const std::string& groupName) const {
return m_groups.find(groupName) != m_groups.end();
return m_groups.hasKey(groupName);
}
@@ -1565,8 +1565,8 @@ namespace Opm {
std::vector< const Group* > Schedule::getGroups() const {
std::vector< const Group* > groups;
for( const auto& itr : m_groups )
groups.push_back( &itr.second );
for( const auto& group : m_groups )
groups.push_back( &group );
return groups;
}