The 'globalIdx' generated by localIdxToGlobalIdx() is in the range
zero to number of active cells in global model, not zero to number
of active cells on rank. Using 'globalIdx' as an argument to
set*TracerConcentration() therefore ends up indexing out-of-bounds
for the internal arrays in the tracer model object in parallel
restarted simulation runs.
The problem has been present since the restart support for tracers
was added in commit e9c45f4ca (PR #3708).
This commit switches to using the 'elemIdx' instead, as we already
do when calling the output module's setRestart() member function.
Following this, we are able to restart the standard Norne benchmark
case (NORNE_ATW2013.DATA) in parallel. The numerical results for
the tracer concentrations are, however, a little questionable and
will warrant further investigation. Nevertheless, the tracer values
are now the same in a parallel restarted run as in a sequential
restarted run.
Commit 6ba9dc086 (PR #5626) moved the balance sheet report output
logic ahead of the timestep. As a consequence, the output module's
'inplace_' and 'initialInplace_' data members must be fully
initialised the first time we call 'writeReports()' if the run
requests balance sheet output.
This commit initialises those objects by calling calc_inplace() from
EclWriter<>::endRestart(). Doing so restores the behaviour from
before PR #5626. Note, however, that using this value for
'initialInplace_' is incorrect as the simulator then, in a restarted
run, will calculate recovery factors based on the fluid distribution
at the restart time instead of at the start of the base run.
Nevertheless this is, as alluded to earlier, how the simulator has
always performed. The behaviour is just a little more explicit now.
In particular,
- Split some long lines
- Mark objects 'const' where possible
- Reduce scope of objects
- Add braces to single statement control structures
- Prefer pre-increment
- Prefer type deduction for induction variables
In that case processEclipseFormat will create NNCs over the pinched
out cells with correct transmissibilities. Those NNCs are marked as
being created in PINCH and used to overwrite calculated
transmissibilties for the horizontal intersections (transmissibilities
of normal NNCs are usually added).
Note that the trnasmissibilities (without the multipliers) do not
change later. Only the multipliers can change them in the schedule and
that will still happen.
The 'FIP' mnemonic continues to be an alias for 'SFIP' in the
current implementation, and the output layer will create the 'SFIP'
arrays as copies of 'FIP' if passed only the 'FIP' arrays.
To this end, make 'outputFipRestart_' into a structure that tracks
which of the *FIP mnemonics have been requested, and insert the
pertinent solution arrays into the data::Solution object when
needed.