removing the use of cast between base class and derived class

between WellsGroupInterface and WellsGroup, WellNode.
This commit is contained in:
Kai Bao
2016-10-10 15:30:15 +02:00
parent 631ea6cf82
commit 9bfe9d561a
3 changed files with 85 additions and 22 deletions

View File

@@ -271,8 +271,7 @@ namespace Opm
// find a node needs to update targets, then update targets for all the wellls inside the group.
// if (leaf_nodes_[i]->shouldUpdateWellTargets() && !leaf_nodes_[i]->individualControl()) {
if (!leaf_nodes_[i]->individualControl()) {
// TODO: will remove dynamic_cast with interface revision.
WellsGroup* parent_node = dynamic_cast<Opm::WellsGroup *>(leaf_nodes_[i]->getParent());
WellsGroupInterface* parent_node = leaf_nodes_[i]->getParent();
// update the target within this group.
if (leaf_nodes_[i]->isProducer()) {
parent_node->updateWellProductionTargets(well_rates);