opm-common
Loading...
Searching...
No Matches
RestartIO.hpp
1/*
2 Copyright (c) 2018 Equinor ASA
3 Copyright (c) 2016 Statoil ASA
4 Copyright (c) 2013-2015 Andreas Lauser
5 Copyright (c) 2013 SINTEF ICT, Applied Mathematics.
6 Copyright (c) 2013 Uni Research AS
7 Copyright (c) 2015 IRIS AS
8
9 This file is part of the Open Porous Media project (OPM).
10
11 OPM is free software: you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
15
16 OPM is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with OPM. If not, see <http://www.gnu.org/licenses/>.
23*/
24#ifndef RESTART_IO_HPP
25#define RESTART_IO_HPP
26
27#include <opm/output/eclipse/AggregateAquiferData.hpp>
28#include <opm/output/eclipse/RestartValue.hpp>
29
30#include <optional>
31#include <string>
32#include <vector>
33
34namespace Opm {
35
36 class EclipseGrid;
37 class EclipseState;
38 class Schedule;
39 class UDQState;
40 class SummaryState;
41 class WellTestState;
42
43} // namespace Opm
44
45namespace Opm { namespace EclIO { namespace OutputStream {
46
47 class Restart;
48
49}}}
50
51namespace Opm { namespace Action {
52
53 class State;
54
55}}
56
57/*
58 The two free functions RestartIO::save() and RestartIO::load() can
59 be used to save and load reservoir and well state from restart
60 files. Observe that these functions 'just do it', i.e. the checking
61 of which report step to load from, if output is enabled at all and
62 so on is handled by an outer scope.
63
64 If the filename corresponds to unified eclipse restart file,
65 i.e. UNRST the functions will seek correctly to the correct report
66 step, and truncate in the case of save. For any other filename the
67 functions will start reading and writing from file offset zero. If
68 the input filename does not correspond to a unified restart file
69 there is no consistency checking between filename and report step;
70 i.e. these calls:
71
72 load("CASE.X0010" , 99 , ...)
73 save("CASE.X0010" , 99 , ...)
74
75 will read from and write to the file "CASE.X0010" - completely ignoring
76 the report step argument '99'.
77*/
78namespace Opm::RestartIO {
79
80 void save(EclIO::OutputStream::Restart& rstFile,
81 int report_step,
82 double seconds_elapsed,
83 RestartValue value,
84 const EclipseState& es,
85 const EclipseGrid& grid,
86 const Schedule& schedule,
87 const Action::State& action_state,
88 const WellTestState& wtest_state,
89 const SummaryState& sumState,
90 const UDQState& udqState,
91 std::optional<Helpers::AggregateAquiferData>& aquiferData,
92 bool write_double = false);
93
94 // Overloaded function to handle grid containing LGR
95 void save(EclIO::OutputStream::Restart& rstFile,
96 int report_step,
97 double seconds_elapsed,
98 std::vector<RestartValue> value,
99 const EclipseState& es,
100 const EclipseGrid& grid,
101 const Schedule& schedule,
102 const Action::State& action_state,
103 const WellTestState& wtest_state,
104 const SummaryState& sumState,
105 const UDQState& udqState,
106 std::optional<Helpers::AggregateAquiferData>& aquiferData,
107 bool write_double = false);
108
109
110 RestartValue load(const std::string& filename,
111 int report_step,
112 Action::State& action_state,
113 SummaryState& summary_state,
114 const std::vector<RestartKey>& solution_keys,
115 const EclipseState& es,
116 const EclipseGrid& grid,
117 const Schedule& schedule,
118 const std::vector<RestartKey>& extra_keys = {});
119
120
121 data::Solution load_solution_only(const std::string& filename,
122 int report_step,
123 const std::vector<RestartKey>& solution_keys,
124 const EclipseState& es,
125 const EclipseGrid& grid);
126
127} // namespace Opm::RestartIO
128
129#endif // RESTART_IO_HPP
Management information about the current run's ACTION system, especially concerning the number of tim...
Definition State.hpp:51
File manager for restart output streams.
Definition OutputStream.hpp:149
About cell information and dimension: The actual grid information is held in a pointer to an ERT ecl_...
Definition EclipseGrid.hpp:61
Definition EclipseState.hpp:62
Definition Schedule.hpp:101
Definition SummaryState.hpp:72
Definition UDQState.hpp:40
Definition WellTestState.hpp:65
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30