mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Schedule::getGroup returns reference, not pointer
This commit is contained in:
@@ -47,32 +47,32 @@ BOOST_AUTO_TEST_CASE(AddWellsAndGroupToCollection) {
|
||||
EclipseStateConstPtr eclipseState(new EclipseState(*deck, parseContext));
|
||||
PhaseUsage pu = phaseUsageFromDeck(eclipseState);
|
||||
|
||||
GroupTreeNodePtr field=eclipseState->getSchedule()->getGroupTree(2)->getNode("FIELD");
|
||||
GroupTreeNodePtr g1=eclipseState->getSchedule()->getGroupTree(2)->getNode("G1");
|
||||
GroupTreeNodePtr g2=eclipseState->getSchedule()->getGroupTree(2)->getNode("G2");
|
||||
GroupTreeNodePtr field=eclipseState->getSchedule()->getGroupTree(2).getNode("FIELD");
|
||||
GroupTreeNodePtr g1=eclipseState->getSchedule()->getGroupTree(2).getNode("G1");
|
||||
GroupTreeNodePtr g2=eclipseState->getSchedule()->getGroupTree(2).getNode("G2");
|
||||
|
||||
WellCollection collection;
|
||||
|
||||
// Add groups to WellCollection
|
||||
const auto* fieldGroup = eclipseState->getSchedule()->getGroup(field->name());
|
||||
const auto& fieldGroup = eclipseState->getSchedule()->getGroup(field->name());
|
||||
collection.addField(fieldGroup, 2, pu);
|
||||
|
||||
for (auto iter = field->begin(); iter != field->end(); ++iter) {
|
||||
const auto* childGroupNode = eclipseState->getSchedule()->getGroup((*iter).second->name());
|
||||
collection.addGroup(childGroupNode, fieldGroup->name(), 2, pu);
|
||||
const auto& childGroupNode = eclipseState->getSchedule()->getGroup((*iter).second->name());
|
||||
collection.addGroup(childGroupNode, fieldGroup.name(), 2, pu);
|
||||
}
|
||||
|
||||
const auto* g1Group = eclipseState->getSchedule()->getGroup(g1->name());
|
||||
const auto& g1Group = eclipseState->getSchedule()->getGroup(g1->name());
|
||||
for (auto iter = g1->begin(); iter != g1->end(); ++iter) {
|
||||
const auto* childGroupNode = eclipseState->getSchedule()->getGroup((*iter).second->name());
|
||||
collection.addGroup(childGroupNode, g1Group->name(), 2, pu);
|
||||
const auto& childGroupNode = eclipseState->getSchedule()->getGroup((*iter).second->name());
|
||||
collection.addGroup(childGroupNode, g1Group.name(), 2, pu);
|
||||
}
|
||||
|
||||
|
||||
const auto* g2Group = eclipseState->getSchedule()->getGroup(g2->name());
|
||||
const auto& g2Group = eclipseState->getSchedule()->getGroup(g2->name());
|
||||
for (auto iter = g2->begin(); iter != g2->end(); ++iter) {
|
||||
const auto* childGroupNode = eclipseState->getSchedule()->getGroup((*iter).second->name());
|
||||
collection.addGroup(childGroupNode, g2Group->name(), 2, pu);
|
||||
auto childGroupNode = eclipseState->getSchedule()->getGroup((*iter).second->name());
|
||||
collection.addGroup(childGroupNode, g2Group.name(), 2, pu);
|
||||
}
|
||||
|
||||
BOOST_CHECK_EQUAL("FIELD", collection.findNode("FIELD")->name());
|
||||
|
||||
Reference in New Issue
Block a user