My Project
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/RestartValue.hpp>
28 
29 #include <opm/output/eclipse/AggregateAquiferData.hpp>
30 
31 #include <optional>
32 #include <string>
33 #include <utility>
34 #include <vector>
35 
36 namespace Opm {
37 
38  class EclipseGrid;
39  class EclipseState;
40  class Schedule;
41  class UDQState;
42  class SummaryState;
43  class WellTestState;
44 
45 } // namespace Opm
46 
47 namespace Opm { namespace EclIO { namespace OutputStream {
48 
49  class Restart;
50 
51 }}}
52 
53 namespace Opm { namespace Action {
54 
55  class State;
56 
57 }}
58 
59 /*
60  The two free functions RestartIO::save() and RestartIO::load() can
61  be used to save and load reservoir and well state from restart
62  files. Observe that these functions 'just do it', i.e. the checking
63  of which report step to load from, if output is enabled at all and
64  so on is handled by an outer scope.
65 
66  If the filename corresponds to unified eclipse restart file,
67  i.e. UNRST the functions will seek correctly to the correct report
68  step, and truncate in the case of save. For any other filename the
69  functions will start reading and writing from file offset zero. If
70  the input filename does not correspond to a unified restart file
71  there is no consistency checking between filename and report step;
72  i.e. these calls:
73 
74  load("CASE.X0010" , 99 , ...)
75  save("CASE.X0010" , 99 , ...)
76 
77  will read from and write to the file "CASE.X0010" - completely ignoring
78  the report step argument '99'.
79 */
80 namespace Opm { namespace RestartIO {
81 
82  void save(EclIO::OutputStream::Restart& rstFile,
83  int report_step,
84  double seconds_elapsed,
85  RestartValue value,
86  const EclipseState& es,
87  const EclipseGrid& grid,
88  const Schedule& schedule,
89  const Action::State& action_state,
90  const WellTestState& wtest_state,
91  const SummaryState& sumState,
92  const UDQState& udqState,
93  std::optional<Helpers::AggregateAquiferData>& aquiferData,
94  bool write_double = false);
95 
96 
97  RestartValue load(const std::string& filename,
98  int report_step,
99  Action::State& action_state,
100  SummaryState& summary_state,
101  const std::vector<RestartKey>& solution_keys,
102  const EclipseState& es,
103  const EclipseGrid& grid,
104  const Schedule& schedule,
105  const std::vector<RestartKey>& extra_keys = {});
106 
107 }} // namespace Opm::RestartIO
108 
109 #endif // RESTART_IO_HPP
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29