readDeck.hpp
Go to the documentation of this file.
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
26
27#include <filesystem>
28#include <memory>
29#include <optional>
30#include <string>
31
32namespace 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
43namespace Opm {
44
45namespace Action {
46class State;
47}
48
49enum class FileOutputMode {
51 OUTPUT_NONE = 0,
52
55
57 OUTPUT_ALL = 3,
58};
59
60// Ensure that a directory exists, creating it if it does not.
61void
62ensureOutputDirExists(const std::string& cmdline_output_dir);
63
64// Prepare the result ouptut directory by removing files from previous simulation runs.
65void
66prepareResultOutputDirectory(const std::string& baseName, const std::filesystem::path& outputDir);
67
68std::unique_ptr<ParseContext> setupParseContext(const bool exitOnAllErrors);
69
70// Setup the OpmLog backends
73 const std::string& deck_filename,
74 const std::string& cmdline_output_dir,
75 const std::string& cmdline_output,
76 bool output_cout_,
77 const std::string& stdout_log_id,
78 const bool allRanksDbgLog);
79
85 const std::string& deckFilename,
86 std::shared_ptr<EclipseState>& eclipseState,
87 std::shared_ptr<Schedule>& schedule,
88 std::unique_ptr<UDQState>& udqState,
89 std::unique_ptr<Action::State>& actionState,
90 std::unique_ptr<WellTestState>& wtestState,
91 std::shared_ptr<SummaryConfig>& summaryConfig,
92 std::shared_ptr<Python> python,
93 const std::string& parsingStrictness,
94 bool initFromRestart,
95 bool checkDeck,
96 const std::optional<int>& outputInterval);
97
99 const EclipseState& eclipseState);
100} // end namespace Opm
101
102#endif // OPM_READDECK_HEADER_INCLUDED
Dune::Communication< MPIComm > Communication
Definition: ParallelCommunication.hpp:30
Definition: BlackoilPhases.hpp:27
std::unique_ptr< ParseContext > setupParseContext(const bool exitOnAllErrors)
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, bool initFromRestart, bool checkDeck, const std::optional< int > &outputInterval)
Reads the deck and creates all necessary objects if needed.
void ensureOutputDirExists(const std::string &cmdline_output_dir)
FileOutputMode
Definition: readDeck.hpp:49
@ OUTPUT_LOG_ONLY
Output only to log files, no ECLIPSE output.
@ OUTPUT_ALL
Output to all files.
@ OUTPUT_NONE
No file output.
void verifyValidCellGeometry(Parallel::Communication comm, const EclipseState &eclipseState)
void prepareResultOutputDirectory(const std::string &baseName, const std::filesystem::path &outputDir)
FileOutputMode setupLogging(Parallel::Communication &comm, const std::string &deck_filename, const std::string &cmdline_output_dir, const std::string &cmdline_output, bool output_cout_, const std::string &stdout_log_id, const bool allRanksDbgLog)