Removed the previously introduced getAndUnRootChild method
This commit is contained in:
parent
9b6430f907
commit
a5144288a3
@ -90,7 +90,20 @@ namespace Opm
|
||||
parent = roots_[roots_.size() - 1].get();
|
||||
}
|
||||
|
||||
std::shared_ptr<WellsGroupInterface> child = getAndUnRootChild(child_name);
|
||||
std::shared_ptr<WellsGroupInterface> child;
|
||||
|
||||
for (size_t i = 0; i < roots_.size(); ++i) {
|
||||
if (roots_[i]->name() == child_name) {
|
||||
child = roots_[i];
|
||||
// We've found a new parent to the previously thought root, need to remove it
|
||||
for(size_t j = i; j < roots_.size() - 1; ++j) {
|
||||
roots_[j] = roots_[j+1];
|
||||
}
|
||||
|
||||
roots_.resize(roots_.size()-1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!child.get()) {
|
||||
child = createWellsGroup(child_name, deck);
|
||||
@ -110,24 +123,6 @@ namespace Opm
|
||||
}
|
||||
|
||||
|
||||
std::shared_ptr<WellsGroupInterface> WellCollection::getAndUnRootChild(std::string child_name) {
|
||||
std::shared_ptr<WellsGroupInterface> child;
|
||||
|
||||
for (size_t i = 0; i < roots_.size(); ++i) {
|
||||
if (roots_[i]->name() == child_name) {
|
||||
child = roots_[i];
|
||||
// We've found a new parent to the previously thought root, need to remove it
|
||||
for(size_t j = i; j < roots_.size() - 1; ++j) {
|
||||
roots_[j] = roots_[j+1];
|
||||
}
|
||||
|
||||
roots_.resize(roots_.size()-1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return child;
|
||||
}
|
||||
|
||||
const std::vector<WellNode*>& WellCollection::getLeafNodes() const {
|
||||
return leaf_nodes_;
|
||||
}
|
||||
|
@ -125,7 +125,6 @@ namespace Opm
|
||||
const std::vector<double>& well_surfacerates_phase);
|
||||
|
||||
private:
|
||||
std::shared_ptr<WellsGroupInterface> getAndUnRootChild(std::string child_name);
|
||||
// To account for the possibility of a forest
|
||||
std::vector<std::shared_ptr<WellsGroupInterface> > roots_;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user