This commit reimplements the private RestartFileView class in terms
of the ERst class. The latter supports all operations we currently
need, although we can no longer use a 'const' object since loading
arrays mutates the ERst instance.
Most changes here are fairly mechanic and most of the new complexity
concerns how to identify a vector (keyword) of a particular element
type. We make special concessions for INTEHEAD, since this vector
plays a central role in accessing the other data vectors. The
mutability of RestartFileView is underscored by using shared_ptr<>
in the various helper facilities.
This commit makes class 'Opm::EclIO::ERst' able to open separate
restart files (*.X000n, *.F000n). Specifically, we refactor the
existing class constructor body into a new helper function
'initUnified'. We add a new helper function 'initSeparate' that
builds the requisite indices in the case of a single report step,
and make the constructor body call 'initUnified' or 'initSeparate'
depending on whether or not the SEQNUM keyword exists in the restart
stream.
Add two new unit tests to exercise the new ability.
This commit switches the file handling operations of the gateway
function RestartIO::save() to using the OutputStream::Restart
component. Briefly, this means replacing write_kw() function calls
with calls to Restart::write(), especially since the latter natively
handles PaddedString<8> data.
Space-padded vectors of N (usually 8) characters is the typical
representation of character data in ECLIPSE output files. Support
this type natively in the ECLIPSE IO library.
this is not supported in older version of boost::filesystem.
furthermore, it was always an experimental feature and
and has been deprecated in newer versions.
generic_string is available in all versions, so use that.
Then we don't have to store copies of the 'formatted' and 'unified'
flags, and are also able to remove the 'prepareStep()' function. We
will reintroduce these features if we decide to add support for
keeping the output stream open between separate restart output
requests (i.e., between calls to EclipseIO::writeTimeStep()).
In particular, make the stream() function into a private detail of
the implementation and add an overload set for outputting keyword
data and messages to the underlying output stream. Update unit test
accordingly.
Suggested by: Atgeirr F. Rasmussen