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