This commit introduces consistency checks for the scaled displacing
saturation in the three point horizontal scaling method
(SCALECRS=YES). These plug into the framework introduced in commit
c3939c544 (PR #5438). We implement the following two checks
- SGCR < 1-SOGCR-SWL < SGU
- SWCR < 1-SOWCR-SGL < SWU
which collectively guarantee a mobile displacing oil saturation in
the two phase gas/oil and oil/water systems.
This commit introduces a set of consistency checks for the water
phase saturation functions. These plug into the framework
introduced in commit c3939c544 (PR #5438). We implement the
following three checks
- 0 <= SWL < 1
- 0 < SWU <= 1
- SWL <= SWCR < SWU
which collectively enable a non-negative oil saturation in the two
phase oil/water system.
This commit introduces a set of consistency checks for the gas phase
saturation functions. These plug into the framework introduced in
commit c3939c544 (PR #5438). We implement the following three checks
- 0 <= SGL < 1
- 0 <= SGU < 1
- SGL <= SGCR < SGU
which collectively enable a non-negative oil saturation in the two
phase gas/oil system.
This commit introduces a set of consistency checks for the oil phase
saturation functions. These plug into the framework introduced in
commit c3939c544 (PR #5438). We implement the following four checks
for the gas/oil two-phase system
- 0 <= SOGCR < 1
- SWL + SGU <= 1
- SOGCR < 1 - SWL - SGL
- SOGCR < 1 - SWL - SGCR
which all guarantee a non-negative (mobile) oil saturation in the
gas/oil system. Similarly, we implement the following four checks
for the oil/water two-phase system
- 0 <= SOWCR < 1
- SGL + SWU <= 1
- SOWCR < 1 - SWL - SGL
- SOWCR < 1 - SWCR - SGL
which provide the same guarantees as outlined above, but for the
oil/water system.
We add a base class, PhaseCheckBase<Scalar>, which provides a common
representation of the violated/critical predicates and implement the
specific checks as derived types of this base class.
This commit adds a new public member function
SatfuncConsistencyChecks<>::collectFailures(root, comm)
which aggregates consistency check violations from all ranks in the
MPI communication object 'comm' onto rank 'root' of 'comm'. This
amounts to summing the total number of violations from all ranks and
potentially resampling the failure points for reporting purposes.
To this end, extract the body of function processViolation() into a
general helper which performs reservoir sampling and records point
IDs and which uses a call-back function to populate the check values
associated to a single failed check. Re-implement the original
function in terms of this helper by wrapping exportCheckValues() in
a lambda function. Extract similar helpers for numPoints() and
anyFailedChecks(), and add a new helper function
SatfuncConsistencyChecks<>::incorporateRankViolations()
which brings sampled points from an MPI rank into the 'root's
internal data structures.
One caveat applies here. Our current approach to collecting check
failures implies that calling member function reportFailures() is
safe only on the 'root' process in a parallel run. On the other
hand functions anyFailedChecks() and anyFailedCriticalChecks() are
safe, and guaranteed to return the same answer, on all MPI ranks.
On a final note, the internal helper functions are at present mostly
implemented in terms of non-owning pointers. I intend to switch to
using 'std::span<>' once we enable C++20 mode.
the outputs will be generated when needed by the custom_command
since these outputs are not intended to be edited, there is no reason
to hipify them up front. in particular this removes the long sequential
process at configure time, allowing all hipification to run in parallel
(if using multiple build jobs, ie. ninja -jx or make -jx)
The intention is that this will ultimately replace the existing
RelpermDiagnostics component which does not really work in parallel
and which does not report enough context to help diagnose underlying
issues. For now, though, we just add the shell of a new set of
checks and hook that up to the build.
Class SatfuncConsistencyChecks<Scalar> manages a configurable set of
consistency checks, the implementations of which must publicly
derive from SatfuncConsistencyChecks<Scalar>::Check. Client code
will configure a set of checks by first calling
SatfuncConsistencyChecks<Scalar>::resetCheckSet()
then register individual checks by calling
SatfuncConsistencyChecks<Scalar>::addCheck()
and finally build requisite internal structures by calling
SatfuncConsistencyChecks<Scalar>::finaliseCheckSet()
Client code will then run the checks by calling
SatfuncConsistencyChecks<Scalar>::checkEndpoints()
typically in a loop. Class SatfuncConsistencyChecks<Scalar> will
count consistency check failures and attribute these to each
individual check as needed. We also maintain separate counts for
"Standard" and "Critical" failures. The former will typically
generate warnings while the latter will typically cause the
simulation run to stop. Individual checks get to decide which check
is "Critical", and client code gets to decide how to respond to
"Critical" failures.
Member function SatfuncConsistencyChecks<Scalar>::reportFailures()
will generate a textual report of the known set of consistency check
failures at a give severity level.
As an internal implementation detail, SatfuncConsistencyChecks uses
"reservoir sampling"
(https://en.wikipedia.org/wiki/Reservoir_sampling) to track details
about individual failed checks. We maintain at most a fixed number
of individual points (constructor argument).
This commits adds cmake functionality that can
hipify the cuistl framework to support AMD GPUs.
Some tests have been written as HIP does not mirror
CUDA exactly.
CONVERT_CUDA_TO_HIP is the new CMAKE argument.
CMAKE version is increased to include HIP
as a language (3.21 required).
A macro is added to create a layer of indirection
that will make only cuistl files that have been
changed rehipified.
Some BDA stuff is extracted to make sure CUDA
is not accidentally included.