make WellConnections constructible from variables
also make it default constructible and add accessors
This commit is contained in:
@@ -33,7 +33,12 @@ namespace Opm {
|
||||
public:
|
||||
|
||||
|
||||
WellConnections();
|
||||
WellConnections(int headI, int headJ);
|
||||
WellConnections(int headI, int headJ,
|
||||
size_t numRemoved,
|
||||
const std::vector<Connection>& connections);
|
||||
|
||||
// cppcheck-suppress noExplicitConstructor
|
||||
WellConnections(const WellConnections& src, const EclipseGrid& grid);
|
||||
void addConnection(int i, int j , int k ,
|
||||
@@ -85,6 +90,11 @@ namespace Opm {
|
||||
bool operator==( const WellConnections& ) const;
|
||||
bool operator!=( const WellConnections& ) const;
|
||||
|
||||
int getHeadI() const;
|
||||
int getHeadJ() const;
|
||||
size_t getNumRemoved() const;
|
||||
const std::vector<Connection>& getConnections() const;
|
||||
|
||||
private:
|
||||
void addConnection(int i, int j , int k ,
|
||||
int complnum,
|
||||
|
||||
@@ -115,6 +115,11 @@ inline std::array< size_t, 3> directionIndices(const Opm::Connection::Direction
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
WellConnections::WellConnections() :
|
||||
headI(0), headJ(0), num_removed(0)
|
||||
{
|
||||
}
|
||||
|
||||
WellConnections::WellConnections(int headIArg, int headJArg) :
|
||||
headI(headIArg),
|
||||
headJ(headJArg)
|
||||
@@ -122,6 +127,17 @@ inline std::array< size_t, 3> directionIndices(const Opm::Connection::Direction
|
||||
}
|
||||
|
||||
|
||||
WellConnections::WellConnections(int headIArg, int headJArg,
|
||||
size_t numRemoved,
|
||||
const std::vector<Connection>& connections) :
|
||||
headI(headIArg),
|
||||
headJ(headJArg),
|
||||
num_removed(numRemoved),
|
||||
m_connections(connections)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
WellConnections::WellConnections(const WellConnections& src, const EclipseGrid& grid) :
|
||||
headI(src.headI),
|
||||
@@ -505,4 +521,24 @@ inline std::array< size_t, 3> directionIndices(const Opm::Connection::Direction
|
||||
this->num_removed += std::distance(new_end, m_connections.end());
|
||||
m_connections.erase(new_end, m_connections.end());
|
||||
}
|
||||
|
||||
|
||||
int WellConnections::getHeadI() const {
|
||||
return headI;
|
||||
}
|
||||
|
||||
|
||||
int WellConnections::getHeadJ() const {
|
||||
return headJ;
|
||||
}
|
||||
|
||||
|
||||
size_t WellConnections::getNumRemoved() const {
|
||||
return num_removed;
|
||||
}
|
||||
|
||||
|
||||
const std::vector<Connection>& WellConnections::getConnections() const {
|
||||
return m_connections;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user