make Connection constructible from variables

also make default constructible
This commit is contained in:
Arne Morten Kvarving
2019-12-10 09:23:27 +01:00
parent e6f2bd0eac
commit e4361cd1e0
2 changed files with 53 additions and 0 deletions

View File

@@ -72,6 +72,8 @@ namespace Opm {
Defaulted,
};
Connection();
Connection(int i, int j , int k ,
int complnum,
double depth,
@@ -89,6 +91,25 @@ namespace Opm {
const double segDistEnd,
const bool defaultSatTabId);
Connection(Direction dir,
double depth,
State state,
int satTableId,
int complnum,
double CF,
double Kh,
double rw,
double r0,
double skinFactor,
const std::array<int,3>& IJK,
std::size_t seqIndex,
double segDistStart,
double segDistEnd,
bool defaultSatTabId,
std::size_t compSegSeqIndex,
int segment,
double wellPi);
bool attachedToSegment() const;
bool sameCoordinate(const int i, const int j, const int k) const;

View File

@@ -72,6 +72,38 @@ namespace Opm {
m_defaultSatTabId(defaultSatTabId)
{}
Connection::Connection(Direction dir, double depth, State state,
int satTableId, int complnum, double CF,
double Kh, double rw, double r0, double skinFactor,
const std::array<int,3>& IJK, std::size_t seqIndex,
double segDistStart, double segDistEnd,
bool defaultSatTabId, std::size_t compSegSeqIndex,
int segment, double wellPi)
: direction(dir)
, center_depth(depth)
, open_state(state)
, sat_tableId(satTableId)
, m_complnum(complnum)
, m_CF(CF)
, m_Kh(Kh)
, m_rw(rw)
, m_r0(r0)
, m_skin_factor(skinFactor)
, ijk(IJK)
, m_seqIndex(seqIndex)
, m_segDistStart(segDistStart)
, m_segDistEnd(segDistEnd)
, m_defaultSatTabId(defaultSatTabId)
, m_compSeg_seqIndex(compSegSeqIndex)
, segment_number(segment)
, wPi(wellPi)
{}
Connection::Connection()
: Connection(Direction::X, 1.0, State::SHUT,
0, 0, 0.0, 0.0, 0.0, 0.0, 0.0,
{0,0,0}, 0, 0.0, 0.0, false, 0, 0, 0.0)
{}
bool Connection::sameCoordinate(const int i, const int j, const int k) const {
if ((ijk[0] == i) && (ijk[1] == j) && (ijk[2] == k)) {