From 4b86e31cd543dc454aaa79a9bc831e87c45582de Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Mon, 9 Jan 2023 12:48:45 +0100 Subject: [PATCH] Schedule: move more code to compile unit we can now forward Opm::Python --- opm/input/eclipse/Schedule/Schedule.hpp | 24 +++------------------ src/opm/input/eclipse/Schedule/Schedule.cpp | 24 +++++++++++++++++++++ tests/parser/MultisegmentWellTests.cpp | 2 ++ tests/test_InteHEAD.cpp | 1 + 4 files changed, 30 insertions(+), 21 deletions(-) diff --git a/opm/input/eclipse/Schedule/Schedule.hpp b/opm/input/eclipse/Schedule/Schedule.hpp index 91e8a6696..e2534b7a2 100644 --- a/opm/input/eclipse/Schedule/Schedule.hpp +++ b/opm/input/eclipse/Schedule/Schedule.hpp @@ -32,7 +32,6 @@ #include #include -#include #include #include #include @@ -60,6 +59,7 @@ namespace Opm class FieldPropsManager; class GTNode; class ParseContext; + class Python; class SCHEDULESection; class SummaryState; class ErrorGuard; @@ -111,27 +111,9 @@ namespace Opm } - static ScheduleStatic serializationTestObject() { - auto python = std::make_shared(Python::Enable::OFF); - ScheduleStatic st(python); - st.m_deck_message_limits = MessageLimits::serializationTestObject(); - st.m_runspec = Runspec::serializationTestObject(); - st.m_unit_system = UnitSystem::newFIELD(); - st.m_input_path = "Some/funny/path"; - st.rst_config = RSTConfig::serializationTestObject(); - st.rst_info = ScheduleRestartInfo::serializationTestObject(); - return st; - } + static ScheduleStatic serializationTestObject(); - bool operator==(const ScheduleStatic& other) const { - return this->m_input_path == other.m_input_path && - this->m_deck_message_limits == other.m_deck_message_limits && - this->m_unit_system == other.m_unit_system && - this->rst_config == other.rst_config && - this->rst_info == other.rst_info && - this->gaslift_opt_active == other.gaslift_opt_active && - this->m_runspec == other.m_runspec; - } + bool operator==(const ScheduleStatic& other) const; }; diff --git a/src/opm/input/eclipse/Schedule/Schedule.cpp b/src/opm/input/eclipse/Schedule/Schedule.cpp index 04c7e4a6e..6d10a294e 100644 --- a/src/opm/input/eclipse/Schedule/Schedule.cpp +++ b/src/opm/input/eclipse/Schedule/Schedule.cpp @@ -157,6 +157,30 @@ namespace Opm { { } + ScheduleStatic ScheduleStatic::serializationTestObject() + { + auto python = std::make_shared(Python::Enable::OFF); + ScheduleStatic st(python); + st.m_deck_message_limits = MessageLimits::serializationTestObject(); + st.m_runspec = Runspec::serializationTestObject(); + st.m_unit_system = UnitSystem::newFIELD(); + st.m_input_path = "Some/funny/path"; + st.rst_config = RSTConfig::serializationTestObject(); + st.rst_info = ScheduleRestartInfo::serializationTestObject(); + return st; + } + + bool ScheduleStatic::operator==(const ScheduleStatic& other) const + { + return this->m_input_path == other.m_input_path && + this->m_deck_message_limits == other.m_deck_message_limits && + this->m_unit_system == other.m_unit_system && + this->rst_config == other.rst_config && + this->rst_info == other.rst_info && + this->gaslift_opt_active == other.gaslift_opt_active && + this->m_runspec == other.m_runspec; + } + Schedule::Schedule( const Deck& deck, const EclipseGrid& ecl_grid, const FieldPropsManager& fp, diff --git a/tests/parser/MultisegmentWellTests.cpp b/tests/parser/MultisegmentWellTests.cpp index ac78a6689..d251addf5 100644 --- a/tests/parser/MultisegmentWellTests.cpp +++ b/tests/parser/MultisegmentWellTests.cpp @@ -40,6 +40,8 @@ #include #include +#include + #include #include #include diff --git a/tests/test_InteHEAD.cpp b/tests/test_InteHEAD.cpp index 217d62aa8..94d7ae12b 100644 --- a/tests/test_InteHEAD.cpp +++ b/tests/test_InteHEAD.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include