A reservoir-coupling master group takes its production potential from
the corresponding slave group, which reports it in display units (e.g.
SM3/DAY for METRIC): the slave applies from_si before storing the value
in its GroupState and sending it to the master. The guide-rate handler
then applied from_si a second time to that value, inflating a master
group's potential by the seconds-per-day factor (86400 in METRIC).
This does not change the physical solution when every producing group
under a parent is a master group, because the GUIDERAT denominator is
built from rate ratios, so a uniform scaling of all potentials cancels
in the guide-rate fractions. But it corrupts the reported group
production guide rates (GOPGR/GVPGR) and would distort the split in a
mixed hierarchy of master and ordinary producing groups.
Apply from_si only to non-master groups, whose potentials are
accumulated from sub-groups in SI; a master group's potential is
already in display units and must not be converted again.
Replaces custom `beforeBegin`/`beforeEnd` iterators with `std::make_reverse_iterator` for consistent and robust reverse traversal of matrix rows and columns. Introduces an `rindex` helper to correctly extract indices from reverse iterators. The reasoning is that the implementation of `beforeBegin`/`beforeEnd` usually relies on undefined behavior: an address one past the end of an array is allowed, but one before is prohibited by the standard.
This is so that the new dune matrix work as expected: it requires to set the build mode each time a matrix is built and the sizes must be specified after setting the build mode. This is compatible with the current BCRSMatrix.
Improves readability and consistency of sparse matrix element access. This is as a preparation work for a new matrix from dune-istl.
* Use begin and end creator iterators accounting that they may be different types.
* Use iterator arithmetic instead of row implementation details.
* Use sparseRange idiom to loop over the row sparsity pattern.
* Avoid taking mutable references of rows, given that a matrix may return proxy objects.
* Do not assign an non-zero numeric value to the jacobian during its pattern creation.
* Include missing header for block vectors