the update_data command needs a full opm-tests checkout,
not just a shallow clone of the PR branch. we thus first
copy the shared copy, then we pull the PR branch into that copy.
Otherwise we will never search for e.g. Boost multiple
times and the upmost module in the hierarchy will dictate
the components to be used. That does not work for downstream
modules.
Therefore with this change we check whether there is an argument
COMPONENTS passed to find_package and make sure there will be
another call to it if that is the case.
The code in @opm-project_NAME@-prereqs uses macros from OpmPackage.cmake. At
the previous location that file was not yet included for the module opm-common
as this is done in the section @OPM_PROJECT_EXTRA_CODE@, which also sets
CMAKE_MODULE_PATH.
This commit adds a new class that aggregates the *WEL vectors for
restart purposes. Using the data sources
- Simulation run's "Schedule" object
- Simulation run's "UnitSystem" object
- Current simulation step ("sim_step")
- WellRates object from simulator at the end of sim_step
- SummaryState object from Summary class at the end of sim_step
this class will fill in the (presently) known elements of the IWEL
(integers), SWEL (Real/float), XWEL (double precision), and ZWEL
arrays for output to a restart file. We distinguish contributions
of data sources extracted directly from the simulation deck from
those computed dynamically by the simulator--mostly to separate
concerns and to enable independent testing. If this introduces too
much computational overhead in actual simulation runs we can fuse
the member functions
AggregateWellData::captureDeclaredWellData()
AggregateWellData::captureDynamicWellData()
to reduce the number of loops over active wells.
The overall structure of this facility is that we have a single
templated function, wellLoop(), that calls user-defined "operations"
on each active well. Each of these operations in turn define a
subset of one of the {I,S,X,Z}WEL arrays pertaining to the
particular well. We furthermore put implementation functions into
namespaces according to the pertinent arrays.
Many thanks to my Equinor collaborators.
This commit adds new helper classes,
Opm::RestartIO::Helpers::CharArrayNullTerm<NChar>
Opm::RestartIO::Helpers::WindowedArray<T>
Opm::RestartIO::Helpers::WindowedMatrix<T>
the first of which represents a nul-terminated character string of
'NChar' user data (total array size is NChar + 1). Mainly intended
for representing Fortran-compatible characters arrays--especially
for ZWEL and similar restart vectors (e.g., ZGRP).
The second two simplify working with subsets of large linear arrays,
particularly those that represent N items per well, group, or
segment. The WindowedArray is a linear array of windows (N items
per window) packed into a std::vector<T> and the WindowedMatrix
additionally imposes a Row-by-Colum structure which is useful for
the case of N windows (each of size K) for each of M entities (e.g.,
K items for each of N connections for each of M wells).
While here, also add check for all (current) unit conversion
constants for METRIC, FIELD, and LAB unit conventions and extend the
existing PVT-M checks to cover effective Kh too.
Needed for restart output (especially, SCON), and also useful for
computing the connection transmissibility factor (WI) in some cases
if not supplied in COMPDAT.
That is the way it is done in other modules, too. We need this
at least for libecl as this target is used in opm-common_LIBRARIES
and not defined if there was no find_package(ecl) call. That call
is now made during execution of find_package_deps(opm-common).