Remove intializer list ctx + stale test
This commit is contained in:
@@ -30,7 +30,6 @@ namespace Opm {
|
||||
public:
|
||||
WellConnections() = default;
|
||||
// cppcheck-suppress noExplicitConstructor
|
||||
WellConnections( std::initializer_list< Connection > );
|
||||
WellConnections(const WellConnections& src, const EclipseGrid& grid);
|
||||
|
||||
using const_iterator = std::vector< Connection >::const_iterator;
|
||||
@@ -39,6 +38,7 @@ namespace Opm {
|
||||
size_t size() const;
|
||||
const Connection& get(size_t index) const;
|
||||
const Connection& getFromIJK(const int i, const int j, const int k) const;
|
||||
Connection& getFromIJK(const int i, const int j, const int k);
|
||||
|
||||
const_iterator begin() const { return this->m_connections.begin(); }
|
||||
const_iterator end() const { return this->m_connections.end(); }
|
||||
@@ -64,7 +64,6 @@ namespace Opm {
|
||||
private:
|
||||
std::vector< Connection > m_connections;
|
||||
size_t findClosestConnection(int oi, int oj, double oz, size_t start_pos);
|
||||
Connection& getFromIJK(const int i, const int j, const int k);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -386,71 +386,6 @@ inline Opm::Connection connection( int i, int j, int k, int complnum = 1 ) {
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(CompletionOrder) {
|
||||
auto timeMap = createXDaysTimeMap(10);
|
||||
{
|
||||
// Vertical well.
|
||||
Opm::Well well("WELL1" , 5, 5, 0.0, Opm::Phase::OIL, timeMap , 0);
|
||||
auto c1 = connection(5, 5, 8);
|
||||
auto c2 = connection(5, 5, 9);
|
||||
auto c3 = connection(5, 5, 1);
|
||||
auto c4 = connection(5, 5, 0);
|
||||
Opm::WellConnections cv1 = { c1, c2 };
|
||||
well.addWellConnections(1, cv1);
|
||||
BOOST_CHECK_EQUAL(well.getConnections(1).get(0), c1);
|
||||
Opm::WellConnections cv2 = { c3, c4 };
|
||||
well.addWellConnections(2, cv2);
|
||||
BOOST_CHECK_EQUAL(well.getConnections(1).get(0), c1);
|
||||
BOOST_CHECK_EQUAL(well.getConnections(2).get(0), c4);
|
||||
}
|
||||
|
||||
{
|
||||
// Horizontal well.
|
||||
Opm::Well well("WELL1" , 5, 5, 0.0, Opm::Phase::OIL, timeMap , 0);
|
||||
auto c1 = connection(6, 5, 8, 1);
|
||||
auto c2 = connection(5, 6, 7, 2);
|
||||
auto c3 = connection(7, 5, 8, 1);
|
||||
auto c4 = connection(9, 5, 8, 2);
|
||||
auto c5 = connection(8, 5, 9, 3);
|
||||
auto c6 = connection(5, 5, 4, 1);
|
||||
|
||||
std::vector< Opm::Connection > cv1 = { c1, c2 };
|
||||
well.addConnections(1, cv1);
|
||||
BOOST_CHECK_EQUAL(well.getConnections(1).get(0), c2);
|
||||
|
||||
/*
|
||||
* adding completions in batches like this will under the hood modify
|
||||
* completion numbers to match expectations, so we ensure that we're
|
||||
* comparing to the right value by forcing the right-hand-side of the
|
||||
* comparison to use the expected completion number
|
||||
*/
|
||||
std::vector< Opm::Connection > cv2 = { c3, c4, c5 };
|
||||
well.addConnections(2, cv2);
|
||||
BOOST_CHECK_EQUAL(well.getConnections(1).get(0), Connection( c2, 2 ) );
|
||||
BOOST_CHECK_EQUAL(well.getConnections(2).get(0), Connection( c2, 2 ) );
|
||||
BOOST_CHECK_EQUAL(well.getConnections(2).get(1), Connection( c1, 1 ) );
|
||||
BOOST_CHECK_EQUAL(well.getConnections(2).get(2), Connection( c3, 3 ) );
|
||||
BOOST_CHECK_EQUAL(well.getConnections(2).get(3), Connection( c5, 5 ) );
|
||||
BOOST_CHECK_EQUAL(well.getConnections(2).get(4), Connection( c4, 4 ) );
|
||||
std::vector< Opm::Connection > cv3 = { c6 };
|
||||
|
||||
well.addConnections(3, cv3);
|
||||
BOOST_CHECK_EQUAL(well.getConnections(1).get(0), Connection( c2, 2 ) );
|
||||
BOOST_CHECK_EQUAL(well.getConnections(2).get(0), Connection( c2, 2 ) );
|
||||
BOOST_CHECK_EQUAL(well.getConnections(2).get(1), Connection( c1, 1 ) );
|
||||
BOOST_CHECK_EQUAL(well.getConnections(2).get(2), Connection( c3, 3 ) );
|
||||
BOOST_CHECK_EQUAL(well.getConnections(2).get(3), Connection( c5, 5 ) );
|
||||
BOOST_CHECK_EQUAL(well.getConnections(2).get(4), Connection( c4, 4 ) );
|
||||
BOOST_CHECK_EQUAL(well.getConnections(3).get(0), Connection( c6, 6 ) );
|
||||
BOOST_CHECK_EQUAL(well.getConnections(3).get(1), Connection( c2, 2 ) );
|
||||
BOOST_CHECK_EQUAL(well.getConnections(3).get(2), Connection( c1, 1 ) );
|
||||
BOOST_CHECK_EQUAL(well.getConnections(3).get(3), Connection( c3, 3 ) );
|
||||
BOOST_CHECK_EQUAL(well.getConnections(3).get(4), Connection( c5, 5 ) );
|
||||
BOOST_CHECK_EQUAL(well.getConnections(3).get(5), Connection( c4, 4 ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(setGasRate_RateSetCorrect) {
|
||||
auto timeMap = createXDaysTimeMap(10);
|
||||
|
||||
Reference in New Issue
Block a user