adding function findWellNode() to WellCollection

to return the WellNode* instead of WellGroupInterface*
This commit is contained in:
Kai Bao 2016-11-03 13:12:12 +01:00
parent 62dbf74bc9
commit 73b511f90a
2 changed files with 19 additions and 0 deletions

View File

@ -116,6 +116,21 @@ namespace Opm
return NULL;
}
WellNode* WellCollection::findWellNode(const std::string& name) const
{
auto well_node = std::find_if(leaf_nodes_.begin(), leaf_nodes_.end(),
[&] ( WellNode* w) {
return w->name() == name;
});
if (well_node != leaf_nodes_.end()) {
return *well_node;
} else {
return nullptr;
}
}
/// Adds the child to the collection
/// and appends it to parent's children.
/// \param[in] child the child node

View File

@ -95,6 +95,10 @@ namespace Opm
/// \return the pointer to the group if found, NULL otherwise
const WellsGroupInterface* findNode(const std::string& name) const;
WellNode* findWellNode(const std::string& name) const;
/// Applies all group controls (injection and production)
void applyGroupControls();