2017-01-06 07:38:12 -06:00
|
|
|
/*
|
2018-11-02 09:57:48 -05:00
|
|
|
Copyright (c) 2018 Equinor ASA
|
2017-01-06 07:38:12 -06:00
|
|
|
Copyright (c) 2016 Statoil ASA
|
|
|
|
Copyright (c) 2013-2015 Andreas Lauser
|
|
|
|
Copyright (c) 2013 SINTEF ICT, Applied Mathematics.
|
|
|
|
Copyright (c) 2013 Uni Research AS
|
|
|
|
Copyright (c) 2015 IRIS AS
|
|
|
|
|
|
|
|
This file is part of the Open Porous Media project (OPM).
|
|
|
|
|
|
|
|
OPM is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
OPM is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
#ifndef RESTART_IO_HPP
|
|
|
|
#define RESTART_IO_HPP
|
|
|
|
|
2017-03-03 01:18:30 -06:00
|
|
|
#include <opm/output/eclipse/RestartValue.hpp>
|
2017-01-06 07:38:12 -06:00
|
|
|
|
2018-11-02 09:57:48 -05:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp>
|
|
|
|
|
2019-05-02 16:57:43 -05:00
|
|
|
#include <string>
|
2018-11-02 09:57:48 -05:00
|
|
|
#include <utility>
|
|
|
|
#include <vector>
|
|
|
|
|
2017-01-06 07:38:12 -06:00
|
|
|
namespace Opm {
|
|
|
|
|
2018-11-02 09:57:48 -05:00
|
|
|
class EclipseGrid;
|
|
|
|
class EclipseState;
|
|
|
|
class Schedule;
|
2017-01-06 07:38:12 -06:00
|
|
|
|
2018-11-02 09:57:48 -05:00
|
|
|
} // namespace Opm
|
2017-01-06 07:38:12 -06:00
|
|
|
|
2019-05-02 16:30:20 -05:00
|
|
|
namespace Opm { namespace EclIO { namespace OutputStream {
|
|
|
|
|
|
|
|
class Restart;
|
|
|
|
|
|
|
|
}}}
|
2017-01-06 07:38:12 -06:00
|
|
|
|
2020-06-16 07:09:49 -05:00
|
|
|
namespace Opm { namespace Action {
|
|
|
|
|
|
|
|
class State;
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
2017-01-06 07:38:12 -06:00
|
|
|
/*
|
2018-11-02 09:57:48 -05:00
|
|
|
The two free functions RestartIO::save() and RestartIO::load() can
|
2017-01-06 07:38:12 -06:00
|
|
|
be used to save and load reservoir and well state from restart
|
|
|
|
files. Observe that these functions 'just do it', i.e. the checking
|
|
|
|
of which report step to load from, if output is enabled at all and
|
|
|
|
so on is handled by an outer scope.
|
|
|
|
|
|
|
|
If the filename corresponds to unified eclipse restart file,
|
|
|
|
i.e. UNRST the functions will seek correctly to the correct report
|
|
|
|
step, and truncate in the case of save. For any other filename the
|
|
|
|
functions will start reading and writing from file offset zero. If
|
|
|
|
the input filename does not correspond to a unified restart file
|
|
|
|
there is no consistency checking between filename and report step;
|
|
|
|
i.e. these calls:
|
|
|
|
|
|
|
|
load("CASE.X0010" , 99 , ...)
|
|
|
|
save("CASE.X0010" , 99 , ...)
|
|
|
|
|
2018-11-02 09:57:48 -05:00
|
|
|
will read from and write to the file "CASE.X0010" - completely ignoring
|
2017-01-06 07:38:12 -06:00
|
|
|
the report step argument '99'.
|
|
|
|
*/
|
2018-11-02 09:57:48 -05:00
|
|
|
namespace Opm { namespace RestartIO {
|
|
|
|
|
2019-05-02 16:30:20 -05:00
|
|
|
void save(EclIO::OutputStream::Restart& rstFile,
|
|
|
|
int report_step,
|
|
|
|
double seconds_elapsed,
|
|
|
|
RestartValue value,
|
|
|
|
const EclipseState& es,
|
|
|
|
const EclipseGrid& grid,
|
|
|
|
const Schedule& schedule,
|
2020-06-16 07:09:49 -05:00
|
|
|
const Action::State& action_state,
|
2019-05-02 16:30:20 -05:00
|
|
|
const SummaryState& sumState,
|
|
|
|
bool write_double = false);
|
2018-11-02 09:57:48 -05:00
|
|
|
|
2019-06-03 10:35:26 -05:00
|
|
|
|
|
|
|
RestartValue load(const std::string& filename,
|
|
|
|
int report_step,
|
2020-06-16 07:09:49 -05:00
|
|
|
Action::State& action_state,
|
2019-06-03 10:35:26 -05:00
|
|
|
SummaryState& summary_state,
|
|
|
|
const std::vector<RestartKey>& solution_keys,
|
|
|
|
const EclipseState& es,
|
|
|
|
const EclipseGrid& grid,
|
|
|
|
const Schedule& schedule,
|
|
|
|
const std::vector<RestartKey>& extra_keys = {});
|
2018-11-02 09:57:48 -05:00
|
|
|
|
|
|
|
}} // namespace Opm::RestartIO
|
|
|
|
|
|
|
|
#endif // RESTART_IO_HPP
|