From 180ff7336a63bafdd4135d908fcd7b9dcd328c3a Mon Sep 17 00:00:00 2001 From: Liu Ming Date: Fri, 22 Apr 2016 16:30:07 +0800 Subject: [PATCH 1/7] remove unused OpmLog headers. --- opm/parser/eclipse/Parser/ParseContext.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/opm/parser/eclipse/Parser/ParseContext.cpp b/opm/parser/eclipse/Parser/ParseContext.cpp index fd93f1c28..140f96b78 100644 --- a/opm/parser/eclipse/Parser/ParseContext.cpp +++ b/opm/parser/eclipse/Parser/ParseContext.cpp @@ -22,8 +22,6 @@ #include -#include -#include #include #include From 52af33c7e004a922f223199bfec5d3038ccaba3b Mon Sep 17 00:00:00 2001 From: Liu Ming Date: Fri, 22 Apr 2016 16:51:04 +0800 Subject: [PATCH 2/7] remove const constrain for Deck. --- opm/parser/eclipse/Deck/Section.hpp | 2 +- opm/parser/eclipse/EclipseState/checkDeck.cpp | 2 +- opm/parser/eclipse/EclipseState/checkDeck.hpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/opm/parser/eclipse/Deck/Section.hpp b/opm/parser/eclipse/Deck/Section.hpp index a21f4b5ea..0e85143b9 100644 --- a/opm/parser/eclipse/Deck/Section.hpp +++ b/opm/parser/eclipse/Deck/Section.hpp @@ -47,7 +47,7 @@ class Section : public DeckView { // returns whether the deck has all mandatory sections and if all sections are in // the right order - static bool checkSectionTopology(const Deck& deck, + static bool checkSectionTopology(Deck& deck, const Parser&, bool ensureKeywordSectionAffiliation = false); diff --git a/opm/parser/eclipse/EclipseState/checkDeck.cpp b/opm/parser/eclipse/EclipseState/checkDeck.cpp index 94e8d9286..a58db883d 100644 --- a/opm/parser/eclipse/EclipseState/checkDeck.cpp +++ b/opm/parser/eclipse/EclipseState/checkDeck.cpp @@ -26,7 +26,7 @@ #include namespace Opm { -bool checkDeck(DeckConstPtr deck, ParserConstPtr parser, size_t enabledChecks) { +bool checkDeck(DeckPtr deck, ParserConstPtr parser, size_t enabledChecks) { bool deckValid = true; // make sure that the deck does not contain unknown keywords diff --git a/opm/parser/eclipse/EclipseState/checkDeck.hpp b/opm/parser/eclipse/EclipseState/checkDeck.hpp index 1858f3e01..d1ca03bc4 100644 --- a/opm/parser/eclipse/EclipseState/checkDeck.hpp +++ b/opm/parser/eclipse/EclipseState/checkDeck.hpp @@ -40,7 +40,7 @@ enum DeckChecks { // some semantical correctness checks of the deck. this method adds a warning to // the deck object if any issue is found ... -bool checkDeck(std::shared_ptr< const Deck > deck, std::shared_ptr< const Parser >, size_t enabledChecks = AllChecks); +bool checkDeck(std::shared_ptr< Deck > deck, std::shared_ptr< const Parser >, size_t enabledChecks = AllChecks); } From a4640b55bc4a418605044395443435629f189e82 Mon Sep 17 00:00:00 2001 From: Liu Ming Date: Fri, 22 Apr 2016 16:51:35 +0800 Subject: [PATCH 3/7] use MessageContainer instead of OpmLog. --- opm/parser/eclipse/Parser/Parser.cpp | 32 ++++++++++++---------------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/opm/parser/eclipse/Parser/Parser.cpp b/opm/parser/eclipse/Parser/Parser.cpp index aea8268f6..9b07ab123 100644 --- a/opm/parser/eclipse/Parser/Parser.cpp +++ b/opm/parser/eclipse/Parser/Parser.cpp @@ -26,9 +26,6 @@ #include -#include -#include - #include #include #include @@ -394,7 +391,7 @@ bool Parser::parseState(std::shared_ptr parserState) const { deckKeyword.setLocation(parserState->rawKeyword->getFilename(), parserState->rawKeyword->getLineNR()); parserState->deck->addKeyword( std::move( deckKeyword ) ); - OpmLog::addMessage(Log::MessageType::Warning , Log::fileMessage(parserState->dataFile.string() , parserState->lineNR , msg)); + parserState->deck->getMessageContainer().warning(parserState->dataFile.string(), msg, parserState->lineNR); } } parserState->rawKeyword.reset(); @@ -601,13 +598,13 @@ bool Parser::parseState(std::shared_ptr parserState) const { return false; } - bool Section::checkSectionTopology(const Deck& deck, + bool Section::checkSectionTopology(Deck& deck, const Parser& parser, bool ensureKeywordSectionAffiliation) { if( deck.size() == 0 ) { std::string msg = "empty decks are invalid\n"; - OpmLog::addMessage( Log::MessageType::Warning, msg ); + deck.getMessageContainer().warning(msg); return false; } @@ -616,7 +613,7 @@ bool Parser::parseState(std::shared_ptr parserState) const { if( deck.getKeyword(0).name() != "RUNSPEC" ) { std::string msg = "The first keyword of a valid deck must be RUNSPEC\n"; auto curKeyword = deck.getKeyword(0); - OpmLog::addMessage(Log::MessageType::Warning, Log::fileMessage(curKeyword.getFileName(), curKeyword.getLineNumber(), msg)); + deck.getMessageContainer().warning(curKeyword.getFileName(), msg, curKeyword.getLineNumber()); deckValid = false; } @@ -636,8 +633,7 @@ bool Parser::parseState(std::shared_ptr parserState) const { std::string msg = "The keyword '"+curKeywordName+"' is located in the '"+curSectionName +"' section where it is invalid"; - - OpmLog::addMessage(Log::MessageType::Warning, Log::fileMessage(curKeyword.getFileName(), curKeyword.getLineNumber(), msg)); + deck.getMessageContainer().warning(curKeyword.getFileName(), msg, curKeyword.getLineNumber()); deckValid = false; } @@ -648,7 +644,7 @@ bool Parser::parseState(std::shared_ptr parserState) const { if (curKeywordName != "GRID") { std::string msg = "The RUNSPEC section must be followed by GRID instead of "+curKeywordName; - OpmLog::addMessage(Log::MessageType::Warning, Log::fileMessage(curKeyword.getFileName(), curKeyword.getLineNumber(), msg)); + deck.getMessageContainer().warning(curKeyword.getFileName(), msg, curKeyword.getLineNumber()); deckValid = false; } @@ -658,7 +654,7 @@ bool Parser::parseState(std::shared_ptr parserState) const { if (curKeywordName != "EDIT" && curKeywordName != "PROPS") { std::string msg = "The GRID section must be followed by EDIT or PROPS instead of "+curKeywordName; - OpmLog::addMessage(Log::MessageType::Warning, Log::fileMessage(curKeyword.getFileName(), curKeyword.getLineNumber(), msg)); + deck.getMessageContainer().warning(curKeyword.getFileName(), msg, curKeyword.getLineNumber()); deckValid = false; } @@ -668,7 +664,7 @@ bool Parser::parseState(std::shared_ptr parserState) const { if (curKeywordName != "PROPS") { std::string msg = "The EDIT section must be followed by PROPS instead of "+curKeywordName; - OpmLog::addMessage(Log::MessageType::Warning, Log::fileMessage(curKeyword.getFileName(), curKeyword.getLineNumber(), msg)); + deck.getMessageContainer().warning(curKeyword.getFileName(), msg, curKeyword.getLineNumber()); deckValid = false; } @@ -678,7 +674,7 @@ bool Parser::parseState(std::shared_ptr parserState) const { if (curKeywordName != "REGIONS" && curKeywordName != "SOLUTION") { std::string msg = "The PROPS section must be followed by REGIONS or SOLUTION instead of "+curKeywordName; - OpmLog::addMessage(Log::MessageType::Warning, Log::fileMessage(curKeyword.getFileName(), curKeyword.getLineNumber(), msg)); + deck.getMessageContainer().warning(curKeyword.getFileName(), msg, curKeyword.getLineNumber()); deckValid = false; } @@ -688,7 +684,7 @@ bool Parser::parseState(std::shared_ptr parserState) const { if (curKeywordName != "SOLUTION") { std::string msg = "The REGIONS section must be followed by SOLUTION instead of "+curKeywordName; - OpmLog::addMessage(Log::MessageType::Warning, Log::fileMessage(curKeyword.getFileName(), curKeyword.getLineNumber(), msg)); + deck.getMessageContainer().warning(curKeyword.getFileName(), msg, curKeyword.getLineNumber()); deckValid = false; } @@ -698,7 +694,7 @@ bool Parser::parseState(std::shared_ptr parserState) const { if (curKeywordName != "SUMMARY" && curKeywordName != "SCHEDULE") { std::string msg = "The SOLUTION section must be followed by SUMMARY or SCHEDULE instead of "+curKeywordName; - OpmLog::addMessage(Log::MessageType::Warning, Log::fileMessage(curKeyword.getFileName(), curKeyword.getLineNumber(), msg)); + deck.getMessageContainer().warning(curKeyword.getFileName(), msg, curKeyword.getLineNumber()); deckValid = false; } @@ -708,7 +704,7 @@ bool Parser::parseState(std::shared_ptr parserState) const { if (curKeywordName != "SCHEDULE") { std::string msg = "The SUMMARY section must be followed by SCHEDULE instead of "+curKeywordName; - OpmLog::addMessage(Log::MessageType::Warning, Log::fileMessage(curKeyword.getFileName(), curKeyword.getLineNumber(), msg)); + deck.getMessageContainer().warning(curKeyword.getFileName(), msg, curKeyword.getLineNumber()); deckValid = false; } @@ -719,7 +715,7 @@ bool Parser::parseState(std::shared_ptr parserState) const { std::string msg = "The SCHEDULE section must be the last one (" +curKeywordName+" specified after SCHEDULE)"; - OpmLog::addMessage(Log::MessageType::Warning, Log::fileMessage(curKeyword.getFileName(), curKeyword.getLineNumber(), msg)); + deck.getMessageContainer().warning(curKeyword.getFileName(), msg, curKeyword.getLineNumber()); deckValid = false; } } @@ -729,7 +725,7 @@ bool Parser::parseState(std::shared_ptr parserState) const { const auto& curKeyword = deck.getKeyword(deck.size() - 1); std::string msg = "The last section of a valid deck must be SCHEDULE (is "+curSectionName+")"; - OpmLog::addMessage(Log::MessageType::Warning, Log::fileMessage(curKeyword.getFileName(), curKeyword.getLineNumber(), msg)); + deck.getMessageContainer().warning(curKeyword.getFileName(), msg, curKeyword.getLineNumber()); deckValid = false; } From 9ad0219603c72f52120649b0674d2cc8257735c1 Mon Sep 17 00:00:00 2001 From: Liu Ming Date: Fri, 22 Apr 2016 18:41:34 +0800 Subject: [PATCH 4/7] use MessageContainer to logging. --- opm/parser/eclipse/EclipseState/checkDeck.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/opm/parser/eclipse/EclipseState/checkDeck.cpp b/opm/parser/eclipse/EclipseState/checkDeck.cpp index a58db883d..d6a6a57fd 100644 --- a/opm/parser/eclipse/EclipseState/checkDeck.cpp +++ b/opm/parser/eclipse/EclipseState/checkDeck.cpp @@ -18,9 +18,6 @@ */ #include "checkDeck.hpp" -#include -#include - #include #include #include @@ -36,7 +33,7 @@ bool checkDeck(DeckPtr deck, ParserConstPtr parser, size_t enabledChecks) { const auto& keyword = deck->getKeyword(keywordIdx); if (!parser->isRecognizedKeyword( keyword.name() ) ) { std::string msg("Keyword '" + keyword.name() + "' is unknown."); - OpmLog::addMessage(Log::MessageType::Warning , Log::fileMessage( keyword.getFileName(), keyword.getLineNumber(), msg)); + deck->getMessageContainer().warning(keyword.getFileName(), msg,keyword.getLineNumber()); deckValid = false; } } From 960e362c66dbee3b32f50c285fc9f46b42a23ccc Mon Sep 17 00:00:00 2001 From: Liu Ming Date: Mon, 25 Apr 2016 09:48:22 +0800 Subject: [PATCH 5/7] delete opmlog fro python directory. --- opm/parser/eclipse/python/c_inter/copm_log.cc | 25 -------------- .../python/python/opm/log/CMakeLists.txt | 7 ---- .../eclipse/python/python/opm/log/__init__.py | 3 -- .../python/python/opm/log/log_message.py | 3 -- .../python/python/opm/log/message_type.py | 11 ------ .../eclipse/python/python/opm/log/opm_log.py | 34 ------------------- .../python/tests/opm_log/CMakeLists.txt | 6 ---- .../eclipse/python/tests/opm_log/__init__.py | 0 .../python/tests/opm_log/test_opm_log.py | 20 ----------- 9 files changed, 109 deletions(-) delete mode 100644 opm/parser/eclipse/python/c_inter/copm_log.cc delete mode 100644 opm/parser/eclipse/python/python/opm/log/CMakeLists.txt delete mode 100644 opm/parser/eclipse/python/python/opm/log/__init__.py delete mode 100644 opm/parser/eclipse/python/python/opm/log/log_message.py delete mode 100644 opm/parser/eclipse/python/python/opm/log/message_type.py delete mode 100644 opm/parser/eclipse/python/python/opm/log/opm_log.py delete mode 100644 opm/parser/eclipse/python/tests/opm_log/CMakeLists.txt delete mode 100644 opm/parser/eclipse/python/tests/opm_log/__init__.py delete mode 100644 opm/parser/eclipse/python/tests/opm_log/test_opm_log.py diff --git a/opm/parser/eclipse/python/c_inter/copm_log.cc b/opm/parser/eclipse/python/c_inter/copm_log.cc deleted file mode 100644 index 10283a008..000000000 --- a/opm/parser/eclipse/python/c_inter/copm_log.cc +++ /dev/null @@ -1,25 +0,0 @@ -#include -#include - -extern "C" { - - void add_stdout_log(int64_t messageMask) { - std::shared_ptr streamLog = std::make_shared(std::cout , messageMask); - Opm::OpmLog::addBackend( "STDOUT" , streamLog ); - } - - void add_stderr_log(int64_t messageMask) { - std::shared_ptr streamLog = std::make_shared(std::cerr , messageMask); - Opm::OpmLog::addBackend( "STDERR" , streamLog ); - } - - void add_file_log( const char * filename , int64_t messageMask) { - std::shared_ptr streamLog = std::make_shared(filename , messageMask); - Opm::OpmLog::addBackend( filename , streamLog ); - } - - void log_add_message( int64_t messageType , const char * message) { - Opm::OpmLog::addMessage(messageType , message ); - } - -} diff --git a/opm/parser/eclipse/python/python/opm/log/CMakeLists.txt b/opm/parser/eclipse/python/python/opm/log/CMakeLists.txt deleted file mode 100644 index 4b9b18e5c..000000000 --- a/opm/parser/eclipse/python/python/opm/log/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - message_type.py - opm_log.py -) - -add_python_package("opm.log" ${PYTHON_INSTALL_PREFIX}/opm/log "${PYTHON_SOURCES}" True) diff --git a/opm/parser/eclipse/python/python/opm/log/__init__.py b/opm/parser/eclipse/python/python/opm/log/__init__.py deleted file mode 100644 index 97bb256a7..000000000 --- a/opm/parser/eclipse/python/python/opm/log/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .message_type import MessageType -from .opm_log import OpmLog - diff --git a/opm/parser/eclipse/python/python/opm/log/log_message.py b/opm/parser/eclipse/python/python/opm/log/log_message.py deleted file mode 100644 index 5ed56a998..000000000 --- a/opm/parser/eclipse/python/python/opm/log/log_message.py +++ /dev/null @@ -1,3 +0,0 @@ -class MessageType(object): - # These are hand-copied from LogUtil.hpp - diff --git a/opm/parser/eclipse/python/python/opm/log/message_type.py b/opm/parser/eclipse/python/python/opm/log/message_type.py deleted file mode 100644 index d54eef6fd..000000000 --- a/opm/parser/eclipse/python/python/opm/log/message_type.py +++ /dev/null @@ -1,11 +0,0 @@ -class MessageType(object): - # These are hand-copied from LogUtil.hpp - DEBUG = 1 - INFO = 2 - WARNING = 4 - ERROR = 8 - PROBLEM = 16 - BUG = 16 - - - DEFAULT = DEBUG + INFO + WARNING + ERROR + PROBLEM + BUG diff --git a/opm/parser/eclipse/python/python/opm/log/opm_log.py b/opm/parser/eclipse/python/python/opm/log/opm_log.py deleted file mode 100644 index b874fa9c3..000000000 --- a/opm/parser/eclipse/python/python/opm/log/opm_log.py +++ /dev/null @@ -1,34 +0,0 @@ -from ert.cwrap import BaseCClass, CWrapper -from opm import OPMPrototype - -from opm.log import MessageType - -class OpmLog(BaseCClass): - _add_file_log = OPMPrototype("void add_file_log( char* , int64 )", bind = False) - _add_stderr_log = OPMPrototype("void add_stderr_log( int64 )" , bind = False) - _add_stdout_log = OPMPrototype("void add_stdout_log( int64 )" , bind = False) - _add_message = OPMPrototype("void log_add_message( int64 , char* )" , bind = False) - - def __init__(self): - raise Exception("Can not instantiate - just use class methods") - - @classmethod - def addStdoutLog(cls , message_mask = MessageType.DEFAULT): - cls._add_stdout_log(message_mask) - - - @classmethod - def addStderrLog(cls , message_mask = MessageType.DEFAULT): - cls._add_stderr_log(message_mask) - - - @classmethod - def addFileLog(cls , filename , message_mask = MessageType.DEFAULT): - cls._add_file_log(filename , message_mask) - - - @classmethod - def addMessage(cls , message_type , message): - cls._add_message(message_type , message) - - diff --git a/opm/parser/eclipse/python/tests/opm_log/CMakeLists.txt b/opm/parser/eclipse/python/tests/opm_log/CMakeLists.txt deleted file mode 100644 index 0444afa36..000000000 --- a/opm/parser/eclipse/python/tests/opm_log/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -set (TEST_SOURCES - __init__.py - test_opm_log.py) - -add_python_package("python.tests.log" "${PYTHON_INSTALL_PREFIX}/tests/opm_log" "${TEST_SOURCES}" False) -addPythontest( python.test_log tests.opm_log.test_opm_log.OpmLogTest ) diff --git a/opm/parser/eclipse/python/tests/opm_log/__init__.py b/opm/parser/eclipse/python/tests/opm_log/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/opm/parser/eclipse/python/tests/opm_log/test_opm_log.py b/opm/parser/eclipse/python/tests/opm_log/test_opm_log.py deleted file mode 100644 index c051de4ad..000000000 --- a/opm/parser/eclipse/python/tests/opm_log/test_opm_log.py +++ /dev/null @@ -1,20 +0,0 @@ -from unittest import TestCase -from ert.test import TestAreaContext - -from opm.log import OpmLog, MessageType - - -class OpmLogTest(TestCase): - def test_file_stream(self): - OpmLog.addStdoutLog( MessageType.ERROR ) - OpmLog.addStderrLog( MessageType.ERROR ) - - with TestAreaContext("log/test"): - OpmLog.addFileLog( "log.txt" , MessageType.INFO ) - OpmLog.addMessage( MessageType.INFO , "XXLine1") - - with open("log.txt") as file: - line = file.readline() - line = line.strip() - self.assertEqual( line , "XXLine1") - From 5720192314ce957f0cbea5fc5c53979e3cfd80d6 Mon Sep 17 00:00:00 2001 From: Liu Ming Date: Mon, 25 Apr 2016 10:04:40 +0800 Subject: [PATCH 6/7] remove log from cmake files. --- opm/parser/eclipse/python/c_inter/CMakeLists.txt | 1 - opm/parser/eclipse/python/python/opm/CMakeLists.txt | 1 - opm/parser/eclipse/python/tests/CMakeLists.txt | 1 - 3 files changed, 3 deletions(-) diff --git a/opm/parser/eclipse/python/c_inter/CMakeLists.txt b/opm/parser/eclipse/python/c_inter/CMakeLists.txt index ef969b708..9ef2285b3 100644 --- a/opm/parser/eclipse/python/c_inter/CMakeLists.txt +++ b/opm/parser/eclipse/python/c_inter/CMakeLists.txt @@ -5,7 +5,6 @@ cparse_context.cc ctable_manager.cc ctable.cc ctable_index.cc -copm_log.cc ) target_link_libraries(copmparser opmparser) diff --git a/opm/parser/eclipse/python/python/opm/CMakeLists.txt b/opm/parser/eclipse/python/python/opm/CMakeLists.txt index 15acbe44b..e12387dca 100644 --- a/opm/parser/eclipse/python/python/opm/CMakeLists.txt +++ b/opm/parser/eclipse/python/python/opm/CMakeLists.txt @@ -7,7 +7,6 @@ add_python_package("opm" ${PYTHON_INSTALL_PREFIX}/opm "${PYTHON_SOURCES}" True) add_subdirectory( parser ) add_subdirectory( deck ) add_subdirectory( ecl_state ) -add_subdirectory( log ) configure_file(opm_lib_info_build.py.in ${PROJECT_BINARY_DIR}/${PYTHON_INSTALL_PREFIX}/opm/__opm_lib_info.py ) diff --git a/opm/parser/eclipse/python/tests/CMakeLists.txt b/opm/parser/eclipse/python/tests/CMakeLists.txt index 4c9b72929..8257c1945 100644 --- a/opm/parser/eclipse/python/tests/CMakeLists.txt +++ b/opm/parser/eclipse/python/tests/CMakeLists.txt @@ -7,4 +7,3 @@ add_subdirectory( parser ) add_subdirectory( deck ) add_subdirectory( parse_context ) add_subdirectory( ecl_state ) -add_subdirectory( opm_log ) From 59c6569a788a030e735955fdf47be8c57a7d9b55 Mon Sep 17 00:00:00 2001 From: Liu Ming Date: Mon, 25 Apr 2016 16:25:15 +0800 Subject: [PATCH 7/7] Make mutable MessageContainer member, recover the const qualifier for deck. --- opm/parser/eclipse/Deck/Deck.cpp | 9 ++------- opm/parser/eclipse/Deck/Deck.hpp | 5 ++--- opm/parser/eclipse/Deck/Section.hpp | 2 +- opm/parser/eclipse/EclipseState/checkDeck.cpp | 2 +- opm/parser/eclipse/EclipseState/checkDeck.hpp | 2 +- opm/parser/eclipse/Parser/Parser.cpp | 2 +- 6 files changed, 8 insertions(+), 14 deletions(-) diff --git a/opm/parser/eclipse/Deck/Deck.cpp b/opm/parser/eclipse/Deck/Deck.cpp index 28dc36cde..aef52826c 100644 --- a/opm/parser/eclipse/Deck/Deck.cpp +++ b/opm/parser/eclipse/Deck/Deck.cpp @@ -143,16 +143,11 @@ namespace Opm { return this->keywordList.at( index ); } - const MessageContainer& Deck::getMessageContainer() const { - return m_messageContainer; + MessageContainer& Deck::getMessageContainer() const { + return this->m_messageContainer; } - MessageContainer& Deck::getMessageContainer() { - return m_messageContainer; - } - - UnitSystem& Deck::getDefaultUnitSystem() { if( !this->defaultUnits ) this->initUnitSystem(); return *this->defaultUnits; diff --git a/opm/parser/eclipse/Deck/Deck.hpp b/opm/parser/eclipse/Deck/Deck.hpp index a4e9815cf..e2b7a9124 100644 --- a/opm/parser/eclipse/Deck/Deck.hpp +++ b/opm/parser/eclipse/Deck/Deck.hpp @@ -105,8 +105,7 @@ namespace Opm { void addKeyword( const DeckKeyword& keyword ); DeckKeyword& getKeyword( size_t ); - const MessageContainer& getMessageContainer() const; - MessageContainer& getMessageContainer(); + MessageContainer& getMessageContainer() const; UnitSystem& getDefaultUnitSystem(); UnitSystem& getActiveUnitSystem(); @@ -121,7 +120,7 @@ namespace Opm { void initUnitSystem() const; std::vector< DeckKeyword > keywordList; - MessageContainer m_messageContainer; + mutable MessageContainer m_messageContainer; mutable std::unique_ptr< UnitSystem > activeUnits; mutable std::unique_ptr< UnitSystem > defaultUnits; diff --git a/opm/parser/eclipse/Deck/Section.hpp b/opm/parser/eclipse/Deck/Section.hpp index 0e85143b9..a21f4b5ea 100644 --- a/opm/parser/eclipse/Deck/Section.hpp +++ b/opm/parser/eclipse/Deck/Section.hpp @@ -47,7 +47,7 @@ class Section : public DeckView { // returns whether the deck has all mandatory sections and if all sections are in // the right order - static bool checkSectionTopology(Deck& deck, + static bool checkSectionTopology(const Deck& deck, const Parser&, bool ensureKeywordSectionAffiliation = false); diff --git a/opm/parser/eclipse/EclipseState/checkDeck.cpp b/opm/parser/eclipse/EclipseState/checkDeck.cpp index d6a6a57fd..79b3a19c8 100644 --- a/opm/parser/eclipse/EclipseState/checkDeck.cpp +++ b/opm/parser/eclipse/EclipseState/checkDeck.cpp @@ -23,7 +23,7 @@ #include namespace Opm { -bool checkDeck(DeckPtr deck, ParserConstPtr parser, size_t enabledChecks) { +bool checkDeck(DeckConstPtr deck, ParserConstPtr parser, size_t enabledChecks) { bool deckValid = true; // make sure that the deck does not contain unknown keywords diff --git a/opm/parser/eclipse/EclipseState/checkDeck.hpp b/opm/parser/eclipse/EclipseState/checkDeck.hpp index d1ca03bc4..1858f3e01 100644 --- a/opm/parser/eclipse/EclipseState/checkDeck.hpp +++ b/opm/parser/eclipse/EclipseState/checkDeck.hpp @@ -40,7 +40,7 @@ enum DeckChecks { // some semantical correctness checks of the deck. this method adds a warning to // the deck object if any issue is found ... -bool checkDeck(std::shared_ptr< Deck > deck, std::shared_ptr< const Parser >, size_t enabledChecks = AllChecks); +bool checkDeck(std::shared_ptr< const Deck > deck, std::shared_ptr< const Parser >, size_t enabledChecks = AllChecks); } diff --git a/opm/parser/eclipse/Parser/Parser.cpp b/opm/parser/eclipse/Parser/Parser.cpp index 9b07ab123..fa4a4c636 100644 --- a/opm/parser/eclipse/Parser/Parser.cpp +++ b/opm/parser/eclipse/Parser/Parser.cpp @@ -598,7 +598,7 @@ bool Parser::parseState(std::shared_ptr parserState) const { return false; } - bool Section::checkSectionTopology(Deck& deck, + bool Section::checkSectionTopology(const Deck& deck, const Parser& parser, bool ensureKeywordSectionAffiliation) {