Code to connect segment <-> connection in *one* function call
This commit is contained in:
parent
349fb1f4f5
commit
1c07a8f251
@ -134,16 +134,18 @@ namespace Opm {
|
||||
void setState(State state);
|
||||
void setComplnum(int compnum);
|
||||
void scaleWellPi(double wellPi);
|
||||
void updateSegment(int segment_number, double center_depth, std::size_t seqIndex);
|
||||
void updateSegment(int segment_number_arg,
|
||||
double center_depth_arg,
|
||||
std::size_t seqIndex,
|
||||
std::size_t compseg_insert_index,
|
||||
double start,
|
||||
double end);
|
||||
const std::size_t& getSeqIndex() const;
|
||||
const bool& getDefaultSatTabId() const;
|
||||
const std::size_t& getCompSegSeqIndex() const;
|
||||
void setCompSegSeqIndex(std::size_t index);
|
||||
void setDefaultSatTabId(bool id);
|
||||
const double& getSegDistStart() const;
|
||||
const double& getSegDistEnd() const;
|
||||
void setSegDistStart(const double& distStart);
|
||||
void setSegDistEnd(const double& distEnd);
|
||||
std::string str() const;
|
||||
bool ctfAssignedFromInput() const
|
||||
{
|
||||
|
@ -272,12 +272,12 @@ namespace Opm {
|
||||
const int k = compseg.m_k;
|
||||
if (grid.cellActive(i, j, k)) {
|
||||
Connection& connection = connection_set.getFromIJK(i, j, k);
|
||||
connection.updateSegment(compseg.segment_number, compseg.center_depth, compseg.m_seqIndex);
|
||||
|
||||
// keep connection sequence number from input sequence
|
||||
connection.setCompSegSeqIndex(compseg.m_seqIndex);
|
||||
connection.setSegDistStart(compseg.m_distance_start);
|
||||
connection.setSegDistEnd(compseg.m_distance_end);
|
||||
connection.updateSegment(compseg.segment_number,
|
||||
compseg.center_depth,
|
||||
compseg.m_seqIndex,
|
||||
compseg.m_seqIndex,
|
||||
compseg.m_distance_start,
|
||||
compseg.m_distance_end);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Util/Value.hpp>
|
||||
|
||||
|
||||
namespace Opm {
|
||||
|
||||
|
||||
@ -155,22 +156,10 @@ namespace Opm {
|
||||
}
|
||||
|
||||
|
||||
void Connection::setCompSegSeqIndex(std::size_t index) {
|
||||
m_compSeg_seqIndex = index;
|
||||
}
|
||||
|
||||
void Connection::setDefaultSatTabId(bool id) {
|
||||
m_defaultSatTabId = id;
|
||||
}
|
||||
|
||||
void Connection::setSegDistStart(const double& distStart) {
|
||||
m_segDistStart = distStart;
|
||||
}
|
||||
|
||||
void Connection::setSegDistEnd(const double& distEnd) {
|
||||
m_segDistEnd = distEnd;
|
||||
}
|
||||
|
||||
double Connection::depth() const {
|
||||
return this->center_depth;
|
||||
}
|
||||
@ -215,10 +204,18 @@ namespace Opm {
|
||||
this->open_state = state;
|
||||
}
|
||||
|
||||
void Connection::updateSegment(int segment_number_arg, double center_depth_arg, std::size_t seqIndex) {
|
||||
void Connection::updateSegment(int segment_number_arg,
|
||||
double center_depth_arg,
|
||||
std::size_t seqIndex,
|
||||
std::size_t compseg_insert_index,
|
||||
double start,
|
||||
double end) {
|
||||
this->segment_number = segment_number_arg;
|
||||
this->center_depth = center_depth_arg;
|
||||
this->m_seqIndex = seqIndex;
|
||||
this->m_compSeg_seqIndex = compseg_insert_index;
|
||||
this->m_segDistStart = start;
|
||||
this->m_segDistEnd = end;
|
||||
}
|
||||
|
||||
int Connection::segment() const {
|
||||
|
@ -369,8 +369,12 @@ inline std::array< size_t, 3> directionIndices(const Opm::Connection::Direction
|
||||
satTableId,
|
||||
direction, ctf_kind,
|
||||
noConn, conSDStart, conSDEnd, defaultSatTable);
|
||||
prev->setCompSegSeqIndex(css_ind);
|
||||
prev->updateSegment(conSegNo, conCDepth, con_SIndex);
|
||||
prev->updateSegment(conSegNo,
|
||||
conCDepth,
|
||||
con_SIndex,
|
||||
css_ind,
|
||||
conSDStart,
|
||||
conSDEnd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user