opm-simulators
readDeck.hpp
1 /*
2  Copyright 2013, 2014, 2015 SINTEF ICT, Applied Mathematics.
3  Copyright 2014 Dr. Blatt - HPC-Simulation-Software & Services
4  Copyright 2015 IRIS AS
5  Copyright 2014 STATOIL ASA.
6 
7  This file is part of the Open Porous Media project (OPM).
8 
9  OPM is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  OPM is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with OPM. If not, see <http://www.gnu.org/licenses/>.
21 */
22 #ifndef OPM_READDECK_HEADER_INCLUDED
23 #define OPM_READDECK_HEADER_INCLUDED
24 
25 #include <opm/simulators/utils/ParallelCommunication.hpp>
26 
27 #include <filesystem>
28 #include <memory>
29 #include <optional>
30 #include <string>
31 
32 namespace Opm {
33  class EclipseState;
34  class ErrorGuard;
35  class ParseContext;
36  class Python;
37  class Schedule;
38  class SummaryConfig;
39  class UDQState;
40  class WellTestState;
41 } // end namespace Opm
42 
43 namespace Opm {
44 
45 namespace Action {
46 class State;
47 }
48 
49 enum class FileOutputMode {
51  OUTPUT_NONE = 0,
52 
54  OUTPUT_LOG_ONLY = 1,
55 
57  OUTPUT_ALL = 3,
58 };
59 
60 // Ensure that a directory exists, creating it if it does not.
61 void
62 ensureOutputDirExists(const std::string& cmdline_output_dir);
63 
64 // Prepare the result ouptut directory by removing files from previous simulation runs.
65 void
66 prepareResultOutputDirectory(const std::string& baseName, const std::filesystem::path& outputDir);
67 
68 std::unique_ptr<ParseContext> setupParseContext(const bool exitOnAllErrors);
69 
70 // Setup the OpmLog backends for screen output
71 void setupStreamLogging(const std::string& stdout_log_id);
72 
73 // Setup the OpmLog backends
75 setupLogging(Parallel::Communication& comm,
76  const std::string& deck_filename,
77  const std::string& cmdline_output_dir,
78  const std::string& cmdline_output,
79  bool output_cout_,
80  const std::string& stdout_log_id,
81  const bool allRanksDbgLog);
82 
87 void readDeck(Parallel::Communication comm,
88  const std::string& deckFilename,
89  std::shared_ptr<EclipseState>& eclipseState,
90  std::shared_ptr<Schedule>& schedule,
91  std::unique_ptr<UDQState>& udqState,
92  std::unique_ptr<Action::State>& actionState,
93  std::unique_ptr<WellTestState>& wtestState,
94  std::shared_ptr<SummaryConfig>& summaryConfig,
95  std::shared_ptr<Python> python,
96  const std::string& parsingStrictness,
97  const std::string& actionParsingStrictness,
98  const std::string& inputSkipMode,
99  bool initFromRestart,
100  bool checkDeck,
101  bool keepKeywords,
102  const std::optional<int>& outputInterval,
103  bool slaveMode);
104 
105 void verifyValidCellGeometry(Parallel::Communication comm,
106  const EclipseState& eclipseState);
107 } // end namespace Opm
108 
109 #endif // OPM_READDECK_HEADER_INCLUDED
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: blackoilbioeffectsmodules.hh:45
Output only to log files, no ECLIPSE output.
FileOutputMode
Definition: readDeck.hpp:49
Output to all files.
void readDeck(Parallel::Communication comm, const std::string &deckFilename, std::shared_ptr< EclipseState > &eclipseState, std::shared_ptr< Schedule > &schedule, std::unique_ptr< UDQState > &udqState, std::unique_ptr< Action::State > &actionState, std::unique_ptr< WellTestState > &wtestState, std::shared_ptr< SummaryConfig > &summaryConfig, std::shared_ptr< Python > python, const std::string &parsingStrictness, const std::string &actionParsingStrictness, const std::string &inputSkipMode, bool initFromRestart, bool checkDeck, bool keepKeywords, const std::optional< int > &outputInterval, bool slaveMode)
Reads the deck and creates all necessary objects if needed.
Definition: readDeck.cpp:686