A rewritten Summary.cpp with some minor header modifications. Synposis
of the new implementation:
* Uses unordered_map< string, std::function > for dispatch, instead of
multiple functions and a switch
* Some poor man's function composition support has been added
(privately) to avoid a lot of reptition in the post processing.
* Functions assume they work over lists of wells instead of single wells
being special cased - this means groups of well etc. can share
implementation with single wells and field keywords.
* Unsupported keywords are not written in the Summary file.
Furthermore, some comments on special cases and overall approach and
a generally more declarative implementation. This change is invisible to
downstream developers. Users will obviously see no more garbage
keywords.
Simulators might modify the grid post EclipseState creation, so the Grid
fetched from there is unreliable. Copy the Deck-provided grid and apply
the manipulations at EclipseWriter construction time to ensure it uses
the same dimensions and has the same properties as the simulator.
Basing the dest durations on days over seconds make them less noisy,
more readable and closer to actual idiomatic use. Removes some subtle
complexities from the tests.
Reading the start time from EclipseState means it's no longer required
as a parameter to every method, and that the current time can be
calculated as start time + time elapsed.
Hides all the EclipseWriter details and helper classes using pimpl,
which now enforces the non-copyability of EclipseWriter (which relies on
open and stateful file handles).
Rewrites the RFT test to be independent of opm-core data types and
functions, and renames it to test_RFT since the class now represents the
full file, not some open-closing handle.
Remove the unnecessary or unused includes. Consequence is well enum
conversions being no longer public static. To not break the tests the
functions have been implemented in writenumwells.
Remove the opm-core dependency and re-implement the RFT writer. The
approach has been changed in the sense that we now store and keep alive
a file instance for the RFT file, instead of re-opening the file at
every time step.
To stay consistent with the interface exposed by the other
eclipse-writer components, the summary facilities takes its time elapsed
since simulation start, not on a per-step basis.
The support for reading restart files has been written in order to break
the dependency on opm-core. init_from_restart_file now returns
opm-output defined data types that clients, typically simulators, can
use to populate its own internal structures at will.
To break dependencies between modules, and to properly define the input
format for the output facilities, make writeTimeStep take data::Solution
over SimulationDataContainer.
The tests requires some boilerplate setup and quickly became slow to
maintain and run. Rewrite so that the tests are grouped on topic instead
of immediate keyword family.