mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
adding function findWellNode() to WellCollection
to return the WellNode* instead of WellGroupInterface*
This commit is contained in:
parent
62dbf74bc9
commit
73b511f90a
@ -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
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user