WellConnections: Initialise Head in Copy Constructor

This commit ensures that the data members 'headI' and 'headJ' are
properly initialised in the constructor

    WellConnections(const WellConnections&, const EclipseGrid&)

which powers the implementation of

    Well::getActiveConnections()
This commit is contained in:
Bård Skaflestad
2018-10-02 13:16:20 +02:00
parent 3655213c40
commit 58a5a4e371
2 changed files with 6 additions and 2 deletions

View File

@@ -94,9 +94,10 @@ namespace Opm {
const double segDistEnd= 0.0,
const bool defaultSatTabId = true);
std::vector< Connection > m_connections;
size_t findClosestConnection(int oi, int oj, double oz, size_t start_pos);
int headI, headJ;
std::vector< Connection > m_connections;
};
}

View File

@@ -123,7 +123,10 @@ namespace {
WellConnections::WellConnections(const WellConnections& src, const EclipseGrid& grid) {
WellConnections::WellConnections(const WellConnections& src, const EclipseGrid& grid) :
headI(src.headI),
headJ(src.headJ)
{
for (const auto& c : src) {
if (grid.cellActive(c.getI(), c.getJ(), c.getK()))
this->add(c);