In this pull requested we resorted to storing the data items (e.g. cart_dims, global_cell,
etc.) instead of the UnstructuredGrid. Unfortunately, this is a change of the lifetime
guarantees: Previously, a shared_ptr to the Unstructuredgrid was stored. Thus the data members
were available for the lifetime of the EclipseWriter. With the previous changes the grid could
actually have been destroyed before the writer.
Therefore we no store a shared_ptr to the UnstructuredGrid again (in addition to the datamembers).
Thus at least for UnstructuredGrid the old guarantees still hold.
Removed conflicts in
opm/core/wells/WellsManager.cpp
that were due to the change
```diff
- pd.well_index = WellsManagerDetail::computeWellIndex(radius, cubical, cell_perm, completion->getDiameter());
+ pd.well_index = WellsManagerDetail::computeWellIndex(radius, cubical, cell_perm, completion->getSkinFactor());
```
in WellsManager::createWellsFromSpecs which moved from WellsManager.cpp to WellsManager_impl.hpp file in a previous commit.
because as discussed with Atgeirr, this function should no longer
write the initial solution, it also does no longer need to know the
initial simulator state...
this patch gets rid of the old-parser-taking methods of
EclipseWriter. this avoids quite a few consistency issues and also
reduces the amount of duplicate work required.
maybe it is not a bug but a slightly spec. The problem is that GCC 4.4
does not implicitly convert std::shared_ptr<$FOO> to
std::shared_ptr<const $FOO> which caused the recent Jenkins build
errors at Statoil. Note that this problem only occurs with the output
writer in conjunction with the old Eclipse parser, so
OPM/opm-autodiff#105 also makes the problem disappear. The present
patch addresses the root cause, though...
At least for g++-4.4. shared_ptr does not have a constructor
taking an integer and therefore compilation fails. Therefore we
resort statements to construct empty pointers, like
```parser_(0)```
to using the empty constructor:
```parser_()```
This patch closes#533
This means that EclipseKeyword now never processes the data it
gets. Instead the data must be explicitly preprocessed by the calling
site using the new auxiliary functions "convertUnit()",
"extractFromStriped()", etc. This approach needs a few additional
temporary copies of the data, but given the facts that readability of
this code is much better using this approach, and that EclipseWriter
is neither a performance- nor a memory critical codepath, I don't care
too much about those temporary arrays...
- the output=true|false parameter gets respected now
- if output is "true", it is checked that the value of the
"output_dir" parameter is a directory (although I did not find an
easy way to check whether it is writable short of writing a file to
it.)
- the "output_interval" parameter gets respected as well
- the index of a written timestep is now independent of the time step
index of the simulation: the initial solution is always 0, the first
result written to disk is always 1 and so on... (i.e., it does not
matter anymore how many steps the simulator needed between two writes)
these changes have been proposed by @atgeirr. Thanks!
Since writeTimeStep() now gets called also before the first timestep is done,
the EclipseWellTotal::update() method was in error, always calling
SimulatorTimer::stepLengthTaken(). That method cannot be called if the
timer's currentStepNum() is 0, so that is checked for and intercepted.
The total rate in that case is of course zero.
This commit implements some additional scaling keywords. This includes
the ISWL-family that provide hysteresis behaviour via alternative
scaling of the tables. The old parser has been somewhat extended for
testing purposes. The commit also includes a slight refactoring of the
SatFunc-family where a new base class has been introduced.
If we want to index into two arrays that has been concatenated (for
instance oil phase pressure continuously, then water phase pressure
continuously), then this variant (courtesy of @bska) will cover both
variants (intermixed striding (where offset < stride) and sequentially
striding (where offset > stride)).