mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Some comments
This commit is contained in:
parent
abdae7073e
commit
b959de1ba0
@ -63,7 +63,13 @@ namespace Opm
|
||||
}
|
||||
parent_as_group->addChild(child);
|
||||
|
||||
if(child->isLeafNode()) {
|
||||
leaf_nodes_.push_back(child);
|
||||
}
|
||||
}
|
||||
|
||||
const std::vector<std::tr1::shared_ptr<WellsGroupInterface> >& WellCollection::getLeafNodes() const {
|
||||
return leaf_nodes_;
|
||||
}
|
||||
|
||||
WellsGroupInterface* WellCollection::findNode(std::string name)
|
||||
|
@ -38,9 +38,14 @@ namespace Opm
|
||||
void addChild(std::string child, std::string parent,
|
||||
const EclipseGridParser& deck);
|
||||
|
||||
const std::vector<std::tr1::shared_ptr<WellsGroupInterface> >& getLeafNodes() const;
|
||||
private:
|
||||
// To account for the possibility of a forest
|
||||
std::vector<std::tr1::shared_ptr<WellsGroupInterface> > roots_;
|
||||
|
||||
// This will be used to traverse the bottom nodes.
|
||||
std::vector<std::tr1::shared_ptr<WellsGroupInterface> > leaf_nodes_;
|
||||
|
||||
WellsGroupInterface* findNode(std::string name);
|
||||
};
|
||||
|
||||
|
@ -32,6 +32,10 @@ namespace Opm
|
||||
{
|
||||
}
|
||||
|
||||
bool WellsGroupInterface::isLeafNode() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
WellsGroupInterface* WellsGroup::findGroup(std::string name_of_node)
|
||||
{
|
||||
if (name() == name_of_node) {
|
||||
@ -69,6 +73,10 @@ namespace Opm
|
||||
|
||||
}
|
||||
|
||||
bool WellNode::isLeafNode() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
surface_component toSurfaceComponent(std::string type)
|
||||
{
|
||||
if (type == "OIL") {
|
||||
|
@ -17,10 +17,18 @@ namespace Opm
|
||||
InjectionSpecification inj_spec);
|
||||
virtual ~WellsGroupInterface();
|
||||
|
||||
/// The unique identifier for the well or well group.
|
||||
const std::string& name();
|
||||
|
||||
/// Production specifications for the well or well group.
|
||||
const ProductionSpecification& prodSpec() const;
|
||||
|
||||
/// Injection specifications for the well or well group.
|
||||
const InjectionSpecification& injSpec() const;
|
||||
|
||||
/// \returns true if the object is a leaf node (WellNode), false otherwise.
|
||||
virtual bool isLeafNode() const;
|
||||
|
||||
/// \returns the pointer to the WellsGroupInterface with the given name. NULL if
|
||||
/// the name is not found.a
|
||||
virtual WellsGroupInterface* findGroup(std::string name_of_node) = 0;
|
||||
@ -52,6 +60,8 @@ namespace Opm
|
||||
|
||||
virtual WellsGroupInterface* findGroup(std::string name_of_node);
|
||||
|
||||
virtual bool isLeafNode() const;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@ -505,14 +505,14 @@ namespace Opm
|
||||
}
|
||||
}
|
||||
|
||||
WellCollection well_collection;
|
||||
WellCollection wells_;
|
||||
if (deck.hasField("GRUPTREE")) {
|
||||
std::cout << "Found gruptree" << std::endl;
|
||||
const GRUPTREE& gruptree = deck.getGRUPTREE();
|
||||
|
||||
std::map<std::string, std::string>::const_iterator it = gruptree.tree.begin();
|
||||
for( ; it != gruptree.tree.end(); ++it) {
|
||||
well_collection.addChild(it->first, it->second, deck);
|
||||
wells_.addChild(it->first, it->second, deck);
|
||||
}
|
||||
}
|
||||
|
||||
@ -520,7 +520,7 @@ namespace Opm
|
||||
WELSPECS welspecs = deck.getWELSPECS();
|
||||
for(int i = 0; i < welspecs.welspecs.size(); ++i) {
|
||||
WelspecsLine line = welspecs.welspecs[i];
|
||||
well_collection.addChild(line.name_, line.group_, deck);
|
||||
wells_.addChild(line.name_, line.group_, deck);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
#ifndef OPM_WELLSMANAGER_HEADER_INCLUDED
|
||||
#define OPM_WELLSMANAGER_HEADER_INCLUDED
|
||||
|
||||
#include <opm/core/WellCollection.hpp>
|
||||
struct Wells;
|
||||
struct UnstructuredGrid;
|
||||
|
||||
@ -62,6 +62,8 @@ namespace Opm
|
||||
// The managed Wells.
|
||||
Wells* w_;
|
||||
|
||||
WellCollection well_collection_;
|
||||
|
||||
};
|
||||
|
||||
} // namespace Opm
|
||||
|
Loading…
Reference in New Issue
Block a user