RestartIO.hpp
Go to the documentation of this file.
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
28
30
31#include <string>
32#include <utility>
33#include <vector>
34
35namespace Opm {
36
37 class EclipseGrid;
38 class EclipseState;
39 class Schedule;
40
41} // namespace Opm
42
43namespace Opm { namespace EclIO { namespace OutputStream {
44
45 class Restart;
46
47}}}
48
49/*
50 The two free functions RestartIO::save() and RestartIO::load() can
51 be used to save and load reservoir and well state from restart
52 files. Observe that these functions 'just do it', i.e. the checking
53 of which report step to load from, if output is enabled at all and
54 so on is handled by an outer scope.
55
56 If the filename corresponds to unified eclipse restart file,
57 i.e. UNRST the functions will seek correctly to the correct report
58 step, and truncate in the case of save. For any other filename the
59 functions will start reading and writing from file offset zero. If
60 the input filename does not correspond to a unified restart file
61 there is no consistency checking between filename and report step;
62 i.e. these calls:
63
64 load("CASE.X0010" , 99 , ...)
65 save("CASE.X0010" , 99 , ...)
66
67 will read from and write to the file "CASE.X0010" - completely ignoring
68 the report step argument '99'.
69*/
70namespace Opm { namespace RestartIO {
71
73 int report_step,
74 double seconds_elapsed,
76 const EclipseState& es,
77 const EclipseGrid& grid,
78 const Schedule& schedule,
79 const SummaryState& sumState,
80 bool write_double = false);
81
82
83 RestartValue load(const std::string& filename,
84 int report_step,
85 SummaryState& summary_state,
86 const std::vector<RestartKey>& solution_keys,
87 const EclipseState& es,
88 const EclipseGrid& grid,
89 const Schedule& schedule,
90 const std::vector<RestartKey>& extra_keys = {});
91
92}} // namespace Opm::RestartIO
93
94#endif // RESTART_IO_HPP
const char *const string
Definition: cJSON.h:170
File manager for restart output streams.
Definition: OutputStream.hpp:136
Definition: EclipseGrid.hpp:54
Definition: EclipseState.hpp:63
Definition: RestartValue.hpp:68
Definition: Schedule.hpp:113
Definition: SummaryState.hpp:65
RestartValue load(const std::string &filename, int report_step, SummaryState &summary_state, const std::vector< RestartKey > &solution_keys, const EclipseState &es, const EclipseGrid &grid, const Schedule &schedule, const std::vector< RestartKey > &extra_keys={})
void save(EclIO::OutputStream::Restart &rstFile, int report_step, double seconds_elapsed, RestartValue value, const EclipseState &es, const EclipseGrid &grid, const Schedule &schedule, const SummaryState &sumState, bool write_double=false)
Definition: A.hpp:4
T value(details::expression_node< T > *n)
Definition: exprtk.hpp:12955