20#ifndef OPM_IO_OUTPUTSTREAM_HPP_INCLUDED
21#define OPM_IO_OUTPUTSTREAM_HPP_INCLUDED
23#include <opm/io/eclipse/PaddedOutputString.hpp>
24#include <opm/common/utility/TimeService.hpp>
33namespace Opm {
namespace EclIO {
39namespace Opm {
namespace EclIO {
namespace OutputStream {
73 Init& operator=(
const Init& rhs) =
delete;
81 void write(
const std::string& kw,
82 const std::vector<int>& data);
89 void write(
const std::string& kw,
90 const std::vector<bool>& data);
98 void write(
const std::string& kw,
99 const std::vector<float>& data);
107 void write(
const std::string& kw,
108 const std::vector<double>& data);
112 std::unique_ptr<EclOutput> stream_;
122 void open(
const std::string& fname,
123 const bool formatted);
129 template <
typename T>
130 void writeImpl(
const std::string& kw,
131 const std::vector<T>& data);
172 void message(
const std::string& msg);
179 void write(
const std::string& kw,
180 const std::vector<int>& data);
187 void write(
const std::string& kw,
188 const std::vector<bool>& data);
196 void write(
const std::string& kw,
197 const std::vector<float>& data);
205 void write(
const std::string& kw,
206 const std::vector<double>& data);
213 void write(
const std::string& kw,
214 const std::vector<std::string>& data);
222 void write(
const std::string& kw,
227 std::unique_ptr<EclOutput> stream_;
241 void openUnified(
const std::string& fname,
242 const bool formatted,
254 void openNew(
const std::string& fname,
255 const bool formatted);
267 void openExisting(
const std::string& fname,
268 const bool formatted,
269 const std::streampos writePos);
277 template <
typename T>
278 void writeImpl(
const std::string& kw,
279 const std::vector<T>& data);
303 RFT(
const RFT& rhs) =
delete;
306 RFT& operator=(
const RFT& rhs) =
delete;
307 RFT& operator=(
RFT&& rhs);
314 void write(
const std::string& kw,
315 const std::vector<int>& data);
323 void write(
const std::string& kw,
324 const std::vector<float>& data);
332 void write(
const std::string& kw,
337 std::unique_ptr<EclOutput> stream_;
350 void open(
const std::string& fname,
351 const bool formatted,
352 const bool existing);
358 template <
typename T>
359 void writeImpl(
const std::string& kw,
360 const std::vector<T>& data);
366 using StartTime = time_point;
368 enum class UnitConvention
385 void add(
const std::string& keyword,
386 const std::string& wgname,
388 const std::string& unit);
393 std::vector<PaddedOutputString<8>> keywords{};
394 std::vector<PaddedOutputString<8>> wgnames{};
395 std::vector<int> nums{};
396 std::vector<PaddedOutputString<8>> units{};
401 const UnitConvention uconv,
402 const std::array<int,3>& cartDims,
404 const StartTime start);
419 std::array<int,3> cartDims_;
420 StartTime startDate_;
421 std::vector<PaddedOutputString<8>> restart_;
424 std::unique_ptr<EclOutput> stream_;
432 std::unique_ptr<EclOutput>
451 std::string outputFileName(
const ResultSet& rsetDescriptor,
452 const std::string& ext);
Definition EclOutput.hpp:38
File manager for "init" output streams.
Definition OutputStream.hpp:56
void write(const std::string &kw, const std::vector< int > &data)
Write integer data to underlying output stream.
Definition OutputStream.cpp:237
File manager for RFT output streams.
Definition OutputStream.hpp:284
void write(const std::string &kw, const std::vector< int > &data)
Write integer data to underlying output stream.
Definition OutputStream.cpp:503
File manager for restart output streams.
Definition OutputStream.hpp:136
void message(const std::string &msg)
Generate a message string (keyword type 'MESS') in underlying output stream.
Definition OutputStream.cpp:330
void write(const std::string &kw, const std::vector< int > &data)
Write integer data to underlying output stream.
Definition OutputStream.cpp:337
Definition OutputStream.hpp:383
Definition OutputStream.hpp:364
Null-terminated, left adjusted, space padded array of N characters.
Definition PaddedOutputString.hpp:40
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30
Definition OutputStream.hpp:286
Abstract representation of an ECLIPSE-style result set.
Definition OutputStream.hpp:46
std::string baseName
Base name of simulation run.
Definition OutputStream.hpp:51
std::string outputDir
Output directory. Commonly "." or location of run's .DATA file.
Definition OutputStream.hpp:48
Definition OutputStream.hpp:377
Definition OutputStream.hpp:42