This commit adds conversion factors for the ECL LAB unit
conventions--notably Atmospheres for pressures, Hours for time,
Grams for mass, and cubic centimetres for volumes.
it is parsed and put into the deck, but it is not internalized in any
way. (Note that, given that this keyword is quite simple, adding
sophisticated code to absorb it into EclipseState would be overkill,
in my not so humble opinion.)
A RestartConfig refurbishment that generalises some of the previously
special-casing. Short synopsis:
* Integer list input is first translated to their corresponding
mnemonics.
* Mnemonic implementation support turning off input parameters via
mnemonic=0, handled generally rather than special-cased for BASIC/FREQ
* Restart configuration setup is handled in one else-less, linear code
path. RPTRST and RPTSCHED are interpreted by their separate helper
functions, but they produce the same resulting object. Should be
easier to follow
* Ignores unknown mnemonics, has a list of known/supported mnemonics
that will be internalised.
The explicit list over supported keywords is from the Eclipse100 manual
and must be manually maintained, i.e. no dynamic solution is in place
yet. This might never be necessary, but support it dynamically isn't a
problem.
RestartConfig is a first-class citizen of EclipseConfig rather than
being embedded in IOConfig. This narrows IOConfig's responsibility to
only that of paths file system definitions and interactions, and
RestartConfig to what and when to output the restart file.
Implementing these checks as function objects improves performance
slightly (5% or so according to my measurements), probably due to the
functions being inlined rather than reduced to function pointers.
Profiling indicates the size-check isn't hoisted properly. In this case,
manually hoising the loop invariant doesn't negatively impact clarity
nor give any more noise, and slightly improves performance.
SCHEDULESection with its special implementation is a remnant of older
design and largely unnecessary now. The implementation also relied on
shared_ptr for efficiency and was not really used at all.
SCHEDULESection now is no longer special, and uses the same
implementation as SUMMARY, RUNSPEC etc. The one thing that separated it,
looking up keywords within a timestep, was only used once and this
computation has been inlined in the function.
Rather than doing add-item-check-duplicates per DeckItem added to a
record, construct all the items at once, then pass them in full to the
DeckRecord object. The DeckRecord object still check for duplicate
names, but with lower complexity and cost.
Reuses the original records string_view rather than expanding to the
same std::string, we save some allocations, memory cache misses and
simplify the class slightly.
Additionally, the uninteresting add-multiple-identical-records logic
ParserItem did before has been moved into RawRecord and is now performed
by std::deque (which also means it can allocate better for itself). The
addition of prepend deprecates push_front.
Book keeping internally in the string class is rather unnecessary and
performed a lot (once per line in the input). Performing a manual copy
without string encumbered book keeping (essentially using the string as
a raw char* buffer) gives some performance, which scales well with the
lines in each deck.
The configuration of when to write restart files is quite complex,
involving at least the three keywords RPTSOL, RPTRST and RPTSCHED. This
commit moves that configuration from the IOConfig class to the
RestartConfig class.
At a later stage the RestartConfgig class will be extended with
information of *what* to save in the restart file.
Looking up well keywords uses the well matching algorithm. This covers
all cases supplied by the eclipse documentation, and extends it slightly
by also allowing matching.
The well matching algorithm has been tuned to not throw when a well name
is used for pattern and the well is not registered. Instead it will
return the empty list, meaning keywords that expects to match over
wells, but passes full identifiers, that also rely on the match to throw
for control flow, will have to manually check the emptiness of the well
list.
The configuration of when to write restart files is quite complex,
involving at least the three keywords RPTSOL, RPTRST and RPTSCHED. This
commit moves that configuration from the IOConfig class to the
RestartConfig class.
At a later stage the RestartConfgig class will be extended with
information of *what* to save in the restart file.