From 7332ee4b18abdd21f8b863d65ad4e40f461935d4 Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Sat, 23 Jun 2018 14:09:35 +0200 Subject: [PATCH] Remove intializer list ctx + stale test --- .../EclipseState/Schedule/WellConnections.hpp | 3 +- tests/parser/WellTests.cpp | 65 ------------------- 2 files changed, 1 insertion(+), 67 deletions(-) diff --git a/opm/parser/eclipse/EclipseState/Schedule/WellConnections.hpp b/opm/parser/eclipse/EclipseState/Schedule/WellConnections.hpp index 3285baa76..aa80c935c 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/WellConnections.hpp +++ b/opm/parser/eclipse/EclipseState/Schedule/WellConnections.hpp @@ -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); }; } diff --git a/tests/parser/WellTests.cpp b/tests/parser/WellTests.cpp index 4adf5b108..6cc94e383 100644 --- a/tests/parser/WellTests.cpp +++ b/tests/parser/WellTests.cpp @@ -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);