Compare commits

...

2374 Commits

Author SHA1 Message Date
Markus Blatt
90d18f7d1a Changed version in dune.module to 2022.04 2022-05-12 11:39:24 +02:00
Markus Blatt
8f13f559f8 Merge pull request #3025 from blattms/backport-of-pr-3023
[backport] Do not hard-code shared-libs in package configuration if not needed.
2022-05-06 14:36:53 +02:00
Markus Blatt
e66fd64dba Do not hard-code shared-libs in package configuration if not needed.
We usually list all libraries that might be needed for linking in the
CMake package configuration files. This is needed when building static
libraries as we do not yet use CMake targets (which would allow to
list them differently). As we are doing this unconditionally and
also including the ones listed in modules that we depend on, changing
a library (e.g. moving from Python 3.9 to 3.10) requires a complete
rebuild of all modules to get rid of the stale dependency on
libpython3.9.

At least when building shared libraries listing the dependencies is
not needed and this patch simply removes all shared libraries form the
list in the CMake package configuration file. Thus we only need to
recompile the modules that have direct dependency on a stale library.
2022-05-06 14:33:28 +02:00
Markus Blatt
388c852c27 Merge pull request #3017 from blattms/backport-of-pr-3015
[backport] Install python bindings as default.
2022-05-02 12:47:39 +02:00
Markus Blatt
c7d50318e7 Install python bindings as default.
This is for consistency with opm-simulators, which (always)
installs them if they are built.

Closes #2976
2022-05-02 12:39:40 +02:00
Markus Blatt
23ad6d7383 Merge pull request #3013 from blattms/backport-of-pr-3012
[backport] Make not finding Quadmath non-fatal (e.g. not available on arm64)
2022-04-29 11:51:54 +02:00
Markus Blatt
c8e5935a19 Make not finding Quadmath non-fatal (e.g. not available on arm64)
Quadmath is usually unused except when a dependency uses it and
explicitly puts QuadMath::QuadMath into their CMake package
configuration file.

On most platforms the compiler has Quadmath available by
default. But on those that don't we should not stop CMake and fail.
Hence now we only print a message that Quadmath is not available.
2022-04-29 11:21:40 +02:00
Markus Blatt
28f9f86c65 Merge pull request #3011 from blattms/backport-of-pr-3006
[backport] Added default values for I, J, K1 and K2
2022-04-28 12:27:27 +02:00
Øyvind Lind-Johansen
783e6f6555 Added default values for I, J, K1 and K2 2022-04-28 12:23:33 +02:00
Markus Blatt
536641d5d7 Merge pull request #3010 from blattms/backport-of-pr-3007
[backport] fixed: avoid direct floating point comparisons in tests
2022-04-28 12:23:00 +02:00
Markus Blatt
1f40b8cdaa Merge pull request #3009 from blattms/backport-of-pr-3008
Spelling fixes (valied -> valid).
2022-04-28 12:21:12 +02:00
Markus Blatt
573609832d Spelling fixes (valied -> valid). 2022-04-28 12:19:05 +02:00
Arne Morten Kvarving
7945f45c5e fixed: avoid direct floating point comparisons in tests
we want to compare with an epsilon since these have gone
through calculations
2022-04-28 12:17:19 +02:00
Markus Blatt
dc207254ae Bump version to 2022.04-rc1 2022-04-26 20:02:39 +02:00
Markus Blatt
2721fe62bd Merge pull request #3001 from blattms/backport-of-pr-2997
[backport] Cleanup, update and improve man pages for 2022.04
2022-04-21 11:31:56 +02:00
Markus Blatt
4637126794 Cleanup, update and improve man pages for 2022.04 2022-04-21 11:29:25 +02:00
Markus Blatt
80e9abdd69 Merge pull request #3000 from blattms/backport-of-pr-2998
[backport] added: ability to use jenkins build scripts for release test building
2022-04-21 11:25:46 +02:00
Arne Morten Kvarving
c5a01d7d84 added: ability to use jenkins build scripts for release test building
we need to be able to specify absolute refs to use for the repos
rather than a pull request number.
2022-04-21 11:24:37 +02:00
Markus Blatt
a965a18320 Merge pull request #2996 from blattms/backport-of-pr-2995
[backport] Use dune buildsystem defaults
2022-04-20 20:24:45 +02:00
Markus Blatt
a561e68b41 Require UMFPack
A direct coarse solver of AMG is needed for good convergence and umfpack
was tested to work better than SuperLU previously. Hence we now require it.
2022-04-20 19:53:13 +02:00
Markus Blatt
a44c0ad80b Always build with MPI and search for SuperLU and Quadmath.
Concerning MPI, both DUNE and OPM must be compiled with the
same default. For DUNE that is to used MPI if it is found.
With the previous default Cmake in opm-grid would fail for
DUNE 2.8

Even if SuperLU is found umfpack will be used as the coarse
solver for AMG. But if dune-fem is used  that will need SuperL
if it is on the system otherwise linking will fail for DUNE 2.8

Quadmath is used by dune-fem if it is found and linking of flow
will fail in this case for DUNE 2.8 if we did not search for it.
2022-04-20 19:53:13 +02:00
Markus Blatt
35835efbbe Merge pull request #2987 from akva2/update_redhat_python_versioned_packages
update redhat packaging
2022-04-10 10:57:22 +02:00
Bård Skaflestad
61090f078e Merge pull request #2988 from totto82/wvfpexp
add support for wvfpexp in the input layer
2022-04-07 11:39:24 +02:00
Tor Harald Sandve
f91b9b7c31 add support for wvfpexp in the input layer 2022-04-07 09:38:03 +02:00
Markus Blatt
6111526c93 Merge pull request #2986 from bska/block-level-solvent-sat-smry
Support Block Level Solvent Saturation Summary Output
2022-04-06 12:12:09 +02:00
Bård Skaflestad
3e1031b1d5 Support Block Level Solvent Saturation Summary Output
This commit recognises the summary vector "BNSAT" as a supported
keyword.  This, in turn, enables retrieving the simulator's solvent
saturation values at the block level as a time series.
2022-04-05 15:45:30 +02:00
Markus Blatt
9d5167ab4e Merge pull request #2980 from blattms/binary-package-versio-no-build-time
Incude binary package version in project-version.h and skip timestamp
2022-04-05 14:54:36 +02:00
Arne Morten Kvarving
9c260d6c9a update redhat packaging
- add parameter for which toolset to use
- build against openmpi3
- build with python support
- add boolean flags for the different mpi builds (mostly for testing)
- add parameter for appending extra token to package names.
  this can be used for allowing multiple versions to be installed on the
  same system.
2022-04-05 11:43:43 +02:00
Markus Blatt
ebca866e31 Merge pull request #2984 from akva2/fix_rst_deck_test
fixed: use PROJECT_BINARY_DIR, not CMAKE_BINARY_DIR
2022-04-01 16:40:16 +02:00
Arne Morten Kvarving
1f335a1d54 fixed: use PROJECT_BINARY_DIR, not CMAKE_BINARY_DIR
when using as super-build these differ
2022-04-01 11:58:13 +02:00
Markus Blatt
fce5764dd4 Merge pull request #2982 from akva2/remove_debian_package
remove in-tree debian (ubuntu) packaging
2022-03-31 19:50:09 +02:00
Arne Morten Kvarving
525875f16a remove in-tree debian (ubuntu) packaging
ubuntu packages will be built using the debian packaging
in the future
2022-03-31 15:39:30 +02:00
Markus Blatt
99f2c4d6ab Merge pull request #2974 from bska/disallow-wells-parented-to-field
Disallow Wells Parented Directly to FIELD
2022-03-30 13:09:30 +02:00
Bård Skaflestad
c82286f7d8 Disallow Wells Parented Directly to FIELD
The commercial simulator does not support parenting a well directly
to the FIELD group and Flow in multiple locations implicitly assumes
that no well is parented directly to FIELD either.

With this commit we detect this situation at the parser stage and
stop reading the input file.  In this case, we issue a diagnostic
message of the form

    Error: Problem with keyword WELSPECS
    In SPE1CASE1.DATA line 384
    Wells cannot be parented directly to 'FIELD'.
    Wells entered with disallowed 'FIELD' parent group:
     * PROD
     * INJ

    Error: Unrecoverable errors were encountered while loading input
2022-03-28 21:59:32 +02:00
Bård Skaflestad
74d7effe3f Merge pull request #2975 from bska/restart-compat
Address Compatibility Issues in XWEL and ZUDL
2022-03-24 17:29:19 +01:00
Bård Skaflestad
920382179e Always Output All Well Flow Rates to XWEL
Additionally, items 36..38 appear to be copies of items 1..3, so
preserve this behaviour for increased compatibility.
2022-03-24 16:10:21 +01:00
Bård Skaflestad
d08b7292bf Use Uppercase Exponents in UDQDefine::input_string
Needed for compatibility reasons.
2022-03-24 16:10:21 +01:00
Bård Skaflestad
a0d9a04470 UDQ Tests: Make Utility Functions Private
Mostly to avoid diagnostics of the form "no previous declaration
for...".  While here, also sort includes
2022-03-24 16:10:21 +01:00
Markus Blatt
a162915f77 Merge pull request #2979 from bska/detect-invalid-cpdata
Add Means of Detecting Valid Cell Geometries
2022-03-24 16:05:20 +01:00
Bård Skaflestad
6f29e74692 Add Means of Detecting Valid Cell Geometries
We define a valid cell geometry as one in which all components of
all eight corner vertices of a cell have finite coordinate values
(absolute value less than 1.0E+20) and at least one pair of pillar
vertices are separated by a positive distance.
2022-03-24 11:13:32 +01:00
Markus Blatt
0cdfeae0e5 Added CMake variable to prevent timestamps in flow binary packages.
One can now set the variable OPM_BINARY_PACKAGE_VERSION to a
meaningful version string (Debian 11.2: 2021.10-4). When building
outside of git it will be used as the project hash. If the variable is
non-empty there will also be no timestamp in project-timestamp.hh (as
this would break reproducible builds).

Note that if building from git or not setting the variable then everything
will be like before.
2022-03-23 22:53:43 +01:00
Markus Blatt
283d7b3dce Do not try to get git hashes for version if built from tarballs. 2022-03-23 22:37:31 +01:00
Markus Blatt
dff978d0eb Merge pull request #2978 from blattms/debian-use-dist-packages-only-for-usr-prefix
[python] Use dist-packages if it is used for Python's sitepackages
2022-03-22 16:42:17 +01:00
Markus Blatt
cd3a6b2ddf Make determining whether to use site-packages more bullet-proof
Seems like sometimes getsitepackages might not even be implemented.
2022-03-22 12:00:55 +01:00
Markus Blatt
bcf1ba0ba9 [python] Use dist-packages if is used for Python's sitepackages
Instead of checking whether this is Debian system we query the
sitepackages path from Python. If it matches dist-packages then
we use dist-packages if we install below /usr, otherwise site-packages
is used.
2022-03-22 11:45:02 +01:00
Bård Skaflestad
06ff1db977 Merge pull request #2977 from blattms/fail-without-setuptools
[cmake] Send error for OPM_ENABLE_PYTHON=ON without setuptools
2022-03-15 13:29:12 +01:00
Markus Blatt
af052ef3ba [cmake] Send error for OPM_ENABLE_PYTHON=ON without setuptools
Compiling will fail at a very late stage and might cause surprises
for novice users. It seems much better to issue an error in CMake with
a meaningful error message. Might prevent some support issues in the
future.
2022-03-15 13:00:24 +01:00
Bård Skaflestad
2da0f48da2 Merge pull request #2973 from GitPaean/no_aquifer_connection
throw when there is no connection for analytical aquifer
2022-03-11 10:18:55 +01:00
Bård Skaflestad
94635c03d3 Merge pull request #2968 from plgbrts/vapwat
Introducing water-gas ratio RVW keyword
2022-03-10 16:19:01 +01:00
Kai Bao
facb210275 throw when there is no connection for analytical aquifer 2022-03-10 15:08:40 +01:00
Joakim Hove
e2493d22fc Merge pull request #2971 from joakim-hove/alq-undef
Convert default ALQ type to GRAT when gaslift optimization is active
2022-03-09 10:15:30 +01:00
Joakim Hove
660b878b8e Convert default ALQ type to GRAT when gaslift optimization is active 2022-03-08 11:37:06 +01:00
Arne Morten Kvarving
e7599f6825 Merge pull request #2970 from akva2/pypi310
add python 3.10 to pypi builds
2022-03-07 14:01:11 +01:00
Arne Morten Kvarving
302e7e7d41 add python 3.10 to pypi builds 2022-03-07 13:58:12 +01:00
Paul Egberts
eb396ecc53 water-gas ratio keyword RVW 2022-03-01 15:41:53 +01:00
Paul Egberts
e4949820ab water-gas ratio keyword RVW 2022-03-01 15:41:52 +01:00
Atgeirr Flø Rasmussen
617e34fbbb Merge pull request #2967 from bska/smry-phase-press-smry
Recognize Block Level Water and Gas Pressure Summary Vectors
2022-03-01 09:42:39 +01:00
Bård Skaflestad
20de64e739 Recognize Block Level Water and Gas Pressure Summary Vectors
This commit adds support for the BWPR and BGPR summary vectors that
output block-level phase pressures for water (BWPR) and gas (BGPR)
to the summary file.
2022-02-28 23:03:26 +01:00
Markus Blatt
3e37b8abe8 Merge pull request #2965 from bska/dont-needlessly-capture-constant
Don't Needlessly Capture Constant Buffer Size
2022-02-24 12:35:39 +01:00
Bård Skaflestad
982ed7caf0 Don't Needlessly Capture Constant Buffer Size
A lambda expression can read the value of a variable without
capturing it if the variable

    has const non-volatile integral or enumeration type and
    has been initialized with a constant expression

Clang issues a diagnostic if such variables are captured so drop the
'sz' from the explicit list of captures.
2022-02-24 09:58:51 +01:00
Bård Skaflestad
a85ec1a7e6 Merge pull request #2964 from atgeirr/fix-missing-include
Add missing <string> include for std::to_string().
2022-02-24 09:51:28 +01:00
Atgeirr Flø Rasmussen
84644fe5cd Add missing <string> include for std::to_string(). 2022-02-24 09:32:17 +01:00
Markus Blatt
555eb4c8b0 Merge pull request #2963 from joakim-hove/get_str_allow_rawstring
Export RawString as std::string to Python
2022-02-23 13:47:28 +01:00
Markus Blatt
9ef9cb0245 Merge pull request #2958 from bska/create-iregflow-summary
Add Summary Evaluation Functions For Inter-Region Flows
2022-02-23 13:41:49 +01:00
Bård Skaflestad
369b6ee637 Add Summary Evaluation Functions For Inter-Region Flows
This commit adds the glue code necessary to extract the pertinent
flow rate values from an inter-region flow rate map and then
accumulating those into the SummaryState.  We multiply with the
timestep size if we're computing a cumulative total volume.

Add basic unit test for this part of Summary::eval().
2022-02-23 11:57:34 +01:00
Joakim Hove
42e36100a8 Export RawString as std::string to Python 2022-02-23 11:01:00 +01:00
Markus Blatt
0475a46ab3 Merge pull request #2961 from bska/fix-welopen-status-event
Update Injected/Produced Flag When Processing WELOPEN
2022-02-22 12:37:01 +01:00
Bård Skaflestad
4150936e7c Update Injected/Produced Flag When Processing WELOPEN
If a well is entered in WCON{INJE,PROD} as status 'SHUT' but later
activated in WELOPEN, we must take care to record this status change
in the well's internal "has_produced" or "has_injected" flags as
appropriate.  Otherwise, the counts of "abandoned" wells will not be
correct.
2022-02-21 22:20:20 +01:00
Bård Skaflestad
0275a00b0f Fix Misspelled Function Name 2022-02-21 22:20:20 +01:00
Bård Skaflestad
31cddd2d86 Merge pull request #2962 from goncalvesmachadoc/btemp
add BTCNFHEA
2022-02-21 22:18:11 +01:00
goncalvesmachadoc
187149dc1a add BTCNFHEA 2022-02-21 17:35:04 +01:00
Markus Blatt
e44f3c6798 Merge pull request #2945 from bska/iregflow-protocol-objects
Add Protocol Objects for Linearising and Accumulating Inter-Region Flows
2022-02-17 09:36:34 +01:00
Bård Skaflestad
819571a8db Make Summary Evaluation API Aware of Inter-Region Flows
This commit adds a new parameter, interreg_flows, to the eval()
member function of class Opm::Summary.  This is in preparation of
adding summary file output of inter-region flow rates and
cumulatives-e.g., the ROFT summary vectors.
2022-02-16 23:28:46 +01:00
Bård Skaflestad
68975be966 Add Accumulating Mapping Structure for Inter-Region Flows
This commit introduces a new helper facility,

    data::InterRegFlowMap

that knows how to interpret region IDs.  It is a simple wrapper
around a common CSR representation of (source, destination) region
ID pairs with the additional feature that the element type of the
connection is a linear sequence values of arithmetic type.  We've
initially elected to make this sequence out of 'float' in order to
conserve memory since we expect to do little arithmetic to the
sequence itself outside of compression and parallel communication.

Client code will be of two primary categories

  1. Producing side which inserts flow rates from individual
     connections, compresses the result when done, and communicates
     the results to one or more parallel I/O ranks

  2. Consuming side, typically on an I/O rank, which merges the
     contributions from multiple source ranks and extracts values
     pertaining inter-region flows for purpose of outputting time
     series data to a summary file.

The first case will create and populate 'FlowRates' and add these
into the container using the 'addConnection' function and finally
call 'compress' when complete.  Consumers will then use member
function 'getInterRegFlows' to extract a signed view of flow rate
values associated to a particular region ID pair (nullopt if no such
pair is registered).
2022-02-16 23:28:46 +01:00
Bård Skaflestad
7ef3d6c0b3 Add Protocol to Linearise Connection Flow Rates Into Subrange
This commit introduces a wrapper for a linear subrange of
consecutive elements of an arithmetic type that imposes an ordering
of the elements when treated as directional component surface flow
rates.  The wrapper distinguishes negative from positive flow rate
contributions and tracks those separately.  This is a building block
for accounting for the inter-region flows in a parallel context.
2022-02-16 23:28:46 +01:00
Bård Skaflestad
27da32d812 Re-Sort Main Source File Section for output/data
In preparation of adding more source files here.
2022-02-16 23:28:46 +01:00
Bård Skaflestad
e6bfc0624c Merge pull request #2960 from tskille/emsry_rxft_fix
Split summary number for RXFT vectors in ESMRY file
2022-02-16 21:19:16 +01:00
Torbjørn Skille
48cab1f3bf Split summary number for RXFT vectors in ESMRY file 2022-02-16 20:45:01 +01:00
Bård Skaflestad
f9ab536a66 Merge pull request #2959 from bska/improve-skiprest-diagnostic
Clarify Underlying Issue When Missing RESTART DATE in SKIPREST
2022-02-15 14:55:51 +01:00
Bård Skaflestad
ea5b2f072c Clarify Underlying Issue When Missing RESTART DATE in SKIPREST
When a restarted model uses SKIPREST, there must be DATES or TSTEP
records/report times that correspond exactly to the restart time.
The current diagnostic message is a little too brief and developer
centric and does not offer sufficient hints to the user as to what
the underlying issue might be.

Try to expand the current message and provide more clues to the user
by mentioning both the SKIPREST and RESTART keywords in addition to
the expected and encountered time points.

Example original message:
  Error: Problem with keyword DATES
  In PRED_FLOW.DATA line 223
  At date: 2019-04-18 - scanned past restart data: 2019-04-12

Example message in this commit:
  Error: Problem with keyword DATES
  In PRED_FLOW.DATA line 223
  In a restarted simulation using SKIPREST, the DATES keyword must have
  a record corresponding to the RESTART time 12-Apr-2019 00:00:00.
  Reached time 18-Apr-2019 00:00:00 without an intervening record.
2022-02-15 14:08:26 +01:00
Joakim Hove
46c955956f Merge pull request #2957 from tskille/deck_item_change
DeckItem - API change
2022-02-14 18:31:10 +01:00
Torbjørn Skille
5bf2087d0a DeckItem - API change 2022-02-14 15:48:52 +01:00
Markus Blatt
ab697b69ea Merge pull request #2916 from joakim-hove/udq-doc
Technical documentation for UDQ / ACTIONX and PYACTION
2022-02-14 15:17:20 +01:00
Joakim Hove
fb012786c3 Address final review comments in pyaction.tex and actionx.tex 2022-02-11 11:31:31 +01:00
Joakim Hove
a8656a9bbd Address final review comments in udq.tex 2022-02-10 07:55:04 +01:00
Joakim Hove
8c95c64e9b PYACTION polish II 2022-02-10 07:25:12 +01:00
Joakim Hove
b8cecd9ce4 Pyaction polish I 2022-02-10 07:25:12 +01:00
Joakim Hove
a62c3ae162 Actionx polish II 2022-02-10 07:25:12 +01:00
Joakim Hove
4e7bcd16b9 Actionx polish I 2022-02-10 07:25:12 +01:00
Joakim Hove
b20baa0c8e UDQ polish II 2022-02-10 07:25:12 +01:00
Joakim Hove
d89f92d52f Polish of UDQ chapter 2022-02-10 07:25:12 +01:00
Joakim Hove
148a54a7a6 Add section about problems with parallel and actionx 2022-02-10 07:25:12 +01:00
Joakim Hove
7d51e996d9 Update information about ACTIONX + WELPI 2022-02-10 07:25:12 +01:00
Joakim Hove
832b351bb3 Edit sentence about wrapping and embedding 2022-02-10 07:25:12 +01:00
Joakim Hove
de3e639196 More about PYACTION security 2022-02-10 07:25:12 +01:00
Joakim Hove
8370bf152a Written more about the ACTIONX + PYACTION interaction 2022-02-10 07:25:12 +01:00
Joakim Hove
b6731ba8c7 Add two \label{..} expressions 2022-02-10 07:25:12 +01:00
Joakim Hove
411682c466 Slightly rewritten paragraph about ACTIONX <-> simulator interaction 2022-02-10 07:25:12 +01:00
Joakim Hove
f869df0255 PYACTION updates 2022-02-10 07:25:12 +01:00
Joakim Hove
8a2c30c7ba More Python doc 2022-02-10 07:25:12 +01:00
Joakim Hove
53dd18a92c Start adding documentation for the PYACTION keyword 2022-02-10 07:25:12 +01:00
Joakim Hove
f61e573a19 Minor formatting 2022-02-10 07:25:12 +01:00
Joakim Hove
fafebfdc5d Fix will -> well 2022-02-10 07:25:12 +01:00
Joakim Hove
ff13b32da0 More about opm-common <-> opm-simulators interaction for Actionx 2022-02-10 07:25:12 +01:00
Joakim Hove
a403a31f16 Add ref to ref manual 2022-02-10 07:25:12 +01:00
Joakim Hove
627faea4e5 More ACTIONX doc work 2022-02-10 07:25:12 +01:00
Joakim Hove
7056c5f879 Changes to ACTIONX section 2022-02-10 07:25:12 +01:00
Joakim Hove
9e78155222 More on actionx execution model 2022-02-10 07:25:12 +01:00
Joakim Hove
b2e9790204 Actionx reformatting 2022-02-10 07:25:12 +01:00
Joakim Hove
8e94f2ec3b More ACTIONX documentation 2022-02-10 07:25:12 +01:00
Joakim Hove
bbd58ab2a3 More actionx doc 2022-02-10 07:25:12 +01:00
Joakim Hove
b04ea92a32 More work .... 2022-02-10 07:25:12 +01:00
Joakim Hove
6741b34ab0 Actionx documentation updates 2022-02-10 07:25:12 +01:00
Joakim Hove
9693d8a2bd Small updates in UDQ text 2022-02-10 07:25:12 +01:00
Joakim Hove
8a06db36c3 Add some details about forward referencing of wells (and groups) 2022-02-10 07:25:12 +01:00
Joakim Hove
8837e4cd38 Some more details about parallel 2022-02-10 07:25:12 +01:00
Joakim Hove
8d7d185976 Review comment 2022-02-10 07:25:12 +01:00
Joakim Hove
6d03ae8166 Started on section with parallel info for UDQ 2022-02-10 07:25:12 +01:00
Joakim Hove
3ca273c7d5 Rewrite section about forward referencing wells in actionx 2022-02-10 07:25:12 +01:00
Joakim Hove
82d748386c Remove superfluos 'from' 2022-02-10 07:25:12 +01:00
Joakim Hove
3731230049 Add UDQ and ACTIONX documentation for technical manual 2022-02-10 07:25:12 +01:00
Markus Blatt
3bd13c9e85 Merge pull request #2955 from bska/general-reg-iregflow
Recognize Non-Default FIP Arrays for Inter-Region Flow Summary Keywords
2022-02-09 16:23:42 +01:00
Bård Skaflestad
55a7d0af19 Retrieve FIP Arrays of Inter-Region Flows
This commit adds a new query

    SummaryConfig::fip_regions_interreg_flow

that retrieves the set of FIP array names (e.g., FIPNUM and FIPXYZ)
that are associated to any inter-region flow summary keywords.  This
query method returns an empty set if there are no inter-region flow
summary keywords.
2022-02-04 20:38:10 +01:00
Bård Skaflestad
0d6c43f431 Recognize Non-Default FIP Array for Inter-Region Flows
This commit extends the 'SummaryConfig' support for inter-region
flows to be aware of user-provided FIP arrays.  In other words, we
now recognize, e.g., that

    ROFT_XYZ

is the cumulative inter-region oil flow volume corresponding to
regions defined by the 'FIPXYZ' region definition.
2022-02-04 20:38:10 +01:00
Markus Blatt
9b53068e8b Merge pull request #2954 from blattms/python-use-correct-cxx-to-link
[python] Use correct C++ compiler for linking.
2022-02-04 15:59:21 +01:00
Markus Blatt
06618244e7 Use C++ everywhere and skip using a custom build_ext subclass.
Somehow using a custom build_ext subclass always triggered a failing
rebuild when testing:

/usr/lib/ccache/g++-10 -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -Wl,-z,relro -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-RNBry6/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.9/cxx/builtin_pybind11.o build/temp.linux-x86_64-3.9/cxx/connection.o build/temp.linux-x86_64-3.9/cxx/converters.o build/temp.linux-x86_64-3.9/cxx/deck.o build/temp.linux-x86_64-3.9/cxx/deck_keyword.o build/temp.linux-x86_64-3.9/cxx/eclipse_config.o build/temp.linux-x86_64-3.9/cxx/eclipse_grid.o build/temp.linux-x86_64-3.9/cxx/eclipse_io.o build/temp.linux-x86_64-3.9/cxx/eclipse_state.o build/temp.linux-x86_64-3.9/cxx/emodel_util.o build/temp.linux-x86_64-3.9/cxx/export.o build/temp.linux-x86_64-3.9/cxx/field_props.o build/temp.linux-x86_64-3.9/cxx/group.o build/temp.linux-x86_64-3.9/cxx/log.o build/temp.linux-x86_64-3.9/cxx/parsecontext.o build/temp.linux-x86_64-3.9/cxx/parser.o build/temp.linux-x86_64-3.9/cxx/schedule.o build/temp.linux-x86_64-3.9/cxx/summary_state.o build/temp.linux-x86_64-3.9/cxx/table_manager.o build/temp.linux-x86_64-3.9/cxx/unit_system.o build/temp.linux-x86_64-3.9/cxx/well.o -lopmcommon -lboost_system -lstdc++fs -o build/lib.linux-x86_64-3.9/opm/libopmcommon_python.cpython-39-x86_64-linux-gnu.so -fopenmp /usr/lib/x86_64-linux-gnu/libfmt.so.7.1.3
error: can't copy 'build/lib.linux-x86_64-3.9/opm/libopmcommon_python.cpython-39-x86_64-linux-gnu.so': doesn't exist or not a regular file

Therefore we resort to only setting the CC and CXX variables to the
C++ compiler. Note that one cannot use "ccache c++" for CXX.

With the default build_ext the problem vanishes.
2022-02-04 10:07:05 +01:00
Bård Skaflestad
7b3e6ea534 Merge pull request #2953 from totto82/nlinears
Add NLINEARS
2022-02-03 17:09:20 +01:00
Markus Blatt
b67091183b [python] Use correct C++ compiler for linking.
CC is the C compiler. CXX is the C++ compiler. Setuptools will
use the C++ compiler for C++ code. Hence it is vital to set that
correctly. If not set the default C++ compiler will be used.

Unfortunately it will use the first string as the CXX compiler and
hence we need to strip ccache. Fortunately it used CC for the
compilation and that works with gcc as well.
2022-02-03 17:02:09 +01:00
Tor Harald Sandve
646fa507f6 Add NLINEARS 2022-02-03 14:35:07 +01:00
Markus Blatt
94a095a2b6 Merge pull request #2931 from plgbrts/expli-salt
allow for explicit initial condition for SALT and SALTP
2022-02-03 11:19:02 +01:00
Markus Blatt
c5691477e5 Merge pull request #2948 from blattms/fix-setup.py-mult-lib
[bugfix] Make opm-common_PYTHON_LINKAGE a comma separated list.
2022-02-02 09:44:34 +01:00
Markus Blatt
64bd13231d Merge pull request #2949 from blattms/fix-no-python-but-embedded
[cmake][bugfix] Test python/embedded python flags before source_hook.
2022-02-02 09:43:46 +01:00
Bård Skaflestad
7b9fa31894 Merge pull request #2951 from joakim-hove/empty-actionx
Empty actionx
2022-01-31 15:40:32 +01:00
Joakim Hove
d55f5fa5f5 Allow ACTIONX with empty condition
Allow ACTIONX keywords with empty conditions, these ACTIONX keywords will always
evaluate to false. Main motivation is to facilitate dummy keywords for PYACTION.
2022-01-31 15:10:40 +01:00
Joakim Hove
23f02023a3 Add method Action::ASTNode::empty() 2022-01-31 11:39:52 +01:00
Joakim Hove
0b27fd8e18 Remove unused function 2022-01-31 10:18:00 +01:00
Bård Skaflestad
4be0eea139 Merge pull request #2950 from joakim-hove/pyaction-handle-return
Pyaction handle return
2022-01-28 12:25:17 +01:00
Joakim Hove
343f14dacf Record and act on return value from PYACTION 2022-01-28 12:05:17 +01:00
Joakim Hove
c37c2b2d49 Make SummaryState::set() available as __setitem__ in Python 2022-01-28 12:05:17 +01:00
Joakim Hove
c660b2e4b4 Make SummaryState public member in msim class 2022-01-28 12:05:17 +01:00
Joakim Hove
4928782cf4 Add Schedule member to the msim class 2022-01-28 12:05:17 +01:00
Markus Blatt
325e559229 [cmake][bugfix] Test python/embedded python flags before source_hook.
If cmake is run with `-DOPM_ENABLE_EMBEDDED_PYTHON=ON -DOPM_ENABLE_PYTHON=OFF`
a cmake error was produced because the library would depend on
python/cxx/builtin_pybind11.cpp which would not be generated.

We fix this by doing the Python sanity check (deactivate embedded
python if python is disabled) before running source_hook that adds the
dependency.

Closes #2940
2022-01-27 15:21:33 +01:00
Markus Blatt
ba2065853a Merge pull request #2943 from joakim-hove/setup-linker
Make sure env variable CC is set also if no ccache
2022-01-27 11:37:59 +01:00
Markus Blatt
1daa7d1df4 [bugfix] Make library list used for setup.py a comma separated list.
It is used verbatim in setup.py in the list that specifies the linker
flage. Hence it needs to comma separted instead of using a semicolon
as separator.

We also rename it to SETUP_PY_LINKAGE to indicate where it is used.

Closes #2947
2022-01-27 11:26:56 +01:00
Bård Skaflestad
7471cef938 Merge pull request #2944 from bska/chase-api-update-for-non-python
Update Signature for PyAction::run When !EMBEDDED_PYTHON
2022-01-26 21:12:44 +01:00
Bård Skaflestad
15abd2bd49 Update Signature for PyAction::run When !EMBEDDED_PYTHON
Otherwise, we get build errors of the form "no declaration matches"
2022-01-26 20:57:03 +01:00
Joakim Hove
07500d5f09 Set the CC environment variable also for non ccache situation 2022-01-26 12:20:43 +01:00
Joakim Hove
c0be54af92 Merge pull request #2939 from joakim-hove/pyaction-use-actionx
Pyaction use actionx
2022-01-26 08:29:27 +01:00
Joakim Hove
46b663218a Enable running normal ACTIONX keywords from PYACTION
The run() function invoked by PYACTION has got a new fifth argument which is a
callable the script should utilize to apply the keywords from an ACTIONX
keyword. The callable is implemented as C++ lambda which will run the
Schedule::iterateScheduleSection() method and make sure an updated
SimulatorUpdate variable can be passed back to the simulator.
2022-01-25 10:04:43 +01:00
Joakim Hove
4224e26321 Accept empty list of matching_wells when resolving '?' 2022-01-25 09:45:32 +01:00
Joakim Hove
45a6e4fb15 Add method Actions::has( action_name ) 2022-01-25 09:45:32 +01:00
Markus Blatt
5e5dd48cee Merge pull request #2942 from joakim-hove/use-cmake-cxx-compiler
Use C++ compiler from cmake in setup.py
2022-01-24 21:52:57 +01:00
Joakim Hove
c1905359d9 Merge pull request #2941 from bska/consistent-kw-repr
Fix Several Name Inconsistencies in JSON Keyword Representation
2022-01-24 16:58:35 +01:00
Bård Skaflestad
6bb8855afd Fix RADFIN Keyword Representation
Previous version was a copy of RADFIN4 representation.
2022-01-24 16:42:53 +01:00
Joakim Hove
b3faf8abf2 Use C++ compiler from cmake in setup.py 2022-01-24 16:05:25 +01:00
Bård Skaflestad
1603100f0d Remove Extraneous JSON Input Files
There are no such keywords as 'RSSSPEC' (three 'S'-es) or 'DFLOWR'.
2022-01-24 15:51:50 +01:00
Bård Skaflestad
6dcdcaf08c Fix Keyword Names
Should match the name of the generator JSON input file.
2022-01-24 15:51:50 +01:00
Joakim Hove
8a0e1b21b9 Merge pull request #2932 from joakim-hove/pyaction-applyaction
Pyaction applyaction
2022-01-24 08:20:14 +01:00
Joakim Hove
9a80c00828 Merge pull request #2933 from blattms/rename-workarea.cpp-to-workarea.hpp
Renames header tests/WorkArea.cpp to tests/WorkArea.hpp
2022-01-23 10:54:07 +01:00
Bård Skaflestad
7d9c1b1aaf Merge pull request #2938 from blattms/support-libfmt8
Cast enum classes to int when used in fmt::format.
2022-01-22 09:09:38 +01:00
Markus Blatt
034ea368b0 Cast enum classes to int when used in fmt::format.
This is needed for libfmt >= 8.1.0 as in that version the
cast to int was removed from inside the fmt::format call and an
assertion will fail:
```
In file included from /usr/include/fmt/format.h:48,
                 from /build/opm-common-2021.10/src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQSet.cpp:22:
/usr/include/fmt/core.h: In instantiation of 'constexpr fmt::v8::detail::value<Context> fmt::v8::detail::make_arg(T&&) [with bool IS_PACKED = true; Context = fmt::v8::basic_format_context<fmt::v8::appender, char>; fmt::v8::detail::type <anonymous> = fmt::v8::detail::type::custom_type; T = Opm::UDQVarType&; typename std::enable_if<IS_PACKED, int>::type <anonymous> = 0]':
/usr/include/fmt/core.h:1855:77:   required from 'constexpr fmt::v8::format_arg_store<Context, Args>::format_arg_store(T&& ...) [with T = {const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long unsigned int&, Opm::UDQVarType&, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long unsigned int&, Opm::UDQVarType&}; Context = fmt::v8::basic_format_context<fmt::v8::appender, char>; Args = {std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, long unsigned int, Opm::UDQVarType, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, long unsigned int, Opm::UDQVarType}]'
/usr/include/fmt/core.h:1872:38:   required from 'constexpr fmt::v8::format_arg_store<Context, typename std::remove_cv<typename std::remove_reference<Args>::type>::type ...> fmt::v8::make_format_args(Args&& ...) [with Context = fmt::v8::basic_format_context<fmt::v8::appender, char>; Args = {const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long unsigned int&, Opm::UDQVarType&, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long unsigned int&, Opm::UDQVarType&}]'
/usr/include/fmt/core.h:3119:44:   required from 'std::string fmt::v8::format(fmt::v8::format_string<T ...>, T&& ...) [with T = {const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long unsigned int, Opm::UDQVarType, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long unsigned int, Opm::UDQVarType}; std::string = std::__cxx11::basic_string<char>; fmt::v8::format_string<T ...> = fmt::v8::basic_format_string<char, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long unsigned int, Opm::UDQVarType, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long unsigned int, Opm::UDQVarType>]'
/build/opm-common-2021.10/src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQSet.cpp:523:27:   required from here
/usr/include/fmt/core.h:1728:7: error: static assertion failed: Cannot format an argument. To make type T formattable provide a formatter<T> specialization: https://fmt.dev/latest/api.html#udt
 1728 |       formattable,
      |       ^~~~~~~~~~~
/usr/include/fmt/core.h:1728:7: note: 'formattable' evaluates to false
```
2022-01-21 22:13:54 +01:00
Joakim Hove
1c3aa651f1 Merge pull request #2937 from blattms/udqenum-fix-spelling
Fixes spelling error in UDQEnums.cpp
2022-01-21 21:00:33 +01:00
Markus Blatt
ad023b57c1 Fixes spelling error in UDQEnums.cpp 2022-01-21 18:33:13 +01:00
Markus Blatt
1b76df42cb Merge pull request #2936 from bska/fix-keyword-name
Ensure That Keyword Name Matches Filename
2022-01-21 18:27:41 +01:00
Bård Skaflestad
36903d3e9d Ensure That Keyword Name Matches Filename
Otherwise, we get "missing keyword" errors at the parsing stage.
2022-01-21 15:08:02 +01:00
Bård Skaflestad
10bdd92b94 Merge pull request #2934 from bska/fix-uninitialized-member
Ensure Proper Initialisation of All TableManager Member
2022-01-21 15:06:05 +01:00
Bård Skaflestad
6f79a86e66 Ensure Proper Initialisation of All TableManager Member
Otherwise, the equality operators for a default-constructed
TableManager object, mostly used in unit tests, will depend on
uninitialised values.

Thanks to [at]akva2 for the initial clue to the underlying cause.
2022-01-21 13:13:10 +01:00
Markus Blatt
274cee38c7 Renames header tests/WorkArea.cpp to tests/WorkArea.hpp 2022-01-21 10:18:56 +01:00
Joakim Hove
49c10378bb Merge pull request #2929 from bska/internalise-interreg-smry-nodes
Make SummaryConfig Nodes for Inter-Region Flows
2022-01-20 17:17:20 +01:00
Bård Skaflestad
e1ec7fc828 Register Inter-Region Flow Cumulatives for SummaryState
Needed for correct accumulation in future work.
2022-01-20 09:57:15 +01:00
Bård Skaflestad
5a2876642e Make SummaryConfig Nodes for Inter-Region Flows
This commit adds new nodes pertaining to the inter-region flows to
the summary configuration keyword list.  We combine the pair of
region IDs into a single 'NUMS' value as part of creating the node.
We also split inter-region nodes into a "supported" and an
"unsupported" set, with the former containing the oil, gas, and
water keywords.

While here, also correct a misprint in a diagnostic message which I
noticed as part of developing the new feature.
2022-01-20 09:57:15 +01:00
Bård Skaflestad
4b2a37a39e Split Combined Vector ID Calculation Out to Helpers
This commit introduces new helper functions

    int EclIO::combineSummaryNumbers(int, int)
    tuple<int, int> EclIO::splitSummaryNumber(int)

that know about the relation

    combined = n1 + 32768*(n2 + 10)

This relation is typically used to combine one-based region IDs for
inter-region flows into a single 'NUMS' entry in the summary file.
2022-01-20 09:47:18 +01:00
Joakim Hove
34d71e0c2e Add Schedule::runPyAction() to be called from the simulator 2022-01-20 09:28:12 +01:00
Joakim Hove
9ce5ca2b21 Pass matching wells to Schedule::applyAction() 2022-01-20 08:22:21 +01:00
Joakim Hove
b62b5be44f Remove unused argument sim_time from Schedule::applyAction() 2022-01-20 08:12:10 +01:00
Joakim Hove
4a8f432b10 Merge pull request #2930 from goncalvesmachadoc/patch-5
Fix SALTVD unit
2022-01-20 08:01:20 +01:00
Paul Egberts
3ea67696e1 Changed unit string to Salinity 2022-01-18 11:29:16 +01:00
Paul Egberts
0e24dc78c4 allow for explicit initial condition for SALT and SALTP 2022-01-18 11:05:17 +01:00
Cintia Goncalves Machado
39fb33cd52 Fix SALTVD unit
According to eclipse/flow manuals, saltvd input should be lb/stb (Salinity in Units.hpp), not Density (lb/ft3).
2022-01-18 11:02:49 +01:00
Joakim Hove
c680443251 Merge pull request #2928 from bska/parse-interreg-sumkw
Recognize Additional Inter-Region Flow Summary Vector Keywords
2022-01-14 10:05:33 +01:00
Bård Skaflestad
2fe8b4c802 Recognize Additional Inter-Region Flow Summary Vector Keywords
This commit adds support for recognizing additional inter-region
flow rate/cumulatives at the parser level.  In particular, we now
have input support for the E300-compatible keyword strings

    R[OGW]F(R[-+]?|T[-+])

(e.g., ROFR, RGFT-, or RWFR+).  This, in turn, ensures that the
parsing process does not abruptly terminate when encountering such
summary keywords.  This is also a necessary step towards supporting
actually calculating those summary vectors, but we presently do not
support doing so.

Expand the minimum, input-reading only, corresponding unit test to
include the oil, gas, and water varieties of the new keyword strings.

While here, also properly classify the per-phase gas cumulatives

    RGFTG, RGFTL

as inter-region summary vectors.  These were inadvertently listed as
per-region vectors (i.e., in the REGION_PROBE instead of in the
REGION2REGION_PROBE).
2022-01-14 09:48:33 +01:00
Joakim Hove
1b96dd81d9 Merge pull request #2927 from OPMUSER/Fix-Duplicate-Keywords
Delete GRUPRIG from OPM Flow Keyword List
2022-01-12 19:00:48 +01:00
Bård Skaflestad
447db33942 Merge pull request #2924 from blattms/improve-readme
Slightly improve readme
2022-01-12 17:31:19 +01:00
Markus Blatt
14245c968a Add posix as requirement 2022-01-12 15:14:36 +01:00
OPMUSER
14e047aa7e Update keyword_list.cmake
Remove OPm Flow version of GRUPRIG from keyword_list.cmake
2022-01-12 18:32:12 +08:00
OPMUSER
0c3f2ac64d Delete GRUPRIG from OPM Flow Keyword List
GRUPRIG was both in the E100 and the OPM Flow keyword definitions. So delete the OPM Flow version. Need to run Jenkins, just in case
2022-01-12 18:04:58 +08:00
Joakim Hove
089b6bff42 Merge pull request #2926 from joakim-hove/rm-fnmatch
Remove stale #include <fnamatch.h>
2022-01-12 08:26:43 +01:00
Joakim Hove
ea5c847c41 Remove stale #include <fnamatch.h> 2022-01-12 07:42:34 +01:00
Joakim Hove
24e58e36aa Merge pull request #2925 from joakim-hove/fnmatch
Use std::regex to implement fnmatch()
2022-01-11 13:36:43 +01:00
Joakim Hove
c50eb01bb0 Implement fnmatch() in Opm::shmatch() with std::regex 2022-01-11 11:14:11 +01:00
Joakim Hove
e43d75aacc Merge pull request #2871 from bska/continuous-solution-cumulatives-on-restart
Save and Reload Free/Solution Gas/Oil Cumulatives in Restart
2022-01-11 10:38:40 +01:00
Bård Skaflestad
8a72cfce36 Save and Reload Free/Solution Gas/Oil Cumulatives in Restart
This commit ensures that the field, group, and well level cumulative
production curves of solution/free oil and gas are continuous in a
restarted simulation run.

Thanks to Torbjørn Skille for identifying the appropriate locations
in XGRP/XWEL for outputting these items.
2022-01-10 20:57:59 +01:00
Markus Blatt
c28afa48ee Merge pull request #2923 from blattms/fix-segfault-parallel-multflt
Fixes parallel segfault for MULTFLT
2022-01-10 20:49:53 +01:00
Markus Blatt
955906c411 Improve README
Make it clear what is in the repository. Might help people
finding it via search engines.
2022-01-10 16:08:49 +01:00
Markus Blatt
dd88fc45fd Fixes parallel segfault happening when geology is modified for t>0.
This is a quick fix.
The problem that occurs is the following. After loadbalancing the
FieldPropsManager only has a non-nullptr to the FieldProperties on
the process with rank=0. Therefore most of the calls to it will
segfault. This has not been problem before changeset
2921838895. We did not make any calls to e.g.
FieldProperties::apply_schedule_keywords during a simulation.
Now we do via  [eclproblem.hh#L1021-L1022](/OPM/opm-simulators/blob/3e4e62bc4f6f6f8a02eb2d2e4976dc2e2d956313/ebos/eclproblem.hh#L1021-L1022))
2022-01-10 15:38:17 +01:00
Joakim Hove
f9ba16d72e Merge pull request #2919 from totto82/fixMULTXYZ_aquifer
Add permeability multiplier for connection between reservoir and aquifer
2022-01-10 12:08:16 +01:00
Bård Skaflestad
20732329f4 Merge pull request #2920 from plgbrts/saltp
Corrected dimensions of SALTPVD
2022-01-07 14:37:21 +01:00
Tor Harald Sandve
dcf3c42a33 add perm multiplier aquifer 2022-01-07 10:58:48 +01:00
Markus Blatt
c37203d605 Merge pull request #2918 from bska/fix-solution-gas-summary-unit
Fix Unit of Measure for Dissolved Gas Flow Rates
2022-01-07 09:57:35 +01:00
Paul Egberts
0a000dae5a corrected dimensions 2022-01-06 21:38:38 +01:00
Bård Skaflestad
21e067beaa Fix Unit of Measure for Dissolved Gas Flow Rates
These quantities are reported in surface volume gas flow rate units.
2022-01-06 15:01:19 +01:00
Joakim Hove
f0b91be7c3 Merge pull request #2884 from bska/dont-access-empty-optional
Don't Access an Empty Optional Object
2022-01-06 14:49:03 +01:00
Bård Skaflestad
56539e0453 Don't Access an Empty Optional Object
The maximum supply of lift gas and/or the maximum total gas flow
rate of a group may be defaulted in the context of lift gas
optimisation.  In that case, the std::optional<> objects will be
empty and we must not access the contained object through the
value() member function.  We output the sentinel value "-10" in this
case.
2022-01-06 12:34:10 +01:00
Bård Skaflestad
07d69bc1f7 Merge pull request #2910 from bska/use-named-equil-items
Switch to Using Named Items For Extracting EQUIL Keyword Data
2022-01-06 12:33:21 +01:00
Bård Skaflestad
f1fd4726e3 Switch to Using Named Items For Extracting EQUIL Keyword Data
This is more self-documenting that numeric item indices.  While
here, also switch to constructing the EQUIL record in place instead
of forming a temporary and moving it into the vector.
2022-01-03 14:58:09 +01:00
Joakim Hove
aa77a9c6e9 Merge pull request #2903 from joakim-hove/repo-reorg
Suggestion: repo reorg
2022-01-03 10:36:48 +01:00
Joakim Hove
0a59bd8f61 Filesystem rename EclipseState/Schedule/ Schedule/ 2022-01-02 14:32:14 +01:00
Joakim Hove
aede532b9a Filesystem rename parser/eclipse/ input/eclipse 2022-01-02 14:32:14 +01:00
Bård Skaflestad
722a375f1c Merge pull request #2915 from tskille/esmry_fix
ESmry - Ignore empty keys
2021-12-29 00:54:54 +01:00
Torbjørn Skille
3e69167bf9 ignore empty keys 2021-12-28 20:39:45 +01:00
Bård Skaflestad
5cdb5c7a6e Merge pull request #2912 from tskille/blacklisted
update list of blacklisted keywords
2021-12-22 00:53:40 +01:00
Atgeirr Flø Rasmussen
3682e4b67a Merge pull request #2914 from atgeirr/fix-for-posix-getopt
Fix driver, as POSIX or BSD getopt() stops on first non-option argument.
2021-12-21 21:46:57 +01:00
Atgeirr Flø Rasmussen
a8665b77d9 Fix driver, as POSIX or BSD getopt() stops on first non-option argument. 2021-12-21 18:40:38 +01:00
Torbjørn Skille
9255a7831c update list of blacklisted keywords 2021-12-21 10:47:12 +01:00
Markus Blatt
fae1278d82 Merge pull request #2911 from tskille/fix_x_option
fixing -x option for compareECL program
2021-12-21 10:22:02 +01:00
Torbjørn Skille
d94b809814 fixing -x option for compareECL program 2021-12-21 09:24:33 +01:00
Joakim Hove
435e7cf146 Merge pull request #2888 from joakim-hove/gconinje-rst
Gconinje rst
2021-12-20 10:11:28 +01:00
Jostein Alvestad
0478b91f24 Added correction to IGRP[nwgmax+5] for group control from FIELD level 2021-12-20 09:19:49 +01:00
Joakim Hove
9c54e324e9 Load injection guide rates from restart file 2021-12-20 09:19:49 +01:00
Joakim Hove
6d5ea77bf5 Rename rst::group.guide_rate_def 2021-12-20 09:19:49 +01:00
Joakim Hove
ad420a2b02 Save guiderate injection settings for group injection 2021-12-20 09:19:49 +01:00
Joakim Hove
a945a6fe9b Merge pull request #2907 from joakim-hove/welsegs-delayed-name
Handle ACTIONX delayed WELSPECS for keywords WELSEGS and COMPSEGS
2021-12-19 13:52:19 +01:00
Joakim Hove
1121f03fe6 Merge pull request #2906 from OPMUSER/Actionx-WTMULT
Update ActionX.cpp with WTMULT
2021-12-19 13:51:23 +01:00
Joakim Hove
48fa6ecf3a Merge pull request #2909 from bska/dont-emit-partial-rft-record
Don't Write RFT Records for Wells With No Connections
2021-12-19 12:13:44 +01:00
Joakim Hove
d867d63b78 Merge pull request #2908 from bska/dont-access-missing-refdepth
Don't Access Well BHP Reference Depth If Unavailable
2021-12-19 12:13:29 +01:00
Bård Skaflestad
17bcea4954 Don't Write RFT Records for Wells With No Connections
These render Flow's RFT files much more difficult to open in
post-processing software such as ResInsight.
2021-12-17 16:09:40 +01:00
Bård Skaflestad
cafa759b3d Don't Access Well BHP Reference Depth If Unavailable
This commit ensures that we do not access the well's BHP reference
depth unless that value is well defined.  If the input deck does not
define an explicit BHP reference depth (WELSPECS(5)), and if the
well does not have any active reservoir connections, then we are
supposed to output the usual sentinel value (-1.0E+20) as the datum
depth in 'SWEL'.

Account for this altered semantics in the restart reader too.
2021-12-17 15:20:40 +01:00
Bård Skaflestad
8306b7039f Extract Existence Predicate for Well BHP Reference Depth
This commit adds a new member function,

    bool Well::hasRefDepth() const

that allows the caller to query whether or not a particular well has
an active value for the well BHP reference depth.  The most common
cause of this value being missing is that the depth item of WELSPECS
is defaulted while the well is not connected to any active cells.

This predicate allows client code, e.g., the restart output module,
to safely access reference depth values in the case of potentially
missing reference depths.
2021-12-17 12:45:55 +01:00
Joakim Hove
b5e3137949 Handle ACTIONX delayed WELSPECS for keywords WELSEGS and COMPSEGS 2021-12-17 11:10:12 +01:00
Bård Skaflestad
25ea975171 Adjust Whitespace in Well::operator==(const Well&)
In preparation of making the comparator aware that reference depths
might not always be awailable.
2021-12-17 10:41:27 +01:00
OPMUSER
231066ea22 Update ActionX.cpp 2021-12-17 10:50:38 +08:00
Joakim Hove
0abdac2db6 Merge pull request #2895 from joakim-hove/actionx-welspecs
Actionx welspecs
2021-12-16 10:29:38 +01:00
Joakim Hove
aeb4c2bd8a Merge pull request #2905 from OPMUSER/Actionx-NEXT
Update ActionX.cpp with NEXT
2021-12-15 14:25:18 +01:00
OPMUSER
41e2703222 Update ActionX.cpp 2021-12-15 16:36:11 +08:00
Atgeirr Flø Rasmussen
48fdc4fafd Merge pull request #2896 from atgeirr/add-missing-include-and-copyright
Add missing include, and copyright header.
2021-12-14 12:53:16 +01:00
Joakim Hove
9bb9a6e2c8 Merge pull request #2904 from OPMUSER/Actionx-Typo-Fix
Update ActionX.cpp for Typo
2021-12-14 12:28:09 +01:00
OPMUSER
5fa54a99c8 Update ActionX.cpp 2021-12-14 18:10:28 +08:00
Joakim Hove
a507a3d9c4 Merge pull request #2902 from joakim-hove/nextstep-alias
Handle NEXT as an alias for NEXTSTEP
2021-12-14 08:14:33 +01:00
Joakim Hove
f3578ae716 Update NEXTSTEP 2021-12-14 08:03:59 +01:00
Joakim Hove
43f9e6bcf1 Handle NEXT as an alias for NEXTSTEP 2021-12-14 07:46:37 +01:00
Joakim Hove
e4be1e83b0 Log well and group names encountered in ACTIONX 2021-12-13 18:33:14 +01:00
Joakim Hove
aabc3b999b Utility class Action::WGNames to manage names introduced in ACTIONX 2021-12-13 18:33:14 +01:00
Joakim Hove
fb1e9d5d7a Merge pull request #2900 from joakim-hove/handlercontext-refactor
Refactor Schedule handlerContext usage
2021-12-13 18:18:00 +01:00
Joakim Hove
e4a0eb7972 Refactor Schedule handlerContext usage 2021-12-13 13:50:33 +01:00
Joakim Hove
927f68bfc5 Merge pull request #2898 from joakim-hove/missing-actionx-cmp
Add missing ACTION comparison in ScheduleState
2021-12-13 13:50:11 +01:00
Joakim Hove
c7ffbf51a0 Merge pull request #2894 from joakim-hove/actionx-error-msg
Improve error message for unsupported ACTIONX keyword
2021-12-13 13:49:48 +01:00
Joakim Hove
73abb5ae58 Merge pull request #2901 from fgfuchs/missing_include_algorithm
added #include <algorithm>
2021-12-13 13:04:25 +01:00
Franz Fuchs
b509056474 added include algorithm, as it did not compile with GNU compiler versoin 11.1. 2021-12-13 12:08:13 +01:00
Joakim Hove
8345620813 Add missing ACTION comparison in ScheduleState 2021-12-13 10:47:32 +01:00
Atgeirr Flø Rasmussen
1a0c81fbd4 Add missing include, and copyright header. 2021-12-13 09:40:50 +01:00
Tor Harald Sandve
e2b0ad581c Merge pull request #1956 from goncalvesmachadoc/watvap
Finalize VAPWAT keyword
2021-12-09 15:37:04 +01:00
Joakim Hove
221812d4d7 Merge pull request #2892 from OPMUSER/NEXTSTEP
Update ActionX.cpp with NEXTSTEP
2021-12-09 15:04:09 +01:00
Joakim Hove
30766c65dd Improve error message for unsupported ACTIONX keyword 2021-12-09 11:23:16 +01:00
OPMUSER
f5e449d1e6 Add WELTARG 2021-12-09 18:17:25 +08:00
OPMUSER
8b46e3e711 Update ActionX.cpp with NEXTSTEP 2021-12-09 16:34:50 +08:00
Joakim Hove
91c6a3f20a Merge pull request #2887 from joakim-hove/prefetch-compsegs
Prefetch compsegs
2021-12-09 07:21:51 +01:00
goncalvesmachadoc
805686dad2 clean test 2021-12-08 17:43:21 +01:00
Bård Skaflestad
84bf899380 Merge pull request #2593 from plgbrts/salt_prec
salt solubility table allowing specification of solubility per region
2021-12-08 15:52:18 +01:00
Joakim Hove
35ba2a330f Merge pull request #2890 from bska/no-execute-perm
Remove 'Execute' Permission From Source Files
2021-12-08 15:33:44 +01:00
Bård Skaflestad
64e8ec3cfd Remove 'Execute' Permission From Source Files
These files just need to have read/write permissions on Linux/Unix.
2021-12-08 15:09:23 +01:00
Joakim Hove
5cd2a2ddb0 Merge pull request #2885 from OPMUSER/WSEGVALV
Add COMPSEGS, WELSEGS and WSEGVALV to ACTIONX
2021-12-08 14:54:48 +01:00
Joakim Hove
8a74a00c5b Merge pull request #2889 from joakim-hove/remove-test
Remove parse test - deck has been removed from opm-tests
2021-12-08 14:35:27 +01:00
Joakim Hove
2688aeb5c7 Remove parse test - deck has been removed from opm-tests 2021-12-08 14:03:59 +01:00
Joakim Hove
e7a91cbe32 Special case first record in COMPSEGS keyword 2021-12-08 12:41:47 +01:00
Joakim Hove
52e72a3022 Use keyword.is<> for COMPSEGS 2021-12-08 12:31:32 +01:00
OPMUSER
cc28d81886 Add COMPSEGS, WELSEGS and WSEGVALV to ACTIONX 2021-12-08 17:11:49 +08:00
Paul Egberts
48124f12f4 added test for solubility table for 2 regions 2021-12-06 21:43:42 +01:00
Bård Skaflestad
23de8a630b Merge pull request #2883 from tskille/smry_updates
updates of ESmry and ExtESmry
2021-12-06 10:56:49 +01:00
Bård Skaflestad
6452e645dc Merge pull request #2882 from tskille/array_list
add program arraylist
2021-12-06 10:54:47 +01:00
Torbjørn Skille
5306fb1db8 updates of ESmry and ExtESmry
* add function for returning root name
 * add function for returning io (opening and loading)
 * rename member function LoadData() to loadData()
2021-12-04 09:59:58 +01:00
Torbjørn Skille
ed6bb4161d add program arraylist 2021-12-04 08:41:16 +01:00
Joakim Hove
2851c1d4e2 Merge pull request #2881 from joakim-hove/WELTARG-LIFT
Allow using mode LIFT in WELTARG
2021-12-03 15:45:56 +01:00
Joakim Hove
2a612b5c64 Allow using mode LIFT in WELTARG 2021-12-03 10:39:02 +01:00
Paul Egberts
10f11f9982 fix: number of tables should be based on NTPVT 2021-12-02 18:03:57 +01:00
Paul Egberts
3ead0f48d2 add test for salt solubility table 2021-12-02 16:43:54 +01:00
Paul Egberts
f053ba9a20 salt solubility table implementation using simpleTableContainer 2021-12-02 11:52:38 +01:00
Paul Egberts
4445092191 removed because changing to SimpleTableContainer implementation 2021-12-02 11:52:37 +01:00
Paul Egberts
12396498d7 some formatting 2021-12-02 11:52:37 +01:00
Paul Egberts
e40fdf75ba salt solubility table allowing specification of solubility per region 2021-12-02 11:52:37 +01:00
Bård Skaflestad
6e6b438405 Merge pull request #2880 from goncalvesmachadoc/testFixReport
add Field vectors to required list
2021-11-30 17:50:52 +01:00
goncalvesmachadoc
b5285c7a99 add Field vectors to required list 2021-11-30 16:50:26 +01:00
Joakim Hove
0f48afd01d Merge pull request #2879 from joakim-hove/rst-load-tracer-rate
Rst load tracer rate
2021-11-30 14:09:15 +01:00
Joakim Hove
b95019847c Restore tracer cumulatives WTIT and WTPT 2021-11-30 11:23:13 +01:00
Joakim Hove
bdd933ff6f Initialize tracer injection properties from restart file 2021-11-30 11:23:13 +01:00
Joakim Hove
04ef6fad1c Load water tracer concentration from restart file 2021-11-30 11:23:13 +01:00
Joakim Hove
77053495b0 Add Runspec argument to Restart header constructor 2021-11-30 11:23:13 +01:00
Joakim Hove
76744d2178 Merge pull request #2878 from joakim-hove/tracer-xwel-sign
Sign change on tracer data
2021-11-30 09:57:54 +01:00
Joakim Hove
ba17da040a Merge pull request #2875 from joakim-hove/tracer-name-fixup
Add tracer config function fname() == name + "F"
2021-11-30 09:57:41 +01:00
Joakim Hove
2c9af65747 Merge pull request #2876 from joakim-hove/rst-deck-rptrst-fix
Retain RPTRST keyword when updating SOLUTION section for restart
2021-11-30 09:42:01 +01:00
Joakim Hove
041a2a72a1 Sign change on tracer data 2021-11-29 08:05:23 +01:00
Joakim Hove
78377b705f Retain RPTRST keyword when updating SOLUTION section for restart 2021-11-27 12:44:11 +01:00
Joakim Hove
ae8c7c5325 Add tracer config function fname() == name + "F" 2021-11-26 16:45:04 +01:00
Joakim Hove
4c05ba58d1 Merge pull request #2874 from joakim-hove/tracer-name-fixup
Tracer name fixup
2021-11-26 16:44:10 +01:00
Joakim Hove
ecdfa8413d Allow to create TracerConfig (for restart) without any data 2021-11-26 14:55:53 +01:00
Joakim Hove
508e2dac3c Make sure correct name is used in tracer configuration 2021-11-26 14:48:01 +01:00
Joakim Hove
4e4f7fc94c Merge pull request #2872 from joakim-hove/schedule-deck-start
Schedule deck start
2021-11-26 12:15:01 +01:00
Joakim Hove
507d412355 DeckRecord writer accepts optional item offset 2021-11-26 09:11:53 +01:00
Joakim Hove
e011da6661 SchduleBlock: dump DATES / TSTEP from public method 2021-11-26 09:11:53 +01:00
Joakim Hove
c4bdff2b39 ScheduleDeck constructed with time_point argument 2021-11-26 09:11:53 +01:00
Joakim Hove
2d0e92750d Merge pull request #2866 from joakim-hove/schedule-dump
Implement schedule dump to deck functionality
2021-11-25 11:10:11 +01:00
Bård Skaflestad
535f3401d6 Merge pull request #2825 from jalvestad/rst-ntw-imp
Corrections to output of network data to Eclipse compatible restart file
2021-11-25 00:30:28 +01:00
Jostein Alvestad
07f67b4df1 corrected share - NETBALAN to be consistent with master 2021-11-24 14:10:12 +01:00
Jostein Alvestad
4585f2499d changes to correct test_AggregateNetwork 2021-11-24 13:27:21 +01:00
Jostein Alvestad
556c21a254 changes to correct output of restart data for networks
corrections to intehead for netbalan data plus improvements createdoubhead

simplification of code due to changes in master

correction to default value for NETBALAN PRESSURE_CONVERGENCE_LIMIT
2021-11-24 13:27:18 +01:00
Joakim Hove
e250f83c1d Merge pull request #2870 from joakim-hove/default-units-bug
Make sure units are correct for default initialized NETBALAN
2021-11-24 11:11:10 +01:00
Joakim Hove
94cb4ba908 Make sure NETBALAN defaults have correct units 2021-11-24 10:41:18 +01:00
Joakim Hove
24a8c09956 Add UnitSystem::from_si() and to_si based on string 2021-11-24 09:42:51 +01:00
Joakim Hove
685c8b06f2 Merge pull request #2868 from joakim-hove/tracer-optional
Use std::optional<> for tracer details
2021-11-24 09:41:58 +01:00
Joakim Hove
75bf28c45b Merge pull request #2869 from joakim-hove/tracer-rst-name
Look up tracer name without trailing 'F' in restart writer
2021-11-24 09:41:39 +01:00
Joakim Hove
4e5c7feb5f Look up tracer name without trailing 'F' in restart writer 2021-11-23 15:01:50 +01:00
Joakim Hove
48854bfbeb Use std::optional<> for tracer details 2021-11-23 15:01:11 +01:00
Joakim Hove
c081a764a7 Implement schedule dump to deck functionality 2021-11-23 15:00:33 +01:00
Joakim Hove
f3f3dde251 Merge pull request #2856 from joakim-hove/deck-refactor2
Deck refactor2
2021-11-23 14:58:01 +01:00
Joakim Hove
f572937529 Add template<> Deck::get<T>() to get keywords 2021-11-23 14:06:37 +01:00
Daniel
90ce7bc6cb Replaced call to Deck::getKeyword(kw, index) with deck[kw][index] 2021-11-23 14:00:38 +01:00
Daniel
b0f757eb50 Replace Deck::getKeyword(std::string) with operator[std::string] 2021-11-23 14:00:38 +01:00
Bård Skaflestad
80bd7fd974 Merge pull request #2864 from joakim-hove/tracer-zero
Pad XCON, XGRP and RSEG vectors with tracer zero
2021-11-23 12:33:17 +01:00
Joakim Hove
5f6d43f7b8 Explicitly assign tracer data in RSEG variable 2021-11-23 11:28:04 +01:00
Joakim Hove
604321ebdb Segment data aggregation refactor
- Pass segment string as argument to lambda get instead of binding at
  declaration.

- Use SummaryState::get() overload with default

- Introduce scope to make special casing of first segment more distinct
2021-11-23 11:24:55 +01:00
Joakim Hove
f5cc0da3ee Publish function numRSegElem 2021-11-23 07:53:14 +01:00
Joakim Hove
8ed6e3c204 Pad XCON vector with tracer values (currently just zero) 2021-11-23 07:52:55 +01:00
Joakim Hove
ad61859ddf Fill XGRP vector with zero tracer values 2021-11-23 07:51:06 +01:00
Joakim Hove
e2172d12a0 Merge pull request #2861 from joakim-hove/tracer-well-rst
Add tracer data to SWEL and XWEL
2021-11-23 07:48:26 +01:00
Joakim Hove
1839dcdbd5 Assign tracer data to XWEL 2021-11-22 16:27:17 +01:00
Joakim Hove
b00707ff84 Assign tracer data to SWEL 2021-11-22 16:27:17 +01:00
Joakim Hove
414b7c1946 Add TracerConfig::operator[](std::size_t) 2021-11-22 15:52:36 +01:00
Joakim Hove
7e26d683dd Merge pull request #2859 from joakim-hove/tracer-intehead
Update INTEHEAD vector to take tracer data into account
2021-11-22 15:51:09 +01:00
Joakim Hove
48c97f8f2e Merge pull request #2867 from atgeirr/add-missing-include
Add missing include for unordered_map.
2021-11-22 10:28:57 +01:00
Joakim Hove
5c3c19474a Merge pull request #2858 from joakim-hove/parser-item-init
Initialize values used for overloading in ParserItem
2021-11-22 09:50:33 +01:00
Joakim Hove
6d669c9b6c Merge pull request #2853 from joakim-hove/wstats
WSTAT
2021-11-22 09:50:04 +01:00
Atgeirr Flø Rasmussen
cacdafcf51 Add missing include for unordered_map. 2021-11-22 09:48:32 +01:00
Joakim Hove
272a22a34c Update INTEHEAD vector to take tracer data into account 2021-11-22 09:46:02 +01:00
Joakim Hove
27c690acf4 Add class Tracers with tracer dimensions 2021-11-22 09:46:02 +01:00
Joakim Hove
37d9893e9e Merge pull request #2855 from joakim-hove/add-ztracer
Add ztracer keyword to restart file
2021-11-22 09:37:34 +01:00
Joakim Hove
2043a5f991 Merge pull request #2848 from joakim-hove/keyword-is
Suggestion: use keyword.is<T>() instead of checking name?
2021-11-19 16:09:03 +01:00
Joakim Hove
5df24a644a Merge pull request #2857 from joakim-hove/netbalan-default
Netbalan default
2021-11-19 15:36:04 +01:00
Joakim Hove
45c726156c Use keyword.is<ParserKeyword:XXXX> instead of checking name 2021-11-19 15:32:20 +01:00
Joakim Hove
d1f3d40e03 Add ZTRACER keyword before tracer solution data in restart file 2021-11-19 08:00:23 +01:00
Joakim Hove
137ef059e7 Add TracerConfig::operator[] 2021-11-19 07:53:21 +01:00
Joakim Hove
0998309138 Rename DeckKeyword::isKeyword -> DeckKeyword::is 2021-11-18 16:45:08 +01:00
Joakim Hove
78a90e1dec Create Network::Balance constructor based on default values 2021-11-18 15:29:38 +01:00
Joakim Hove
ebc92f4250 Add bool active() method to NetworkDims 2021-11-18 15:29:38 +01:00
Joakim Hove
9f86549d30 Initialize values used for overloading in ParserItem 2021-11-18 11:28:30 +01:00
Joakim Hove
b1279876cd Use std::optional<> for NETBALAN pressure values 2021-11-18 10:50:39 +01:00
Joakim Hove
9d1f512b44 Merge pull request #2854 from joakim-hove/add-type-tracer-solution
Add restart output type RESTART_TRACER_SOLUTION
2021-11-18 09:39:24 +01:00
Joakim Hove
5432636a82 Add restart output type RESTART_TRACER_SOLUTION 2021-11-17 14:26:37 +01:00
Joakim Hove
07a5fb22c3 Handle string output for WSTAT to RSM file 2021-11-17 12:16:42 +01:00
Joakim Hove
cb2e90bb71 Output WSTAT numerical value to summary file 2021-11-17 12:16:34 +01:00
Joakim Hove
2a50e28085 Test ensure that WSTAT is included in SummaryConfig 2021-11-17 12:10:48 +01:00
Joakim Hove
9732520e3f Move special case handling of 'S' summary keywords to SummaryNode 2021-11-17 12:04:19 +01:00
Joakim Hove
f1b3c73c65 Merge pull request #2852 from joakim-hove/add-kw-compsegs
Add kw compsegs
2021-11-16 20:01:11 +01:00
Joakim Hove
b30e51ccf0 Merge pull request #2851 from joakim-hove/replace-std-size
Replace std size
2021-11-16 19:28:27 +01:00
Joakim Hove
f95b0ad19e Rename inspect_actionx_keyword -> prefect_cell_properties 2021-11-16 19:25:45 +01:00
Joakim Hove
bef5f5b9f4 Small fixup in python wrapper 2021-11-16 18:37:59 +01:00
Daniel
fe24c0717c Replace Deck::getKeyword(size_t) with operator[size_t] 2021-11-16 18:36:27 +01:00
Joakim Hove
b6ec75eeb6 Merge pull request #2841 from joakim-hove/register-tests-in-files
Register ecl io tests using the file list in CMakeLists_files.cmake
2021-11-16 13:47:15 +01:00
Daniel
7435073568 Add keyword COMPSEGS to inspect_actionx_keyword() 2021-11-16 10:20:22 +01:00
Joakim Hove
df99685a92 Merge pull request #2844 from hakonhagland/py_rpath
Add rpath to libopmcommon.so in the build directory.
2021-11-15 17:50:39 +01:00
Joakim Hove
a8edbddbcd Merge pull request #2845 from blattms/spelling-fixes-2021.10
Fixes spelling errors pointed out by lintian
2021-11-15 16:44:11 +01:00
Markus Blatt
388bb09162 Fixes spelling errors pointed out by lintian 2021-11-15 16:05:20 +01:00
Joakim Hove
b3bbd567e8 Merge pull request #2832 from joakim-hove/action-multxyz
Action multxyz
2021-11-15 14:24:56 +01:00
Håkon Hægland
a4d703b433 Add rpath to libopmcommon.so in the build directory.
Currently, an rpath to the install directory of libopmcommon.so is
generated for libopmcommon_python.so, but a similar rpath is not added to
the libopmcommon.so in the build directory. It is useful to be able to
use the build directory libraries when not compiling with
-DOPM_INSTALL_PYTHON or when developing.

This PR fixes issue #2843.
2021-11-15 13:50:06 +01:00
Markus Blatt
7554a16b4c Merge pull request #2839 from joakim-hove/rm-sched-debug
Remove stale compile definition SCHEDULE_DEBUG
2021-11-15 12:16:55 +01:00
Joakim Hove
785188c45c Merge pull request #2840 from joakim-hove/avoid-python-dep
Avoid python dep
2021-11-15 12:06:11 +01:00
Joakim Hove
0e5d7977c3 Merge pull request #2842 from blattms/pkgconfig-link-private
List link dependencies as private.
2021-11-15 12:05:16 +01:00
Markus Blatt
b21f5e248d List link dependencies as private.
This hides them for shared libraries that do not need them.
Should fix the following lintian warnings:

W: libopm-common-dev: pkg-config-references-unknown-shared-library usr/lib/x86_64-linux-gnu/pkgconfig/opm-common.pc -lpython3.7m (line 12)
W: libopm-common-dev: pkg-config-references-unknown-shared-library usr/lib/x86_64-linux-gnu/pkgconfig/opm-common.pc -lstdc++fs (line 12)
W: libopm-common-dev: pkg-config-references-unknown-shared-library usr/lib/x86_64-linux-gnu/pkgconfig/opm-common.pc -lgomp (line 12)
W: libopm-common-dev: pkg-config-references-unknown-shared-library usr/lib/x86_64-linux-gnu/pkgconfig/opm-common.pc -lboost_system (line 12)
W: libopm-common-dev: pkg-config-references-unknown-shared-library usr/lib/x86_64-linux-gnu/pkgconfig/opm-common.pc -lcjson (line 12)

Gbp-Pq: Name 0002-List-link-dependencies-as-private.patch
2021-11-15 11:03:55 +01:00
Joakim Hove
a8d3997c72 Register ecl io tests using the file list in CMakeLists_files.cmake 2021-11-15 10:20:36 +01:00
Joakim Hove
efc2b7c834 Only include builtin_pybind11 when building with embedded python 2021-11-15 09:58:00 +01:00
Joakim Hove
40dd50871c Remove unneeded include <pybind11/stl.h> 2021-11-15 09:48:08 +01:00
Joakim Hove
893363e225 Merge pull request #2833 from hakonhagland/py_sched2
Implement support for adding keywords to the schedule from Python.
2021-11-15 08:47:51 +01:00
Joakim Hove
1f8b79105a Remove stale build symbol SCHEDULE_DEBUG 2021-11-15 08:29:03 +01:00
Håkon Hægland
07f11585aa Fix rebase error. 2021-11-14 13:52:35 +01:00
Håkon Hægland
928a33d2ea Add comment about insert_keywords()
Add comment explaining that one of the insert_keywords()
overloads does not work yet.
2021-11-14 13:18:26 +01:00
Håkon Hægland
372b7e86a4 Support for adding keywords to schedule from Python.
Adds support for adding keywords to the SCHEDULE section of the deck
after the deck has been read from file from Python.
2021-11-14 13:18:26 +01:00
Joakim Hove
84c551a6df Record use of GEO keywords as ACTIONX keyword 2021-11-12 16:52:23 +01:00
Joakim Hove
5a653d7464 Use handleGEOKeyword also for MULTFLT 2021-11-12 16:51:29 +01:00
Joakim Hove
cf640a62ad Fix Copyright comment 2021-11-12 16:51:29 +01:00
Joakim Hove
6056a4c7d0 Merge pull request #2828 from daniepin/activate-cells-during-actionx
Activate cells during ACTIONX sequence if specific keywords are encountered
2021-11-12 16:50:30 +01:00
Daniel
e4026b84e9 Made corrections to inspect_actionx_keyword() method 2021-11-12 15:59:44 +01:00
Daniel
ff638862d9 Inspect keywords during ACTIONX sequence and activate Cells. 2021-11-12 15:08:16 +01:00
Joakim Hove
1d6a930784 Add test for COMPDAT as ACTIONX keyword 2021-11-12 15:08:16 +01:00
Joakim Hove
10314ce169 Merge pull request #2826 from daniepin/applyAction-refactor
Combine ScheduleGrid and FieldPropsManager
2021-11-12 15:04:37 +01:00
Joakim Hove
e65639a2e6 Merge pull request #2836 from akva2/update_data_base
added: tell update_data where to start branch from
2021-11-12 14:10:44 +01:00
Joakim Hove
3a1679319f Merge pull request #2809 from bska/ext-network-restart
Support Loading Extended Network Model From Restart
2021-11-12 14:04:46 +01:00
Daniel
6c1f2e4ded Add serializeOp() and serializeObject() methods to Prop struct 2021-11-12 13:56:33 +01:00
Arne Morten Kvarving
f7375c2638 added: tell update_data where to start branch from
this to allow for update_data from opm-tests
2021-11-12 13:30:44 +01:00
Bård Skaflestad
459fd67203 Incorporate Extended Network Objects From Restart into Schedule
This commit hooks the new RstNetwork object into the restart feature
of the main Schedule object.  We form ExtNetwork Schedule subobjects
if there are active branches and nodes in the restart file.
2021-11-12 13:06:31 +01:00
Bård Skaflestad
19ec3b34f9 Support Loading Extended Network Model From Restart
This commit adds a new helper class, RstNetwork, that loads the raw
data representing the extended network model from restart vectors
IBRAN, INODE, RNODE, and ZNODE.  We support loading the information
that is currently output to those restart vectors, but those do not
include every option supported by the input keywords BRANPROP and
NODEPROP.

The RstNetwork type supports querying whether or not the extended
network model is active and, if so, to get iterable collections of
branches and nodes that are geared towards constructing ExtNetwork
objects.
2021-11-12 13:06:31 +01:00
Bård Skaflestad
c3b3ce4832 Sort Headers in Restart State Object Implementation
In preparation of adding restart support for the extended network
model.
2021-11-12 13:06:31 +01:00
Bård Skaflestad
def4dd2c68 Return Restart State Object by Move()
Useful since we don't get in-place construction when returning a
composite object.  Also useful if we decide to make RstState a
move-only type.
2021-11-12 13:06:31 +01:00
Joakim Hove
d7c495e229 Merge pull request #2824 from joakim-hove/rst-deck-file-arg
rst_deck: interpret restart argument as proper filename
2021-11-12 13:03:08 +01:00
Joakim Hove
c6209872f6 Rename struct options -> struct Options in rst_deck 2021-11-12 12:22:15 +01:00
Joakim Hove
d950e3ceb1 rst_deck: optionally interpret restart argument as proper filename 2021-11-12 12:22:15 +01:00
Joakim Hove
01a7149b36 Merge pull request #2788 from joakim-hove/deck-view
Refactor Deck and DeckView class hierarchy
2021-11-12 10:14:09 +01:00
Joakim Hove
fe38dbb663 Merge pull request #2834 from joakim-hove/restart-throw-input-error
Use OpmInputError for restart input problems
2021-11-12 09:59:01 +01:00
Joakim Hove
c73e77b3de Use OpmInputError for restart input problems 2021-11-12 09:19:08 +01:00
Joakim Hove
ee105b7bbf Remove base class DeckViewInternal and create new class DeckView 2021-11-12 08:09:29 +01:00
Joakim Hove
fb1dcd0203 Merge pull request #2817 from joakim-hove/schedule-fp
Schedule fp
2021-11-12 07:52:58 +01:00
Joakim Hove
12dd45ca66 Merge pull request #2835 from joakim-hove/add-dimension-to-uda
Add dimension to uda in Python
2021-11-12 07:51:55 +01:00
Joakim Hove
08e29defd2 Remove python2 adaption 2021-11-11 15:53:21 +01:00
Joakim Hove
e017195478 Whitespace fixup 2021-11-11 15:53:21 +01:00
Joakim Hove
b77ed8cc7c Add dimension to UDAValue when creating 2021-11-11 15:53:21 +01:00
Joakim Hove
0fc2448369 Expose UDAValue to Python 2021-11-11 15:53:21 +01:00
Joakim Hove
e9ec23b385 Spelling fix 2021-11-11 15:53:21 +01:00
Joakim Hove
77985eaa08 Export UnitSystem and Dimension from opm.io 2021-11-11 15:53:21 +01:00
Joakim Hove
64e10a9c77 Export UnitSystem to opm._common 2021-11-11 15:53:21 +01:00
Joakim Hove
55eeabba42 Use only python3 syntax for import from test directory 2021-11-11 15:53:21 +01:00
Joakim Hove
90e55025d6 Merge pull request #2831 from joakim-hove/action-sim-update
Add struct SimulatorUpdate to transport results back to simulator
2021-11-11 14:59:07 +01:00
Joakim Hove
2320c16508 Merge pull request #2829 from joakim-hove/use-optional-for-active-units
Use std::optional< > for Deck unitsystem
2021-11-11 14:58:09 +01:00
Joakim Hove
40df72bc95 Merge pull request #2821 from hakonhagland/py11_uda
Add support for UDA values in DeckKeyword constructor.
2021-11-10 16:58:26 +01:00
Joakim Hove
d61f2356db Remove unused variables 2021-11-10 16:21:28 +01:00
Joakim Hove
f1e768e184 Add struct SimulatorUpdate to transport results back to simulator 2021-11-10 15:57:56 +01:00
Håkon Hægland
4e5f7ef48e Add some more UDA value tests.
Adds some more tests for UDA value items when constructing DeckKeyword
from Python.
2021-11-10 15:56:36 +01:00
Joakim Hove
ba3bcdb21b Refactor / simplify function 2021-11-10 15:05:36 +01:00
Joakim Hove
2921838895 Apply MULTXYZ multipliers from Schedule section 2021-11-10 15:05:36 +01:00
Joakim Hove
243beeb96a Add functionality to update FieldProps with schedule multipliers 2021-11-10 15:05:36 +01:00
Joakim Hove
948504444d Remove ParseContext::UNSUPPORTED_SCHEDULE_GEO_MODIFIERS 2021-11-10 15:05:36 +01:00
Joakim Hove
37fa5f034c Rename EclipseState::initTransMult -> applyMULTXYZ 2021-11-10 14:52:12 +01:00
Joakim Hove
304f4179c5 Mark MULTXYZ as allowed in SCHEDULE section 2021-11-10 14:52:12 +01:00
Joakim Hove
4b89399640 Use std::optional< > for Deck unitsystem 2021-11-10 14:51:15 +01:00
Daniel
faefde1a4f Modify ACTIONX tests 2021-11-09 13:01:36 +01:00
Joakim Hove
edf4a9bcf4 Add ACTIONX + COMPDAT integration test with msim 2021-11-09 12:33:34 +01:00
Joakim Hove
a51a220a24 Add test for ACTIONX with trailing COMPDAT 2021-11-09 12:33:22 +01:00
Daniel
c80bcfd0bb Removed unused variable active_index 2021-11-09 12:26:52 +01:00
Daniel
243c46a9a6 Removed FieldPropsManager* parameter from applyAction() 2021-11-09 12:20:27 +01:00
Daniel
d8a2061a14 Modify loadCOMPDAT() to not take a FieldPropsManager* as an argument 2021-11-09 12:16:40 +01:00
Håkon Hægland
25ccb17917 Test UDA value DeckKeyword
Test that the DeckKeyword() Python constructor can handle UDA value
keywords.
2021-11-09 11:47:58 +01:00
Joakim Hove
381e54f4a9 Merge pull request #2822 from joakim-hove/mutable-transmult
Add mutable EclipseState::getTransMult()
2021-11-09 11:25:40 +01:00
Joakim Hove
acbcccda22 Merge pull request #2819 from joakim-hove/refactor-micpara-contructions
Refactor construction of Microbial growth constructor
2021-11-09 11:25:09 +01:00
Daniel
11ddf673f0 Add keyword NTG to Cell props struct 2021-11-09 10:16:09 +01:00
Daniel
c3a55cb03b Add keywords SATNUM and PVTNUM to Cell props struct 2021-11-09 10:07:00 +01:00
Joakim Hove
2c1c298003 Add mutable EclipseState::getTransMult() 2021-11-08 11:59:32 +01:00
Joakim Hove
b1b7ed5ecb Merge pull request #2818 from joakim-hove/rename-geo-modifiers
Rename EclipseState::apply_geo_keywords -> apply_schedule_keywords
2021-11-08 11:46:25 +01:00
Håkon Hægland
702c4d46af Add support for UDA values in DeckKeyword constructor.
Add support for UDA values items when constructing DeckKeywords from
DeckValues. This is needed when constructing DeckKeywords
from Python. For example WCONPROD has UDA value argument for the oil
rate.
2021-11-08 09:58:22 +01:00
Joakim Hove
3a291283eb Merge pull request #2820 from bska/support-fluid-api-gravity
Support GRAVITY As Fallback for DENSITY
2021-11-08 07:50:15 +01:00
Joakim Hove
1c8c2cb11f Refactor construction of Microbial growth constructor 2021-11-07 20:24:17 +01:00
Bård Skaflestad
da9d550f05 Support GRAVITY As Fallback for DENSITY
This commit activates support for the 'GRAVITY' keyword.  We treat
this as a fallback alternative to the 'DENSITY' keyword.
2021-11-07 20:20:56 +01:00
Joakim Hove
3d17cee393 Rename EclipseState::apply_geo_keywords -> apply_schedule_keywords 2021-11-07 19:55:09 +01:00
Joakim Hove
0595aa8fea Merge pull request #2801 from joakim-hove/affected-wells
Register well as "touched" by WCONHIST and WCONINJE in ACTIONX block
2021-11-05 12:02:01 +01:00
Joakim Hove
70261592b3 Merge pull request #2814 from bska/restart-load-field-wide-constraints
Load Field-Wide Constraints From Restart File
2021-11-05 11:06:29 +01:00
Joakim Hove
bbfd433b8e Merge pull request #2807 from joakim-hove/alq-sign
Change sign of gas lift rate calculated from IGLR and ALQ value
2021-11-05 11:05:52 +01:00
Bård Skaflestad
67df58e10d Load Field-Wide Constraints From Restart File
If constraints are applied at the field level, e.g., through the
GCONINJE keyword, then we must incorporate those constraints into
FIELD when restarting a simulation run.  This commit takes a step in
this direction by explicitly loading the *GRP array entries
pertaining to FIELD and special casing

    Schedule::addGroup(RstGroup, time)

to look for "rst_group.name == FIELD".  In that case, we update the
injection and production properties of the existing FIELD group as
needed.
2021-11-05 10:02:07 +01:00
Joakim Hove
f78a6a858a Merge pull request #2806 from daniepin/completed-cells-fp
Add permability property to CompletedCells
2021-11-05 09:34:04 +01:00
Joakim Hove
6dca968e66 Merge pull request #2811 from joakim-hove/remove-unused-deck-function
Remove unused Deck::hasKeyword( const DeckKeyword& )
2021-11-04 17:11:51 +01:00
Joakim Hove
822df970dc Merge pull request #2813 from joakim-hove/avoid-use-of-generated-header
Avoid use of generated header S.hpp in header file
2021-11-04 17:11:32 +01:00
Joakim Hove
3fcbac1e95 Move implementation to cpp file 2021-11-04 13:33:43 +01:00
Joakim Hove
f13cf8db11 Remove unused Deck::hasKeyword( const DeckKeyword& ) 2021-11-04 12:41:12 +01:00
Daniel
0d8edeccfa Remove active_index from serializer 2021-11-04 11:29:12 +01:00
Daniel
45dd77938b Removed constructor from ScheduleGrid, added perm prop to tests
Changed (BASE_SIM.DATA, BASE_SIM_THPRES.DATA, RESTART_SIM.DATA),  testblackoilstate3.DATA and testrft.DATA since they affect the tests in test_Restart.cpp, test_restartwellinfo.cpp and test_RFT.cpp respectively.
2021-11-04 11:29:12 +01:00
Daniel
931cebb12f Add Props struct to CompletedCells::Cell 2021-11-04 11:29:12 +01:00
Daniel
39723102a9 Add permability property to CompletedCells 2021-11-04 11:29:12 +01:00
Joakim Hove
f2db4651d0 Register well as "touched" by WCONHIST and WCONINJE in ACTIONX block 2021-11-04 09:37:36 +01:00
Joakim Hove
5e2dc1e30c Merge pull request #2808 from bska/identify-nodename-restart-item
Identify Extended Network Model Node Name Item in ZNODE
2021-11-03 16:44:47 +01:00
Bård Skaflestad
ab5cb1118d Identify Extended Network Model Node Name Item in ZNODE
In preparation of adding initial support for restarting simulations
featuring the extended network model.
2021-11-03 13:17:49 +01:00
Joakim Hove
6e56d80529 Change sign of gas lift rate calculated from IGLR and ALQ value 2021-11-03 11:54:26 +01:00
Joakim Hove
dd54d2aad1 Merge pull request #2805 from bska/restart-continuous-xlpt
Ensure Continuous Cumulative Liquid Production On Restart
2021-11-03 08:40:50 +01:00
Bård Skaflestad
9ce58ec2ad Ensure Continuous Cumulative Liquid Production On Restart
The xLPT curves should not start at zero in a restarted simulation
run.  This commit initialises the cumulative liquid production
volume using the value

    xOPT + xWPT

with the individual terms taken from XWEL or XGRP as appropriate.
2021-11-02 16:16:45 +01:00
Joakim Hove
cbfc727cd2 Merge pull request #2773 from bska/restart-gefac
Add Restart Support for Item 2 of GEFAC
2021-11-02 15:32:52 +01:00
Bård Skaflestad
c51724942b Add Restart Support for Item 2 of GEFAC
That is, save and restore the group efficiency factor value to/from
the SGRP array in the restart file.
2021-11-02 12:41:19 +01:00
Bård Skaflestad
7aae45a67f Adjust Whitespace
In preparation of adding restart support for Item 2 of GEFAC.
2021-11-02 12:41:19 +01:00
Joakim Hove
612706e02f Merge pull request #2804 from jalvestad/rst_improv
Add item IGRP[NWGMAX + 39] to the Eclipse-compatible restart file
2021-11-02 11:57:32 +01:00
Joakim Hove
ea856e1484 Merge pull request #2791 from joakim-hove/alq-output
Use gas lift rate value for WALQ output when gas lift rate optimization is in action
2021-11-01 19:37:52 +01:00
Joakim Hove
1342b47f63 Calculate GLIR from liquid rates and fraction Gas / Liquid 2021-11-01 17:48:47 +01:00
Joakim Hove
5b2712490e Change argument type in utility functions 2021-11-01 17:48:47 +01:00
Joakim Hove
8fb66ef908 Fetch ALQ value from simulator if WLIFTOPT is enabled for well 2021-11-01 17:48:47 +01:00
Joakim Hove
03f440d064 Use named symbol zero for increased readability 2021-11-01 17:48:47 +01:00
Joakim Hove
5e84c8d935 Add function GLiftOpt::num_wells() 2021-11-01 17:48:47 +01:00
Joakim Hove
4eddb181c6 Merge pull request #2803 from akva2/remove_ebos_flags
changed: remove extra flags for ebos
2021-11-01 17:39:24 +01:00
Atgeirr Flø Rasmussen
af8fc94188 Merge pull request #2802 from akva2/remove_gcc7_compat
changed: drop gcc7 compatibility
2021-11-01 15:29:52 +01:00
Jostein Alvestad
ffad873b0f Added output of IGRP[NWGMAX + 39] - node sequence number for groups in external network 2021-11-01 15:04:02 +01:00
Arne Morten Kvarving
becfb799a5 changed: remove extra flags for ebos
ebos is no more
2021-11-01 13:52:05 +01:00
Arne Morten Kvarving
6465cfe1ea changed: drop gcc7 compatibility
this means getting rid of the Opm::filesystem namespace
and directly using std::filesystem, as well as dropping
some of the compat code for the tr filesystem.

we still need the FileSystem.hpp/cpp files though as unique_path
is not part of std::filesystem.
2021-11-01 12:36:42 +01:00
Joakim Hove
f8d33def59 Merge pull request #2786 from daniepin/completed_cells-refactor
Refactored ScheduleGrid to use public struct cell
2021-10-30 17:10:32 +02:00
Joakim Hove
30f44eff1d Merge pull request #2789 from joakim-hove/deck-view-rename
Rename DeckView -> DeckViewInternal
2021-10-30 15:56:30 +02:00
Joakim Hove
0d6acd82e0 Merge pull request #2790 from joakim-hove/gaslift-rst-fixup
Gaslift rst fixup
2021-10-30 15:55:37 +02:00
Joakim Hove
f60b5d1c8c Merge pull request #2794 from joakim-hove/gliftopt
Gliftopt
2021-10-30 15:55:16 +02:00
Joakim Hove
1d19c67cea Merge pull request #2800 from bska/provide-stable-actionx-well-order
Ensure Stable Sort Order for Well Names in ACTIONX Block
2021-10-29 19:42:02 +02:00
Joakim Hove
82a16bc1e9 Use std::map::insert_or_assign() to update maps 2021-10-29 17:05:29 +02:00
Bård Skaflestad
7452d398e5 Ensure Stable Sort Order for Well Names in ACTIONX Block
This means we don't process wells in an order that's dictated by
the implementation's choices for the element order in an
unordered_set<string>.
2021-10-29 16:48:22 +02:00
Bård Skaflestad
1f03a0e726 Provide External Access to Well-Order Sorting
This commit extracts the 'NameOrder' sorting operation to a new
public member function, WellMatcher::sort(vector<string>).  The
immediate use-case for this function is to provide a stable sorting
order for wells that are matched in an ACTIONX block.  Well IDs
often end up in various output arrays in the restart files--e.g., in
the IUAP array the matching wells are used in a WCON* keyword that
employs a user-defined argument as part of setting its targets or
limits--and we should strive to keep those arrays as deterministic
as possible.
2021-10-29 16:48:22 +02:00
Joakim Hove
9685946196 Merge pull request #2799 from akva2/fix_suitesparse_warning
changed: use STRING type
2021-10-29 16:39:51 +02:00
Joakim Hove
34c87b45fe Merge pull request #2795 from bska/add-guiderate-haspotentials-predicate
Add Predicate for Potential Rates of W/G Name
2021-10-29 16:39:33 +02:00
Joakim Hove
cabeff1eee Merge pull request #2797 from akva2/fix_cjson
Fix some cjson issues
2021-10-29 16:39:18 +02:00
Bård Skaflestad
93df70417a Add Predicate for Potential Rates of W/G Name
This commit adds a new predicate, GuideRate::hasPotentials(), that
checks whether or not rates exist in the 'potentials' array for a
particular well or group name.  If neither explicit guide rate
values nor potential rates exist for a particular "wgname", then it
is an error to call GuideRate::get() and that member function will
throw an exception.  This new predicate provides a way of avoiding
that exception.
2021-10-29 15:03:49 +02:00
Arne Morten Kvarving
fecd879840 changed: use STRING type
there is no such thing as INT type in cmake
2021-10-29 14:25:41 +02:00
Arne Morten Kvarving
f12f77ba46 Merge pull request #2796 from akva2/fix_pybind11_dep_warning
fix deprecation warning with pybind11 >= 2.6
2021-10-29 13:57:57 +02:00
Arne Morten Kvarving
129bc72273 fix deprecation warning with pybind11 >= 2.6 2021-10-29 13:41:50 +02:00
Arne Morten Kvarving
21cdcecb81 fixed: append cjson libraries to python module build when using system cjson 2021-10-29 13:15:47 +02:00
Arne Morten Kvarving
c979f25d02 fix cjson find module
the param to find_package_handle_standard_args should match module name
2021-10-29 13:15:47 +02:00
Joakim Hove
1849e2230c Load GLIFTOPT properties from restart file 2021-10-28 16:27:36 +02:00
Joakim Hove
589191f532 Write options for GLIFTOPT to restart file 2021-10-28 16:27:36 +02:00
Joakim Hove
927b6c2cbb Fetch GLIFT rate change from correct restart item 2021-10-27 11:11:25 +02:00
Joakim Hove
0e4f16dddc Use correct item for GLIFT weight factor when loading from restart 2021-10-27 11:11:25 +02:00
Joakim Hove
7f3be89d9c Use named constant for GASLIFT option 2021-10-27 11:11:25 +02:00
Joakim Hove
9eaf6b2fdf Rename item in LIFTOPT keyword 2021-10-27 11:11:25 +02:00
daniepin
3e612b8407 Delete .vscode directory 2021-10-27 09:55:10 +02:00
Joakim Hove
705c3ac8c6 Rename DeckView -> DeckViewInternal 2021-10-26 23:10:19 +02:00
Daniel Pinjusic
f8b8cad95a Refactored ScheduleGrid to use public struct cell 2021-10-26 13:36:54 +02:00
Joakim Hove
d96e5308a1 Merge pull request #2784 from akva2/janitoring
remove unused variables
2021-10-26 12:29:15 +02:00
Arne Morten Kvarving
f079ca3443 remove unused variables 2021-10-26 08:47:22 +02:00
Joakim Hove
af11f82d4d Merge pull request #2770 from joakim-hove/rst-gaslift
Rst gaslift
2021-10-26 07:22:01 +02:00
Bård Skaflestad
147ecdd9c6 Merge pull request #2783 from akva2/janitoring
avoid sign/unsigned comparison warning
2021-10-25 23:01:35 +02:00
Joakim Hove
2c0a1b4cb6 Merge pull request #2779 from jalvestad/rst-netbalan
Add items for the NETBALAN keyword to the Eclipse-compatible restart file
2021-10-25 22:46:20 +02:00
Arne Morten Kvarving
8454f82ba3 avoid sign/unsigned comparison warning 2021-10-25 21:55:02 +02:00
Joakim Hove
a17fe175d2 Merge pull request #2775 from joakim-hove/actionx-compdat-compsegs-fix
Actionx compdat compsegs fix
2021-10-25 17:38:20 +02:00
Joakim Hove
5dc451f159 Merge pull request #2780 from joakim-hove/rst_fixup2
Rst fixup2
2021-10-25 17:37:47 +02:00
Bård Skaflestad
ff969f0048 Merge pull request #2782 from alfbr/wellgraph
Add helpful output at runtime for wellgraph
2021-10-25 16:47:46 +02:00
Alf Birger Rustad
d5d88ae8b8 Add helpful output at runtime for wellgraph 2021-10-25 14:41:30 +02:00
Jostein Alvestad
85367ec6d7 corrections/improvements based on comments from reviewer 2021-10-25 14:27:28 +02:00
Jostein Alvestad
6830a8581e added incorrectly deleted files 2021-10-25 14:27:26 +02:00
Jostein Alvestad
6b7875765d added unit tests to InteHead and DoubHead for NETBALAN 2021-10-25 14:27:23 +02:00
Jostein Alvestad
60d57f06b7 added DOUBHEAD items for NETBALAN 2021-10-25 14:27:20 +02:00
Jostein Alvestad
d1a1050e67 small correction to code 2021-10-25 14:27:18 +02:00
Jostein Alvestad
2911e11033 added changes to write NETBALAN keyword data to InteHead 2021-10-25 14:27:16 +02:00
Joakim Hove
e323c4a88c Make sure Schdule keyword is retained in FileDeck::skip 2021-10-24 10:08:46 +02:00
Joakim Hove
5f0bd0a5c7 Implement FileDeck::Index::operator+(std::size_t shift) 2021-10-24 10:01:48 +02:00
Joakim Hove
344dd516a0 Fix rst_deck for non skiprest 2021-10-23 17:49:22 +02:00
Joakim Hove
822a97c8d9 Load LIFTOP options from restart file 2021-10-22 15:53:03 +02:00
Joakim Hove
737a76918f Load WLIFTOPT wells from restart file 2021-10-22 15:25:38 +02:00
Joakim Hove
58c0e7d868 Load GasLift settings from restart file 2021-10-22 15:25:38 +02:00
Joakim Hove
741bd5da95 Merge pull request #2777 from joakim-hove/wliftopt-update
Add two extra items for WLIFTOPT restart output
2021-10-22 15:24:42 +02:00
Joakim Hove
a2d217ad36 Add two extra items for WLIFTOPT restart output 2021-10-22 13:30:24 +02:00
Joakim Hove
a1942ccec7 Merge pull request #2778 from atgeirr/bump-version
Bump version.
2021-10-22 13:24:20 +02:00
Atgeirr Flø Rasmussen
bd9bc77129 Bump version. 2021-10-22 10:17:59 +02:00
Williham Williham Totland
4134b98701 Introduce class SchduleGrid to be used as grid by Schedule class 2021-10-22 08:35:17 +02:00
Joakim Hove
798e93e4a8 Merge pull request #2774 from blattms/dune-2.8-imported-targets
Define imported targets needed e.g. for dune-fem 2.8.0
2021-10-21 20:17:43 +02:00
Markus Blatt
c6e1730a0a Search for GMP if dune-common is used.
We do suggest dune-fem for opm-models and that one links to it
if available.
2021-10-21 15:33:02 +02:00
Markus Blatt
e67a55bf86 dune-fem uses QuadMath if available, search for it.
One still has to set USE_QUADMATH to true otherwise no
search will happen.
2021-10-21 15:30:44 +02:00
Markus Blatt
d577b74106 Introduced DUNE-2.8 compatible imported targets where needed.
I.e. in the find_package files for PTScotch ParMETIS, Quadmath,
SuiteSparse, and SuperLU.
2021-10-21 15:29:12 +02:00
Markus Blatt
c713d540e6 Adds a rudimentary FindTBB.cmake to make DUNE 2.8 with TBB work
Fixes errors like

Target "test_communication_utils" links to target
"PkgConfig::PkgConfigTBB" but the target
was not found.  Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
2021-10-20 22:06:29 +02:00
Markus Blatt
22e9452de0 Search for TBB in Finddune-common.cmake
When configured with TBB dune-common-targets.cmake lists the
imported TBB::tbb or PkgConfig::PkgConfigTBB target
in INTERFACE_LINK_LIBRARIES. Hence we need to be able to resolve
this target in opm. We do this by searching for TBB id dune-common
is a prerequisite.

This commit fixes the problem only for newer versions of TBB shipping a
TBBConfig.cmake file.

The error fixed is along these lines:

Target "test_communication_utils" links to target "TBB::tbb" but the target
was not found.  Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
2021-10-20 22:06:29 +02:00
Bård Skaflestad
e7d528e1d2 Merge pull request #2427 from bska/connection-cumulatives-restart
Save/Restore Connection Level Cumulatives to/from Restart
2021-10-20 17:04:23 +02:00
Bård Skaflestad
65538e3ac9 Save/Restore Connection Level Cumulatives to/from Restart
This commit add support for saving connection-level cumulative
quantities (e.g., those denoted by summary vectors COPT or CVIT) to
the restart file (in the 'XCON' array) and to restore these values
back to the 'SummaryState' object upon simulation restart.

Thanks to Torbjørn Skille and Jostein Alvestad for invaluable
assistance in characterising these XCON items.
2021-10-20 15:47:12 +02:00
Bård Skaflestad
8d1e13fd0c Configure Additional Summary Quantites for Restart
In particular, ensure that connection-level cumulatives are always
available in the SummaryState.  Also generate the connection-level
flowing gas/oil ratio (CGOR) while here.
2021-10-20 15:47:12 +02:00
Bård Skaflestad
941df67e24 Identify More Connection Restart Items
In particular, add named items for cumulative production and
injection in the XCON array.  These are needed in order to generate
continuous connection-level curves in restarted runs.

While here, also add a named item for the well-level cumulative oil
injection quantity.
2021-10-20 15:47:12 +02:00
Bård Skaflestad
9f0185018e Merge pull request #2769 from joakim-hove/rst-deck-skip
Rst deck skip
2021-10-20 15:45:30 +02:00
Joakim Hove
ace87a357a Handle skipping in SCHEDULE section 2021-10-20 14:02:13 +02:00
Bård Skaflestad
9c5df232ed Merge pull request #2768 from joakim-hove/update-test-data
Update test data
2021-10-20 12:58:09 +02:00
Joakim Hove
1044be41a2 Replace DATES -> TSTEP for restart testing 2021-10-20 11:28:34 +02:00
Joakim Hove
f644bf1659 Insert comment with report step in DATES testdata 2021-10-20 09:35:39 +02:00
Joakim Hove
6ca08afb74 Merge pull request #2763 from joakim-hove/wtmult-simple
Basic support for WTMULT
2021-10-20 08:31:43 +02:00
Joakim Hove
24d1f58aca Merge pull request #2767 from joakim-hove/rst-deck-output
Rst deck output
2021-10-20 08:01:21 +02:00
Bård Skaflestad
5e3ba88dde Merge pull request #2759 from joakim-hove/restart-errors
Validate restart input in constructor
2021-10-19 21:52:54 +02:00
Joakim Hove
93de5d5f69 Use default aware function when building DeckKeyword 2021-10-19 19:13:15 +02:00
Joakim Hove
22edbe79ab DeckKeyword - slash termination correctly initialized 2021-10-19 19:13:15 +02:00
Joakim Hove
a22458a592 Use {} for constructor call 2021-10-19 13:26:26 +02:00
Bård Skaflestad
8d16838e6f Merge pull request #2766 from OPM/fix/missing-includes
fix missing includes
2021-10-19 13:20:19 +02:00
Bernd Flemisch
60477ac627 fix missing includes 2021-10-19 12:07:48 +02:00
Joakim Hove
5e3e20c552 Implement basic WTMULT behavior 2021-10-19 11:59:49 +02:00
Arne Morten Kvarving
648abeef1f Merge pull request #2765 from akva2/janitoring
remove unused variables
2021-10-19 11:49:55 +02:00
Joakim Hove
a3d37aad1e Remove comment about UDA in WTMULT 2021-10-19 11:12:32 +02:00
Joakim Hove
14453560da Add UDAValue::operator*= 2021-10-19 11:12:06 +02:00
Arne Morten Kvarving
d65c232057 remove unused variables 2021-10-19 10:53:34 +02:00
Bård Skaflestad
726a0589ec Merge pull request #2760 from joakim-hove/handle-nextstep
Internalize NEXTSTEP keyword and interact with TUNING.TSINIT
2021-10-18 18:34:14 +02:00
Bård Skaflestad
dc633cdee9 Merge pull request #2764 from akva2/janitoring
fixed: forward struct as struct
2021-10-18 17:33:29 +02:00
Arne Morten Kvarving
ff5c3b9574 fixed: forward struct as struct 2021-10-18 15:42:48 +02:00
Joakim Hove
5bd9906569 Merge pull request #2761 from bska/sumthin-rptonly-smry-sect
Initialize RPTONLY/SUMTHIN Settings From SUMMARY Section
2021-10-18 13:09:43 +02:00
Bård Skaflestad
70bb2afe93 Merge pull request #2762 from akva2/janitoring
avoid signed/unsigned comparison warnings
2021-10-18 13:04:34 +02:00
Arne Morten Kvarving
076f12cb34 avoid signed/unsigned comparison warnings 2021-10-18 11:50:47 +02:00
Bård Skaflestad
6ffe20ddc8 Initialize RPTONLY/SUMTHIN Settings From SUMMARY Section 2021-10-18 11:17:34 +02:00
Joakim Hove
1a1edf01b5 Internalize NEXTSTEP keyword and interact with TUNING.TSINIT 2021-10-18 10:11:21 +02:00
Bård Skaflestad
74fa193b82 Sort Includes in Schedule.hpp 2021-10-18 09:47:41 +02:00
Bård Skaflestad
6da7c3c88e Merge pull request #2756 from joakim-hove/rst-wlist
Rst wlist
2021-10-18 09:46:12 +02:00
Joakim Hove
f892fbeb18 Merge pull request #2758 from joakim-hove/wtest-filter-wells
Filter out wells from WellTestState
2021-10-18 08:09:38 +02:00
Joakim Hove
a13376c2d1 Better error messages when the RESTART keyword is invalid 2021-10-17 19:59:29 +02:00
Joakim Hove
99ff9adca5 Filter out wells from WellTestState 2021-10-17 19:41:56 +02:00
Bård Skaflestad
9d0d13296d Merge pull request #2752 from akva2/improve_test_drivers
use -e when passing exename to test drivers
2021-10-17 17:33:53 +02:00
Joakim Hove
091ec36c28 Load WLIST from restart file 2021-10-15 13:15:33 +02:00
Joakim Hove
0f0dcea773 Fix bug with group offset in UDQACtive 2021-10-15 13:13:01 +02:00
Atgeirr Flø Rasmussen
3b2d650f8d Merge pull request #2757 from atgeirr/silence-struct-class-warning
Use struct consistently for Tuning.
2021-10-15 08:34:24 +02:00
Atgeirr Flø Rasmussen
8d123ea7ab Use struct consistently for Tuning. 2021-10-15 07:19:09 +02:00
Tor Harald Sandve
0dff883914 Merge pull request #2743 from daavid00/micp-2021-10
micp
2021-10-14 22:27:43 +02:00
daavid00
a26b69e91e Adding the SIScaling in MICPTests for correct parameetr conversion 2021-10-14 22:11:50 +02:00
daavid00
ae8baba566 Removing EQLDIMS word in MICPTests for jenkins building 2021-10-14 21:04:28 +02:00
daavid00
60d5cd2c70 Adding missing words to MICPTests for jenkins building 2021-10-14 20:41:22 +02:00
daavid00
ae5c09243a adding one test for the MICP keywords 2021-10-14 19:31:07 +02:00
daavid00
60963e2310 first version of micp implementation in flow 2021-10-14 17:27:13 +02:00
Joakim Hove
35f35541ff Add testdata for WLIST restart testing 2021-10-14 11:41:40 +02:00
Joakim Hove
7b23110ccc Merge pull request #2753 from joakim-hove/wconprod-question-pattern
Ensure that matched wells are passed to WCONPROD and WCONINJE
2021-10-14 07:22:07 +02:00
Joakim Hove
aaed77da09 Merge pull request #2754 from joakim-hove/rst-deck-testing
Move some code from rst_deck application to FileDeck class
2021-10-14 07:21:53 +02:00
Joakim Hove
fa77a72e61 Merge pull request #2755 from bska/use-mutable-error-guard
Confer 'trim_wgname' Errors Back to Caller
2021-10-14 07:21:04 +02:00
Bård Skaflestad
64d0db7a26 Confer 'trim_wgname' Errors Back to Caller
Mutating a copy of the ErrorGuard object means we potentially lose
error conditions.
2021-10-13 22:37:10 +02:00
Joakim Hove
82b112305e Move some code from rst_deck application to FileDeck class 2021-10-13 14:51:02 +02:00
Joakim Hove
e101020f33 Add FileDeck::Index::operator< 2021-10-13 14:37:25 +02:00
Bård Skaflestad
117c9179fa Merge pull request #2739 from bska/restore-guiderate
Add Means of Initialising GR Values in SI Units
2021-10-13 14:01:25 +02:00
Joakim Hove
1e0c65163b Ensure that matched wells are passed to WCONPROD and WCONINJE 2021-10-13 12:33:36 +02:00
Bård Skaflestad
05e449440a Add Means of Initialising GR Values in SI Units
Intended use case is reading initial guide-rate values from the
restart file.
2021-10-13 11:41:23 +02:00
Bård Skaflestad
dcaf86e443 Hook Production Groups Into Guide Rate System at Restart
Otherwise, groups that have a non-trivial guide rate definition
won't be a part of group-level controls (GCONPROD) when continuing
the simulation run.
2021-10-13 11:41:23 +02:00
Bård Skaflestad
e451babec7 Restore Guiderate's Nominated Phase From Restart File 2021-10-13 11:41:23 +02:00
Bård Skaflestad
0c8f270723 Use min_element to Determine When GR Values Have Expired
This reduces the amount of mutable state being processed.
2021-10-13 11:41:23 +02:00
Bård Skaflestad
79a856ab20 Simplify Logic to Determine When to Reuse GR Values
Using map<>::find() means we also don't need to perform repeated
name-based lookups.
2021-10-13 11:41:23 +02:00
Bård Skaflestad
55ac8ff824 Make GuideRate Implementation Tidier
Mark parameters 'const' where possible, make value state private,
and wrap long lines.
2021-10-13 11:41:23 +02:00
Joakim Hove
0c2645154f Merge pull request #2747 from joakim-hove/wtest-state-rst-load
Wtest state rst load
2021-10-13 11:27:50 +02:00
Arne Morten Kvarving
53cfb50d75 use -e when passing exename to test drivers 2021-10-13 11:27:47 +02:00
Bård Skaflestad
9a866a8a10 Merge pull request #2751 from bska/report-siunits-injgr-grouplevel
Add Guide Rate Value Accessor for SI Units
2021-10-13 10:56:57 +02:00
Bård Skaflestad
d3ccb820af Add Guide Rate Value Accessor for SI Units
Needed to properly report group-level injection guide rates in the
summary file.

Forgotten in PR #2605 (commit 2a374fc53).
2021-10-13 09:53:39 +02:00
Joakim Hove
06fd01c6ba Create WellTestState object from restart file 2021-10-13 08:46:11 +02:00
Joakim Hove
ee92f53b72 Merge pull request #2746 from joakim-hove/wtest-load-rst
Wtest load rst
2021-10-13 08:43:06 +02:00
Joakim Hove
7a1869fa60 Load WTEST configuration from restart file 2021-10-12 17:04:18 +02:00
Joakim Hove
af253dde47 Merge pull request #2748 from joakim-hove/wtest-serialize
Enable serialize support for WellTestState
2021-10-12 17:03:23 +02:00
Joakim Hove
4d72677b57 Merge pull request #2750 from joakim-hove/rst_deck_bugfix
Fix bug in SOLUTION section iteration in rst_deck
2021-10-12 13:05:47 +02:00
Joakim Hove
b440860478 Fix bug in SOLUTION section iteration in rst_deck 2021-10-12 12:06:46 +02:00
Joakim Hove
c5267ad7e6 Merge pull request #2745 from joakim-hove/wtest-state-is-open
Remove WellTestState::xxx_is_open() predicates
2021-10-12 09:17:35 +02:00
Joakim Hove
c56165b2d0 Enable serialize support for WellTestState 2021-10-12 07:57:41 +02:00
Joakim Hove
178fd6462c Remove WellTestState::xxx_is_open() predicates 2021-10-11 17:26:51 +02:00
Joakim Hove
f1c51b549a Merge pull request #2718 from joakim-hove/wtest-restart
Wtest restart
2021-10-11 17:25:56 +02:00
Joakim Hove
7f24433337 Write WTEST configuration and state to restart file 2021-10-10 13:06:28 +02:00
Joakim Hove
f7b09380d4 Add WellTestState argument to AggregateWellData functions 2021-10-10 12:11:29 +02:00
Joakim Hove
bc6e2b268a Merge pull request #2737 from joakim-hove/wtest-state-refactor2
Wtest state refactor2
2021-10-10 09:54:08 +02:00
Joakim Hove
139e988598 Refactor WellStateTest to use map storage internally 2021-10-08 18:34:47 +02:00
Joakim Hove
5bd7b61075 Rename updateWells -> test_wells 2021-10-08 14:15:16 +02:00
Joakim Hove
e41a8dfbf1 Remove ecl wells from WellTestState::update call 2021-10-08 14:15:14 +02:00
Joakim Hove
69e0a49e55 Merge pull request #2742 from joakim-hove/welltest-state-rename
Welltest state rename
2021-10-08 14:06:52 +02:00
Joakim Hove
b317e1e8d8 WellTestState::dropCompletion -> WellTestState::open_completion 2021-10-08 12:56:48 +02:00
Joakim Hove
ac6a8f91d6 WellTestState::openWell -> WellTestState::open_well 2021-10-08 12:56:48 +02:00
Joakim Hove
a5ee46c195 WellTestState::hasWellClosed -> WellTestState::well_is_closed 2021-10-08 12:56:48 +02:00
Joakim Hove
60f0c3f260 WellTestState::closeWell -> WellTestState::close_well 2021-10-08 12:56:47 +02:00
Joakim Hove
c202ccfb46 WellTestState::hasCompletion -> WellTestState::completion_is_closed 2021-10-08 12:56:47 +02:00
Joakim Hove
d840b72ed5 WellTestState::addClosedCompletion - WellTestState::close_completion 2021-10-08 12:56:47 +02:00
Joakim Hove
52dde24faf WellTestState::openAllCompletions -> WellTestState::open_completions 2021-10-08 12:56:47 +02:00
Joakim Hove
b39cf81142 Renome unused function WellTestState::updateCompletion() 2021-10-08 12:56:47 +02:00
Joakim Hove
04bbb164d9 Merge pull request #2741 from dafeda/find_boost
Use built in FindBoost
2021-10-08 10:46:58 +02:00
Bård Skaflestad
72e4f5f774 Merge pull request #2738 from bska/restore-group-control
Restore Group Level Controls if Limits Exist
2021-10-08 10:13:21 +02:00
Bård Skaflestad
3ac75ed2fc Restore Group Level Controls if Limits Exist
A group may have limits but no active control at the time of restart.
2021-10-07 21:59:27 +02:00
Bård Skaflestad
687d98aeea Restore Limited Version of Exceed Action From Restart File
Applies to group-level production controls.
2021-10-07 21:59:27 +02:00
Bård Skaflestad
de0d603215 Merge pull request #2735 from bska/restore-history-cmode
Restore Well Level History Control Mode From Restart File
2021-10-07 21:01:38 +02:00
Bård Skaflestad
f1cdcdb0e9 Restore History Control Mode From Restart File
In this case, we must also discard all other limits to ensure we
don't accidentally change control modes until explicitly reset with
a new WCONHIST or WCONINJH keyword.
2021-10-07 15:49:13 +02:00
Bård Skaflestad
f2a98d2a8b Create Helper Functions to Determine Active Well Controls
While here, also check that history mode injectors use only RATE or
BHP controls.
2021-10-07 15:49:13 +02:00
Bård Skaflestad
0a266f460d Add Means of Discarding All Well Level Injection Controls
Needed when restoring history mode injectors from restart files.
2021-10-07 15:49:13 +02:00
Bård Skaflestad
5f0177e275 Merge pull request #2734 from bska/reset-actnum-eclipsestate
Support Resetting ACTNUM At EclipseState Level
2021-10-07 15:45:16 +02:00
Bård Skaflestad
fe2a3f5203 Support Resetting ACTNUM At EclipseState Level
Mostly a convenience method that avoids resorting to ugly const_cast
expressions in client code.
2021-10-07 14:50:50 +02:00
Bård Skaflestad
b3befa57fe Merge pull request #2730 from bska/prune-deactivated-anconn
Add Means of Pruning Deactivated Aquifer Connections
2021-10-07 14:49:35 +02:00
Bård Skaflestad
75ee817fed Add Means of Pruning Deactivated Aquifer Connections
This commit adds operation pruneDeactivatedAquiferConnections at
the EclipseState and AquiferConfig levels.  This is intended as a
stop-gap solution to a sequencing problem that arises from MINPV
processing.  In general we must not form connections to analytic
aquifers until the set of active grid cells is fully established.

Pruning cells that become deactivated as part of MINPV handling
nevertheless covers the common case of connection boxes applying
only to the outer shell.  Solving the problem in general will
however require delaying forming the analytic aquifer connections
until after the active cells are fully known.
2021-10-07 12:31:08 +02:00
Arne Morten Kvarving
0c7dc81814 Merge pull request #2740 from akva2/janitoring
anonymize parameter to quell compiler warning
2021-10-07 12:27:18 +02:00
Feda Curic
c2e8eabc2f Use built in FindBoost 2021-10-07 12:11:54 +02:00
Arne Morten Kvarving
c240581785 anonymize parameter to quell compiler warning 2021-10-07 11:10:29 +02:00
Joakim Hove
d2b221da64 Merge pull request #2736 from joakim-hove/welltest-state-wells-size
WellTestState: will only count actually closed wells
2021-10-07 09:27:34 +02:00
Joakim Hove
d78cdfbe7f WellTestState: will only count actually closed wells 2021-10-06 17:51:15 +02:00
Joakim Hove
d4baf44e1b Merge pull request #2727 from joakim-hove/netbalan-units
Handle NETBALAN keyword in Schedule section
2021-10-06 08:00:38 +02:00
Joakim Hove
d05f152100 Merge pull request #2722 from joakim-hove/add-wtest-state-argument
2: Add WellTestState argument to IO routines
2021-10-05 07:31:31 +02:00
Joakim Hove
75d05312b7 Add WellTestState argument to IO routines 2021-10-04 20:42:39 +02:00
Joakim Hove
2e6daf088b Merge pull request #2724 from joakim-hove/wtest-state-serialize
1: Wtest state serialize
2021-10-04 20:40:41 +02:00
Joakim Hove
e1b9602a25 Handle NETBALAN keyword in Schedule 2021-10-04 13:43:19 +02:00
Joakim Hove
0074364560 Merge pull request #2729 from joakim-hove/netbalan-commits
Netbalan commits
2021-10-04 13:42:58 +02:00
Joakim Hove
72ba5b8d36 Merge pull request #2728 from joakim-hove/cmp-network
Add network member to ScheduleState::operator==()
2021-10-04 13:11:24 +02:00
Joakim Hove
c6dc9277c5 Add units to JSON specification for NETBALAN keyword 2021-10-04 12:27:03 +02:00
Joakim Hove
a1f924baec Fix typo in json file 2021-10-04 12:27:03 +02:00
Joakim Hove
0e0c72edd5 Remove stale comments 2021-10-04 12:27:03 +02:00
Joakim Hove
4aea8cd584 Add network member to ScheduleState::operator==() 2021-10-04 12:23:42 +02:00
Joakim Hove
3ca639e2dd Add serialization support for WellTestState 2021-10-01 14:14:05 +02:00
Joakim Hove
bffa3a3768 Extracted buffer test class to separate compilation unit for reuse 2021-10-01 14:14:05 +02:00
Joakim Hove
cd1c40dbcb Merge pull request #2726 from totto82/fixUnitWECON
fix unit item 5 and item 6 WECON
2021-10-01 14:08:50 +02:00
Tor Harald Sandve
fad9305cdc fix unit item 5 and item 6 WECON 2021-10-01 12:55:43 +02:00
Joakim Hove
27ec5e0ea5 Merge pull request #2725 from joakim-hove/strip-actionx-cond-quotes
Strip the quotes when creating Actionx::Condition instance
2021-10-01 11:09:25 +02:00
Joakim Hove
21c53158ad Strip the quotes when creating Actionx::Condition instance 2021-09-30 17:17:50 +02:00
Joakim Hove
bd4386c79b Merge pull request #2723 from totto82/openComp
add method that open all completions
2021-09-30 16:43:29 +02:00
Tor Harald Sandve
cc24920ff9 add method that open all completions 2021-09-30 11:46:19 +02:00
Joakim Hove
9a2a4036de Merge pull request #2720 from joakim-hove/wtest-overwrite
WTEST - consecutive keywords overwrite instead of updating
2021-09-30 10:31:23 +02:00
Bård Skaflestad
05bac5f59a Merge pull request #2719 from OPMUSER/master
Add WTEST to Allowed ACTIONX Keywords
2021-09-29 18:41:28 +02:00
Bård Skaflestad
53dcb5c8a0 Merge pull request #2721 from blattms/fix-fs-proximare-gcc7
Fix compilation with g++-7 lacking fs::proximate
2021-09-29 18:40:00 +02:00
Bård Skaflestad
7ecbf4725a Merge pull request #2714 from jalvestad/rstfieldctrl-r
Improve Eclipse-compatible restart file. Output correct Guiderate control and FIELD level control
2021-09-29 17:07:08 +02:00
Markus Blatt
49bfad1779 Fix compilation with g++-7 lacking fs::proximate
Use Opm::prximate instead of fs::proximate. Fixes
compilation issue like
```
opm-common/src/opm/parser/eclipse/Deck/FileDeck.cpp: In member function ‘void Opm::FileDeck::dump_shared(std::ostream&, const string&) const’:
opm-common/src/opm/parser/eclipse/Deck/FileDeck.cpp:331:44: error: ‘proximate’ is not a member of ‘fs’
             std::string include_file = fs::proximate(block.fname, output_dir);
```
2021-09-29 16:36:03 +02:00
Joakim Hove
05c6fb3cbd WTEST - consecutive keywords overwrite instead of updating 2021-09-29 14:00:04 +02:00
OPMUSER
491275cfc7 Update SummaryConfigTests.cpp 2021-09-29 19:57:24 +08:00
OPMUSER
7d0bf1adde Remove FSIP from ALL keyword Vector List
FSIP (Field Salt In-Place) is not part of the SUMMARY ALL keyword vector list.
2021-09-29 19:08:06 +08:00
OPMUSER
97dd24c7ee Add WTEST to Allowed ACTIONX Keywords
Add WTEST to allowed ACTIONX Keywords
2021-09-29 18:54:03 +08:00
Joakim Hove
3369785c7d Merge pull request #2715 from bska/restore-bhp-hist-limit
Set Appropriate Restart BHP Limit for History Wells
2021-09-28 21:52:43 +02:00
Bård Skaflestad
b97819a121 Set Appropriate Restart BHP Limit for History Wells
Without this we would end up with very wrong BHP limits for this
case--e.g., upper BHP limit of 1 ATM for injectors--and this would
obviously mean that restarted runs do not converge.
2021-09-28 12:01:59 +02:00
Bård Skaflestad
88b6cebb19 Fix Spelling 2021-09-28 12:01:59 +02:00
Joakim Hove
1db095c69b Merge pull request #2717 from OPMUSER/master
Add WECON to Allowed ACTIONX Keywords
2021-09-28 11:57:26 +02:00
Bård Skaflestad
3c23f90cfe Merge pull request #2711 from totto82/wtest_ref
return unique vector of names and not a map with wells and reason
2021-09-28 11:30:36 +02:00
OPMUSER
a0b6e7533b Add WECON to Allowed ACTIONX Keywords 2021-09-28 16:18:35 +08:00
Tor Harald Sandve
cb6db86afe return unique vector of names and not a map with wells and reason 2021-09-28 10:07:45 +02:00
Joakim Hove
caacf4e047 Merge pull request #2716 from joakim-hove/fix-udqstate-serialize-object
Fix serializeObject in UDQState
2021-09-28 09:54:02 +02:00
Joakim Hove
2edfbc42e1 Fix serializeObject in UDQState 2021-09-28 09:01:06 +02:00
Joakim Hove
b39e32a221 Merge pull request #2712 from joakim-hove/serialize-action-state
Serialize Action::State
2021-09-27 13:47:22 +02:00
Jostein Alvestad
77b86dfd3b final changes for corretions to IGRP[nwgmax+WInjActiveCMode] and IGRP[nwgmax+GConInjeWInjCMode] plus similar gas inj 2021-09-27 12:24:34 +02:00
Jostein Alvestad
b97931ddd5 first changes to improve guiderate output to restart file - enums mapping 2021-09-27 12:24:32 +02:00
Arne Morten Kvarving
94d15ca921 Merge pull request #2713 from akva2/fix_rh_rst_deck
fix redhat packaging
2021-09-27 08:14:54 +02:00
Arne Morten Kvarving
e8a8688a48 fix redhat packaging
due to new man page
2021-09-27 08:14:26 +02:00
Joakim Hove
f05fbe281a Add serializer support for UDQState 2021-09-25 11:51:34 +02:00
Joakim Hove
cb5eef07a6 Serialize Action::State 2021-09-25 08:29:27 +02:00
Arne Morten Kvarving
beb78ca1f9 Merge pull request #2710 from akva2/fix_semicolon
fixed: sneaky ; was supposed to be :
2021-09-24 22:27:45 +02:00
Joakim Hove
5a3eca0fe5 Merge pull request #2684 from joakim-hove/file-deck
rst_deck: application to create a deck prepared for restart
2021-09-24 18:46:45 +02:00
Joakim Hove
04dd44488b Merge pull request #2709 from joakim-hove/rst-update-tuning-bug
Fix out of bounds write
2021-09-24 18:45:42 +02:00
Joakim Hove
cc0b9add62 Add integration testing of rst_deck 2021-09-24 14:19:25 +02:00
Joakim Hove
24f31e6358 Add application rst_deck 2021-09-24 14:19:25 +02:00
Arne Morten Kvarving
ed445c9bb2 fixed: do not keep tacking on PYTHONPATH for each build configuration 2021-09-24 14:02:11 +02:00
Joakim Hove
d94db10da4 Fix out of bounds write 2021-09-24 08:34:24 +02:00
Joakim Hove
294d98b9bd Add container FileDeck to represent a deck with file awareness 2021-09-23 21:46:10 +02:00
Joakim Hove
a172879395 Assemble DeckTree during parse process 2021-09-23 14:24:35 +02:00
Joakim Hove
6f94580ff1 Add class DeckTree to mange include file hierarchy 2021-09-23 14:24:35 +02:00
Joakim Hove
a39c707282 Merge pull request #2705 from joakim-hove/opmhash-multi
Add multi deck comparison to opmhash
2021-09-23 14:23:59 +02:00
Bård Skaflestad
b807f39357 Merge pull request #2706 from joakim-hove/use-strtod
Use strtod
2021-09-23 11:26:34 +02:00
Joakim Hove
4910e75d63 Avoid try catch when parsing floating point numbers in UDQ 2021-09-23 10:23:25 +02:00
Joakim Hove
97455adfa6 Add utility function to parse string -> double without exception 2021-09-23 10:23:25 +02:00
Bård Skaflestad
f21239c5a7 Merge pull request #2707 from akva2/set_python_path
set python path in jenkins build script
2021-09-23 10:01:13 +02:00
Arne Morten Kvarving
cc4cc85361 fixed: support cmake 3.13
the Python3 find module only sets Python3_VERSION_XXX,
not PYTHON_VERSION_XXX
2021-09-23 08:43:30 +02:00
Arne Morten Kvarving
7a65fe951e set python path in jenkins build script 2021-09-23 08:29:38 +02:00
Bård Skaflestad
e0e26df2ae Merge pull request #2701 from goncalvesmachadoc/fieldInPlace
add field volumes in place to summary
2021-09-22 21:53:58 +02:00
Joakim Hove
1a7e2edf52 Add multi deck comparison to opmhash 2021-09-22 18:23:35 +02:00
Joakim Hove
ceb03e889d Merge pull request #2698 from joakim-hove/load-action-state
Load action state
2021-09-22 12:35:52 +02:00
Joakim Hove
a8afa7a50f Load run_count and last runtime for actionx from restart file 2021-09-22 00:27:59 +02:00
Joakim Hove
d338325147 Merge pull request #2699 from joakim-hove/numerical-month
Round numerical month values to integer before comparison
2021-09-22 00:27:35 +02:00
Joakim Hove
33a791d499 Merge pull request #2696 from joakim-hove/actionx-strip-quotes
Remove quotes before creating ACTIONX AST
2021-09-22 00:27:16 +02:00
Joakim Hove
745fe11b87 Merge pull request #2704 from joakim-hove/use-proximate
Use fs:proximate() due to missing fs::relative()
2021-09-21 14:59:14 +02:00
Joakim Hove
0213cbad17 Merge pull request #2702 from joakim-hove/deck-tree-commitsII
Deck tree commits ii
2021-09-21 13:43:05 +02:00
Joakim Hove
7f9f20b84e Merge pull request #2700 from hakonhagland/pybind_shared
Use std::shared_ptr as holder type for some Pybind11 classes
2021-09-21 13:33:42 +02:00
Joakim Hove
1f0c3133c6 Use Opm::proximate() due to missing fs::relative() 2021-09-21 13:20:15 +02:00
Joakim Hove
bb5ddb477e Mark TSTEP as keyword which should be split on output 2021-09-21 10:36:20 +02:00
Joakim Hove
ca3eae90ff Add Deck::operator[]() 2021-09-21 10:36:20 +02:00
Joakim Hove
8fffd10ec3 Add DeckKeyword::operator[]() 2021-09-21 10:36:20 +02:00
Joakim Hove
73a3e1d095 Add methods Deck::size() and Deck::empty() 2021-09-21 10:36:20 +02:00
Joakim Hove
daaee6d2a4 Accept numerical month values when outputting ACTIONX state for rst 2021-09-20 19:05:06 +02:00
Joakim Hove
fcad042bdd Round numerical month values to integer before comparison 2021-09-20 19:04:34 +02:00
Joakim Hove
111d1f7ea7 Merge pull request #2697 from joakim-hove/runspec-sim-start
Runspec sim start
2021-09-20 19:03:17 +02:00
Joakim Hove
9a8fae2a88 Merge pull request #2695 from joakim-hove/max-action-conditions
Check number of conditions in ACTIONX with ACTDIMS
2021-09-20 19:02:50 +02:00
Joakim Hove
87f3d039f3 Merge pull request #2693 from joakim-hove/deck-tree-commits
Deck tree commits
2021-09-20 19:02:09 +02:00
goncalvesmachadoc
8698d20d0f add volumes in place to summary 2021-09-20 17:55:08 +02:00
Bård Skaflestad
05e147105e Merge pull request #2694 from totto82/aquct15
add item 13 in AQUCT
2021-09-20 12:18:44 +02:00
Håkon Hægland
29c4ffcdc9 Use std::shared_ptr as holder type.
Use std::shared_ptr as holder type for some Pybind11 classes such that
they can be shared with opm.simulators.
2021-09-20 11:43:50 +02:00
Tor Harald Sandve
c84d52d964 add item 13 in AQUCT 2021-09-20 10:05:13 +02:00
Joakim Hove
e9c9d9b5e3 Use Runspec start_time when assembling ScheduleDeck 2021-09-19 11:23:47 +02:00
Joakim Hove
b8c09945a3 Internalize start time in Runspec 2021-09-19 11:16:25 +02:00
Joakim Hove
8d63e4f20d Moved time related functions from ScheduleDeck to TimeService 2021-09-19 11:06:52 +02:00
Joakim Hove
67b850d086 Remove quotes before creating ACTIONX AST 2021-09-18 20:48:40 +02:00
Joakim Hove
56f5ae6558 Check number of conditions in ACTIONX with ACTDIMS 2021-09-18 18:46:12 +02:00
Joakim Hove
1ef317a66b Normalize include file paths 2021-09-17 14:40:59 +02:00
Joakim Hove
b936b3f7d4 Normalize argument path before internalizing 2021-09-17 14:10:50 +02:00
Joakim Hove
4920b0ea3a Disallow multiple assignments to Deck::datafile 2021-09-17 12:05:51 +02:00
Joakim Hove
0355a71abd Merge pull request #2690 from joakim-hove/readonly-testing
Readonly testing
2021-09-17 12:05:32 +02:00
Arne Morten Kvarving
7894aaf073 Merge pull request #2692 from akva2/janitoring
fixed: use curly-braces
2021-09-17 11:06:36 +02:00
Arne Morten Kvarving
6a69a985cd fixed: use curly-braces
the parantheses confused the preprocessor
2021-09-17 10:49:52 +02:00
Joakim Hove
7562781a8b Readonly summary testing 2021-09-17 10:01:17 +02:00
Joakim Hove
ca59665575 Run ERst tests in readonly tests/ 2021-09-17 10:01:17 +02:00
Joakim Hove
9478bf0292 Run EclIO tests in readonly tests/ 2021-09-17 10:01:17 +02:00
Joakim Hove
41c97ad6a2 Make sure regression test testing can go in readonly tests/ 2021-09-17 10:01:17 +02:00
Joakim Hove
08f9140191 Summary testing with readonly tests/ 2021-09-17 10:01:17 +02:00
Joakim Hove
5b3cd8b908 Ensure RFT testing can be done in readonly tests/ 2021-09-17 10:01:17 +02:00
Joakim Hove
1f8e545ea1 Make sure summary testing can be done with readonly tests/ 2021-09-17 10:01:17 +02:00
Joakim Hove
2d879941fe Ensure UDQ tests can run in readonly tests/ 2021-09-17 10:01:17 +02:00
Joakim Hove
5c0aec538b Make sure test can run in readonly tests/ 2021-09-17 10:01:17 +02:00
Joakim Hove
d3cd4c73ba Make sure tests can be run with readonly tests/ 2021-09-17 10:01:17 +02:00
Joakim Hove
d938b69143 WorkArea::org_path 2021-09-17 10:01:17 +02:00
Joakim Hove
c0d7ca8136 Merge pull request #2687 from joakim-hove/rsm-cmp-zero
Special case comparison with zero
2021-09-16 13:38:26 +02:00
Joakim Hove
60bdfb6a93 Special case comparison with zero 2021-09-16 12:56:08 +02:00
Joakim Hove
a775808972 Merge pull request #2685 from joakim-hove/rsm-summary-compare-fix
Compare with startdate and not first simulation date
2021-09-15 23:58:12 +02:00
Joakim Hove
8821b27556 Special case rsm <-> summary comparison for zero values 2021-09-15 20:44:39 +02:00
Joakim Hove
8f263e637b Merge pull request #2664 from joakim-hove/rst-actionx-keywords
Rst actionx keywords
2021-09-15 16:03:09 +02:00
Joakim Hove
d53984c72d Add trailing newline to error message 2021-09-15 14:38:27 +02:00
Joakim Hove
75add72412 Load action keywords from restart file 2021-09-15 14:29:28 +02:00
Joakim Hove
a9c987b70f Some simplification in ZLACT book keeping 2021-09-15 14:29:28 +02:00
Joakim Hove
21d1b63164 Compare with startdate and not first simulation date 2021-09-15 14:04:53 +02:00
Joakim Hove
d64d138147 Merge pull request #2660 from joakim-hove/split-udq-eval
Split udq eval in eval_assign() and eval_define()
2021-09-14 20:06:14 +02:00
Joakim Hove
df8e14a8ac Throw exception if unknown UDQ is used as UDA 2021-09-14 15:58:59 +02:00
Joakim Hove
d880637a65 Utility function UDQ::controlName(UDAControl) -> std::string 2021-09-14 15:58:59 +02:00
Joakim Hove
598afb9dc9 Split udq eval in eval_assign() and eval_define() 2021-09-14 15:58:59 +02:00
Joakim Hove
4b3231c9ef Merge pull request #2647 from joakim-hove/rst-actionx
Rst actionx
2021-09-14 15:54:32 +02:00
Joakim Hove
b14790f990 Merge pull request #2675 from joakim-hove/no-actnum
Handle GDFILE with grid without actnum
2021-09-14 15:53:24 +02:00
Joakim Hove
b319647a09 Merge pull request #2682 from akva2/janitoring
fixed: add missing field initializers
2021-09-14 15:52:50 +02:00
Joakim Hove
fb6aeb240f Merge pull request #2683 from blattms/spelling-fix
Fixed spelling of assignment,
2021-09-14 15:52:19 +02:00
Markus Blatt
9833afbc5f Fixed spelling of assignment,
Detected by linitian run on Debian package for opm-upscaling.
2021-09-14 12:27:36 +02:00
Arne Morten Kvarving
a2bef15aa1 fixed: add missing field initializers 2021-09-14 11:11:37 +02:00
Joakim Hove
7ad1f360bd Merge pull request #2680 from joakim-hove/output-width
Ensure that normal keywords are not split on output
2021-09-13 17:25:46 +02:00
Joakim Hove
b31c68e830 Ensure that normal keywords are not split on output 2021-09-13 16:50:07 +02:00
Joakim Hove
507f60ec25 Merge pull request #2681 from joakim-hove/testdata-include
Reorganize test deck to use INCLUDE
2021-09-13 16:46:32 +02:00
Joakim Hove
6cc0cba14c Reorganize test deck to use INCLUDE 2021-09-13 16:26:20 +02:00
Joakim Hove
0da931a7e6 Merge pull request #2661 from joakim-hove/save-correct-report-step
Assign SAVE keyword to previous report step
2021-09-13 15:12:56 +02:00
Joakim Hove
6c9a756d9e Merge pull request #2671 from tskille/esmry_lgr
Adding support for LGR related summary vectors
2021-09-13 14:06:21 +02:00
Joakim Hove
bf7d162ce4 Load actionx from restart file 2021-09-13 11:43:26 +02:00
Torbjørn Skille
ce052232f6 update SummaryNode with lgr info 2021-09-13 11:38:41 +02:00
Joakim Hove
e7aa8fda54 Merge pull request #2678 from joakim-hove/remove-parser-output
Remove debug output from parser keyword generation
2021-09-13 11:16:12 +02:00
Joakim Hove
8b5475b98b Merge pull request #2677 from joakim-hove/actionx-enable-gconsump
Enable keywords as ACTIONX keywords
2021-09-13 11:03:42 +02:00
Joakim Hove
c61e3adb86 Remove debug output from parser keyword generation 2021-09-13 10:46:37 +02:00
Joakim Hove
aefb78e078 Enable keywords as ACTIONX keywords 2021-09-13 10:38:00 +02:00
Joakim Hove
efaa613368 Add testdata for restart load testing of ACTIONX 2021-09-13 10:33:32 +02:00
Joakim Hove
de942d91b6 Load ACTIONX conditions from restart file 2021-09-13 10:33:32 +02:00
Joakim Hove
974c53fcd1 Add comment about content of ACTIONX related INTEHEAD parameters 2021-09-13 10:18:35 +02:00
Joakim Hove
539c86c21c Move action condition related enums to separate compilation unit 2021-09-13 10:18:35 +02:00
Joakim Hove
de00a53190 White space 2021-09-13 10:18:35 +02:00
Joakim Hove
3ffff5b65d Merge pull request #2669 from jalvestad/rst_improvement
Add correct value for SACT[4] - equal to last time that the action was triggered
2021-09-13 09:52:41 +02:00
Joakim Hove
00bd0866f2 SAVE keyword should apply to previous timestep 2021-09-13 09:26:00 +02:00
Joakim Hove
1216b4f638 Remove restart schedule testing of possibly dubious quality 2021-09-13 09:10:53 +02:00
Joakim Hove
a1f8585395 Handle GDFILE with grid without actnum 2021-09-13 09:00:16 +02:00
Torbjørn Skille
e4c324dcef Adding support for LGR related summary vectors 2021-09-13 08:37:35 +02:00
Joakim Hove
7002faba3b Merge pull request #2662 from joakim-hove/remove-uda-autocreate
Remove uda autocreate
2021-09-12 08:45:44 +02:00
Joakim Hove
34ab3d8bd7 Merge pull request #2668 from joakim-hove/igph-rst-size
Unconditonally use number of groups for IGPH restart vector
2021-09-12 08:35:51 +02:00
Joakim Hove
fe22a67670 Merge pull request #2666 from joakim-hove/rst-nothing
Protect against unset optional when checking restart config
2021-09-12 08:35:33 +02:00
Joakim Hove
c7237dbc36 Merge pull request #2670 from joakim-hove/udq-trailing-comments
Special case treatment of trailing slash for UDQ keywords
2021-09-12 08:35:18 +02:00
Joakim Hove
9bad260538 Special case treatment of trailing slash for UDQ keywords 2021-09-11 08:29:42 +02:00
Joakim Hove
4dfe80b493 Merge pull request #2663 from joakim-hove/rst-add-parser-argument
Add Parser argument to restart loader
2021-09-10 16:27:42 +02:00
Joakim Hove
a289bc790e Ensure that temporary igph vector is allocated with correct size 2021-09-10 16:16:33 +02:00
Joakim Hove
8790dc5524 Merge pull request #2665 from joakim-hove/has-gpmaint
Add small utility function to check for gpmaint across groups
2021-09-10 14:45:27 +02:00
Jostein Alvestad
59b1166682 Added correction to handle actions that has not been run, plus unit test for SACT[4] 2021-09-10 14:44:39 +02:00
Joakim Hove
5358aa5485 Protect against unset optional when checking restart config 2021-09-10 12:45:54 +02:00
Jostein Alvestad
d9f7c89ecb added sAct[4] = last time that the action was triggered 2021-09-10 08:40:40 +02:00
Joakim Hove
8787078f4b Add small utility function to check for gpmaint across groups 2021-09-09 16:31:13 +02:00
Joakim Hove
7e3d910823 Add begin() and end() const iterators for ScheduleState::map_member 2021-09-09 16:21:33 +02:00
Joakim Hove
54e1345d45 Add Parser argument to restart loader 2021-09-09 12:48:41 +02:00
Joakim Hove
026cbade9c UDQ - a keyword is not recognized only from UNITS verb 2021-09-09 08:30:00 +02:00
Joakim Hove
babff0e0ba Stopped auto creation of UDQ ASSIGN from UDQ UNITS 2021-09-09 08:30:00 +02:00
Joakim Hove
6e13564832 Merge pull request #2658 from joakim-hove/time-point-utility
Utility function to create time_point from UTC timestamp
2021-09-08 14:00:55 +02:00
Joakim Hove
206fe1cf69 Utility function to create time_point from UTC timestamp 2021-09-08 13:58:45 +02:00
Joakim Hove
6a684235d2 Merge pull request #2656 from joakim-hove/action-rst-const
Action rst const
2021-09-08 08:36:13 +02:00
Bård Skaflestad
b101ea885a Merge pull request #2657 from tskille/esmry_fix
fixing bug in Opm::EclIO::ESmry constructor
2021-09-07 23:58:34 +02:00
Torbjørn Skille
c900462edb fixing bug in Opm::EclIO::ESmry constructor
- changed behaviour when opening summary file from restart run
 - will now work with loadBaseRunData=false and original base run folder
   not found.
2021-09-07 22:49:48 +02:00
Joakim Hove
d281881448 rst: use named constants for actionx condition information 2021-09-07 12:40:23 +02:00
Joakim Hove
9cff0dae26 Merge pull request #2655 from joakim-hove/rst-actionx-commits
Rst actionx commits
2021-09-07 08:44:46 +02:00
Joakim Hove
1eaa527725 Implement Actions::operator[] 2021-09-06 20:02:04 +02:00
Joakim Hove
7284c250b3 Make number of restart items for ACTIONX public 2021-09-06 20:02:04 +02:00
Joakim Hove
972136c98b Add method sim_time() in rst::header 2021-09-06 20:02:04 +02:00
Joakim Hove
cc05d493c0 Add utility function to format double 2021-09-06 19:43:16 +02:00
Joakim Hove
02b7e9ae04 Add mapping int -> string for month names 2021-09-06 19:42:51 +02:00
Joakim Hove
6b26dea23a Merge pull request #2652 from joakim-hove/rst-actionx-commits
Rst actionx commits
2021-09-06 16:40:26 +02:00
Joakim Hove
0b97a8bcae Merge pull request #2651 from joakim-hove/add-runspec-arg
Add const Runspec& argument to restart loader
2021-09-06 16:40:11 +02:00
Bård Skaflestad
531090bdab Merge pull request #2653 from akva2/janitoring
remove unused variable
2021-09-06 09:58:30 +02:00
Arne Morten Kvarving
b902867328 remove unused variable 2021-09-06 09:15:00 +02:00
Joakim Hove
f3fc5c7d76 Remove context aware rst testing from regression tester 2021-09-06 08:20:54 +02:00
Joakim Hove
e73b6a053e Use month names from TimeService 2021-09-06 08:20:54 +02:00
Joakim Hove
5b89ba16fb Add functions to convert Action::Condition::Comparator <-> int 2021-09-06 08:20:54 +02:00
Joakim Hove
b35e78df9f Introduce convenience functions to convert int <-> Actionx OR/AND 2021-09-06 08:20:54 +02:00
Joakim Hove
e3685eeb34 Introduce predicated Condition::date() for Actionx output 2021-09-06 08:20:54 +02:00
Joakim Hove
a49758af62 Remove unused argument 2021-09-06 08:16:13 +02:00
Joakim Hove
fcca036af4 Remove context aware rst testing from regression tester 2021-09-04 19:51:10 +02:00
Joakim Hove
04a44657d6 Add const Runspec& argument to restart loader 2021-09-04 19:42:31 +02:00
Joakim Hove
d060d92268 Merge pull request #2649 from joakim-hove/actdims-rename
Rename actDims in AggregateActionxData
2021-09-04 19:10:47 +02:00
Joakim Hove
4b0df44879 Merge pull request #2650 from jalvestad/ighp-unit-test
Unit test for IGPH
2021-09-04 19:00:25 +02:00
Joakim Hove
d904ab6108 Rename actDims -> action_rst_dims + refactor Actionx restart 2021-09-04 18:13:11 +02:00
Joakim Hove
e75b6167ef Split Actions::size() in py_size() and ecl_size() 2021-09-03 14:05:43 +02:00
Jostein Alvestad
1d3415d07a added unit tests for IGPH 2021-09-03 13:29:18 +02:00
Tor Harald Sandve
08e22740d8 Merge pull request #2648 from joakim-hove/group-has-injection-control
Use Group class to query for  controls
2021-09-03 07:32:28 +02:00
Joakim Hove
51213a30b5 Remove has_control() method from Injection and Production controls 2021-09-02 22:24:16 +02:00
Joakim Hove
09becfbb7f Include target control in GPMaint when acessing group 2021-09-02 22:08:51 +02:00
Joakim Hove
038c1946c7 Use Group class to query for injection controls 2021-09-02 16:21:08 +02:00
Bård Skaflestad
a3ccf0118b Merge pull request #2645 from akva2/fix_thread_stupid
fixed: do not assign value to nonexistent variable
2021-09-02 11:42:54 +02:00
Arne Morten Kvarving
a2d5b83dbc fixed: do not assign value to nonexistent variable 2021-09-02 10:36:18 +02:00
Tor Harald Sandve
9af5108421 Merge pull request #2643 from joakim-hove/gpmaint-state
Gpmaint state
2021-09-02 08:02:25 +02:00
Joakim Hove
81f5ec72e9 Merge pull request #2642 from joakim-hove/schedule-rename-runtime
Schedule rename runtime
2021-09-02 07:16:13 +02:00
Joakim Hove
5d8053c134 Add inner class State to GPMaint and GPMaint::rate() method 2021-09-01 21:19:53 +02:00
Joakim Hove
46d92d4701 Add report step member to GPMaint class 2021-09-01 16:02:23 +02:00
Joakim Hove
39938be2c3 Rename HandlerContext::runtime
When replaying the Schedule keywords due to ACTIONX only the actual ACTIONX
keywords should be involved with the runtime flag set to true. The rest of the
deck should be evaluated in the normal way.
2021-09-01 15:44:25 +02:00
Joakim Hove
100f6e96d1 Add small function Schedule::end_report() 2021-09-01 15:43:52 +02:00
Bård Skaflestad
84c0f73a33 Merge pull request #2640 from goncalvesmachadoc/radial
fix bug radial
2021-09-01 09:37:36 +02:00
Cintia Goncalves Machado
08c4cebced fix bug radial 2021-09-01 00:01:18 +02:00
Joakim Hove
60971f21e8 Merge pull request #2620 from joakim-hove/uda-rst
Uda rst
2021-08-31 16:48:03 +02:00
Markus Blatt
44c612ef7a Merge pull request #2639 from bska/fix-signed-vs-unsigned
Fix "Signed vs. Unsigned" Comparison Warning
2021-08-31 14:32:16 +02:00
Bård Skaflestad
17e3c9ce63 Fix "Signed vs. Unsigned" Comparison Warning
Use range-for instead of a counted loop.  While here, also mark a
few objects as 'const' to avoid inadvertent modifications.
2021-08-31 12:48:25 +02:00
Joakim Hove
5e2bff42cf Update UDA properties from restart file 2021-08-31 12:48:01 +02:00
Joakim Hove
d8d6749337 Load active UDA's from restart file 2021-08-31 11:20:12 +02:00
Joakim Hove
fd010c1370 Add testdata for UDA restart testing 2021-08-31 11:20:12 +02:00
Joakim Hove
dca7775997 Merge pull request #2633 from joakim-hove/uda-ig-phase
Ensure that UDA is only active for one phase in restart file
2021-08-31 11:19:09 +02:00
Bård Skaflestad
7a2f2bd23a Merge pull request #2635 from tskille/ecloutput_update
Update of class EclOutput
2021-08-31 10:03:58 +02:00
Joakim Hove
89d7507bfa Merge pull request #2638 from joakim-hove/summary-action-keys-month-names
Intercept month keywords earlier in Summary creation
2021-08-30 19:43:15 +02:00
Joakim Hove
5b8d24bf2f Intercept month keywords earlier in Summary creation 2021-08-30 17:32:41 +02:00
Markus Blatt
657f04cd28 Merge pull request #2631 from blattms/dune-2.8-metis
Fix FindMETIS for DUNE 2.8.
2021-08-30 16:23:55 +02:00
Torbjørn Skille
a9ba936f6a update of class EclOutput
- significant improvements on performance
 - writing blocks of data from disk, rather that one by one element
2021-08-30 15:57:53 +02:00
Joakim Hove
50cb0b5da2 Merge pull request #2636 from bska/segmet-wct
Support Segment-Level Water Cut Summary Vector
2021-08-30 09:53:07 +02:00
Bård Skaflestad
b251d5dfe6 Support Segment-Level Water Cut Summary Vector 2021-08-29 21:08:42 +02:00
Bård Skaflestad
1858362ce7 Merge pull request #2634 from tskille/eclfile_update
update of base class EclFile
2021-08-27 23:06:31 +02:00
Bård Skaflestad
2e1c65e515 Merge pull request #2565 from goncalvesmachadoc/fsip
add FSIP to summary
2021-08-27 22:43:52 +02:00
Torbjørn Skille
83b5c99135 update of base class EclFile
- significant improvements on performance
 - reading blocks of data from disk, rather that one by one element
 - using block sizes defined in Opm::EclIO::EclIOdata.hpp

updates of EGrid::get_zcorn_from_disk
 - using same approach as for EclFile
 - also minor change in EGrid api
2021-08-27 20:21:46 +02:00
Cintia Goncalves Machado
65017f3855 add FSIP to test 2021-08-27 13:13:48 +02:00
Joakim Hove
bbba7661a1 Ensure that UDA is only active for one phase in restart file 2021-08-27 11:58:09 +02:00
Joakim Hove
de6997847d Add function to check if GroupInjectionProperties is UDA enabled 2021-08-27 11:55:24 +02:00
Joakim Hove
4604c2b0c8 Merge pull request #2632 from joakim-hove/uda-rst-commits
Uda rst commits
2021-08-27 11:36:42 +02:00
Cintia Goncalves Machado
7520e95276 outputFSIP 2021-08-26 18:31:56 +02:00
Joakim Hove
cb6e6164a3 Add operator== to Well::ProductionControls and init struct members 2021-08-26 18:30:29 +02:00
Joakim Hove
8dfa1cdd2b Refactor test 2021-08-26 18:30:29 +02:00
Bård Skaflestad
06ad830769 Merge pull request #2629 from jalvestad/actionrst-improvement
Corrections to Actionx data IACT, SACT
2021-08-26 17:56:11 +02:00
Joakim Hove
bf5e63f8cf Add Group::injectionProperties(Phase) accessor 2021-08-26 17:24:51 +02:00
Markus Blatt
0056e0a2a1 Fix FindMETIS for DUNE 2.8.
With version 2.8 DUNE will specify imported target METIS::METIS for
the linker and introduces a METIS_API_VERSION to distinguish different
versions. This patch introduces these to the find module used by OPM.
2021-08-26 15:08:27 +02:00
Jostein Alvestad
1715bfc4e4 removed comments from UDQ_ACTIONX_TEST1.DATA 2021-08-26 12:22:15 +02:00
Jostein Alvestad
86a85b5b24 added unit tests and modified input data accordingly 2021-08-26 12:17:40 +02:00
Jostein Alvestad
f3fbd44b4b changes to allow for opm/units 2021-08-26 12:17:38 +02:00
Jostein Alvestad
30109c1722 correction of units for SACT[3] 2021-08-26 12:17:36 +02:00
Jostein Alvestad
4705cf7eb9 corrections to IACT[2], SACT[3] 2021-08-26 12:17:35 +02:00
Bård Skaflestad
961190c723 Merge pull request #2628 from goncalvesmachadoc/outputVolume
Add reservoir volumes to Inplace
2021-08-26 10:21:02 +02:00
Bård Skaflestad
87041776ce Merge pull request #2626 from joakim-hove/normal-summmary-keys
Normal summmary keys
2021-08-25 22:16:17 +02:00
Bård Skaflestad
c2444681d7 Merge pull request #2627 from joakim-hove/udq-units
Make sure to assign UDQ units for udq loaded from restart file
2021-08-25 21:35:25 +02:00
Cintia Goncalves Machado
6e386d6245 add reservoir volumes to Inplace 2021-08-25 18:25:10 +02:00
Joakim Hove
9257610869 Make sure to assign UDQ units for udq loaded from restart file 2021-08-25 16:16:54 +02:00
Joakim Hove
3867cde543 Merge pull request #2616 from akva2/default_asserts
changed: default to asserts enabled in release mode
2021-08-25 09:42:10 +02:00
Joakim Hove
a07ab41a73 Refactor summary configuration of time vectors to reuse from ACTIONX 2021-08-25 07:29:30 +02:00
Joakim Hove
69e1101b35 Remove automatic DAY, YEAR and MONTH from SummaryState 2021-08-25 06:57:17 +02:00
Joakim Hove
cda7bd3740 Use normal summary keys for time related properties 2021-08-25 06:52:47 +02:00
Joakim Hove
31fa88b53e Merge pull request #2621 from tskille/extesmry
Adding python bindings for class ExtESmry
2021-08-24 23:24:32 +02:00
Joakim Hove
797c1cbde8 Merge pull request #2624 from akva2/janitoring
Some janitoring
2021-08-24 11:02:42 +02:00
Arne Morten Kvarving
41867b55fe reduce scope of variables
also use .empty() instead of comparing strings to ""
2021-08-24 09:33:22 +02:00
Arne Morten Kvarving
2d20087f17 only declare variable when required 2021-08-24 09:33:22 +02:00
Arne Morten Kvarving
add60560ee pass by const reference 2021-08-24 09:33:22 +02:00
Joakim Hove
7b2b58caa8 Merge pull request #2623 from joakim-hove/actionx-pretty-print
Fix prefix with output from schedule parse in ACTIONX mode
2021-08-24 07:39:45 +02:00
Joakim Hove
f4eda06021 Fix prefix with output from schedule parse in ACTIONX mode 2021-08-23 23:01:08 +02:00
Torbjørn Skille
514e3a4a35 Adding python bindings for c++ class ExtESmry
- Used for loading data from summary file ESMRY
 - python class ESmry supporting both SMSPEC/UNSMRY and ESMRY summary files.
2021-08-23 22:15:58 +02:00
Bård Skaflestad
981e977da4 Merge pull request #2495 from bska/walq
Implement WALQ Summary Vector
2021-08-20 21:41:31 +02:00
Bård Skaflestad
b638ba0f0e Output WGLIR=0 Unless ALQ=GRAT
This reduces the risk of users misinterpreting the curves since the
unit of measure when plotting the vector will unconditionally be
surface volume rate for gas.

We will revisit this decision if we gain the ability to capture the
actual lift gas injection rate independent of ALQ type.

Suggested by: [at]tskille
2021-08-20 20:35:12 +02:00
Bård Skaflestad
2ad81c9364 Implement WALQ Summary Vector 2021-08-20 20:35:12 +02:00
Bård Skaflestad
0b5694c05b Check ALQ Type When Accumulating Gas Lift Injection Rate
This commit adds a guard to the xGLIR accumulation procedure.  In
particular, we do not accumulate anything unless the ALQ type is gas
rate.  We do however output a well-level value if the ALQ type is
gas/liquid ratio.  This guard requires passing the Schedule object
as part of the 'fn_args', so update the call sites accordingly.
2021-08-20 20:35:12 +02:00
Bård Skaflestad
fcac9edef6 Don't Copy VFP Table To Extract ALQ Type
We can just extract the ALQ type directly from a reference to a VFP
table instead.
2021-08-20 20:35:12 +02:00
Bård Skaflestad
6b9f0817a8 Prune Duplicate Summary Keyword
Keyword 'WGLIR' was already present earlier in the list.
2021-08-20 20:35:12 +02:00
Joakim Hove
c21bde269a Merge pull request #2619 from joakim-hove/uda-rst-trivial
Uda rst trivial
2021-08-20 15:43:45 +02:00
Joakim Hove
815606651e Slightly simplify logic test 2021-08-20 14:29:45 +02:00
Joakim Hove
aff9cb74d1 Add UDQConfig::operator[](std::size_t insert_index) 2021-08-20 14:29:45 +02:00
Joakim Hove
3ab7179305 Add UDQInput::operator== 2021-08-20 14:29:45 +02:00
Joakim Hove
d2b1c99663 Use std::variant instead of pointers 2021-08-20 14:29:45 +02:00
Joakim Hove
9a883f1907 Remove unused variable - check vector size directly 2021-08-20 14:29:44 +02:00
Joakim Hove
cdb92013dd Add function to convert from integer code to UDAControl type 2021-08-20 14:29:16 +02:00
Joakim Hove
5e60927477 Rename uad -> uda 2021-08-20 14:29:16 +02:00
Joakim Hove
c087c725b6 Remove unused members wg_keys and udq_keys from UDQActive 2021-08-20 14:29:16 +02:00
Joakim Hove
c4896a0f49 Add missing this-> 2021-08-20 14:29:16 +02:00
Joakim Hove
e1ff4b4682 Rename UDQActive::Record -> UDQActive::OutputRecord 2021-08-20 14:29:16 +02:00
Joakim Hove
1ce143e479 Rename UDQActive::get_iuad() -> iuad() 2021-08-20 14:29:16 +02:00
Joakim Hove
a0ad7883c7 Remove unused size query functions 2021-08-20 14:29:14 +02:00
Joakim Hove
f5f3957177 Merge pull request #2617 from tskille/egrid_mapaxes
Adding support for handling MAPAXES and MAPUNITS
2021-08-20 13:12:15 +02:00
Bård Skaflestad
fe27c58b0b Merge pull request #2526 from bska/restart-load-analytic-aquifer
Load Analytic Aquifer Objects From Restart File
2021-08-19 22:29:36 +02:00
Bård Skaflestad
6db9e150e1 Merge pull request #2618 from joakim-hove/store-action-results
Store action results
2021-08-19 20:48:49 +02:00
Bård Skaflestad
0d35d64aea Load Analytic Aquifer Objects from Restart File
This commit adds support for creating the analytic aquifer objects

    Opm::AquiferCT
    Opm::Aquifetp
    Opm::Aquancon
    Opm::AquiferConfig

from information stored in the restart vectors

    {I,S,X}AAQ
    {I,S}CAQ

We add a new helper class

    Opm::RestartIO::RstAquifer

which contain the same data members as the '*_data' structures of
the analytic aquifer objects.  Those analytic aquifer objects then
get friendship from the '*_data' structures in order to assign the
private members from the corresponding restart information.  We
finally add a gateway to EclipseState that consumes an RstAquifer
instance and overwrites the internal AquiferConfig object when the
restarted run contains analytic aquifers.

Update RstState constructor API to meet requirements of RstAquifer,
notably by adding an EclipseGrid parameter.  That in turn is needed
by the RstAquifer to translate connection (I,J,K) tuples to active
cell IDs.

Note that if an analytic aquifer does not have any connections then
this facility will not load said aquifer.  That may be a problem
when plotting summary curves, but we will address the issue later if
it comes up.
2021-08-19 20:34:19 +02:00
Bård Skaflestad
d1b1cebdf5 Support Retrieving Non-Zero Restart Vector Occurrence
Needed to load connection information for analytic aquifers (xCAQ).
2021-08-19 20:34:19 +02:00
Bård Skaflestad
e4a485844f Load Numeric Aquifer Data From Restart File
Needed to get continuous 'ANQT' curves in restarted runs.
2021-08-19 20:34:19 +02:00
Joakim Hove
9862d88b12 Remove unused UDQActive::operator[] 2021-08-19 17:01:31 +02:00
Joakim Hove
ec66eeee17 Remove trailing whitespace 2021-08-19 16:21:27 +02:00
Joakim Hove
3c434b2d49 Use const ref 2021-08-19 16:21:27 +02:00
Joakim Hove
41ea258752 Use fmt to create error messages 2021-08-19 16:21:27 +02:00
Joakim Hove
86311f3735 Use stored Action result when updating ZWEL 2021-08-19 15:53:31 +02:00
Torbjørn Skille
445a329785 adding support for handling MAPAXES and MAPUNITS 2021-08-19 15:35:26 +02:00
Joakim Hove
957f540d17 The Action::State will store the last Action::Result instance 2021-08-19 15:29:15 +02:00
Joakim Hove
c6540d6f5b Add operator== to Action::Result 2021-08-19 15:28:47 +02:00
Joakim Hove
a63341db79 Implement optional semantics with std::optional 2021-08-19 14:28:17 +02:00
Joakim Hove
1940ab20a8 Add typedef for convenience 2021-08-19 14:15:14 +02:00
Arne Morten Kvarving
7f84696bc9 changed: default to asserts enabled in release mode 2021-08-19 13:03:25 +02:00
Arne Morten Kvarving
e291234e04 Merge pull request #2594 from akva2/fix_ndebug
fixed: make WITH_NDEBUG cmake option work again
2021-08-19 13:02:10 +02:00
Joakim Hove
ae8671455c Merge pull request #2613 from akva2/refactor_test_update_params
changed: pass more information as parameters
2021-08-19 10:08:38 +02:00
Joakim Hove
66de0ed235 Merge pull request #2608 from joakim-hove/skiprest-nug
Skiprest bug
2021-08-18 18:26:37 +02:00
Bård Skaflestad
51ee6ffd16 Merge pull request #2611 from akva2/fix_proximate
fix build with gcc7
2021-08-18 17:53:20 +02:00
Joakim Hove
658e14667d Merge pull request #2614 from joakim-hove/use-summary-get-well-var
Use SummaryState::get_well_var() with default
2021-08-18 17:08:52 +02:00
Joakim Hove
69c9faefcc Use SummaryState::get_well_var() with default 2021-08-18 16:17:55 +02:00
Arne Morten Kvarving
2f3733b615 fix build with gcc7
the filesystem ts did not include proximate. implement
a poor man's version (copied from libstdc++, slightly modified)
and use this when necessary
2021-08-18 15:33:02 +02:00
Arne Morten Kvarving
91816c2b53 changed: pass more information as parameters
the use of environment variables makes it less flexible
2021-08-18 13:48:53 +02:00
Joakim Hove
d37389720f Fix bug for time-stepping when loading restart deck 2021-08-18 13:40:21 +02:00
Joakim Hove
719b05e93b Improve error message when scanning past restart date 2021-08-18 13:40:21 +02:00
Joakim Hove
34f9d88c32 Renamed test deck 2021-08-18 13:40:21 +02:00
Joakim Hove
a646794882 Merge pull request #2612 from bska/restore-group-quant
Load Active Constraints and Guide Rates at Group Level
2021-08-18 13:11:02 +02:00
Joakim Hove
a53a1d871e Load Active Constraints and Guide Rates at Group Level
Needed to initialise restarted runs.
2021-08-18 09:37:42 +02:00
Bård Skaflestad
a1619543f3 Refactor Group Cumulative Loading
Reduces duplication.
2021-08-18 09:33:38 +02:00
Joakim Hove
8acda9b023 Merge pull request #2610 from joakim-hove/skiprest-bug-trivial
Skiprest bug trivial
2021-08-17 11:30:13 +02:00
Joakim Hove
8c43916751 Updates to Schedule logger utility class 2021-08-17 10:35:21 +02:00
Joakim Hove
b8565ee46c Add info message when adding group and well from restart file 2021-08-17 09:22:36 +02:00
Joakim Hove
f25c71b8f3 Merge pull request #2597 from bska/rptonly
Add Support for RPTONLY and RPTONLYO
2021-08-17 09:21:02 +02:00
Bård Skaflestad
d216de77ea Add Support for RPTONLY and RPTONLYO
This former restricts summary output events to coincide with the
report step while the latter (*O) turns off this restriction and
makes summary output for every timestep.
2021-08-16 20:50:08 +02:00
Bård Skaflestad
114eec30c5 Merge pull request #2609 from tskille/fix_ExtESmry
fixing bug in ExtESmry
2021-08-16 20:46:42 +02:00
Torbjørn Skille
3f1a89069d fixing bug in ExtESmry
- segfault when loading more that one vector
 - test ExtESmry updated, now failing without this fix
2021-08-16 19:47:59 +02:00
Joakim Hove
2cf17408e9 Merge pull request #2605 from bska/report-siunits-guiderates
Add Guiderate Value Accessor for SI Units
2021-08-16 16:51:30 +02:00
Bård Skaflestad
2a374fc53b Add Guiderate Value Accessor for SI Units
This is mostly for reporting purposes if the calling code knows that
the values stored in the GuideRate container are in output units.
The output layer, and particularly the Summary facility, expects
that its input values are strictly SI.
2021-08-16 12:26:09 +02:00
Bård Skaflestad
612cbf749c Merge pull request #2607 from akva2/janitoring
Some more SCA warning cleanup
2021-08-16 12:24:56 +02:00
Joakim Hove
52acaa3757 Merge pull request #2603 from bska/protect-import-container-from-multiple-inclusion
Add Include Guards to Protect From Multiple Inclusion
2021-08-16 11:34:27 +02:00
Arne Morten Kvarving
f7a143c604 pass by const ref 2021-08-16 11:06:00 +02:00
Bård Skaflestad
210e09f981 Add Include Guards to Protect From Multiple Inclusion
While here, also use a more efficient way of forming a
vector<double> from a vector<float> source.
2021-08-16 11:03:38 +02:00
Arne Morten Kvarving
e25667dc71 mark constructor explicit 2021-08-16 10:57:22 +02:00
Arne Morten Kvarving
7560d7fd7c make EclipseState constructor explicit
and adjust test code
2021-08-16 10:57:22 +02:00
Arne Morten Kvarving
155c8fbcdb make Aquifer constructors explicit
and adjust test code
2021-08-16 10:57:22 +02:00
Arne Morten Kvarving
1463266ba6 initialize member 2021-08-16 10:57:22 +02:00
Bård Skaflestad
92b1c6cb45 Merge pull request #2606 from tskille/cleanup_esmry
cleanup after renaming from LODSMRY -> ESMRY
2021-08-16 10:40:26 +02:00
Torbjørn Skille
c6ff9bba00 cleanup after renaming from LODSMRY -> ESMRY 2021-08-16 09:10:00 +02:00
Bård Skaflestad
f89d3fe75a Merge pull request #2590 from tskille/write_lodsmry
Support for writing ESMRY file
2021-08-12 21:29:45 +02:00
Bård Skaflestad
6801ac1a3d Merge pull request #2604 from akva2/janitoring
Quell some static analysis warnings
2021-08-12 20:36:21 +02:00
Torbjørn Skille
46693aec47 Adding support for writing esmry
- command line option --enable-esmry, default = false
 - complete re-write of esmry file for every time step

Updating of class ESmry
 - remove automatic loading from ESMRY
2021-08-12 19:17:07 +02:00
Arne Morten Kvarving
f44e56d101 use std::copy 2021-08-12 15:42:34 +02:00
Arne Morten Kvarving
ad9de78253 mark some constructors explicit 2021-08-12 15:36:25 +02:00
Arne Morten Kvarving
a3ca314832 use initializer list 2021-08-12 15:34:55 +02:00
Bård Skaflestad
d9dc2f3dd8 Merge pull request #2602 from tskille/egrid_update
Adding member function getXYZ_layer to EGrid
2021-08-12 12:19:02 +02:00
Torbjørn Skille
9a5937ae29 Adding member function getXYZ_layer to EGrid
- getting xyz values from EGrid file
 - partially loading ZCORN array, loading only z-values associated with selected layer
 - will be used by resinsight, user interface discussed with Ceetron
2021-08-12 08:47:31 +02:00
Bård Skaflestad
8bcd1b8f83 Merge pull request #2600 from asnyv/import_paths
Support PATHS in IMPORT keyword
2021-08-11 21:33:40 +02:00
Bård Skaflestad
4aafd43871 Merge pull request #2601 from akva2/janitoring
Some janitoring
2021-08-11 21:02:17 +02:00
Asgeir Nyvoll
1a2f6cae46 Support PATHS in IMPORT keyword 2021-08-11 15:02:32 +02:00
Arne Morten Kvarving
a76cf5cdb3 replace NULL with nullptr 2021-08-11 14:46:49 +02:00
Arne Morten Kvarving
8b539a46fc trim some whitespace and fix a typo 2021-08-11 14:46:48 +02:00
Bård Skaflestad
f373afd526 Merge pull request #2596 from bska/refactor-sumthin
Refactor SUMTHIN Implementation
2021-08-09 18:18:10 +02:00
Bård Skaflestad
509878eb49 Refactor SUMTHIN Implementation
Report steps do not influence the SUMTHIN intervals and the special
value

    SUMTHIN
    0.0 /

turns off the "thinning" process.  This refactoring introduces a new
helper variable, sumthin_active_, which caches whether SUMTHIN is
active (i.e., exists and has strictly positive value).

While here, also ensure that the ministep IDs have non-unit steps
when SUMTHIN ends up skipping an output event.
2021-08-09 17:59:13 +02:00
Joakim Hove
e6d7081950 Merge pull request #2582 from joakim-hove/igrp-simplification2
Igrp simplification2
2021-08-05 08:55:08 +02:00
Joakim Hove
edb4100457 Merge pull request #2580 from joakim-hove/zudl-roundtrip
Normalise input data in UDQ definitions
2021-08-05 08:54:39 +02:00
Joakim Hove
3502bbdc7f Merge pull request #2595 from goncalvesmachadoc/enablePrecSalt
add enable PRECSALT
2021-08-05 00:15:56 +02:00
Cintia Goncalves Machado
c5a5bb2f1d add enable PRECSALT 2021-08-04 16:24:58 +02:00
Bård Skaflestad
ee4987bf20 Merge pull request #2592 from akva2/janitoring
changed: use std::vector<char> instead of raw char arrays
2021-08-04 15:53:52 +02:00
Bård Skaflestad
fc378d510e Merge pull request #2591 from goncalvesmachadoc/VAPWAT
Add enable WATVAP
2021-08-04 15:50:13 +02:00
Arne Morten Kvarving
1d4a3cc655 fixed: make WITH_NDEBUG cmake option work again
cmake now adds -DNDEBUG to default CXX flags
invert logic and use -UNDEBUG to remove instead
2021-08-04 15:21:37 +02:00
Cintia Goncalves Machado
0427f45163 fix; 2021-08-04 13:35:21 +02:00
Arne Morten Kvarving
328882e820 changed: use std::vector<char> instead of raw char arrays
also fixes a harmless error where delete was used instead of delete[]
2021-08-04 13:03:31 +02:00
Joakim Hove
cbe2ba52fc Use common function injectionGroup for both gas and water 2021-08-04 12:24:02 +02:00
Cintia Goncalves Machado
830cb81620 addEnableWATVAP 2021-08-04 12:23:17 +02:00
Joakim Hove
af3679980d More shuffling about 2021-08-04 12:05:56 +02:00
Joakim Hove
a6ba80068b Split out if (cgroup) { ... } 2021-08-04 12:05:56 +02:00
Joakim Hove
579463c2a0 Introduce local bool variable 2021-08-04 12:05:56 +02:00
Joakim Hove
01b93b15ec Remove extra assignment 2021-08-04 12:05:56 +02:00
Joakim Hove
5369e4021b Minor white space shuffle about 2021-08-04 12:05:56 +02:00
Joakim Hove
2c6f37bd88 Merge pull request #2587 from joakim-hove/guiderat-delay-throw
Delay error condition to GuideRateModel::eval() time
2021-08-04 11:52:52 +02:00
Joakim Hove
89d41ec087 Merge pull request #2585 from joakim-hove/validate-compord
Support 'DEPTH' ordering in COMPORD
2021-08-04 11:52:32 +02:00
Joakim Hove
3db1cfd8e5 Merge pull request #2584 from joakim-hove/irrevers-thpres
Support EQLOPTS option IRREVER in THPRES keyword
2021-08-04 10:07:04 +02:00
Joakim Hove
2fa5c48679 Support EQLOPTS option IRREVER in THPRES keyword 2021-08-04 07:55:36 +02:00
Joakim Hove
4a415e7ebf Support DEPTH ordering in COMPDAT 2021-08-04 07:54:54 +02:00
Joakim Hove
c0601e183b Do not trap invalid COMPORD input 2021-08-04 07:54:54 +02:00
Joakim Hove
1726ad8090 Delay error condition to GuideRateModel::eval() time 2021-08-04 07:54:12 +02:00
Joakim Hove
d36e5a86a2 Merge pull request #2586 from joakim-hove/foam-validation
Enforce keyword requirement with "requires": []
2021-08-04 07:53:15 +02:00
Joakim Hove
e61f47600d Merge pull request #2588 from joakim-hove/handle-gridunit
GRIDUNIT
2021-08-04 07:53:00 +02:00
Joakim Hove
324f55684b Merge pull request #2581 from joakim-hove/rst-cumulatives
Unconditionally store both production and injection cumulatives
2021-08-03 21:49:32 +02:00
Joakim Hove
36fbd90151 Merge pull request #2576 from joakim-hove/multiple-welsegs
Multiple welsegs
2021-08-03 21:49:18 +02:00
Joakim Hove
729631cd2a Merge pull request #2575 from joakim-hove/skiprest
Skiprest
2021-08-03 21:48:51 +02:00
Joakim Hove
af03d417bb Unconditionally store both production and injection cumulatives 2021-08-03 18:29:34 +02:00
Joakim Hove
691936d0fc Allow scanning past restart date if SKIPREST is active 2021-08-03 18:28:42 +02:00
Joakim Hove
a897cfaa14 Add small struct ScheduleRestartInfo 2021-08-03 18:28:42 +02:00
Joakim Hove
f9aa081235 Remove [[maybe unused]] 2021-08-03 18:28:42 +02:00
Joakim Hove
597c7017e1 Allow for multiple WELSEGS keywords for the same well 2021-08-03 18:26:07 +02:00
Joakim Hove
106cc727c8 Allow scanning past restart date if SKIPREST is active 2021-08-03 18:26:07 +02:00
Joakim Hove
56bb0cacf3 Add small struct ScheduleRestartInfo 2021-08-03 18:26:07 +02:00
Joakim Hove
7c62eade08 Remove [[maybe unused]] 2021-08-03 18:26:07 +02:00
Joakim Hove
e4f5898457 Merge pull request #2579 from joakim-hove/rock-size
Set keyword size of ROCK to UNKNOWN
2021-08-03 18:25:33 +02:00
Joakim Hove
acbabab232 Merge pull request #2578 from joakim-hove/vfpprod-lookup
Check that VFP table exists before deref ...
2021-08-03 18:25:19 +02:00
Joakim Hove
342b5dfb8d Merge pull request #2589 from joakim-hove/sumthin
Sumthin
2021-08-03 18:24:23 +02:00
Joakim Hove
c13edd0826 Handle GRIDUNIT in deck input 2021-08-03 18:22:32 +02:00
Joakim Hove
e9ca60944d Fix typo 2021-08-03 18:15:26 +02:00
Joakim Hove
7c986e6891 Simplify setting of FOAM options 2021-08-03 18:10:57 +02:00
Joakim Hove
04a4cf46d9 Enforce keyword requirement with "requires": [] 2021-08-03 18:10:04 +02:00
Joakim Hove
7d1bb870aa Check that SUMTHIN requirement is respected in summary writer 2021-08-03 14:04:18 +02:00
Joakim Hove
055efd00fc Add SUMTHIN member to ScheduleState 2021-08-03 14:04:18 +02:00
Joakim Hove
f9c792fe35 Set keyword size of ROCK to UNKNOWN 2021-08-03 14:03:02 +02:00
Joakim Hove
cff145095f Merge pull request #2573 from joakim-hove/refactor-keyword-size
Expand KeywordSize class
2021-08-03 14:02:18 +02:00
Joakim Hove
7939adf3e3 Normalise input data in UDQ definitions
The UDQDefine::input_string() function will return normalized input which is
equivalent to the deck input string, but not necessarily identical. Normalizing
which might give rise to differences:

- All selectors/qualifiers in expressions like "WWCT '*'" are quoted.

- Whether to pad operators with space like "170 + FU_PAR10" or "170+FU_PAR10" is
  hardcoded and independent of the space used in the input.

- Floating point numbers is output with format "%g" - no trailing zeros.
2021-07-25 16:36:18 +02:00
Joakim Hove
3853356b22 Check that VFP table exists before deref 2021-07-25 13:08:13 +02:00
Joakim Hove
2482251c3d Specify min_size for SAVE keyword 2021-07-23 10:42:47 +02:00
Joakim Hove
946fcca4fd Add min_size setting ParserKeywords 2021-07-23 10:42:47 +02:00
Joakim Hove
48a0d91e49 Extract all data related to keyword size in class KeywordSize 2021-07-23 10:42:47 +02:00
Joakim Hove
f17b75ab53 Merge pull request #2570 from bska/dont-manage-resources
Don't Manage Resources Manually
2021-07-23 10:42:20 +02:00
Joakim Hove
647cdf2190 Merge pull request #2577 from joakim-hove/keyword-size
Keyword size
2021-07-23 10:42:07 +02:00
Joakim Hove
bfc94a0bdb Use keyword/item scheme with shift for TRACERKM keyword 2021-07-23 09:07:10 +02:00
Joakim Hove
f4c23b6b84 Use normal keyword/item syntax for size of ROCKPAMA keyword 2021-07-23 09:07:10 +02:00
Joakim Hove
763670635c Use normal keyword/item scheme to specify size of ROCK 2021-07-23 09:07:10 +02:00
Joakim Hove
fb7f74f397 Merge pull request #2574 from joakim-hove/log-error
Log error messages from EclipseState and Schedule construction
2021-07-23 08:02:05 +02:00
Joakim Hove
d4b2902c6d Log error messages from EclipseState and Schedule construction 2021-07-22 08:38:30 +02:00
Bård Skaflestad
80a88bea56 Use 'vector' in Place of Manual Memory Management 2021-07-20 12:25:39 +02:00
Bård Skaflestad
21fcfcc135 ESmry: Slight Refactoring
Mostly to reduce variable scope and make objects 'const'.  While
here, also replace a number of 'std::to_string' calls with 'format'.
2021-07-20 12:25:39 +02:00
Markus Blatt
1561a8a82e Merge pull request #2569 from bska/fix-tag-mismatch
Fix Mismatched Tags
2021-07-19 14:20:00 +02:00
Bård Skaflestad
d596fd5f64 Use Variable in Most Narrow Scope Only
This eliminiates a dead store.
2021-07-16 11:29:56 +02:00
Bård Skaflestad
5bebfed4cf Fix Mismatched Tags
'RstState' is a 'struct' and should be forward declared as such.
While here, also fix a shadowing variable warning.
2021-07-16 11:29:56 +02:00
Bård Skaflestad
c72a90ef6e Merge pull request #2572 from plgbrts/gaswater5
fix for two phase gas-water system
2021-07-15 11:55:31 +02:00
Paul Egberts
64051c254f shorten threeP and twoP formulation 2021-07-14 14:10:13 +02:00
Paul Egberts
bddbc252db allow for two phase gas-water system 2021-07-14 11:50:43 +02:00
Bård Skaflestad
dd2f215132 Merge pull request #2571 from OPM/esmry_ms
new member function in ESmry
2021-07-13 17:22:30 +02:00
Torbjørn Skille
7b89e9dbf8 new member function in ESmry
- checking if all timesteps are avaliable
- This will not be the case if RPTONLY has been used with eclipse
2021-07-13 16:14:21 +02:00
Joakim Hove
3d154ee668 Merge pull request #2568 from OPMUSER/Jason_Updates
Update TRACERS JSON
2021-07-10 10:50:08 +02:00
OPMUSER
a0050ed896 Update TRACERS JSON
Added item for checking, no other changes.
2021-07-10 09:11:47 +08:00
Joakim Hove
8b2b70bdf3 Merge pull request #2567 from OPMUSER/Jason_Updates
JSON Revised Definitions
2021-07-09 12:03:29 +02:00
OPMUSER
0e693e68e3 BOOST_AUTO_TEST_CASE( WCHONHIST )
Change number of entries from 11 to 12.
2021-07-09 16:00:54 +08:00
OPMUSER
147acc1445 JSON Revised Definitions
Mostly item and comments, except for:
NODEPROP
WCONHIST
2021-07-08 15:25:47 +08:00
Bård Skaflestad
0f2b338805 Merge pull request #2551 from bska/basic-5-freq-6
Use Previous Output Time to Decide Next Output Time
2021-07-07 22:08:35 +02:00
Bård Skaflestad
ed5a9db25b Use Previous Output Time to Decide Next Output Time
This commit switches the criterion for BASIC=4 and BASIC=5 to using
the difference between the previous and the next output time instead
of "just" the next output time.  The original criteria

    year % freq == 0
    month % freq == 0

don't do what we want.  BASIC=4 and BASIC=5 should output every
'freq' year (=4) or 'freq' month (=5) of simulated time.
2021-07-07 15:06:10 +02:00
Bård Skaflestad
1c49dcc3db Whitespace Adjustments
In preparation of fixing restart output times.
2021-07-07 14:37:21 +02:00
Bård Skaflestad
045d407aed Merge pull request #2559 from bska/write-restart-file-events
Add Utility to Track Restart Output Events
2021-07-07 14:36:11 +02:00
Bård Skaflestad
e8c59932b3 Add Utility to Track Restart Output Events
This commit adds a new helper object

    Opm::WriteRestartFileEvents

that identifies when a restart file output event occurs as well as
the most recent output event prior to a particular report step.  We
implement this facility in terms of a dense bit vector that wastes
up to 63 bits of space.  Most of the logic is devoted to finding the
most recent previous output event, of which the core routine is
counting the number of leading zero bits in a 64 bit value.  We've
elected to implement this in a portable manner using binary search,
although most implementations provide efficient intrinsics for this
operation, e.g., GCC's __builtin_clzl.  In C++20 we can use the new
function std::countl_zero() from <bit>.
2021-07-06 14:26:09 +02:00
Joakim Hove
833d036074 Merge pull request #2549 from OPMUSER/Jason_Updates
Update Various JSON Definitions
2021-07-05 22:54:31 +02:00
Joakim Hove
68d4f3d730 Merge pull request #2555 from goncalvesmachadoc/patch-3
Add BCAD
2021-07-05 19:51:09 +02:00
Joakim Hove
458b1d0396 Merge pull request #2558 from joakim-hove/remove-test
Remove test check for number of items in record
2021-07-05 19:50:21 +02:00
Joakim Hove
6ad1d4020c Remove superfluos test 2021-07-05 16:01:31 +02:00
Joakim Hove
7946532f8c Merge pull request #2557 from joakim-hove/udq-load-rst
Create UDQConfig object when loading from restart file
2021-07-03 23:26:48 +02:00
Joakim Hove
56facd6a49 Create UDQConfig object when loading from restart file 2021-07-03 10:29:36 +02:00
Bård Skaflestad
1e8356cc86 Merge pull request #2553 from osae/tracerUnits
Some support for non-default tracer amount units.
2021-07-02 12:14:00 +02:00
Bård Skaflestad
43829de62d Merge pull request #2550 from bska/separate-boost-test-params
Separate Test Command Line Arguments from Runner Arguments
2021-07-01 22:57:59 +02:00
Bård Skaflestad
85f809c42b Separate Test Command Line Arguments from Runner Arguments
When passing parameters to test runners based on Boost.Test we need
to distinguish the parameters that are intended for the test case
and those that are intended for the Boost.Test framework (e.g.,
"--run_test=").
2021-07-01 16:27:26 +02:00
Bård Skaflestad
f9f54d9cea Merge pull request #2556 from bska/fix-udq-restart-indexing
Don't Use Common Start Offset for UDQ Restart Variables
2021-07-01 16:25:19 +02:00
Bård Skaflestad
cb862b5fa5 Don't Use Common Start Offset for UDQ Restart Variables
The arrays are sized according to the number of variables of each
category (well, group, field), not the number of UDQs.
2021-07-01 14:23:02 +02:00
Bård Skaflestad
b8e9f2d766 Split UDQ Definition Strings Out of Main Loop
Mainly for reduced mental load when reading the body.
2021-07-01 14:21:10 +02:00
Bård Skaflestad
3a2d37b92a Merge pull request #2546 from joakim-hove/udq-rst
Udq rst
2021-07-01 14:19:35 +02:00
Cintia Goncalves Machado
29af0809b7 Add BCAD
BSIP was written twice.
2021-07-01 10:49:31 +02:00
Joakim Hove
6af909778c Load UDQConfig and UDQState from restart data 2021-07-01 07:31:48 +02:00
Joakim Hove
f108463265 Split UDQ tokens also on ' ' 2021-07-01 07:31:03 +02:00
Joakim Hove
1c478078b8 Implement rst udq with std::variant<> for DEFINE and ASSIGN 2021-07-01 07:30:21 +02:00
Joakim Hove
a045550121 Add std::initializer_list constructor for NameOrder 2021-07-01 07:25:54 +02:00
Joakim Hove
1e4a940e70 Add WellMatcher constructor which takes list of wells 2021-07-01 07:25:25 +02:00
Ove Sævareid
e9458705d0 Some formatting of unit names. 2021-06-30 19:04:16 +02:00
Arne Morten Kvarving
0f953dfef8 Merge pull request #2554 from akva2/rh_boost_doc
fix redhat packaging
2021-06-30 15:09:57 +02:00
Arne Morten Kvarving
155ab84649 fix redhat packaging
- use system level boost instead of boost 1.48 now that RHEL6 is dead
- take care of new doc installation
2021-06-30 15:01:09 +02:00
OPMUSER
189db2490a Add NMESSAGE Summary keyword
Add NMESSAGE summary keyword and declarations in config file.
2021-06-30 18:38:13 +08:00
Bård Skaflestad
b39ab05f9f Merge pull request #2537 from GitPaean/new_update_guide_rates_together
[new attempt] update the guide rates for all the wells at the same time.
2021-06-30 12:37:52 +02:00
OPMUSER
f1e7efeb39 JSON Keyword Updates
COMPDAT, GCONINJE and GCONPROD
2021-06-30 18:32:32 +08:00
Ove Sævareid
9013b7dca5 Some support for non-default tracer amount units. 2021-06-30 12:22:52 +02:00
Bård Skaflestad
c492cc5c0b Merge pull request #2545 from joakim-hove/actionx-enable-complump-wpimult
Add COMPLUMP and WPIMULT as AXTIONX enabled keywords
2021-06-30 11:54:10 +02:00
OPMUSER
9133b6125d Update Various JSON Definitions
AQUCON, AQUCT, AQUFETP, EQUIL, MESSAGES, PLYMAX, REGDIMS, and RESTART
2021-06-29 19:17:52 +08:00
Bård Skaflestad
b4eeca78fa Merge pull request #2548 from jalvestad/rstcorr-test
Added test data for IGRP - availablility for higher order control
2021-06-29 09:14:33 +02:00
Kai Bao
23d0185acd update the guide rates for all the wells at the same time. 2021-06-28 23:11:11 +02:00
Jostein Alvestad
98641b3e93 first version of extended IGRP tests 2021-06-28 13:32:50 +02:00
Jostein Alvestad
01b3c8ee64 initial changes to make extended unit tests for AggregateGroupData 2021-06-28 13:32:49 +02:00
Jostein Alvestad
b747a5edbb corrections for errors occurred during rebase - move of code to UDQDims.cpp 2021-06-28 13:32:43 +02:00
Jostein Alvestad
84023e650f correction to test for when to output IGPH 2021-06-28 13:29:42 +02:00
Bård Skaflestad
e7c223bc00 Merge pull request #2544 from OPMUSER/Jason_Updates
JSON updates
2021-06-27 17:06:09 +02:00
OPMUSER
82e0c608d2 FixJSON typos for EDITNNC, FOAMFSC, FOAMOPTS
Fix JSON typos for or EDITNNC, FOAMFSC, FOAMOPTS keywords
2021-06-26 16:16:03 +08:00
Joakim Hove
f7427c9ae8 Merge pull request #2539 from joakim-hove/udq-rst-selector
Alternative selector implementation for UDQAssign loaded from rst
2021-06-26 09:41:54 +02:00
Bård Skaflestad
24c04a0b0d Merge pull request #2543 from joakim-hove/udq-state-refactor
Refactor UDQ state to use plain maps
2021-06-25 22:02:38 +02:00
Bård Skaflestad
f4d5a80fcc Merge pull request #2468 from osae/tracerWell
Support for tracer summary curves, WT(I/P)(R/T/C).
2021-06-25 17:47:56 +02:00
Bård Skaflestad
fc98b2a2dc Merge pull request #2518 from jalvestad/rstfile-corr
Corrections to eclipse-compatible restart file
2021-06-25 17:25:59 +02:00
Joakim Hove
3fa67b21b3 Alternative selector implementation for UDQAssign loaded from rst 2021-06-25 15:25:48 +02:00
Joakim Hove
44e056a84e Merge pull request #2496 from bska/aqunum-initpress-array
Collect Type-Specific Aquifer Data in Single Structure
2021-06-25 15:23:48 +02:00
Joakim Hove
0f9c2c2cf3 Refactor UDQState to use plain maps internally 2021-06-25 15:09:42 +02:00
Joakim Hove
c5bed1a023 Add COMPLUMP and WPIMULT as AXTIONX enabled keywords 2021-06-25 14:33:34 +02:00
OPMUSER
8542fe4128 Fix VISREF Replace semicolon with comma 2021-06-25 18:12:17 +08:00
OPMUSER
5010ebb57e EDITNNC, FOAMFSC, FOAMOPTS and VISCREF
Added item and comments. VISCREF was missing the oil API column.
2021-06-25 18:06:27 +08:00
Bård Skaflestad
4e14cb68e1 Collect Type-Specific Aquifer Data in Single Structure
This commit adds a new helper class,

    Opm::data::TypeSpecificData

which holds type-specific sub-structures for Carter-Tracy,
Fetkovich, and Numerical aquifers.  We implement this facility in
terms of a std::variant<> of simple structures.  In turn, use the
type-specific data for numerical aquifers to fill in the initial
aquifer cell pressures where not available in the input data.
2021-06-25 11:55:56 +02:00
Joakim Hove
d875715cff Merge pull request #2541 from OPMUSER/Jason_Updates
AQUCON, AQUCT, EHYSTR, NETWORK, NNC and UDQDIMS Changes
2021-06-25 11:45:18 +02:00
Joakim Hove
b5d2a224bf Merge pull request #2542 from bska/use-restart-file-view
Reimplement RstState::load In Terms of RestartFileView
2021-06-25 09:54:29 +02:00
Bård Skaflestad
c32aa48b32 Reimplement RstState::load In Terms of RestartFileView
This is in preparation of unconditionally loading analytic aquifer
information from the restart file.  Update callers to new API.
2021-06-25 09:20:55 +02:00
Bård Skaflestad
62893dfcdc RestartFileView: Add Keyword Accessors for 'bool'
Needed to load logical vectors like 'LOGIHEAD'.
2021-06-25 09:14:44 +02:00
OPMUSER
68d3b4ce1f AQUCON, AQUCT, EHYSTR, NETWORK, NNC and UDQDIMS Changes
Added item counter for checking and comment for E300 parameters.
2021-06-25 12:43:50 +08:00
Bård Skaflestad
1c2212487d Merge pull request #2540 from bska/prune-close-brace-semicolon
Prune Needless Trailing ';' On Certain Close Braces
2021-06-25 00:59:36 +02:00
Bård Skaflestad
cbe149a783 Prune Needless Trailing ';' On Certain Close Braces
Removes warning "extra ';'" in GCC's "-Wpedantic" mode.
2021-06-24 23:58:27 +02:00
Jostein Alvestad
0452a0c867 corrections for errors occurred during rebase - move of code to UDQDims.cpp 2021-06-24 23:24:15 +02:00
Jostein Alvestad
72e4891ac5 Correction for inj_phase - index plus function name change 2021-06-24 23:21:39 +02:00
Jostein Alvestad
4633a4c498 correction to test for when to output IGPH 2021-06-24 23:21:19 +02:00
Joakim Hove
ed66a05c54 Merge pull request #2535 from joakim-hove/rstfile-corr-udq
UDQ output updates
2021-06-24 16:58:27 +02:00
Joakim Hove
0d170d7339 Merge pull request #2534 from joakim-hove/udq-rst-preparation
Update UDQ parsing - preparation for restart load
2021-06-24 15:42:54 +02:00
Joakim Hove
31731a3a2a Merge pull request #2538 from akva2/print_opm_tests_rev
print revision of opm-tests
2021-06-24 15:25:09 +02:00
Arne Morten Kvarving
085ec57759 print revision of opm-tests 2021-06-24 14:40:01 +02:00
Joakim Hove
6041a16339 Merge pull request #2536 from OPMUSER/Jason_Updates
WELLDIMS Fix Up
2021-06-24 12:46:08 +02:00
OPMUSER
9c6d1e5395 WELLDIMS Fix Up
Fix missing entry and defaults to eliminate false warning messages.
2021-06-24 17:23:49 +08:00
Joakim Hove
81f6e7dcd7 Merge pull request #2530 from OPMUSER/Jason_Updates
Jason updates #2
2021-06-24 11:10:39 +02:00
OPMUSER
41b7d05285 Correct TABDIMS and ROCKCOMP 2021-06-24 15:51:52 +08:00
Joakim Hove
e73b613582 UDQ output updates 2021-06-24 09:18:34 +02:00
Joakim Hove
3f47cd536d Improve UDQToken pretty output 2021-06-24 01:29:39 +02:00
Joakim Hove
e1c780ee62 Update UDQ parsing - preparation for restart load 2021-06-24 01:08:54 +02:00
Joakim Hove
3b41815974 Merge pull request #2533 from blattms/janitor
Remove warnings about unsigned-signed comparison and init order.
2021-06-23 16:30:37 +02:00
Markus Blatt
48d73bbc6e Remove warnings about unsigned-signed comparison and init order. 2021-06-23 14:42:44 +02:00
Joakim Hove
0d060fad24 Merge pull request #2527 from tskille/parser
Functionality for parsing only selected sections of a data deck
2021-06-23 14:04:42 +02:00
Joakim Hove
3b7f43f7c4 Merge pull request #2529 from joakim-hove/nnc-json
Update JSON scheme for NNC
2021-06-23 13:38:54 +02:00
Bård Skaflestad
91a852dc53 Merge pull request #2519 from joakim-hove/udq-rst
Udq rst
2021-06-23 12:03:25 +02:00
Joakim Hove
ccf23ab301 Update JSON scheme for NNC 2021-06-23 11:53:28 +02:00
Joakim Hove
1e5a1311c4 Load UDQ data from restart files 2021-06-23 08:12:25 +02:00
Joakim Hove
ba21904558 Merge pull request #2524 from joakim-hove/jostein-commits
Jostein commits
2021-06-23 08:11:31 +02:00
Bård Skaflestad
cc55180797 Merge pull request #2525 from joakim-hove/keyword-sections
Keyword sections
2021-06-23 00:34:42 +02:00
Bård Skaflestad
f3de7bde0f Merge pull request #2472 from bska/centralise-aquprop-calculations
Centralise Aquifer PVT Property Calculations and Use Simulator's Values for Restart Output
2021-06-22 20:38:07 +02:00
Ove Sævareid
e7104a4b16 Guard against undefined values. 2021-06-22 20:17:14 +02:00
Ove Sævareid
30d446d41b Tests for tracer summary. 2021-06-22 20:17:14 +02:00
Ove Sævareid
5a22e9c782 Tracer read/write/get. 2021-06-22 20:17:14 +02:00
Ove Sævareid
7f062f213f Comments and cleanup 2021-06-22 20:17:14 +02:00
Ove Sævareid
785d360fed Untangling tracer summary. 2021-06-22 20:17:14 +02:00
Ove Sævareid
94c6c4942c Support for tracer summary curves, WT(I/P)(R/T/C). 2021-06-22 20:17:14 +02:00
Torbjørn Skille
eded5fdb0c add functionality to the parser for parsing selected sections of a data deck
- made available in python bindings
 - added unit tests both for c++ and python
2021-06-22 18:45:24 +02:00
Joakim Hove
84e5307117 Return set of valid sections from ParserKeyword 2021-06-22 17:16:48 +02:00
Joakim Hove
050e82cebd Return deck names from ParserKeyword as std::unordered_set 2021-06-22 17:16:00 +02:00
Joakim Hove
36c07ae545 Remove unused iterator for section names 2021-06-22 17:08:43 +02:00
Bård Skaflestad
b783a1de32 Use More Dynamic Aquifer Data From Simulator
This commit switches to using the simulator's notion of initial
aquifer pressure, aquifer mass density of water, aquifer water
viscosity, and aquifer time constants.  These values will,
ultimately, come from the *_data structures for the analytic
aquifers but the simulator is the only system that is able to
compute equilibrated initial pressure values if that is defaulted in
the input.
2021-06-22 16:36:45 +02:00
Bård Skaflestad
4381eca9ac Rename Analytic Aquifer Structure Data Members
This commit renames various data members of the *_data structures to
aid the reader who may not be intimately familiar with the details
of the analytic models.  We switch the 'initial_pressure' into an
optional<double> instead of a pair<bool,double> with 'std::nullopt'
representing defaulted initial aquifer pressure values in the input
file.

We also add logic and private data members to compute/store aquifer
time constants, mass density of water, water viscosity and, in the
case of Carter-Tracy aquifers, also the influx constant 'beta'.
This centralises the requisite logic which reduces the risk of
subtle errors.

In the case of defaulted initial pressures, we support deferred
calculation of aquifer properties until the equilibrium pressure is
known.  Users are then expected to assign a value to the initial
pressure members and call 'finishInitialisation()' to derive those
properties.

While here, also switch to using raw string literals instead of
concatenated and escaped literals for the embedded deck strings in
the ParserTests.
2021-06-22 16:36:45 +02:00
Joakim Hove
79da27ae91 Remove leading space from ActionX condition 2021-06-22 16:20:24 +02:00
Jostein Alvestad
a1a8d74738 Update IUQD[0] depending on status 2021-06-22 16:20:24 +02:00
Jostein Alvestad
c44dcb8257 changes to DeckOutput.hpp for opmpack 2021-06-22 16:20:24 +02:00
Joakim Hove
8b625b6590 Merge pull request #2523 from joakim-hove/gr-minor
GuideRate / restart - minor stuff
2021-06-22 16:19:59 +02:00
Joakim Hove
b240f15ff8 Move eclipseControlMode function as static method in Well class 2021-06-22 10:32:46 +02:00
Joakim Hove
d1a0b4ab34 Add method GuideRate::init_grvalue() 2021-06-22 10:32:46 +02:00
Joakim Hove
9e2c79517a Remove method Schedule::guideRateConfig() 2021-06-22 10:32:46 +02:00
Bård Skaflestad
be0838981d Merge pull request #2505 from joakim-hove/restore-guide-rates
Assign guide rate values to data::Wells when loading from restart
2021-06-22 09:16:37 +02:00
Joakim Hove
f7299aaea4 Recover guide rates from restart file 2021-06-22 07:24:00 +02:00
Joakim Hove
b0c134d385 Merge pull request #2522 from bska/report-dynpv
Add 'Inplace' Slot for Dynamic Pore Volume
2021-06-21 17:51:44 +02:00
Bård Skaflestad
695357e5f0 Add 'Inplace' Slot for Dynamic Pore Volume
The 'PoreVolume' value is supposed to be calculated at reference
conditions (i.e., no rock compressibility or temperature effects),
but being able to report the non-reference condition value is
beneficial.  This commit adds a slot for accumulating that value per
FIP region and transporting the aggregated values to the PRT output
system.
2021-06-21 16:25:55 +02:00
Joakim Hove
5f4483769b Merge pull request #2521 from joakim-hove/udq-rst-preparations
Udq rst preparations
2021-06-21 09:21:22 +02:00
Joakim Hove
fff4c58a9a Create small class UDQDims with static methods to enable reuse 2021-06-21 08:15:07 +02:00
Joakim Hove
176669d625 RstState add groups and wells by calls from RstState::load() 2021-06-21 08:15:07 +02:00
Joakim Hove
1f9aaae0b8 Merge pull request #2520 from joakim-hove/opmpack-title-special
Make sure deck output of TITLE has trailing newline
2021-06-19 13:42:46 +02:00
Joakim Hove
df2fbd0ab3 Update AggregateUDQTest to output valid restart file 2021-06-19 13:38:41 +02:00
Joakim Hove
94bf2db8c7 Make sure deck output of TITLE has trailing newline 2021-06-19 11:39:25 +02:00
Joakim Hove
862dd4b180 Use unformatted IO in testcase 2021-06-18 15:02:02 +02:00
Joakim Hove
f45f787651 White space 2021-06-18 14:06:43 +02:00
Joakim Hove
92adc65bbe Merge pull request #2517 from joakim-hove/load-rst-group
Add Schedule::addGroup( const RstGroup& ) overload
2021-06-17 21:22:43 +02:00
Joakim Hove
419bdf23c4 Add Schedule::addGroup( const RstGroup& ) overload 2021-06-17 13:19:20 +02:00
Joakim Hove
33f4ec04c2 Merge pull request #2516 from joakim-hove/update-rst-output
Update restart output from EclRegressionTest
2021-06-17 10:11:30 +02:00
Joakim Hove
e561e3fb43 Update restart output from EclRegressionTest 2021-06-17 08:46:51 +02:00
Joakim Hove
bd3724068c Merge pull request #2512 from blattms/doxygen-no-timestamp
For discussion: Deactive timestamping in doxygen for reproducible builds.
2021-06-17 08:32:00 +02:00
Markus Blatt
d052e6e47d Merge pull request #2510 from blattms/debian-patches-2
Further patches to the build system from Debian unstable packaging.
2021-06-16 12:34:04 +02:00
Joakim Hove
59115f818d Merge pull request #2515 from joakim-hove/group-cmode
Group cmode
2021-06-16 12:24:51 +02:00
Markus Blatt
b1a0964cd1 Merge pull request #2511 from blattms/debian-spelling-and-encoding-fixes
Debian spelling and encoding fixes
2021-06-16 10:32:45 +02:00
Joakim Hove
d7eff6159f Use function Group::InjectionCMode2Int() to convert cmode -> int 2021-06-16 08:50:51 +02:00
Joakim Hove
0ff19fa453 Use function Group::ProductionCMode2Int() for enum -> int mapping 2021-06-16 08:50:51 +02:00
Markus Blatt
c957f31d40 Doygen: remove wrong usage of \example directive.
For whatever reason it produced a file like
_2tmp_2reprotest_81JBnX9_2build-experiment-1_2build-experiment-1_2opm_2output_2OutputWriter_8hpp-example.html
with the full path in it.

BTW: correct usage is "\example <cpp-file>" where the cpp file
includes the example code.
2021-06-15 23:14:23 +02:00
Markus Blatt
f8840e7152 Deactive timestamping in doxygen for reproducible builds. 2021-06-15 21:17:03 +02:00
Markus Blatt
b83919d1f3 Changed encoding of all installed headers to UTF-8
On Debian support for national encodings is being phased out.
Fixes lintian warnings about national-encoding.
2021-06-15 21:11:45 +02:00
Markus Blatt
50ec3bca05 Spelling fixes pointed out by lintian. 2021-06-15 21:11:36 +02:00
Markus Blatt
13bf65a73b Install build system documentation to doc and not next to CMake files. 2021-06-15 21:06:55 +02:00
Markus Blatt
ff9792e31c Work around issues of Boost >=1.70.0 and CMake 3.18.4
With that combination the first search seems to happen in CONFIG mode
but subsequent searches will use MODULE mode. This will result in the
following warning:

CMake Warning at /usr/share/cmake-3.18/Modules/FindBoost.cmake:1187 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  /usr/share/cmake-3.18/Modules/FindBoost.cmake:1311 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/share/cmake-3.18/Modules/FindBoost.cmake:1919 (_Boost_MISSING_DEPENDENCIES)
  cmake/Modules/OpmFind.cmake:135 (find_package)
  cmake/Modules/OpmFind.cmake:230 (find_and_append_package_to)
  cmake/Modules/OpmLibMain.cmake:83 (find_and_append_package_list_to)
  CMakeLists.txt:222 (include)

Also the variable Boost_LIBRARIES will look quite messed up by
occurrences of optimized and debug:
Boost_LIBRARIES=optimized;/usr/lib/x86_64-linux-gnu/libboost_system.so.1.74.0;debug;/usr/lib/x86_64-linux-gnu/libboost_system.so;optimized;/usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.74.0;debug;/usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so

Which will make the modules unusable because of CMake errors during
linking:

CMake Error at /usr/share/dune/cmake/modules/DuneMacros.cmake:991 (target_link_libraries):
  The "debug" argument must be followed by a library.
Call Stack (most recent call first):
  src/CMakeLists.txt:2 (target_link_dune_default_libraries)
-- Configuring incomplete, errors occurred!

Note this fix is only needed for Boost versions 1.70 and higher.
Older versions do not provide cmake package configuration
files (BoostConfig.cmake) and hence there can be no mixup.

Note also that the alternative approach of setting
CMAKE_FIND_PACKAGE_PREFER_CONFIG does not work for OPM as with this
e.g. the Dune module versions would not be set correctly.
2021-06-15 21:04:41 +02:00
Markus Blatt
bf55667553 Allow installation of bash completion scripts to new location.
That location is /usr/share/bash-completion/completions and scripts
will be loaded on demand. Added option USE_BASH_COMPLETIONS_DIR (default OFF)
to request this. It is needed to prevent lintian warnings for Debian
packages.
2021-06-15 20:56:50 +02:00
Joakim Hove
428563e33a Merge pull request #2503 from joakim-hove/wells-output-json
Wells output json
2021-06-15 10:14:51 +02:00
Joakim Hove
702de267bc Add json output for data::Group 2021-06-15 07:38:41 +02:00
Joakim Hove
011845992f Add Json output from output::Wells 2021-06-15 07:38:34 +02:00
Joakim Hove
73d2f7812e Merge pull request #2504 from joakim-hove/rename-wellrates
Rename data::WellRates -> data::Wells
2021-06-14 18:21:33 +02:00
Joakim Hove
69dfff722b Merge pull request #2506 from joakim-hove/guiderate-model-const
Make method GuideRateModel::updateLINCOM() const
2021-06-14 15:30:46 +02:00
Joakim Hove
71ccf698ab Make method GuideRateModel::updateLINCOM() const 2021-06-14 12:52:28 +02:00
Joakim Hove
9fe4be5ebf Rename data::WellRates -> data::Wells 2021-06-12 09:33:05 +02:00
Bård Skaflestad
5e1d923647 Merge pull request #2500 from joakim-hove/del-timemap
Remove stale class TimeMap
2021-06-10 20:30:08 +02:00
Joakim Hove
37f07a1b18 Remove stale class TimeMap 2021-06-10 14:12:12 +02:00
Bård Skaflestad
b7c79c2da7 Merge pull request #2485 from bska/track-gconinje-udqactive
Track UDA Active Status for Group Injection Controls
2021-06-10 12:33:14 +02:00
Arne Morten Kvarving
e88909995f upadte-opm-tests: supply access token in header 2021-06-10 10:25:54 +02:00
Bård Skaflestad
5ab4bdc2db Track UDA Active Status for Group Injection Controls
This commit adds a new member function, updateUDQActive, to the
group injection properties.  This is inspired by the function of the
same name in the group production properties and fills the same
purpose.  This, in turn, enables tracking whether a GCONINJE keyword
activates a user-defined argument.  That status is in turn needed to
generate the 'IUAD' restart vector in the restart file in the face
of models for which the only UDA is in GCONINJE.
2021-06-09 20:41:03 +02:00
Bård Skaflestad
665a82b9cd Identify GCONINJE UDA Items
This commit adds UDA items for the GCONINJE keyword.  This is in
preparation of tracking UDA status in this context.  While here,
also add unit tests for the expected values of UDQ::keyword() and
UDQ::udaCode().
2021-06-09 20:41:03 +02:00
Bård Skaflestad
cefc083135 Associate Group Injection Properties to Named Group
This commit adds a new data member, group_name, to the injection
properties per group.  This is in preparation of tracking the UDQ
active status for group injection controls (keyword GCONINJE).
Group production properties already have a similar data member for
the same purpose.
2021-06-09 20:41:03 +02:00
Bård Skaflestad
1f26249ce9 Merge pull request #2498 from bska/public-rst-file-view
Promote RestartFileView to Public Access
2021-06-09 20:38:44 +02:00
Bård Skaflestad
82ccd15580 Promote RestartFileView to Public Access
In preparation of loading analytic aquifers from the restart file.
2021-06-09 00:35:13 +02:00
Bård Skaflestad
423b4a39e6 Merge pull request #2497 from joakim-hove/connections-num-open
Add method ConnectionSet::num_open()
2021-06-08 17:59:46 +02:00
Joakim Hove
9dd4c43209 Add method ConnectionSet::num_open() 2021-06-08 14:41:52 +02:00
Joakim Hove
59efd8e98e Merge pull request #2493 from akva2/add_missing_forward
add missing forward declaration
2021-06-05 22:56:07 +02:00
Joakim Hove
4127c45866 Merge pull request #2494 from blattms/prevent-further-reallocations
Prevent reallocations where possible when parsing items.
2021-06-04 18:25:18 +02:00
Markus Blatt
de37080dae Prevent reallocations where possible when parsing items.
We either reserve or use std::vector::insert instead of just
blindly using push_back.
2021-06-04 16:21:05 +02:00
Arne Morten Kvarving
ebadbdc0ac add missing forward declaration 2021-06-04 13:18:42 +02:00
Bård Skaflestad
4238209e8f Merge pull request #2492 from atgeirr/silence-warnings
Silence warnings.
2021-06-03 17:09:55 +02:00
Atgeirr Flø Rasmussen
51701f230e Silence warnings. 2021-06-03 12:22:45 +02:00
Joakim Hove
e01e8e9225 Merge pull request #2471 from bska/communicate-dynamic-aqudata
Communicate Dynamic Aquifer Data
2021-05-29 07:47:18 +02:00
Joakim Hove
542edd6fa9 Merge pull request #2487 from bska/nrsegz-actph
Account for RSEG Size Depending on Number of Active Phases
2021-05-29 07:45:57 +02:00
Bård Skaflestad
a1fd22d578 Make Aquifer Data a First Class RestartValue
This commit promotes the 'aquifer' data member of 'RestartValue' to
first class status.  In particular, this means that users must
provide aquifer data, albeit possibly empty, when constructing the
RestartValue object for input or output.

This is in preparation of using more dynamic aquifer quantities from
the simulator layer as part of the restart I/O.
2021-05-28 17:41:29 +02:00
Bård Skaflestad
15150bee50 Add Communication Support for Dynamic Aquifer Data
This commit introduces 'MessageBuffer' read and write operations for
the CarterTracyData and FetkovichData structures in preparation of
communicating these substructures from parallel processes to the IO
rank.  This is foundational work for retrieving more of the dynamic
quantities pertaining to aquifers from the simulation layer.
2021-05-28 17:41:29 +02:00
Bård Skaflestad
096ef91b73 Account for RSEG Size Depending on Number of Active Phases
The number of data items per well segment in the RSEG restart vector
turns out to depend on the number of active phases (Oil, Gas, Water)
in the simulation run.  In particular, the following relations hold

  * Single phase (Oil, Gas, or Water):          NRSEGZ = 126
  * Two phases (Oil/Gas, Oil/Water, Gas/Water): NRSEGZ = 134
  * Three phases (Oil/Gas/Water):               NRSEGZ = 146

This commit implements that variability.

The output layer does not currently use any items above index 110 so
this does not alter the contents of RSEG, only the size, for 1p or
2p simulation runs.
2021-05-28 17:41:20 +02:00
Bård Skaflestad
1b4c833c2f Merge pull request #2491 from joakim-hove/remove-unused
Remove unused variables
2021-05-28 17:37:25 +02:00
Bård Skaflestad
46e336fbb4 Merge pull request #2490 from joakim-hove/expose-stdout
Expose function stdoutIsTerminal() as static member in OpmLog
2021-05-28 13:08:28 +02:00
Joakim Hove
c9325ccfcc Remove unused variables 2021-05-28 12:02:14 +02:00
Joakim Hove
e57febca9a Expose function stdoutIsTerminal() as static member in OpmLog 2021-05-28 10:12:30 +02:00
Joakim Hove
3c4935e10b Merge pull request #2489 from joakim-hove/nupcol-update
Nupcol updates
2021-05-28 07:22:27 +02:00
Joakim Hove
0d565f9c10 Nupcol updates 2021-05-28 00:59:09 +02:00
Bård Skaflestad
6ea6891ccb Merge pull request #2488 from joakim-hove/shrink-to-fit
Add shrink_to_fit() for underlying storage in DeckItem
2021-05-27 18:14:37 +02:00
Joakim Hove
503ad0b98c Add shrink_to_fit() for underlying storage in DeckItem 2021-05-27 12:45:03 +02:00
Bård Skaflestad
dee11eae41 Merge pull request #2475 from jalvestad/rst-wlist
Output of restart tables for Well list information to the Eclipse compatible restart files
2021-05-27 10:29:44 +02:00
Jostein Alvestad
589c6014a4 changed WLIST unit test - made consistent with WListManager - newList 2021-05-26 15:25:58 +02:00
Jostein Alvestad
60148fda30 modification-correction of serialization of well_wlist_names 2021-05-26 14:27:51 +02:00
Jostein Alvestad
7974fd219a modified code to handle new empty wlists and make action NEW more robust 2021-05-26 13:58:06 +02:00
Joakim Hove
bf6ca3ff58 Merge pull request #2481 from joakim-hove/min-nupcol
Min nupcol
2021-05-26 10:22:09 +02:00
Jostein Alvestad
d1eafd6919 removed comments and removed unnecessary include-headers 2021-05-26 09:02:46 +02:00
Joakim Hove
b3b73c6f02 Merge pull request #2484 from bska/fix-double-inc
Don't Increment Loop Counter Twice
2021-05-26 00:39:55 +02:00
Bård Skaflestad
32fa3df6b6 Don't Increment Loop Counter Twice 2021-05-25 17:31:44 +02:00
Jostein Alvestad
5907a7520a first complete version that satisfies all unit tests 2021-05-25 10:37:45 +02:00
Jostein Alvestad
31c55af919 first running rewritten version - use WListManager only 2021-05-25 10:37:43 +02:00
Jostein Alvestad
4c9832aedc minor change of variable name rptStep to simStep to be consistent 2021-05-25 10:37:42 +02:00
Jostein Alvestad
1ffbfded8e cleaned up code - removed comments 2021-05-25 10:37:41 +02:00
Jostein Alvestad
c6a798cd2a completed unit tests for WList-data 2021-05-25 10:37:40 +02:00
Jostein Alvestad
96f0c2fbdd further changes unit tests 2021-05-25 10:37:39 +02:00
Jostein Alvestad
5dd815bcbe partial completion of unit tests 2021-05-25 10:37:37 +02:00
Jostein Alvestad
50cb354e23 added unit tests incl. test dataset 2021-05-25 10:37:33 +02:00
Jostein Alvestad
1086c60825 first version of restart output for WLIST keyword, plus related parser code changes 2021-05-25 10:37:29 +02:00
Joakim Hove
76fdcc2985 Merge pull request #2482 from joakim-hove/actionx-well-event
Add new well event for wells which have been touched by ACTIONX
2021-05-22 11:16:46 +02:00
Joakim Hove
ff292908ff Add new well event for wells which have been touched by ACTIONX 2021-05-21 15:55:39 +02:00
Joakim Hove
8dd9b47fd4 Use Nupcol class in Runspec & ScheduleState 2021-05-21 14:53:12 +02:00
Joakim Hove
2e52d46b68 Add class Nupcol 2021-05-21 14:40:36 +02:00
Bård Skaflestad
536265a8a3 Merge pull request #2480 from bska/write-aqunum-restart
Add Restart Output for Numeric Aquifers
2021-05-20 13:58:58 +02:00
Bård Skaflestad
6c1c753764 Add Numeric Aquifer Restart Output
This commit generates the IAQN and RAQN restart vectors pertaining
to numeric aquifers.  The arrays are sized according to the number
of records in the input AQUNUM keyword.  RAQN is a mix of static and
dynamic information, including the cumulative total inflow volume of
water from the aquifer into the model.  IAQN is exclusively static
information.

We add new members to 'AggregateAquiferData' and ensure that the
numeric aquifer arrays remain empty when no numeric aquifers exist
in the model.  Add unit tests for these new arrays and update
existing unit tests to account for new dimension items.
2021-05-19 23:07:05 +02:00
Bård Skaflestad
8c33979071 Ensure Existence of ANQx Summary Vectors
These are needed for restart purposes.
2021-05-19 23:03:45 +02:00
Bård Skaflestad
5a81df350c Identify Numeric Aquifer Restart Array Items
In particular, identify most the items in the IAQN and RAQN arrays.
While here, also make INTEHEAD Items for numeric aquifers public.
2021-05-19 22:42:58 +02:00
Joakim Hove
cb5e4eff2b Merge pull request #2479 from joakim-hove/actionx-output-sep
Actionx output sep
2021-05-19 16:51:29 +02:00
Joakim Hove
a99c27add1 Make sure ACTIONX restart output is formatted as opmpack 2021-05-19 13:02:31 +02:00
Joakim Hove
4b831e750a Assemble output formatting in small struct 2021-05-19 13:02:10 +02:00
Joakim Hove
f259f78788 Merge pull request #2477 from bska/count-aqunum-records
Track AQUNUM Records for Restart Purposes
2021-05-19 07:42:13 +02:00
Bård Skaflestad
8eb9bee6ed Track AQUNUM Records for Restart Purposes
When forming restart arrays for numerical aquifers (IAQN and RAQN)
we need to know the total number of records in the input AQUNUM
keyword as well as the record ID of each individual record.  This
commit adds a tracking mechanism for this information.

While here, also add unit tests that verify that we've correctly
interpreted the AQUNUM records.
2021-05-18 21:17:33 +02:00
Joakim Hove
f58a314f6a Merge pull request #2476 from totto82/guideRateTypeRES
Add support for guide rate type RES
2021-05-18 21:15:29 +02:00
Joakim Hove
bf064812d3 Merge pull request #2478 from berland/extend_options_items
Extend number of parameters to OPTIONS keyword.
2021-05-18 20:42:15 +02:00
Håvard Berland
fb2d5dc620 Extend number of parameters to OPTIONS keyword.
Eclipse 2019.1 reference manual goes to item number 319
2021-05-18 14:02:46 +02:00
Tor Harald Sandve
a18866b355 Add support for guide rate type RES 2021-05-18 11:20:57 +02:00
Joakim Hove
147359c564 Merge pull request #2473 from bska/fix-smry-anx-all
Output Summary for all Numeric Aquifers When ID Defaulted
2021-05-17 07:11:08 +02:00
Bård Skaflestad
51cf551eac Output Summary for all Numeric Aquifers When ID Defaulted
This commit extends the 'SummaryConfig' aquifer processing to
recognize numeric aquifer keywords without an explicit list of
aquifer IDs, i.e., summary keywords of the form

    ANQR
    /

We use the new functions '{analytic,numeric}AquiferIDs()' to form
lists of pertinent IDs once and then ensure that we create nodes
only for proper subsets of these ID sets.

Add unit tests to both the analytic and numeric configurations to
ensure that we generate these output sets or input errors when the
input file refers to IDs of incorrect type or out of range.
2021-05-16 12:15:46 +02:00
Bård Skaflestad
79b1f97640 Provide Means of Linearising All Aquifer IDs in a Model
This commit adds two helper functions

    std::vector<int> analyticAquiferIDs(const AquiferConfig&)
    std::vector<int> numericAquiferIDs(const AquiferConfig&)

which return the numeric IDs of the model's analytic and numeric
aquifers respectively.  These are useful for configuring aquifer
summary keywords of the form

    AAQR
    /

that do not list individual aquifer IDs and for identifying issues
in the input file when a summary keyword that does list its aquifer
IDs refers to an aquifer of incorrect category (e.g., ID of numeric
aquifer in an analytic aquifer summary keyword).

While here, also add more unit test coverage to the AquiferConfig
object.  In particular, add a unit test that includes aquifers at
all.
2021-05-16 12:15:46 +02:00
Joakim Hove
f44b49338b Merge pull request #2474 from bska/deckkeyword-empty
Add 'empty' Predicate to DeckKeyword Type
2021-05-16 07:30:24 +02:00
Bård Skaflestad
b216c63921 Add 'empty' Predicate to DeckKeyword Type
Makes logic statements more explicit and removes a number of
"signed vs. unsigned" comparison operations.
2021-05-16 00:07:10 +02:00
Joakim Hove
98b49964f5 Merge pull request #2470 from vkip/master
Adding support for DATES with time (HH:MM:SS.MICROSEC) in python/opm/utils/time_vector.py
2021-05-14 08:03:23 +02:00
Vegard Kippe
e5987985be Removed pandas dep also from supporting files.. 2021-05-13 10:53:03 +02:00
Vegard Kippe
8a69023089 Removed the pandas dependency 2021-05-13 10:47:27 +02:00
Vegard Kippe
988ff7521b Add python3-pandas to debian/control 2021-05-12 14:49:28 +02:00
Vegard Kippe
62e78e0018 Adding pandas to requirements.txt 2021-05-12 12:36:42 +02:00
Vegard Kippe
fe5004685c Adding support for time (HH:MM:SS.MICROSEC) in time_vector. Updating tests accordingly. 2021-05-12 12:16:34 +02:00
Joakim Hove
dc207ae8c5 Merge pull request #2469 from atgeirr/optimize-for-large-nnc-case
Optimize further for large NNC case
2021-05-11 20:46:35 +02:00
Atgeirr Flø Rasmussen
521cd5610f Remove extra reserved item capacity in ParseRecord. 2021-05-11 15:56:54 +02:00
Atgeirr Flø Rasmussen
fef696d978 Make duplicate name of item check optional in DeckRecord constructor.
This is for catching programmer error mostly, so it has been disabled
in the call path used in OPM Flow.
2021-05-11 15:30:31 +02:00
Joakim Hove
12a41a7b1f Merge pull request #2467 from atgeirr/add-deck-move-constructor
Add move constructor for Deck.
2021-05-11 11:00:41 +02:00
Atgeirr Flø Rasmussen
395bb1ca90 Add move constructor for Deck. 2021-05-11 08:10:18 +02:00
Bård Skaflestad
fea7bbce6d Merge pull request #2466 from jalvestad/rst-file_corrections
Some corrections / improvements to the eclipse - compatible restart file
2021-05-10 22:00:03 +02:00
Jostein Alvestad
26cc7897c6 correction to SWEL for prediction mode wells 2021-05-10 09:54:25 +02:00
Jostein Alvestad
777de0673f Added correction for IH[ROCKOPTS_TTYP] 2021-05-10 09:54:23 +02:00
Jostein Alvestad
68fbc5f51b further changes/corrections 2021-05-10 09:54:20 +02:00
Jostein Alvestad
184bff2e6b correction to ZACN - include Field props rhs.quantities [ind+1] 2021-05-10 09:54:18 +02:00
Jostein Alvestad
2e6fa4468b Correction for change of dimension of INOBR array v. 2019 2021-05-10 09:54:16 +02:00
Joakim Hove
3a4a8c91c6 Merge pull request #2465 from joakim-hove/wg-events-has
Add method WellGroupEvents::has(wgname)
2021-05-10 08:47:06 +02:00
Joakim Hove
14885372d2 Add method WellGroupEvents::has(wgname) 2021-05-09 16:32:07 +02:00
Joakim Hove
c1442803bd Merge pull request #2463 from joakim-hove/get_events
Add method WellGroupEvents.at() to get individual events
2021-05-09 13:52:22 +02:00
Joakim Hove
65edae0b2e Add method WellGroupEvents.at() to get individual events 2021-05-09 11:44:11 +02:00
Joakim Hove
d50b5852e0 Merge pull request #2464 from akva2/no_more_python3.5
changed: python 3.5 is no longer support in pypi
2021-05-08 20:13:10 +02:00
Arne Morten Kvarving
04ae012638 changed: python 3.5 is no longer support in pypi 2021-05-08 19:25:06 +02:00
Bård Skaflestad
65dc2e0942 Merge pull request #2462 from joakim-hove/keyword-generator-default-precision
Make sure precision is retained in very small default values

Closes #2448
2021-05-07 12:45:16 +02:00
Joakim Hove
f1c3c66996 Merge pull request #2461 from atgeirr/add-missing-include
Add missing <sstream> include.
2021-05-06 15:45:24 +02:00
Joakim Hove
e2572ed89e Merge pull request #2460 from joakim-hove/clear-events
Add clearEvent() method to consume events
2021-05-06 15:45:09 +02:00
Joakim Hove
b21fd3e3e8 Make sure precision is retained in very small default values 2021-05-06 15:33:21 +02:00
Atgeirr Flø Rasmussen
d3c32d1906 Add missing <sstream> include. 2021-05-06 11:34:47 +02:00
Bård Skaflestad
25db0ec1db Merge pull request #2458 from joakim-hove/mapaxes
Mapaxes
2021-05-05 20:33:17 +02:00
Joakim Hove
05fee1fd12 Add small class to handle MAPAXES & MAPUNITS 2021-05-05 16:09:58 +02:00
Joakim Hove
4372354174 Merge pull request #2361 from bska/dont-copy-wells-for-smry-eval
Don't Copy Well Objects During Summary Vector Evaluation
2021-05-05 16:07:23 +02:00
Joakim Hove
881da80e96 Add clearEvent() method to consume events 2021-05-05 13:40:50 +02:00
Joakim Hove
6509da9b66 Merge pull request #2459 from akva2/no_opm_in_opm
fixed: do not use Opm:: prefix when inside namespace Opm
2021-05-05 13:10:49 +02:00
Arne Morten Kvarving
978150d78f fixed: do not use Opm:: prefix when inside namespace Opm
this is at best bad practice and can lead to confusing
errors because compiler will interpret it as Opm:: if there
is no 'foo' symbol available in the Opm namespace and give
confusing 'no symbol Opm::Opm::foo' error messages.
2021-05-05 09:43:07 +02:00
Bård Skaflestad
3a5934a09e Don't Copy Well Objects During Summary Vector Evaluation
This commit makes the 'find_wells()' helper function return a vector
of (const) Well pointers instead of fully fledged Well objects.
This, in turn, eliminates quite a bit of the overhead of evaluating
well-based summary vectors (i.e., well, group, field, and connection
level vectors).
2021-05-04 13:17:52 +02:00
Joakim Hove
6650369970 Fix dimension handling for MAPAXES / MAPUNITS 2021-05-04 13:15:40 +02:00
Joakim Hove
2ca78faf3c Configure MAPAXES as DATA keyword to enable loading from IMPORT 2021-05-04 13:15:40 +02:00
Joakim Hove
2da2b28159 Merge pull request #2457 from joakim-hove/remove-get-mapaxes
Remove getMAPAXES from EclipseGrid public api
2021-05-04 13:14:54 +02:00
Joakim Hove
a093251235 Remove unused mapaxes argument in constructor / init 2021-05-04 10:39:48 +02:00
Joakim Hove
d3f2f593eb Remove public method EclipseGrid::getMAPUNITS() 2021-05-04 07:48:23 +02:00
Joakim Hove
a6d574581d Remove getMAPAXES from EclipseGrid public api 2021-05-03 15:19:47 +02:00
Joakim Hove
507242c9e7 Merge pull request #2452 from bska/fix-gaslift-restart
Don't Output Gas Lift Parameters Unless Active
2021-05-03 12:45:28 +02:00
Bård Skaflestad
c76f1364c2 Don't Output Gas Lift Parameters Unless Active
This commit checks that gas lift is active before outputting a
positive value in INTEHEAD[EACHNC].  Unless gas lift is activated
through keyword LIFTOPT, that item in INTEHEAD must be zero.
2021-05-02 00:17:05 +02:00
Arne Morten Kvarving
04622a13a5 Merge pull request #2456 from blattms/fix-cmake-package-config
Include OpmPackage in opm-project-config.cmake and force -std=c++17
2021-04-30 11:11:32 +02:00
Bård Skaflestad
efcb8d9c00 Merge pull request #2454 from akva2/fix_missing_include
fixed: include <stdexcept> in RFTConfig.cpp
2021-04-29 20:34:36 +02:00
Markus Blatt
ddfe309a88 Use current CMAKE_CXX_STANDARD in opm-project-prereq.cmake 2021-04-29 16:03:59 +02:00
Markus Blatt
7740e00883 Removed code for CMake < 3.10 2021-04-29 16:03:21 +02:00
Markus Blatt
f336cd1b74 Include OpmPackage in opm-project-config.cmake and force -std=c++17
OpmPackage is needed as it defines find_package_deps. The CXX standard
needs to be set as some cmake package config scripts will add
incompatible compile switches like -std=gnu++11 otherwise (I guess
because of import targets with INTERFACE_COMPILE_FEATURES), that will
break the build.
2021-04-29 14:07:59 +02:00
Arne Morten Kvarving
63f336c931 fixed: include <stdexcept> in connection.cpp 2021-04-29 13:24:37 +02:00
Arne Morten Kvarving
bb164e2dd0 fixed: include <stdexcept> in RFTConfig.cpp 2021-04-29 12:40:58 +02:00
Bård Skaflestad
98a2d1b8a3 Merge pull request #2449 from akva2/fix_missing_include
fixed: include <limits> in TranCalculator
2021-04-29 12:12:53 +02:00
Arne Morten Kvarving
8753bef383 fixed: include <limits> in TranCalculator
also forward struct as struct
2021-04-29 10:26:35 +02:00
Joakim Hove
c05ea0fe21 Merge pull request #2441 from akva2/use_forwarding
Use forwarding
2021-04-27 19:30:04 +02:00
Joakim Hove
da6df3cc87 Merge pull request #2444 from joakim-hove/actions-wait-time-equal
ActionX wait time compared with =>
2021-04-27 16:17:30 +02:00
Arne Morten Kvarving
b063fcd089 remove some unnecessary includes
from tests and a few schedule classes
2021-04-27 12:55:45 +02:00
Arne Morten Kvarving
bc3863912f BoxTests: fix test suite name 2021-04-27 12:55:45 +02:00
Arne Morten Kvarving
b968cd7d95 SummaryState: move forwarding to fix doxy 2021-04-27 12:55:45 +02:00
Arne Morten Kvarving
058b41e7d7 RFTConfig: remove unnecessary include 2021-04-27 12:55:45 +02:00
Arne Morten Kvarving
43dfdd4d2d UDQContext: forward types to avoid includes 2021-04-27 12:55:45 +02:00
Arne Morten Kvarving
4fe78a0424 LogUtil: forward types to avoid includes 2021-04-27 12:55:45 +02:00
Arne Morten Kvarving
b51779b6f8 UDQSet: forward types to avoid includes 2021-04-27 12:55:45 +02:00
Arne Morten Kvarving
1ff9cf93aa Connection: forward types to avoid includes 2021-04-27 12:55:45 +02:00
Arne Morten Kvarving
bc633fb09a UDQConfig: forward types to avoid includes 2021-04-27 12:55:45 +02:00
Arne Morten Kvarving
0dd63e4f84 SICD/AutoICD: forward types to avoid includes
move helper template to separate private header to avoid
use of symbols in header
2021-04-27 12:55:45 +02:00
Arne Morten Kvarving
9876a73a53 Well: forward types to avoid includes 2021-04-27 12:45:24 +02:00
Arne Morten Kvarving
cd7a12ce48 WellConnections: forward types to avoid includes 2021-04-27 12:45:24 +02:00
Arne Morten Kvarving
c407618375 Schedule: forward types to avoid includes
move constructor definition to compile unit
to avoid symbol usage in header
2021-04-27 12:45:24 +02:00
Arne Morten Kvarving
1ef8fd987b JFunc: forward types to avoid includes 2021-04-27 12:45:24 +02:00
Arne Morten Kvarving
b835c33c1a TableManager: forward types to avoid includes
move private template definitions to compile unit
to avoid using symbol definitions in header
2021-04-27 12:45:24 +02:00
Arne Morten Kvarving
2e5554598d RSTConfig: forward types to avoid includes 2021-04-27 12:45:24 +02:00
Arne Morten Kvarving
35c20318f4 RPTConfig: forward types to avoid includes 2021-04-27 12:45:24 +02:00
Arne Morten Kvarving
b9e8f01862 GConSale: forward types to avoid includes 2021-04-27 12:45:24 +02:00
Arne Morten Kvarving
c43076f598 GConSump: forward types to avoid includes 2021-04-27 12:45:24 +02:00
Arne Morten Kvarving
97eaa972c2 EclipseState: forward types to avoid includes
also clean up some unnecessary forwards, old debugging code
2021-04-27 12:45:24 +02:00
Arne Morten Kvarving
1e232cf5c0 Actdims: forward types to avoid includes 2021-04-27 12:45:24 +02:00
Arne Morten Kvarving
85d56347ba MULTREGTScanner: forward types to avoid includes 2021-04-27 12:45:24 +02:00
Arne Morten Kvarving
d96a246441 GridDims: forward types to avoid includes 2021-04-27 12:45:24 +02:00
Arne Morten Kvarving
7fd4d2bd9f EInit: move template definition to cpp file
and use explicit template instantation to generate necessary symbols.

this allows not pulling in error macros in header
2021-04-27 12:45:24 +02:00
Arne Morten Kvarving
007fdc73aa ERst: move template definition to cpp file
and use explicit template instantation to generate necessary symbols.

this allows not pulling in error macros in header
2021-04-27 12:45:24 +02:00
Arne Morten Kvarving
b9b71d7c1f EclFile: move template definition to cpp file
only used internally. this allows not pulling in error macros in header
2021-04-27 12:45:24 +02:00
Arne Morten Kvarving
651fcc5dc0 EclipseGrid: forward types to avoid includes 2021-04-27 12:45:24 +02:00
Arne Morten Kvarving
079e51e8c0 DeckKeyword: forward types to avoid includes 2021-04-27 12:45:24 +02:00
Joakim Hove
0ef2bc1528 ActionX wait time compared with => 2021-04-27 11:59:17 +02:00
Arne Morten Kvarving
b7fca24862 Merge pull request #2443 from totto82/bump_master
Bump version number
2021-04-27 10:13:28 +02:00
Tor Harald Sandve
6ad6283706 Bump version number 2021-04-27 09:59:50 +02:00
Joakim Hove
76286d9b97 Merge pull request #2426 from bska/support-voidage-smry
Summary: Support Voidage Vectors CV{I,P}{R,T}
2021-04-26 10:27:18 +02:00
Bård Skaflestad
7055a18a97 Summary: Support Voidage Vectors CV{I,P}{R,T}
This commit adds support for outputting the reservoir voidage volume
summary vectors CVPR (production rate), CVPT (cumulative production
total), CVIR (injection rate), and CVIT (cumulative injection total).

The simulator uses the 'data::Connection::reservoir_rate' member to
communicate these values, so add a special purpose evaluation
function to compute the requisite updates.

While here, also add 'CVPR' to the 'CONNECTION_PROBE'.  This keyword
being missing looks to be an earlier oversight.
2021-04-24 20:27:17 +02:00
Bård Skaflestad
06d2520b07 Remove Executable Bit From Source Files 2021-04-24 20:27:17 +02:00
Joakim Hove
086b44c0fb Merge pull request #2440 from akva2/fix_fallout_2438
Fix fallout from PR #2438
2021-04-24 08:27:12 +02:00
Arne Morten Kvarving
0fcbfac33d fixed: missing member initialization
if deck has no rockcomp keyword, variable is not written
2021-04-23 22:18:52 +02:00
Arne Morten Kvarving
7a4e63c24b Revert "Temp disable test"
This reverts commit aeb4ba3788.
2021-04-23 22:09:35 +02:00
Bård Skaflestad
c62563a7e5 Merge pull request #2439 from joakim-hove/fix-rst
Inclide cstdlib to get EXIT_SUCCESS and EXIT_FAILURE
2021-04-23 20:31:47 +02:00
Joakim Hove
aeb4ba3788 Temp disable test 2021-04-23 19:12:33 +02:00
Joakim Hove
326b1638dc Inclide cstdlib to get EXIT_SUCCESS and EXIT_FAILURE 2021-04-23 19:11:32 +02:00
Joakim Hove
2934a5ac1a Merge pull request #2438 from akva2/avoid_gen_headers_in_headers
Avoid headers in headers
2021-04-23 17:30:59 +02:00
Bård Skaflestad
1bfc81c82f Merge pull request #2437 from akva2/prune_boost_includes
changed: remove unnecessary boost includes
2021-04-23 16:09:57 +02:00
Arne Morten Kvarving
96da3d3c98 PlyshlogTable: remove unnecessary include 2021-04-23 13:05:08 +02:00
Arne Morten Kvarving
131a34f336 RockConfig: put some more code in cpp file
to avoid include files in header
2021-04-23 13:05:08 +02:00
Arne Morten Kvarving
c80da8bb6c MessageLimits: put some more code in cpp file
to avoid include files in header
2021-04-23 13:05:08 +02:00
Arne Morten Kvarving
3307889464 Tabdims: put some code in separate compile unit
to avoid include files in header
2021-04-23 13:05:08 +02:00
Arne Morten Kvarving
6547376330 Regdims: put some code in separate compile unit
to avoid include files in header
2021-04-23 13:05:08 +02:00
Arne Morten Kvarving
625c33f18f Eqldims: put some code in separate compile unit
to avoid include files in header
2021-04-23 13:05:08 +02:00
Arne Morten Kvarving
dcba5e2641 Aqudims: put some code in separate compile unit
to avoid include files in header
2021-04-23 13:05:05 +02:00
Arne Morten Kvarving
54979c1aed Tuning: put some code in separate compile unit
to avoid include files in header
2021-04-23 13:05:01 +02:00
Arne Morten Kvarving
3a01bf6a51 TranCalculator: put some code in separate compile unit
to avoid include files in header
2021-04-23 13:04:53 +02:00
Arne Morten Kvarving
95925e8648 fix header guards 2021-04-23 13:04:53 +02:00
Arne Morten Kvarving
72ede7df50 changed: remove unnecessary boost includes 2021-04-23 11:27:38 +02:00
Joakim Hove
b1e76e0038 Merge pull request #2389 from GitPaean/using_pinched_grid_numerical_aquifer
Using pinched grid for numerical aquifer
2021-04-21 13:03:21 +02:00
Joakim Hove
9e3ad90b8a Merge pull request #2434 from akva2/fix_serialize_valgrind
Fix some valgrind errors in test_ParallelRestart
2021-04-21 13:01:10 +02:00
Kai Bao
b3f53b2f04 renaming function names for numerical aquifers
following reviewing comment.
2021-04-21 09:35:54 +02:00
Arne Morten Kvarving
c7a7caff56 fixed: do no use [] to deref when checking for data
this causes default initialized objects if key is missing,
and these objects tend to have uninitialized members.
2021-04-21 09:33:24 +02:00
Arne Morten Kvarving
c817c4de33 fixed: missing data in serializeObjects 2021-04-21 09:33:24 +02:00
Arne Morten Kvarving
84c2d2239e simplify
this is a vector of POD so we can use the primitive serializer directly
2021-04-21 09:33:24 +02:00
Arne Morten Kvarving
c99c8e1193 fixed: initialize data
can cause uninitialized data usage when default constructed
2021-04-21 09:33:24 +02:00
Joakim Hove
ca03815efe Merge pull request #2433 from totto82/fldNO
let cmode FLD override yes/no in item8 in GCONPROD and GCONINJE
2021-04-21 08:44:28 +02:00
Tor Harald Sandve
49bac6f251 let cmode FLD override yes/no in item8 in GCONPROD and GCONINJE 2021-04-20 11:29:45 +02:00
Kai Bao
4e911f1c88 splitting generation of the numerical aquifer connections to two steps
generate all the connections specified in the deck records first, then
filter out the wrong ones using processed grid later. The refactoring is
to avoid using the Deck explicitly in opm-grid.
2021-04-20 00:35:17 +02:00
Bård Skaflestad
d7389f9b3c Merge pull request #2431 from totto82/addSwitchEvent
add event for switching from injector to producer
2021-04-16 19:04:14 +02:00
Bård Skaflestad
1c915d5c9c Merge pull request #2432 from goncalvesmachadoc/welltemp_output
Fix Well Temperature Output
2021-04-16 18:56:54 +02:00
Cintia Goncalves Machado
a9f3909f13 fixWellTempOutput 2021-04-16 16:50:12 +02:00
Tor Harald Sandve
7b8b83645b add event for switching from injector to producer 2021-04-16 13:39:33 +02:00
Joakim Hove
a48c3829d7 Merge pull request #2429 from blattms/fix-compile-g++10.2
Include stdexcept header to fix compilation with g++-10
2021-04-15 14:36:29 +02:00
Markus Blatt
b240e66503 Include stdexcept header to fix compilation with g++-10 2021-04-15 11:51:57 +02:00
Joakim Hove
b7c4bde0e9 Merge pull request #2428 from joakim-hove/optional-guiderate-model
Use std::optional<> in GuideRateConfig
2021-04-15 08:15:42 +02:00
Kai Bao
ea293b8353 make sure NNC is from low to high for numerical aquifers. 2021-04-14 21:11:10 +02:00
Kai Bao
9517d9bdae removing an unused function aquiferNNCs()
and using std::make_move_iterator following review comments.
2021-04-14 21:11:10 +02:00
Kai Bao
08539cdcd6 fixing AquiferTests 2021-04-14 21:11:10 +02:00
Kai Bao
67d56cd637 adding methond to set NNC for EclipseState
it needs to be updated after grid processing.
2021-04-14 21:11:10 +02:00
Kai Bao
36f714381d using pinched grid for numerical aquifer 2021-04-14 21:11:10 +02:00
Kai Bao
276530fcde neighborCellInsideReservoirAndActive function takes extra actnum 2021-04-14 21:11:10 +02:00
Joakim Hove
05366912fc Merge pull request #2380 from bska/output-aquifer-to-restart
Add Restart Output Facility for Analytic Aquifer Data
2021-04-14 20:59:49 +02:00
Bård Skaflestad
ef5a74392e Address Review Comments
Use SummaryState::get() with default, std::size instead of distance,
and a named constant for the aquifer model type.
2021-04-14 20:58:19 +02:00
Bård Skaflestad
d43e358d01 Activate Aquifer Restart Output
This commit hooks the aquifer restart output facility (output arrays
{I,S,X}AAQ and {I,S,A}CAQ) up to the general "RestartIO" module.  If
a simulation run uses analytic aquifers we construct an aquifer
output object at simulation start and store this in an optional<> in
the internal implementation object.  Otherwise the optional holds
nullopt.  We expand RestartIO::save() to take such an optional by
reference and aggregate/output aquifer information, directly after
the well information, if the optional holds a value.  Update callers
accordingly.
2021-04-14 20:58:19 +02:00
Bård Skaflestad
a36b8bd4bb Centralise Aquifer Dimension Handling in INTEHEAD
This commit switches the INTEHEAD factory function to passing
dimensions related to aquifers by means of the 'AquiferDims'
structure.  While here, also update description and names of a few
aquifer-related INTEHEAD items to reflect more recent understanding.
2021-04-14 20:58:19 +02:00
Bård Skaflestad
0edf6673ba Add Restart Output Facility for Analytic Aquifer Data
We support both Fetkovich and Carter-Tracy aquifers.  We presently
output trivial values only in the 'ACAQ' (per-connection, double
precision elements), but otherwise assemble reasonable values for
many items.

We leverage the fact that the aquifer connections do not change
throughout the simulation run.  The "Aggregate" API is therefore
constructed in such a way that most of the expensive operations
(e.g., mapping active cell IDs to their columnar counterparts)
happens once (in the constructor) and the per-aquifer operations are
performed for each restart output step.  We intend that one aquifer
output object be constructed at the start of the simulation run, if
needed, and that this object will live until simulation shutdown.
2021-04-14 20:58:19 +02:00
Bård Skaflestad
0aea5c1e20 Hook Aquifer Dimensions Up to 'Runspec' Constructor
Forgotten in 796318409 (PR #2338).
2021-04-14 20:58:19 +02:00
Bård Skaflestad
762e256d2b Make "WindowedArray" a Movable Type
Needed to put such objects into standard containers.
2021-04-14 20:58:19 +02:00
Bård Skaflestad
0e5a7a335b Order Aquifer Connections by Global Index
We need a stable connection order for restart purposes.
2021-04-14 20:58:19 +02:00
Bård Skaflestad
e477409373 Reduce Analytic Aquifer Compilation Overhead
In particular, switch to using forward declarations instead of
transitive includes in headers and especially of 'Deck'-related
headers.
2021-04-14 20:58:19 +02:00
Joakim Hove
39dab54321 Use std::optional<> in GuideRateConfig 2021-04-14 19:57:59 +02:00
Joakim Hove
a93c75ed2f Merge pull request #2425 from joakim-hove/optional-topup-phase
Return std::optional<Phase> for Group::topup_phase()
2021-04-14 19:56:54 +02:00
Joakim Hove
4ab4f0407f Return std::optional<Phase> for Group::topup_phase() 2021-04-14 11:28:36 +02:00
Joakim Hove
a6bdda7b27 Merge pull request #2420 from tskille/fix_erst
fixing bug for python bindings ERst
2021-04-14 10:05:59 +02:00
Bård Skaflestad
bdd0c9d351 Merge pull request #2424 from tskille/vfp_iglr
fixing ALQ Type IGLR
2021-04-13 21:01:29 +02:00
Bård Skaflestad
2afb2ddd1e Merge pull request #2421 from tskille/latest_emodel
new python bindings class EModel
2021-04-13 18:13:12 +02:00
Torbjørn Skille
5b73f17652 fixing ALQ Type IGLR 2021-04-13 11:21:27 +02:00
Torbjørn Skille
94e541ad60 new python bindings class EModel 2021-04-13 10:42:43 +02:00
Joakim Hove
7a372c2a43 Merge pull request #2423 from joakim-hove/export-volume
Store the active volume with a mutable in the grid
2021-04-13 07:14:09 +02:00
Markus Blatt
e215098122 Merge pull request #2418 from akva2/fix_lto_python
Fix some python bindings issues
2021-04-12 14:10:42 +02:00
Joakim Hove
97652c1313 Store the active volume with a mutable in the grid 2021-04-12 13:53:59 +02:00
Joakim Hove
877f82ef06 Merge pull request #2422 from joakim-hove/add-compile-guard
Add missing compile guard
2021-04-12 08:32:34 +02:00
Joakim Hove
524be4ca4f Add missing compile guard 2021-04-12 00:10:23 +02:00
Torbjørn Skille
6003736221 fixing bug for python bindings ERst
> bug related to occurence parameter in function get_erst_vector(..)
 > additional python unittest related to this function
2021-04-11 08:48:23 +02:00
Joakim Hove
71a7af3cae Merge pull request #2419 from joakim-hove/pass-affected-wells
Make sure the affected_wells variable is passed to applyWellopen()
2021-04-10 17:16:43 +02:00
Joakim Hove
8a96d9a8d1 Make sure the affected_wells variable is passed to applyWellopen() 2021-04-10 14:10:44 +02:00
Bård Skaflestad
989c3a8396 Merge pull request #2417 from joakim-hove/import-general
Refactor IMPORT handler to accept all data keywords
2021-04-09 14:49:59 +02:00
Arne Morten Kvarving
9402db2421 fix building python bindings (with lto)
need to set the define for header only library with internal libfmt,
and whatever flags are required by external libfmt
2021-04-09 11:56:25 +02:00
Arne Morten Kvarving
5d13b9ed59 fixed: built builtin_pybind11.cpp in python bindings
necessary with lto as symbols are not visible in main library
2021-04-09 11:56:25 +02:00
Joakim Hove
adc52eb870 Refactor IMPORT handler to accept all data keywords 2021-04-09 10:34:16 +02:00
Joakim Hove
88f284ecab Merge pull request #2408 from joakim-hove/rst-test-eclipsestate
Add  EclipseState comparison to rst_test application
2021-04-09 08:51:59 +02:00
Markus Blatt
9a0d26c398 Merge pull request #2386 from blattms/cmake-3.10
Stop pretending that we support CMake 2.8
2021-04-08 10:15:10 +02:00
Joakim Hove
b05da71c57 rst_test application will also compare EclipseState 2021-04-08 09:25:03 +02:00
Joakim Hove
d08d358e5d Add EclipseState::rst_cmp 2021-04-08 09:25:03 +02:00
Joakim Hove
1a1aaa724b Add comparison functions operator== and rst_cmp() to FieldProps 2021-04-08 09:25:03 +02:00
Joakim Hove
d75c704f26 Reformat #include 2021-04-08 09:15:16 +02:00
Joakim Hove
5e4e949d8d Add IOConfig::rst_cmp 2021-04-08 09:15:16 +02:00
Joakim Hove
8214f36b61 Add InitConfig::rst_cmp 2021-04-08 09:15:16 +02:00
Joakim Hove
acae9728df Add SimulationConfig::rst_cmp() 2021-04-08 09:15:16 +02:00
Joakim Hove
646e0cb60f FieldPropsmanager will have a copy of the tables 2021-04-08 09:15:16 +02:00
Joakim Hove
fe5761096d Add ThresholdPressure::rst_cmp() 2021-04-08 09:15:16 +02:00
Joakim Hove
6c71179fa1 Add UnitSystem::rst_cmp() 2021-04-08 09:15:16 +02:00
Joakim Hove
e1e1afccd4 Add Runspec::rst_cmp() 2021-04-08 09:15:16 +02:00
Arne Morten Kvarving
6058d2b4f2 Merge pull request #2415 from akva2/fix_redhat_man_pages
fix redhat packaging
2021-04-08 09:07:36 +02:00
Arne Morten Kvarving
b28eca17e8 fix redhat packaging
handle the new man pages
2021-04-08 09:06:38 +02:00
Joakim Hove
3a733bda6f Add EclipseConfig::rst_cmp() 2021-04-08 09:01:19 +02:00
Joakim Hove
10c8b96fe0 Merge pull request #2414 from bska/write-active-network-only
Output Network Arrays Only if Network is Active
2021-04-07 22:37:51 +02:00
Joakim Hove
7c9fff256c Add const to AquiferConfig::operator==() 2021-04-07 17:52:25 +02:00
Bård Skaflestad
8a72a34ba5 Output Network Arrays Only if Network is Active
This fixes a real field case in which the network is only activated
(keywords BRANPROP and NODEPROP) fairly late in the simulation run.
2021-04-07 16:46:00 +02:00
Atgeirr Flø Rasmussen
659580d749 Merge pull request #2412 from joakim-hove/ep-optional
Use std::optional and value objects instead of std::shared_ptr
2021-04-07 16:20:31 +02:00
Joakim Hove
be451c0ccd Merge pull request #2413 from bska/fix-missing-initializer
Initialise All Well Table Dimensions
2021-04-07 15:22:05 +02:00
Markus Blatt
62b202e85c Stop pretending that we support CMake 2.8
We actually already require at least CMake 2.8.12 due to the embedded
pybind11 (some tests of it are even at 3.0). Anyway as Ubuntu LTS has
3.10.2 I doubt that anything less is tested by us.
2021-04-07 13:56:03 +02:00
Bård Skaflestad
4d4a6b700d Initialise All Well Table Dimensions
Including the maximum number of well lists per well and maximum
dynamic well lists added in commit 278cd0a24 (PR #2368).
2021-04-07 13:50:28 +02:00
Joakim Hove
ce5f0757df Merge pull request #2411 from joakim-hove/jfunc-optional
Use std::optional instead of std::shared_ptr to manage JFunc
2021-04-07 13:40:44 +02:00
Joakim Hove
ec0ca7bd6d Merge pull request #2410 from blattms/fixes-debian-1
Fixes from the debian packages
2021-04-07 10:29:19 +02:00
Joakim Hove
d33e6ba8ef Remove TableManager copy constructor and operator= 2021-04-07 09:31:25 +02:00
Joakim Hove
c55f761905 Use std::optional and value objects instead of std::shared_ptr 2021-04-07 09:13:53 +02:00
Joakim Hove
0d4a514c90 Use std::optional instead of std::shared_ptr to manage JFunc 2021-04-07 08:37:12 +02:00
Markus Blatt
3fd76f9c26 Fixes include paths in pkg-config files (at least in Debian).
Previously we ended up with "-I -I/cjson" for
"/usr/include;/usr/include/cjson" in opm-common_INCLUDE_DIRS.

Gbp-Pq: Name 0008-Fixes-include-paths-in-pkg-config-files-at-least-in-.patch
2021-04-06 22:57:00 +02:00
Markus Blatt
6895ee4959 Install CMake files below share/opm with USE_SOURCE_PERMISSIONS.
Otherwise the scripts will not be executable.
Fixes lintian warning
script-not-executable usr/share/opm/cmake/Scripts/cppcheck-test.sh

Gbp-Pq: Name 0007-Install-CMake-files-below-share-opm-with-USE_SOURCE_.patch
2021-04-06 22:56:59 +02:00
Markus Blatt
3e22403cfe Make SOVERSION change with every release.
Previously the SOVERSION was the year which indicated a stable ABI
within each year. It is highly unlikely that or ABI is that
stable. Hence we stop pretending that it is and change the version
with every release.

Gbp-Pq: Name 0006-Make-SOVERSION-change-with-every-release.patch
2021-04-06 22:56:59 +02:00
Markus Blatt
b24ca0519c Added manpages for all executables.
Debian policy says that each executable should have a man page.
This should remove the lintian warning about missing man pages.
Man pages have been created by the following command:

declare -A short_desc
short_desc['compareECL']='Comparator for Eclipse files'
short_desc['convertECL']='Converter for Eclipse files (binary <-> formatted format)'
short_desc['opmhash']='Hasher for summary keywords in Eclipse files'
short_desc['opmpack']='Validator and printer of deck in Eclipse files without comments'
short_desc['summary']='Printer for summary keys in Eclipse summary files'

for key in "${!short_desc[@]}"; do
       help2man -h "-h" --version-string="2020.04" --no-discard-stderr -n "${short_desc[$key]}" $key >\
       $key.1
done

Gbp-Pq: Name 0005-Added-manpages-for-all-executables.patch
2021-04-06 22:56:59 +02:00
Markus Blatt
8e70bfb93b Fix pkg-config files with imported targets.
They had imported target names (e.g. from OpenMP) in them which did not work.
Also linking std++fs was a bit strange. Hopefully fixed now.

Gbp-Pq: Name 0003-Fix-pkg-config-files-with-imported-targets.patch
2021-04-06 22:56:59 +02:00
Arne Morten Kvarving
ef47292a85 Merge pull request #2409 from akva2/enable_embedded_python_ubuntu
enable embedded python in ubuntu packages
2021-04-06 15:36:46 +02:00
Arne Morten Kvarving
df525c930a enable embedded python in ubuntu packages 2021-04-06 15:34:11 +02:00
Joakim Hove
cfccc4c814 Merge pull request #2407 from joakim-hove/ecl-config-fix
Ecl config fix
2021-04-06 10:00:59 +02:00
Joakim Hove
975b6fd35e Include IO config in EclipseConfig::operator== 2021-04-06 08:14:52 +02:00
Joakim Hove
dcfcd8fa41 Remove deprecated function 2021-04-06 08:14:52 +02:00
Joakim Hove
67e972a1fa Merge pull request #2404 from joakim-hove/test-sched-deck
Add schedule deck member to Schedule::operator==()
2021-04-04 17:56:27 +02:00
Joakim Hove
0999637e58 Add schedule deck member to Schedule::operator==() 2021-04-04 16:08:26 +02:00
Joakim Hove
512110c258 Merge pull request #2406 from joakim-hove/optional-topup-phase
Use std::optional<Phase> instead of std::pair<Phase, bool>
2021-04-04 16:07:01 +02:00
Joakim Hove
43f62189ef Merge pull request #2405 from joakim-hove/sched-state-reorder
Reorder members in ScheduleState
2021-04-03 15:33:24 +02:00
Joakim Hove
9281ef04d2 Merge pull request #2403 from joakim-hove/mv-rst-info
Move restart information to ScheduleStatic
2021-04-03 15:32:38 +02:00
Joakim Hove
9dc7e6fa11 Merge pull request #2402 from joakim-hove/welldims-data-equal
Add Welldims comparison ignoring location member
2021-04-03 11:48:50 +02:00
Joakim Hove
9a58358d9f Use std::optional<Phase> instead of std::pair<Phase, bool> 2021-04-03 11:33:33 +02:00
Joakim Hove
4b6e0e1a3f Reorder members in ScheduleState 2021-04-03 11:13:57 +02:00
Joakim Hove
6e10badb1b Move restart information to ScheduleStatic 2021-04-03 08:40:06 +02:00
Joakim Hove
f2a8f6d6e6 Add Welldims comparison ignoring location member 2021-04-03 08:08:29 +02:00
Joakim Hove
58d900bd4b Merge pull request #2400 from bska/remove-aquct-cellid
Remove Cell ID Member from CT Aquifer Representation
2021-04-02 09:58:26 +02:00
Bård Skaflestad
c94eb84efe Remove Cell ID Member from CT Aquifer Representation
The data member 'cell_id' isn't actually used anywhere outside of
object serialization.  Just remove it.
2021-04-01 14:16:50 +02:00
Joakim Hove
4014eb385c Merge pull request #2390 from joakim-hove/import-container
Import container
2021-03-31 11:55:39 +02:00
Joakim Hove
f754ddebce Merge pull request #2399 from joakim-hove/gconinje-rename
Rename GCONINJE item and use compiled constants
2021-03-31 09:51:44 +02:00
Joakim Hove
a051a3f736 Merge pull request #2398 from joakim-hove/plysher-json
Fix JSON scheme for PLYSHEAR table
2021-03-31 09:51:29 +02:00
Joakim Hove
20231af0db Rename GCONINJE item and use compiled constants 2021-03-31 09:23:10 +02:00
Joakim Hove
4b0996585d Fix JSON scheme for PLYSHEAR table 2021-03-31 08:16:17 +02:00
Joakim Hove
5edaf996d7 Merge pull request #2393 from joakim-hove/rst-bits
Add named constant IGroup::ExceedAction = 7
2021-03-30 22:11:21 +02:00
Joakim Hove
e6e041ca5e Remove unused argument 2021-03-30 21:24:03 +02:00
Joakim Hove
c3e0575042 Slight refactor of Schedule::addGroup() 2021-03-30 21:24:03 +02:00
Joakim Hove
30659aaf5a Remove group active control and rename gconprod_cmode -> prod_cmode 2021-03-30 21:24:03 +02:00
Joakim Hove
93b07c0519 Add named constant IGroup::ExceedAction = 7 2021-03-30 21:15:22 +02:00
Joakim Hove
b88a302f49 Merge pull request #2396 from joakim-hove/rm-defaults
Remove dummy default values for GCONPROD
2021-03-30 20:23:16 +02:00
Joakim Hove
3c33261ace Remove dummy default values for GCONPROD 2021-03-30 18:35:45 +02:00
Joakim Hove
febfa9a47a Integrate ImportContainer into the parser inner loop 2021-03-30 11:50:34 +02:00
Joakim Hove
6e888b9c87 Add class ImportContainer to load keywords from IMPORT file 2021-03-30 11:50:34 +02:00
Joakim Hove
02b02189de Allow EclFile constructor to get formatted as input argument 2021-03-30 11:37:32 +02:00
Joakim Hove
19addd0fc6 DeckKeyword constructor does not mutate UnitSystem 2021-03-30 11:37:32 +02:00
Joakim Hove
0f59fe900b Merge pull request #2392 from joakim-hove/schedule-prt
Make sure a confusing last report step message is not written out
2021-03-29 15:27:36 +02:00
Joakim Hove
eb2fb4c233 Make sure a confusing last report step message is not written out 2021-03-29 12:27:25 +02:00
Joakim Hove
c7200aa1af Merge pull request #2347 from joakim-hove/ched-state-rst-config2
Internalize restart configuration in new schedule structure
2021-03-27 11:39:23 +01:00
Joakim Hove
e9890a1e13 Fix warning - unused variable 2021-03-27 07:51:41 +01:00
Joakim Hove
0eb1b95fc3 Handle commandline argument --output-interval 2021-03-27 07:51:41 +01:00
Joakim Hove
d14cd52a5e Remove stale functionality RestartConfig / DynamicState 2021-03-27 07:51:41 +01:00
Joakim Hove
546523e229 Add new class RSTConfig for configuration of restart. 2021-03-27 07:51:41 +01:00
Joakim Hove
d25962ba80 Merge pull request #2378 from bska/configure-requisite-aquifer-summary-output
Configure Aquifer Summary Output Needed for Restart
2021-03-26 16:02:41 +01:00
Bård Skaflestad
621f0a443a Configure Aquifer Summary Output Needed for Restart
The summary vectors

    AAQP (pressure), AAQR (rate), AAQT (volume)

must be available for output to the restart file's "XAAQ" array for
all analytic aquifers.  Additionally, the summary vectors

    AAQTD (dimensionless time), AAQPD (dimensionless pressure)

must be available for restart output to "XAAQ" in the case of
Carter-Tracy aquifers.

This commit ensures that those values are always calculated and
stored in the SummaryState.
2021-03-26 15:24:23 +01:00
Bård Skaflestad
0f7d44ea13 Use Same Evaluation Factory for All Vectors
In particular, switch to using the Evaluator::Factory object for the
"required" restart vectors too.  This is in preparation of including
aquifer-related summary vectors into the set of required restart
vectors.
2021-03-26 15:24:23 +01:00
Bård Skaflestad
d0855bd995 Harmonise Required Segment Vector Implementation
Use pattern from the well, group, and field-level implementation.
While here, also switch to passing a default-constructed optional
instead of an empty string for the "fip_region".
2021-03-26 15:24:23 +01:00
Atgeirr Flø Rasmussen
9a9efa50f3 Merge pull request #2388 from joakim-hove/update-license
Update license header to GPL V3
2021-03-26 14:52:40 +01:00
Joakim Hove
eeddd663a5 Uddate license header to GPL V3 2021-03-26 12:42:30 +01:00
Joakim Hove
12dd9d321b Merge pull request #2384 from joakim-hove/actionx-affected-wells
Schedule::applyAction() will return a set of wells affected
2021-03-25 17:03:49 +01:00
Joakim Hove
9bfdf709b7 Schedule::applyAction() will return a set of wells affected 2021-03-25 12:00:08 +01:00
Joakim Hove
da8df340b2 Merge pull request #2383 from joakim-hove/remove-first-rst-step
Remove unused function first_rst_step()
2021-03-25 10:53:10 +01:00
Bård Skaflestad
19183bdd6c Merge pull request #2379 from joakim-hove/aquifer-grid-order
Aquifer grid order
2021-03-25 09:41:29 +01:00
Bård Skaflestad
704b3edfe7 Merge pull request #2373 from joakim-hove/aggregate-conn-data
Aggregate conn data
2021-03-25 09:31:56 +01:00
Joakim Hove
cfc552f39c Remove unused function first_rst_step() 2021-03-25 08:28:30 +01:00
Joakim Hove
2247b45872 Use SummaryState for connection rates in restart output 2021-03-25 07:21:31 +01:00
Joakim Hove
b6e739cd7e Register connection variables as required for restart 2021-03-25 07:21:31 +01:00
Joakim Hove
39e5ca32c0 Add summary evaluation support for CPR 2021-03-25 07:21:31 +01:00
Joakim Hove
ee86cf0196 Register summary evaluator for COIR 2021-03-25 07:21:31 +01:00
Joakim Hove
04242353c7 Use {} for optional string instead of "" 2021-03-25 07:21:31 +01:00
Joakim Hove
14fe6a5700 Merge pull request #2382 from joakim-hove/move-rst-tests
Move restart tests and use Schedule::write_rst_file()
2021-03-25 07:18:08 +01:00
Joakim Hove
f31a080fb6 Merge pull request #2374 from bska/aquct-dimless-time-and-press-smry
Support CT-Aquifer Dimensionless P/T Summary Vectors
2021-03-25 07:17:23 +01:00
Joakim Hove
6eddc4c088 Move restart tests and use Schedule::write_rst_file() 2021-03-24 18:15:47 +01:00
Joakim Hove
7c1b5b8b21 Add warning about aquifers connected to inactive cells 2021-03-24 13:08:27 +01:00
Joakim Hove
e8d4d99e6b Interleave ACTNUM modifications and Aquifer configuration 2021-03-24 13:08:27 +01:00
Bård Skaflestad
70457e1433 Support CT-Aquifer Dimensionless P/T Summary Vectors
This commit adds support for calculating and outputting the
CT-specific summary vectors "AAQTD" (dimensionless time, real time
divided by aquifer's time constant) and "AAQPD" (dimensionless
pressure-influence function evaluated at dimensionless time).
2021-03-24 11:43:25 +01:00
Joakim Hove
602dc07181 Merge pull request #2381 from joakim-hove/simplify-rst-test
Simplify test fixture
2021-03-24 10:27:57 +01:00
Markus Blatt
b7dc593092 Merge pull request #2359 from blattms/support-system-pybind
Support system pybind
2021-03-24 10:09:37 +01:00
Joakim Hove
e2ef6bc662 Simplify test fixture 2021-03-24 09:40:04 +01:00
Bård Skaflestad
37aee167eb Merge pull request #2377 from joakim-hove/rst-test-fix
Fix test assert and temporarily disable
2021-03-23 15:51:06 +01:00
Joakim Hove
a62d73a424 Merge pull request #2376 from joakim-hove/rst-test-fixtures
Update test fixtures
2021-03-23 13:02:48 +01:00
Joakim Hove
227a07ed06 Fix test assert and temporarily disable 2021-03-23 11:40:32 +01:00
Joakim Hove
8258d65900 Update test fixtures 2021-03-23 09:33:06 +01:00
Joakim Hove
6609ca265c Merge pull request #2372 from joakim-hove/summary-state-connections
Add special treatment of connection variables in SummaryState
2021-03-23 07:22:45 +01:00
Joakim Hove
5f91bfa7d0 Merge pull request #2375 from GitPaean/aquifer_cell_volumes
function to ouput the cell volume for numerical aquifer cells
2021-03-22 22:33:30 +01:00
Kai Bao
2a67eb44ed function to ouput the cell volume for numerical aquifer cells 2021-03-22 15:18:47 +01:00
Joakim Hove
596c3a9db3 Merge pull request #2370 from joakim-hove/actionx-prt-prefix
Add prefix the schedule messages to highlight ACTIONX rerun
2021-03-22 10:54:27 +01:00
Joakim Hove
12c63f7346 Use Summarystate::update_conn_var from Summary 2021-03-21 15:21:41 +01:00
Joakim Hove
5b3787ec46 Add special treatment of connection variables in SummaryState 2021-03-21 15:20:45 +01:00
Joakim Hove
d2cb2eeec4 Add prefix the schedule messages to highlight ACTIONX rerun 2021-03-19 22:30:37 +01:00
Bård Skaflestad
77f058645f Merge pull request #2368 from jalvestad/intehead_corrections
Corrections to InteHead to account for ROCKOPTS data and Well lists
2021-03-19 21:14:53 +01:00
Markus Blatt
1c311150a5 Prevent newline in PYTHON_INCLUDE_DIR.
It breaks the docker pypi build.
2021-03-19 20:18:58 +01:00
Markus Blatt
f8c6fabb2d Use system's pybind11 if available. 2021-03-19 20:18:58 +01:00
Jostein Alvestad
278cd0a240 eliminated WellDims and used WellTableDims instead 2021-03-19 13:59:40 +01:00
Jostein Alvestad
d0f177d94c corrections to inteHead - rockopts, well lists 2021-03-19 13:59:39 +01:00
Joakim Hove
70a658c91d Merge pull request #2367 from joakim-hove/well-cmode
Add shortcuts to get injectorcontrols from Well
2021-03-19 12:48:42 +01:00
Tor Harald Sandve
61ad81b701 Merge pull request #2315 from bska/record-dynamic-status
Record Dynamic Well Status in Output Wells
2021-03-19 09:07:38 +01:00
Joakim Hove
f345d37dd1 Add shortcuts to get injectorcontrols from Well 2021-03-18 19:30:09 +01:00
Bård Skaflestad
89e3efb2e4 Record Dynamic Well Status in Output Wells
This commit adds a new data member

    Well::Status dynamicStatus

to the data::Well object.  This member records the simulator's
notion of a well's open/shut/stop status and is especially needed to
support WECON-type status changes once the simulator maintains both
open and shut wells.

While here, also change multiple summary primitives to not look up
the same values repeatedly.
2021-03-18 17:26:33 +01:00
Joakim Hove
27b4110314 Merge pull request #2355 from totto82/guideRateInj
Add guiderate for injection groups
2021-03-18 17:04:34 +01:00
Markus Blatt
77050e5042 Moved settings of CMake_STANDARD stuff to OPMInit.cmake
That makes it usable from *prereqs and helps preventing
multiple -std=c++xx options when compiling (at least for
pybind11)
2021-03-18 15:06:00 +01:00
Markus Blatt
55bdaaa9f9 Do not set unnecessary COMPILE_DEFINTIONS.
The ones set for DUNE are for very old unsupported versions.
2021-03-18 15:06:00 +01:00
Markus Blatt
18ccbcfa03 Merge pull request #2362 from blattms/use-add-compile-definitions
Use add_compile_definitions to add defintions
2021-03-18 15:04:34 +01:00
Joakim Hove
b206a7542e Merge pull request #2365 from bska/ancon-accum-effective-face-area
Accumulate Effective Aquifer Connection Face Area
2021-03-18 11:00:34 +01:00
Bård Skaflestad
3c6c827a75 Accumulate Effective Aquifer Connection Face Area
We need this information to form part of the per-connection restart
output to the "SCAQ" array.  The accumulation uses the same
procedure as for the total influx coefficient, but is always based
on the geometric face area instead of the tabulated aquifer influx
coefficient.
2021-03-17 21:04:30 +01:00
Markus Blatt
05128745cf Some modules may still export definitions using -D, strip it. 2021-03-17 17:27:26 +01:00
Markus Blatt
213f0c0afa Only add -D for older CMake versions. 2021-03-17 16:57:00 +01:00
Joakim Hove
a3984dbcb6 Merge pull request #2364 from blattms/remove-boost-python-include
Removes inclusion of boost-python header
2021-03-17 16:55:10 +01:00
Markus Blatt
6cf4250f18 Removes inclusion of boost-python header 2021-03-17 16:02:41 +01:00
Markus Blatt
6d9a924930 Add -D qualifier to DEFINITIONS if missing for old CMake. 2021-03-17 15:36:24 +01:00
Joakim Hove
fe99038df6 Merge pull request #2363 from joakim-hove/action-wells-specified
Make sure action results contain well for fully specified condition
2021-03-17 13:44:09 +01:00
Markus Blatt
a4f73a3a7c Use add_compile_definitions for newer CMake versions.
add_definitions is deprecated.
Note the new command does not need the -D qualifier but will detect
if there is one and act accordingly. This helps with package
configuration files that have "-DVAR" in their COMPILE_DEFINTIONS

As some packages actually already add the -D qualifier we now detect
that to be able to support old CMake version without
add_compile_definitions. In this case we prevent adding another -D
and use add_definitions.
2021-03-17 11:16:13 +01:00
Joakim Hove
d02ae5e650 Make sure action results contain well for fully specified condition 2021-03-17 10:08:35 +01:00
Markus Blatt
66ed9bcf75 Merge pull request #2360 from blattms/fix-docker-pypi
Determine Python include directory to fix docker pypi builds
2021-03-16 22:05:00 +01:00
Markus Blatt
ee11a57b6c Honor PYTHON_EXECUTABLE even if we use Python3. 2021-03-16 20:32:50 +01:00
Markus Blatt
9bc0536d13 Do not use the imported Python3 library directly.
It just a hassle (need to search for Python3 downstream,
cannot be backwards compatible).
2021-03-16 20:32:50 +01:00
Markus Blatt
1ed6166f1f Determine Python include directory to fix docker pypi builds
Whenever OPM_ENABLE_PYTHON is on we need to set PYTHON_INCLUDE_DIRS
as it is needed to find Python.h (shouldn't we even need to link the
library?).

This could (in theory) be done by using by issuing
find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
or
find_package(PythonLibs REQUIRED).

Unfortunately, both do not work (for yet unknown reasons) when we
build pypi packages in docker (even with setting the PYTHON_EXECUTABLE
or Python3_EXECUTABLE correctly).

Hence we now use python manually to determine these.
2021-03-16 20:32:36 +01:00
Tor Harald Sandve
5f30a969f0 clean-up the interface of the guiderates 2021-03-16 15:53:35 +01:00
Joakim Hove
39a8233238 Merge pull request #2358 from joakim-hove/test-remove-special
Remove special mnemomics from testing
2021-03-16 14:01:03 +01:00
Joakim Hove
17639d821d Remove special mnemomics from testing 2021-03-15 22:33:16 +01:00
Joakim Hove
b189cc907f Merge pull request #2356 from atgeirr/minor-fixes
Minor fixes
2021-03-15 22:31:54 +01:00
Joakim Hove
eb652ac232 Merge pull request #2353 from joakim-hove/remove-unneeded-cmake-include
Remove cmake include of pybind11 CMakeLists.txt
2021-03-15 16:41:24 +01:00
Atgeirr Flø Rasmussen
675cb40dd4 Silence a few warnings. 2021-03-15 14:19:15 +01:00
Joakim Hove
ae7edda588 Merge pull request #2351 from joakim-hove/remove-find-cwrap
Removed cmake module FindCwrap
2021-03-15 13:39:52 +01:00
Markus Blatt
b7ce9c0fe2 Merge pull request #2348 from blattms/external-fmtlib-2
Enable usage of fmtlib on the system.
2021-03-15 13:26:23 +01:00
Atgeirr Flø Rasmussen
6518e5d905 Add missing <string> include. 2021-03-15 12:57:57 +01:00
Tor Harald Sandve
8941cc7c02 Add guiderate for injection groups 2021-03-15 12:29:20 +01:00
Joakim Hove
2a2ce8c826 Merge pull request #2354 from blattms/python-libs-only-for-embedded
Only search for Python libs if OPM_ENABLE_EMBEDDED_PYTHON is ON.
2021-03-15 12:28:04 +01:00
Markus Blatt
0455c48d2f Only search for Python libs if OPM_ENABLE_EMBEDDED_PYTHON is ON.
Apparently it is not needed in the other cases.
Fixes an issue that arose from #2344 and restores the old behaviour
concerning the libraries.
2021-03-15 10:19:10 +01:00
Joakim Hove
52caefae34 Remove cmake include of pybind11 CMakeLists.txt 2021-03-15 09:27:19 +01:00
Joakim Hove
0ae020cb8b Removed cmake module FindCwrap 2021-03-13 16:22:16 +01:00
Joakim Hove
8d11fc5458 Merge pull request #2344 from blattms/search-for-python3
Explictly search for python3 (CMake >= 3.12.0) and send error if only python2 is found
2021-03-13 16:20:04 +01:00
Markus Blatt
af3c825588 Make sure any python search finds Python3.
FindCWrap issues another find_package(PythonInterpret).
By setting the PYTHON_EXECUTABLE variable we make sure it
will find python3

This also fixes the CMake confusions about multiple linker paths

```
Make Warning at cmake/Modules/OpmSatellites.cmake:320 (add_executable):
  Cannot generate a safe linker search path for target test_ERft because
  files in some directories may conflict with libraries in implicit
  directories:

    link library [libpython3.7m.so] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/lib/python3.7/config-3.7m-x86_64-linux-gnu

  Some of these libraries may not be found correctly.
```
2021-03-12 16:48:26 +01:00
Markus Blatt
9a25b78b98 Cater for missing FindPython3 in CMake version < 3.12.0
For these we need to use the old approach. At least we
now produce an error if only python2 is found.

Needed e.g. for Ubuntu LTS 18.04.
2021-03-12 16:47:27 +01:00
Markus Blatt
504aed72eb Enable usage of fmtlib on the system.
If fmtlib is present on the system we used that one
in the normal mode (not header only). Otherwise we
fallback to the embedded one header only.
2021-03-12 14:47:15 +01:00
Markus Blatt
f8ab960d97 Merge pull request #2346 from blattms/recover-external-cjson-support
Recover external cjson library support.
2021-03-12 14:42:44 +01:00
Kai Bao
df0fdb7169 Merge pull request #2349 from GitPaean/using_map_for_numerical_aquifers
using std::map for m_aquifers of NumericalAquifers
2021-03-12 13:14:51 +01:00
Kai Bao
e56865cafe using std::map for m_aquifers of NumericalAquifers
to make sure the same order when traversing the m_aquifers during
parallel running.
2021-03-12 10:01:22 +01:00
Markus Blatt
2e0bc4f17a Recover external cjson library support.
This was somehow deactivated when merging opm-parser to opm-common.
2021-03-11 16:21:46 +01:00
Joakim Hove
654a78a541 Merge pull request #2339 from joakim-hove/sched-state-sim-step
Sched state sim step
2021-03-11 15:23:02 +01:00
Markus Blatt
c98f74c206 Make imported Python3 targets available downstream 2021-03-11 12:50:48 +01:00
Markus Blatt
974f7da6a1 Use python3 for setup scripts, too 2021-03-11 11:50:27 +01:00
Joakim Hove
fda9601ecc Merge pull request #2345 from GitPaean/adding_missing_init_pressure
adding init_pressure in the serilization of NumericalAquiferCell
2021-03-11 08:43:49 +01:00
Kai Bao
16fd8997fa adding init_pressure in the serilization of NumericalAquiferCell
it was missing.
2021-03-10 23:40:46 +01:00
Bård Skaflestad
2782bff479 Merge pull request #2342 from joakim-hove/gen-source-dep-fixup
Gen source dep fixup

Fixes #2340.
2021-03-10 21:47:03 +01:00
Joakim Hove
56d3d1a7d3 Merge pull request #2335 from totto82/addInjectionTypeChangedEvent
Add event for injection type changed
2021-03-10 15:58:59 +01:00
Markus Blatt
164f451124 Explictly search for python3 and use that instead PythonInterpret et al.
Otherwise python2 might be found, but OPM needs python3.
2021-03-10 15:57:01 +01:00
Joakim Hove
122f15006c Check OPM_ENABLE_PYTHON and OPM_ENABLE_EMBEDDED_PYTHON 2021-03-10 15:44:45 +01:00
Joakim Hove
d6aa829197 Avoid spurious dependencies if Python is not enabled 2021-03-10 15:44:43 +01:00
Joakim Hove
f8fb46ed84 Source generator should only optionally generate Python binding code 2021-03-10 15:44:18 +01:00
Joakim Hove
0a5301d949 Merge pull request #2319 from jalvestad/rst_wsegaicd
Changes to output Restart data for the WSEGAICD keyword (Eclipse compatible restart file)
2021-03-10 14:59:49 +01:00
Joakim Hove
55fd38d5c9 Merge pull request #2341 from joakim-hove/remove-rst-keyword
Remove unneccesary function RestartConfig::getKeyword()
2021-03-10 14:49:31 +01:00
Joakim Hove
90839c0e16 Remove unneccesary function RestartConfig::getKeyword() 2021-03-10 13:23:16 +01:00
Joakim Hove
bfb1b7d7e5 Merge pull request #2337 from joakim-hove/gconinje-guiderate
Gconinje guiderate
2021-03-10 13:17:32 +01:00
Joakim Hove
2487feb815 Merge pull request #2331 from bska/enumerate-active-by-columns
Add Special Purpose Active Cell Enumeration by Columns
2021-03-10 13:17:10 +01:00
Joakim Hove
e2521495f2 Internalize guide rate when loading GCONINJE keyword 2021-03-10 09:54:50 +01:00
Joakim Hove
6e7d9102c7 Rename enum Group::GuideRateTarget -> Group::GuideRateProdTarget 2021-03-10 09:54:50 +01:00
Joakim Hove
218349a453 Rename GCONINJE guiderate items 2021-03-10 09:54:50 +01:00
Bård Skaflestad
6d18b3b7e6 ActiveIndexByColumn: Remove 'build' Method
Do construction work in constructor instead.

Suggested by: [at]joakim-hove
2021-03-10 09:54:14 +01:00
Joakim Hove
d673f2e555 Add member first_in_month and first_in_year to ScheduleState 2021-03-10 09:49:13 +01:00
Joakim Hove
b151c85f6c Add month_num and year_num members to ScheduleState 2021-03-10 09:26:02 +01:00
Bård Skaflestad
b6b81462d2 Use Sorting to Infer Columnar Active Cell ID
This reduces the space overhead of the build stage from "number of
Cartesian cells" to "number of active cells", at the cost of some
increased processing time (sorting vs. linear traversals).
2021-03-10 09:23:23 +01:00
Bård Skaflestad
d2028e4851 Add Special Purpose Active Cell Enumeration by Columns
The protocol for outputting an aquifer's active cell IDs to the
restart file requires that the cells be enumerated according to
their column.  In particular, the aquifer's notion of a model's
active cells correspond to a cell ordering of the form

    for (i = 0; i < Nx; ++i)
        for (j = 0; j < Ny; ++j)
            for (k = 0; k < Nz; ++k)
                use(X(i, j, k))

instead of the common ordering, sometimes referred to as "natural
ordering"

    for (k = 0; k < Nz; ++k)
        for (j = 0; j < Ny; ++j)
            for (i = 0; i < Nx; ++i)
                use(X(i, j, k))

which is employed elsewhere.

This commit adds a special purpose mapping facility which will
translate active cell IDs from natural ordering to the columnar
enumeration.  The facility is intentionally bare-bones because we
do not expect to use it outside of the restart writing code, and
only in a limited fashion within that context.  We will however
consider adding more features if the need arises.
2021-03-10 09:23:23 +01:00
Tor Harald Sandve
456e94d524 Add event for injection type changed 2021-03-10 08:40:03 +01:00
Jostein Alvestad
97fa62e560 correction for maxAbsoluteRate 2021-03-10 08:38:08 +01:00
Joakim Hove
34ddba52d7 Add member sim_step to ScheduleState 2021-03-10 08:08:43 +01:00
Joakim Hove
69c198271f Merge pull request #2327 from joakim-hove/summary-invalid-fipnum
Summary invalid fipnum
2021-03-10 07:32:43 +01:00
Joakim Hove
c4b8598b92 Merge pull request #2338 from bska/internalise-aqudims
Partially Internalise AQUDIMS in Runspec
2021-03-10 07:27:45 +01:00
Bård Skaflestad
796318409d Partially Internalise AQUDIMS in Runspec
This commit internalises the items NANAQU (5) and NCAMAX (6) of the
AQUDIMS keyword into a new structure

    AquiferDimensions

hooked up to the 'Runspec' class.  This is in preparation of adding
restart output for analytic aquifers (Carter-Tracy and Fetkovich).
2021-03-09 22:29:00 +01:00
Joakim Hove
e3b54278a0 Merge pull request #2336 from bska/tidy-aquancon-repr
Don't Needlessly Copy AQUANCON Objects
2021-03-09 20:12:13 +01:00
Joakim Hove
b197ac7a3f Merge pull request #2317 from joakim-hove/parserkeywords-container
Add container of builtin keywords
2021-03-09 20:11:33 +01:00
Bård Skaflestad
cab51ed57e Merge pull request #2334 from joakim-hove/restart-config-testing
Use schedule object in testing of restart configuration
2021-03-09 18:04:47 +01:00
Bård Skaflestad
0c2a435b94 Don't Needlessly Copy AQUANCON Objects
Return the operator[]() data by reference-to-const instead of as a
freshly created vector object.

While here, also (slightly) reduce the compilation overhead of this
module (and its users) by forward declaring interface types and
moving the actual include statements to the .CPP file.
2021-03-09 16:19:05 +01:00
Jostein Alvestad
f84c42104a further improvements to the code - segmentType 2021-03-09 15:50:04 +01:00
Jostein Alvestad
01fa2af160 corrections and comments to code to explaing logic 2021-03-09 15:50:02 +01:00
Jostein Alvestad
941de32084 changes to boost test values due to changes in the test-dataset 2021-03-09 15:50:00 +01:00
Jostein Alvestad
e96778c440 changes in test-dataset and initial adaptions to the new data set, plus corrections for ScalingFactor 2021-03-09 15:49:58 +01:00
Jostein Alvestad
8a5a159450 Added changes to output restart data to support WSEGAICD input 2021-03-09 15:49:55 +01:00
Joakim Hove
84d5dbde0e Make the Builtin class available from Python 2021-03-09 12:22:39 +01:00
Joakim Hove
f584901da4 Add class Builtin with all the compiled keywords 2021-03-09 12:22:39 +01:00
Joakim Hove
0d07a250d8 Use schedule object in testing of restart configuration 2021-03-09 12:19:46 +01:00
Bård Skaflestad
dd7d8748e0 Merge pull request #2333 from joakim-hove/restart-config-testing
Use multiline string literals
2021-03-09 09:12:26 +01:00
Joakim Hove
2dbf7ff281 Use multiline string literals 2021-03-09 08:25:36 +01:00
Joakim Hove
1ecf10a6ab Merge pull request #2332 from joakim-hove/schedule-output-interval
Add optional argument to override output interval - EBOS paramstyle
2021-03-09 07:26:02 +01:00
Joakim Hove
298e565862 Merge pull request #2329 from tskille/esmry_fixes
Improved robustness for locating multiple result files
2021-03-08 22:10:23 +01:00
Torbjørn Skille
8f123f3519 Improved robustness for locating multiple result files 2021-03-08 19:36:12 +01:00
Joakim Hove
66b6b35925 Merge pull request #2330 from bska/accept-temporary-cartdims
Accept Temporary 'Dimension' Arguments in EclipseGrid Constructor
2021-03-08 19:31:25 +01:00
Joakim Hove
9369690615 Add overide output interval argument to RestartConfig 2021-03-08 18:16:42 +01:00
Joakim Hove
9d18afb45e Add optional argument to override output interval - EBOS paramstyle 2021-03-08 17:43:04 +01:00
Bård Skaflestad
050e2c6c9e Accept Temporary 'Dimension' Arguments in EclipseGrid Constructor
There's no need to require that the client creates an actual,
mutable array object on the stack (or elsewhere) in order to form an
EclipseGrid instance.

This is nevertheless mostly to make it easier to use the COORD/ZCORN
constructor usable in unit tests.
2021-03-08 16:52:34 +01:00
Joakim Hove
18dca82a8b Handle empty regions in summary region results 2021-03-08 16:29:56 +01:00
Joakim Hove
47f292bd93 Handle undefined fipnum definition in summary keywords like RPR__ABC 2021-03-08 12:30:41 +01:00
Joakim Hove
8a901f2700 Merge pull request #2326 from joakim-hove/summary-add-fp
Add fieldprops argument to SummaryConfig constructor
2021-03-08 12:25:13 +01:00
Joakim Hove
9c0b375e60 Merge pull request #2325 from OPM/restart-config-private
Hide RestartConfig as private member of Schedule class
2021-03-08 12:24:27 +01:00
Joakim Hove
48b366b1f9 Add fieldprops argument to SummaryConfig constructor 2021-03-08 08:23:01 +01:00
Joakim Hove
b5183b1d76 Hide RestartConfig as private member of Schedule class 2021-03-07 11:27:09 +01:00
Joakim Hove
091c7b21cd Merge pull request #2323 from joakim-hove/remove-timemap
Remove timemap
2021-03-06 13:36:03 +01:00
Joakim Hove
c01a880388 Remove functionality from DynamicState 2021-03-06 07:49:02 +01:00
Joakim Hove
6fb0aa21ec Remove unused includes 2021-03-06 07:49:02 +01:00
Joakim Hove
fc28ff36f1 Reduce TimeMap usage 2021-03-06 07:49:02 +01:00
Joakim Hove
76231044e3 Merge pull request #2324 from joakim-hove/remove-function
Remove function RestartConfig::getRestartFileName()
2021-03-05 17:40:28 +01:00
Joakim Hove
993c6c1725 Remove unused function RestartConfig::getRestartFileName() 2021-03-05 15:45:17 +01:00
Joakim Hove
a713783b48 Merge pull request #2320 from joakim-hove/vfp-uda
Handle UDA values for ALQ in WCONPROD / WCONHIST
2021-03-05 12:29:19 +01:00
Joakim Hove
910c37c4e1 Merge pull request #2321 from joakim-hove/icd-maxrate-optional
Use std::optional<double> for ICD maximum flow rate
2021-03-05 12:28:49 +01:00
Joakim Hove
4d6ee36708 Merge pull request #2322 from joakim-hove/region-input-error
Region input error
2021-03-05 11:12:39 +01:00
Joakim Hove
586d15653b SummaryConfig: allow region numbers beyond NUMFIP 2021-03-05 08:39:37 +01:00
Joakim Hove
b1877c79e0 Remove extra "," in format message 2021-03-05 07:21:09 +01:00
Joakim Hove
b38d5166ce Use std::optional<double> for ICD maximum flow rate and scaling 2021-03-04 19:28:48 +01:00
Joakim Hove
3205423fc5 Accept UDA input for ALQ in WCONPROD / WCONHIST 2021-03-04 14:01:28 +01:00
Bård Skaflestad
ab5ad88fef Merge pull request #2310 from joakim-hove/restart-config-make-time-map
Restart config make time map
2021-03-03 18:06:43 +01:00
Joakim Hove
7b896359f6 Part 2: Use Opm::time_point 2021-03-03 15:13:34 +01:00
Joakim Hove
5698883040 Part 1: Add typedef Opm::time_point and from_time_t() + to_time_t() 2021-03-03 15:13:34 +01:00
Joakim Hove
2c0b2281da namespace TimeService with functions advance and makeUTCTime 2021-03-03 15:09:29 +01:00
Joakim Hove
09dcacf16d Use ScheduleDeck::size() instead of this->size() while assembling 2021-03-03 15:09:29 +01:00
Joakim Hove
37e29266ea Remove timemap member from Schedule class 2021-03-03 15:09:29 +01:00
Joakim Hove
dbd57cc326 Schedule class will store restart info 2021-03-03 15:09:29 +01:00
Joakim Hove
c7da5b11cf Hide TimeMap member in RestartConfig 2021-03-03 15:09:29 +01:00
Joakim Hove
80c5a6979b Merge pull request #2313 from totto82/drsdt_dyn
Add DRSDTCON to allow for convective DRSDT
2021-03-03 12:47:55 +01:00
Joakim Hove
d5639ffeb8 Merge pull request #2316 from joakim-hove/python-ignore-keyword
Expose ParseContext::ignore_keyword() in Python
2021-03-03 10:48:01 +01:00
Tor Harald Sandve
ee52a05106 use compile constants instead of strings 2021-03-02 14:30:27 +01:00
Joakim Hove
0c74e9ac7a Expose ParseContext::ignore_keyword() in Python 2021-03-02 10:24:18 +01:00
Joakim Hove
6d04924966 Merge pull request #2314 from verveerpj/missing_features
Add error keys to support the new keyword validation in opm-simulators
2021-02-28 20:59:18 +01:00
Peter Verveer
537d6938e6 Add error keys to support the new keyword validation in opm-simulators 2021-02-26 17:27:37 +01:00
Joakim Hove
778767d205 Merge pull request #2309 from joakim-hove/schedule-testing
Remove enforced inline schedule testing
2021-02-25 22:48:06 +01:00
Bård Skaflestad
50dec6bd58 Merge pull request #2296 from alfbr/fix-message
Do not print debug message to LOG/PRT file
2021-02-24 23:47:43 +01:00
Alf Birger Rustad
f48c7b79a3 Fix typo 2021-02-24 22:22:48 +01:00
Alf Birger Rustad
e6fc1b522f Send message to DBG-file 2021-02-24 22:08:13 +01:00
Tor Harald Sandve
9b5ad9cfe8 Add DRSDTCON to allow for convective DRSDT 2021-02-23 12:45:03 +01:00
Bård Skaflestad
3db2e964dd Merge pull request #2311 from GitPaean/wip_aquifer_init
writing aquifer cell and connection information to INIT file
2021-02-22 01:00:44 +01:00
Kai Bao
43b609801d addressing the review comments for PR OPM/opm-common#2311 2021-02-21 23:15:47 +01:00
Joakim Hove
715bebdb89 Merge pull request #2312 from bska/call-firstrft-once
Call Schedule::first_RFT() Once Only
2021-02-20 16:02:16 +01:00
Kai Bao
a38b35d0a0 small refactoring of function writeAquifers in WriteInit
splitting the function to be two for better readability.
2021-02-19 22:51:00 +01:00
Kai Bao
088459f74c removing two unused header files in WriteInit.cpp 2021-02-19 22:25:25 +01:00
Kai Bao
dc2cf4053a writing aquifer connection to INIT file 2021-02-19 22:25:15 +01:00
Bård Skaflestad
bcf40ea5bd Call Schedule::first_RFT() Once Only
This member function is no longer constant time so it makes sense to
limit the number of calls.
2021-02-19 17:41:24 +01:00
Bård Skaflestad
a1ee2f3b07 Merge pull request #2308 from joakim-hove/rft-fixup
Fix check for access to first_RFT()
2021-02-19 12:56:36 +01:00
Joakim Hove
7894de8030 Remove enforced inline schedule testing 2021-02-19 11:51:26 +01:00
Joakim Hove
aadfe009c3 Fix check for access to first_RFT() 2021-02-19 11:34:12 +01:00
Joakim Hove
928ba9f702 Merge pull request #2304 from joakim-hove/rft-sched-state
Use SchedState to handle RFT configuration
2021-02-19 10:35:21 +01:00
Joakim Hove
404b7cc38a Merge pull request #2305 from joakim-hove/guiderate-injector
Convert GuideRateTarget::RAT to preferred phase for injectors
2021-02-18 19:56:49 +01:00
Joakim Hove
4e57436773 Use ScheduleState to configure RFT 2021-02-18 19:54:18 +01:00
Joakim Hove
0c9390d93a Merge pull request #2307 from joakim-hove/restart-config
Restart config
2021-02-18 18:44:05 +01:00
Joakim Hove
673d4bc251 Merge pull request #2306 from joakim-hove/rm-dynamicstate
Rm dynamicstate
2021-02-18 18:43:36 +01:00
Joakim Hove
b90af1efe0 Remove unused #include 2021-02-18 17:03:40 +01:00
Joakim Hove
956de08c05 Remove forward declaration 2021-02-18 16:59:43 +01:00
Joakim Hove
7e7a409ea4 Make function private 2021-02-18 16:58:17 +01:00
Joakim Hove
7aa8d0565b Remove class DynamicVector<T> 2021-02-18 16:50:23 +01:00
Joakim Hove
5f95d2622c Remove unused #include <.../DynamicState> and <.../DynamicVector> 2021-02-18 16:45:56 +01:00
Joakim Hove
803e993e91 Convert GuideRateTarget::RAT to preferred phase for injectors 2021-02-18 10:23:01 +01:00
Bård Skaflestad
17fb887398 Merge pull request #2295 from jalvestad/rst-network
Add restart data output for Network option data (keywords NETWORK, BRANPROP NODEPROP)
2021-02-17 14:35:49 +01:00
Jostein Alvestad
dafd605eaa various code improvements based on Joakims review 2021-02-17 08:59:03 +01:00
Jostein Alvestad
b403e2ae48 corrections to handle the use of network or not and degenrate case 2021-02-17 08:59:01 +01:00
Jostein Alvestad
cece11c727 some corrections and completed unit tests 2021-02-17 08:58:59 +01:00
Jostein Alvestad
895b8af837 first complete version of restart output - no unit tests
code improvement plus initial changes on test dataset

removed changes to test-dataset

changes to adapt to changes of Schedule object

Added test data set

changed test data - all in one DATA-file, changed serielizer - vector string

added unit test of INode data
2021-02-17 08:58:55 +01:00
Jostein Alvestad
e3be265625 initial changes to output network data to ECL-compatible restart file
first code that runs and outputs the INODE array

Added INODE and parts of IBRAN

added contributions for IBRAN and INOBR

added changes for output of RNODE

initial changes for RBRAN
2021-02-17 08:58:52 +01:00
Bård Skaflestad
ec742e302f Merge pull request #2303 from joakim-hove/group-and-network
Network variables are stored with SummaryState::update_group_var
2021-02-17 00:01:00 +01:00
Joakim Hove
a2061972bc Merge pull request #2302 from joakim-hove/sched-state-rft-config
Use std::optional<>
2021-02-16 22:55:56 +01:00
Joakim Hove
be1de22974 Node variables are stored with SummaryState::update_group_var 2021-02-16 22:28:19 +01:00
Joakim Hove
a43d9245e8 Merge pull request #2301 from joakim-hove/rm-commented-code
Remove commented out code
2021-02-16 15:30:47 +01:00
Joakim Hove
e029731197 Use std::optional<> instead of homemade std::pair() 2021-02-16 13:50:27 +01:00
Joakim Hove
b70cdb78da Remove commented out code 2021-02-16 13:39:29 +01:00
Joakim Hove
261f63503d Merge pull request #2298 from joakim-hove/vfp-warnings
VFP Table updates
2021-02-16 13:37:47 +01:00
Joakim Hove
315c80eedc Merge pull request #2300 from joakim-hove/remove-aqucon-mult
Remove aqucon mult
2021-02-16 13:36:33 +01:00
Joakim Hove
a5f32420f5 Improve error message for reused aquifer cell 2021-02-16 10:45:13 +01:00
Joakim Hove
4535b69e0d Remove multiplier from aquifer cell 2021-02-16 09:58:51 +01:00
Joakim Hove
84809e8d31 Merge pull request #2297 from joakim-hove/aquconn-combine
Implement add and multiply semantics for repeated AQUANCON keywords
2021-02-16 09:47:49 +01:00
Joakim Hove
45bfe8da9f VFP Table updates
- Add member KeywordLocation to vfp tables
 - Improve error messages
 - Remove array_type typedef - use std::vector<double>
 - Use class based enums
 - Replace assert(x) -> if (!x) throw
2021-02-16 09:14:43 +01:00
Joakim Hove
18cf79ff8a Merge pull request #2299 from joakim-hove/fp-allow-invalid
FieldProps can return invalid data if allow_unsupported is true
2021-02-16 09:08:32 +01:00
Joakim Hove
e20be57d8b FieldProps can return invalid data if allow_unsupported is true 2021-02-16 08:34:15 +01:00
Joakim Hove
3032df0739 Implement add and multiply semantics for repeated AQUANCON keywords 2021-02-15 13:11:06 +01:00
Alf Birger Rustad
51d2a90386 Do not print debug message to LOG/PRT file 2021-02-15 10:37:02 +01:00
Joakim Hove
154b8727e1 Merge pull request #2294 from joakim-hove/aquconn
Aquconn
2021-02-15 09:19:34 +01:00
Joakim Hove
79375ecc9c Use face area as default influx coefficient for aquifer connection 2021-02-14 20:55:28 +01:00
Joakim Hove
6b9eea3919 Merge pull request #2293 from joakim-hove/handlercontext-add-wellpi
Handle WELPI + ACTIONX
2021-02-14 19:50:28 +01:00
Joakim Hove
36159d8512 Handle WELPI as ACTIONX keyword 2021-02-14 18:57:51 +01:00
Joakim Hove
6ad537fb20 Merge pull request #2292 from joakim-hove/tran-distribute-keys
Unconditionally include TRAN? keywords in FieldProps::keys<double>()
2021-02-12 16:58:49 +01:00
Joakim Hove
6fcd31850c Unconditionally include TRAN? keywords in FieldProps::keys<double>() 2021-02-12 09:59:14 +01:00
Joakim Hove
aa7b619fc7 Merge pull request #2287 from joakim-hove/target-wellpi
Store target_wellpi in simple map member of ScheduleState
2021-02-12 09:24:27 +01:00
Joakim Hove
579890177e Remove prod_index member from Well class 2021-02-11 15:57:42 +01:00
Bård Skaflestad
7c67eccb93 Merge pull request #2288 from tskille/wct_unit
change units for water cut vectors
2021-02-11 00:01:35 +01:00
Torbjørn Skille
1256f93f63 change units for water cut vectors
using same as for commercial simulator
2021-02-10 21:09:55 +01:00
Joakim Hove
35761f31c1 Store target_wellpi in simple map member of ScheduleState 2021-02-10 21:03:26 +01:00
Joakim Hove
5b195311ee Merge pull request #2286 from joakim-hove/well-get-index-forward
Use template predicate and perfect forwarding
2021-02-10 15:37:50 +01:00
Joakim Hove
20b2531f95 Merge pull request #2285 from joakim-hove/apply-action-wellpi-arg
Update Schedulle::applyAction() api with wellpi argument
2021-02-10 14:59:17 +01:00
Joakim Hove
cbf18f3a89 Use template predicate and perfect forwarding 2021-02-10 13:19:32 +01:00
Joakim Hove
6d02754260 Update Schedulle::applyAction() api with wellpi argument 2021-02-10 12:30:49 +01:00
Joakim Hove
df563c0776 Merge pull request #2284 from joakim-hove/well-get-by-insert-index
Well get by insert index
2021-02-10 11:06:25 +01:00
Joakim Hove
23c1b15a46 Merge pull request #2283 from joakim-hove/unused-arg-warning
Remove unused arguments
2021-02-10 11:01:24 +01:00
Joakim Hove
7a40f31823 Add operator[] to NameOrder class 2021-02-10 09:45:01 +01:00
Joakim Hove
0e3839a6f1 Remove unused arguments 2021-02-10 09:19:39 +01:00
Joakim Hove
b45d40e722 Add Schedule::getWell( well_index, report_step) method 2021-02-10 09:09:53 +01:00
Joakim Hove
aea7de2c29 Add size() method to NameOrder class 2021-02-10 09:09:53 +01:00
Joakim Hove
994703e9db Merge pull request #2269 from joakim-hove/well-sched-state2
Well use SchedState
2021-02-10 09:08:16 +01:00
Joakim Hove
bcffaefa7a Use ScheduleState for wells++
Use SchedueleState for wells, in addition to the members UDQConfig, GasLiftOpt
and GuideRateConfig.
2021-02-10 07:22:46 +01:00
Joakim Hove
0a6bbffea9 Merge pull request #2281 from joakim-hove/use-summarystate-optional-get
Use SummaryState::get_well_var(, default) instead of manual check
2021-02-10 07:21:51 +01:00
Joakim Hove
564c207a05 Use SummaryState::get_well_var() 2021-02-09 21:51:26 +01:00
Joakim Hove
2c4ac9d52f Merge pull request #2252 from GitPaean/new_numerical_aquifer_2
Numerical Aquifer continue
2021-02-09 07:22:25 +01:00
Joakim Hove
a64a7ba9d5 Merge pull request #2279 from joakim-hove/action-welpi
Export list of WELPI wells from an ACTIONX keyword
2021-02-09 07:20:39 +01:00
Bård Skaflestad
83e6c4d2ca Merge pull request #2276 from joakim-hove/wellpi
Apply WELPI is based on newWellPI and not scaling factor
2021-02-08 23:28:50 +01:00
Kai Bao
e5277221c7 adding more tests in AquiferTests for numerical aquifer 2021-02-08 09:40:25 +01:00
Joakim Hove
c294e1779a Merge pull request #2280 from joakim-hove/mutable-overloads
Add mutable overloads for map_member methods get() and operator()
2021-02-07 23:39:41 +01:00
Joakim Hove
61e9d2ba98 Add mutable overloads for map_member methods get() and operator() 2021-02-07 18:05:40 +01:00
Joakim Hove
759a00538e Export list of WELPI wells from an ACTIONX keyword 2021-02-07 16:26:58 +01:00
Bård Skaflestad
f880a4fa61 Merge pull request #2278 from joakim-hove/compdat-no-move
Avoid use after move

Fixes #2277
2021-02-07 11:29:07 +01:00
Joakim Hove
f9a9361180 Avoid use after move 2021-02-07 07:55:37 +01:00
Kai Bao
8443b991c7 isolate numerical aquifer cells by setting permeability to zero
instead of editing transmissiblity directly.
2021-02-05 14:40:38 +01:00
Kai Bao
fc8ca0566d updating more fieldProps related to numerical aquifer cells 2021-02-05 14:40:38 +01:00
Kai Bao
667f20df70 addressing reviewing comments in OPM/opm-common#2252 2021-02-05 14:40:38 +01:00
Kai Bao
9231c6c25d adding a few functions for simulator usage
return aqufier id and access all the aquifers in NumericalAquifers
2021-02-05 14:40:38 +01:00
Kai Bao
74921e3668 summary support for numerical aquifer keywords 2021-02-05 14:40:38 +01:00
Kai Bao
2da3a2987c fixing test TESTCP_ACTNUM_AQUNUM in EclipseGridTests 2021-02-05 14:40:38 +01:00
Kai Bao
a1f98d7f2d creating NNCs to form numerical aquifers
Aquifer cells are connected through NNCs to form the aquifer itself. And
the reservoirs cells are connected to the first aquifer cell through
NNCs also.
2021-02-05 14:40:38 +01:00
Kai Bao
398d45ff68 updating some field_props for numerical aquifer cells
in the implementation, numerical aquifer cells are some specific grid
cells. At the same time, aquifer keywords can specify these cells with
very different properties, like depth, porosoity, pore volume, SATNUM,
PVTNUM, and so on.
2021-02-05 14:40:38 +01:00
Kai Bao
7628d7e13b isolating the aquifer cells from the rest of the reservoir
by setting the transmissiblity associated with aquifer cells to be zero.
2021-02-05 14:40:38 +01:00
Joakim Hove
e571aca93b Apply WELPI is based on newWellPI and not scaling factor 2021-02-05 13:02:47 +01:00
Joakim Hove
c9908df914 Merge pull request #2275 from joakim-hove/apply-action-simtime
Pass simulation time argument to Schedule::applyAction()
2021-02-05 12:06:44 +01:00
Joakim Hove
39c560e5cc Pass simulation time argument to Schedule::applyAction() 2021-02-05 09:53:27 +01:00
Joakim Hove
eb736fa9cd Merge pull request #2273 from joakim-hove/sched-unique
Sched unique
2021-02-04 13:52:55 +01:00
Joakim Hove
7a45b23736 Merge pull request #2272 from joakim-hove/remove-udq-constructor
Remove UDQParams( Deck ) constructor
2021-02-04 11:12:55 +01:00
Joakim Hove
08cb85e08e Add temporary disabled Schedule::unique<UDQConfig>() test 2021-02-04 11:11:40 +01:00
Joakim Hove
3bc82e7a96 Add Schedule::unique<T>() 2021-02-04 11:11:40 +01:00
Joakim Hove
1ca611e698 Add const overload to ScheduleState::get<T>() 2021-02-04 11:11:39 +01:00
Joakim Hove
6592e83ed8 Remove UDQParams( Deck ) constructor 2021-02-04 09:22:40 +01:00
Joakim Hove
bf82cde25d Merge pull request #2270 from joakim-hove/jr-janitor
Remove unused arguments
2021-02-03 15:04:16 +01:00
Markus Blatt
1fb9793fa9 Merge pull request #2271 from joakim-hove/sched-block-mutable
Make return value from ScheduleDeck::operator[] mutable
2021-02-03 14:05:29 +01:00
Joakim Hove
71aac491c9 Add mutable ScheduleDeck::operator[] overload 2021-02-03 12:07:56 +01:00
Joakim Hove
3936af4f9e Remove report_step argument from Well::handleWELOPENConnections() 2021-02-03 11:50:25 +01:00
Joakim Hove
d1178bdd38 Remocve report_step argument from Well::handleWPIMULT() 2021-02-03 11:47:39 +01:00
Joakim Hove
29274ed315 Remove report_step argument from Well::handleCOMPLUMP() 2021-02-03 11:46:48 +01:00
Joakim Hove
fa85bc6445 Remove report_step argument from Well::handleCOMPSEGS() 2021-02-03 11:45:18 +01:00
Joakim Hove
5580165fee Remove report_step argument in Well::updateConnections() 2021-02-03 11:40:38 +01:00
Joakim Hove
4aa0d5ac56 Remove unused method Well::updateConnectionStatus() 2021-02-03 11:31:52 +01:00
Joakim Hove
e7f72ddb8a Remove unsused argument report_step in Well::updateConnections() 2021-02-03 11:27:10 +01:00
Joakim Hove
a47cdc1b6b Require Well::updateConnections() force argument 2021-02-03 11:20:09 +01:00
Joakim Hove
509c8a71a0 Remove runtime argument from Schedule::updateWellStatus() 2021-02-03 11:09:17 +01:00
Joakim Hove
8099c868c2 Merge pull request #2268 from joakim-hove/well-status-scalar
Well status scalar
2021-02-02 23:03:48 +01:00
Joakim Hove
f308817d5c Use scalar well Status 2021-02-02 18:06:03 +01:00
Joakim Hove
78521f6f4a Removed function Well::commitStatus() 2021-02-02 17:36:44 +01:00
Joakim Hove
44388315ae Removed first_step from WellStatus 2021-02-02 17:27:21 +01:00
Joakim Hove
d25e8555b2 Remove last_step from WellStatus 2021-02-02 17:27:10 +01:00
Joakim Hove
4a7ddeefca Merge pull request #2265 from totto82/fixMaxGasLiq
fix max_gas_liquid_ratio
2021-02-02 10:02:20 +01:00
Bård Skaflestad
763fb0d368 Merge pull request #2266 from bska/recognize-bsoil
Recognize BSOIL as a Block Summary Keyword
2021-02-02 09:56:17 +01:00
Bård Skaflestad
14351087ab Recognise BSOIL as a Block Summary Keyword 2021-02-02 09:22:13 +01:00
Tor Harald Sandve
1ff349150b fix max_gas_liquid_ratio 2021-02-02 09:18:42 +01:00
Joakim Hove
ea8e391de5 Merge pull request #2261 from joakim-hove/group-sched-state
Group sched state
2021-02-02 09:14:04 +01:00
Joakim Hove
e016d357d8 Use ScheduleState to manage groups 2021-02-02 07:25:16 +01:00
Bård Skaflestad
98efacf14f Merge pull request #2263 from totto82/fixUnitThconr
Fix unit THCONR
2021-02-01 18:23:09 +01:00
Joakim Hove
bd22745ec0 Merge pull request #2256 from joakim-hove/vfp-pointer-update
Pack only unique VFP tables
2021-02-01 17:06:30 +01:00
Joakim Hove
4015e240b9 Merge pull request #2260 from akva2/fix_clang_template_args
fixed: add some type aliases and explicit template parameters
2021-02-01 15:04:57 +01:00
Joakim Hove
5f21fe291f ScheduleState::get<T> will give compile error for invalid T 2021-02-01 14:50:14 +01:00
Joakim Hove
1893daec8b Will refuse pointer update with empty pointer 2021-02-01 14:50:14 +01:00
Joakim Hove
1032e16947 Use order independent map== 2021-02-01 14:50:14 +01:00
Joakim Hove
5c72211325 Pack pointers for VFP maps 2021-02-01 14:50:14 +01:00
Joakim Hove
be28004793 Merge pull request #2255 from berland/jsonfixes_ecl_test_suite
Fix bugs in keyword definitions
2021-02-01 14:18:26 +01:00
Tor Harald Sandve
39e6b953d8 Fix unit THCONR 2021-02-01 12:48:56 +01:00
Håvard Berland
2de6ab7bc4 Remove size from AQUFET and AQUFETP 2021-02-01 12:17:52 +01:00
Arne Morten Kvarving
2bb214cbfd fixed: add some type aliases and explicit template parameters
clang does not consider default template parameters
when resolving template arguments.
2021-02-01 09:09:01 +01:00
Joakim Hove
47a7f15efc Merge pull request #2253 from joakim-hove/use-normal-map-groups
Use normal map groups
2021-01-30 20:04:13 +01:00
Joakim Hove
38485d9a96 Merge pull request #2259 from joakim-hove/remove-update-ptr
Remove ScheduleState::update_ptr method
2021-01-30 20:00:51 +01:00
Joakim Hove
448a548c8a Remove ScheduleState::update_ptr method 2021-01-30 14:51:36 +01:00
Joakim Hove
982f2a9bed Use std::unordered_map<> for groups 2021-01-30 14:23:09 +01:00
Joakim Hove
d2398bdf3d Merge pull request #2258 from joakim-hove/use-well-order
Use WellOrder class for wellnames
2021-01-30 10:23:51 +01:00
Joakim Hove
a4c89c0466 Use GroupOrder in Schedule 2021-01-30 10:20:03 +01:00
Joakim Hove
efa08f123f Implement GroupOrder as standalone class and to ScheduleState 2021-01-30 10:19:49 +01:00
Joakim Hove
9728e5d69b Use WellOrder class for wellnames 2021-01-30 08:40:51 +01:00
Joakim Hove
e5017ebd69 Merge pull request #2257 from joakim-hove/add-missing-well-order==
Add missing WellOrder== in ScheduleState==
2021-01-29 23:08:32 +01:00
Joakim Hove
3a8dfc53d6 Add missing WellOrder== in ScheduleState== 2021-01-29 21:48:01 +01:00
Håvard Berland
131b2ec046 Fix bugs in keyword definitions
Uncovered by trying to parse the test suite supplied with Eclipse.

Some missing, some typos, some inconsistencies.
2021-01-29 16:06:20 +01:00
Bård Skaflestad
c17e400e43 Merge pull request #2254 from akva2/janitoring
remove unused variable
2021-01-29 15:43:33 +01:00
Arne Morten Kvarving
30d6dd2a94 remove unused variable 2021-01-29 15:03:54 +01:00
Joakim Hove
2cf3feb8d0 Merge pull request #2248 from joakim-hove/update-ptr
Use small wrapper to manage shared pointers in ScheduleState
2021-01-29 12:54:37 +01:00
Joakim Hove
acb1284efd Use small wrapper to manage shared pointers in ScheduleState 2021-01-29 11:42:36 +01:00
Joakim Hove
39720fa3a4 Merge pull request #2251 from joakim-hove/rename-wellorder
Rename wellorder
2021-01-29 06:59:05 +01:00
Joakim Hove
86c6028fc9 Merge pull request #2250 from joakim-hove/python-test-fixup
Fix bug in python/setup-test.sh.in
2021-01-28 20:42:05 +01:00
Joakim Hove
8da208c0c0 Add derived class GroupNames 2021-01-28 20:04:29 +01:00
Joakim Hove
a4ca61dc4e Renamed WellOrder -> NameOrder 2021-01-28 19:49:05 +01:00
Joakim Hove
39c72cf45a Merge pull request #2213 from joakim-hove/use-ordinary-map
Use ordinary map for wells
2021-01-28 19:47:51 +01:00
Joakim Hove
7e8bb3846a Fix bug in python/setup-test.sh.in 2021-01-28 17:20:19 +01:00
Joakim Hove
b1d2e96dea Use ordinary map for wells 2021-01-28 17:08:43 +01:00
Joakim Hove
3ba858e5a9 Merge pull request #2246 from GitPaean/new_numerical_aquifer
numerical aquifers
2021-01-28 11:14:02 +01:00
Joakim Hove
8c80620851 Merge pull request #2249 from joakim-hove/windows-slashes
Replace windows path separators in GDFILE keyword
2021-01-28 10:58:05 +01:00
Kai Bao
abbb56c173 addressing review comments for OPM/opm-common#2246 2021-01-27 22:50:50 +01:00
Kai Bao
af882dc483 wip in adding serialize code 2021-01-27 22:49:03 +01:00
Kai Bao
35bc7293f1 adding a test for numerical aquifer 2021-01-27 22:49:03 +01:00
Kai Bao
9f5463afbc removing the usage of class NumericalAquiferConnections
it is just of limited usage and potentially create more confusion.
2021-01-27 22:49:03 +01:00
Kai Bao
e8dc3c19fb adding numerical aquifer to AquiferConfig 2021-01-27 22:49:03 +01:00
Kai Bao
77b2b107f4 creating class NumericalAquifers 2021-01-27 22:49:03 +01:00
Kai Bao
067b3e11e5 adding NumericalAquiferConnections 2021-01-27 22:49:03 +01:00
Kai Bao
836b5aefd5 adding NumericalAquiferCell
it is the cells that makes the numerical aquifer itself.
2021-01-27 22:49:03 +01:00
Joakim Hove
d15a3a918c Replace windows path separators in GDFILE keyword 2021-01-27 16:15:28 +01:00
Joakim Hove
0882e0361a Merge pull request #2242 from joakim-hove/vfp-name
Vfp name
2021-01-26 16:12:52 +01:00
Joakim Hove
d30b571edd Merge pull request #2223 from joakim-hove/pack-state
Add serialize support for unique elements in ScheduleState
2021-01-26 16:12:23 +01:00
Joakim Hove
c4e6bf0dd8 Add optional methods to get VFP tables 2021-01-26 13:34:16 +01:00
Joakim Hove
a8f3ef088e Add name() method to VFP tables - for serialization 2021-01-26 13:32:30 +01:00
Joakim Hove
816f87a1d4 Refactor serialization of std::shared_ptr<> members in ScheduleState 2021-01-26 13:26:20 +01:00
Joakim Hove
f70ea18a1a Merge pull request #2245 from joakim-hove/rename-schedulestate-updates
Rename schedulestate updates
2021-01-26 12:58:27 +01:00
Joakim Hove
45d6e362b9 Rename ScheduleState modifiers 2021-01-26 11:21:55 +01:00
Joakim Hove
6e5ec70d6d Add WellTestConfig::WTESTWell constructor 2021-01-26 11:21:55 +01:00
Joakim Hove
ebb4b22c5a Merge pull request #2240 from joakim-hove/vfp-reference-wrapper
Export VFP tables as reference wrappers instead of pointers
2021-01-26 11:07:33 +01:00
Joakim Hove
3f204ae6df Merge pull request #2244 from totto82/addConnectionRadiusAndLength
Adding connection length and effective radius to the connection
2021-01-26 07:03:49 +01:00
Tor Harald Sandve
434b791442 Adding connection length and effective radius to the connection 2021-01-25 14:10:06 +01:00
Joakim Hove
f6e66a4398 Export VFP tables as reference wrappers instead of pointers 2021-01-25 12:21:56 +01:00
Joakim Hove
471eef05b2 Merge pull request #2227 from joakim-hove/wellname-sort
Wells from wellmatcher are sorted by insert order
2021-01-25 12:13:33 +01:00
Joakim Hove
56c7e89bbd Use WellOrder to construct WellMatcher 2021-01-25 10:20:57 +01:00
Joakim Hove
264a0f4178 Add Wellorder member to ScheduleState and serialize() 2021-01-25 10:20:57 +01:00
Joakim Hove
9f2cb7ec39 Merge pull request #2238 from joakim-hove/wellorder
Wellorder
2021-01-25 09:11:23 +01:00
Joakim Hove
95031c7ed8 Merge pull request #2239 from joakim-hove/eclipsestate-error-msg
Eclipsestate error msg
2021-01-25 09:10:53 +01:00
Joakim Hove
57ab9d0d95 Make error message stand out more with newlines 2021-01-25 07:21:09 +01:00
Joakim Hove
e06bbf5731 Remove extra ',' in output format - recovers internal message 2021-01-25 07:20:11 +01:00
Joakim Hove
15bd99b44c Add class WellOrder to keep track of well insert order 2021-01-25 06:50:08 +01:00
Joakim Hove
6b723ea782 Merge pull request #2235 from joakim-hove/alqr
Add load for loading summary keywords AL.+
2021-01-24 08:51:13 +01:00
Joakim Hove
87b8b145b0 Add basic parsing support for ALxx summary keywords 2021-01-24 07:18:17 +01:00
Joakim Hove
10421f7430 Merge pull request #2236 from joakim-hove/ehystr
Add missing item to EHYSTR keyword
2021-01-23 21:38:32 +01:00
Joakim Hove
24461aa5d0 Merge pull request #2234 from joakim-hove/MSUM_PROBE
Add summary keywords of the form MSUMxxx
2021-01-23 21:38:21 +01:00
Joakim Hove
2c0d194f85 Add missing item to EHYSTR keyword 2021-01-23 19:31:28 +01:00
Joakim Hove
03b2066427 Merge pull request #2228 from totto82/CO2STORE
add CO2STORE as alias for CO2STOR
2021-01-23 19:08:25 +01:00
Joakim Hove
6566e46457 Add summary keywords of the form MSUMxxx 2021-01-23 18:26:21 +01:00
Tor Harald Sandve
195749d7bf add CO2STORE as alias for CO2STOR 2021-01-22 14:31:00 +01:00
Joakim Hove
21ce685473 Merge pull request #2224 from totto82/addDiffusion
Add support for DIFFC and DIFFUSE
2021-01-21 18:31:19 +01:00
Tor Harald Sandve
c8343d95f6 add support for DIFFC and DIFFUSE 2021-01-21 11:21:05 +01:00
Joakim Hove
30ec56fffe Merge pull request #2225 from bska/dont-copy-wells
Revert to Looping Well Names
2021-01-21 09:01:50 +01:00
Bård Skaflestad
5c1c7881fc Loop Well Names When Creating xWEL Arrays
The well maintains its own insertion index so we don't need to infer
that value from the well object ordering implied by member function

    Schedule::getWells()
2021-01-20 16:56:29 +01:00
Bård Skaflestad
7318bc080f Revert to Looping Well Names
The wells maintain their own insertion index, so we do not need to
infer the index from the well name order.
2021-01-20 16:56:29 +01:00
Joakim Hove
af66a6b5f5 Merge pull request #2226 from tskille/tcpu_unit
Adding unit SECONDS for summary vector TCPU
2021-01-20 16:35:13 +01:00
Torbjørn Skille
768cbb2c56 Adding unit SECONDS for summary vector TCPU 2021-01-20 15:02:30 +01:00
Joakim Hove
60aeb91a5e Merge pull request #2221 from joakim-hove/schedule-grid-pointers
Use pointers to grid and fieldprops in Schedule construction
2021-01-20 13:20:48 +01:00
Arne Morten Kvarving
09d658cb41 Merge pull request #2216 from dr-robertk/PR/fix-openmp-linking-issue
Linking issue when OpenMP is disabled.
2021-01-20 09:06:40 +01:00
Atgeirr Flø Rasmussen
503e527272 Merge pull request #2222 from OPM/revert-2215-use-ordinary-map-groups
Revert "Use std::map for groups"
2021-01-19 14:39:06 +01:00
Joakim Hove
ecce98a307 Revert "Use std::map for groups" 2021-01-19 12:40:01 +01:00
Joakim Hove
11b568e8e5 Merge pull request #2215 from joakim-hove/use-ordinary-map-groups
Use std::map for groups
2021-01-19 12:35:59 +01:00
Joakim Hove
a01b81d9ec Use pointers to grid and fieldprops in Schedule construction 2021-01-19 10:27:37 +01:00
Joakim Hove
a24bc9427e Merge pull request #2220 from joakim-hove/sched-state-python
Add very basic Python wrapping for ScheduleState
2021-01-19 10:15:34 +01:00
Joakim Hove
5a8cb5f562 Add very basic Python wrapping for ScheduleState 2021-01-19 09:51:22 +01:00
Joakim Hove
4b89487ef2 Merge pull request #2217 from joakim-hove/add-group-to-group
Use names in api for group-group update
2021-01-18 14:39:13 +01:00
Joakim Hove
499f1ce72f Merge pull request #2219 from joakim-hove/group-remove-define-step
Remove member to track create time from Group
2021-01-18 14:38:56 +01:00
Joakim Hove
888a646716 Remove member to track create time from Group 2021-01-18 12:19:54 +01:00
Joakim Hove
a618f39f9b Use names in api for group-group update 2021-01-18 11:39:07 +01:00
dr-robertk
3c66dcdd4b [bugfix][OpenMP] #ifdef _OPENMP should be used, otherwise linking errors
occur.
2021-01-18 10:34:15 +01:00
Joakim Hove
55cec7dd4d Use std::map for groups 2021-01-18 09:13:35 +01:00
Joakim Hove
462ab5f44a Merge pull request #2214 from joakim-hove/use-ordinary-map-commits
Use ordinary map commits
2021-01-15 14:31:07 +01:00
Joakim Hove
d3a1f6521f Change test to check for existence 2021-01-15 12:29:01 +01:00
Joakim Hove
8cd442e5b2 Use full well objects instead of well names 2021-01-15 12:25:27 +01:00
Joakim Hove
bee758bc37 Whitespace 2021-01-15 12:24:12 +01:00
Joakim Hove
7fc9d2bb73 Merge pull request #2212 from joakim-hove/sched-udq-active
Sched udq active
2021-01-15 10:24:27 +01:00
Joakim Hove
344972624a Use ScheduleState to manage UDQActive 2021-01-15 09:19:33 +01:00
Joakim Hove
bc3c3490bb Merge pull request #2211 from joakim-hove/sched-action
Sched action
2021-01-15 09:18:32 +01:00
Joakim Hove
c22b47f994 Use ScheduleState to manage Actionx 2021-01-15 07:51:51 +01:00
Joakim Hove
ccb0ecbea3 Merge pull request #2210 from joakim-hove/sched-vfp
Sched vfp
2021-01-15 07:39:34 +01:00
Joakim Hove
d7345edc95 Use ScheduleState to manage VFP tables 2021-01-14 21:28:19 +01:00
Joakim Hove
32dec137a7 Merge pull request #2207 from joakim-hove/sched-rptconfig
Sched rptconfig
2021-01-14 11:52:19 +01:00
Joakim Hove
65aab177df Manage RTPSCHED config in ScheduleState 2021-01-14 10:40:30 +01:00
Joakim Hove
b2bc40206a Merge pull request #2206 from joakim-hove/sched-static
Assemble static schedule information in ScheduleStatic
2021-01-13 13:19:22 +01:00
Joakim Hove
6453844fd6 Merge pull request #2209 from GitPaean/creating_aquifer_helpers
creating AquiferHelpers
2021-01-13 13:14:48 +01:00
Kai Bao
13c38b7eb9 creating AquiferHelpers
to make function neighborCellInsideReservoirAndActive more reusable.
2021-01-13 11:51:14 +01:00
Joakim Hove
2a95573570 Assemble static schedule information in ScheduleStatic 2021-01-13 11:49:29 +01:00
Joakim Hove
de0615e251 Merge pull request #2205 from joakim-hove/sched-network
Manage Network configuration with ScheduleState
2021-01-13 08:04:19 +01:00
Joakim Hove
bd596f06b4 Manage Network configuration with ScheduleState 2021-01-12 21:42:23 +01:00
Joakim Hove
5ab1ae67ec Merge pull request #2203 from joakim-hove/sched-wlist
Sched wlist
2021-01-12 21:14:29 +01:00
Joakim Hove
ad03c1f479 Merge pull request #2188 from jalvestad/actx-paren
Changes to Actionx - related data (IACN) due to use of parentheses in the action conditions
2021-01-12 21:13:51 +01:00
Joakim Hove
b6e78fe486 Manage well list with ScheduleState 2021-01-12 20:18:22 +01:00
Joakim Hove
c2e1aeb568 Merge pull request #2202 from joakim-hove/sched-gcon
Manage GConSale and GConSump with ScheduleState object
2021-01-12 20:17:44 +01:00
Joakim Hove
ddba87cf99 Manage GConSale and GConSump with ScheduleState object 2021-01-12 18:29:27 +01:00
Joakim Hove
9b150db251 Merge pull request #2201 from joakim-hove/sched-wtest-config
Handle well test configuration with ScheduleState
2021-01-12 17:50:27 +01:00
Jostein Alvestad
7056ce3970 removed comment line 2021-01-12 14:31:41 +01:00
Jostein Alvestad
8e4557646d changes based on reviewer comments to improve/clean code 2021-01-12 14:30:25 +01:00
Joakim Hove
c20417d69b Handle well test configuration with ScheduleState 2021-01-12 14:02:15 +01:00
Joakim Hove
a2810bdf2e Merge pull request #2200 from joakim-hove/clamp-chrono
Make sure ScheduleState time_points are clamped to std::time_t
2021-01-12 13:58:58 +01:00
Joakim Hove
aebbc56b07 Make sure ScheduleState time_points are clamped to std::time_t 2021-01-12 13:06:04 +01:00
Joakim Hove
c5b226a8c8 Merge pull request #2199 from joakim-hove/sched-global-whistctl-mode
Sched global whistctl mode
2021-01-12 12:25:00 +01:00
Jostein Alvestad
4825f291e7 Added unit tests for Actionx data with parentheses 2021-01-12 09:32:10 +01:00
Jostein Alvestad
025ee7b634 changes to Actionx unit test data 2021-01-12 09:32:09 +01:00
Jostein Alvestad
0efb585b4c some corrections to treatment of parentheses 2021-01-12 09:32:07 +01:00
Jostein Alvestad
3d072baf9e initial changes for handling parentheses in ACTIONX conditions 2021-01-12 09:32:05 +01:00
Joakim Hove
473f937b8c Mange global well history control mode in ScheduleState 2021-01-12 09:02:35 +01:00
Joakim Hove
2aeee665d1 Merge pull request #2198 from joakim-hove/sched-message-limits
Sched message limits
2021-01-12 09:00:41 +01:00
Joakim Hove
85c8a9b4e7 Use SchduleState to manage MessageLimits 2021-01-11 23:03:46 +01:00
Joakim Hove
30f947b998 Merge pull request #2194 from joakim-hove/sched-events
Sched events
2021-01-11 20:24:15 +01:00
Joakim Hove
e445bf738c Manage events with the ScheduleState machinery 2021-01-11 20:05:46 +01:00
Joakim Hove
e185ddf96b Merge pull request #2196 from joakim-hove/schedule-debug
Schedule debug
2021-01-11 12:11:40 +01:00
Joakim Hove
a8a033314e Enable Schedule integration-test/debug in jenkins build 2021-01-11 10:03:00 +01:00
Joakim Hove
c8ba2b30b3 Add runtime Schedule integration test - guarded by #ifdef 2021-01-11 09:56:47 +01:00
Joakim Hove
046f5800e4 Merge pull request #2195 from GitPaean/moving_aquifer_folders
Moving aquifer folders
2021-01-09 10:34:54 +01:00
Kai Bao
ae8ac08a03 removing x from Aquifer files using chmod 2021-01-08 23:39:38 +01:00
Kai Bao
b9ae495bce moving Aquifer related to Aquifer folder 2021-01-08 23:17:36 +01:00
Joakim Hove
b802e23f74 Merge pull request #2193 from joakim-hove/sched-rerun
Sched rerun
2021-01-08 15:15:38 +01:00
Joakim Hove
b8ef8767e5 Remove grid and fp members from default HandlerContext construction 2021-01-08 14:52:26 +01:00
Joakim Hove
77312b1432 Enable rerun of iteration over Schedule keywords 2021-01-08 10:03:20 +01:00
Joakim Hove
248e6a3c8c Merge pull request #2191 from joakim-hove/schedule-oilvap
Schedule oilvap
2021-01-08 09:21:29 +01:00
Joakim Hove
5f78173afb Use ScheduleState for oil vaporization properties 2021-01-08 07:39:23 +01:00
Joakim Hove
c49463fe6f Add class ScheduleTStep 2021-01-07 15:49:46 +01:00
Joakim Hove
f460c67ade Merge pull request #2189 from joakim-hove/schedule-nupcol
Schedule nupcol
2021-01-07 15:48:41 +01:00
Joakim Hove
aedeca0907 Merge pull request #2192 from joakim-hove/cond-open-paren
Add Condition::open_paren() and Condition::close_paren()
2021-01-07 13:19:49 +01:00
Joakim Hove
f424aba75d Internalize nupcol in ScheduleState 2021-01-07 11:57:52 +01:00
Joakim Hove
b652fe794f Add Condition::open_paren() and Condition::close_paren() 2021-01-07 10:52:02 +01:00
Joakim Hove
f18bbb6c8e Schedule::create_first() to create and init first ScheduleState 2021-01-07 08:22:08 +01:00
Joakim Hove
167ada2020 Merge pull request #2190 from joakim-hove/schedule-tuning
Schedule tuning
2021-01-07 07:49:23 +01:00
Joakim Hove
628293c26a Manage Tuning object through ScheduleState 2021-01-06 23:13:43 +01:00
Bård Skaflestad
dca842a5c7 Merge pull request #2178 from joakim-hove/add-sched-tstep
Add sched tstep
2021-01-06 20:56:06 +01:00
Joakim Hove
aaacdd6c57 Add class ScheduleTStep 2021-01-06 19:08:00 +01:00
Bård Skaflestad
22ac814056 Merge pull request #2183 from joakim-hove/sched-deck
Sched deck
2021-01-05 21:46:16 +01:00
Bård Skaflestad
d20b4e0145 Merge pull request #2187 from berland/json_segment1
Use consistent names in WSEG* keywords
2021-01-05 21:04:48 +01:00
Joakim Hove
8cd9065b61 Add class ScheduleDeck 2021-01-05 19:36:00 +01:00
Håvard Berland
c07bf30bcf Use consistent names in WSEG* keywords
WSEGAICD and WSEGSICD used SEG1 and SEG2, while all
other WSEG* keywords use SEGMENT1 and SEGMENT2 for the same
item.
2021-01-05 15:00:50 +01:00
Joakim Hove
3fb60785b5 Merge pull request #2186 from joakim-hove/wbp-improvements
Wbp improvements
2021-01-05 13:51:34 +01:00
Joakim Hove
1695d75d7a Better error message if PAvgCalculatorCollection is missing well 2021-01-05 11:36:52 +01:00
Joakim Hove
ff8035fd0e Merge pull request #2185 from joakim-hove/use-make-shared
Use std::make_shared<> instead of new
2021-01-05 09:20:21 +01:00
Joakim Hove
985ea968d8 Use std::make_shared<> instead of new 2021-01-05 08:37:56 +01:00
Joakim Hove
e15a4a5259 Updated WBP calculator to account for PORV 2021-01-05 08:32:38 +01:00
Joakim Hove
c08b62ac9a Make general WBP calculator public 2021-01-05 07:35:45 +01:00
Joakim Hove
b73a9321aa Merge pull request #2184 from joakim-hove/timemap-allow-rst
Timemap allow rst
2021-01-04 22:13:24 +01:00
Joakim Hove
f1305155e7 Merge pull request #2182 from joakim-hove/wpb-ref-depth
Add reference depth member to PAvg and PAvgCalculator
2021-01-04 22:12:19 +01:00
Joakim Hove
df833aaed3 Internalize WPAVEDEP keyword with reference depth for WBP 2021-01-04 18:39:45 +01:00
Joakim Hove
7a4bdd4ab5 Update report number in comment 2021-01-04 11:28:16 +01:00
Joakim Hove
8bc16ab7fe Rewrite TimeMap::operator[]
- Access to the historical period for a restarted run will not be caught.
- Access to underlying timepoint will be based on at()
2021-01-04 11:28:08 +01:00
Joakim Hove
cbd8c85a6e Merge pull request #2180 from joakim-hove/use-start-time
Use start_time instead of invalid time as dummy for restart
2021-01-01 23:20:43 +01:00
Joakim Hove
314587b608 Use start_time instead of invalid time as dummy for restart 2021-01-01 21:43:44 +01:00
Joakim Hove
777f4f9859 Merge pull request #2179 from joakim-hove/multiline-strings
Multiline strings
2021-01-01 21:40:51 +01:00
Joakim Hove
cc772aa1df Use raw string deck input strings 2021-01-01 21:22:12 +01:00
Bård Skaflestad
764065ccf9 Merge pull request #2167 from totto82/addEvents
add WELTARG and WEFAC to events
2020-12-21 21:30:54 +01:00
Joakim Hove
5c722e5267 Merge pull request #2177 from bska/no-sfunc-1p
Don't Require Saturation Functions for One-Phase Runs
2020-12-21 13:35:10 +01:00
Bård Skaflestad
dde58f8e38 Don't Require Saturation Functions for One-Phase Runs
Users should not have to supply synthetic relative permeability or
capillary pressure functions in a single-phase run.
2020-12-21 11:03:08 +01:00
Joakim Hove
824625f121 Merge pull request #2173 from bska/promote-sfunc-family
Make Saturation Function Family Available in Runspec
2020-12-18 07:39:49 +01:00
Bård Skaflestad
5816d2dbd2 Push Compatibility Check To Parser Level
Leverage the 'prohibits'/'requires' support to enforce earlier
keyword compatibility checks.  This plays better with parallel runs.
2020-12-17 21:33:11 +01:00
Bård Skaflestad
1ca668b67c Make Saturation Function Family Available in Runspec
This information is generally useful so we should have a single
source of truth and not have to reimplement the logic every time
we need it.
2020-12-17 21:33:11 +01:00
Bård Skaflestad
f5a61c3382 Merge pull request #2160 from jalvestad/iudq1-rev
Revision of AggregateUDQData plus some improvements to SWEL and XCON
2020-12-17 21:31:36 +01:00
Joakim Hove
628ad29da1 Merge pull request #2175 from joakim-hove/remove-porv-warning
Remove check and warning for use of porv based WBP calculation
2020-12-17 16:43:26 +01:00
Joakim Hove
93913d64a3 Merge pull request #2119 from jalvestad/glopt
Enable eclipse compatible restart for wells with gas lift optimization
2020-12-17 15:56:48 +01:00
Joakim Hove
5484053cd5 Remove check and warning for use of porv based WBP calculation 2020-12-17 15:49:08 +01:00
Bård Skaflestad
2c5403409e Merge pull request #2172 from bska/relax-eps-requirements
Relax EPS Activation Criterion
2020-12-17 10:19:52 +01:00
Bård Skaflestad
ad8209d882 Relax EPS Activation Criterion
Existence of certain EPS keywords (SWL, SGCR, others) is sufficient
to activate the end-point scaling option.  The deck does not *need*
to have the ENDSCALE keyword in these cases, but it is recommended
that ENDSCALE nevertheless be used.

On the other hand, certain other keywords do require the presence of
ENDSCALE so record this in "requires" clauses.
2020-12-16 17:47:00 +01:00
Joakim Hove
32d9dab412 Merge pull request #2170 from akva2/aquifer_serialize
Add serialization for aquifers
2020-12-16 12:38:43 +01:00
Joakim Hove
1e30916130 Merge pull request #2171 from akva2/fix_autoicd_serialize
Fix AutoICD serialization
2020-12-16 12:37:53 +01:00
Arne Morten Kvarving
6971705c30 fix indentation 2020-12-16 08:34:43 +01:00
Arne Morten Kvarving
8175a8a18f implement AutoICD::serializeObject 2020-12-16 08:34:43 +01:00
Arne Morten Kvarving
fc46b310d6 fix AutoICD::serializeOp 2020-12-16 08:34:43 +01:00
Tor Harald Sandve
648030f1d0 add a well efficiency event 2020-12-15 13:34:34 +01:00
Arne Morten Kvarving
40ec45ebf2 add output serialization functions for aquifer 2020-12-15 11:49:48 +01:00
Jostein Alvestad
229950a591 added unit tests for the lift gas optimisation data 2020-12-15 10:53:29 +01:00
Jostein Alvestad
8c174d7f00 initial changes to make unit tests 2020-12-15 10:53:27 +01:00
Jostein Alvestad
df7e8220db added file for unit-test - not ready yet 2020-12-15 10:53:25 +01:00
Jostein Alvestad
7d784f53ff added code to write lift gas optimisation data to restart file 2020-12-15 10:53:16 +01:00
Arne Morten Kvarving
11ade04fd6 fixed: initialize members in Aquifer 2020-12-15 09:51:44 +01:00
Jostein Alvestad
e1e0857999 made UDQToken.hpp a public header file 2020-12-14 16:09:06 +01:00
Jostein Alvestad
c2a1218066 some minor improvements - warnings and comments 2020-12-14 15:26:25 +01:00
Jostein Alvestad
8da71d5620 improved code quality, used existing functions where possible 2020-12-14 13:56:02 +01:00
Jostein Alvestad
12598aee05 added more extensive unit tests for iudq[1]
Added one test case, cleaned code

Some minor cleaning / corrections

some changes to improve code quality
2020-12-14 13:55:55 +01:00
Jostein Alvestad
768f9958b6 first draft version of new code 2020-12-14 13:55:47 +01:00
Jostein Alvestad
4f1e65e29b initial temporary changes to improve iudq[1]
initial changes to improve iudq[1] for DEFINE

further changes for IUDQ revision

further improvments iudq[1] - top parser tree

further improvments to IUDQ[1] - minus-sign++

first working version of revised UDQ-restart output

additional improvements SWEL, XCON

initial - unfinished changes of rewriting iudq[1]

some minor debug output changes
2020-12-14 13:55:37 +01:00
Joakim Hove
debfc70450 Merge pull request #2169 from joakim-hove/welpi-actionx2
Use event_step
2020-12-13 14:01:39 +01:00
Joakim Hove
545a5ecf7b Use event_step 2020-12-13 09:02:10 +01:00
Bård Skaflestad
9ef5cc2309 Merge pull request #2164 from jalvestad/swel_xconn
Changes for SWEL  for correct handling of lift gas plus improvements to XCONN
2020-12-11 22:52:18 +01:00
Joakim Hove
5474bc9a90 Merge pull request #2158 from joakim-hove/well-status
Manage well status with a shared pointer: To enable/improve runtime updates
2020-12-11 17:10:19 +01:00
Joakim Hove
bd2330df4f Merge pull request #2166 from joakim-hove/actionx-restart-paren
Handle parenthesis in the Actionx::Condition class
2020-12-11 17:01:30 +01:00
Joakim Hove
469cf09d85 Handle parenthesis in the Actionx::Condition class 2020-12-11 14:53:29 +01:00
Tor Harald Sandve
44ebf2f241 add WELTARG and WEFAC to events 2020-12-11 11:35:41 +01:00
Joakim Hove
59f9813e14 Merge pull request #2163 from verveerpj/cylindrical_grid
Support cylindrical grids as a spiderweb with corrected volumes
2020-12-10 09:55:33 +01:00
Joakim Hove
a365a2575a Merge pull request #2165 from joakim-hove/actionx-paren
Add test for boolean logic
2020-12-10 09:40:44 +01:00
Joakim Hove
c31ebda702 Add test for boolean logic 2020-12-09 17:34:18 +01:00
Peter Verveer
40940625fc Bug fix in calculation of depth 2020-12-09 15:51:30 +01:00
Peter Verveer
81c7b53449 Support cylindrical grids as a spiderweb with corrected volumes 2020-12-09 15:51:01 +01:00
Joakim Hove
7541b5e503 Merge pull request #2161 from joakim-hove/update-range
Add function DynamicState::update_range()
2020-12-08 22:14:30 +01:00
Joakim Hove
934e031f22 Merge pull request #2162 from akva2/janitoring
Some bug fixes
2020-12-08 22:14:15 +01:00
Joakim Hove
cf244a293e Add time range to WellStatus 2020-12-08 20:01:55 +01:00
Arne Morten Kvarving
c776ede067 fixed: error in comparison operator 2020-12-08 15:52:55 +01:00
Arne Morten Kvarving
4fd58bf2f3 fixed: use fabs, not abs()
latter is for ints
2020-12-08 15:52:55 +01:00
Arne Morten Kvarving
c205a11037 fixed: forward struct as struct 2020-12-08 15:52:55 +01:00
Jostein Alvestad
fe9ade9dab changes to SWEL and XCONN for lift gas optimisation 2020-12-08 14:50:45 +01:00
Joakim Hove
2e832f0fbe Changes to Well status implementation
o The status of a well is maintened as a small object which is managed by a new
   std::shared_ptr member in the well objects. The consequence of this is that
   several well objects can share the same underlying status object. The
   advantage of this is that runtime (i.e. ACTIONX) updates of well status will
   affect the correct set of wells.

 o The general Schedule::updateWell() will use the DynamicState::upadte_equal()
2020-12-08 09:36:45 +01:00
Joakim Hove
85e2c641d3 Add function DynamicState::update_range() 2020-12-08 09:36:44 +01:00
Markus Blatt
1ef1646fb1 Merge pull request #2159 from joakim-hove/warning-unused
Fix warning with unused variable
2020-12-07 12:27:09 +01:00
Joakim Hove
1b76cd1fe6 Fix warning with unused variable 2020-12-06 10:04:49 +01:00
Joakim Hove
e261253683 Merge pull request #2157 from joakim-hove/wbp-porv
Add PORV argument when creating PAvgCalculator
2020-12-04 20:31:52 +01:00
Joakim Hove
968aa79468 Merge pull request #2151 from verveerpj/spiderweb
Allow use of both DZ and DZV when creating a spiderweb grid
2020-12-04 13:13:57 +01:00
Joakim Hove
135e8c793c Merge pull request #2154 from joakim-hove/dynamicstate-update
Dynamicstate update
2020-12-04 13:13:44 +01:00
Bård Skaflestad
8ada1cc333 Merge pull request #2155 from joakim-hove/handle-welpi-report-step
Use argument reportStep + 1 when evaulating WELPI in  ACTIONX
2020-12-04 12:54:35 +01:00
Joakim Hove
9809197b5d Add PORV argument when creating PAvgCalculator 2020-12-04 10:58:27 +01:00
Peter Verveer
b85ab8813e Allow use of both DZ and DZV when creating a spiderweb grid 2020-12-04 09:44:36 +01:00
Joakim Hove
dbc23dca65 Use argument reportStep + 1 for WELPI ACTIONX events 2020-12-04 09:28:14 +01:00
Joakim Hove
0102d736ac Merge pull request #2141 from GitPaean/wsegaicd2
WSEGAICD
2020-12-04 08:52:16 +01:00
Joakim Hove
0752764ecc Refactor of DynamicState::update_equal() 2020-12-04 08:10:54 +01:00
Bård Skaflestad
aaff4d1785 Merge pull request #2153 from bska/fix-wpi-shut
Summary Test Deck: Open Wells 1, 2, 3, and 6 at First Step
2020-12-04 00:30:20 +01:00
Bård Skaflestad
e1db7cd87e Summary Test Deck: Open Wells 1, 2, 3, and 6 at First Step
This restores 'test_Summary' for WPI vectors.
2020-12-03 22:08:01 +01:00
Kai Bao
c965db78e4 addressing reviewing comments for OPM/opm-common#2141 2020-12-03 21:54:31 +01:00
Kai Bao
f78e0e9c96 adding more accessing functions for AICD class 2020-12-03 15:23:04 +01:00
Kai Bao
540b45b8c7 adding the parsing of WSEGAICD 2020-12-03 15:23:04 +01:00
Bård Skaflestad
971f9d9415 Merge pull request #2150 from joakim-hove/zero-PI-closed-wells
The summary calculator should return zero PI for non flowing wells
2020-12-03 15:09:35 +01:00
Joakim Hove
1a2e0ec01e The summary calculator should return zero PI for non flowing wells 2020-12-03 11:05:10 +01:00
Joakim Hove
acb55a1bff Merge pull request #2148 from joakim-hove/guard-copt
Check that we have the COPT key before accessing it
2020-12-03 09:45:08 +01:00
Joakim Hove
7615088a03 Merge pull request #2146 from joakim-hove/pavg-fixup
Pavg fixup
2020-12-03 09:44:56 +01:00
Bård Skaflestad
b573fc0223 Merge pull request #2149 from tskille/gridhead_fix
fix gridhead out-of-bounds indexing error in EGrid
2020-12-02 23:18:11 +01:00
Torbjørn Skille
26de5bb9b0 fix gridhead out-of-bounds indexing error in EGrid 2020-12-02 19:06:58 +01:00
Joakim Hove
4c48f9bcf9 Merge pull request #2144 from totto82/alq_default
Fix gaslift output
2020-12-02 15:56:35 +01:00
Joakim Hove
19e755e10d Check that we have the COPT key before accessing it 2020-12-02 15:54:01 +01:00
Joakim Hove
1ca2a0b06b Merge pull request #2147 from akva2/fix_deckitem_serialize
fixed: missing serialization for rsval in DeckItem
2020-12-02 14:06:20 +01:00
Arne Morten Kvarving
fa9dc54bbb Merge pull request #2132 from tskille/eclio_lgr
Eclio lgr
2020-12-02 11:23:08 +01:00
Arne Morten Kvarving
0c11863bb5 fixed: missing serialization for rsval in DeckItem
this broke ActionX in parallel
2020-12-02 09:43:22 +01:00
Tor Harald Sandve
1f6dbae5cb use privious table as default 2020-12-02 09:42:51 +01:00
Joakim Hove
f5cc5bc3f2 Merge pull request #2145 from joakim-hove/improve-error-message
Improve error message for connection in inactive cell
2020-12-02 08:29:55 +01:00
Joakim Hove
5b50805c0f Merge pull request #2143 from joakim-hove/roew-copt
Summary keyword ROEW is based on COPT and not WOPT
2020-12-02 08:29:40 +01:00
Joakim Hove
9c6c07c294 Merge pull request #2139 from joakim-hove/actionx-required-summary-variables
ACTIONX: Determine required summary keywords
2020-12-02 08:27:33 +01:00
Joakim Hove
e9443b02a7 Merge pull request #2138 from joakim-hove/welpi-get-wells-from-actionx
Pass the wells captured from ACTIONX to Schedule::handleWELPI()
2020-12-02 08:27:17 +01:00
Torbjørn Skille
a8461fd121 Updating class ERst
- rename member function from getRst -> getRestartData
 - adding support for parsing and reading data for LGRs
 - a number of member functions made const
 - updated python bindings for this class
2020-12-01 23:06:44 +01:00
Torbjørn Skille
a7314ab5a0 Updating class EGrid
- now supporting parsing/reading of lgrs
 - detect if radial grid is used
 - return xyz coordinates also for radial grids
 - support for getting nnc data
2020-12-01 20:14:37 +01:00
Torbjørn Skille
e1334adbf6 Adding new class EInit
- for parsing and loading data from INIT file
 - including functions to support parsing/logading LGR data
2020-12-01 20:14:37 +01:00
Joakim Hove
ab8c6b3d21 Delay exception in WBP calculation 2020-12-01 10:59:31 +01:00
Joakim Hove
de6a067906 Make sure well has been defined before creating PAvgCalculator 2020-12-01 10:32:38 +01:00
Joakim Hove
1ac1582f12 PAvgCalculatorCollection: accept presssure updates in invalid cell 2020-12-01 10:27:44 +01:00
Joakim Hove
38c01e91e1 Improve error message for connection in inactive cell 2020-12-01 08:17:16 +01:00
Joakim Hove
a242b3abfa Merge pull request #2142 from joakim-hove/cache-parser-keyword
Cache parser keyword
2020-12-01 08:11:18 +01:00
Joakim Hove
e52e0914fb Merge pull request #2118 from joakim-hove/wbp
Wbp
2020-11-30 13:17:18 +01:00
Tor Harald Sandve
491d1d1f15 only compute glir for producers 2020-11-30 11:09:06 +01:00
Joakim Hove
53cd73c2d7 PAvgCalculator to calculate WBP? pressures 2020-11-30 10:42:15 +01:00
Tor Harald Sandve
e0f4337a9d Fix gaslift output
Use value from WCONPROD as default. The simulator does not set the alqvalue if gas optimization is not used
Multiply with efficiency factor when accumulation group rates
2020-11-30 10:11:26 +01:00
Joakim Hove
a6215ce107 Summary keyword ROEW is based on COPT and not WOPT 2020-11-29 13:46:26 +01:00
Joakim Hove
a42cd6433a Hold on to the ParserKeyword instance 2020-11-29 12:59:05 +01:00
Joakim Hove
c045891c4c Use fmtlib for output message 2020-11-29 12:58:10 +01:00
Joakim Hove
0dd522a105 Merge pull request #2140 from GitPaean/wsegaicd
correct the unit for STRENGTH for WSEGAICD
2020-11-28 07:30:16 +01:00
Kai Bao
5b867e135e removing extra WSEGSICD in keyword_list 2020-11-27 22:53:57 +01:00
Kai Bao
6f4f489d0a correct the unit for STRENGTH for WSEGAICD 2020-11-27 22:49:21 +01:00
Joakim Hove
e0a9bcc924 ACTIONX: Determine required summary keywords 2020-11-26 20:09:28 +01:00
Joakim Hove
678edf4497 Export static function to check month name validity 2020-11-26 20:09:28 +01:00
Joakim Hove
b6717fd685 Merge pull request #2133 from verveerpj/support_permr_and_permtht
Support PERMR and PERMTHT as aliases for PERMX and PERMY
2020-11-26 19:35:46 +01:00
Peter Verveer
479225f170 Add test to check PERMR/PERMTHT 2020-11-26 15:29:57 +01:00
Peter Verveer
3070696070 Support PERMR and PERMTHT aliases for PERMX and PERMY 2020-11-26 15:21:36 +01:00
Joakim Hove
e38252219f Pass the wells captured from ACTIONX to Schedule::handleWELPI() 2020-11-26 14:51:38 +01:00
Joakim Hove
718faaf43b Merge pull request #2135 from joakim-hove/inplace-at
Make sure original_inplace can be safely accessed
2020-11-26 14:31:26 +01:00
Joakim Hove
f395629dd5 Merge pull request #2131 from jalvestad/swel-cor
Correction of SWEL to handle zero rates in WCONHIST and WELOPEN SHUT
2020-11-26 14:07:32 +01:00
Arne Morten Kvarving
15ecabd6e1 Merge pull request #2136 from akva2/test-pypi
Some fixes to pypi packaging
2020-11-26 12:15:55 +01:00
Arne Morten Kvarving
edeef07018 remove unused file 2020-11-26 12:07:04 +01:00
Bård Skaflestad
e98872a543 Merge pull request #2137 from akva2/janitoring
add explicit defaults to quell warnings

Supersedes and closes #2134
2020-11-26 11:47:56 +01:00
Arne Morten Kvarving
e3a63c294b add explicit defaults to quell warnings 2020-11-26 11:27:31 +01:00
Joakim Hove
491d816656 Make sure ROEW summary keywords are evaluated last 2020-11-26 10:54:24 +01:00
Joakim Hove
77ec5ffa5d Make sure original_inplace can be safely accessed 2020-11-26 07:43:00 +01:00
Bård Skaflestad
a3df631aab Merge pull request #2128 from bska/wpi-smry-output
Support Outputting Preferred Phase PI to Summary File
2020-11-26 01:30:36 +01:00
Bård Skaflestad
0422f38d23 WPI Summary Output: Address Review Comments
Add an explicit case for 'OIL' and throw an exception if the
"preferred" phase is not supported.
2020-11-25 22:17:52 +01:00
Arne Morten Kvarving
b7fdffa12d disable building tests in pypi-packages 2020-11-25 12:20:02 +01:00
Arne Morten Kvarving
87698342d8 add export of build results from pypi docker 2020-11-25 11:57:10 +01:00
Arne Morten Kvarving
62bb1bc196 add python3.9 to pypi 2020-11-25 11:57:02 +01:00
Bård Skaflestad
a14c4184a9 Support Outputting Preferred Phase PI to Summary File
This commit adds support for outputting the productivity index of
a well's preferred phase at the well and connection levels to the
summary file (keywords 'WPI' and 'CPI').

Update unit tests accordingly.
2020-11-24 16:10:02 +01:00
Bård Skaflestad
a4e05aee47 Recognize Productivity Index Summary Config Node Type 2020-11-24 16:10:02 +01:00
Jostein Alvestad
fa1dbe2e28 rewriting of parts of SWEL code 2020-11-24 15:56:32 +01:00
Joakim Hove
08f8685bd1 Merge pull request #2127 from joakim-hove/summary-rhpv
Support summary keyword RHPV
2020-11-24 15:28:29 +01:00
Joakim Hove
9b0b03d6d3 Merge pull request #2126 from joakim-hove/udq-type-cast
Udq type cast
2020-11-24 14:28:25 +01:00
Joakim Hove
52df226da9 Merge pull request #2130 from bska/report-size-mismatch
Report Element Counts for Solution Vector Size Mismatch
2020-11-24 14:05:26 +01:00
Joakim Hove
ef5c51cee7 RHPV 2020-11-24 12:10:05 +01:00
Joakim Hove
b5012898d8 Merge pull request #2124 from joakim-hove/summary-roew
Summary roew
2020-11-24 11:49:11 +01:00
Joakim Hove
fa3b740d1d UDQ Cast can cast to both lhs type and rhs type 2020-11-24 11:48:17 +01:00
Joakim Hove
74cedd95e2 Add accessor to get UDQ assign objects 2020-11-24 11:48:17 +01:00
Bård Skaflestad
1c726b85c9 Use LIBFMT to Log Restart File Output
The library knows how to format 'std::tm{}' objects using format
strings from 'std::strftime()' which means we get month names for
free.

Existing report format:
    Restart file written for report step:  4/39.  Date: 2018/12/15

New report format:
    Restart file written for report step 4/39, date = 15-Dec-2018 00:00:00
2020-11-24 11:29:21 +01:00
Jostein Alvestad
b22334f08a correction of an unintended change in test_AggregateWellData.cpp 2020-11-24 10:54:58 +01:00
Jostein Alvestad
f2e32fa436 Added unit tests for corrections 2020-11-24 10:49:47 +01:00
Jostein Alvestad
366c0a544b corrections to SWEL for WCONHIST wells and shut wells 2020-11-23 15:53:45 +01:00
Bård Skaflestad
1fa5f3ce81 Report Element Counts for Solution Vector Size Mismatch
This makes it slightly easier to diagnose output errors.
2020-11-23 12:56:40 +01:00
Joakim Hove
12aa1f7c59 Start to implement ROEW 2020-11-23 11:02:02 +01:00
Joakim Hove
60920dd487 Ensure that WOPT is added to SummaryConfig when requesting ROEW 2020-11-23 11:02:02 +01:00
Joakim Hove
f7cb068f66 Add public get for UnitSystem from Schedule 2020-11-23 11:02:02 +01:00
Joakim Hove
8e83deef26 Merge pull request #2123 from joakim-hove/region-cache-wells
Add method RegionCache::wells()
2020-11-23 11:00:22 +01:00
Joakim Hove
0ff78a1bd6 Merge pull request #2125 from joakim-hove/serializer-vector
Serializer vector
2020-11-23 10:59:10 +01:00
Joakim Hove
174c16058c Changes in SummaryState deserialize: Use internal variables directly 2020-11-21 09:33:33 +01:00
Joakim Hove
c7e734ab41 Fix bug SummaryState::erase_xxx_var() 2020-11-21 09:33:33 +01:00
Joakim Hove
18d01d1999 Use ordered set for wells and groups member 2020-11-21 09:33:33 +01:00
Joakim Hove
25beb52f68 Add operator== to SummaryState 2020-11-21 09:33:33 +01:00
Joakim Hove
8f65921753 Add put_vector() and get_vector() methods to Serializer 2020-11-21 09:33:33 +01:00
Joakim Hove
3bc490b693 Add method RegionCache::wells()
The method RegionCache::wells() will output the wells with the first connection
in region region_id.
2020-11-21 08:58:39 +01:00
Joakim Hove
315d9d30e0 Rename put<K,T> and get<K,T> -> put_map() and get_map() 2020-11-20 15:47:52 +01:00
Joakim Hove
44d9261258 Merge pull request #2122 from joakim-hove/summary-oip
Add const Inplace& argument to Summary::eval()
2020-11-20 14:12:34 +01:00
Joakim Hove
7a0b020c43 Add Inplace argument to Summary::eval() 2020-11-20 12:42:30 +01:00
Bård Skaflestad
f190387431 Merge pull request #1522 from bska/output-preferred-phase
Restart File: Output Well's Preferred Phase
2020-11-20 00:59:33 +01:00
Bård Skaflestad
2fb768e727 Simplify Preferred Phase Extraction
Well::getPreferredPhase() now knows that the preferred phase for
injectors is the injected phase.  There is no need to special-case
injectors here.
2020-11-19 17:28:40 +01:00
Bård Skaflestad
c76878520a Load Well's Preferred Phase from Restart File 2020-11-19 17:28:40 +01:00
Bård Skaflestad
9a669f5400 Restart File: Output Well's Preferred Phase
Note: We're missing the 'LIQUID' option (integer value 4) since

    Well::getPreferredPhase()

does not return that value.

Also, while here, remove the previously misattributed IWEL[15] item.
This item is the well's preferred phase, not the prediction control.
Finally, don't assign the active control mode to the history control.
That was a mistake.
2020-11-19 17:28:40 +01:00
Joakim Hove
767f77e8c8 Merge pull request #2114 from joakim-hove/summary-oip
Add container to hold on to Original in place values
2020-11-19 17:12:51 +01:00
Joakim Hove
20be6aa6d9 Merge pull request #2121 from bska/fix-fmtout-segfault
Don't Overrun Formatting Buffer in 'doub_string_ecl'
2020-11-19 16:25:52 +01:00
Joakim Hove
bb3be75dc5 Add container class Inplace to manage aggregated region properties 2020-11-19 16:23:36 +01:00
Joakim Hove
955869e81d Merge pull request #2085 from joakim-hove/igrp-2
AggregateGroupData - refactoring
2020-11-19 16:23:14 +01:00
Bård Skaflestad
cdc1361a03 Don't Overrun Formatting Buffer in 'doub_string_ecl'
We would write outside the allocated buffer, and fail to write the
nul terminator, when presented with inputs of very small size
(denormalized numbers in the order of 1.0e-101 or smaller).  Switch
to using std::snprintf and expand the buffer size to work around
this problem.

While here, also fix a subtle issue in determining whether or not we
should insert the exponent character 'D' into the formatted output.
Since we add one upon formatting the number, we also need to use a
non-symmetric condition for the 'D' character lest we fail to output
correctly formatted versions of

    -2.9440373045442E-100 (=> -0.29440373045442D-99)
    -2.9440373045442E+99  (=> -0.29440373045442+100)
2020-11-19 11:46:37 +01:00
Joakim Hove
f2bdde4b73 Minor refactor 2020-11-19 11:42:17 +01:00
Joakim Hove
f64f8fd30e Remove code which just resets default value -1 2020-11-19 11:42:17 +01:00
Joakim Hove
25731a67dd Minor refactor of function 2020-11-19 11:42:17 +01:00
Joakim Hove
618595e538 Rewrite branching logic in AggregateGroupData 2020-11-19 11:42:17 +01:00
Joakim Hove
2ae5d6634d Use std::optional<Group> when searching upwards for control group 2020-11-19 11:42:17 +01:00
Joakim Hove
05814ad90e Simplified initialization 2020-11-19 11:42:17 +01:00
Joakim Hove
4ca4e865c9 Rename pctl_mode -> active_cmode 2020-11-19 11:42:17 +01:00
Joakim Hove
a65bb1e969 Rename prod_cmode -> deck_cmode 2020-11-19 11:42:17 +01:00
Joakim Hove
ee662f8e38 Store GroupProductionControls in local variable 2020-11-19 11:42:17 +01:00
Joakim Hove
b28ed60b02 Reactor function groupProductionControllable() 2020-11-19 11:42:17 +01:00
Joakim Hove
4e5cc1c94d Refactor function groupInjectionControllable() 2020-11-19 11:42:17 +01:00
Joakim Hove
2820efc463 Extract assignment of GCONPROD cmode to separate function 2020-11-19 11:42:17 +01:00
Joakim Hove
2b6ffeb068 Refactor IGRP StaticContrib 2020-11-19 11:42:17 +01:00
Joakim Hove
5746c068c5 Add names for group type and level index 2020-11-19 11:42:17 +01:00
Bård Skaflestad
5338a1dd13 Merge pull request #2120 from joakim-hove/summary-store-ref
Store references to EclipseState and Schedule in Summary class
2020-11-19 11:00:06 +01:00
Joakim Hove
bd766a0277 Store references to EclipseState and Schedule in Summary class 2020-11-19 07:19:57 +01:00
Tor Harald Sandve
506ce18537 Merge pull request #2012 from osae/kwPVTEXTBO
New kw PVTSOL to accomodate an extension of the black oil model.
2020-11-18 14:00:43 +01:00
Joakim Hove
b8179b943d Merge pull request #2115 from joakim-hove/all-connections-inactive
Automatically shut wells with no connections
2020-11-18 06:49:35 +01:00
Joakim Hove
e2cdd4d5e1 Merge pull request #2117 from joakim-hove/summaryconfig-rhpv
Load summary keyword RHPV_xxx
2020-11-17 22:20:46 +01:00
Joakim Hove
61c879e8cb Load summary keyword RHPV_xxx 2020-11-17 15:15:26 +01:00
Joakim Hove
91275cc0a5 Automatically shut wells with no connections 2020-11-17 14:55:48 +01:00
Joakim Hove
785a14dd25 Merge pull request #2116 from akva2/janitoring
fixed: initializer list order
2020-11-17 13:28:29 +01:00
Arne Morten Kvarving
ec2294ee77 fixed: initializer list order 2020-11-17 12:21:29 +01:00
Joakim Hove
8ffb918650 Merge pull request #2112 from joakim-hove/udq-update
Support UDQ UPDATE
2020-11-17 10:31:47 +01:00
Arne Morten Kvarving
a5a521e295 Merge pull request #2103 from akva2/build_flow_poly
build flow_poly on jenkins
2020-11-17 09:49:26 +01:00
Ove Sævareid
e489f1aced Serialize PvtsolTable. 2020-11-16 20:18:05 +01:00
Ove Sævareid
58aa93dcfe New kw PVTSOL to accomodate an extension of the back oil model. 2020-11-16 20:18:05 +01:00
Joakim Hove
c46488236a Merge pull request #2110 from joakim-hove/actionx-welpi
Actionx welpi
2020-11-16 18:12:53 +01:00
Joakim Hove
278c2182bd Handle WELPI keyword in ACTIONX blocks 2020-11-16 16:55:34 +01:00
Joakim Hove
e4ab6c43ce Merge pull request #2107 from joakim-hove/rrpv
Rrpv
2020-11-16 10:37:12 +01:00
Joakim Hove
bd9df4ec54 Merge pull request #2111 from joakim-hove/warnings
Warnings
2020-11-16 10:36:08 +01:00
Joakim Hove
ed5ed62203 Parse summary keyword ROEW_xxx 2020-11-16 07:12:59 +01:00
Joakim Hove
b2da0228b1 Support UDQ UPDATE action 2020-11-15 10:03:34 +01:00
Joakim Hove
e0e5ed1f91 Make sure UDQ can use also special summary values like TIME 2020-11-15 10:02:34 +01:00
Joakim Hove
e9e56fc5b5 Remove constructor declaration without implementation 2020-11-15 10:00:36 +01:00
Joakim Hove
25739a846c Suppress unused warning with (void) 2020-11-13 18:08:24 +01:00
Joakim Hove
7f2c06f5b0 Fix serialization object 2020-11-13 18:03:15 +01:00
Joakim Hove
e35febde59 Merge pull request #2108 from joakim-hove/actionx-gconinje
Hanlde GCONINJE in ACTIONX block
2020-11-13 17:48:05 +01:00
Joakim Hove
27883b8a3c Merge pull request #2105 from GitPaean/aqunum_activating_cells
AQUNUM can activate inactive cells
2020-11-13 17:23:14 +01:00
Kai Bao
72d3346ab8 Numerical aquifer cells need to be active
even the cells are disabled with ACTNUM
2020-11-13 11:18:48 +01:00
Joakim Hove
e8cb3f37e0 Hanlde GCONINJE in ACTIONX block 2020-11-13 08:48:11 +01:00
Joakim Hove
54cae0f07e Merge pull request #2095 from joakim-hove/nnc-location
Nnc location
2020-11-13 08:26:30 +01:00
Joakim Hove
c3b6da7bc3 Add RRPV as summary variable 2020-11-13 08:20:28 +01:00
Joakim Hove
cfbafc236a Allow deck_names in ParserKeyword to be interpreted as regexp 2020-11-13 08:19:43 +01:00
Joakim Hove
5c30077cd4 Merge pull request #2101 from joakim-hove/wpave
Internalize WPAVE and WWPAVE keywords
2020-11-13 07:00:14 +01:00
Joakim Hove
d4513d214f Internalize WPAVE and WWPAVE keywords 2020-11-12 23:59:10 +01:00
Joakim Hove
0fdc36d433 Merge pull request #2104 from GitPaean/correcting_aqucon_definition
correcting the definition of the keyword AQUCON
2020-11-12 16:19:20 +01:00
Kai Bao
c2b48ed34b correcting the definition of the keyword AQUCON
mostly related to default value.

default_value is used, while it looks like not working.
2020-11-12 14:01:39 +01:00
Arne Morten Kvarving
d6212f4a8b build flow_poly on jenkins 2020-11-12 11:12:19 +01:00
Bård Skaflestad
893fcbb9fb Merge pull request #2100 from joakim-hove/intehead51
Update INTEHEAD[51] value based on presence of GCONPROD / GCONINJE
2020-11-11 23:44:09 +01:00
Joakim Hove
37b71e8be5 Skip NNCEDIT with multiplier = 1 2020-11-11 19:57:06 +01:00
Joakim Hove
e61e7afcc8 Refactor the NNC input class
- The NNC and EDITNNC keywords are internalized in the same class.
- The EDITNNC keyword operations are applied directly to the NNC keywords.
- The nnc vectors are ordered with cell1 < cell2 and ascending order.
- An api has been added to get the KeywordLocation from an NCC
- NNC/EDITNNC which is connected to inactive cell is ignored
2020-11-11 19:57:06 +01:00
Joakim Hove
08f8a381b0 Update INTEHEAD[51] value based on presence of GCONPROD / GCONINJE 2020-11-11 19:56:28 +01:00
Joakim Hove
2374ae2127 Merge pull request #2102 from bska/cxl-support-dynamic-connections
CxL: Account for Dynamically Changing Set of Connections
2020-11-11 19:31:15 +01:00
Bård Skaflestad
c157760ac7 CxL: Account for Dynamically Changing Set of Connections
This commit adds a new helper function

    getCompletionNumberFromGlobalConnectionIndex

which returns an optional<int> containing the completion number of
the connection with the associated global cell index, or nullopt if
no such connection exists.  We then reimplement the CxL summary
keywords in terms of this function to handle connections being added
dynamically during the simulation.  The connections at the end of
the simulation, from which we configure all connection-related
summary nodes, might not accurately reflect the connections existing
at all times during the simulation.
2020-11-11 16:04:08 +01:00
Joakim Hove
71b5dea35e Merge pull request #2096 from tskille/io_c0nn
Update of EclIO classes.
2020-11-11 08:18:26 +01:00
Torbjørn Skille
9fa90b2687 Update of EclIO classes.
- Enables reading of output files generated by simulator IX
 - Adding support for EclFile data type C0nn (string with length > 8 characters)
 - Update of program summary, now supporting well names with more that 8 characters
 - Updates of program convertECL, possible to write output files with IX "format"
 - updates of python bindings (EclOutput and EclFile)
2020-11-10 22:02:38 +01:00
Bård Skaflestad
3d928b8a7f Merge pull request #2099 from bska/fix-oob-indexing
Summary: Don't Index Out-of-Bounds During Node Configuration
2020-11-10 11:55:40 +01:00
Bård Skaflestad
f5fb6bc047 Summary: Don't Index Out-of-Bounds During Node Configuration
The 'schedule_wells' vector is guaranteed to be empty when we're
configuring the set of summary vectors to report.  Don't blindly
access the .front() element.
2020-11-10 11:15:17 +01:00
Joakim Hove
3a1f5bd654 Merge pull request #2077 from joakim-hove/actionx-gliftopt
Actionx gliftopt
2020-11-10 09:36:21 +01:00
Joakim Hove
f3d6c3abe4 Support GCONLIFT in ACTIONX 2020-11-09 17:15:17 +01:00
Joakim Hove
7dd50935d1 Refactor ACTIONX testing to use a make_schedule() setup function 2020-11-09 17:15:17 +01:00
Joakim Hove
ada1f9d144 Add Schedule handler overload for GLIFTOPT - to support ACTIONX 2020-11-09 17:15:17 +01:00
Joakim Hove
6aefc2c17a Add reqiures: ["LIFTOPT"] to GLIFTOPT keyword 2020-11-09 17:14:15 +01:00
Joakim Hove
cddfbb5217 Merge pull request #2075 from joakim-hove/actionx-gconprod
Actionx gconprod
2020-11-09 16:40:40 +01:00
Joakim Hove
22bf627d7b Merge pull request #2098 from joakim-hove/ijk-warning
Fix shadow warning
2020-11-09 15:39:48 +01:00
Joakim Hove
f85884db71 Fix shadow warning 2020-11-09 14:41:16 +01:00
Joakim Hove
d896b2ce15 Support GCONPROD in ACTIONX 2020-11-09 14:34:47 +01:00
Joakim Hove
bb905eb545 Merge pull request #2059 from joakim-hove/summary-completion
Summary completion
2020-11-09 14:33:10 +01:00
Joakim Hove
5337306a55 Add summary evaluation for CxxxL connection completion keywords 2020-11-09 13:23:02 +01:00
Joakim Hove
523e099580 Add summary evaluation for WxxxL well completion keywords 2020-11-09 13:23:02 +01:00
Joakim Hove
2a6b623dcb Optionally strip off trailing __XX when looking for summary function 2020-11-09 13:23:02 +01:00
Joakim Hove
1dc6545bab Trivial white space 2020-11-09 13:23:02 +01:00
Joakim Hove
b9b918defa Add summary configuration for WxxxL and CxxxL completion keywords 2020-11-09 13:23:02 +01:00
Joakim Hove
e625623e49 Remove WGORL from WELL_PROBE configuration file 2020-11-09 12:47:25 +01:00
Joakim Hove
624ff50628 Merge pull request #2086 from joakim-hove/group-is-field
Add method Group::is_field()
2020-11-09 12:47:07 +01:00
Joakim Hove
84a2c3c209 Add method Group::is_field() 2020-11-09 12:46:30 +01:00
Joakim Hove
558cd2c1f7 Merge pull request #2088 from joakim-hove/welltype-injection-phase
Add method WellType::injection_phase()
2020-11-09 12:45:34 +01:00
Joakim Hove
c414aa52a9 Merge pull request #2089 from joakim-hove/udq-minus-bugx
Udq minus bugx
2020-11-07 14:58:45 +01:00
Joakim Hove
315187b8d6 Merge pull request #2093 from akva2/fix_system_header
workaround cmake issue
2020-11-06 11:10:15 +01:00
Arne Morten Kvarving
fac6695d15 workaround cmake issue
cmake does not properly interpret the SYSTEM marker in lists of
include directories. this causes issues downstream when using
dunecontrol / the in-tree cmake config files.
2020-11-06 10:16:02 +01:00
Joakim Hove
515a9ef258 Merge pull request #2090 from akva2/bump_version
bump version to 2021.04-pre
2020-11-06 09:11:29 +01:00
Arne Morten Kvarving
a194c8a1fc bump version to 2021.04-pre 2020-11-06 08:57:04 +01:00
Joakim Hove
47543641ee Testing of negative prefix 2020-11-05 15:38:23 +01:00
Joakim Hove
2b24fba2c5 Merge pull request #2078 from joakim-hove/gliftopt-has
Add methods GasLiftOpt::has_well() and GasLiftOpt::has_group()
2020-11-05 12:41:21 +01:00
Joakim Hove
f5631549bf Merge pull request #2074 from joakim-hove/handlercontext-units
Make section and keyword index optional in Schedule handlerContext
2020-11-05 12:40:53 +01:00
Joakim Hove
25dee84f81 Merge pull request #2073 from joakim-hove/summary-completion-commits
Summary completion commits
2020-11-05 12:40:06 +01:00
Joakim Hove
ef39f6a817 Merge pull request #2071 from joakim-hove/WWIRT
Add summary variable WWIRT
2020-11-05 12:39:45 +01:00
Joakim Hove
a383f55cf5 Add method WellType::injection_phase() 2020-11-05 12:32:24 +01:00
Joakim Hove
c883e738f0 Merge pull request #2087 from OPM/revert-2082-igrp-prod
Revert "Igrp prod"
2020-11-05 12:27:02 +01:00
Joakim Hove
57566ad768 Revert "Igrp prod" 2020-11-05 11:15:20 +01:00
Joakim Hove
f16375f5ee Merge pull request #2082 from joakim-hove/igrp-prod
Igrp prod
2020-11-04 15:41:35 +01:00
Joakim Hove
7c1b2ff6b4 Simplified initialization 2020-11-04 14:13:44 +01:00
Joakim Hove
c392c5aaa2 Rename pctl_mode -> active_cmode 2020-11-04 14:13:44 +01:00
Joakim Hove
861be5d672 Rename prod_cmode -> deck_cmode 2020-11-04 14:13:44 +01:00
Joakim Hove
73f550ddb3 Store GroupProductionControls in local variable 2020-11-04 14:13:44 +01:00
Joakim Hove
6402ee098e Reactor function groupProductionControllable() 2020-11-04 14:13:44 +01:00
Joakim Hove
f32a3badc2 Refactor function groupInjectionControllable() 2020-11-04 14:13:44 +01:00
Joakim Hove
5738e60432 Add method WellType::injection_phase() 2020-11-04 14:13:44 +01:00
Joakim Hove
46bf4e394a Extract assignment of GCONPROD cmode to separate function 2020-11-04 09:56:09 +01:00
Joakim Hove
ce50cd5d3e Refactor IGRP StaticContrib 2020-11-04 09:07:47 +01:00
Joakim Hove
f508c23750 Add names for group type and level index 2020-11-04 08:45:24 +01:00
Joakim Hove
d88017def9 Merge pull request #2080 from joakim-hove/rst-commits
Rst commits
2020-11-04 07:25:51 +01:00
Joakim Hove
13c60d2008 Attach TUNING_CHANGE event to the correct report step 2020-11-03 21:09:48 +01:00
Joakim Hove
28d1256683 Change message when loading restart date 2020-11-03 21:09:48 +01:00
Joakim Hove
857617c0ef Cast to avoid warning 2020-11-03 21:09:48 +01:00
Joakim Hove
c392c24b6d Use named index/offset when assembling group result 2020-11-03 21:09:48 +01:00
Joakim Hove
fd7723ca61 Use const for local variables 2020-11-03 21:09:48 +01:00
Joakim Hove
6324b666c9 White space changes 2020-11-03 21:09:48 +01:00
Joakim Hove
da0ed1450e RstGroup: use raw values for rates which should enter UDA 2020-11-03 21:09:48 +01:00
Joakim Hove
4d5b4a9815 Add function converting from integer to GuideRateTarget 2020-11-03 20:38:26 +01:00
Joakim Hove
37443b8c38 Merge pull request #2079 from bska/expand-block-probe
Recognize Additional Relperm Keywords per Block
2020-11-03 14:37:18 +01:00
Bård Skaflestad
85cbe8c745 Recognize Additional Relperm Keywords per Block
The BKROG and BKROW keywords are the two-phase relative permeabilites
for oil in oil/gas and oil/water systems (per block.)
2020-11-03 12:45:00 +01:00
Joakim Hove
6c449a48b1 Merge pull request #2069 from joakim-hove/udq-wlist
Udq wlist
2020-11-03 11:22:02 +01:00
Joakim Hove
19090c2827 Add methods GasLiftOpt::has_well() and GasLiftOpt::has_group() 2020-11-03 08:47:15 +01:00
Joakim Hove
064559b9e4 Add UnitSystem member to Schedule class
Mkae Section and KeywordIndex members in HandleContext optional.
2020-11-02 21:27:18 +01:00
Bård Skaflestad
1d73d07f19 Merge pull request #2076 from joakim-hove/rm-printf
Remove extra printf
2020-11-02 19:19:10 +01:00
Joakim Hove
30bbee6e69 Merge pull request #2072 from alfbr/new-line
Added newline where natural.
2020-11-02 16:40:13 +01:00
Joakim Hove
7b8590f7ee Remove extra printf 2020-11-02 16:37:56 +01:00
Joakim Hove
5316d193ea White space 2020-11-02 14:44:05 +01:00
Joakim Hove
f3e9a02123 Add additional connection in testdata 2020-11-02 14:44:05 +01:00
Joakim Hove
64b9a49a20 Use multiline string literal for test data 2020-11-02 14:44:05 +01:00
Joakim Hove
f02437cdcb Use name based lookup in function getijk() 2020-11-02 14:44:05 +01:00
Joakim Hove
7d596e4e41 Make function parseKeyworType() in SummaryConfig public 2020-11-02 14:44:05 +01:00
Joakim Hove
a8f5dc6354 Add SummaryConfig::operator[](const std::size_t index) 2020-11-02 14:12:05 +01:00
Joakim Hove
0805249185 Merge pull request #2070 from joakim-hove/get-completion-connection
Get connections from global index
2020-11-02 14:04:05 +01:00
Alf Birger Rustad
a2cfd9a525 Added newline where natural. 2020-11-02 13:43:13 +01:00
Joakim Hove
855decfa56 Add summary variable WWIRT 2020-11-02 10:29:31 +01:00
Joakim Hove
5193cc48c6 Merge pull request #2067 from joakim-hove/group-uda
Group uda
2020-11-02 10:05:18 +01:00
Joakim Hove
9844b73bdb Add functions to get/query connections from global index 2020-11-02 07:57:19 +01:00
Joakim Hove
14df089f14 Use WellMatcher() in Schedule::wellNames() 2020-10-31 09:04:32 +01:00
Joakim Hove
7ef7e3017e Add class WellMatcher and use it UDQ evaluation 2020-10-30 22:17:59 +01:00
Joakim Hove
9bec2673ad Explicitly delete UDAValue::operator=() 2020-10-30 17:19:02 +01:00
Joakim Hove
f34f221be8 Properly initialize UDA values for group production and injection 2020-10-30 17:19:02 +01:00
Joakim Hove
d27e31ee84 Merge pull request #2062 from joakim-hove/summary-config-extra
Use general datatype for extra data in summary keywords
2020-10-30 17:18:23 +01:00
Joakim Hove
3a8694fee1 Merge pull request #2064 from bska/deferred-welpi-uconv
Defer Unit Conversion for WELPI Values
2020-10-30 17:18:06 +01:00
Bård Skaflestad
94af88c3a1 Switch Back to Consuming Strictly SI Convention PI Values
Heed advice from [at]joakim-hove to keep client code as close to
strictly SI as possible.  We must nevertheless continue to store the
raw (input/output units) requested PI value internally as this is
the only way to ensure that both the client and implementation has
consistent view of the well's preferred phase.  This means pushing
the unit conversion into Well::getWellPIScalingFactor().

Thanks to [at]joakim-hove for pointing out that the Well already
maintains an internal UnitSystem data member which makes the process
of converting the PI units trivial.
2020-10-30 15:16:31 +01:00
Bård Skaflestad
354351daee Record General Event When Processing WELPI
This commit ensures that we record a general, Schedule-level

    WELL_PRODUCTIVITY_INDEX

event in addition to the well-specific event already recorded when
we encounter a WELPI keyword.  We need this information in order to
trigger a PI calculation across all MPI processes in opm-simulators.
2020-10-30 15:16:31 +01:00
Bård Skaflestad
54e2eb5597 Store Raw WELPI in Well::productivity_index
This makes the interface less convenient to use, but it is the only
way to guarantee that we have a consistent notion of preferred phase
for injectors.  The downside is that the users of

    Well::getWellPIScalingFactor()

must convert the argument to raw/input units before calling the
function.
2020-10-30 15:16:31 +01:00
Bård Skaflestad
6f124fb478 Revert "Capture Preferred Phase When Processing WELPI Keyword"
There and back again.  We don't actually need the preferred phase at
the time of encountering the WELPI request.  [at]joakim-hove was
right, the preferred phase of an injector must reflect the state at
the same report step as the WELPI keyword.  In other words, if the
injected phase is reset at the same report step as a WELPI keyword,
then the new preferred phase must be that of the new injected phase.

This reverts commit 3eef45e87d.
2020-10-30 15:16:31 +01:00
Bård Skaflestad
038c2bd2e0 Merge pull request #2068 from bska/msw-allconn
MSW: Support Connection Results for All Connections
2020-10-30 14:24:22 +01:00
Joakim Hove
279871df05 Add missing #include 2020-10-30 13:36:08 +01:00
Bård Skaflestad
62a39877be Address Review Comments
Add comments on a function and rename a variable.
2020-10-30 11:47:11 +01:00
Bård Skaflestad
14c566d99b MSW: Support Connection Results for All Connections
The current code that aggregates flow rates from connection to
segment levels assumes that the simulator generates connection
results for the open connections only.  Relax this restriction as
upcoming work in the context of WELPI will require generating at
least the CTFs even for shut connections.
2020-10-30 11:37:31 +01:00
Joakim Hove
e613a7c31d Use std::optional<std::string> for fip_region member 2020-10-30 11:30:05 +01:00
Joakim Hove
96f9362f59 Merge pull request #2066 from joakim-hove/rst-pressure-drop-model
Load MSW pressure drop model fro restart file
2020-10-30 11:07:58 +01:00
Joakim Hove
78b544afdf Merge pull request #2063 from joakim-hove/completion-util
Add function bool Well::hasCompletion( int )
2020-10-30 10:17:34 +01:00
Joakim Hove
00af07ceed Load MSW pressure drop model fro restart file 2020-10-29 11:34:56 +01:00
Bård Skaflestad
8d3e419162 Merge pull request #2065 from joakim-hove/meta-error-message
Improve error message for unhandled meta summary keyword
2020-10-29 10:25:48 +01:00
Joakim Hove
c83e4820bc Improve error message for unhandled meta summary keyword 2020-10-29 08:57:25 +01:00
Joakim Hove
ed5d20d90e Add utility functions to query/get completion data 2020-10-28 16:00:56 +01:00
Joakim Hove
03efa3d2e1 Merge pull request #2060 from goncalvesmachadoc/outtemp
add extra thermal summary keywords
2020-10-28 14:26:22 +01:00
Joakim Hove
24a9dbf4c6 Merge pull request #2058 from joakim-hove/rst-commits2
Rst commits2
2020-10-28 14:24:59 +01:00
Cintia Goncalves Machado
957d5d3840 add extra thermal summary keywords 2020-10-28 13:28:37 +01:00
Markus Blatt
e5f191ede8 Merge pull request #2038 from blattms/fix-scotch-parmetis
[cmake] Use scotch include dir for parmetis bindings of scotch.
2020-10-28 12:28:50 +01:00
Joakim Hove
1f7ec57895 Use named constants in IGRP access 2020-10-27 20:50:12 +01:00
Joakim Hove
92bf4a96ea Separately load active and requested group control from restart file
Use named constants for access to IGRP vector
2020-10-27 20:48:03 +01:00
Joakim Hove
30a897e89d Merge pull request #2047 from joakim-hove/gconprod-item10
Blank string is default rate in GCONPROD
2020-10-27 19:50:14 +01:00
Joakim Hove
e5519c456c Merge pull request #2050 from joakim-hove/udq-cast-error
Improve error message for invalid udq_cast()
2020-10-27 19:49:51 +01:00
Joakim Hove
a90feb6bb7 Blank string is default rate in GCONPROD 2020-10-27 18:51:36 +01:00
Joakim Hove
d301274e89 Improve warning for UDQ missing unit 2020-10-27 18:50:47 +01:00
Joakim Hove
4f02dc5173 Add try catch block around UDQ eval 2020-10-27 18:50:47 +01:00
Joakim Hove
82afbf070c Improve error message for invalid udq_cast() 2020-10-27 18:50:47 +01:00
Joakim Hove
0f28d7c199 Merge pull request #2051 from joakim-hove/improve-udq-error-message
Improve error message for failed udq
2020-10-27 18:28:28 +01:00
Joakim Hove
404e2b095e Merge pull request #2048 from joakim-hove/thp-uda
Thp uda
2020-10-27 18:26:59 +01:00
Joakim Hove
2a41058eda Merge pull request #2039 from joakim-hove/rst-tstep
Allow restart date to be at a TSTEP
2020-10-27 18:24:08 +01:00
Joakim Hove
9011ca0e78 Merge pull request #2049 from joakim-hove/udq-leading-sign
Udq leading sign
2020-10-27 17:05:02 +01:00
Joakim Hove
716b4d3bf1 Remove special casing of leading '-' in UDQ parsing 2020-10-27 14:17:12 +01:00
Joakim Hove
e9dadcf93e Extract leading sign when extract UDQ factor 2020-10-27 14:17:12 +01:00
Joakim Hove
0994a1a2fe Add sign member to UDQASTNode and implement operator* 2020-10-27 14:17:12 +01:00
Joakim Hove
524e211247 Merge pull request #2056 from joakim-hove/udq-extra-ficup
Store extra summary parameters from UDQ and restart in common map
2020-10-27 14:16:02 +01:00
Atgeirr Flø Rasmussen
3c1e3b5a30 Merge pull request #2054 from joakim-hove/groups-active-cmode
Rename group production control mode variable
2020-10-27 11:52:42 +01:00
Joakim Hove
8e44859c48 Merge pull request #2055 from bska/fix-wpil-smry
Don't Treat WPIL as Completion Keyword
2020-10-27 08:53:50 +01:00
Joakim Hove
5cb8dfdca0 Store extra summary parameters from UDQ and restart in common map 2020-10-27 08:50:56 +01:00
Bård Skaflestad
509b15a243 Don't Treat WPIL as Completion Keyword
WPIL is the productivity index of liquid (water + oil).
2020-10-27 00:07:38 +01:00
Joakim Hove
45c784f8d8 Add Group active_cmode 2020-10-26 21:01:16 +01:00
Joakim Hove
a81eb8f9d4 Use Group::gconprod_cmode() in AggregateGroupData 2020-10-26 20:47:09 +01:00
Joakim Hove
8e0928cc9d Rename group production control mode variable 2020-10-26 18:46:48 +01:00
Bård Skaflestad
e38b8f5812 Merge pull request #2053 from joakim-hove/fglir
Summary function glir should sum over all argument wells
2020-10-26 15:57:02 +01:00
Joakim Hove
70353f496d Allow restart date to be at a TSTEP 2020-10-26 15:10:10 +01:00
Joakim Hove
908eebb7ed Summary function glir should sum over all argument wells 2020-10-26 15:06:00 +01:00
Joakim Hove
548bed1dc8 Improve error message for failed udq 2020-10-26 11:57:09 +01:00
Joakim Hove
cab2e29724 Merge pull request #2044 from joakim-hove/include-udq-summary
Include udq summary
2020-10-26 11:18:56 +01:00
Joakim Hove
c1a65ef7da Merge pull request #2046 from joakim-hove/udqdefine-location
Udqdefine location
2020-10-26 10:31:32 +01:00
Joakim Hove
de51e3e3a4 Check that UDQ value is numeric before comparing with zero 2020-10-25 19:16:50 +01:00
Joakim Hove
604cbef5dc USe fmt::format() for error message 2020-10-25 19:12:51 +01:00
Joakim Hove
eb208ffb78 Remove unused UDQDefine constructor 2020-10-24 12:48:43 +02:00
Joakim Hove
5e6c6be3b8 Add location member to UDQDefine 2020-10-24 12:47:55 +02:00
Joakim Hove
508b4e6f96 Scan UDQ expressions to extract required summary keywords 2020-10-24 10:15:58 +02:00
Joakim Hove
5c1604c5f2 Merge pull request #2045 from joakim-hove/include-udq-summary-commits
Include udq summary commits
2020-10-24 10:15:30 +02:00
Bård Skaflestad
9fc6948e05 Merge pull request #2042 from joakim-hove/well-reperf
Changes to well reference depth
2020-10-23 16:49:08 +02:00
Joakim Hove
3fa4c4bbb1 Publish function SummaryConfig::parseKeywordType() 2020-10-23 16:05:55 +02:00
Joakim Hove
b53acbc6a7 Add functionality to extract required summary keys from UDQConfig 2020-10-23 16:05:55 +02:00
Joakim Hove
faa1e7dc4d Add function to return pointers to all unique UDQConfig objects 2020-10-23 16:05:55 +02:00
Joakim Hove
b4388ba203 Merge pull request #2040 from joakim-hove/udq-left-assoc
Ensure that division is left assosiative in UDQ parser
2020-10-23 16:04:45 +02:00
Joakim Hove
b9bd1598d7 Changes to well reference depth
1. The well reference depth should *not* be updated when new connections are
   added with COMPDAT.

2. The well reference depth should be recalculated when the well is updated with
   the WELSPECS keyword.
2020-10-23 15:25:38 +02:00
Joakim Hove
58e859fb11 Merge pull request #2043 from joakim-hove/eclipsegrid-remove-test
Remove not interesting test code
2020-10-22 20:23:47 +02:00
Joakim Hove
0a0f30133d Remove not interesting test code 2020-10-22 18:52:05 +02:00
Joakim Hove
7a21769ca1 Merge pull request #2041 from akva2/janitoring
quell unused parameter warning
2020-10-22 17:22:24 +02:00
Arne Morten Kvarving
be84d23da4 quell unused parameter warning 2020-10-22 14:53:25 +02:00
Joakim Hove
80a023794e Ensure that division is left assosiative in UDQ parser 2020-10-22 14:40:32 +02:00
Joakim Hove
4a806533db Merge pull request #1915 from goncalvesmachadoc/addSpyderwebGrid
add Spiderweb grid
2020-10-22 14:08:01 +02:00
Joakim Hove
d9a7d6326f Merge pull request #2033 from joakim-hove/rst-group-commits
Rst group commits
2020-10-22 09:25:56 +02:00
Joakim Hove
f6077809c7 Init GuideRateModel from restart file 2020-10-22 08:18:47 +02:00
Joakim Hove
5a91c73b8e Merge pull request #2035 from joakim-hove/igrp-guide-rate
Igrp guide rate
2020-10-22 08:06:56 +02:00
Joakim Hove
0894f7e774 Merge pull request #2032 from joakim-hove/MULTIREG
Multireg
2020-10-22 08:06:37 +02:00
Joakim Hove
ee7f50a51d Merge pull request #2037 from joakim-hove/udq-define-order
Make sure UDQ define statements are evaluated in definition order
2020-10-21 17:32:55 +02:00
Markus Blatt
8951ff3130 [cmake] Use scotch include dir for parmetis bindings of scotch.
The parmetis.h distributed via the parmetis binding of scotch
with Ubuntu 18.04 (libscotchparmetis-dev) includes the header
scotch.h located in /usr/include/scotch/. Therefore our check
of the include file failed. With this commit we check the
parmetis.h header another time with the scotch include path added.
Now parmetis is found on my Ubuntu.
2020-10-21 14:36:39 +02:00
Joakim Hove
85f7380721 Merge pull request #2030 from joakim-hove/default-group
Use optional - and default to self - for reinj and voidage groups
2020-10-21 13:58:07 +02:00
Joakim Hove
413a16157c Make sure UDQ define statements are evaluated in definition order 2020-10-21 13:49:07 +02:00
Joakim Hove
ba4082b2b9 Merge pull request #2034 from joakim-hove/udq-assign-define
Udq assign define
2020-10-21 11:45:41 +02:00
Joakim Hove
3f2e41ba99 Add member guide_rate_def to Group object loaded from restart file 2020-10-21 10:31:44 +02:00
Joakim Hove
c8efb7fd3b Use named constants when saving GuideRate defintion to IGRP 2020-10-21 09:47:16 +02:00
Joakim Hove
67f24bd3a7 When loading from restart: set wells active control also for SHUT 2020-10-20 22:48:08 +02:00
Joakim Hove
5c6fa9cc51 Add Group update events after loading from restart file 2020-10-20 22:46:28 +02:00
Joakim Hove
2bc338e87f Add functions converting integer group control modes to enum 2020-10-20 22:44:01 +02:00
Joakim Hove
b72460f0c8 Remove unused members from rst header class 2020-10-20 22:43:49 +02:00
Joakim Hove
2289ba165b Update SummaryState in UDQContext 2020-10-20 22:22:21 +02:00
Joakim Hove
313f576e37 Ensure that UDQDefine::eval returns nodes with correct name 2020-10-20 20:45:59 +02:00
Joakim Hove
5ff65747f3 Rename summary variable in test 2020-10-20 20:02:19 +02:00
Joakim Hove
ab43f54076 Export undefined value from UDQState 2020-10-20 19:44:15 +02:00
Joakim Hove
bf2f049a4b Merge pull request #2031 from bska/schedule-apply-wellpi
Apply WELPI CTF Scaling at Schedule Level
2020-10-20 12:05:05 +02:00
Bård Skaflestad
ab51949909 Address Code Review Comments
Use more complete object name and fix up a comment.
2020-10-20 11:14:03 +02:00
Joakim Hove
158c7376d7 Add test for MULTIREG and COPYREG keywords 2020-10-20 08:22:42 +02:00
Joakim Hove
eb7cb2f94a Bug in COPYEREG keyword - look up wrong item 2020-10-20 08:22:22 +02:00
Bård Skaflestad
91bb168ee5 Fix Shadowing Type Alias
The local 'WellPI' type alias shadowed the name of the test.
2020-10-19 21:16:55 +02:00
Bård Skaflestad
5b4a1c0bad Remove WELL_CONNECTIONS_UPDATED Event
With the introduction of Schedule::applyWellProdIndexScaling(), this
special-purpose event type is no longer needed and only causes
confusion.
2020-10-19 19:16:17 +02:00
Bård Skaflestad
26ef5d01a2 Apply WELPI CTF Scaling at Schedule Level
This commit adds a new member function

  applyWellProdIndexScaling(well_name, report_step, scalingFactor)

which applies WELPI-based CTF scaling (by scalingFactor) for all
pertinent report steps from 'report_step' and until the end of the
simulation run.  We use the 'scalingApplicable' array to communicate
connection eligibility between report steps and only apply the
scaling if the internal connections pointers differ between report
steps.
2020-10-19 19:16:16 +02:00
Bård Skaflestad
cfa5dd80cc Enable Applying WELPI CTF Scaling Across Time Direction
This commit adds a new in/out parameter, scalingApplicable, to the
applyWellProdIndexScaling functions.  This parameter carries time
(history) information on whether or not a particular connection is
eligible for WELPI-based CTF scaling.  Entries are marked ineligible
(false) and left untouched on subsequent calls if the corresponding
connection is ineligible at any point--e.g., as a result of new
COMPDAT entries.

This ability enables implementing WELPI CTF scaling at the Schedule
level which is the only level that has sufficient time information
to identify all the unique Well/WellConnections object combinations.
2020-10-19 19:16:15 +02:00
Bård Skaflestad
338a48708a Add Special Predicate to Check if Two Wells Have Same Connections
This commit adds a new special purpose predicate member function

    bool Well::hasSameConnectionsPointers

which checks if the internal WellConnections pointers of two Well
objects (*this and the input argument) point to the same object.
This, in turn, enables identifying when to apply dynamic WELPI CTF
scaling across the time direction the internalized connection
information.
2020-10-19 19:16:15 +02:00
Bård Skaflestad
dabf988aa7 Split WELPI Application Into Two Parts
First part, implemented in a new member function

    Well::getWellPIScalingFactor

calculates a CTF scaling factor from stored WELPI information and a
dynamically calculated well-level PI value.  The second part, using
the original name applyWellProdIndexScaling, applies an externally
calculate CTF scaling factor to all eligble connections.

This is needed to enable applying multiple scalings across the time
direction.  Update unit tests accordingly.
2020-10-19 19:16:12 +02:00
Joakim Hove
452c222f71 Merge pull request #2018 from bska/preferred-is-injected
Use Injected Phase as Preferred Phase for Injectors
2020-10-19 18:03:52 +02:00
Joakim Hove
d545359395 Use optional - and default to self - for reinj and voidage groups 2020-10-19 17:07:00 +02:00
Bård Skaflestad
641b9fb4b1 Merge pull request #2029 from joakim-hove/udq-function-rename
Renamed UDQ functions: MIN -> UDQ_MIN and MAX -> UDQ_MAX
2020-10-19 14:28:44 +02:00
Joakim Hove
63e0eb385a Renamed UDQ functions: MIN -> UDQ_MIN and MAX -> UDQ_MAX 2020-10-19 13:09:40 +02:00
Bård Skaflestad
3eef45e87d Capture Preferred Phase When Processing WELPI Keyword
This is to handle the case of an injector changing its injected (and
therefore preferred) phase (e.g., in WCONINJE or WCONINJH) at the
same report step as a WELPI CTF rescaling, but logically after the
WELPI action is applied.

For instance, this happens in the following setup:

    WCONINJH
       INJ2   WATER   OPEN  5500 /
    /

    DATES
      1 'JAN' 2020 /
    /

    WELPI
      'INJ2' 0.1E5 /
    /

    WCONINJH
       INJ2   GAS   OPEN   701627 /
    /

    DATES
      1 'FEB' 2020 /
    /

In this case, the WELPI for 'INJ2' is supposed to be interpreted as
the water-phase PI (preferred phase is 'WATER' when we read WELPI),
but since the injecting phase is reset to 'GAS' at the same report
step we risk misinterpreting the PI as pertaining to the 'GAS' phase
when calculating the well's effective/dynamic PI in the simulator if
we just use Well::getPreferredPhase().

Switch the the well's input PI from an optional<double> to an
optional<struct> that captures both the input PI value (SI units)
and the preferred phase when processing the WELPI data.  Provide a
way to query that information from the simulator and update unit
tests accordingly.
2020-10-19 11:09:00 +02:00
Bård Skaflestad
f84858279f WELPI: Don't Inadvertently Overwrite Scaling Eligiblity
Since the Well stores a pointer to its connections, rather than the
connections themselves, we must take care not change the existing
state of the connections' WELPI eligibility flag.  Do the update
check on a copy of the connections instead of the real connections.

Pointy Hat: [at]bska
2020-10-19 11:08:59 +02:00
Bård Skaflestad
f718cc1adc Injectors: Ensure "Preferred" Phase is "Injected" Phase
This needed to correctly interpret WELPI values when wells switch
from injecting Water to injecting Gas or the other way around.
2020-10-19 11:08:59 +02:00
Arne Morten Kvarving
ebc562887c Merge pull request #2028 from atgeirr/silence-warning
Silence shadowing warnings.
2020-10-19 10:32:52 +02:00
Atgeirr Flø Rasmussen
fd59f1685a Silence shadowing warnings. 2020-10-19 09:06:38 +02:00
Joakim Hove
fd1cc74f74 Merge pull request #2026 from joakim-hove/multflt-messages
Message limits for MULTFLT and Tracer
2020-10-16 16:02:09 +02:00
Joakim Hove
b05680f76b Merge pull request #2023 from joakim-hove/alq-dimension
Alq dimension
2020-10-16 14:27:43 +02:00
Joakim Hove
64165f072a Rename summary function -> glir 2020-10-16 12:16:33 +02:00
Joakim Hove
8ffc4b85b0 Add a comment warning in Summary evaluation of WGLIR 2020-10-16 12:16:33 +02:00
Joakim Hove
134834cefa Pass VFP ALQ type to enable unit conversion for ALQ values 2020-10-16 12:16:33 +02:00
Joakim Hove
3e02a48c10 Convert VFP dimensions without parsing dimension string 2020-10-16 12:16:33 +02:00
Joakim Hove
2644e3bd78 Add test (safety belt) for VFP dimension conversion 2020-10-16 12:16:33 +02:00
Joakim Hove
d004bfdc76 Merge pull request #2025 from joakim-hove/udq-allow-missing-well
Udq allow missing well
2020-10-16 12:16:01 +02:00
Joakim Hove
c696cee549 Limit the number of messages emitted while loading tracer tables 2020-10-16 11:27:33 +02:00
Joakim Hove
0587e11112 Limit the number of MULTFLT messages 2020-10-16 11:27:33 +02:00
Joakim Hove
9c49468f46 Create small utility class InfoLogger 2020-10-16 11:27:33 +02:00
Joakim Hove
d9f260dd51 Add utility KeywordLocation::format() 2020-10-16 11:27:33 +02:00
Joakim Hove
9ea86a9bbc Remove unused function 2020-10-16 11:27:33 +02:00
Joakim Hove
451eefbda5 UDQContext - differentiate between missing well and invalid variable 2020-10-16 11:24:21 +02:00
Joakim Hove
c11d2eee37 Merge pull request #2024 from joakim-hove/summary-state-has-well-var
Add SummaryState functions has_well_var() and has_group_var()
2020-10-16 11:23:12 +02:00
Joakim Hove
78c07a4e2a Merge pull request #2022 from joakim-hove/fmwia-fixup
Count of abondoned wells should handle both STOP and SHUT
2020-10-16 11:22:37 +02:00
Joakim Hove
0cdfdca0f7 Add SummaryState functions has_well_var() and has_group_var() 2020-10-15 13:01:52 +02:00
Joakim Hove
a2f72f0953 Count of abondoned wells should handle both STOP and SHUT 2020-10-14 16:08:11 +02:00
Peter Verveer
7e64686b77 Remove or disable tests for RADIAL.
These failed due to replacing support for RADIAL by SPIDER.
2020-10-06 18:26:13 +02:00
Cintia Goncalves Machado
296fa9ed51 updateSpider 2020-09-11 14:49:33 +02:00
Cintia Goncalves Machado
2ca0985057 addSpiderweb 2020-09-10 17:01:13 +02:00
2154 changed files with 370561 additions and 35693 deletions

View File

@@ -1,5 +1,5 @@
project(opm-common C CXX)
cmake_minimum_required (VERSION 2.8)
cmake_minimum_required (VERSION 3.10)
option(SIBLING_SEARCH "Search for other modules in sibling directories?" ON)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
@@ -9,8 +9,8 @@ option(ENABLE_ECL_INPUT "Enable eclipse input support?" ON)
option(ENABLE_ECL_OUTPUT "Enable eclipse output support?" ON)
option(ENABLE_MOCKSIM "Build the mock simulator for io testing" ON)
option(OPM_ENABLE_PYTHON "Enable python bindings?" OFF)
option(OPM_INSTALL_PYTHON "Enable python bindings?" OFF)
option(OPM_ENABLE_EMBEDDED_PYTHON "Enable python bindings?" OFF)
option(OPM_INSTALL_PYTHON "Install python bindings?" ON)
option(OPM_ENABLE_EMBEDDED_PYTHON "Enable embedded python?" OFF)
# Output implies input
if(ENABLE_ECL_OUTPUT)
@@ -42,11 +42,13 @@ set(OPM_PROJECT_EXTRA_CODE_INTREE "#ENABLE_ECL_INPUT is needed by opm-common-pre
if(ENABLE_ECL_OUTPUT)
set(OPM_PROJECT_EXTRA_CODE_INSTALLED "${OPM_PROJECT_EXTRA_CODE_INSTALLED}
set(COMPARE_ECL_COMMAND ${CMAKE_INSTALL_PREFIX}/bin${${name}_VER_DIR}/compareECL)
set(OPM_PACK_COMMAND ${CMAKE_INSTALL_PREFIX}/bin${${name}_VER_DIR}/opmpack)")
set(OPM_PACK_COMMAND ${CMAKE_INSTALL_PREFIX}/bin${${name}_VER_DIR}/opmpack)
set(RST_DECK_COMMAND ${CMAKE_INSTALL_PREFIX}/bin${${name}_VER_DIR}/rst_deck)")
set(OPM_PROJECT_EXTRA_CODE_INTREE "${OPM_PROJECT_EXTRA_CODE_INTREE}
set(COMPARE_ECL_COMMAND ${PROJECT_BINARY_DIR}/bin/compareECL)
set(OPM_PACK_COMMAND ${PROJECT_BINARY_DIR}/bin/opmpack)")
set(OPM_PACK_COMMAND ${PROJECT_BINARY_DIR}/bin/opmpack)
set(RST_DECK_COMMAND ${PROJECT_BINARY_DIR}/bin/rst_deck)")
endif()
# project information is in dune.module. Read this file and set variables.
@@ -64,6 +66,27 @@ include(Findopm-tests)
# with the find module
include (${project}-prereqs)
if(ENABLE_ECL_INPUT)
# source_hook runs before config_hook and the former needs fmt, hence this
# needs to be here.
if(fmt_FOUND)
# OpmSatellites will not add the library, do it here.
list(APPEND opm-common_LIBRARIES fmt::fmt)
else()
add_definitions(-DFMT_HEADER_ONLY)
include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/external/fmtlib/include)
# Not sure why this is needed.
list(APPEND EXTRA_INCLUDES ${PROJECT_SOURCE_DIR}/external/fmtlib/include)
endif()
endif()
if(OPM_ENABLE_EMBEDDED_PYTHON AND NOT OPM_ENABLE_PYTHON)
# This needs to be here to run before source_hook
message(WARNING "Inconsistent settings: OPM_ENABLE_PYTHON=OFF and "
"OPM_ENABLE_EMBEDDED_PYTHON=ON. Please use OPM_ENABLE_PYTHON=ON to "
"activate. Will disable embedded python in this run.")
set(OPM_ENABLE_EMBEDDED_PYTHON OFF CACHE BOOL "Enable embedded python?" FORCE)
endif()
# read the list of components from this file (in the project directory);
# it should set various lists with the names of the files to include
include (CMakeLists_files.cmake)
@@ -75,10 +98,7 @@ macro (config_hook)
endif()
# For this project
add_definitions(-DFMT_HEADER_ONLY)
list(APPEND EXTRA_INCLUDES SYSTEM ${PROJECT_SOURCE_DIR}/external/fmtlib/include)
include_directories(${EXTRA_INCLUDES} ${PROJECT_BINARY_DIR}/include)
# For downstreams
list(APPEND EXTRA_INCLUDES ${PROJECT_BINARY_DIR}/include)
set(OPM_PROJECT_EXTRA_CODE_INTREE "${OPM_PROJECT_EXTRA_CODE_INTREE}
@@ -96,8 +116,7 @@ macro (config_hook)
set(HAVE_ECL_OUTPUT 1)")
endif()
# Configure boost targets for old cmake
include(cmake/Modules/BoostTargets.cmake)
find_package(Boost COMPONENTS filesystem regex system unit_test_framework)
if (HAVE_DYNAMIC_BOOST_TEST)
set_target_properties(Boost::unit_test_framework PROPERTIES INTERFACE_COMPILE_DEFINITIONS BOOST_TEST_DYN_LINK=1)
@@ -118,8 +137,11 @@ macro (sources_hook)
foreach (name A B C D E F G H I J K L M N O P Q R S T U V W X Y Z)
list(INSERT opm-common_SOURCES 0 ${PROJECT_BINARY_DIR}/ParserKeywords/${name}.cpp)
endforeach()
if (OPM_ENABLE_EMBEDDED_PYTHON)
list(INSERT opm-common_SOURCES 0 ${PROJECT_BINARY_DIR}/python/cxx/builtin_pybind11.cpp)
endif()
endif()
set_source_files_properties(src/opm/parser/eclipse/Python/Python.cpp
set_source_files_properties(src/opm/input/eclipse/Python/Python.cpp
PROPERTIES COMPILE_FLAGS -Wno-shadow)
endmacro (sources_hook)
@@ -148,10 +170,70 @@ endmacro (install_hook)
# OpmnLibMain function. Here only the library dependency is implemented, the
# bulk of the python configuration is further down in the file.
if (OPM_ENABLE_PYTHON)
find_package(PythonInterp REQUIRED)
if (OPM_ENABLE_EMBEDDED_PYTHON)
find_package(PythonLibs REQUIRED)
list(APPEND opm-common_LIBRARIES ${PYTHON_LIBRARY})
# We need to be compatible with older CMake versions
# that do not offer FindPython3
# e.g. Ubuntu LTS 18.04 uses cmake 3.10
if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
find_package(PythonInterp REQUIRED)
if (OPM_ENABLE_EMBEDDED_PYTHON)
find_package(PythonLibs REQUIRED)
list(APPEND opm-common_LIBRARIES ${PYTHON_LIBRARIES})
endif()
if(PYTHON_VERSION_MAJOR LESS 3)
message(SEND_ERROR "OPM requires version 3 of Python but only version ${PYTHON_VERSION_STRING} was found")
endif()
set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
set(Python3_LIBRARIES ${PYTHON_LIBRARIES})
else()
# Be backwards compatible.
if(PYTHON_EXECUTABLE AND NOT Python3_EXECUTABLE)
set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
endif()
if (OPM_ENABLE_EMBEDDED_PYTHON)
find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
get_target_property(_lib_path Python3::Python IMPORTED_LOCATION)
set(PYTHON_LIBRARY ${_lib_path})
set(PYTHON_LIBRARIES {PYTHON_LIBRARY})
list(APPEND opm-common_LIBRARIES ${PYTHON_LIBRARY})
set(PYTHON_INCLUDE_DIRS ${Python3_INCLUDE_DIRS})
else()
find_package(Python3 REQUIRED COMPONENTS Interpreter)
endif()
# Make sure we fail gracefully here without setuptool
execute_process(COMMAND ${Python3_EXECUTABLE} -c "import setuptools"
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
ERROR_VARIABLE SETUPTOOL_ERROR OUTPUT_VARIABLE SETUPTOOL_OUT
RESULT_VARIABLE SETUPTOOL_RESULT)
if(SETUPTOOL_RESULT GREATER 0)
message(WARNING "Trying to test setuptools resulted in error message: ${SETUPTOOL_ERROR}")
message(SEND_ERROR "To build the python bindings you need to install setuptool. "
"Either use \"apt-get install python3-setuptools\" (on Debian/Ubuntu) "
"or \"pip install setuptools\"")
endif()
# Compatibility settings for PythonInterp and PythonLibs
# used e.g. in FindCwrap, pybind11
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
endif()
# We always need the PYTHON_INCLUDE_DIR. Unfortunately
# When we build pypi packages CMake will fail to determine
# these via the usual find_package(PythonLibs or
# find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
# Hence we overwrite them here.
if(NOT PYTHON_INCLUDE_DIRS)
execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" "from distutils import sysconfig; print(sysconfig.get_python_inc(plat_specific=True), end=\"\");"
RESULT_VARIABLE _PYTHON_DIR_SUCCESS
OUTPUT_VARIABLE PYTHON_INCLUDE_DIR
ERROR_VARIABLE _PYTHON_ERROR_VALUE)
if(NOT _PYTHON_DIR_SUCCESS MATCHES 0)
message(FATAL_ERROR "Could not determine Python include directory. Error: ${_PYTHON_ERROR_VALUE}.")
endif()
set(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR})
endif()
find_package(pybind11 2.2 CONFIG)
if (NOT pybind11_FOUND)
# Use full path for reuse with pypi
set(pybind11_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/python/pybind11/include ${PYTHON_INCLUDE_DIRS})
endif()
endif()
@@ -196,7 +278,15 @@ if(ENABLE_ECL_INPUT)
test_util/summary.cpp
)
foreach(target compareECL convertECL summary)
add_executable(arraylist
test_util/arraylist.cpp
)
add_executable(rewriteEclFile
test_util/rewriteEclFile.cpp
)
foreach(target compareECL convertECL summary rewriteEclFile arraylist)
target_link_libraries(${target} opmcommon)
install(TARGETS ${target} DESTINATION bin)
endforeach()
@@ -230,28 +320,47 @@ if(ENABLE_ECL_INPUT)
${PROJECT_BINARY_DIR}/tests
)
foreach(test test_EclIO test_EGrid test_ERft test_ERst test_ESmry)
opm_add_test(${test} CONDITION ENABLE_ECL_INPUT AND Boost_UNIT_TEST_FRAMEWORK_FOUND
LIBRARIES ${_libs}
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/tests)
endforeach()
endif()
# Install build system files
install(DIRECTORY cmake DESTINATION share/opm)
# Install build system files and documentation
install(DIRECTORY cmake
DESTINATION share/opm USE_SOURCE_PERMISSIONS
PATTERN "OPM-CMake.md" EXCLUDE)
install(FILES cmake/OPM-CMake.md
DESTINATION ${CMAKE_INSTALL_DOCDIR})
# Install tab completion skeleton
install(FILES etc/opm_bash_completion.sh.in DESTINATION share/opm/etc)
if (OPM_ENABLE_PYTHON)
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "
import site, sys
try:
sys.stdout.write(site.getsitepackages()[-1])
except e:
sys.stdout.write('')" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES_PATH)
# -------------------------------------------------------------------------
# 1: Wrap C++ functionality in Python
if (EXISTS "/etc/debian_version")
if (PYTHON_SITE_PACKAGES_PATH MATCHES ".*/dist-packages/?" AND
CMAKE_INSTALL_PREFIX MATCHES "^/usr.*")
# dist-packages is only used if we install below /usr and python's site packages
# path matches dist-packages
set(PYTHON_PACKAGE_PATH "dist-packages")
else()
set(PYTHON_PACKAGE_PATH "site-packages")
endif()
set(PYTHON_INSTALL_PREFIX "lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/${PYTHON_PACKAGE_PATH}" CACHE STRING "Subdirectory to install Python modules in")
if(PYTHON_VERSION_MAJOR)
set(PY_MAJOR ${PYTHON_VERSION_MAJOR})
else()
set(PY_MAJOR ${Python3_VERSION_MAJOR})
endif()
if(PYTHON_VERSION_MINOR)
set(PY_MINOR ${PYTHON_VERSION_MINOR})
else()
set(PY_MINOR ${Python3_VERSION_MINOR})
endif()
set(PYTHON_INSTALL_PREFIX "lib/python${PY_MAJOR}.${PY_MINOR}/${PYTHON_PACKAGE_PATH}" CACHE STRING "Subdirectory to install Python modules in")
make_directory(${PROJECT_BINARY_DIR}/python)
get_target_property(_opmcommon_include_dirs opmcommon INCLUDE_DIRECTORIES)
@@ -275,7 +384,12 @@ if (OPM_ENABLE_PYTHON)
endif()
if (BUILD_SHARED_LIBS)
list(APPEND _python_rpath_list "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
if (OPM_INSTALL_PYTHON)
list(APPEND _python_rpath_list "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
list(APPEND _python_rpath_list "${PROJECT_BINARY_DIR}/lib")
else()
list(APPEND _python_rpath_list "${PROJECT_BINARY_DIR}/lib")
endif()
endif()
if (_python_rpath_list)
@@ -291,19 +405,45 @@ if (OPM_ENABLE_PYTHON)
set(opm-common_PYTHON_PACKAGE_VERSION ${OPM_PYTHON_PACKAGE_VERSION_TAG})
# Generate versioned setup.py
if (pybind11_INCLUDE_DIRS)
string(REGEX REPLACE ";" "', '" _tmp "${pybind11_INCLUDE_DIRS}")
set(SETUP_PY_PYBIND_INCLUDE_DIR "'${_tmp}'")
endif()
if (TARGET fmt::fmt)
get_target_property(SETUP_PY_FMT_LIBS fmt::fmt LOCATION)
get_target_property(FMT_FLAGS fmt::fmt INTERFACE_COMPILE_DEFINITIONS)
foreach(flag ${FMT_FLAGS})
set(SETUP_PY_FMT_FLAGS "${SETUP_PY_FMT_FLAGS} '-D${flag}',")
endforeach()
list(APPEND opm-common_PYTHON_LINKAGE "'${SETUP_PY_FMT_LIBS}'")
else()
set(SETUP_PY_FMT_FLAGS "'-DFMT_HEADER_ONLY'")
endif()
if(cjson_FOUND)
list(APPEND opm-common_PYTHON_LINKAGE "'${cjson_LIBRARIES}'")
endif()
# opm-common_PYTHON_LINKAGE is used verbatim in a listin python.
# Hence items need to be comma separated.
if (opm-common_PYTHON_LINKAGE)
string(REPLACE ";" "," SETUP_PY_LINKAGE "${opm-common_PYTHON_LINKAGE}")
endif()
configure_file (${PROJECT_SOURCE_DIR}/python/setup.py.in ${PROJECT_BINARY_DIR}/python/setup.py)
file(COPY ${PROJECT_SOURCE_DIR}/python/README.md DESTINATION ${PROJECT_BINARY_DIR}/python)
execute_process(COMMAND ${PYTHON_EXECUTABLE} target_name.py
execute_process(COMMAND ${Python3_EXECUTABLE} target_name.py
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/python
OUTPUT_VARIABLE python_lib_target)
add_custom_target(copy_python ALL
COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/python/install.py ${PROJECT_SOURCE_DIR}/python ${PROJECT_BINARY_DIR} 0)
COMMAND ${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/python/install.py ${PROJECT_SOURCE_DIR}/python ${PROJECT_BINARY_DIR} 0)
add_custom_command(OUTPUT python/opm/${python_lib_target}
DEPENDS ${PYTHON_CXX_DEPENDS}
DEPENDS copy_python
COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_BINARY_DIR}/python/setup.py
COMMAND ${Python3_EXECUTABLE} ${PROJECT_BINARY_DIR}/python/setup.py
build
build_ext
--build-lib=${PROJECT_BINARY_DIR}/python
@@ -327,7 +467,7 @@ if (OPM_ENABLE_PYTHON)
# setup.py install manually - optionally with the generated script
# setup-install.sh - and completely bypass cmake in the installation phase.
if (OPM_INSTALL_PYTHON)
install( CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_BINARY_DIR}/python/install.py ${PROJECT_BINARY_DIR}/python/opm ${DEST_PREFIX}${CMAKE_INSTALL_PREFIX}/${PYTHON_INSTALL_PREFIX} 1)")
install( CODE "execute_process(COMMAND ${Python3_EXECUTABLE} ${PROJECT_BINARY_DIR}/python/install.py ${PROJECT_BINARY_DIR}/python/opm ${DEST_PREFIX}${CMAKE_INSTALL_PREFIX}/${PYTHON_INSTALL_PREFIX} 1)")
endif()
# Observe that if the opmcommon library has been built as a shared library the
@@ -335,7 +475,7 @@ if (OPM_ENABLE_PYTHON)
# testing.
add_test(NAME python_tests
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/python
COMMAND ${CMAKE_COMMAND} -E env LD_LIBRARY_PATH=${PROJECT_BINARY_DIR}/lib ${PYTHON_EXECUTABLE} setup.py build_ext --dry-run --build-lib ${PROJECT_BINARY_DIR}/python test
COMMAND ${CMAKE_COMMAND} -E env LD_LIBRARY_PATH=${PROJECT_BINARY_DIR}/lib ${Python3_EXECUTABLE} setup.py build_ext --dry-run --build-lib ${PROJECT_BINARY_DIR}/python test
)
set_target_properties(opmcommon PROPERTIES POSITION_INDEPENDENT_CODE ON)
@@ -368,11 +508,12 @@ if (OPM_ENABLE_PYTHON)
# -------------------------------------------------------------------------
# 2: Embed the Python interpreter for keywords like PYACTION and PYINPUT
target_include_directories(opmcommon SYSTEM PRIVATE "${pybind11_INCLUDE_DIRS}")
if (OPM_ENABLE_EMBEDDED_PYTHON)
add_subdirectory(python/pybind11)
target_include_directories(opmcommon SYSTEM PRIVATE "python/pybind11/include;${PYTHON_INCLUDE_DIRS}")
target_link_libraries(opmcommon PUBLIC ${PYTHON_LIBRARY})
add_definitions(-DEMBEDDED_PYTHON)
endif()
endif()
install(DIRECTORY docs/man1 DESTINATION ${CMAKE_INSTALL_MANDIR}
FILES_MATCHING PATTERN "*.1")

File diff suppressed because it is too large Load Diff

View File

@@ -6,14 +6,24 @@ execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
${BASE_DIR}/tmp_gen/TestKeywords.cpp
${BASE_DIR}/TestKeywords.cpp)
if (EXISTS ${BASE_DIR}/python/cxx)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
${BASE_DIR}/tmp_gen/builtin_pybind11.cpp
${BASE_DIR}/python/cxx/builtin_pybind11.cpp)
endif()
file(GLOB HDRS ${BASE_DIR}/tmp_gen/include/opm/parser/eclipse/Parser/ParserKeywords/*.hpp)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
${BASE_DIR}/tmp_gen/include/opm/input/eclipse/Parser/ParserKeywords/Builtin.hpp
${BASE_DIR}/include/opm/input/eclipse/Parser/ParserKeywords/Builtin.hpp)
file(GLOB HDRS ${BASE_DIR}/tmp_gen/include/opm/input/eclipse/Parser/ParserKeywords/*.hpp)
foreach(HDR ${HDRS})
file(RELATIVE_PATH hdr ${BASE_DIR}/tmp_gen/include/opm/parser/eclipse/Parser/ParserKeywords ${HDR})
file(RELATIVE_PATH hdr ${BASE_DIR}/tmp_gen/include/opm/input/eclipse/Parser/ParserKeywords ${HDR})
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
${HDR}
${BASE_DIR}/include/opm/parser/eclipse/Parser/ParserKeywords/${hdr})
${BASE_DIR}/include/opm/input/eclipse/Parser/ParserKeywords/${hdr})
endforeach()

View File

@@ -18,13 +18,13 @@ set(_testdir ${PROJECT_SOURCE_DIR}/tests/parser/data)
opm_add_test(ParserTests
SOURCES tests/parser/ParserTests.cpp
LIBRARIES ${TEST_LIBS}
TEST_ARGS ${_testdir}/)
TEST_ARGS -- ${_testdir}/)
list(APPEND EXTRA_TESTS ParserTests)
opm_add_test(ParserIncludeTests
SOURCES tests/parser/ParserIncludeTests.cpp
LIBRARIES ${TEST_LIBS}
TEST_ARGS ${_testdir}/parser/)
TEST_ARGS -- ${_testdir}/parser/)
target_compile_definitions(ParserIncludeTests PRIVATE
-DHAVE_CASE_SENSITIVE_FILESYSTEM=${HAVE_CASE_SENSITIVE_FILESYSTEM})
list(APPEND EXTRA_TESTS ParserIncludeTests)
@@ -32,23 +32,21 @@ list(APPEND EXTRA_TESTS ParserIncludeTests)
opm_add_test(PvtxTableTests
SOURCES tests/parser/PvtxTableTests.cpp
LIBRARIES ${TEST_LIBS}
TEST_ARGS ${_testdir}/integration_tests/)
TEST_ARGS -- ${_testdir}/integration_tests/)
list(APPEND EXTRA_TESTS PvtxTableTests)
opm_add_test(EclipseStateTests
SOURCES tests/parser/EclipseStateTests.cpp
LIBRARIES ${TEST_LIBS}
TEST_ARGS ${_testdir}/integration_tests/)
TEST_ARGS -- ${_testdir}/integration_tests/)
list(APPEND EXTRA_TESTS EclipseStateTests)
foreach (test BoxTest
CheckDeckValidity
EclipseGridCreateFromDeck
EDITNNCTests
IncludeTest
IntegrationTests
IOConfigIntegrationTest
NNCTests
ParseKEYWORD
Polymer
ScheduleCreateFromDeck
@@ -57,7 +55,7 @@ foreach (test BoxTest
opm_add_test(${test}
SOURCES tests/parser/integration/${test}.cpp
LIBRARIES ${TEST_LIBS}
TEST_ARGS ${_testdir}/integration_tests/)
TEST_ARGS -- ${_testdir}/integration_tests/)
list(APPEND EXTRA_TESTS ${test})
endforeach ()
@@ -71,6 +69,20 @@ opm_add_test( rst_msw
LIBRARIES ${TEST_LIBS}
TEST_ARGS tests/MSW.DATA tests/MSW_RESTART.DATA )
add_test( NAME rst_deck_test
COMMAND ${PROJECT_SOURCE_DIR}/tests/rst_test_driver.sh ${PROJECT_BINARY_DIR}/bin/rst_deck ${PROJECT_BINARY_DIR}/bin/opmhash
${PROJECT_SOURCE_DIR}/tests/SPE1CASE2_INCLUDE.DATA)
add_test( NAME rst_deck_test2
COMMAND ${PROJECT_SOURCE_DIR}/tests/rst_test_driver2.sh
${PROJECT_BINARY_DIR}/bin/rst_deck
${PROJECT_BINARY_DIR}/bin/opmi
${PROJECT_SOURCE_DIR}/tests/ACTIONX_M1.DATA
${PROJECT_SOURCE_DIR}/tests/ACTIONX_M1_MULTIPLE.DATA
${PROJECT_SOURCE_DIR}/tests/ACTIONX_M1.UNRST
${PROJECT_SOURCE_DIR}/tests/ACTIONX_M1.X0010 )
# opm-tests dependent tests
if(HAVE_OPM_TESTS)
opm_add_test(parse_write ONLY_COMPILE
@@ -91,7 +103,6 @@ if(HAVE_OPM_TESTS)
${OPM_TESTS_ROOT}/spe9/SPE9_CP.DATA
${OPM_TESTS_ROOT}/spe9/SPE9_CP_GROUP.DATA
${OPM_TESTS_ROOT}/spe9/SPE9_CP_SHORT.DATA
${OPM_TESTS_ROOT}/spe9/SPE9_CP_SHORT_RESTART.DATA
${OPM_TESTS_ROOT}/spe9/SPE9.DATA
${OPM_TESTS_ROOT}/spe10model1/SPE10_MODEL1.DATA
${OPM_TESTS_ROOT}/spe10model2/SPE10_MODEL2.DATA
@@ -115,8 +126,17 @@ if(HAVE_OPM_TESTS)
opm_add_test("SPE9_CP_GROUP2" NO_COMPILE EXE_NAME parse_write TEST_ARGS "${OPM_TESTS_ROOT}/spe9group/SPE9_CP_GROUP.DATA")
set_property(TEST NORNE_ATW2013
PROPERTY ENVIRONMENT "OPM_ERRORS_IGNORE=PARSE_RANDOM_SLASH")
add_test( NAME rst_deck_test_norne
COMMAND ${PROJECT_SOURCE_DIR}/tests/rst_test_driver.sh ${PROJECT_BINARY_DIR}/bin/rst_deck ${PROJECT_BINARY_DIR}/bin/opmhash
${OPM_TESTS_ROOT}/norne/NORNE_ATW2013.DATA)
set_property(TEST rst_deck_test_norne
PROPERTY ENVIRONMENT "OPM_ERRORS_IGNORE=PARSE_RANDOM_SLASH")
endif()
# JSON tests
opm_add_test(jsonTests
SOURCES tests/json/jsonTests.cpp

View File

@@ -1,26 +1,29 @@
set(genkw_SOURCES src/opm/json/JsonObject.cpp
src/opm/parser/eclipse/Parser/createDefaultKeywordList.cpp
src/opm/parser/eclipse/Deck/UDAValue.cpp
src/opm/parser/eclipse/Deck/DeckValue.cpp
src/opm/parser/eclipse/Deck/Deck.cpp
src/opm/parser/eclipse/Deck/DeckItem.cpp
src/opm/parser/eclipse/Deck/DeckKeyword.cpp
src/opm/parser/eclipse/Deck/DeckRecord.cpp
src/opm/parser/eclipse/Deck/DeckOutput.cpp
src/opm/parser/eclipse/Generator/KeywordGenerator.cpp
src/opm/parser/eclipse/Generator/KeywordLoader.cpp
src/opm/parser/eclipse/Parser/ErrorGuard.cpp
src/opm/parser/eclipse/Parser/ParseContext.cpp
src/opm/parser/eclipse/Parser/ParserEnums.cpp
src/opm/parser/eclipse/Parser/ParserItem.cpp
src/opm/parser/eclipse/Parser/ParserKeyword.cpp
src/opm/parser/eclipse/Parser/ParserRecord.cpp
src/opm/parser/eclipse/Parser/raw/RawKeyword.cpp
src/opm/parser/eclipse/Parser/raw/RawRecord.cpp
src/opm/parser/eclipse/Parser/raw/StarToken.cpp
src/opm/parser/eclipse/Units/Dimension.cpp
src/opm/parser/eclipse/Units/UnitSystem.cpp
src/opm/input/eclipse/Parser/createDefaultKeywordList.cpp
src/opm/input/eclipse/Deck/UDAValue.cpp
src/opm/input/eclipse/Deck/DeckTree.cpp
src/opm/input/eclipse/Deck/DeckValue.cpp
src/opm/input/eclipse/Deck/Deck.cpp
src/opm/input/eclipse/Deck/DeckView.cpp
src/opm/input/eclipse/Deck/DeckItem.cpp
src/opm/input/eclipse/Deck/DeckKeyword.cpp
src/opm/input/eclipse/Deck/DeckRecord.cpp
src/opm/input/eclipse/Deck/DeckOutput.cpp
src/opm/input/eclipse/Generator/KeywordGenerator.cpp
src/opm/input/eclipse/Generator/KeywordLoader.cpp
src/opm/input/eclipse/Parser/ErrorGuard.cpp
src/opm/input/eclipse/Parser/ParseContext.cpp
src/opm/input/eclipse/Parser/ParserEnums.cpp
src/opm/input/eclipse/Parser/ParserItem.cpp
src/opm/input/eclipse/Parser/ParserKeyword.cpp
src/opm/input/eclipse/Parser/ParserRecord.cpp
src/opm/input/eclipse/Parser/raw/RawKeyword.cpp
src/opm/input/eclipse/Parser/raw/RawRecord.cpp
src/opm/input/eclipse/Parser/raw/StarToken.cpp
src/opm/input/eclipse/Units/Dimension.cpp
src/opm/input/eclipse/Units/UnitSystem.cpp
src/opm/common/utility/OpmInputError.cpp
src/opm/common/utility/shmatch.cpp
src/opm/common/OpmLog/OpmLog.cpp
src/opm/common/OpmLog/Logger.cpp
src/opm/common/OpmLog/StreamLog.cpp
@@ -35,13 +38,20 @@ add_executable(genkw ${genkw_SOURCES})
target_link_libraries(genkw ${opm-common_LIBRARIES})
# Generate keyword list
include(src/opm/parser/eclipse/share/keywords/keyword_list.cmake)
string(REGEX REPLACE "([^;]+)" "${PROJECT_SOURCE_DIR}/src/opm/parser/eclipse/share/keywords/\\1" keyword_files "${keywords}")
configure_file(src/opm/parser/eclipse/keyword_list.argv.in keyword_list.argv)
include(src/opm/input/eclipse/share/keywords/keyword_list.cmake)
string(REGEX REPLACE "([^;]+)" "${PROJECT_SOURCE_DIR}/src/opm/input/eclipse/share/keywords/\\1" keyword_files "${keywords}")
configure_file(src/opm/input/eclipse/keyword_list.argv.in keyword_list.argv)
# Generate keyword source
add_custom_command( OUTPUT
set( genkw_argv keyword_list.argv
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords
${PROJECT_BINARY_DIR}/tmp_gen/ParserInit.cpp
${PROJECT_BINARY_DIR}/tmp_gen/include/
opm/input/eclipse/Parser/ParserKeywords
${PROJECT_BINARY_DIR}/tmp_gen/TestKeywords.cpp)
set( _tmp_output
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/A.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/B.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/C.cpp
@@ -68,18 +78,11 @@ add_custom_command( OUTPUT
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/X.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/Y.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/Z.cpp
${PROJECT_BINARY_DIR}/tmp_gen/TestKeywords.cpp
COMMAND genkw keyword_list.argv
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords
${PROJECT_BINARY_DIR}/tmp_gen/ParserInit.cpp
${PROJECT_BINARY_DIR}/tmp_gen/include/
opm/parser/eclipse/Parser/ParserKeywords
${PROJECT_BINARY_DIR}/tmp_gen/TestKeywords.cpp
DEPENDS genkw ${keyword_files} src/opm/parser/eclipse/share/keywords/keyword_list.cmake
)
${PROJECT_BINARY_DIR}/tmp_gen/ParserInit.cpp
${PROJECT_BINARY_DIR}/tmp_gen/TestKeywords.cpp)
# To avoid some rebuilds
add_custom_command(OUTPUT
set( _target_output
${PROJECT_BINARY_DIR}/ParserKeywords/A.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/B.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/C.cpp
@@ -107,7 +110,24 @@ add_custom_command(OUTPUT
${PROJECT_BINARY_DIR}/ParserKeywords/Y.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/Z.cpp
${PROJECT_BINARY_DIR}/TestKeywords.cpp
${PROJECT_BINARY_DIR}/ParserInit.cpp
DEPENDS ${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/A.cpp
COMMAND ${CMAKE_COMMAND} -DBASE_DIR=${PROJECT_BINARY_DIR}
-P ${PROJECT_SOURCE_DIR}/CopyHeaders.cmake)
${PROJECT_BINARY_DIR}/ParserInit.cpp)
if (OPM_ENABLE_PYTHON)
list(APPEND genkw_argv ${PROJECT_BINARY_DIR}/tmp_gen/builtin_pybind11.cpp)
list(APPEND _tmp_output ${PROJECT_BINARY_DIR}/tmp_gen/builtin_pybind11.cpp)
list(APPEND _target_output ${PROJECT_BINARY_DIR}/python/cxx/builtin_pybind11.cpp)
endif()
add_custom_command( OUTPUT
${_tmp_output}
COMMAND genkw ${genkw_argv}
DEPENDS genkw ${keyword_files} src/opm/input/eclipse/share/keywords/keyword_list.cmake)
# To avoid some rebuilds
add_custom_command(OUTPUT
${_target_output}
DEPENDS ${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/A.cpp
COMMAND ${CMAKE_COMMAND} -DBASE_DIR=${PROJECT_BINARY_DIR} -P ${PROJECT_SOURCE_DIR}/CopyHeaders.cmake)

View File

@@ -1,3 +1,23 @@
# opm-common
Contains common components used throughout all of OPM,
in particular CMake modules for the build system.
# opm-common: Tools for Eclipse reservoir simulation files
The Open Porous Media (OPM) software suite provides libraries and
tools for modeling and simulation of porous media processes,
especially for simulating CO2 sequestration and improved and enhanced
oil recovery. The Eclipse file format is widely used in the reservoir
simulation community. This package provides a library containing code
for processing files in Eclipse format, Python binding for accessing
Eclipse files and utility code used by other OPM modules (e.g. CMake
modules used).
License
-------
The library is distributed under the GNU General Public License,
version 3 or later (GPLv3+).
Requirements
-----------
- C++17 compatible compiler
- CMake >= 3.10
- Posix compatibility

View File

@@ -1,49 +0,0 @@
# make targets for boost if find module did not do the job
if(NOT TARGET Boost::system)
add_library(Boost::system UNKNOWN IMPORTED)
set_target_properties(Boost::system PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}"
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}"
IMPORTED_LOCATION "${Boost_SYSTEM_LIBRARY}"
IMPORTED_LOCATION_DEBUG "${Boost_SYSTEM_LIBRARY_DEBUG}"
IMPORTED_LOCATION_RELEASE "${Boost_SYSTEM_LIBRARY_RELEASE}"
)
endif()
if(NOT TARGET Boost::filesystem)
add_library(Boost::filesystem UNKNOWN IMPORTED)
set_target_properties(Boost::filesystem PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}"
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}"
INTERFACE_COMPILE_DEFINITIONS BOOST_FILESYSTEM_VERSION=3
INTERFACE_LINK_LIBRARIES "${boost_system}"
IMPORTED_LOCATION "${Boost_FILESYSTEM_LIBRARY}"
IMPORTED_LOCATION_DEBUG "${Boost_FILESYSTEM_LIBRARY_DEBUG}"
IMPORTED_LOCATION_RELEASE "${Boost_FILESYSTEM_LIBRARY_RELEASE}"
)
endif()
if(NOT TARGET Boost::regex)
add_library(Boost::regex UNKNOWN IMPORTED)
set_target_properties(Boost::regex PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}"
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${boost_system}"
IMPORTED_LOCATION "${Boost_REGEX_LIBRARY}"
IMPORTED_LOCATION_DEBUG "${Boost_REGEX_LIBRARY_DEBUG}"
IMPORTED_LOCATION_RELEASE "${Boost_REGEX_LIBRARY_RELEASE}"
)
endif()
if(NOT TARGET Boost::unit_test_framework)
add_library(Boost::unit_test_framework UNKNOWN IMPORTED)
set_target_properties(Boost::unit_test_framework PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}"
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${boost_system}"
IMPORTED_LOCATION "${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}"
IMPORTED_LOCATION_DEBUG "${Boost_UNIT_TEST_FRAMEWORK_LIBRARY_DEBUG}"
IMPORTED_LOCATION_RELEASE "${Boost_UNIT_TEST_FRAMEWORK_LIBRARY_RELEASE}"
)
endif()

View File

@@ -1,49 +0,0 @@
# Find the Python wrappers for module cwrap from ert
#
# Set the cache variable CWRAP_PYTHON_PATH to the install location of the root
# ert package.
find_package(PythonInterp)
if(PYTHONINTERP_FOUND)
# We try to find the cwrap Python distribution. This is done by running Python
# code which tries to 'import cwrap' and prints out the path to the module if
# the import succeeds.
#
# The normal Python import machinery is employed, so if you have installed cwrap
# python in a default location, or alternatively set the PYTHONPATH variable the
# cwrap Python distribution will eventually be found there, independently of the
# alternatives which are tested with the ${PATH_LIST} variable.
if (EXISTS "/etc/debian_version")
set( PYTHON_PACKAGE_PATH "dist-packages")
else()
set( PYTHON_PACKAGE_PATH "site-packages")
endif()
set(PYTHON_INSTALL_PREFIX "lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/${PYTHON_PACKAGE_PATH}" CACHE STRING "Subdirectory to install Python modules in")
set(PATH_LIST)
if (ERT_ROOT)
list(APPEND PATH_LIST ${ERT_ROOT})
endif()
list(APPEND PATH_LIST ${CMAKE_PREFIX_PATH})
# Add various popular sibling alternatives.
list(APPEND PATH_LIST "${PROJECT_SOURCE_DIR}/../ert/build"
"${PROJECT_BINARY_DIR}/../ert-build")
foreach( PATH ${PATH_LIST})
set( python_code "import sys; sys.path.insert(0 , '${PATH}/${PYTHON_INSTALL_PREFIX}'); import os.path; import inspect; import cwrap; print os.path.dirname(os.path.dirname(inspect.getfile(cwrap)))")
execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "${python_code}"
RESULT_VARIABLE import_result
OUTPUT_VARIABLE stdout_output
ERROR_VARIABLE stderr_output
OUTPUT_STRIP_TRAILING_WHITESPACE )
if (${import_result} EQUAL 0)
set( CWRAP_PYTHON_PATH ${stdout_output} CACHE PATH "Python path for cwrap" )
break()
endif()
endforeach()
endif()
find_package_handle_standard_args("Cwrap" DEFAULT_MSG CWRAP_PYTHON_PATH)

View File

@@ -0,0 +1,31 @@
# - Find the GNU Multiprecision library.
#
# Will define the following imported target for usage:
# - GMP::gmp Target for linking/compiling with C library
# - GMP::gmpxx Target for linking/compiling with C++ library
find_path(GMP_INCLUDE_DIR gmp.h)
find_library(GMP_LIBRARY gmp)
find_path(GMPXX_INCLUDE_DIR gmpxx.h)
find_library(GMPXX_LIBRARY gmpxx)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GMP
DEFAULT_MSG
GMPXX_LIBRARY GMPXX_INCLUDE_DIR GMP_INCLUDE_DIR GMP_LIBRARY)
if(GMP_FOUND)
if(NOT TARGET GMP::gmp)
add_library(GMP::gmp UNKNOWN IMPORTED GLOBAL)
set_target_properties(GMP::gmp PROPERTIES
IMPORTED_LOCATION ${GMP_LIBRARY}
INTERFACE_INCLUDE_DIRECTORIES ${GMP_INCLUDE_DIR})
endif()
if(NOT TARGET GMP::gmpxx)
add_library(GMP::gmpxx UNKNOWN IMPORTED GLOBAL)
set_target_properties(GMP::gmpxx PROPERTIES
IMPORTED_LOCATION ${GMPXX_LIBRARY}
INTERFACE_INCLUDE_DIRECTORIES ${GMPXX_INCLUDE_DIR}
TARGET_LINK_LIBRARIES GMP::gmp)
endif()
endif()

View File

@@ -8,7 +8,11 @@
# HAVE_METIS - like METIS_FOUND, but for the inclusion in config.h
# METIS_INCLUDE_DIRS - incude paths to use libMETIS
# METIS_LIBRARIES - Link these to use libMETIS
# METIS::METIS - Imported metis target needed for DUNE 2.8.0
# METIS_API_VERSION - The METIS api version scotch is supporting.
set(METIS_API_VERSION 0 CACHE STRING
"METIS API version provided by METIS or scotch-metis library")
set(METIS_SEARCH_PATH "/usr" "/usr/local" "/opt" "/opt/local")
set(METIS_NO_DEFAULT_PATH "")
if(METIS_ROOT)
@@ -35,9 +39,27 @@ find_library(METIS_LIBRARIES
${METIS_NO_DEFAULT_PATH})
set (METIS_FOUND FALSE)
if (METIS_INCLUDE_DIRS OR METIS_LIBRARIES)
set(METIS_FOUND TRUE)
set(HAVE_METIS TRUE)
file(READ "${METIS_INCLUDE_DIRS}/metis.h" metisheader)
string(REGEX MATCH "#define METIS_VER_MAJOR[ ]+([0-9]+)" METIS_MAJOR_VERSION ${metisheader})
if(NOT METIS_API_VERSION AND METIS_MAJOR_VERSION)
# string(REGEX REPLACE ".*#define METIS_VER_MAJOR[ ]+([0-9]+).*" "\\1"
# METIS_MAJOR_VERSION "${metisheader}")
if(METIS_MAJOR_VERSION GREATER_EQUAL 3 AND METIS_MAJOR_VERSION LESS 5)
set(METIS_API_VERSION "3")
else()
set(METIS_API_VERSION "${METIS_MAJOR_VERSION}")
endif()
endif()
add_library(METIS::METIS UNKNOWN IMPORTED)
set_target_properties(METIS::METIS PROPERTIES
IMPORTED_LOCATION ${METIS_LIBRARIES}
INTERFACE_INCLUDE_DIRECTORIES ${METIS_INCLUDE_DIRS}
INTERFACE_COMPILE_DEFINITIONS METIS_API_VERSION=${METIS_API_VERSION})
endif()
# print a message to indicate status of this package

View File

@@ -70,6 +70,20 @@ if(PTSCOTCH_FOUND)
set(PTSCOCH_LINK_FLAGS "${DUNE_MPI_LINK_FLAGS}"
CACHE STRING "PT-Scotch link flags")
set(HAVE_PTSCOTCH 1)
if(NOT TARGET PTScotch::Scotch)
add_library(PTScotch::Scotch UNKNOWN IMPORTED GLOBAL)
set_target_properties(PTScotch::Scotch PROPERTIES
IMPORTED_LOCATION "${SCOTCH_LIBRARY}"
INCLUDE_DIRECTORIES "${PTSCOTCH_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${PTSCOTCHERR_LIBRARY}")
endif()
if(NOT TARGET PTScotch::PTScotch)
add_library(PTScotch::PTScotch UNKNOWN IMPORTED GLOBAL)
set_target_properties(PTScotch::PTScotch PROPERTIES
IMPORTED_LOCATION "${PTSCOTCH_LIBRARY}"
INCLUDE_DIRECTORIES "${PTSCOTCH_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "PTScotch::Scotch;${MPI_DUNE_LIBRARIES}")
endif()
# log result
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determing location of PT-Scotch succeded:\n"

View File

@@ -60,6 +60,19 @@ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${MPI_C_COMPILE_FLAGS}")
include(CheckIncludeFile)
check_include_file(parmetis.h PARMETIS_FOUND)
if(NOT PARMETIS_FOUND)
# If we are using the ParMETIS bindings of PTScotch, we need
# to use the scotch include path as partmetis.h includes scotch.h
find_package(PTScotch)
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${PTSCOTCH_INCLUDE_DIR})
unset(PARMETIS_FOUND CACHE) # force recheck of include file
check_include_file(parmetis.h PARMETIS_FOUND)
if(PARMETIS_FOUND)
set(PARMETIS_SCOTCH_INCLUDE_DIRS ${PTSCOTCH_INCLUDE_DIRS})
endif()
endif()
_search_parmetis_lib(PARMETIS_LIBRARY parmetis "The main ParMETIS library.")
# behave like a CMake module is supposed to behave
@@ -77,7 +90,7 @@ find_package_handle_standard_args(
cmake_pop_check_state()
if(PARMETIS_FOUND)
set(PARMETIS_INCLUDE_DIRS ${PARMETIS_INCLUDE_DIR})
set(PARMETIS_INCLUDE_DIRS ${PARMETIS_INCLUDE_DIR} ${PARMETIS_SCOTCH_INCLUDE_DIRS})
set(PARMETIS_LIBRARIES ${PARMETIS_LIBRARY} ${METIS_LIBRARIES} ${MPI_C_LIBRARIES}
CACHE FILEPATH "All libraries needed to link programs using ParMETIS")
set(PARMETIS_LINK_FLAGS "${DUNE_C_LINK_FLAGS}"
@@ -89,6 +102,13 @@ if(PARMETIS_FOUND)
"Include directory: ${PARMETIS_INCLUDE_DIRS}\n"
"Library directory: ${PARMETIS_LIBRARIES}\n\n")
if(NOT TARGET ParMETIS::ParMETIS)
add_library(ParMETIS::ParMETIS UNKNOWN IMPORTED GLOBAL)
set_target_properties(ParMETIS::ParMETIS PROPERTIES
IMPORTED_LOCATION ${PARMETIS_LIBRARY}
INCLUDE_DIRECTORIES "${PARMETIS_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${METIS_LIBRARIES};${MPI_C_LIBRARIES}")
endif()
endif(PARMETIS_FOUND)
mark_as_advanced(PARMETIS_INCLUDE_DIRS PARMETIS_LIBRARIES HAVE_PARMETIS)

View File

@@ -34,11 +34,16 @@ int main(void){
if (QUADMATH_FOUND)
set(QUADMATH_LIBRARIES "quadmath")
set(HAVE_QUAD "${QUADMATH_FOUND}")
add_library(QuadMath::QuadMath INTERFACE IMPORTED)
set_target_properties(QuadMath::QuadMath PROPERTIES
INTERFACE_LINK_LIBRARIES quadmath
INTERFACE_COMPILE_DEFINITIONS _GLIBCXX_USE_FLOAT128
INTERFACE_COMPILE_OPTIONS $<$<CXX_COMPILER_ID:GNU>:-fext-numeric-literals>)
endif()
endif()
if (USE_QUADMATH AND NOT QUADMATH_FOUND)
message(FATAL_ERROR "Quadruple precision math support was explicitly requested but is unavailable!")
message(STATUS "Quadruple precision math support is unavailable! Skipping it.")
endif()
include(FindPackageHandleStandardArgs)

View File

@@ -259,9 +259,9 @@ foreach (module IN LISTS SuiteSparse_FIND_COMPONENTS)
set (SuiteSparse_FOUND FALSE)
# use empty string instead of zero, so it can be tested with #ifdef
# as well as #if in the source code
set (HAVE_SUITESPARSE_${MODULE}_H "" CACHE INT "Is ${module} header present?")
set (HAVE_SUITESPARSE_${MODULE}_H "" CACHE STRING "Is ${module} header present?")
else (NOT SuiteSparse_${MODULE}_FOUND)
set (HAVE_SUITESPARSE_${MODULE}_H 1 CACHE INT "Is ${module} header present?")
set (HAVE_SUITESPARSE_${MODULE}_H 1 CACHE STRING "Is ${module} header present?")
list (APPEND SuiteSparse_LIBRARIES "${${MODULE}_LIBRARIES}")
list (APPEND SuiteSparse_LINKER_FLAGS "${${MODULE}_LINKER_FLAGS}")
list (APPEND SuiteSparse_INCLUDE_DIRS "${${MODULE}_INCLUDE_DIRS}")
@@ -280,6 +280,32 @@ if (SuiteSparse_LIBRARIES)
list (REVERSE SuiteSparse_LIBRARIES)
endif (SuiteSparse_LIBRARIES)
if(SuiteSparse_FOUND)
if(NOT TARGET SuiteSparse::SuiteSparse)
add_library(SuiteSparse::SuiteSparse INTERFACE IMPORTED GLOBAL)
set_property(TARGET SuiteSparse::SuiteSparse PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${SuiteSparse_INCLUDE_DIRS})
if(config_LIBRARY)
set_property(TARGET SuiteSparse::SuiteSparse PROPERTY
INTERFACE_LINK_LIBRARIES ${config_LIBRARY})
endif()
endif()
foreach(_module ${SuiteSparse_MODULES})
string (TOUPPER ${_module} _MODULE)
if(SuiteSparse_${_MODULE}_FOUND)
if(NOT TARGET SuiteSparse::${_module})
message(STATUS "Creating target SuitSparse::${_module}")
add_library(SuiteSparse::${_module} UNKNOWN IMPORTED GLOBAL)
set_target_properties(SuiteSparse::${_module} PROPERTIES
IMPORTED_LOCATION ${${_MODULE}_LIBRARY}
INCLUDE_DIRECTORIES ${${_MODULE}_INCLUDE_DIRS}
INTERFACE_LINK_LIBRARIES "${config_LIBRARY}")
target_link_libraries(SuiteSparse::SuiteSparse
INTERFACE SuiteSparse::${_module})
endif()
endif()
endforeach(_module)
endif()
# print a message to indicate status of this package
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (SuiteSparse

View File

@@ -180,6 +180,16 @@ if(SUPERLU_FOUND)
if (SUPERLU_BLAS_LIBRARY)
list(APPEND SUPERLU_LIBRARIES ${SUPERLU_BLAS_LIBRARY})
endif()
if(NOT TARGET SuperLU::SuperLU)
add_library(SuperLU::SuperLU UNKNOWN IMPORTED GLOBAL)
set_target_properties(SuperLU::SuperLU PROPERTIES
IMPORTED_LOCATION ${SUPERLU_LIBRARY}
INCLUDE_DIRECTORIES ${SUPERLU_INCLUDE_DIRS})
if(SUPERLU_BLAS_LIBRARY)
set_property(TARGET SuperLU::SuperLU PROPERTY
INTERFACE_LINK_LIBRARIES ${SUPERLU_BLAS_LIBRARY})
endif()
endif()
endif()
cmake_pop_check_state()

View File

@@ -0,0 +1,34 @@
# Poor man's FindTBB that will create the CMake targets
# used by DUNE.
# If the TBB version is new enough it will ship its own
# TBBConfig.cmake and we are good
find_package(TBB QUIET CONFIG)
if(NOT TBB_FOUND)
# Fall back to using pkgconfig
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PkgConfigTBB IMPORTED_TARGET GLOBAL tbb QUIET)
if(NOT TARGET PkgConfig::PkgConfigTBB)
# workaround bug in old FindPkgConfig.cmake which adds
# pkgcfg_lib_PkgConfigTBB_atomic-NOTFOUND because it cannot
# find the atomic lib of the compiler (not in platforms default
# library path. It will therefore not create the target and we
# try that manually.
string(REPLACE ";pkgcfg_lib_PkgConfigTBB_atomic-NOTFOUND" "" _find_tbb_libs "${PkgConfigTBB_LINK_LIBRARIES}")
if(_find_tbb_libs)
add_library(PkgConfig::PkgConfigTBB INTERFACE IMPORTED GLOBAL)
set_property(TARGET PkgConfig::PkgConfigTBB PROPERTY
INTERFACE_LINK_LIBRARIES "${_find_tbb_libs}")
endif()
endif()
if(TARGET PkgConfig::PkgConfigTBB)
if(NOT TARGET TBB::tbb)
message(STATUS "Found TBB library using pkg config")
add_library(TBB::tbb ALIAS PkgConfig::PkgConfigTBB)
endif()
endif()
endif(PKG_CONFIG_FOUND)
else()
message(STATUS "Found TBB library using config mode")
endif(NOT TBB_FOUND)

View File

@@ -6,10 +6,6 @@
include (FindPackageHandleStandardArgs)
if ((NOT CJSON_ROOT) AND OPM_PARSER_ROOT)
set( CJSON_ROOT ${OPM_PARSER_ROOT})
endif()
if (CJSON_ROOT)
set (_no_default_path "NO_DEFAULT_PATH")
else (CJSON_ROOT)
@@ -18,10 +14,9 @@ endif (CJSON_ROOT)
find_path (CJSON_INCLUDE_DIR
NAMES "cjson/cJSON.h"
NAMES "cJSON.h"
HINTS "${CJSON_ROOT}"
PATHS "${PROJECT_SOURCE_DIR}"
PATH_SUFFIXES "include" "external"
PATH_SUFFIXES "cjson"
DOC "Path to cjson library header files"
${_no_default_path} )
@@ -36,17 +31,13 @@ string(REGEX REPLACE "${PROJECT_SOURCE_DIR}/?(.*)" "\\1" BUILD_DIR_SUFFIX "${PR
find_library (CJSON_LIBRARY
NAMES "cjson"
HINTS "${CJSON_ROOT}"
PATHS "${PROJECT_BINARY_DIR}/../opm-parser"
"${PROJECT_BINARY_DIR}/../opm-parser${BUILD_DIR_SUFFIX}"
"${PROJECT_BINARY_DIR}/../../opm-parser/${BUILD_DIR_SUFFIX}"
PATH_SUFFIXES "lib" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
"opm/json"
DOC "Path to cjson library archive/shared object files"
${_no_default_path} )
# setup list of all required libraries to link with cjson
set (CJSON_INCLUDE_DIRS ${CJSON_INCLUDE_DIR})
set (CJSON_LIBRARIES ${CJSON_LIBRARY})
set (cjson_INCLUDE_DIRS ${CJSON_INCLUDE_DIR})
set (cjson_LIBRARIES ${CJSON_LIBRARY})
# math library (should exist on all unices; automatically linked on Windows)
if (UNIX)
@@ -81,10 +72,7 @@ endif ()
# if the test program didn't compile, but was required to do so, bail
# out now and display an error; otherwise limp on
set (CJSON_FIND_REQUIRED ${cjson_FIND_REQUIRED})
set (CJSON_FIND_QUIETLY ${cjson_FIND_QUIETLY})
find_package_handle_standard_args (CJSON
find_package_handle_standard_args (cjson
DEFAULT_MSG
CJSON_INCLUDE_DIRS CJSON_LIBRARIES HAVE_CJSON
cjson_INCLUDE_DIRS cjson_LIBRARIES HAVE_CJSON
)
set (cjson_FOUND ${CJSON_FOUND})

View File

@@ -19,7 +19,9 @@ find_opm_package (
"BLAS REQUIRED;
LAPACK REQUIRED;
CxaDemangle;
MPI
MPI;
TBB;
GMP
"
# header to search for
"dune/common/fvector.hh"
@@ -28,7 +30,7 @@ find_opm_package (
"dunecommon"
# defines to be added to compilations
"DUNE_COMMON_FIELDVECTOR_SIZE_IS_METHOD=1"
""
# test program
"#include <dune/common/fvector.hh>

View File

@@ -24,7 +24,8 @@ find_opm_package (
dune-alugrid;
ZLIB;
ZOLTAN;
METIS
METIS;
Quadmath
"
# header to search for
"dune/fem/space/shapefunctionset/legendre.hh"

View File

@@ -19,7 +19,7 @@ find_opm_package (
"dune-common REQUIRED;
ParMETIS;
SuperLU;
SuiteSparse COMPONENTS umfpack
SuiteSparse COMPONENTS umfpack REQUIRED
"
# header to search for
"dune/istl/bcrsmatrix.hh"

View File

@@ -16,7 +16,36 @@ function (linker_cmdline what INTO outvar FROM)
# (you get an error message about argument not parsed). translate each
# of the libraries into a linker option
set (deplib_list "")
set (deplib_list_tmp "")
foreach (deplib IN LISTS ARGN)
# resolve imported targets
string(FIND ${deplib} "::" _sep)
if (_sep GREATER "-1")
set(_lib "")
# the code below does not really work for imported interface library
# as cmake will error out whene querying IMPORTED_LOCATION, because the
# property is not whitelisted. I have no idea how to determine if
# a library is an imported interface library
# At least it works for resolving OpenMP::OpenMP_CXX
#
# get_property(_def TARGET ${deplib} PROPERTY IMPORTED_LOCATION DEFINED)
# if (_def)
# get_property(_def TARGET ${deplib} PROPERTY IMPORTED_LOCATION SET)
# if (_def)
# get_target_property(_tmp_lib ${deplib} IMPORTED_LOCATION)
# list(APPEND _lib ${_tmp_lib})
# endif()
# endif()
get_property(_def TARGET ${deplib} PROPERTY INTERFACE_LINK_LIBRARIES SET)
if (_def)
get_target_property(_tmp_lib ${deplib} INTERFACE_LINK_LIBRARIES)
list(APPEND _lib ${_tmp_lib})
endif()
set(deplib ${_lib})
endif()
list(APPEND deplib_list_tmp ${deplib})
endforeach()
foreach (deplib IN LISTS deplib_list_tmp)
# starts with a hyphen already? then just add it
string (SUBSTRING ${deplib} 0 1 dash)
if (${dash} STREQUAL "-")
@@ -44,18 +73,20 @@ function (linker_cmdline what INTO outvar FROM)
# is more or less lost. remove system default path, to lessen the
# chance that we pick the wrong library
if (NOT ((deplib_dir STREQUAL "/usr/lib") OR
(deplib_dir STREQUAL "/usr/${CMAKE_INSTALL_LIBDIR}")))
list (APPEND deplib_list "-L${deplib_dir}")
endif (NOT ((deplib_dir STREQUAL "/usr/lib") OR
(deplib_dir STREQUAL "/usr/${CMAKE_INSTALL_LIBDIR}")))
(deplib_dir STREQUAL "") OR
(deplib_dir STREQUAL "/usr/${CMAKE_INSTALL_LIBDIR}")))
list (APPEND deplib_list "-L${deplib_dir}")
endif ()
# if there was no translation of the name, the library is named
# unconventionally (.so.3gf, I'm looking at you), so pass this
# name unmodified to the linker switch
if (deplib_orig STREQUAL deplib_name)
if (deplib_orig STREQUAL deplib_name AND
NOT deplib_orig STREQUAL "stdc++fs")
list (APPEND deplib_list "-l:${deplib_orig}")
else (deplib_orig STREQUAL deplib_name)
else ()
list (APPEND deplib_list "-l${deplib_name}")
endif (deplib_orig STREQUAL deplib_name)
endif (deplib_orig STREQUAL deplib_name AND
NOT deplib_orig STREQUAL "stdc++fs")
endif (${dash} STREQUAL "-")
endforeach (deplib)
# caller determines whether we want it returned as a list or a string

View File

@@ -1,6 +1,16 @@
# Installs bash tab completion for a product
macro(opm_add_bash_completion binary)
option(USE_BASH_COMPLETIONS_DIR
"Whether to use the new bash completion dir (/usr/share/bash-completion/completions) with load on demand"
OFF)
if(USE_BASH_COMPLETIONS_DIR)
set(_BASH_COMPLETION_FILE ${binary})
set(_BASH_COMPLETION_INSTALL_DIR ${CMAKE_INSTALL_DATAROOTDIR}/bash-completion/completions)
else()
set(_BASH_COMPLETION_FILE ${binary}_bash_completion.sh)
set(_BASH_COMPLETION_INSTALL_DIR ${CMAKE_INSTALL_SYSCONFDIR}/bash_completion.d)
endif()
set(PRODUCT ${binary})
configure_file(${OPM_MACROS_ROOT}/etc/opm_bash_completion.sh.in ${binary}_bash_completion.sh @ONLY)
install(FILES ${PROJECT_BINARY_DIR}/${binary}_bash_completion.sh DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/bash_completion.d)
configure_file(${OPM_MACROS_ROOT}/etc/opm_bash_completion.sh.in ${_BASH_COMPLETION_FILE} @ONLY)
install(FILES ${PROJECT_BINARY_DIR}/${_BASH_COMPLETION_FILE} DESTINATION ${_BASH_COMPLETION_INSTALL_DIR})
endmacro()

View File

@@ -29,12 +29,18 @@ macro (opm_compile opm)
# create this library, if there are any compilation units
link_directories (${${opm}_LIBRARY_DIRS})
add_definitions (${${opm}_DEFINITIONS})
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.12")
# Some modules may still export definitions using -D, strip it
string(REGEX REPLACE "-D" "" _clean_defs "${${opm}_DEFINITIONS}")
add_compile_definitions(${_clean_defs})
else()
add_definitions(${${opm}_DEFINITIONS})
endif()
set (${opm}_VERSION "${${opm}_VERSION_MAJOR}.${${opm}_VERSION_MINOR}")
if (${opm}_SOURCES)
add_library (${${opm}_TARGET} ${${opm}_LIBRARY_TYPE} ${${opm}_SOURCES})
set_target_properties (${${opm}_TARGET} PROPERTIES
SOVERSION ${${opm}_VERSION_MAJOR}
SOVERSION ${${opm}_VERSION}
VERSION ${${opm}_VERSION}
LINK_FLAGS "${${opm}_LINKER_FLAGS_STR}"
POSITION_INDEPENDENT_CODE TRUE

View File

@@ -130,9 +130,18 @@ macro (find_and_append_package_to prefix name)
# and the likes which is only done via opm_find_package
if ( (NOT DEFINED ${name}_FOUND AND NOT DEFINED ${NAME}_FOUND )
OR _search_components GREATER -1)
string(REGEX MATCH "(opm)-.*" _is_opm ${name})
string(REGEX MATCH "(opm)-.*" _is_opm ${name})
if(NOT _is_opm)
find_package (${name} ${ARGN})
# When using Boost >= 1.70 and e.g. CMake 3.18 we need to make sure that
# subsequent searches are using config mode too. Otherwise the library
# list will be completely messed up. We use a set Boost_Dir to detect that
# previous searches were done using config mode.
if("${name}" STREQUAL "Boost" AND Boost_DIR)
set(_CONFIG_MODE CONFIG)
else()
set(_CONFIG_MODE "")
endif()
find_package (${name} ${ARGN} ${_CONFIG_MODE})
else()
if(${name}_DIR)
find_package (${name} ${${prefix}_VERSION_MAJOR}.${${prefix}_VERSION_MINOR} ${ARGN} NO_MODULE PATHS ${${name}_DIR} NO_DEFAULT_PATH)
@@ -163,7 +172,21 @@ macro (find_and_append_package_to prefix name)
string (REPLACE "-" "_" NAME "${NAME}")
if (${name}_FOUND OR ${NAME}_FOUND)
foreach (var IN LISTS _opm_proj_vars)
foreach (var IN LISTS _opm_proj_vars)
if("${var}" STREQUAL "DEFINITIONS"
AND CMAKE_VERSION VERSION_LESS "3.12")
# For old Cmake versions we use add_definitions which
# requires -D qualifier add that
set(_defs)
foreach(_def IN LISTS ${name}_${var})
if(_def MATCHES "^[a-zA-Z].*")
list(APPEND _defs "-D${_def}")
else()
list(APPEND _defs "${_def}")
endif()
endforeach()
set(${name}_${var} "${_defs}")
endif()
if (DEFINED ${name}_${var})
list (APPEND ${prefix}_${var} ${${name}_${var}})
# some packages define an uppercase version of their own name

View File

@@ -130,14 +130,21 @@ endif ()
# parallel computing must be explicitly enabled
# This needs to be in OpmInit as prereqs is called before OpmLibMain is included.
option (USE_MPI "Use Message Passing Interface for parallel computing" OFF)
option (USE_MPI "Use Message Passing Interface for parallel computing" ON)
if (NOT USE_MPI)
set (CMAKE_DISABLE_FIND_PACKAGE_MPI TRUE)
endif ()
# Compiler standard version needs to be requested here as prereqs is included
# before OpmLibMain and some tests need/use CXX_STANDARD_VERSION (e.g. pybind11)
# Languages and global compiler settings
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# quadmath must be explicitly enabled
# This needs to be in OpmInit as prereqs is called before OpmLibMain is included.
option (USE_QUADMATH "Use high precision floating point library (slow)" OFF)
option (USE_QUADMATH "Search for high precision floating point library (normally not used)" ON)
if (NOT USE_QUADMATH)
set (CMAKE_DISABLE_FIND_PACKAGE_QuadMath TRUE)
endif ()

View File

@@ -20,16 +20,6 @@
include (AddOptions)
no_default_options ()
# Languages and global compiler settings
if(CMAKE_VERSION VERSION_LESS 3.8)
message(WARNING "CMake version does not support c++17, guessing -std=c++17")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
else()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
endif()
# Various compiler extension checks
include(OpmCompilerChecks)
@@ -74,7 +64,7 @@ include (UseThreads)
find_threads (${project})
# SuperLU is optional
option (USE_SUPERLU "Use SuperLU direct solvers" OFF)
option (USE_SUPERLU "Use SuperLU direct solvers for AMG (if umfpack is not found)" ON)
# PETSc is optional
option (USE_PETSC "Use PETSc iterative solvers" OFF)

View File

@@ -95,10 +95,19 @@ macro (find_opm_package module deps header lib defs prog conf)
# compile with this option to avoid avalanche of warnings
set (${module}_DEFINITIONS "${${module}_DEFINITIONS}")
# -D to compile definitions for older CMake versions
set (_D_PREFIX "")
if(CMAKE_VERSION VERSION_LESS "3.12")
set(_D_PREFIX "-D")
endif()
foreach (_def IN ITEMS ${defs})
list (APPEND ${module}_DEFINITIONS "-D${_def}")
if(_def MATCHES "^[A-Za-z].*")
list (APPEND ${module}_DEFINITIONS "${_D_PREFIX}${_def}")
endif()
endforeach (_def)
list (APPEND ${module}_DEFINITIONS ${defs})
# tidy the lists before returning them
remove_dup_deps (${module})

View File

@@ -30,7 +30,6 @@ function (configure_pc_file name source dest prefix libdir includedir)
set (minor "${${name}_VERSION_MINOR}")
set (target "${${name}_LIBRARY}")
linker_cmdline (STRING INTO target from ${target})
configure_file (${source} ${dest} @ONLY)
endfunction (configure_pc_file name source dist prefix libdir includedir)
@@ -55,6 +54,12 @@ function (configure_cmake_file name variant version)
foreach (suffix IN LISTS variable_suffices)
set (opm-project_${suffix} "${${name}_${suffix}}")
endforeach (suffix)
if (BUILD_SHARED_LIBS)
# No need to list shared libraries as the linker information is alread
# in the shared lib
string(REGEX REPLACE ";?[^;]*.so" "" opm-project_LIBRARIES "${opm-project_LIBRARIES}")
endif()
set (opm-project_NAME "${${name}_NAME}")
set (opm-project_NAME_UC "${${name}_NAME}")
string(TOUPPER "${opm-project_NAME}" opm-project_NAME_UC)
@@ -101,16 +106,24 @@ function (opm_cmake_config name)
# and we have existing entries pointing to that install directory.
# Since they will yield a duplicate in next replace anyways, we filter them out first
# to get avoid those the bogus entries.
string(REPLACE "${CMAKE_INSTALL_PREFIX}/include${${name}_VER_DIR}" "" ${name}_INCLUDE_DIRS "${${name}_INCLUDE_DIRS}")
# First with trailing / to change /usr/include/package to package and not /package
# Fixes broken pkg-config files for Debian/Ubuntu packaging.
string(FIND "${${name}_INCLUDE_DIRS}" "${PROJECT_SOURCE_DIR}" _source_in_include)
# replace the build directory with the target directory in the
# variables that contains build paths
string (REPLACE
"${PROJECT_SOURCE_DIR}"
"${CMAKE_INSTALL_PREFIX}/include${${name}_VER_DIR}"
${name}_INCLUDE_DIRS
"${${name}_INCLUDE_DIRS}"
)
if(_source_in_include GREATER "-1")
string(REGEX REPLACE "${CMAKE_INSTALL_PREFIX}/include${${name}_VER_DIR}[;$]" "" ${name}_INCLUDE_DIRS "${${name}_INCLUDE_DIRS}")
# Get rid of empty entries
string(REPLACE ";;" ";" ${name}_INCLUDE_DIRS "${${name}_INCLUDE_DIRS}")
# replace the build directory with the target directory in the
# variables that contains build paths
string (REPLACE
"${PROJECT_SOURCE_DIR}"
"${CMAKE_INSTALL_PREFIX}/include${${name}_VER_DIR}"
${name}_INCLUDE_DIRS
"${${name}_INCLUDE_DIRS}"
)
endif()
string (REPLACE
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}${${name}_VER_DIR}"

View File

@@ -338,7 +338,7 @@ macro(opm_add_test TestName)
# has been specified to supervise the test binary, use it else
# run the test binary "naked".
if (CURTEST_DRIVER)
set(CURTEST_COMMAND ${CURTEST_DRIVER} ${CURTEST_DRIVER_ARGS} ${CURTEST_EXE_NAME} ${CURTEST_TEST_ARGS})
set(CURTEST_COMMAND ${CURTEST_DRIVER} ${CURTEST_DRIVER_ARGS} -e ${CURTEST_EXE_NAME} -- ${CURTEST_TEST_ARGS})
else()
set(CURTEST_COMMAND ${PROJECT_BINARY_DIR}/bin/${CURTEST_EXE_NAME})
if (CURTEST_TEST_ARGS)

View File

@@ -1,4 +1,11 @@
find_package (Boost 1.44.0 COMPONENTS unit_test_framework QUIET)
# When using Boost >= 1.70 and e.g. CMake 3.18 we need to make sure that
# subsequent searches are using config mode too. Otherwise the library
# list will be completely messed up. We use a set Boost_Dir to detect that
# previous searches were done using config mode.
if(Boost_DIR)
set(_Boost_CONFIG_MODE CONFIG)
endif()
find_package (Boost 1.44.0 COMPONENTS unit_test_framework QUIET ${_Boost_CONFIG_MODE})
if (Boost_UNIT_TEST_FRAMEWORK_FOUND)
# setup to do a test compile

View File

@@ -63,9 +63,9 @@ if (CXX_COMPAT_GCC)
# use these options for release builds - full optimization
add_options (ALL_LANGUAGES "${_prof_RELEASE}" ${_opt_rel} ${_opt_flags})
option(WITH_NDEBUG "Disable asserts in release mode" ON)
if(WITH_NDEBUG)
add_options (ALL_LANGUAGES "${_prof_RELEASE}" -DNDEBUG)
option(WITH_NDEBUG "Disable asserts in release mode" OFF)
if(NOT WITH_NDEBUG)
add_options (ALL_LANGUAGES "${_prof_RELEASE}" -UNDEBUG)
endif()
else ()

View File

@@ -17,6 +17,9 @@ message("-- Writing version information to local header project-version.h")
string (TIMESTAMP build_timestamp "%Y-%m-%d at %H:%M:%S hrs")
string (TOUPPER "${CMAKE_BUILD_TYPE}" cmake_build_type_upper_)
set(OPM_BINARY_PACKAGE_VERSION "" CACHE STRING
"Version of the binary Linux package built (will be printed in PRT file of flow if not empty)")
string(LENGTH "${OPM_BINARY_PACKAGE_VERSION}" _BINARY_PACKAGE_VERSION_LENGTH)
if (cmake_build_type_upper_ MATCHES DEBUG)
file (WRITE "${PROJECT_BINARY_DIR}/project-version.h"
"#ifndef OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
@@ -43,22 +46,30 @@ else ()
# system, so there is "no" way we can update the SHA. notice
# that this is a slightly different version of the label than
# above.
if (NOT GIT_FOUND)
file (WRITE "${PROJECT_BINARY_DIR}/project-version.h"
"#ifndef OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
"#define OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
"#define PROJECT_VERSION_NAME \"${${project}_LABEL}\"\n"
"#define PROJECT_VERSION_HASH \"unknown git version\"\n"
"#define PROJECT_VERSION \"${${project}_LABEL} (unknown git version)\"\n"
"#endif // OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
)
# Write header file with build timestamp
file (WRITE "${PROJECT_BINARY_DIR}/project-timestamp.h"
"#ifndef OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
"#define OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
"#define BUILD_TIMESTAMP \"${build_timestamp}\"\n"
"#endif // OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
if (NOT GIT_FOUND OR NOT EXISTS ${PROJECT_SOURCE_DIR}/.git)
if(_BINARY_PACKAGE_VERSION_LENGTH GREATER 0)
set(_PROJECT_VERSION_HASH "${OPM_BINARY_PACKAGE_VERSION}")
else()
set(_PROJECT_VERSION_HASH "unknown git version")
endif()
file (WRITE "${PROJECT_BINARY_DIR}/project-version.h"
"#ifndef OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
"#define OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
"#define PROJECT_VERSION_NAME \"${${project}_LABEL}\"\n"
"#define PROJECT_VERSION_HASH \"${_PROJECT_VERSION_HASH}\"\n"
"#define PROJECT_VERSION \"${${project}_LABEL} (${_PROJECT_VERSION_HASH})\"\n"
"#endif // OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
)
# Write header file with build timestamp
file (WRITE "${PROJECT_BINARY_DIR}/project-timestamp.h"
"#ifndef OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
"#define OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n")
if (_BINARY_PACKAGE_VERSION_LENGTH EQUAL 0)
file(APPEND "${PROJECT_BINARY_DIR}/project-timestamp.h"
"#define BUILD_TIMESTAMP \"${build_timestamp}\"\n")
endif()
file(APPEND "${PROJECT_BINARY_DIR}/project-timestamp.h"
"#endif // OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n")
else ()
add_custom_target (update-version ALL
COMMAND ${CMAKE_COMMAND}

View File

@@ -1,138 +0,0 @@
# CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords> <multi_value_keywords> args...)
#
# CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or functions for
# parsing the arguments given to that macro or function.
# It processes the arguments and defines a set of variables which hold the
# values of the respective options.
#
# The <options> argument contains all options for the respective macro,
# i.e. keywords which can be used when calling the macro without any value
# following, like e.g. the OPTIONAL keyword of the install() command.
#
# The <one_value_keywords> argument contains all keywords for this macro
# which are followed by one value, like e.g. DESTINATION keyword of the
# install() command.
#
# The <multi_value_keywords> argument contains all keywords for this macro
# which can be followed by more than one value, like e.g. the TARGETS or
# FILES keywords of the install() command.
#
# When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of the
# keywords listed in <options>, <one_value_keywords> and
# <multi_value_keywords> a variable composed of the given <prefix>
# followed by "_" and the name of the respective keyword.
# These variables will then hold the respective value from the argument list.
# For the <options> keywords this will be TRUE or FALSE.
#
# All remaining arguments are collected in a variable
# <prefix>_UNPARSED_ARGUMENTS, this can be checked afterwards to see whether
# your macro was called with unrecognized parameters.
#
# As an example here a my_install() macro, which takes similar arguments as the
# real install() command:
#
# function(MY_INSTALL)
# set(options OPTIONAL FAST)
# set(oneValueArgs DESTINATION RENAME)
# set(multiValueArgs TARGETS CONFIGURATIONS)
# cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
# ...
#
# Assume my_install() has been called like this:
# my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub)
#
# After the cmake_parse_arguments() call the macro will have set the following
# variables:
# MY_INSTALL_OPTIONAL = TRUE
# MY_INSTALL_FAST = FALSE (this option was not used when calling my_install()
# MY_INSTALL_DESTINATION = "bin"
# MY_INSTALL_RENAME = "" (was not used)
# MY_INSTALL_TARGETS = "foo;bar"
# MY_INSTALL_CONFIGURATIONS = "" (was not used)
# MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL"
#
# You can the continue and process these variables.
#
# Keywords terminate lists of values, e.g. if directly after a one_value_keyword
# another recognized keyword follows, this is interpreted as the beginning of
# the new option.
# E.g. my_install(TARGETS foo DESTINATION OPTIONAL) would result in
# MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTINATION would
# be empty and MY_INSTALL_OPTIONAL would be set to TRUE therefor.
#=============================================================================
# Copyright 2010 Alexander Neundorf <neundorf@kde.org>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
if(__CMAKE_PARSE_ARGUMENTS_INCLUDED)
return()
endif()
set(__CMAKE_PARSE_ARGUMENTS_INCLUDED TRUE)
function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgNames)
# first set all result variables to empty/FALSE
foreach(arg_name ${_singleArgNames} ${_multiArgNames})
set(${prefix}_${arg_name})
endforeach(arg_name)
foreach(option ${_optionNames})
set(${prefix}_${option} FALSE)
endforeach(option)
set(${prefix}_UNPARSED_ARGUMENTS)
set(insideValues FALSE)
set(currentArgName)
# now iterate over all arguments and fill the result variables
foreach(currentArg ${ARGN})
list(FIND _optionNames "${currentArg}" optionIndex) # ... then this marks the end of the arguments belonging to this keyword
list(FIND _singleArgNames "${currentArg}" singleArgIndex) # ... then this marks the end of the arguments belonging to this keyword
list(FIND _multiArgNames "${currentArg}" multiArgIndex) # ... then this marks the end of the arguments belonging to this keyword
if(${optionIndex} EQUAL -1 AND ${singleArgIndex} EQUAL -1 AND ${multiArgIndex} EQUAL -1)
if(insideValues)
if("${insideValues}" STREQUAL "SINGLE")
set(${prefix}_${currentArgName} ${currentArg})
set(insideValues FALSE)
elseif("${insideValues}" STREQUAL "MULTI")
list(APPEND ${prefix}_${currentArgName} ${currentArg})
endif()
else(insideValues)
list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg})
endif(insideValues)
else()
if(NOT ${optionIndex} EQUAL -1)
set(${prefix}_${currentArg} TRUE)
set(insideValues FALSE)
elseif(NOT ${singleArgIndex} EQUAL -1)
set(currentArgName ${currentArg})
set(${prefix}_${currentArgName})
set(insideValues "SINGLE")
elseif(NOT ${multiArgIndex} EQUAL -1)
set(currentArgName ${currentArg})
set(${prefix}_${currentArgName})
set(insideValues "MULTI")
endif()
endif()
endforeach(currentArg)
# propagate the result variables to the caller:
foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames})
set(${prefix}_${arg_name} ${${prefix}_${arg_name}} PARENT_SCOPE)
endforeach(arg_name)
set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE)
endfunction(CMAKE_PARSE_ARGUMENTS _options _singleArgs _multiArgs)

View File

@@ -1,47 +0,0 @@
# The module defines the following variables:
# GIT_EXECUTABLE - path to git command line client
# GIT_FOUND - true if the command line client was found
# Example usage:
# find_package(Git)
# if(GIT_FOUND)
# message("git found: ${GIT_EXECUTABLE}")
# endif()
#=============================================================================
# Copyright 2010 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Look for 'git' or 'eg' (easy git)
#
set(git_names git eg)
# Prefer .cmd variants on Windows unless running in a Makefile
# in the MSYS shell.
#
if(WIN32)
if(NOT CMAKE_GENERATOR MATCHES "MSYS")
set(git_names git.cmd git eg.cmd eg)
endif()
endif()
find_program(GIT_EXECUTABLE
NAMES ${git_names}
PATH_SUFFIXES Git/cmd Git/bin
DOC "git command line client"
)
mark_as_advanced(GIT_EXECUTABLE)
# Handle the QUIETLY and REQUIRED arguments and set GIT_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Git DEFAULT_MSG GIT_EXECUTABLE)

View File

@@ -1,61 +0,0 @@
# This module defines two macros:
# CMAKE_PUSH_CHECK_STATE()
# and
# CMAKE_POP_CHECK_STATE()
# These two macros can be used to save and restore the state of the variables
# CMAKE_REQUIRED_FLAGS, CMAKE_REQUIRED_DEFINITIONS, CMAKE_REQUIRED_LIBRARIES
# and CMAKE_REQUIRED_INCLUDES used by the various Check-files coming with CMake,
# like e.g. check_function_exists() etc.
# The variable contents are pushed on a stack, pushing multiple times is supported.
# This is useful e.g. when executing such tests in a Find-module, where they have to be set,
# but after the Find-module has been executed they should have the same value
# as they had before.
#
# Usage:
# cmake_push_check_state()
# set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -DSOME_MORE_DEF)
# check_function_exists(...)
# cmake_pop_check_state()
#=============================================================================
# Copyright 2006-2011 Alexander Neundorf, <neundorf@kde.org>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
MACRO(CMAKE_PUSH_CHECK_STATE)
IF(NOT DEFINED _CMAKE_PUSH_CHECK_STATE_COUNTER)
SET(_CMAKE_PUSH_CHECK_STATE_COUNTER 0)
ENDIF()
MATH(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}+1")
SET(_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_INCLUDES})
SET(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS})
SET(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_LIBRARIES})
SET(_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_FLAGS})
ENDMACRO(CMAKE_PUSH_CHECK_STATE)
MACRO(CMAKE_POP_CHECK_STATE)
# don't pop more than we pushed
IF("${_CMAKE_PUSH_CHECK_STATE_COUNTER}" GREATER "0")
SET(CMAKE_REQUIRED_INCLUDES ${_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
SET(CMAKE_REQUIRED_DEFINITIONS ${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
SET(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
SET(CMAKE_REQUIRED_FLAGS ${_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
MATH(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}-1")
ENDIF()
ENDMACRO(CMAKE_POP_CHECK_STATE)

View File

@@ -1,624 +0,0 @@
# - Find BLAS library
# This module finds an installed fortran library that implements the BLAS
# linear-algebra interface (see http://www.netlib.org/blas/).
# The list of libraries searched for is taken
# from the autoconf macro file, acx_blas.m4 (distributed at
# http://ac-archive.sourceforge.net/ac-archive/acx_blas.html).
#
# This module sets the following variables:
# BLAS_FOUND - set to true if a library implementing the BLAS interface
# is found
# BLAS_LINKER_FLAGS - uncached list of required linker flags (excluding -l
# and -L).
# BLAS_LIBRARIES - uncached list of libraries (using full path name) to
# link against to use BLAS
# BLAS95_LIBRARIES - uncached list of libraries (using full path name)
# to link against to use BLAS95 interface
# BLAS95_FOUND - set to true if a library implementing the BLAS f95 interface
# is found
# BLA_STATIC if set on this determines what kind of linkage we do (static)
# BLA_VENDOR if set checks only the specified vendor, if not set checks
# all the possibilities
# BLA_F95 if set on tries to find the f95 interfaces for BLAS/LAPACK
##########
### List of vendors (BLA_VENDOR) valid in this module
## Goto,ATLAS PhiPACK,CXML,DXML,SunPerf,SCSL,SGIMATH,IBMESSL,Intel10_32 (intel mkl v10 32 bit),Intel10_64lp (intel mkl v10 64 bit,lp thread model, lp64 model),
## Intel( older versions of mkl 32 and 64 bit), ACML,ACML_MP,ACML_GPU,Apple, NAS, Generic
# C/CXX should be enabled to use Intel mkl
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
include(CheckFunctionExists)
include(CheckFortranFunctionExists)
set(_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
# Check the language being used
get_property( _LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES )
if( _LANGUAGES_ MATCHES Fortran )
set( _CHECK_FORTRAN TRUE )
elseif( (_LANGUAGES_ MATCHES C) OR (_LANGUAGES_ MATCHES CXX) )
set( _CHECK_FORTRAN FALSE )
else()
if(BLAS_FIND_REQUIRED)
message(FATAL_ERROR "FindBLAS requires Fortran, C, or C++ to be enabled.")
else(BLAS_FIND_REQUIRED)
message(STATUS "Looking for BLAS... - NOT found (Unsupported languages)")
return()
endif(BLAS_FIND_REQUIRED)
endif( )
macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
# This macro checks for the existence of the combination of fortran libraries
# given by _list. If the combination is found, this macro checks (using the
# Check_Fortran_Function_Exists macro) whether can link against that library
# combination using the name of a routine given by _name using the linker
# flags given by _flags. If the combination of libraries is found and passes
# the link test, LIBRARIES is set to the list of complete library paths that
# have been found. Otherwise, LIBRARIES is set to FALSE.
# N.B. _prefix is the prefix applied to the names of all cached variables that
# are generated internally and marked advanced by this macro.
set(_libdir ${ARGN})
set(_libraries_work TRUE)
set(${LIBRARIES})
set(_combined_name)
if (NOT _libdir)
if (WIN32)
set(_libdir ENV LIB)
elseif (APPLE)
set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV DYLD_LIBRARY_PATH)
else ()
set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH)
endif ()
endif ()
foreach(_library ${_list})
set(_combined_name ${_combined_name}_${_library})
if(_libraries_work)
if (BLA_STATIC)
if (WIN32)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
endif ( WIN32 )
if (APPLE)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
else (APPLE)
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
endif (APPLE)
else (BLA_STATIC)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
# for ubuntu's libblas3gf and liblapack3gf packages
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf)
endif ()
endif (BLA_STATIC)
find_library(${_prefix}_${_library}_LIBRARY
NAMES ${_library}
PATHS ${_libdir}
)
mark_as_advanced(${_prefix}_${_library}_LIBRARY)
set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
set(_libraries_work ${${_prefix}_${_library}_LIBRARY})
endif(_libraries_work)
endforeach(_library ${_list})
if(_libraries_work)
# Test this combination of libraries.
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_threads})
# message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
if (_CHECK_FORTRAN)
check_fortran_function_exists("${_name}" ${_prefix}${_combined_name}_WORKS)
else()
check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS)
endif()
set(CMAKE_REQUIRED_LIBRARIES)
mark_as_advanced(${_prefix}${_combined_name}_WORKS)
set(_libraries_work ${${_prefix}${_combined_name}_WORKS})
endif(_libraries_work)
if(NOT _libraries_work)
set(${LIBRARIES} FALSE)
endif(NOT _libraries_work)
#message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
endmacro(Check_Fortran_Libraries)
set(BLAS_LINKER_FLAGS)
set(BLAS_LIBRARIES)
set(BLAS95_LIBRARIES)
if ($ENV{BLA_VENDOR} MATCHES ".+")
set(BLA_VENDOR $ENV{BLA_VENDOR})
else ($ENV{BLA_VENDOR} MATCHES ".+")
if(NOT BLA_VENDOR)
set(BLA_VENDOR "All")
endif(NOT BLA_VENDOR)
endif ($ENV{BLA_VENDOR} MATCHES ".+")
if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
if(NOT BLAS_LIBRARIES)
# gotoblas (http://www.tacc.utexas.edu/tacc-projects/gotoblas2)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
sgemm
""
"goto2"
""
)
endif(NOT BLAS_LIBRARIES)
endif (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
if (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All")
if(NOT BLAS_LIBRARIES)
# BLAS in ATLAS library? (http://math-atlas.sourceforge.net/)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
dgemm
""
"f77blas;atlas"
""
)
endif(NOT BLAS_LIBRARIES)
endif (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All")
# BLAS in PhiPACK libraries? (requires generic BLAS lib, too)
if (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All")
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
sgemm
""
"sgemm;dgemm;blas"
""
)
endif(NOT BLAS_LIBRARIES)
endif (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All")
# BLAS in Alpha CXML library?
if (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All")
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
sgemm
""
"cxml"
""
)
endif(NOT BLAS_LIBRARIES)
endif (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All")
# BLAS in Alpha DXML library? (now called CXML, see above)
if (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All")
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
sgemm
""
"dxml"
""
)
endif(NOT BLAS_LIBRARIES)
endif (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All")
# BLAS in Sun Performance library?
if (BLA_VENDOR STREQUAL "SunPerf" OR BLA_VENDOR STREQUAL "All")
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
sgemm
"-xlic_lib=sunperf"
"sunperf;sunmath"
""
)
if(BLAS_LIBRARIES)
set(BLAS_LINKER_FLAGS "-xlic_lib=sunperf")
endif(BLAS_LIBRARIES)
endif(NOT BLAS_LIBRARIES)
endif (BLA_VENDOR STREQUAL "SunPerf" OR BLA_VENDOR STREQUAL "All")
# BLAS in SCSL library? (SGI/Cray Scientific Library)
if (BLA_VENDOR STREQUAL "SCSL" OR BLA_VENDOR STREQUAL "All")
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
sgemm
""
"scsl"
""
)
endif(NOT BLAS_LIBRARIES)
endif (BLA_VENDOR STREQUAL "SCSL" OR BLA_VENDOR STREQUAL "All")
# BLAS in SGIMATH library?
if (BLA_VENDOR STREQUAL "SGIMATH" OR BLA_VENDOR STREQUAL "All")
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
sgemm
""
"complib.sgimath"
""
)
endif(NOT BLAS_LIBRARIES)
endif (BLA_VENDOR STREQUAL "SGIMATH" OR BLA_VENDOR STREQUAL "All")
# BLAS in IBM ESSL library? (requires generic BLAS lib, too)
if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
sgemm
""
"essl;blas"
""
)
endif(NOT BLAS_LIBRARIES)
endif (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
#BLAS in acml library?
if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
if( ((BLA_VENDOR STREQUAL "ACML") AND (NOT BLAS_ACML_LIB_DIRS)) OR
((BLA_VENDOR STREQUAL "ACML_MP") AND (NOT BLAS_ACML_MP_LIB_DIRS)) OR
((BLA_VENDOR STREQUAL "ACML_GPU") AND (NOT BLAS_ACML_GPU_LIB_DIRS))
)
# try to find acml in "standard" paths
if( WIN32 )
file( GLOB _ACML_ROOT "C:/AMD/acml*/ACML-EULA.txt" )
else()
file( GLOB _ACML_ROOT "/opt/acml*/ACML-EULA.txt" )
endif()
if( WIN32 )
file( GLOB _ACML_GPU_ROOT "C:/AMD/acml*/GPGPUexamples" )
else()
file( GLOB _ACML_GPU_ROOT "/opt/acml*/GPGPUexamples" )
endif()
list(GET _ACML_ROOT 0 _ACML_ROOT)
list(GET _ACML_GPU_ROOT 0 _ACML_GPU_ROOT)
if( _ACML_ROOT )
get_filename_component( _ACML_ROOT ${_ACML_ROOT} PATH )
if( SIZEOF_INTEGER EQUAL 8 )
set( _ACML_PATH_SUFFIX "_int64" )
else()
set( _ACML_PATH_SUFFIX "" )
endif()
if( CMAKE_Fortran_COMPILER_ID STREQUAL "Intel" )
set( _ACML_COMPILER32 "ifort32" )
set( _ACML_COMPILER64 "ifort64" )
elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "SunPro" )
set( _ACML_COMPILER32 "sun32" )
set( _ACML_COMPILER64 "sun64" )
elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "PGI" )
set( _ACML_COMPILER32 "pgi32" )
if( WIN32 )
set( _ACML_COMPILER64 "win64" )
else()
set( _ACML_COMPILER64 "pgi64" )
endif()
elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "Open64" )
# 32 bit builds not supported on Open64 but for code simplicity
# We'll just use the same directory twice
set( _ACML_COMPILER32 "open64_64" )
set( _ACML_COMPILER64 "open64_64" )
elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "NAG" )
set( _ACML_COMPILER32 "nag32" )
set( _ACML_COMPILER64 "nag64" )
else() #if( CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" )
set( _ACML_COMPILER32 "gfortran32" )
set( _ACML_COMPILER64 "gfortran64" )
endif()
if( BLA_VENDOR STREQUAL "ACML_MP" )
set(_ACML_MP_LIB_DIRS
"${_ACML_ROOT}/${_ACML_COMPILER32}_mp${_ACML_PATH_SUFFIX}/lib"
"${_ACML_ROOT}/${_ACML_COMPILER64}_mp${_ACML_PATH_SUFFIX}/lib" )
else() #if( _BLAS_VENDOR STREQUAL "ACML" )
set(_ACML_LIB_DIRS
"${_ACML_ROOT}/${_ACML_COMPILER32}${_ACML_PATH_SUFFIX}/lib"
"${_ACML_ROOT}/${_ACML_COMPILER64}${_ACML_PATH_SUFFIX}/lib" )
endif()
endif()
elseif(BLAS_${BLA_VENDOR}_LIB_DIRS)
set(_${BLA_VENDOR}_LIB_DIRS ${BLAS_${BLA_VENDOR}_LIB_DIRS})
endif()
if( BLA_VENDOR STREQUAL "ACML_MP" )
foreach( BLAS_ACML_MP_LIB_DIRS ${_ACML_MP_LIB_DIRS})
check_fortran_libraries (
BLAS_LIBRARIES
BLAS
sgemm
"" "acml_mp;acml_mv" "" ${BLAS_ACML_MP_LIB_DIRS}
)
if( BLAS_LIBRARIES )
break()
endif()
endforeach()
elseif( BLA_VENDOR STREQUAL "ACML_GPU" )
foreach( BLAS_ACML_GPU_LIB_DIRS ${_ACML_GPU_LIB_DIRS})
check_fortran_libraries (
BLAS_LIBRARIES
BLAS
sgemm
"" "acml;acml_mv;CALBLAS" "" ${BLAS_ACML_GPU_LIB_DIRS}
)
if( BLAS_LIBRARIES )
break()
endif()
endforeach()
else() #if( _BLAS_VENDOR STREQUAL "ACML" )
foreach( BLAS_ACML_LIB_DIRS ${_ACML_LIB_DIRS} )
check_fortran_libraries (
BLAS_LIBRARIES
BLAS
sgemm
"" "acml;acml_mv" "" ${BLAS_ACML_LIB_DIRS}
)
if( BLAS_LIBRARIES )
break()
endif()
endforeach()
endif()
# Either acml or acml_mp should be in LD_LIBRARY_PATH but not both
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
sgemm
""
"acml;acml_mv"
""
)
endif(NOT BLAS_LIBRARIES)
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
sgemm
""
"acml_mp;acml_mv"
""
)
endif(NOT BLAS_LIBRARIES)
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
sgemm
""
"acml;acml_mv;CALBLAS"
""
)
endif(NOT BLAS_LIBRARIES)
endif () # ACML
# Apple BLAS library?
if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
dgemm
""
"Accelerate"
""
)
endif(NOT BLAS_LIBRARIES)
endif (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
if ( NOT BLAS_LIBRARIES )
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
dgemm
""
"vecLib"
""
)
endif ( NOT BLAS_LIBRARIES )
endif (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
# Generic BLAS library?
if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
sgemm
""
"blas"
""
)
endif(NOT BLAS_LIBRARIES)
endif (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
#BLAS in intel mkl 10 library? (em64t 64bit)
if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
if (NOT WIN32)
set(LM "-lm")
endif ()
if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
if(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
find_package(Threads)
else(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
find_package(Threads REQUIRED)
endif(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
if (WIN32)
if(BLA_F95)
if(NOT BLAS95_LIBRARIES)
check_fortran_libraries(
BLAS95_LIBRARIES
BLAS
sgemm
""
"mkl_blas95;mkl_intel_c;mkl_intel_thread;mkl_core;libguide40"
""
)
endif(NOT BLAS95_LIBRARIES)
else(BLA_F95)
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
SGEMM
""
"mkl_c_dll;mkl_intel_thread_dll;mkl_core_dll;libguide40"
""
)
endif(NOT BLAS_LIBRARIES)
endif(BLA_F95)
else(WIN32)
if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
if(BLA_F95)
if(NOT BLAS95_LIBRARIES)
check_fortran_libraries(
BLAS95_LIBRARIES
BLAS
sgemm
""
"mkl_blas95;mkl_intel;mkl_intel_thread;mkl_core;guide"
"${CMAKE_THREAD_LIBS_INIT};${LM}"
)
endif(NOT BLAS95_LIBRARIES)
else(BLA_F95)
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
sgemm
""
"mkl_intel;mkl_intel_thread;mkl_core;guide"
"${CMAKE_THREAD_LIBS_INIT}"
"${LM}"
)
endif(NOT BLAS_LIBRARIES)
endif(BLA_F95)
endif (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
if (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All")
if(BLA_F95)
if(NOT BLAS95_LIBRARIES)
check_fortran_libraries(
BLAS95_LIBRARIES
BLAS
sgemm
""
"mkl_blas95;mkl_intel_lp64;mkl_intel_thread;mkl_core;guide"
"${CMAKE_THREAD_LIBS_INIT};${LM}"
)
endif(NOT BLAS95_LIBRARIES)
else(BLA_F95)
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
sgemm
""
"mkl_intel_lp64;mkl_intel_thread;mkl_core;guide"
"${CMAKE_THREAD_LIBS_INIT};${LM}"
)
endif(NOT BLAS_LIBRARIES)
endif(BLA_F95)
endif (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All")
endif (WIN32)
#older vesions of intel mkl libs
# BLAS in intel mkl library? (shared)
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
sgemm
""
"mkl;guide"
"${CMAKE_THREAD_LIBS_INIT};${LM}"
)
endif(NOT BLAS_LIBRARIES)
#BLAS in intel mkl library? (static, 32bit)
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
sgemm
""
"mkl_ia32;guide"
"${CMAKE_THREAD_LIBS_INIT};${LM}"
)
endif(NOT BLAS_LIBRARIES)
#BLAS in intel mkl library? (static, em64t 64bit)
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
sgemm
""
"mkl_em64t;guide"
"${CMAKE_THREAD_LIBS_INIT};${LM}"
)
endif(NOT BLAS_LIBRARIES)
endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
endif (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
if(BLA_F95)
if(BLAS95_LIBRARIES)
set(BLAS95_FOUND TRUE)
else(BLAS95_LIBRARIES)
set(BLAS95_FOUND FALSE)
endif(BLAS95_LIBRARIES)
if(NOT BLAS_FIND_QUIETLY)
if(BLAS95_FOUND)
message(STATUS "A library with BLAS95 API found.")
else(BLAS95_FOUND)
if(BLAS_FIND_REQUIRED)
message(FATAL_ERROR
"A required library with BLAS95 API not found. Please specify library location.")
else(BLAS_FIND_REQUIRED)
message(STATUS
"A library with BLAS95 API not found. Please specify library location.")
endif(BLAS_FIND_REQUIRED)
endif(BLAS95_FOUND)
endif(NOT BLAS_FIND_QUIETLY)
set(BLAS_FOUND TRUE)
set(BLAS_LIBRARIES "${BLAS95_LIBRARIES}")
else(BLA_F95)
if(BLAS_LIBRARIES)
set(BLAS_FOUND TRUE)
else(BLAS_LIBRARIES)
set(BLAS_FOUND FALSE)
endif(BLAS_LIBRARIES)
if(NOT BLAS_FIND_QUIETLY)
if(BLAS_FOUND)
message(STATUS "A library with BLAS API found.")
else(BLAS_FOUND)
if(BLAS_FIND_REQUIRED)
message(FATAL_ERROR
"A required library with BLAS API not found. Please specify library location."
)
else(BLAS_FIND_REQUIRED)
message(STATUS
"A library with BLAS API not found. Please specify library location."
)
endif(BLAS_FIND_REQUIRED)
endif(BLAS_FOUND)
endif(NOT BLAS_FIND_QUIETLY)
endif(BLA_F95)
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})

View File

@@ -1,307 +0,0 @@
# - Find LAPACK library
# This module finds an installed fortran library that implements the LAPACK
# linear-algebra interface (see http://www.netlib.org/lapack/).
#
# The approach follows that taken for the autoconf macro file, acx_lapack.m4
# (distributed at http://ac-archive.sourceforge.net/ac-archive/acx_lapack.html).
#
# This module sets the following variables:
# LAPACK_FOUND - set to true if a library implementing the LAPACK interface
# is found
# LAPACK_LINKER_FLAGS - uncached list of required linker flags (excluding -l
# and -L).
# LAPACK_LIBRARIES - uncached list of libraries (using full path name) to
# link against to use LAPACK
# LAPACK95_LIBRARIES - uncached list of libraries (using full path name) to
# link against to use LAPACK95
# LAPACK95_FOUND - set to true if a library implementing the LAPACK f95
# interface is found
# BLA_STATIC if set on this determines what kind of linkage we do (static)
# BLA_VENDOR if set checks only the specified vendor, if not set checks
# all the possibilities
# BLA_F95 if set on tries to find the f95 interfaces for BLAS/LAPACK
### List of vendors (BLA_VENDOR) valid in this module
## Intel(mkl), ACML,Apple, NAS, Generic
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
set(_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES)
if (NOT _LANGUAGES_ MATCHES Fortran)
include(CheckFunctionExists)
else (NOT _LANGUAGES_ MATCHES Fortran)
include(CheckFortranFunctionExists)
endif (NOT _LANGUAGES_ MATCHES Fortran)
set(LAPACK_FOUND FALSE)
set(LAPACK95_FOUND FALSE)
# TODO: move this stuff to separate module
macro(Check_Lapack_Libraries LIBRARIES _prefix _name _flags _list _blas _threads)
# This macro checks for the existence of the combination of fortran libraries
# given by _list. If the combination is found, this macro checks (using the
# Check_Fortran_Function_Exists macro) whether can link against that library
# combination using the name of a routine given by _name using the linker
# flags given by _flags. If the combination of libraries is found and passes
# the link test, LIBRARIES is set to the list of complete library paths that
# have been found. Otherwise, LIBRARIES is set to FALSE.
# N.B. _prefix is the prefix applied to the names of all cached variables that
# are generated internally and marked advanced by this macro.
set(_libraries_work TRUE)
set(${LIBRARIES})
set(_combined_name)
if (NOT _libdir)
if (WIN32)
set(_libdir ENV LIB)
elseif (APPLE)
set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV DYLD_LIBRARY_PATH)
else ()
set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH)
endif ()
endif ()
foreach(_library ${_list})
set(_combined_name ${_combined_name}_${_library})
if(_libraries_work)
if (BLA_STATIC)
if (WIN32)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
endif ( WIN32 )
if (APPLE)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
else (APPLE)
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
endif (APPLE)
else (BLA_STATIC)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
# for ubuntu's libblas3gf and liblapack3gf packages
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf)
endif ()
endif (BLA_STATIC)
find_library(${_prefix}_${_library}_LIBRARY
NAMES ${_library}
PATHS ${_libdir}
)
mark_as_advanced(${_prefix}_${_library}_LIBRARY)
set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
set(_libraries_work ${${_prefix}_${_library}_LIBRARY})
endif(_libraries_work)
endforeach(_library ${_list})
if(_libraries_work)
# Test this combination of libraries.
if(UNIX AND BLA_STATIC)
set(CMAKE_REQUIRED_LIBRARIES ${_flags} "-Wl,--start-group" ${${LIBRARIES}} ${_blas} "-Wl,--end-group" ${_threads})
else(UNIX AND BLA_STATIC)
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_blas} ${_threads})
endif(UNIX AND BLA_STATIC)
# message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
if (NOT _LANGUAGES_ MATCHES Fortran)
check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS)
else (NOT _LANGUAGES_ MATCHES Fortran)
check_fortran_function_exists(${_name} ${_prefix}${_combined_name}_WORKS)
endif (NOT _LANGUAGES_ MATCHES Fortran)
set(CMAKE_REQUIRED_LIBRARIES)
mark_as_advanced(${_prefix}${_combined_name}_WORKS)
set(_libraries_work ${${_prefix}${_combined_name}_WORKS})
#message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
endif(_libraries_work)
if(_libraries_work)
set(${LIBRARIES} ${${LIBRARIES}} ${_blas} ${_threads})
else(_libraries_work)
set(${LIBRARIES} FALSE)
endif(_libraries_work)
endmacro(Check_Lapack_Libraries)
set(LAPACK_LINKER_FLAGS)
set(LAPACK_LIBRARIES)
set(LAPACK95_LIBRARIES)
if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
find_package(BLAS)
else(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
find_package(BLAS REQUIRED)
endif(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
if(BLAS_FOUND)
set(LAPACK_LINKER_FLAGS ${BLAS_LINKER_FLAGS})
if ($ENV{BLA_VENDOR} MATCHES ".+")
set(BLA_VENDOR $ENV{BLA_VENDOR})
else ($ENV{BLA_VENDOR} MATCHES ".+")
if(NOT BLA_VENDOR)
set(BLA_VENDOR "All")
endif(NOT BLA_VENDOR)
endif ($ENV{BLA_VENDOR} MATCHES ".+")
if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
if(NOT LAPACK_LIBRARIES)
check_lapack_libraries(
LAPACK_LIBRARIES
LAPACK
cheev
""
"goto2"
"${BLAS_LIBRARIES}"
""
)
endif(NOT LAPACK_LIBRARIES)
endif (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
#acml lapack
if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
if (BLAS_LIBRARIES MATCHES ".+acml.+")
set (LAPACK_LIBRARIES ${BLAS_LIBRARIES})
endif ()
endif ()
# Apple LAPACK library?
if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
if(NOT LAPACK_LIBRARIES)
check_lapack_libraries(
LAPACK_LIBRARIES
LAPACK
cheev
""
"Accelerate"
"${BLAS_LIBRARIES}"
""
)
endif(NOT LAPACK_LIBRARIES)
endif (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
if ( NOT LAPACK_LIBRARIES )
check_lapack_libraries(
LAPACK_LIBRARIES
LAPACK
cheev
""
"vecLib"
"${BLAS_LIBRARIES}"
""
)
endif ( NOT LAPACK_LIBRARIES )
endif (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
# Generic LAPACK library?
if (BLA_VENDOR STREQUAL "Generic" OR
BLA_VENDOR STREQUAL "ATLAS" OR
BLA_VENDOR STREQUAL "All")
if ( NOT LAPACK_LIBRARIES )
check_lapack_libraries(
LAPACK_LIBRARIES
LAPACK
cheev
""
"lapack"
"${BLAS_LIBRARIES}"
""
)
endif ( NOT LAPACK_LIBRARIES )
endif ()
#intel lapack
if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
find_PACKAGE(Threads)
else(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
find_package(Threads REQUIRED)
endif(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
if (BLA_F95)
if(NOT LAPACK95_LIBRARIES)
check_lapack_libraries(
LAPACK95_LIBRARIES
LAPACK
cheev
""
"mkl_lapack95"
"${BLAS95_LIBRARIES}"
"${CMAKE_THREAD_LIBS_INIT}"
)
endif(NOT LAPACK95_LIBRARIES)
else(BLA_F95)
if(NOT LAPACK_LIBRARIES)
check_lapack_libraries(
LAPACK_LIBRARIES
LAPACK
cheev
""
"mkl_lapack"
"${BLAS_LIBRARIES}"
"${CMAKE_THREAD_LIBS_INIT}"
)
endif(NOT LAPACK_LIBRARIES)
endif(BLA_F95)
endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
endif(BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
else(BLAS_FOUND)
message(STATUS "LAPACK requires BLAS")
endif(BLAS_FOUND)
if(BLA_F95)
if(LAPACK95_LIBRARIES)
set(LAPACK95_FOUND TRUE)
else(LAPACK95_LIBRARIES)
set(LAPACK95_FOUND FALSE)
endif(LAPACK95_LIBRARIES)
if(NOT LAPACK_FIND_QUIETLY)
if(LAPACK95_FOUND)
message(STATUS "A library with LAPACK95 API found.")
else(LAPACK95_FOUND)
if(LAPACK_FIND_REQUIRED)
message(FATAL_ERROR
"A required library with LAPACK95 API not found. Please specify library location."
)
else(LAPACK_FIND_REQUIRED)
message(STATUS
"A library with LAPACK95 API not found. Please specify library location."
)
endif(LAPACK_FIND_REQUIRED)
endif(LAPACK95_FOUND)
endif(NOT LAPACK_FIND_QUIETLY)
set(LAPACK_FOUND "${LAPACK95_FOUND}")
set(LAPACK_LIBRARIES "${LAPACK95_LIBRARIES}")
else(BLA_F95)
if(LAPACK_LIBRARIES)
set(LAPACK_FOUND TRUE)
else(LAPACK_LIBRARIES)
set(LAPACK_FOUND FALSE)
endif(LAPACK_LIBRARIES)
if(NOT LAPACK_FIND_QUIETLY)
if(LAPACK_FOUND)
message(STATUS "A library with LAPACK API found.")
else(LAPACK_FOUND)
if(LAPACK_FIND_REQUIRED)
message(FATAL_ERROR
"A required library with LAPACK API not found. Please specify library location."
)
else(LAPACK_FIND_REQUIRED)
message(STATUS
"A library with LAPACK API not found. Please specify library location."
)
endif(LAPACK_FIND_REQUIRED)
endif(LAPACK_FOUND)
endif(NOT LAPACK_FIND_QUIETLY)
endif(BLA_F95)
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})

View File

@@ -816,7 +816,7 @@ HTML_COLORSTYLE_GAMMA = 80
# page will contain the date and time when the page was generated. Setting
# this to NO can help when comparing the output of multiple runs.
HTML_TIMESTAMP = YES
HTML_TIMESTAMP = NO
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the

View File

@@ -93,6 +93,16 @@ if(NOT @opm-project_NAME@_FOUND)
# this is the contents of config.h as far as our probes can tell:
# Require correct CMake standard. Needed for user modules as
# some software will add incompatible compile switches like
# -std=gnu++11 otherwise when search for (I guess because of
# imported targets using INTERFACE_COMPILE_FEATURES), and will
# break compilation because of missing c++17 features.
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD @CMAKE_CXX_STANDARD@)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
endif()
# The settings in this block do not mix well with the DEST_PREFIX
# setting.
@@ -104,6 +114,7 @@ if(NOT @opm-project_NAME@_FOUND)
@OPM_PROJECT_EXTRA_CODE@
# end extra code
include(OpmPackage)
include(@opm-project_NAME@-prereqs)
endif()
endif()

View File

@@ -9,5 +9,6 @@ Name: @name@
Description: @description@ @major@.@minor@
Version: @major@.@minor@
URL: http://opm-project.org
Libs: @target@ @libs@
Libs.private: @libs@
Libs: @target@
Cflags: @includes@ @defs@

5
debian/changelog vendored
View File

@@ -1,5 +0,0 @@
opm-common (2019.04-pre~xenial) xenial; urgency=medium
* New release
-- Arne Morten Kvarving <arne.morten.kvarving@sintef.no> Mon, 19 Oct 2015 10:49:00 +0200

1
debian/compat vendored
View File

@@ -1 +0,0 @@
9

64
debian/control vendored
View File

@@ -1,64 +0,0 @@
Source: opm-common
Priority: extra
Maintainer: Arne Morten Kvarving <arne.morten.kvarving@sintef.no>
Build-Depends: build-essential, debhelper (>= 9),
pkg-config, cmake, git, libtool, doxygen, graphviz,
texlive-latex-extra, texlive-latex-recommended,
ghostscript, libboost-system-dev, libboost-test-dev,
zlib1g-dev, libpython3-dev, python3-numpy, python3-distutils,
python3-setuptools, python3-setuptools-scm, python3-pytest-runner,
python3-decorator
Standards-Version: 3.9.2
Section: libs
Homepage: http://opm-project.org
Vcs-Git: git://github.com/OPM/opm-common.git
Vcs-Browser: https://github.com/OPM/opm-common
Package: libopm-common1
Section: libs
Pre-Depends: ${misc:Pre-Depends}
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends}, ${misc:Depends}
Provides: libopm-common
Description: OPM common library
The OPM common library contains generic code shared across all OPM modules.
Package: libopm-common1-bin
Section: libs
Pre-Depends: ${misc:Pre-Depends}
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends}, ${misc:Depends}
Provides: libopm-common-bin
Description: OPM common binaries
The OPM common binaries.
Package: libopm-common1-dev
Section: libdevel
Architecture: any
Multi-Arch: foreign
Provides: libopm-common-dev
Suggests: libopm-common1-doc
Depends: libopm-common1 (= ${binary:Version})
Description: OPM common library -- development files
The OPM common library contains the shared buildsystem
and helpers shared across all OPM modules.
Package: libopm-common1-doc
Section: doc
Architecture: all
Multi-Arch: foreign
Provides: libopm-common-doc
Description: OPM common library -- documentation
The OPM common library contains the shared buildsystem
and helpers shared across all OPM modules.
Package: python3-opm-common
Section: libs
Pre-Depends: ${misc:Pre-Depends}
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends}, ${misc:Depends}, libopm-common1, python3-numpy, python3-decorator
Description: OPM common python bindings
Python package for opm-common

13
debian/copyright vendored
View File

@@ -1,13 +0,0 @@
License: GPL-3+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>

2
debian/docs vendored
View File

@@ -1,2 +0,0 @@
LICENSE
README.md

View File

@@ -1 +0,0 @@
usr/bin/*

View File

@@ -1,6 +0,0 @@
usr/include/*
usr/lib/dunecontrol/*
usr/lib/*/pkgconfig/*
usr/share/cmake/*
usr/share/opm/*
usr/lib/*/lib*.so

View File

@@ -1 +0,0 @@
usr/share/doc/*

View File

@@ -1 +0,0 @@
usr/lib/*/lib*.so.*

View File

@@ -1 +0,0 @@
usr/lib/python*/*

29
debian/rules vendored
View File

@@ -1,29 +0,0 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
%:
dh $@ --parallel
override_dh_auto_clean:
dh_auto_clean --buildsystem=cmake
override_dh_auto_build:
dh_auto_build --buildsystem=cmake
# consider using -DUSE_VERSIONED_DIR=ON if backporting
override_dh_auto_configure:
dh_auto_configure --buildsystem=cmake -- -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSTRIP_DEBUGGING_SYMBOLS=ON -DBUILD_SHARED_LIBS=1 -DCMAKE_INSTALL_DOCDIR=share/doc/libopm-common1 -DWHOLE_PROG_OPTIM=ON -DUSE_RUNPATH=OFF -DWITH_NATIVE=OFF -DOPM_ENABLE_PYTHON=1 -DOPM_INSTALL_PYTHON=1 -DPYTHON_EXECUTABLE=/usr/bin/python3
override_dh_auto_install:
dh_auto_install -- install-html
override_dh_installdocs:
dh_installdocs --link-doc=libopm-common1

View File

@@ -1 +0,0 @@
1.0

View File

@@ -153,7 +153,7 @@ we currently have five different categories:
To infer the number of records in the keyword based on an
internal calculation is not supported, hence for these keywords
size is given as unkown, and the keywords are terminated when the
size is given as unknown, and the keywords are terminated when the
next valid keyword is found:
{"name" : "VFPPROD" , "size" : "UNKNOWN", ....
@@ -297,7 +297,7 @@ composite units based on the dimension of the composite quantity. As a
consequence the list of dimensions supported by the parser is long,
and growing. The current list can be found in the source file:
opm/parser/eclipse/Units/UnitSystem.cpp
opm/input/eclipse/Units/UnitSystem.cpp

63
docs/man1/compareECL.1 Normal file
View File

@@ -0,0 +1,63 @@
.TH COMPAREECL "1" "April 2022" "compareECL 2022.04" "User Commands"
.SH NAME
compareECL \- Comparator for Eclipse files
.SH DESCRIPTION
compareECL compares ECLIPSE files (restart (.RST), unified restart (.UNRST), initial (.INIT), summary (.SMRY), unified summary (.UNSMRY) or .RFT) and gridsizes (from .EGRID or .GRID file) from two simulations.
The program takes four arguments:
.PP
1. Case number 1, reference case (full path without extension)
2. Case number 2, test case (full path without extension)
3. Absolute tolerance
4. Relative tolerance (between 0 and 1)
.PP
.SH OPTIONS
.HP
In addition, the program takes these options (which must be given before the arguments):
.PP
\fB\-a\fR Run a full analysis of errors.
.TP
\fB\-h\fR Print help and exit.
.TP
\fB\-d\fR Use report steps only when comparing results from summary files.
.TP
\fB\-i\fR Execute integration test (regression test is default).
.IP
The integration test compares SGAS, SWAT and PRESSURE in unified restart files, and WOPR, WGPR, WWPR and WBHP (all wells) in summary file.
.PP
\fB\-k\fR Specify specific keyword to compare (capitalized), for examples \fB\-k\fR PRESSURE or \fB\-k\fR WOPR:A\-1H
.TP
\fB\-l\fR Only do comparison for the last Report Step. This option is only valid for restart files.
.TP
\fB\-n\fR Do not throw on errors.
.TP
\fB\-p\fR Print keywords in both cases and exit.
.TP
\fB\-r\fR compare a spesific report time step number in a restart file.
.TP
\fB\-t\fR Specify ECLIPSE filetype to compare, (default behaviour is that all files are compared if found). Different possible arguments are:
.IP
\fB\-t\fR UNRST
Compare two unified restart files (.UNRST). This the default value, so it is the same as not passing option \fB\-t\fR.
.IP
\fB\-t\fR EGRID
Compare two EGrid files (.EGRID).
.IP
\fB\-t\fR INIT
Compare two initial files (.INIT).
.IP
\fB\-t\fR RFT
Compare two RFT files (.RFT).
.IP
\fB\-t\fR SMRY
Compare two cases consistent of (unified) summary files.
.PP
\fB\-x\fR Allow extra keywords in case number 2. These additional keywords (not found in case number1) will be ignored in the comparison.
.PP
.SH Example usage of the program:
.PP
compareECL \fB\-k\fR PRESSURE <path to first casefile> <path to second casefile> 1e\-3 1e\-5
compareECL \fB\-t\fR INIT \fB\-k\fR PORO <path to first casefile> <path to second casefile> 1e\-3 1e\-5
compareECL \fB\-i\fR <path to first casefile> <path to second casefile> 0.01 1e\-6
.PP
Exceptions are thrown (and hence program exits) when deviations are larger than the specified tolerances, or when the number of cells does not match \fB\-\-\fR either in the grid file or for a specific keyword. Information about the keyword, keyword occurrence (zero based) and cell coordinate is printed when an exception is thrown. For more information about how the cases are compared, see the documentation of the EclFilesComparator class.

18
docs/man1/convertECL.1 Normal file
View File

@@ -0,0 +1,18 @@
.TH CONVERTECL "1" "April 2022" "convertECL 2022.04" "User Commands"
.SH NAME
convertECL \- Converter for Eclipse files (binary <-> formatted format)
.SH DESCRIPTION
convertECL needs one argument which is the input file to be converted. If this is a binary file the output file will be formatted. If the input file is formatted the output will be binary.
.PP
In addition, the program takes these options (which must be given before the arguments):
.PP
.SH OPTIONS
.HP
\fB\-h\fR Print help and exit.
.TP
\fB\-l\fR list report step numbers in the selected restart file.
.TP
\fB\-i\fR Enforce IX standard on output file.
.TP
\fB\-r\fR extract and convert a spesific report time step number from a unified restart file.
.PP

41
docs/man1/opmhash.1 Normal file
View File

@@ -0,0 +1,41 @@
.TH OPMHASH "1" "April 2022" "opmhash 2022.04" "User Commands"
.SH NAME
opmhash \- Hasher for summary keywords in Eclipse files
.SH DESCRIPTION
opmhash: invalid option \fB\-\-\fR 'h'
The purpose of the opmhash program is to load a deck and create a summary, by
diffing two such summaries it is simple to determine if two decks are similar.
For each keyword a hash of the normalized content is calculated. The output of
the program will look like this:
.TP
RUNSPEC
: 13167205945009276792
.TP
TITLE
: 16047371705964514902
.TP
DIMENS
: 1264233216877515756
.TP
NONNC
: 10052807539267647959
.TP
OIL
: 6013609912232720008
.TP
WATER
: 14106203893673265964
.TP
Total
: 7362809723723482303
.PP
Where the 'random' integer following each keyword is the hash of the content of
that keyword. The hashing is insensitive to changes in white\-space and comments
and file location. At the bottom comes a total hash of the complete content. The
hash of each keyword is insensitive to shuffling of keywords, but the total hash
depends on the keyword order.
.SH OPTIONS
.HP
\fB\-l\fR : Add filename and linenumber information to each keyword.
.HP
\fB\-s\fR : Short form \- only print the hash of the complete deck.

28
docs/man1/opmpack.1 Normal file
View File

@@ -0,0 +1,28 @@
.TH OPMPACK "1" "April 2022" "opmpack 2022.04" "User Commands"
.SH NAME
opmpack \- Validator and printer of deck in Eclipse files without comments
.SH DESCRIPTION
The opmpack program will load a deck, resolve all include
files and then print it out again on stdout. All comments
will be stripped and the value types will be validated.
.PP
By passing the option \fB\-o\fR you can redirect the output to a file
or a directory.
.PP
Print on stdout:
.TP
opmpack
\fI\,/path/to/case/CASE.DATA\/\fP
.PP
Print MY_CASE.DATA in /tmp:
.IP
opmpack \fB\-o\fR \fI\,/tmp\/\fP /path/to/MY_CASE.DATA
.PP
Print NEW_CASE in cwd:
.IP
opmpack \fB\-o\fR NEW_CASE.DATA path/to/MY_CASE.DATA
.PP
As an alternative to the \fB\-o\fR option you can use \fB\-c\fR; that is equivalent to \fB\-o\fR \-
but restart and import files referred to in the deck are also copied. The \fB\-o\fR and
\fB\-c\fR options are mutually exclusive.

180
docs/man1/rst_deck.1 Normal file
View File

@@ -0,0 +1,180 @@
.TH RST_DECK: "1" "April 2022" "rst_deck 2022.04" "User Commands"
.SH NAME
rst_deck \- Convert simulation deck to a deck ready for restart
.SH DESCRIPTION
The rst_deck program will load a simulation deck and parameters for a restart
and reformat the deck to become a restart deck. Before the updated deck is
output the program will update the SOLUTION and SCHEDULE sections. All keywords
from the SOLUTION section will be cleared out(1) and a RESTART keyword will be
inserted. In the SCHEDULE section the program can either remove all keywords up
until the restart date, or alternatively insert SKIPREST immediately following
the SCHEDULE keyword.
.PP
When creating the updated restart deck the program can either link to unmodified
include files with INCLUDE statements, create a copy of deck structure in an
alternative location or create one large file with all keywords in the same
file. Apart from the alterations to support restart the output deck will be
equivalent to the input deck, but formatting is not retained and comments have
been stripped away.
.PP
Arguments:
.PP
1. The data file we are starting with.
.PP
2. The restart source; this can either be a basename with an optional path
.IP
prefix and a :N to restart from step N; alternatively you can point to an
existing restart file. If you point to an existing restart file the input
will be validated in several ways:
.IP
a) Unified/multiple files will be checked against the UNIFIN setting of
.IP
the deck.
.IP
b) Formatted/unformatted will be checked against the FMTIn setting of the
.IP
deck.
.IP
c) If a single file like \fI\,/path/to/case/HISTORY.X0067\/\fP is given as argument the
.IP
:N notation to denote report step should not be used.
.IP
If the restart argument is given as the path to an existing file the content
of the RESTART keyword will be updated to contain the correct path from the
location of the restart deck to the location of the restart file. This path
awareness will be fooled if the restart deck is redirected from stdout to a
path different from cwd. If the restart argument is given as an absolute
filename the RESTART keyword will have an absolute path, if the restart
argument is a relative path the RESTART keyword will get a relative path \-
although an absolute path will be used if the restart file and the output
deck have different roots. If the restart argument is given as a string not
pointing to an existing file it will be inserted verbatim in the restart
deck.
.IP
A restart step value of 0 is interpreted as a dry run \- a deck which has not
been set up for restart will be written out.
.PP
3. Basename of the restart deck we create, can optionally contain a path prefix;
.IP
the path will be created if it does not already exist. This argument is
optional, if it is not provided the program will dump a restart deck on
stdout. If the argument corresponds to an existing directory the restart case
will get the same name as the base case.
.SH OPTIONS
\fB\-s\fR: Manipulate the SCHEDULE section by inserting a SKIPREST keyword immediately
.IP
following the SCHEDULE keyword. If the \fB\-s\fR option is not used the SCHEDULE
section will be modified by removing all keywords until we reach the restart
date.
.PP
\fB\-m\fR: [share|inline|copy] The restart deck can reuse the unmodified include files
.IP
from the base case, this is mode 'share' and is the default. With mode
\&'inline' the restart deck will be one long file and with mode 'copy' the
file structure of the base case will be retained. The default if no \fB\-m\fR
option is given is the 'share' mode.
.IP
In the case of 'share' and 'copy' the correct path to include files will be
negotiated based on the path given to the output case in the third argument.
If the restart deck is passed to stdout the include files will be resolved
based on output in cwd.
.PP
Example:
.IP
rst_deck \fI\,/path/to/history/HISTORY.DATA\/\fP rst/HISTORY:30 \fI\,/path/to/rst/RESTART\/\fP \fB\-s\fR
.PP
1: The program has a compiled list of keywords which will be retained in the
.IP
SOLUTION section. The current value of that list is: RPTRST
.PP
\&../../opm\-parallel/bin/rst_deck: invalid option \fB\-\-\fR 'v'
\&../../opm\-parallel/bin/rst_deck: invalid option \fB\-\-\fR 'e'
\&../../opm\-parallel/bin/rst_deck: invalid option \fB\-\-\fR 'r'
\&../../opm\-parallel/bin/rst_deck: invalid option \fB\-\-\fR 'i'
\&../../opm\-parallel/bin/rst_deck: invalid option \fB\-\-\fR 'o'
\&../../opm\-parallel/bin/rst_deck: invalid option \fB\-\-\fR 'n'
.PP
The rst_deck program will load a simulation deck and parameters for a restart
and reformat the deck to become a restart deck. Before the updated deck is
output the program will update the SOLUTION and SCHEDULE sections. All keywords
from the SOLUTION section will be cleared out(1) and a RESTART keyword will be
inserted. In the SCHEDULE section the program can either remove all keywords up
until the restart date, or alternatively insert SKIPREST immediately following
the SCHEDULE keyword.
.PP
When creating the updated restart deck the program can either link to unmodified
include files with INCLUDE statements, create a copy of deck structure in an
alternative location or create one large file with all keywords in the same
file. Apart from the alterations to support restart the output deck will be
equivalent to the input deck, but formatting is not retained and comments have
been stripped away.
.PP
Arguments:
.PP
1. The data file we are starting with.
.PP
2. The restart source; this can either be a basename with an optional path
.IP
prefix and a :N to restart from step N; alternatively you can point to an
existing restart file. If you point to an existing restart file the input
will be validated in several ways:
.IP
a) Unified/multiple files will be checked against the UNIFIN setting of
.IP
the deck.
.IP
b) Formatted/unformatted will be checked against the FMTIn setting of the
.IP
deck.
.IP
c) If a single file like \fI\,/path/to/case/HISTORY.X0067\/\fP is given as argument the
.IP
:N notation to denote report step should not be used.
.IP
If the restart argument is given as the path to an existing file the content
of the RESTART keyword will be updated to contain the correct path from the
location of the restart deck to the location of the restart file. This path
awareness will be fooled if the restart deck is redirected from stdout to a
path different from cwd. If the restart argument is given as an absolute
filename the RESTART keyword will have an absolute path, if the restart
argument is a relative path the RESTART keyword will get a relative path \-
although an absolute path will be used if the restart file and the output
deck have different roots. If the restart argument is given as a string not
pointing to an existing file it will be inserted verbatim in the restart
deck.
.IP
A restart step value of 0 is interpreted as a dry run \- a deck which has not
been set up for restart will be written out.
.PP
3. Basename of the restart deck we create, can optionally contain a path prefix;
.IP
the path will be created if it does not already exist. This argument is
optional, if it is not provided the program will dump a restart deck on
stdout. If the argument corresponds to an existing directory the restart case
will get the same name as the base case.
.PP
\fB\-s\fR: Manipulate the SCHEDULE section by inserting a SKIPREST keyword immediately
.IP
following the SCHEDULE keyword. If the \fB\-s\fR option is not used the SCHEDULE
section will be modified by removing all keywords until we reach the restart
date.
.PP
\fB\-m\fR: [share|inline|copy] The restart deck can reuse the unmodified include files
.IP
from the base case, this is mode 'share' and is the default. With mode
\&'inline' the restart deck will be one long file and with mode 'copy' the
file structure of the base case will be retained. The default if no \fB\-m\fR
option is given is the 'share' mode.
.IP
In the case of 'share' and 'copy' the correct path to include files will be
negotiated based on the path given to the output case in the third argument.
If the restart deck is passed to stdout the include files will be resolved
based on output in cwd.
.PP
Example:
.IP
rst_deck \fI\,/path/to/history/HISTORY.DATA\/\fP rst/HISTORY:30 \fI\,/path/to/rst/RESTART\/\fP \fB\-s\fR
.PP
1: The program has a compiled list of keywords which will be retained in the
.IP
SOLUTION section. The current value of that list is: RPTRST

15
docs/man1/summary.1 Normal file
View File

@@ -0,0 +1,15 @@
.TH SUMMARY "1" "April 2022" "summary 2022.04" "User Commands"
.SH NAME
summary \- Printer for summary keys in Eclipse summary files
.SH DESCRIPTION
summary needs a minimum of two arguments. First is smspec filename and then list of vectors
.PP
In addition, the program takes these options (which must be given before the arguments):
.PP
.SH OPTIONS
\fB\-h\fR Print help and exit.
.TP
\fB\-l\fR list all summary vectors.
.TP
\fB\-r\fR extract data only for report steps.
.PP

27
docs/tm/tm.tex Normal file
View File

@@ -0,0 +1,27 @@
\documentclass[a4paper,11pt]{book}
\usepackage{verbatim}
\newcommand{\kw}[1]{\texttt{#1}}
\newcommand{\inlinecode}[1]{\texttt{#1}}
\newcommand{\flow}[0]{\texttt{flow}}
\newcommand{\eclipse}[0]{\texttt{Eclipse}}
\newcommand{\path}[1]{\texttt{#1}}
\newenvironment{deck}[0]{\verbatim}{\endverbatim}
\newenvironment{code}[0]{\verbatim}{\endverbatim}
\begin{document}
\begin{titlepage}
\begin{center}
\Huge
\textbf{Technical manual}
\end{center}
\end{titlepage}
\tableofcontents
\input{udq_actionx/udq}
\input{udq_actionx/actionx}
\input{udq_actionx/pyaction}
\end{document}

View File

@@ -0,0 +1,437 @@
\newcommand{\actionx}{\kw{ACTIONX}}
\chapter{Programming in the deck: \actionx}
\label{actionx}
The \actionx{} keyword is the most direct way to \emph{program} in the deck. The
\actionx{} functionality consist of the \actionx{} keyword itself, with some
metadata and a condition and then a list of keywords which are injected into the
in-memory representation of the \kw{SCHEDULE} section at the point in time where
the condition evaluates to true. The \actionx{} statement is evaluated at the
end of every timestep, and if it evaluates to true the new keywords should take
effect immediately. The \actionx{} conditions are less sophisticated than the
expressions used in \udq{}, this implies that a common pattern is to make
involved calculations as \udq{} expressions, and then use a simple test as
\actionx{} condition.
The \actionx{} keyword is also documented in section 12.3.6 in the \flow{}
reference manual.
\section{Structure of the \actionx{} keyword}
\label{actionx_structure}
The \actionx{} keyword itself consist of multiple records. The first record is
metadata with name of the action, the number of times the action can be
triggered and the minimum time elapsed before an action is eligible for a second
run. The subsequent records are \emph{conditions}, all the conditions are of the
same form
\begin{code}
lhs comparison rhs
\end{code}
and subsequent conditions are combined with \inlinecode{AND} or \inlinecode{OR}.
The \inlinecode{lhs} is a field, well or group quantity, in addition you can use
time variables \kw{DAY}, \kw{MNTH} and \kw{YEAR} as left hand
side\footnote{\eclipse{} supports a wider list of summary variables like region,
block and aquifer quantities on both left and right hand side.}. As with the
\udq{} variables the well and group variables are \emph{sets}, and the
evaluation status is maintained individually for each well and group.
The comparison is one of the ordinary mathematical comparison operators
\inlinecode{>,<,=,!=, <=} and \inlinecode{>=}. Numerical comparisons are done
with the corresponding plain C++ operators, this is in contrast to the \udq{}
implementation where an epsilon defined in \kw{UDQPARAMS} is used in floating
point comparisons.
The \inlinecode{rhs} is a numerical scalar, or a field, well or group quantity.
If your \inlinecode{rhs} is a well or group quantity the \inlinecode{lhs} and
\inlinecode{rhs} must be of the same type. If you use the symbol \kw{MNTH} as
\inlinecode{lhs} you can compare with named months, i.e. the following will
trigger on leap days
\begin{deck}
ACTIONX
LEAP 1000 /
MNTH=FEB AND /
DAY=29 /
/
...
...
ENDACTIO
\end{deck}
When there is a well/group quantity as \inlinecode{lhs} the evaluation status is
maintained individually for each well/group. The complete condition evaluates to
true if \emph{any} of the wells/groups satisfy the condition. In the case of
wells the wells matching the condition can subsequently be accessed with
wellname '?' in the \kw{ACTIONX} keywords, this is a quite common pattern to
e.g. close the well with highest watercut.
If there are more conditions they must be joined with a trailing \kw{AND} or
\kw{OR}, furthermore conditions can be grouped with paranthesis. The \actionx{}
expressions can only contain the four arithmetic operators $+,-,*,/$ and not
mathematical functions like $\log()$, for more advanced expressions the natural
approach is to first define a \udq{} and then use the \udq{} symbol in the
\actionx{}, this is illustrated in section \ref{uda}. When multiple conditions
involving the same well set are evaluated, the list of matching wells available
in '?' will contain all the wells from the final condition, i.e. for
\begin{code}
WWCT = {"OP1": 0.25, "OP2": 0.50, "OP3": 0.75}
\end{code}
and the action
\begin{deck}
ACTIONX
WWCT /
WWCT > 0.33 AND /
WWCT < 0.66 /
/
...
ENDACTIO
\end{deck}
the set of wells available for further use in '?' are \emph{all} the wells
matching the condition \inlinecode{WWCT < 0.66} i.e. OP1 and OP2 and \emph{not}
the wells matching the combined expression \inlinecode{0.33 < WWCT < 0.66}. In
order to select wells in a range as attempted here you will have to create an
indicator variable with \udq{} first and then select based on that indicator -
e.g. something like
\begin{deck}
UDQ
DEFINE WUCTR (WWCT < 0.66) * (WWCT > 0.33) /
/
ACTIONX
WUCTR /
WUCTR = 1 /
/
...
ENDACTIO
\end{deck}
The \actionx{} implementation is located in
\path{opm/input/eclipse/Schedule/Action} and all the classes are in namespace
\inlinecode{Action::}. As with the \udq{} the input parser needs some special
case to handle '/' and '*' as division operator and multiplier respectively, but
that is the only code shared between the \udq{} and the \actionx{}
implementation\footnote{It might be possible to share more code between the two,
in particular both have an internal recursive descent parser, but both \udq{}
and \actionx{} have so much ``personality'' that at least initially separate
implementations was the simplest.}.
The condition part of the \actionx{} keyword is internalized while the
\kw{SCHEDULE} section is parsed, the final product is maintained in a class
\inlinecode{Action::ActionX} which has a \inlinecode{eval()} method waiting to
be called. The keywords in the \actionx{} block are stored in the
\inlinecode{Action::ActionX} keyword for future use. All of the \actionx{}
keywords are stored in a container \inlinecode{Action::Actions} which will
eventually manage the book keeping of which actions are eligible for evaluation.
\section{The structure of the \inlinecode{Schedule} implementation}
\label{schedule_design}
\flow{} internalizes all keywords from the input deck and passes fully baked
datastructures to the simulator, whereas our impression is that \eclipse{} works
more like a reservoir model interepreter, executing one keywords at a time.
Mostly the \flow{} approach has worked out well, however for the \actionx{}
functionality the difference in execution model is quite acute, and the nature
of the \actionx{} keyword has had quite strong influence on the final Schedule
implementation. Although not required for use of \actionx{} it is valuable to
understand how the \actionx{} functionality has influenced the design of the
Schedule class, that way you will hopefully better understand problems or bugs
which might arise in the future.
At the very first pass the \kw{SCHEDULE} section is split in \emph{blocks}, with
one block for each report step. The blocks are implemented with the class
\inlinecode{ScheduleBlock}. Each block has a starting time and a list of
keywords, the keywords are maintained in the input format
\inlinecode{DeckKeyword}. Then the entire \kw{SCHEDULE} section is internalized
in the class \inlinecode{ScheduleDeck} which essentially contains a list of
\inlinecode{ScheduleBlock} instances. Consider the \kw{SCHEDULE} section
\begin{deck}
START
1 'JAN' 2020 /
...
...
SCHEDULE
WELSPECS
'PROD' 'G1' 10 10 8400 'OIL' /
'INJ' 'G1' 1 1 8335 'GAS' /
/
COMPDAT
'PROD' 10 10 3 3 'OPEN' 1* 1* 0.5 /
'INJ' 1 1 1 1 'OPEN' 1* 1* 0.5 /
/
-- End of block 0
DATES
1 'FEB' 2020 /
/
WCONPROD
'PROD' 'OPEN' 'ORAT' 20000 4* 1000 /
/
WCONINJE
'INJ' 'GAS' 'OPEN' 'RATE' 100000 1* 9014 /
/
-- End of block 1
DATES
1 'MAR' 2020 /
/
-- End of block 2
END
\end{deck}
When this is internalized we get a \inlinecode{ScheduleDeck} instance with three
\inlinecode{ScheduleBlock} values:
\begin{code}
ScheduleDeck sched_deck = [
ScheduleBlock {
start = "2020-01-01",
keywords = ["WELSPECS","COMPDAT"]
},
ScheduleBlock {
start = "2020-02-01",
keywords = ["WCONPROD","WCONINJE"]
},
ScheduleBlock {
start = "2020-03-01",
keywords = []
}
]
\end{code}
The \inlinecode{Schedule} class has a \inlinecode{ScheduleDeck} member. The
processed content of the \inlinecode{Schedule} class is managed in vector of
\inlinecode{ScheduleState} instances, where one \inlinecode{ScheduleState}
represents the complete dynamic input state at a particular report step. The
processed \kw{SCHEDULE} code is created with the method
\begin{code}
Schedule::iterateScheduleSection().
\end{code}
When \inlinecode{Schedule::iterateScheduleSection(report\_step)} is called it
starts by clearing the vector of \inlinecode{ScheduleState} instances from
\inlinecode{report\_step} to the end of the simulation, and then recreates those
by treating the \inlinecode{ScheduleBlock}. The advantage of this approach is
that the \inlinecode{Schedule::iterateScheduleSection(report\_step)} method is
idempotent - it can be called repeatedly, from an arbitrary point in the
timeseries.
The implementation of the \actionx{} functionality is just to append the
\actionx{} keywords in the \inlinecode{ScheduleBlock} instance corresponding to
the current report step and then rerun the
\inlinecode{Schedule::iterateScheduleSection()} from this report step.
\section{Forward references of wells and groups}
When a well or group is defined as an \actionx{} keyword and then
unconditionally referenced in the deck we get a challenge at the first pass
through the \kw{SCHEDULE} section. In the example below a new well \kw{W1} is
defined with the \kw{WELSPECS} keyword when the action \inlinecode{NEW\_WELL}
evaluates to true. At 1.st of January 2025 the well \kw{W1} is opened with the
\kw{WCONPROD} keyword. The engineer making this model assumes that the
\inlinecode{NEW\_WELL} action will evaluate to true sometime before 1.st of
January 2025, and thereby ensure that the well is fully defined when it is
eventually opened with \kw{WCONPROD}:
\begin{deck}
ACTIONX
'NEW_WELL/
WWCT OPX > 0.75 /
/
WELSPECS
'W1' 'OP' 1 1 3.33 'OIL' 7*/
/
ENDACTIO
TSTEP
10*30 /
DATES
1 'JAN' 2025 /
/
WCONPROD
'W1' 'OPEN' 'ORAT' 0.000 0.000 0.000 5* /
/
TSTEP
10*30 /
\end{deck}
For \flow{} this creates problems because the entire \kw{SCHEDULE} section is
parsed when the simulator starts, and at first pass the well \kw{W1} is unknown
in the \kw{WCONPROD} keyword. This is ``solved'' in the following way:
\begin{enumerate}
\item At first pass we inspect the keywords inside the \actionx{} block and if
we discover \kw{WELSPECS} we store the name of the well which will be defined
at a later stage through \actionx{}.
\item When we parse further on as part of the first pass and said well is
referenced e.g. in a \kw{WCONPROD} keyword, we verify that the well will
eventually appear via \actionx{} - we issue a warning and ignore the well in
the \kw{WCONPROD} keyword\footnote{If the well is not registered as ``will
appear through \actionx{}'' there will be a runtime error with unknown well
name when parsing \kw{WCONPROD}.}.
\item When the \actionx{} evaluates to true the well will be properly defined,
and when reiterating over the Schedule keywords the \kw{WCONPROD} keyword will
now be properly internalized. If the \actionx{} never evaluates to true the
\kw{WCONPROD} keyword will never be applied, and the warning from point 2 will
be the only trace of this well.
\end{enumerate}
It should be mentioned that the functionality with forward referencing of well
names is quite new\footnote{In January 2022}, there might be well keywords in
the \kw{SCHEDULE} section where the implementation is not yet prepared for this.
Furthermore the forward referencing is not at all implemented for groups. The
relevant data structure is the member \inlinecode{Action::WGNames
action\_wgnames} in the \inlinecode{Schedule} class.
\section{To enable a new keyword for \actionx}
The keywords must be explicitly enabled to be available in an \actionx{} block,
and enabling a new keyword requires recompiling \flow{}. The keywords available
as \actionx{} keywords are listed in the static method
\inlinecode{ActionX::valid\_keyword()} in
\path{opm/input/eclipse/Schedule/Action/ActionX.cpp}. In principle it should
just be to add the keyword to the \inlinecode{ActionX::valid\_keyword()} method
and rebuild \flow{}, but experience has unfortunately shown that problems of
various kinds have had a tendency to pop up when new keywords are tried out as
\actionx{} keywords. Most commonly the problems have been in the interaction
between the \inlinecode{Schedule} class in opm-common and the simulator - things
have a tendency to go out of sync.
\section{Running \actionx{} during simulation}
The first part of the \actionx{} treatment is parsing the keyword and conditions
and assemble a syntax tree which can be used to evaluate the conditions. This
parsing takes place when the \kw{SCHEDULE} section is parsed for the first time.
This takes place fully within the realms of the opm-common codebase, and is
quite mature.
When the simulation actually runs the \actionx{} behavior consists of three
distinct parts, taking place in the simulator, in opm-common and again in the
simulator. The simulator will manage an instance of \inlinecode{Action::State}
which will hold on to the time of last run and the latest results for the
various actions.
\subsection{Prepare and evaluate}
As with \udq{} the \inlinecode{SummaryState} instance is the most important
variable to provide context to the \actionx{} evaluation, i.e. the
\inlinecode{SummaryState} variable must be evaluated before \actionx{}. In
addition the \udq{} variables must be evaluated and available in the
\inlinecode{SummaryState} instance before we invoke the \actionx{}
functionality.
The evaluation of actions is called from the method \inlinecode{applyActions()}
in \path{eclproblem.hh}. The method will evaluate which actions are eligible for
running by inspecting the \inlinecode{Action::Actions} variable and call the
\inlinecode{ActionX::eval()} method.
\subsection{Recreate \inlinecode{Schedule}}
When an \actionx{} has evaluated to \inlinecode{true} the simulator will call
into the opm-common method \inlinecode{Schedule::applyAction(report\_step)}.
That function will add the keywords from the \actionx{} keyword to the
\inlinecode{ScheduleBlock} for the correct report step, and then reiterate
through the \kw{SCHEDULE} section to the end of the simulation.
This reiterate process will recreate all internal members in the
\inlinecode{Schedule} class, i.e. if the simulator was holding on to a reference
to an internal \inlinecode{Schedule} datastructure that will be invalidated.
While recreating the \inlinecode{Schedule} instance there is some book keeping
as to which datastructures need to be recalculated in the simulator as a
consequence of the \actionx{}. That information is maintained in the data
structure \inlinecode{Action::SimulatorUpdate} which is returned back to the
simulator.
\subsection{Updating simulator data structures}
The \actionx{} implementation is in the module opm-common, whereas when the
simulation is proceeding it is the simulator code which is clearly in control.
If an action has evaluated to true and new keywords are injected in the Schedule
object the complete simulator state is updated. This is complex, and many of the
bugs in \actionx{} functionality have been in the interaction between the
simulator and opm-common, in particular when an action has evaluated to true.
An assumption permeating the simulator code is that changes to the well and
group configuration only take place at report steps, and in between those the
simulator ``owns'' the well and group data. Unfortunately this is no longer the
case when \actionx{} is active, and depending on the keywords in the \actionx{}
block we need to update the simulator data structures after \actionx{} has been
evaluated to true. Some details of what is currently updated is decsribed below.
This update mechanism will probably need to be continously updated in the
future.
The simulator code makes \emph{copies} of many of the objects like wells and
connections from the \inlinecode{Schedule} class, and also assembles many
simulator specific data structures which to a large extent consist of extracts
of information from the internals of the \inlinecode{Schedule} object. Some of
the interaction between the simulator and the input layer could probably be
simplified if the simulator would call the \inlinecode{Schedule} object when
e.g. a well or connection is needed, instead of storing references or copies to
the \inlinecode{Schedule} objects internally.
There are currently three categories of changes that can take place due to
\actionx{}:
\subsubsection{General changes in well status}
\label{actionx_change_well}
When there is well related keyword in the \actionx{} block - e.g. \kw{WELOPEN}
to open or close a well or \kw{WCONPROD} to adjust rates, the simulator is
required update it's internal data structures with the updated input information.
This will be communicated by flagging all the wells which need an update in the
\inlinecode{Action::SimulatorUpdate} instance which is passed from the
simulator.
\subsubsection{Changes in geo properties}
The grid keywords are in general not permitted in the \kw{SCHEDULE} section,
however there are a few geo multipliers like \kw{MULTZ} and \kw{MULTFLT} which
are allowed in the \kw{SCHEDULE} section, and thereby also in \actionx{}. If one
of these keywords are encountered in the \actionx{} block we set the flag
\inlinecode{Action::SimulatorUpdate::tran\_update = true} to encourage the
simulator to recalculate the transmissibilities.
\subsubsection{WELPI}
\label{actionx_welpi}
The \kw{WELPI} keyword is quite complex from the outset, when it is included as
an \actionx{} keyword it gets even more complicated. In order to support
\kw{WELPI} in \actionx{} the simulator needs to inspect the \actionx{} keywords
before invoking them, and if \kw{WELPI} is included the PI values must be
assembled from the simulator and passed to the
\inlinecode{Schedule::applyAction()}. This is implemented and works, but it is
complex and the special treatment in order to support the combination \kw{WELPI}
+ \actionx{} is quite considerable.
\section{Problems in parallel}
\label{actionx_paralle}
The operation environment for \actionx{} is quite similar to \udq{} when it
comes to parallel behavior - see section \ref{udq_parallel}, in addition we
need to be aware of parallel challenges after the \actionx{} has completed. If
the \actionx{} keyword changes the well structure there will be problems with
with the parallel well distribution in the simulator. \emph{As of Januarry 2022
this will fail undetected.}
\section{\actionx{} restart output}
As with the \udq{} keyword some of the structure and complexity of the
\actionx{} datastructures are there primarily to enable \eclipse{} compatible
restart. Regarding restart of \actionx{} related data:
\begin{enumerate}
\item The restart output contains the result of parsing an \actionx{}
condition in an intermediate representation which has been reverse
engineered, this is complex and might not be 100\% correct.
\item When restarting \flow{} from an \eclipse{} formatted restart file the
\actionx{} conditions are reparsed based on string data in the restart file
and the intermediate representation mentioned in point 1 is not utilised.
\end{enumerate}

View File

@@ -0,0 +1,405 @@
\newcommand{\pyaction}{\kw{PYACTION}}
\chapter{Programming in the deck: \pyaction{}}
\label{pyaction}
The \pyaction{} keyword is a \flow{} specific keyword which allows for Python
programming in the \kw{SCHEDULE} section. The \pyaction{} keyword is inspired by
the \actionx{} keyword, but instead of a \inlinecode{.DATA} formatted condition
you are allowed to implement the condition with a general Python script. The
\actionx{} keywords are very clearly separated in a condition part and an action
part in the form of a list of keywords which are effectively injected in the
\kw{SCHEDULE} section when the condition evaluates to true. This is not so for
\pyaction{} where there is only one Python script which can both evaluate
conditions and apply changes. In principle the script can run arbitrary code,
but due to the complexity of the \kw{SCHEDULE} datamodel the ``current best''
way to actually change the course of the simulation is through the use of an
additional dummy \actionx{} keyword.
In order to enable the \pyaction{} keyword \flow{} must be compiled with the
\path{cmake} switches \inlinecode{-DOPM\_ENABLE\_EMBEDDED\_PYTHON=ON} and
\inlinecode{-DOPM\_ENABLE\_PYTHON=ON}, the default is to build with these switches
set to \inlinecode{OFF}. Before you enable \pyaction{} in your \flow{}
installation please read carefully through section \ref{pyaction_security} for
security implications of \pyaction{}.
\section{Python - wrapping and embedding}
Python is present in the \flow{} codebase in two different ways. For many of
the classes in the \flow{} codebase - in particular in opm-common, there are
\emph{Python wrappers} available. That means that you can invoke the C++
functionality in \flow{} classes from Python - e.g. this Python script can be used to
load a deck and print all the keywords:
\begin{code}
import sys
from opm.io.parser import Parser
input_file = sys.argv[1]
parser = Parser()
deck = parser.parse_file(input_file)
for kw in deck:
print(kw.name)
\end{code}
When used this way the Python interpreter is the main program running, and the
\flow{} classes like \inlinecode{Opm::Parser} are loaded to extend the Python
interpreter. This can also be flipped around, the Python interpreter can be
\emph{embedded} in the \flow{} executable. When Python is embedded, \flow{} is
the main program running, and with help of the embedded interpreter the \flow{}
program can be extended with Python plugins. The \pyaction{} keyword can be
perceived as a Python plugin. To really interact with the state of the \flow{}
simulation the plugin needs to utilize the functionality which wraps the C++
functionality, so for \pyaction{} both wrapping and embedding is at play.
Exporting more functionality from C++ to Python in the form of new and updated
wrappers is a quite simple and mechanical process. If you need a particular
functionality which is already available in C++ also in Python it will probably
be a quite limited effort for a developer who is already familiar with the code.
\section{The \pyaction{} keyword}
The \pyaction{} keyword is in the \kw{SCHEDULE} section like \actionx{}. The
first record is the name of the action and a string identifier for how many
times the action should run, then there is a path to a Python module:
\begin{deck}
PYACTION
PYTEST 'FIRST_TRUE' /
'pytest.py' /
\end{deck}
This keyword defines a \pyaction{} called \kw{PYTEST} which will run at the end
of every timestep until the first time a \inlinecode{true} value is returned. In
addition to \kw{FIRST\_TRUE} you can choose \kw{SINGLE} to run exactly once and
\kw{UNLIMITED} to continue running at the end of every timestep for the entire
simulation. The second record is the path to a file with Python code which will
run when this \pyaction{} is invoked. The path to the module will be interpreted
relative to the location of the \path{.DATA} file.
The python module can be quite arbitrary, but it must contain a function
\inlinecode{run} with the correct signature:
\begin{code}
def run(ecl_state, schedule, report_step, summary_state, actionx_callback):
print('Running python code in PYACTION')
return True
\end{code}
The \pyaction{} machinery is not as robust as the simulator proper: while
loading the \kw{PYACTION} keyword \flow{} will check that the Python module
contains syntactically valid Python code, and that it contains a
\inlinecode{run()} function, but it will \emph{not} check the signature of the
\inlinecode{run()} function. If the signature is wrong you will get a hard to
diagnose runtime error.
When the Python module is loaded it does so in an environment where the path to
the \path{.DATA} file has been appended to the Python load path by manipulating
the internal \inlinecode{sys.path} variable.
\subsection{The different arguments}
The \inlinecode{run()} function will be called with exactly five arguments which
your implementation can use. These arguments point to datastructures in the
simulator, and is the way to interact with the state of the simulation. The five
arguments are:
\begin{description}
\item[\inlinecode{ecl\_state}:] An instance of the \inlinecode{Opm::EclipseState}
class - this is a representation of \emph{all static properties} in the model,
ranging from porosity to relperm tables. The content of the
\inlinecode{ecl\_state} is immutable - you are not allowed to change the static
properties at runtime\footnote{This could certainly be interesting, but this
is beyond the scope of the \pyaction{} keyword.}.
\item[\inlinecode{schedule}:] An instance of the \inlinecode{Opm::Schedule}
class - this is a representation of all the content from the \kw{SCHEDULE}
section, notably all well and group information and the timestepping. Being
able to change the \kw{SCHEDULE} information runtime is certainly one of the
main motivations for this functionality, however due to the complexity of
the \inlinecode{Opm::Schedule} class (section \ref{schedule_design})
the recommended way to actually mutate the \inlinecode{Opm::Schedule} is
through the use of a dummy \actionx{} keyword (section
\ref{pyaction_actionx}).
\item[\inlinecode{report\_step}:] This is an integer for the report step we
are currently working on. Observe that the \pyaction{} is called for every
simulator timestep, i.e. it will typically be called multiple times with
the same value for the $\mathrm{report\_step}$ argument.
\item[\inlinecode{summary\_state}:] An instance of the
\inlinecode{Opm::SummaryState} class, this is where the current summary
results of the simulator are stored. The \inlinecode{SummaryState} class has
methods to get hold of well, group and general variables
\begin{code}
# Print all well names
for well in summary_state.wells:
print(well)
# Assign all group names to the variable group_names
group_names = summary_state.groups
# Sum the oil rate from all wells.
sum_wopr = 0
for well in summary_state.wells:
sum_wopr += summary_state.well_var(well, 'WOPR')
# Directly fetch the FOPR from the summary_state
fopr = summary_state['FOPR']
\end{code}
The \inlinecode{summary\_state} variable can also be updated with the
\inlinecode{update()}, \inlinecode{update\_well\_var()} and
\inlinecode{update\_group\_var()} methods.
\item[\inlinecode{actionx\_callback}:] The \inlinecode{actionx\_callback} is a
specialized function which is used to update the \inlinecode{Schedule} object
by applying the keywords from a normal \actionx{} keyword. This is described
in detail in section \ref{pyaction_actionx}.
\end{description}
\subsection{Holding state}
The \pyaction{} keywords will often be invoked multiple times, a Python
dictionary \inlinecode{state} has been injected in the module - that dictionary
can be used to maintain state between invocations. Let us assume we want to
detect when the field oil production starts curving down - i.e. when
$\partial^2_{t} \mathrm{FOPR} < 0$, in order to calculate that we need to keep
track of the timesteps and the $\mathrm{FOPR}$ as function of time - this is one
possible implementation:
\begin{code}
def diff(pair1, pair2):
return (pair1[0] - pair2[0], pair1[1] - pair2[1])
def fopr_diff2(summary_state):
fopr = summary_state.get('FOPR')
sim_time = summary_state.get('TIME')
if not 'fopr' in state:
state['fopr'] = []
fopr_series = state['fopr']
fopr_series.append( (sim_time, fopr) )
if len(fopr_series) < 2:
return None
pair0 = fopr_series[-1]
pair1 = fopr_series[-2]
pair2 = fopr_series[-3]
dt1, df1 = diff(pair0, pair1)
dt2, df2 = diff(pair1, pair2)
return 2*(df1/dt1 - df2/dt2)/(dt1 + dt2)
def run(ecl_state, schedule, report_step, summary_state, actionx_callback):
fopr_d2 = fopr_diff2(summary_state)
if not fopr_d2 is None:
if fopr_d2 < 0:
print('Hmmm - this is going the wrong way')
else:
print('All good - sky is the limit!')
\end{code}
\section{Changing the \inlinecode{Schedule} object - using a ``normal'' \actionx{}}
\label{pyaction_actionx}
Before reading this section you should make sure to understand the
\inlinecode{Schedule} design described in section \ref{schedule_design}. The
initial plan when implementing the \pyaction{} keyword was to be able to make
function calls like
\begin{code}
schedule.close_well(w1, report_step)
schedule.set_orat(w2, 1000, report_step)
\end{code}
to close a well and set the oil rate of another well. Unfortunately it proved
very complex to get good semantics for combining such runtime changes with the
keyword based model for \kw{SCHEDULE} section. The current recommendation is to
apply changes to the \kw{SCHEDULE} section using callbacks to \kw{ACTIONX}
keywords from Python code, this is illustrated in the example
below\footnote{From a programmers point of view the solution seems very
unsatisfactory, but it works and it plays nicely with the \kw{ACTIONX} behavior.
If/when the underlying \inlinecode{Schedule} implementation changes there is
nothing per se in the \pyaction{} design which inhibits use of a better
\inlinecode{Schedule} api in the future.}.
The recommended way to achieve this is to create a normal \actionx{} keyword
which is set up to run zero times, and then explicitly invoke that from the
Python \inlinecode{run()} function. In the example below we create an \actionx{}
\inlinecode{CLOSEWELLS} which will close all matching wells (the wellname '?')
\begin{deck}
ACTIONX
CLOSEWELLS 0 /
/
/
WELOPEN
'?' 'CLOSE' /
/
ENDACTIO
\end{deck}
The \inlinecode{CLOSEWELLS} action is set up to run zero times, so the normal
\actionx{} machinery will never run this action\footnote{The \kw{CLOSEWELL}
action has an \emph{empty condition}, the \actionx{} keywords with empty
condition will always evaluate as false.}. Then in the Python run function we go
through all the wells and call the \inlinecode{CLOSEWELL} action to close those
with \inlinecode{OPR < 1000}:
\begin{code}
def run(ecl_state, schedule, report_step, summary_state, actionx_callback):
close_wells = []
for well in summary_state.wells:
if summary_state.well_var(well, 'WOPR') < 1000:
close_wells.append(well)
if close_wells:
actionx_callback('CLOSEWELLS', close_wells)
\end{code}
The implementation of this is quite complex with thread of execution going from
C++ to Python, then invoking a callback to C++ which will call
\inlinecode{Schedule::iterateScheduleSection()}, going back to Python to
complete the \inlinecode{run()} method before the function pointers pops back to
C++ and continues the simulator execution\footnote{This is documented in some
detail as code comments of \inlinecode{Schedule::applyPyAction()} in the
\path{Schedule.cpp} file.}.
\section{Implementing \udq{} like behavior}
The \udq{} keyword has three different purposes - all based on defining
complex quantities from the current state of the simulation:
\begin{enumerate}
\item Define a complex quantity to be used in a \actionx{} condition.
\item Define a complex quantity for reporting in the summary file.
\item Define a quantity which can used as a control in \kw{UDA}.
\end{enumerate}
All of these can be achieved by using the \pyaction{} keyword, although for the
two latter alternatives you must specify the \udq{} keyword in the deck first,
but you can let the \pyaction{} implementation override the value:
\begin{deck}
-- Observe that this UDQ will be assigned from a PYACTION keyword,
-- the value used in the ASSIGN statement below is pure dummy.
UDQ
ASSIGN WUGOOD 1 /
ASSIGN FUGOOD 1 /
/
\end{deck}
\subsection{Using \pyaction{} instead of \udq{} + \actionx{}}
Towards the end of section \ref{actionx_structure} it is demonstrated how \udq{}
and \actionx{} can be combined to implement an action in case a complicated
condition applies. As described in section \ref{pyaction_actionx} the best way
to actually invoke changes on the \kw{SCHEDULE} section is through the use of a
dummy \actionx{} keyword, but \pyaction{} is very well suited to evaluate
complex conditions. In the example below we close all wells which have
consistently produced less than 1000 $\mathrm{m^3/day}$ for more than 60 days:
\begin{code}
wopr_limit = 1000
time_limit = 60 * 3600 * 24
def init_state(summary_state):
if 'closed_wells' in state:
return
state['closed_wells'] = set()
bad_wells = {}
for well in summary_state.wells:
bad_wells[well] = None
state['bad_wells'] = bad_wells
def run(ecl_state, schedule, report_step, summary_state, actionx_callback):
shut_wells = []
init_state(summary_state)
for well in summary_state.wells:
if well in state['closed_wells']:
continue
if summary_state.well_var(well, 'WOPR') < wopr_limit:
elapsed = summary_state.elapsed()
if state['bad_wells'][well] is None:
state['bad_wells'][well] = elapsed
else:
bad_time = elapsed - state['bad_wells'][well]
if bad_time > time_limit:
shut_wells.append(well)
state['closed_wells'].add( well )
else:
state['bad_wells'][well] = None
if shut_wells:
actionx_callback(shut_wells)
\end{code}
\subsection{Using \pyaction{} to report to the summary file}
The important point when using \pyaction{} to report complex results to the
summary file is just that the \inlinecode{summary\_state} argument to the
\inlinecode{run()} function is \emph{writable} with \inlinecode{updata\_xxx}
calls. Assuming dummy \udq{} variables \kw{WUGOOD} and \kw{FUGOOD} have been
defined as per the example above, we can use \pyaction{} to set variable
\kw{FUGOOD} to one for all wells with rate above a limit, and the \kw{FUGOOD}
variable can be the count of such wells:
\begin{code}
def run(ecl_state, schedule, report_step, summary_state, actionx_callback):
good_count = 0
opr_limit = 1000
for wname in schedule.well_names():
if summary_state.well_var(wname, 'FOPR') > opr_limit:
good_count += 1
summary_state.update_well_var(wname, 'WUGOOD', 1)
else:
summary_state.update_well_var(wname, 'WUGOOD', 0)
summary_state.update_var('FUGOOD', good_count)
\end{code}
\subsection{Using \pyaction{} to set a \kw{UDA} control}
Using \pyaction{} to set \kw{UDA} controls is quite simple. Again the \udq{}
keyword must have been defined with a dummy value in the \kw{SCHEDULE} section,
and the \kw{UDA} keyword used in e.g. a \kw{WCONDPROD} keyword. Then the
\inlinecode{run()} function can just be used to assign to the \udq{} variable.
In the example below we use a \kw{UDA} to control the oil production rate, and
the value is set to the average value of the producing wells:
\begin{deck}
-- Define dummy UDQ WUOPR to be used as control in the WCONPROD
-- keyword. The actual value for this UDQ is assigned in a PYACTION
-- keyword
UDQ
ASSIGN WUOPR 0 /
/
...
...
-- Need to define a well list with all the production wells.
-- This is to ensure that the WCONPROD keyword is only applied
-- to producers.
WLIST
'PROD' P1 P2 P3 .../
WCONPROD
'*PROD' 'OPEN' 'ORAT' 'WUOPR' /
/
\end{deck}
This can then be combined with the python code:
\begin{code}
def run(ecl_state, schedule, report_step, summary_state, actionx_callback):
num_prod_wells = 0
for wname in schedule.well_names():
if summary_state.well_var(wname, 'WOPR') > 0:
num_prod_wells += 1
fopr = summary_state['FOPR']
new_rate = fopr / num_prod_wells
for wname in schedule.well_names():
summary_state.update_well_var(wname, 'WUOPR', new_rate)
\end{code}
\section{Security implications of \pyaction{}}
\label{pyaction_security}
The \pyaction{} keyword allows for execution of arbitrary user supplied Python
code, with the priviliges of the user actually running \flow{}. If you have a
setup where \flow{} runs with a different user account than the person
submitting the simulation you should be \emph{very careful} about enabling the
embedded Python functionality and the \pyaction{} keyword. As a scary example
this script will wipe your disks:
\begin{code}
import shutil
def run(ecl_state, schedule, report_step, summary_state, actionx_callback):
shutil.rmtree('/')
\end{code}
If the user running \flow{} has different security credentials than the user
submits the job, this has significant security implications.

599
docs/tm/udq_actionx/udq.tex Normal file
View File

@@ -0,0 +1,599 @@
\newcommand{\udq}{\kw{UDQ}}
\chapter{Programming in the deck: \udq{}}
\udq{} and \kw{ACTIONX} are two keywords which offer a sort of
\emph{programming} in the input deck. \udq{} is an acronym for \emph{User
Defined Quantity}, and the essence of the \udq{} keyword is the ability to
define arithmetic expressions based on the result vectors of the ongoing
simulation. The quantites evaluated with \udq{} can then be output as summary
variables, and they can be used as controls in keywords like \kw{WCONPROD} and
\kw{GCONINJE}. When used as controls the \udq{} variables are called \emph{User
Defined Arguments} (UDA).
For both the \udq{} and \kw{ACTIONX} keywords evaluating an arithmetic
expression based on the current results of the ongoing simulation is an
important part of the concept, and they are often referenced in pair as
\udq{}/\kw{ACTIONX}, this is slightly misleading as the two are fully
independent and share very little both as concepts in \flow{} and in the C++
implementation. The \kw{ACTIONX} keyword is described in chapter \ref{actionx}.
The \udq{} keyword is also documented in section 12.3.233 in the \flow{}
reference manual.
\section{Defining a new \udq{} keyword}
New \udq{} variables are defined with the \udq{} keyword in the \kw{SCHEDULE}
section. The \udq{} keyword is a sort of a super keyword with four additional
subcommands: \kw{DEFINE}, \kw{ASSIGN}, \kw{UNIT} and \kw{UPDATE}. The
\kw{DEFINE} subcommand is the most important command, that is used to
\emph{define} an arithmetic expression for a \udq{} variable, which is evaluated
at the end of every simulator time step. \kw{ASSIGN} is used to define a \udq{}
variable with a constant numerical value, in addition the \kw{ASSIGN} subcommand
is often used as a ``forward reference'' to enable using a \udq{} keyword in
another \kw{DEFINE} expression. The \kw{UNIT} command is used to assign a unit
string to a \udq{} variable, see section \ref{udq_units} for more details about
\udq{} variables and units. The \kw{UPDATE ON} and \kw{UPDATE OFF} commands can
be used to switch updating of \udq{} variables on and off. The \udq{} variables
are created in mode \kw{ON}.
All \udq{} keywords must have the letter \emph{U} as their second character, the
first character should be 'F', 'G' or 'W' to indicate whether this is a field,
group or well quantity\footnote{In \eclipse{} also the characters 'S', 'C', 'A'
and 'B' are used to denote \emph{segment}, \emph{connection} \emph{aquifer} and
\emph{block} variables respectively. None of these are supported in \flow{}.}.
The simplest way to define a \udq{} is just using the \kw{ASSIGN} subcommand of
the \udq{} keyword:
\begin{deck}
UDQ
ASSIGN FUVAR1 123 /
ASSIGN FUVAR2 456 /
/
\end{deck}
This way we will assign to variables \inlinecode{FUVAR1} and \inlinecode{FUVAR2}
with values 123 and 456 respectively. These values can output to the summary
file, be used as control values in a control keyword like \kw{WELTARG} and be
used to recursively define another \udq{} keyword.
The more interesting \udq{} subcommand is \kw{DEFINE} which is used to define an
arithmetic expression for a \udq{} variable, the arithmetic expression will be
evaluated at the end of every timestep. The expressions are built from the
normal arithmetic operators +,-,*,/, a predefined set of available functions
(see \ref{udq_functions}) and results from the ongoing simulation.
In the example below we create \udq{} variables \kw{FUWCT1} and \kw{FUWCT2} as
user defined field water cut, one based on the summary variables \kw{FWPR} and
\kw{FOPR} and one based on summing \kw{WOPR} and \kw{WWPR} over all wells
\begin{deck}
UDQ
DEFINE FUWCT1 FWPR/(FWPR + FOPR) /
DEFINE FUWCT2 SUM(WWPR)/(SUM(WWPR) + SUM(WOPR)) /
/
\end{deck}
A \udq{} variable can be redefined during the simulation, and also change from
constant \kw{ASSIGN} to variable \kw{DEFINE}. Observe that \udq{} values are
always evaluated in order of occurence in the input deck. For instance for this
input
\begin{deck}
UDQ
ASSIGN FU1 100 /
DEFINE FU2 FU1 + FOPR /
DEFINE FU1 FWPR /
/
\end{deck}
the evaluation order will be \{\kw{FU1}, \kw{FU2}\}\footnote{Maintaining the
input order and whether a certain \udq{} symbol is now a \kw{ASSIGN} or
\kw{DEFINE} keyword is also very important for the restart code.}. \kw{ASSIGN}
statements take effect at input time, making the newly defined symbol
immediately available for reuse in a subsequent defintion. This is utilized in
the \udq{} keyword above where the symbol \kw{FU1} is referenced in the
defintion of \kw{FU2}. As used in this example the \kw{ASSIGN FU1 100} can be
seen as a \emph{forward reference}. When we have completed the first timestep
and it is time to evalute the \udq{} expressions they will be evaluated in order
of \emph{first appearance}, i.e. \{\kw{FU1}, \kw{FU2}\}. At this stage the
active definition of \kw{FU1} is \inlinecode{FU1 = FWPR}, i.e. the value
\inlinecode{100} from the initial definition \inlinecode{FU1 = 100} is never
actually used.
\section{Different types of \udq{} - field, group and well}
The \udq{} keywords can be of different types, \flow{} supports \emph{field},
\emph{well} and \emph{group} keywords\footnote{\eclipse{} also supports
connection, segment and aquifer variables.}. The field keywords are scalar,
whereas the well and group keywords are sets with values for every well/group.
The type of a \udq{} keyword is inferred from the name in the same manner as the
summary keywords, i.e. for this \udq{} keyword
\begin{deck}
UDQ
ASSIGN FU1 100 /
ASSIGN WU1 200 /
ASSIGN GU1 300 /
/
\end{deck}
we will define one scalar keyword \kw{FU1}, one well set \kw{WU1} and one group
set \kw{GU1}. The well sets will have one slot for each well in the model, it is
not possible to create a well set with only a subset of wells, but the well set
can have \emph{undefined} value for a subset of wells. The set maintains a
\inlinecode{is\_defined()} status for each element and most operations only
apply to the defined elements\footnote{The C++ implementation of the \udq{}
value set is the equivalent of \texttt{std::map<std::string,
std::optional<double>>}.}.
As indicated with \kw{ASSIGN WU1 200} you can assign a scalar value to a set
keyword, then all elements in the set will have the same value. Assuming we have
a model with wells OP1, OP2, WI and GI the \kw{WU1} will look like
\begin{code}
WU1 = {"OP1": 100, "OP2": 100, "WI": 100, "GI": 100}.
\end{code}
When defining a well \udq{} it is natural to refer to well summary variables, in
the example below we define \kw{WUBHP} which is the bottom hole pressure
for each well, \kw{WUOPR1} which is the oil production rate for a subset of
wells and \kw{WUOPR2} which is the oil production rate for well OP1 \emph{broadcasted to all wells}.
\begin{deck}
UDQ
DEFINE WUBHP WBHP /
DEFINE WUOPR1 WOPR 'OP*' /
DEFINE WUOPR2 WOPR OP1 /
/
\end{deck}
After evaluation these \udq{} values will be\footnote{The numerical values are
arbitrary, just to illustrate that they are \emph{defined}, in contrast to the
[ ] which is used to illustrate an \emph{undefined} value.}:
\begin{code}
WUBHP = {"OP1": 20, "OP2": 30, "WI": 10, "GI": 15}
WUOPR1 = {"OP1": 13, "OP2": 17, "WI": [ ], "GI": [ ]}
WUOPR2 = {"OP1": 13, "OP2": 13, "WI": 13, "GI": 13}
\end{code}
Observe how well variables like \kw{WBHP} and \kw{WOPR} can be qualified with a
wellname pattern. If no wellname is supplied the expression will be evaluated
for all wells, as for \kw{WUBHP}, for \kw{WUOPR1} the pattern 'OP*' will select
wells \{OP1, OP2\} and leave the injectors \{WI, GI\} undefined. For \kw{WUOPR2}
the well pattern 'OP1' specifies a well completely, i.e. this will be evaluated
as a scalar, and then the scalar value \inlinecode{WOPR:OP1 == 13} is
broadcasted to all the wells in \kw{WUOPR2}.
\udq{} sets with different sets of defined wells can be combined, in most cases
the operations will be applied to the intersection of all defined wells,
consider for example\label{udq_diff}:
\begin{deck}
UDQ
DEFINE WUBHP WBHP /
DEFINE WUTHP WTHP OP* /
DEFINE WUPDIFF WUBHP - WUTHP
/
\end{deck}
When these \udq{} statements are evaluated we will get:
\begin{code}
WUBHP = {"OP1": 20, "OP2": 30, "WI": 10, "GI": 15}
WUTHP = {"OP1": 13, "OP2": 17, "WI": [ ], "GI": [ ]}
WUPDIFF = {"OP1": 7, "OP2": 13, "WI": [ ], "GI": [ ]}
\end{code}
As we see the undefined property for wells GI and WI in \kw{WUTHP} is contagious
when the two expressions are combined with \inlinecode{WUPDIFF = WUBHP - WUTHP},
see however section \ref{udq_union_functions} for a collection of functions
which operate on the union of values.
When an undefined variable is output to the summary file it will get a value
given as item 3 of the \kw{UDQPARAM} keyword. Summary output is the \emph{only}
point where the undefined value can be dereferenced, the numerical value given
in \kw{UDQPARAM} will not be available either for \udq{} nor \kw{ACTIONX}
evaluations.
\section{Functions available in \udq{} defintions}
\label{udq_functions}
\flow{} supports all the \udq{} functions available in \eclipse{}, for the
future it would be a quite simple C++ task to extend the list of available
functions, although that will affect \eclipse{} compatibility.
\subsection{Ordinary binary functions}
The \udq{} framework supports all the ordinary arithmetic operators +,-,*,/ and
\^{} and the comparison operators $>, \ge, <, \le, \ne, ==$. For all of these
operations sets and scalars can be combined freely. When combining a scalar and
a set the scalar will be promoted to a set with all values equal, i.e. for
\begin{deck}
UDQ
ASSIGN WULIMIT 100 /
/
\end{deck}
the numerical value 100 will be broadcasted to all wells:
\begin{code}
WULIMIT = {"OP1": 100, "OP2": 100, "WI": 100, "GI": 100}.
\end{code}
In the case of set arguments the operations are only applied to the union of
values which are defined in both argument sets. The comparison operators produce
numerical 0 or 1 depending on the result of the comparison, the result from a
comparison operation can be used numerically in further computations. In the
following example \kw{FUWCNT} will be the number of wells producing with oil
production rate above 1000\footnote{Remember: 1000 has the units of the
deck, i.e. $\mathrm{stb/day}$ in FIELD units and $\mathrm{m^3/day}$ in metric
units.}.
\begin{deck}
UDQ
DEFINE FUWCNT SUM( WOPR > 1000 ) /
/
\end{deck}
\subsection{Functions over a set returning a scalar}
The \udq{} framework has several functions which iterate over all the defined
members of a set and return a scalar. In the example
\begin{deck}
UDQ
DEFINE FU1 SUM(WOPR 'OP*') /
/
\end{deck}
The scalar variable \kw{FU1} will be equal to the sum of oil production rates
for all wells matching the pattern \kw{OP*}, the wells with a name not matching
\kw{OP*} will not contribute to the sum. The complete list of functions iterating
over a set and returning a scalar are:
\begin{description}
\item[SUM] Sum all defined elements in the argument set and return a scalar.
\item[AVEA] The arithmetic average of the elements in the set.
\item[AVEG] The geometric average of the elements in the set.
\item[AVEH] The harmonic average of the elements in the set.
\item[MAX] The maximum element in the set.
\item[MIN] The minimum element in the set.
\item[NORM1] The $\mathrm{L^1}$ norm of the elements in the set.
\item[NORM2] The $\mathrm{L^2}$ norm of the elements in the set.
\item[NORMI] The $\mathrm{L^\infty}$ norm of the elements in the set.
\item[PROD] The product of all the elements in the set.
\end{description}
\subsection{Elemental functions}
There is a family of functions which take a vector or scalar as argument, run
through all the elements in the argument and return a result of the same shape
as the argument, where a function has been applied to all the defined elements.
Assume that the \kw{WU1} has the following value:
\begin{code}
WU1 = {"OP1": -2, "OP2": -1, "WI": 1, "GI": []},
\end{code}
then \kw{DEFINE WUABS ABS(WU1)} will give
\begin{code}
WUABS = {"OP1": 2, "OP2": 1, "WI": 1, "GI": []}.
\end{code}
The available elemental functions of this kind come in different categories:
\subsubsection*{Mathematical functions}
\begin{description}
\item[EXP] Return a new set where all defined elements have been exponentiated.
\item[ABS] Return a new set with the absolute value of all elements.
\item[LN] Return a new set with the \emph{natural logarithm} of all elements.
\item[LOG] Return a new set with $\log_{10}$ of all elements.
\item[NINT] Return a new set where all elements have been converted to the
nearest integer.
\end{description}
\subsubsection*{Sorting functions}
The \udq{} functionality supports functions \kw{SORTA} and \kw{SORTD} to sort a
set in ascending or descending order respectively. Observe that these functions
do not sort the sets in place - the udqset does not have any notion of ordering,
rather they create a permutation set with values 1,2,3, ... The following
combination of \udq{} and \kw{ACTIONX} will use the \kw{SORTD} function to close
the two wells with the highest watercut:
\begin{deck}
UDQ
DEFINE WUWCTS SORTD(WWCT OP*) /
/
\end{deck}
assuming the \kw{WWCT} looks like
\begin{code}
WWCT = {"OP1": 0.5, "OP2": 0.2, "OP3": 0.1, "OP4":0.7, "WI": 0, "GI": 0}
\end{code}
then the \kw{WUWCTS} set will look like
\begin{code}
WUWCTS = {"OP1": 2, "OP2": 3, "OP3": 4, "OP4":1 "WI": [], "GI": []}
\end{code}
When this is combined with the \kw{ACTIONX}(see chapter \ref{actionx})
\begin{code}
ACTIONX
CW /
WUWCTS <= 2 /
/
WELOPEN
'?' 'CLOSE' /
/
ENDACTIO
\end{code}
the two wells with highest watercut will be selected in the \inlinecode{WUWCTS
<= 2} statement and that will be expanded to \{OP4, OP1\} by the '?'
expression in the \kw{WELOPEN} keyword.
\subsubsection*{Random functions}
The \udq{} machinery has functionality to sample random numbers, there are one
set of random number functions which are seeded deterministically by item 1 of
\kw{UDQPARAMS} and an alternative set which is seeded by the clock. The random
number functions take a \udq{} variable as argument, that is only to ensure that
the shape of the result value is correct.
\begin{description}
\item[RANDN] Random numbers from distribution $N(0,1)$ seeded deterministically
by item 1 in \kw{UDQPARAMS}.
\item[RANDU] Random numbers from distribution $U(-1,1)$ seeded deterministically
by item 1 in \kw{UDQPARAMS}.
\item[RRNDN] Random numbers from distribution $N(0,1)$ seeded by the clock.
\item[RRNDU] Random numbers from distribution $U(-1,1)$ seeded by the clock.
\end{description}
Assuming the argument vector \kw{WU1} looks like
\begin{code}
WU1 = {"OP1": -2, "OP2": [], "WI": 1, "GI": []},
\end{code}
the result of \kw{DEFINE WURAND RANDU(WU1)} could be like
\begin{code}
WURAND = {"OP1": 0.576, "OP2": [], "WI": -0.132, "GI": []}.
\end{code}
\subsubsection*{Work with defined status}
The functions \kw{DEF}, \kw{UNDEF} and \kw{IDV} can be used to inspect the
defined/not defined status of the elements in a \udq{} set.
\begin{description}
\item[DEF] Return a set with value 1 for all defined elements.
\item[UNDEF] Return a set with value 1 for all undefined elements.
\item[IDV] Return a set with value 1 for all defined elements and value 0 for
all undefined elements.
\end{description}
Assuming the input argument
\begin{code}
WU1 = {"OP1": -2, "OP2": [], "WI": 1, "GI": []},
\end{code}
the \udq{} assignments
\begin{deck}
UDQ
DEFINE WUDEF DEF(WU1) /
DEFINE WUUNDEF UNDEF(WU1) /
DEFINE WUIDV IDV(WU1) /
/
\end{deck}
will produce:
\begin{code}
WUDEF = {"OP1": 1, "OP2": [], "WI": 1, "GI": []},
WUUNDEF = {"OP1": [], "OP2": 1, "WI": [], "GI": 1},
WUIDV = {"OP1": 1, "OP2": 0, "WI": 1, "GI": 0},
\end{code}
\subsection{Union functions}
\label{udq_union_functions}
There are a list of functions \kw{Uxxx} which operate on the union of the values
found in the two sets, i.e. a result is assigned if at at least one set has
defined value for this well/group.
\begin{description}
\item[UADD] Will add the items from the two sets.
\item[UMUL] Will multiply the items from the two sets.
\item[UMAX] The maximum value from the two sets.
\item[UMIN] The minumum value from the two sets.
\end{description}
In the case where only one of the sets has a defined value the operation will be
performed \emph{as if} the function \kw{Uxxx} is the identity function.
As an example consider the two sets:
\begin{code}
WU1 = {"OP1": 1, "OP2": [], "WI": 2, "GI": []},
WU2 = {"OP1": 6, "OP2": 5, "WI": [], "GI": []},
\end{code}
and the \udq{} expression \kw{DEFINE WUUADD WU1 UADD WU2}, then the resulting
set \kw{WUUADD} will be
\begin{code}
WUUADD = {"OP1": 7, "OP2": 5, "WI": 2, "GI": []}.
\end{code}
This in contrast to a normal $+$ which only operates on the intersection of the
two sets, only well OP1 would have a defined value in this case.
\section{Used as a control: UDA}
\label{uda}
Probably one of the most important uses of the \udq{} functionality is the
ability to use a \udq{} as control in e.g. the \kw{WCONINJE} keyword. In the
example below we calculate the produced liquid volume from a group of wells and
use that as injection target for a water injector:
\begin{deck}
UDQ
DEFINE FULPR (WOPR P* + WWPR P*) * 1.25 /
/
...
...
WCONINJE
WI 'WATER' 'OPEN' 'RATE' 'FULPR' /
/
\end{deck}
In the following insane example we distribute the current oil production rate
randomly among the producers and use that as target for the next timestep - do
not try this at home:
\begin{deck}
UDQ
-- Create a 0 / 1 mask with 0 for injectors and 1 for producers.
DEFINE WUPROD WOPR > 0 /
-- Create a vector of random numbers [0,1] for all producers
DEFINE WURAND 0.5 * (RANDU(WUPROD) + 1) * WUPROD /
-- Create a vector where all producers get a random fraction of
-- the current total oil production rate
DEFINE WUOPR FOPR * WURAND / SUM(WURAND) /
/
-- Need to have a well list or similar to select all producers for
-- the WCONPROD keyword.
WLIST
'P' 'ADD' ..... /
WCONPROD
'*P' 'OPEN' 'ORAT' 'WUOPR' /
/
\end{deck}
One point about this example is that the \udq{} variable \kw{WUOPR} which is
used as as control in the \kw{WCONPROD} is a well set, the lookup machinery will
automatically use the correct well index when assigning control value to a
particular well.
From an implementation point of view the \kw{UDA} functionality creates a
significant complexity, because the actual rate to use in the simulation must be
evaluated \emph{just in time}.
\section{\udq{} units}
\label{udq_units}
The \udq{} subcommand \kw{UNIT} can be used to assign a string which is used as
output unit when the \udq{} variable is output to the summary file. This is
\emph{only} a string and does not induce any unit conversion. All \udq{}
evaluations are in terms of the corre deck units - irrespective of the \kw{UNIT}
subcommand. Consider the following
\begin{deck}
RUNSPEC
FIELD
...
...
SCHEDULE
UDQ
DEFINE WUI WWIR - 100 /
/
\end{deck}
\begin{enumerate}
\item The simulation runs in SI units; hence the water injection rate is
calculated in $\mathrm{m^3/s}$.
\item As part of the summary evaluation the \inlinecode{SummaryState} will
contain the water injection rate converted to field units.
\item The \udq{} variable \kw{WUI} is evaluated as the water injection rate from
\inlinecode{SummaryState} subtracted numerical value 100, \emph{it is solely the users
responsability that the numerical value 100 represents water injection rate in
field units.}
\end{enumerate}
Observe that the units are complicated, and non intuitive for \kw{UDA} values.
The \kw{UDA} evaluation is based on the \inlinecode{SummaryState} class which is
in deck units, the controls determined by \kw{UDA} evaluation must therefor be
converted to SI units just when it is passed to the simulator. The initial
design ambition was to block the deck units at the IO boundary, keeping the
internals fully in SI. The \kw{UDA} concept is the exception which manages to
inject deck units quite far into the code.
\section{Implementation details}
The significant part of the UDQ implementation is in classes located in
\path{opm/input/eclipse/Schedule/UDQ}, in addition the restart output of
\udq{}/\kw{UDA} values is in \path{opm/output/eclipse/AggregateUDQData.cpp}.
Finally the \udq{} parser makes use of the type \inlinecode{RawString} to treat
literal ``/'' and ``*'' different from ordinary parsing where ``/'' signifies
end of line and ``*'' is either a default or part of a multiplier expression.
\subsection*{\inlinecode{UDQConfig}}
The class \inlinecode{UDQConfig} internalizes the parsing of the \udq{} keywords
from the input deck. The \inlinecode{UDQConfig} instance is time-versioned and
managed by the \inlinecode{ScheduleState} class. The \inlinecode{UDQConfig} is
immutable while the simulator is executing. The \inlinecode{UDQConfig} contains
two main classes \inlinecode{UDQDefine} and \inlinecode{UDQAssign} in addition
to book-keeping code to keep track of what type of expression a \udq{} keyword
is at the time. A significant part of the book-keeping is only required to be
able to output restart files in \eclipse{} format.
\subsection*{\inlinecode{UDQDefine} and \inlinecode{UDQASTNode}}
The \inlinecode{UDQDefine} manages a parsed \udq{} expresssion along with a
chunck of metadata. The parsed \udq{} expression is managed in an instance of
\inlinecode{UDQASTNode}. The \inlinecode{UDQASTNode} contains a parsed tree
representation of the \udq{} input expression. The parsing of \udq{} expressions
happens at input time, and for the rest of the simulation the
\inlinecode{UDQASTnode} instances are immutable.
Many scalar \udq{} types are defined in the file \path{UDQEenums.hpp} and in the
namespace \inlinecode{UDQ} there are many small utility functions to work with
these enums.
\subsection*{\inlinecode{SummaryState}}
\label{summarystate}
The \inlinecode{SummaryState} class is not part of the \udq{} implementation,
but it is a very important class for the \udq{} functionality. At the end of
every timestep the simulator will call the method \inlinecode{evalSummary} which
will call into opm-common and evaluate all summary variables and store them in a
\inlinecode{SummaryState} instance\footnote{Observe that during initialization
the \udq{} expressions are inspected, and we make sure that all summary
variables needed to evaulate \udq{} expressions are evaluated in the Summary
evaluation.}. The \inlinecode{SummaryState} class manages a set of maps with
well, group and field variables, when evaluating e.g. the \kw{WOPR} the results
will be stored in a two level map first indexed with keyword \kw{WOPR} and then
with well name. Afterwards the \udq{} layer can fetch values with
\inlinecode{SummaryState::get\_well\_var()}. The values in the
\inlinecode{SummaryState} have been converted to output units, this is important
for the \kw{UDA} evaluation.
At the end of every timestep the \inlinecode{UDQConfig::eval()} method is called
to evaluate all the \udq{} expressions, the evaluated values will end up in the
active \inlinecode{SummaryState} instance, i.e. for this \udq{}
\begin{deck}
UDQ
DEFINE FUOPR SUM(WOPR) /
DEFINE WUGWR WGPR / WWPR /
/
\end{deck}
we will get \inlinecode{SummaryState} entries for \kw{FUOPR} and \kw{WUGWR} for
\emph{all} wells in the model. These \inlinecode{SummaryState} values can then
be output to the summary file, be used when evaluating \kw{ACTIONX} keywords or
to evaluate \kw{UDA} control values.
In addition to the \inlinecode{SummaryState} variable there is an instance of
type \inlinecode{UDQState} which is updated runtime, the \inlinecode{UDQState}
instance holds on to the results of \udq{} evaluations with more context than
\inlinecode{SummaryState} and is used to output \udq{} and \kw{UDA} state to the
restart files. While evaluating the simulator will create a \kw{UDQContext}
variable which will manage both the \inlinecode{SummaryState},
\inlinecode{UDQState} and also some \udq{} parameters from the \kw{RUNSPEC}
section. The lifetime of the \kw{UDQContext} instance is only one \udq{}
evaluation.
While evaluating the \udq{} expressions the results will be instances of
\inlinecode{UDQSet} which is a small container class which keeps track of
well/group names and whether a value is defined or not. The \inlinecode{UDQSet}
class overrides the arithmetic operators like \inlinecode{UDQSet::operator+()}
so that expressions like \kw{2 * WOPR 'OP*'} can be easily evaluated in code.
\subsection*{Paralell awareness}
\label{udq_parallel}
The opm-common code where the \udq{} functionality is implemented is totally
unaware of parallel execution, so to be certain that this works for a parallel
simulator care must be taken. In flow this is handled as:
\begin{enumerate}
\item The \inlinecode{Schedule} class as a whole is identical on all
processes.
\item The state variables \inlinecode{UDQState} and \inlinecode{SummaryState}
are distributed so they are equal on all processes before the \udq{}
evaluation. This communication is performed in the simulator.
\end{enumerate}
The \udq{} evaluation is invoked from
\path{opm-simulators/ebos/eclgenericwriter.cc} function
\inlinecode{evalSummary()}.

View File

@@ -5,8 +5,8 @@
Module: opm-common
Description: Open Porous Media Initiative shared infrastructure
Version: 2020.10-pre
Label: 2020.10-pre
Version: 2022.04
Label: 2022.04
Maintainer: opm@opm-project.org
MaintainerName: OPM community
Url: http://opm-project.org

View File

@@ -18,6 +18,7 @@
*/
#include <filesystem>
#include <iostream>
#include <getopt.h>
#include <string.h>
@@ -25,13 +26,12 @@
#include "config.h"
#if HAVE_OPENMP
#if _OPENMP
#include <omp.h>
#endif
#include <opm/io/eclipse/ESmry.hpp>
#include <opm/io/eclipse/EclUtil.hpp>
#include <opm/common/utility/FileSystem.hpp>
static void printHelp() {
@@ -39,7 +39,7 @@ static void printHelp() {
std::cout << "\nThis program create one or more lodsmry files, designed for effective load on the demand. \n"
<< "These files are created with input from the smspec and unsmry file. \n"
<< "\nIn addition, the program takes these options (which must be given before the arguments):\n\n"
<< "-f if LODSMRY file exist, this will be replaced. Default behaviour is that existing file is kept.\n"
<< "-f if ESMRY file exist, this will be replaced. Default behaviour is that existing file is kept.\n"
<< "-n Maximum number of threads to be used if mulitple files should be created.\n"
<< "-h Print help and exit.\n\n";
}
@@ -48,7 +48,9 @@ static void printHelp() {
int main(int argc, char **argv) {
int c = 0;
int max_threads [[maybe_unused]] = -1;
#ifdef _OPENMP
int max_threads = -1;
#endif
bool force = false;
while ((c = getopt(argc, argv, "fn:h")) != -1) {
@@ -60,7 +62,11 @@ int main(int argc, char **argv) {
printHelp();
return 0;
case 'n':
#ifdef _OPENMP
max_threads = atoi(optarg);
#else
std::cerr << "OpenMP is disabled - using single thread only\n";
#endif
break;
default:
return EXIT_FAILURE;
@@ -69,7 +75,7 @@ int main(int argc, char **argv) {
int argOffset = optind;
#if HAVE_OPENMP
#ifdef _OPENMP
int available_threads = omp_get_max_threads();
if (max_threads < 0)
@@ -87,23 +93,23 @@ int main(int argc, char **argv) {
#pragma omp parallel for
for (int f = argOffset; f < argc; f ++){
Opm::filesystem::path inputFileName = argv[f];
std::filesystem::path inputFileName = argv[f];
Opm::filesystem::path lodFileName = inputFileName.parent_path() / inputFileName.stem();
lodFileName = lodFileName += ".LODSMRY";
std::filesystem::path esmryFileName = inputFileName.parent_path() / inputFileName.stem();
esmryFileName = esmryFileName += ".ESMRY";
if (Opm::EclIO::fileExists(lodFileName) && (force))
remove (lodFileName);
if (Opm::EclIO::fileExists(esmryFileName) && (force))
remove (esmryFileName);
Opm::EclIO::ESmry smryFile(argv[f]);
if (!smryFile.make_lodsmry_file()){
if (!smryFile.make_esmry_file()){
std::cout << "\n! Warning, smspec already have one lod file, existing kept use option -f to replace this" << std::endl;
}
}
auto lap1 = std::chrono::system_clock::now();
std::chrono::duration<double> elapsed_seconds1 = lap1-lap0;
std::cout << "\nruntime for creating " << (argc-argOffset) << " LODSMRY files: " << elapsed_seconds1.count() << " seconds\n" << std::endl;
std::cout << "\nruntime for creating " << (argc-argOffset) << " ESMRY files: " << elapsed_seconds1.count() << " seconds\n" << std::endl;
return 0;
}

View File

@@ -19,14 +19,14 @@
#include <opm/output/eclipse/EclipseIO.hpp>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
#include <opm/input/eclipse/Parser/Parser.hpp>
#include <opm/input/eclipse/Parser/ParseContext.hpp>
#include <opm/input/eclipse/Parser/ErrorGuard.hpp>
#include <opm/parser/eclipse/Python/Python.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
#include <opm/input/eclipse/Python/Python.hpp>
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
#include <opm/input/eclipse/Schedule/Schedule.hpp>
#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
#include <opm/common/OpmLog/OpmLog.hpp>
#include <opm/msim/msim.hpp>
@@ -43,7 +43,7 @@ int main(int /* argc */, char** argv) {
Opm::Deck deck = parser.parseFile(deck_file, parse_context, error_guard);
Opm::EclipseState state(deck);
Opm::Schedule schedule(deck, state, parse_context, error_guard, python);
Opm::SummaryConfig summary_config(deck, schedule, state.getTableManager(), state.aquifer(),
Opm::SummaryConfig summary_config(deck, schedule, state.fieldProps(), state.aquifer(),
parse_context, error_guard);
if (error_guard) {
@@ -51,8 +51,8 @@ int main(int /* argc */, char** argv) {
error_guard.terminate();
}
Opm::msim msim(state);
Opm::msim msim(state, schedule);
Opm::EclipseIO io(state, state.getInputGrid(), schedule, summary_config);
msim.run(schedule, io, false);
msim.run(io, false);
}

View File

@@ -19,17 +19,19 @@
#include <getopt.h>
#include <vector>
#include <iostream>
#include <sstream>
#include <cstdlib>
#include <fmt/format.h>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/input/eclipse/Parser/Parser.hpp>
#include <opm/input/eclipse/Parser/ParseContext.hpp>
#include <opm/input/eclipse/Parser/ErrorGuard.hpp>
#include <opm/input/eclipse/Deck/Deck.hpp>
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
#include <opm/input/eclipse/Schedule/Schedule.hpp>
struct keyword {
@@ -49,7 +51,7 @@ struct keyword {
};
std::vector<keyword> load_deck(const char * deck_file) {
std::vector<keyword> load_deck(const std::string& deck_file) {
Opm::ParseContext parseContext;
Opm::ErrorGuard errors;
Opm::Parser parser;
@@ -73,7 +75,7 @@ std::vector<keyword> load_deck(const char * deck_file) {
}
std::size_t deck_hash(const std::vector<keyword>& keywords) {
std::size_t make_deck_hash(const std::vector<keyword>& keywords) {
std::stringstream ss;
for (const auto& kw : keywords)
ss << kw.content_hash;
@@ -82,14 +84,14 @@ std::size_t deck_hash(const std::vector<keyword>& keywords) {
}
void print_keywords(const std::vector<keyword>& keywords, bool location_info) {
void print_keywords(const std::vector<keyword>& keywords, std::size_t deck_hash, bool location_info) {
for (const auto& kw : keywords) {
if (location_info)
fmt::print("{:8s} : {}:{} {} \n", kw.name, kw.filename, kw.line_number, kw.content_hash);
else
fmt::print("{:8s} : {} \n", kw.name, kw.content_hash);
}
fmt::print("\n{:8s} : {}\n", "Total", deck_hash(keywords));
fmt::print("\n{:8s} : {}\n", "Total", deck_hash);
}
@@ -118,6 +120,12 @@ Options:
-l : Add filename and linenumber information to each keyword.
-s : Short form - only print the hash of the complete deck.
-S : Silent form - will not print any deck output.
It is possible to add multiple deck arguments, they are then scanned repeatedly,
and the decks are compared. In the case of multiple deck arguments the exit
status of the program will be zero if all are equal and nonzero in case of
differences.
)";
std::cerr << help_text << std::endl;
@@ -129,10 +137,11 @@ int main(int argc, char** argv) {
int arg_offset = 1;
bool location_info = false;
bool short_form = false;
bool silent = false;
while (true) {
int c;
c = getopt(argc, argv, "ls");
c = getopt(argc, argv, "lsS");
if (c == -1)
break;
@@ -143,16 +152,53 @@ int main(int argc, char** argv) {
case 's':
short_form = true;
break;
case 'S':
silent = true;
break;
}
}
arg_offset = optind;
if (arg_offset >= argc)
print_help_and_exit();
auto keywords = load_deck(argv[arg_offset]);
if (short_form)
std::cout << deck_hash(keywords) << std::endl;
else
print_keywords(keywords, location_info);
std::vector<std::pair<std::string, std::size_t>> deck_hash_table;
for (int iarg = arg_offset; iarg < argc; iarg++) {
const std::string deck_file = argv[iarg];
auto keywords = load_deck(deck_file);
auto deck_hash = make_deck_hash(keywords);
deck_hash_table.emplace_back(deck_file, deck_hash);
if (silent)
continue;
if (short_form)
std::cout << deck_hash << std::endl;
else
print_keywords(keywords, deck_hash, location_info);
}
if (deck_hash_table.size() > 1) {
bool equal = true;
const auto& [first_deck, first_hash] = deck_hash_table[0];
for (std::size_t index = 1; index < deck_hash_table.size(); index++) {
const auto& [deck, hash] = deck_hash_table[index];
if (first_hash != hash)
equal = false;
if (silent)
continue;
fmt::print("{} {} {}\n",
first_deck,
(first_hash == hash) ? "==" : "!=",
deck);
}
if (equal)
std::exit(EXIT_SUCCESS);
else
std::exit(EXIT_FAILURE);
}
}

View File

@@ -21,19 +21,20 @@
#include <iomanip>
#include <chrono>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/Python/Python.hpp>
#include <opm/input/eclipse/Parser/Parser.hpp>
#include <opm/input/eclipse/Parser/ParseContext.hpp>
#include <opm/input/eclipse/Parser/ErrorGuard.hpp>
#include <opm/input/eclipse/Deck/Deck.hpp>
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
#include <opm/input/eclipse/Schedule/Schedule.hpp>
#include <opm/input/eclipse/Python/Python.hpp>
#include <opm/common/OpmLog/OpmLog.hpp>
#include <opm/common/OpmLog/StreamLog.hpp>
#include <opm/common/OpmLog/LogUtil.hpp>
#include <opm/common/utility/TimeService.hpp>
void initLogging() {
@@ -49,30 +50,30 @@ inline void loadDeck( const char * deck_file) {
std::cout << "Loading deck: " << deck_file << " ..... "; std::cout.flush();
std::chrono::system_clock::time_point start;
Opm::time_point start;
start = std::chrono::system_clock::now();
start = Opm::TimeService::now();
auto deck = parser.parseFile(deck_file, parseContext, errors);
auto deck_time = std::chrono::system_clock::now() - start;
auto deck_time = Opm::TimeService::now() - start;
std::cout << "parse complete - creating EclipseState .... "; std::cout.flush();
start = std::chrono::system_clock::now();
start = Opm::TimeService::now();
Opm::EclipseState state( deck );
auto state_time = std::chrono::system_clock::now() - start;
auto state_time = Opm::TimeService::now() - start;
std::cout << "creating Schedule .... "; std::cout.flush();
start = std::chrono::system_clock::now();
start = Opm::TimeService::now();
Opm::Schedule schedule( deck, state, python);
auto schedule_time = std::chrono::system_clock::now() - start;
auto schedule_time = Opm::TimeService::now() - start;
std::cout << "creating SummaryConfig .... "; std::cout.flush();
start = std::chrono::system_clock::now();
Opm::SummaryConfig summary( deck, schedule, state.getTableManager( ), state.aquifer(),
start = Opm::TimeService::now();
Opm::SummaryConfig summary( deck, schedule, state.fieldProps(), state.aquifer(),
parseContext, errors );
auto summary_time = std::chrono::system_clock::now() - start;
auto summary_time = Opm::TimeService::now() - start;
std::cout << "complete." << std::endl << std::endl;
std::cout << "Time: " << std::endl;

View File

@@ -17,21 +17,21 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#include <filesystem>
#include <fstream>
#include <iostream>
#include <getopt.h>
#include <opm/common/utility/FileSystem.hpp>
#include <opm/parser/eclipse/Parser/ParserKeywords/I.hpp>
#include <opm/parser/eclipse/Parser/ParserKeywords/P.hpp>
#include <opm/parser/eclipse/Parser/ParserKeywords/G.hpp>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
#include <opm/parser/eclipse/Parser/InputErrorAction.hpp>
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/input/eclipse/Parser/ParserKeywords/I.hpp>
#include <opm/input/eclipse/Parser/ParserKeywords/P.hpp>
#include <opm/input/eclipse/Parser/ParserKeywords/G.hpp>
#include <opm/input/eclipse/Parser/Parser.hpp>
#include <opm/input/eclipse/Parser/ErrorGuard.hpp>
#include <opm/input/eclipse/Parser/ParseContext.hpp>
#include <opm/input/eclipse/Parser/InputErrorAction.hpp>
#include <opm/input/eclipse/Deck/Deck.hpp>
namespace fs = Opm::filesystem;
namespace fs = std::filesystem;
Opm::Deck pack_deck( const char * deck_file, std::ostream& os) {
Opm::ParseContext parseContext(Opm::InputError::WARN);
@@ -154,16 +154,14 @@ int main(int argc, char** argv) {
}
using IMPORT = Opm::ParserKeywords::IMPORT;
for (std::size_t import_index = 0; import_index < deck.count<IMPORT>(); import_index++) {
const auto& import_keyword = deck.getKeyword<IMPORT>(import_index);
for (const auto& import_keyword : deck.get<IMPORT>()) {
const auto& fname = import_keyword.getRecord(0).getItem<IMPORT::FILE>().get<std::string>(0);
copy_file(input_arg.parent_path(), fname, output_dir);
}
using PYACTION = Opm::ParserKeywords::PYACTION;
for (std::size_t pyaction_index = 0; pyaction_index < deck.count<PYACTION>(); pyaction_index++) {
const auto& pyaction_keyword = deck.getKeyword<PYACTION>(pyaction_index);
for (const auto& pyaction_keyword : deck.get<PYACTION>()) {
const auto& fname = pyaction_keyword.getRecord(1).getItem<PYACTION::FILENAME>().get<std::string>(0);
copy_file(input_arg.parent_path(), fname, output_dir);
}
@@ -171,7 +169,7 @@ int main(int argc, char** argv) {
using GDFILE = Opm::ParserKeywords::GDFILE;
if (deck.hasKeyword<GDFILE>()) {
const auto& gdfile_keyword = deck.getKeyword<GDFILE>();
const auto& gdfile_keyword = deck.get<GDFILE>().back();
const auto& fname = gdfile_keyword.getRecord(0).getItem<GDFILE::filename>().get<std::string>(0);
copy_file(input_arg.parent_path(), fname, output_dir);
}

369
examples/rst_deck.cpp Normal file
View File

@@ -0,0 +1,369 @@
/*
Copyright 2021 Statoil ASA.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#include <cstdlib>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <getopt.h>
#include <fmt/format.h>
#include <unordered_set>
#include <utility>
#include <opm/input/eclipse/Deck/DeckKeyword.hpp>
#include <opm/input/eclipse/Units/UnitSystem.hpp>
#include <opm/input/eclipse/Parser/ParserKeywords/I.hpp>
#include <opm/input/eclipse/Parser/ParserKeywords/P.hpp>
#include <opm/input/eclipse/Parser/ParserKeywords/G.hpp>
#include <opm/input/eclipse/Parser/ParserKeywords/R.hpp>
#include <opm/input/eclipse/Parser/ParserKeywords/S.hpp>
#include <opm/input/eclipse/Parser/Parser.hpp>
#include <opm/input/eclipse/Parser/ErrorGuard.hpp>
#include <opm/input/eclipse/Parser/ParseContext.hpp>
#include <opm/input/eclipse/Parser/InputErrorAction.hpp>
#include <opm/input/eclipse/EclipseState/IOConfig/IOConfig.hpp>
#include <opm/input/eclipse/Deck/Deck.hpp>
#include <opm/input/eclipse/Deck/FileDeck.hpp>
namespace fs = std::filesystem;
const std::unordered_set<std::string> remove_from_solution = {"EQUIL", "PRESSURE", "SWAT", "SGAS"};
void print_help_and_exit(const std::optional<std::string> error_msg = {}) {
if (error_msg.has_value()) {
std::cerr << "Error:" << std::endl;
std::cerr << error_msg.value() << std::endl;
std::cerr << "------------------------------------------------------" << std::endl;
}
std::string keep_keywords;
for (const auto& kw : Opm::FileDeck::rst_keep_in_solution)
keep_keywords += kw + " ";
const std::string help_text = fmt::format(R"(
The rst_deck program will load a simulation deck and parameters for a restart
and reformat the deck to become a restart deck. Before the updated deck is
output the program will update the SOLUTION and SCHEDULE sections. All keywords
from the SOLUTION section will be cleared out(1) and a RESTART keyword will be
inserted. In the SCHEDULE section the program can either remove all keywords up
until the restart date, or alternatively insert SKIPREST immediately following
the SCHEDULE keyword.
When creating the updated restart deck the program can either link to unmodified
include files with INCLUDE statements, create a copy of deck structure in an
alternative location or create one large file with all keywords in the same
file. Apart from the alterations to support restart the output deck will be
equivalent to the input deck, but formatting is not retained and comments have
been stripped away.
Arguments:
1. The data file we are starting with.
2. The restart source; this can either be a basename with an optional path
prefix and a :N to restart from step N; alternatively you can point to an
existing restart file. If you point to an existing restart file the input
will be validated in several ways:
a) Unified/multiple files will be checked against the UNIFIN setting of
the deck.
b) Formatted/unformatted will be checked against the FMTIn setting of the
deck.
c) If a single file like /path/to/case/HISTORY.X0067 is given as argument the
:N notation to denote report step should not be used.
If the restart argument is given as the path to an existing file the content
of the RESTART keyword will be updated to contain the correct path from the
location of the restart deck to the location of the restart file. This path
awareness will be fooled if the restart deck is redirected from stdout to a
path different from cwd. If the restart argument is given as an absolute
filename the RESTART keyword will have an absolute path, if the restart
argument is a relative path the RESTART keyword will get a relative path -
although an absolute path will be used if the restart file and the output
deck have different roots. If the restart argument is given as a string not
pointing to an existing file it will be inserted verbatim in the restart
deck.
A restart step value of 0 is interpreted as a dry run - a deck which has not
been set up for restart will be written out.
3. Basename of the restart deck we create, can optionally contain a path prefix;
the path will be created if it does not already exist. This argument is
optional, if it is not provided the program will dump a restart deck on
stdout. If the argument corresponds to an existing directory the restart case
will get the same name as the base case.
Options:
-s: Manipulate the SCHEDULE section by inserting a SKIPREST keyword immediately
following the SCHEDULE keyword. If the -s option is not used the SCHEDULE
section will be modified by removing all keywords until we reach the restart
date.
-m: [share|inline|copy] The restart deck can reuse the unmodified include files
from the base case, this is mode 'share' and is the default. With mode
'inline' the restart deck will be one long file and with mode 'copy' the
file structure of the base case will be retained. The default if no -m
option is given is the 'share' mode.
In the case of 'share' and 'copy' the correct path to include files will be
negotiated based on the path given to the output case in the third argument.
If the restart deck is passed to stdout the include files will be resolved
based on output in cwd.
Example:
rst_deck /path/to/history/HISTORY.DATA rst/HISTORY:30 /path/to/rst/RESTART -s
1: The program has a compiled list of keywords which will be retained in the
SOLUTION section. The current value of that list is: {}
)", keep_keywords);
std::cerr << help_text << std::endl;
if (error_msg.has_value())
std::exit(EXIT_FAILURE);
std::exit(EXIT_SUCCESS);
}
struct Options {
std::string input_deck;
std::string restart_base;
int restart_step;
std::optional<std::string> target_path;
std::optional<std::string> target_fname;
Opm::FileDeck::OutputMode mode{Opm::FileDeck::OutputMode::SHARE};
bool skiprest{false};
};
Opm::Deck load_deck(const Options& opt) {
Opm::ParseContext parseContext(Opm::InputError::WARN);
Opm::ErrorGuard errors;
Opm::Parser parser;
/* Use the same default ParseContext as flow. */
parseContext.update(Opm::ParseContext::PARSE_RANDOM_SLASH, Opm::InputError::IGNORE);
parseContext.update(Opm::ParseContext::PARSE_MISSING_DIMS_KEYWORD, Opm::InputError::WARN);
parseContext.update(Opm::ParseContext::SUMMARY_UNKNOWN_WELL, Opm::InputError::WARN);
parseContext.update(Opm::ParseContext::SUMMARY_UNKNOWN_GROUP, Opm::InputError::WARN);
return parser.parseFile(opt.input_deck, parseContext, errors);
}
Opm::FileDeck::OutputMode mode(const std::string& mode_arg) {
if (mode_arg == "inline")
return Opm::FileDeck::OutputMode::INLINE;
if (mode_arg == "share")
return Opm::FileDeck::OutputMode::SHARE;
if (mode_arg == "copy")
return Opm::FileDeck::OutputMode::COPY;
print_help_and_exit(fmt::format("Mode argument: \'{}\' not recognized. Valid options are inline|share|copy", mode_arg));
return Opm::FileDeck::OutputMode::INLINE;
}
std::optional<std::size_t> verify_extension(const std::string& extension, bool unified, bool formatted) {
if (unified) {
if (formatted) {
if (extension == ".FUNRST")
return std::nullopt;
print_help_and_exit("Deck has specified formatted unified input - expected restart extension: .FUNRST");
}
if (extension == ".UNRST")
return std::nullopt;
print_help_and_exit("Deck has expected unformatted unified input - expected restart extension: .UNRST");
}
std::size_t report_step;
if ((formatted && (extension[1] == 'F')) || (!formatted && (extension[1] == 'X'))) {
try {
report_step = std::stoi(extension.substr(2));
return report_step;
}
catch (...) {}
}
print_help_and_exit("Deck has specified multiple input files - expected restart extension: .Xnnnn / .Fnnnn");
return std::nullopt;
}
bool same_mount(const fs::path& p1, const fs::path& p2) {
auto abs1 = fs::absolute(p1);
auto abs2 = fs::absolute(p2);
auto iter1 = abs1.begin(); iter1++;
auto iter2 = abs2.begin(); iter2++;
auto mnt1 = *iter1;
auto mnt2 = *iter2;
return (mnt1 == mnt2);
}
void update_restart_path(Options& opt, const std::string& restart_arg, const Opm::IOConfig& io_config) {
std::string base;
std::optional<std::size_t> rst_step;
auto sep_pos = restart_arg.rfind(':');
auto base_arg = restart_arg.substr(0, sep_pos);
if (fs::exists(base_arg)) {
auto unif = io_config.getUNIFIN();
auto fmt = io_config.getFMTIN();
auto path = fs::path(base_arg);
auto extension = path.extension();
rst_step = verify_extension(extension, unif, fmt);
if (path.is_absolute()) {
path.replace_extension();
base = path;
} else {
auto target_path = fs::current_path();
if (opt.target_path.has_value())
target_path = fs::path(opt.target_path.value());
if (same_mount(path, target_path))
base = fs::relative(path, target_path).replace_extension();
else
base = fs::canonical(fs::absolute(path)).replace_extension();
}
} else
base = base_arg;
if (!rst_step.has_value()) {
if (sep_pos == std::string::npos)
print_help_and_exit(fmt::format("Expected restart argument on the form: BASE:NUMBER - e.g. HISTORY:60"));
rst_step = std::stoi(restart_arg.substr(sep_pos + 1));
}
opt.restart_step = rst_step.value();
opt.restart_base = base;
}
std::pair<Options, std::string> load_options(int argc, char **argv) {
Options opt;
while (true) {
int c;
c = getopt(argc, argv, "hm:s");
if (c == -1)
break;
switch(c) {
case 'm':
opt.mode = mode(optarg);
break;
case 's':
opt.skiprest = true;
break;
case 'h':
print_help_and_exit();
break;
}
}
auto arg_offset = optind;
if (arg_offset >= argc)
print_help_and_exit();
opt.input_deck = argv[arg_offset];
std::string restart_arg = argv[arg_offset + 1];
if ((argc - arg_offset) >= 3) {
auto target_arg = argv[arg_offset + 2];
if (fs::is_directory(target_arg)) {
opt.target_path = target_arg;
opt.target_fname = fs::path(opt.input_deck).filename();
} else {
auto target_path = fs::path( fs::absolute(target_arg) );
opt.target_path = fs::absolute(target_path.parent_path());
opt.target_fname = target_path.filename();
}
if (opt.mode == Opm::FileDeck::OutputMode::COPY) {
auto target = fs::path(target_arg).parent_path();
if (fs::exists(target)) {
auto input = fs::path(opt.input_deck).parent_path();
if (fs::equivalent(target, input))
opt.mode = Opm::FileDeck::OutputMode::SHARE;
}
}
} else {
if (opt.mode == Opm::FileDeck::OutputMode::COPY)
print_help_and_exit("When writing output to stdout you must use inline|share mode");
}
return {opt, restart_arg};
}
void update_solution(const Options& opt, Opm::FileDeck& file_deck)
{
if (opt.restart_step == 0)
return;
const auto solution = file_deck.find("SOLUTION");
if (!solution.has_value())
print_help_and_exit(fmt::format("Could not find SOLUTION section in input deck: {}", opt.input_deck));
auto summary = file_deck.find("SUMMARY");
if (!summary.has_value())
print_help_and_exit(fmt::format("Could not find SUMMARY section in input deck: {}", opt.input_deck));
file_deck.rst_solution(opt.restart_base, opt.restart_step);
}
void update_schedule(const Options& opt, Opm::FileDeck& file_deck)
{
if (opt.restart_step == 0)
return;
if (opt.skiprest)
file_deck.insert_skiprest();
else
file_deck.skip(opt.restart_step);
}
int main(int argc, char** argv) {
auto [options, restart_arg] = load_options(argc, argv);
auto deck = load_deck(options);
Opm::FileDeck file_deck(deck);
update_restart_path(options, restart_arg, Opm::IOConfig(deck));
update_solution(options, file_deck);
update_schedule(options, file_deck);
if (!options.target_path.has_value())
file_deck.dump_stdout(fs::current_path(), options.mode);
else
file_deck.dump( options.target_path.value(), options.target_fname.value(), options.mode);
}

View File

@@ -17,23 +17,24 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#include <filesystem>
#include <fstream>
#include <iomanip>
#include <chrono>
#include <sstream>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/Python/Python.hpp>
#include <opm/input/eclipse/Parser/Parser.hpp>
#include <opm/input/eclipse/Parser/ParseContext.hpp>
#include <opm/input/eclipse/Parser/ErrorGuard.hpp>
#include <opm/input/eclipse/Deck/Deck.hpp>
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
#include <opm/input/eclipse/Schedule/Schedule.hpp>
#include <opm/input/eclipse/Python/Python.hpp>
#include <opm/common/OpmLog/OpmLog.hpp>
#include <opm/common/OpmLog/StreamLog.hpp>
#include <opm/common/OpmLog/LogUtil.hpp>
#include <opm/common/utility/FileSystem.hpp>
inline void createDot(const Opm::Schedule& schedule, const std::string& casename)
@@ -45,7 +46,7 @@ inline void createDot(const Opm::Schedule& schedule, const std::string& casename
os << "// Convert output to PDF with 'dot -Tpdf " << casename << ".gv > " << casename << ".pdf'\n";
os << "strict digraph \"" << casename << "\"\n{\n";
const auto groupnames = schedule.groupNames();
const std::size_t last = schedule.getTimeMap().last();
const std::size_t last = schedule.size() - 1;
// Group -> Group relations.
for (const auto& gn : groupnames) {
const auto& g = schedule.getGroup(gn, last);
@@ -84,6 +85,7 @@ inline void createDot(const Opm::Schedule& schedule, const std::string& casename
}
os << "}\n";
std::cout << "complete." << std::endl;
std::cout << "Convert output to PDF with 'dot -Tpdf " << casename << ".gv > " << casename << ".pdf'\n" << std::endl;
}
@@ -122,7 +124,7 @@ int main(int argc, char** argv)
for (int iarg = 1; iarg < argc; iarg++) {
const std::string filename = argv[iarg];
const auto sched = loadSchedule(filename);
const auto casename = Opm::filesystem::path(filename).stem();
const auto casename = std::filesystem::path(filename).stem();
createDot(sched, casename);
}
} catch (const std::exception& e) {

View File

@@ -3,7 +3,7 @@
declare -A configurations
declare -A EXTRA_MODULE_FLAGS
EXTRA_MODULE_FLAGS[opm-simulators]="-DBUILD_EBOS_EXTENSIONS=ON -DBUILD_EBOS_DEBUG_EXTENSIONS=ON -DBUILD_FLOW_VARIANTS=ON -DOPM_ENABLE_PYTHON=ON"
EXTRA_MODULE_FLAGS[opm-simulators]="-DBUILD_FLOW_VARIANTS=ON -DOPM_ENABLE_PYTHON=ON -DBUILD_FLOW_POLY_GRID=ON"
EXTRA_MODULE_FLAGS[opm-common]="-DOPM_ENABLE_PYTHON=ON -DOPM_ENABLE_EMBEDDED_PYTHON=ON -DOPM_INSTALL_PYTHON=ON"
# Parse revisions from trigger comment and setup arrays
@@ -16,7 +16,12 @@ function parseRevisions {
do
if grep -qi "$upstream=" <<< $ghprbCommentBody
then
upstreamRev[$upstream]=pull/`echo $ghprbCommentBody | sed -r "s/.*${upstream,,}=([0-9]+).*/\1/g"`/merge
if test -n "$absolute_revisions"
then
upstreamRev[$upstream]=`echo $ghprbCommentBody | sed -r "s/.*${upstream,,}=([^ ]+).*/\1/g"`
else
upstreamRev[$upstream]=pull/`echo $ghprbCommentBody | sed -r "s/.*${upstream,,}=([0-9]+).*/\1/g"`/merge
fi
fi
done
if grep -q "with downstreams" <<< $ghprbCommentBody
@@ -25,8 +30,13 @@ function parseRevisions {
do
if grep -qi "$downstream=" <<< $ghprbCommentBody
then
downstreamRev[$downstream]=pull/`echo $ghprbCommentBody | sed -r "s/.*${downstream,,}=([0-9]+).*/\1/g"`/merge
fi
if test -n "$absolute_revisions"
then
downstreamRev[$downstream]=`echo $ghprbCommentBody | sed -r "s/.*${downstream,,}=([^ ]+).*/\1/g"`
else
downstreamRev[$downstream]=pull/`echo $ghprbCommentBody | sed -r "s/.*${downstream,,}=([0-9]+).*/\1/g"`/merge
fi
fi
done
fi
@@ -222,8 +232,12 @@ function build_downstreams {
# $1 = Name of main module
function build_module_full {
PY_MAJOR=`python3 --version | awk -F ' ' '{print $2}' | awk -F '.' '{print $1}'`
PY_MINOR=`python3 --version | awk -F ' ' '{print $2}' | awk -F '.' '{print $2}'`
for configuration in ${!configurations[@]}
do
export PYTHONPATH="$WORKSPACE/$configuration/install/lib/python$PY_MAJOR.$PY_MINOR/site-packages"
# Build upstream modules
build_upstreams

View File

@@ -14,6 +14,9 @@ then
if ! test -d $WORKSPACE/deps/opm-tests
then
cp $OPM_TESTS_ROOT_PREDEFINED $WORKSPACE/deps/opm-tests -R
pushd $WORKSPACE/deps/opm-tests
echo "opm-tests revision: `git rev-parse HEAD`"
popd
fi
else
# We need a full repo checkout
@@ -29,6 +32,9 @@ else
if ! test -d $WORKSPACE/deps/opm-tests
then
cp $OPM_TESTS_ROOT $WORKSPACE/deps/opm-tests -R
pushd $WORKSPACE/deps/opm-tests
echo "opm-tests-revision: `git rev-parse HEAD`"
popd
fi
fi
OPM_TESTS_ROOT=$WORKSPACE/deps/opm-tests

View File

@@ -22,6 +22,7 @@ upstreamRev[opm-grid]=master
upstreamRev[opm-models]=master
upstreamRev[opm-simulators]=master
upstreamRev[opm-upscaling]=master
upstreamRev[opm-tests]=master
# Setup revision tables
parseRevisions
@@ -37,14 +38,20 @@ do
prnumber=${rev//[!0-9]/}
BRANCH_NAME="${BRANCH_NAME}_${repo}_$prnumber"
test -n "$REASON" && REASON+=" "
REASON+="https://github.com/OPM/$repo/pull/$prnumber\n"
REASON+="PR https://github.com/OPM/$repo/pull/$prnumber\n"
fi
done
# Do the commit
export REASON
if [ "${upstreamRev[opm-tests]}" == "master" ]
then
export BRANCH_BASE=origin/master
else
export BRANCH_BASE=${upstreamRev[opm-tests]}
fi
export BRANCH_NAME
$WORKSPACE/deps/opm-simulators/tests/update_reference_data.sh $OPM_TESTS_ROOT
$WORKSPACE/deps/opm-simulators/tests/update_reference_data.sh $OPM_TESTS_ROOT $WORKSPACE/$configuration/build-opm-simulators $WORKSPACE/$configuration/install/bin/convertECL
if test $? -eq 5
then
echo "No tests failed - no data to update. Exiting"
@@ -90,7 +97,7 @@ fi
if [ -n "$DATA_PR" ]
then
curl -d "{ \"body\": \"Existing PR https://github.com/OPM/opm-tests/pull/$DATA_PR was updated\" }" -X POST https://api.github.com/repos/OPM/$MAIN_REPO/issues/$PRNUMBER/comments?access_token=$GH_TOKEN
curl -d "{ \"body\": \"Existing PR https://github.com/OPM/opm-tests/pull/$DATA_PR was updated\" }" -H "Authorization: token ${GH_TOKEN}" -X POST https://api.github.com/repos/OPM/$MAIN_REPO/issues/$PRNUMBER/comments
else
git-open-pull -u jenkins4opm --base-account OPM --base-repo opm-tests -r /tmp/cmsg $BRANCH_NAME
fi

View File

@@ -1,21 +1,24 @@
#ifndef ISIM_MAIN_HPP
#define ISIM_MAIN_HPP
#include <chrono>
#include <functional>
#include <string>
#include <map>
#include <string>
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/input/eclipse/Parser/ErrorGuard.hpp>
#include <opm/input/eclipse/Deck/Deck.hpp>
#include <opm/input/eclipse/Schedule/SummaryState.hpp>
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
#include <opm/input/eclipse/Schedule/Schedule.hpp>
#include <opm/input/eclipse/Schedule/Action/State.hpp>
#include <opm/output/data/Solution.hpp>
#include <opm/output/data/Wells.hpp>
#include <opm/output/data/Groups.hpp>
#include <opm/parser/eclipse/Deck/UDAValue.hpp>
#include <opm/input/eclipse/Deck/UDAValue.hpp>
namespace Opm {
@@ -26,10 +29,7 @@ class Parser;
class Python;
class SummaryState;
class UDQState;
namespace Action {
class State;
}
class WellTestState;
class msim {
@@ -37,24 +37,30 @@ public:
using well_rate_function = double(const EclipseState&, const Schedule&, const SummaryState& st, const data::Solution&, size_t report_step, double seconds_elapsed);
using solution_function = void(const EclipseState&, const Schedule&, data::Solution&, size_t report_step, double seconds_elapsed);
msim(const EclipseState& state);
msim(const EclipseState& state, const Schedule& schedule_arg);
Opm::UDAValue uda_val();
void well_rate(const std::string& well, data::Rates::opt rate, std::function<well_rate_function> func);
void solution(const std::string& field, std::function<solution_function> func);
void run(Schedule& schedule, EclipseIO& io, bool report_only);
void post_step(Schedule& schedule, Action::State& action_state, SummaryState& st, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& group_nwrk_data, size_t report_step);
void run(EclipseIO& io, bool report_only);
void post_step(data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& group_nwrk_data, size_t report_step, const time_point& sim_time);
private:
void run_step(const Schedule& schedule, Action::State& action_state, SummaryState& st, UDQState& udq_state, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& group_nwrk_data, size_t report_step, EclipseIO& io) const;
void run_step(const Schedule& schedule, Action::State& action_state, SummaryState& st, UDQState& udq_state, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& group_nwrk_data, size_t report_step, double dt, EclipseIO& io) const;
void output(Action::State& action_state, SummaryState& st, const UDQState& udq_state, size_t report_step, bool substep, double seconds_elapsed, const data::Solution& sol, const data::Wells& well_data, const data::GroupAndNetworkValues& group_data, EclipseIO& io) const;
void simulate(const Schedule& schedule, const SummaryState& st, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& group_nwrk_data, size_t report_step, double seconds_elapsed, double time_step) const;
void run_step(WellTestState& wtest_state, UDQState& udq_state, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& group_nwrk_data, size_t report_step, EclipseIO& io);
void run_step(WellTestState& wtest_state, UDQState& udq_state, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& group_nwrk_data, size_t report_step, double dt, EclipseIO& io);
void output(WellTestState& wtest_state, const UDQState& udq_state, size_t report_step, bool substep, double seconds_elapsed, const data::Solution& sol, const data::Wells& well_data, const data::GroupAndNetworkValues& group_data, EclipseIO& io);
void simulate(data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& group_nwrk_data, size_t report_step, double seconds_elapsed, double time_step);
EclipseState state;
std::map<std::string, std::map<data::Rates::opt, std::function<well_rate_function>>> well_rates;
std::map<std::string, std::function<solution_function>> solutions;
public:
Schedule schedule;
Action::State action_state;
SummaryState st;
};
}

View File

@@ -18,37 +18,39 @@
*/
#include <iostream>
#include <utility>
#include <opm/output/eclipse/Inplace.hpp>
#include <opm/output/eclipse/EclipseIO.hpp>
#include <opm/output/eclipse/RestartValue.hpp>
#include <opm/output/eclipse/Summary.hpp>
#include <opm/output/data/Solution.hpp>
#include <opm/output/data/Wells.hpp>
#include <opm/output/data/Groups.hpp>
#include <opm/parser/eclipse/Python/Python.hpp>
#include <opm/input/eclipse/Python/Python.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Action/ActionContext.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Action/State.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQConfig.hpp>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
#include <opm/input/eclipse/Schedule/Action/ActionContext.hpp>
#include <opm/input/eclipse/Schedule/UDQ/UDQState.hpp>
#include <opm/input/eclipse/Schedule/UDQ/UDQConfig.hpp>
#include <opm/input/eclipse/Schedule/Well/WellTestState.hpp>
#include <opm/input/eclipse/Parser/Parser.hpp>
#include <opm/input/eclipse/Parser/ParseContext.hpp>
#include <opm/input/eclipse/Parser/ErrorGuard.hpp>
#include <opm/msim/msim.hpp>
namespace Opm {
msim::msim(const EclipseState& state_arg) :
state(state_arg)
msim::msim(const EclipseState& state_arg, const Schedule& schedule_arg)
: state(state_arg)
, schedule(schedule_arg)
, st(TimeService::from_time_t(this->schedule.getStartTime()))
{}
void msim::run(Schedule& schedule, EclipseIO& io, bool report_only) {
void msim::run(EclipseIO& io, bool report_only) {
const double week = 7 * 86400;
data::Solution sol;
SummaryState st(std::chrono::system_clock::from_time_t(schedule.getStartTime()));
UDQState udq_state(schedule.getUDQConfig(0).params().undefinedValue());
Action::State action_state;
UDQState udq_state(this->schedule.getUDQConfig(0).params().undefinedValue());
WellTestState wtest_state;
Python python;
io.writeInitial();
@@ -56,12 +58,13 @@ void msim::run(Schedule& schedule, EclipseIO& io, bool report_only) {
data::Wells well_data;
data::GroupAndNetworkValues group_nwrk_data;
if (report_only)
run_step(schedule, action_state, st, udq_state, sol, well_data, group_nwrk_data, report_step, io);
run_step(wtest_state, udq_state, sol, well_data, group_nwrk_data, report_step, io);
else {
double time_step = std::min(week, 0.5*schedule.stepLength(report_step - 1));
run_step(schedule, action_state, st, udq_state, sol, well_data, group_nwrk_data, report_step, time_step, io);
run_step(wtest_state, udq_state, sol, well_data, group_nwrk_data, report_step, time_step, io);
}
post_step(schedule, action_state, st, sol, well_data, group_nwrk_data, report_step);
auto sim_time = TimeService::from_time_t( schedule.simTime(report_step) );
post_step(sol, well_data, group_nwrk_data, report_step, sim_time);
const auto& exit_status = schedule.exitStatus();
if (exit_status.has_value())
return;
@@ -73,34 +76,33 @@ UDAValue msim::uda_val() {
}
void msim::post_step(Schedule& schedule, Action::State& action_state, SummaryState& st, data::Solution& /* sol */, data::Wells& /* well_data */, data::GroupAndNetworkValues& /* grp_nwrk_data */, size_t report_step) {
const auto& actions = schedule.actions(report_step);
void msim::post_step(data::Solution& /* sol */, data::Wells& /* well_data */, data::GroupAndNetworkValues& /* grp_nwrk_data */, size_t report_step, const time_point& sim_time) {
const auto& actions = this->schedule[report_step].actions.get();
if (actions.empty())
return;
Action::Context context( st , schedule.getWListManager(report_step));
Action::Context context( this->st , this->schedule[report_step].wlist_manager.get());
auto sim_time = schedule.simTime(report_step);
for (const auto& action : actions.pending(action_state, sim_time)) {
for (const auto& action : actions.pending(this->action_state, std::chrono::system_clock::to_time_t(sim_time))) {
auto result = action->eval(context);
if (result)
schedule.applyAction(report_step, *action, result);
this->schedule.applyAction(report_step, *action, result.wells(), {});
}
for (const auto& pyaction : actions.pending_python())
pyaction->run(this->state, schedule, report_step, st);
for (const auto& pyaction : actions.pending_python(this->action_state))
this->schedule.runPyAction(report_step, *pyaction, this->action_state, this->state, this->st);
}
void msim::run_step(const Schedule& schedule, Action::State& action_state, SummaryState& st, UDQState& udq_state, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& grp_nwrk_data, size_t report_step, EclipseIO& io) const {
this->run_step(schedule, action_state, st, udq_state, sol, well_data, grp_nwrk_data, report_step, schedule.stepLength(report_step - 1), io);
void msim::run_step(WellTestState& wtest_state, UDQState& udq_state, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& grp_nwrk_data, size_t report_step, EclipseIO& io) {
this->run_step(wtest_state, udq_state, sol, well_data, grp_nwrk_data, report_step, schedule.stepLength(report_step - 1), io);
}
void msim::run_step(const Schedule& schedule, Action::State& action_state, SummaryState& st, UDQState& udq_state, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& group_nwrk_data, size_t report_step, double dt, EclipseIO& io) const {
double start_time = schedule.seconds(report_step - 1);
double end_time = schedule.seconds(report_step);
void msim::run_step(WellTestState& wtest_state, UDQState& udq_state, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& group_nwrk_data, size_t report_step, double dt, EclipseIO& io) {
double start_time = this->schedule.seconds(report_step - 1);
double end_time = this->schedule.seconds(report_step);
double seconds_elapsed = start_time;
while (seconds_elapsed < end_time) {
@@ -108,23 +110,23 @@ void msim::run_step(const Schedule& schedule, Action::State& action_state, Summa
if ((seconds_elapsed + time_step) > end_time)
time_step = end_time - seconds_elapsed;
this->simulate(schedule, st, sol, well_data, group_nwrk_data, report_step, seconds_elapsed, time_step);
this->simulate(sol, well_data, group_nwrk_data, report_step, seconds_elapsed, time_step);
seconds_elapsed += time_step;
io.summary().eval(st,
io.summary().eval(this->st,
report_step,
seconds_elapsed,
this->state,
schedule,
well_data,
group_nwrk_data,
{},
{},
{},
{});
schedule.getUDQConfig( report_step ).eval(report_step, st, udq_state);
this->schedule.getUDQConfig( report_step ).eval(report_step, schedule.wellMatcher(report_step), this->st, udq_state);
this->output(action_state,
st,
this->output(wtest_state,
udq_state,
report_step,
(seconds_elapsed < end_time),
@@ -138,27 +140,28 @@ void msim::run_step(const Schedule& schedule, Action::State& action_state, Summa
void msim::output(Action::State& action_state, SummaryState& st, const UDQState& udq_state, size_t report_step, bool substep, double seconds_elapsed, const data::Solution& sol, const data::Wells& well_data, const data::GroupAndNetworkValues& group_nwrk_data, EclipseIO& io) const {
RestartValue value(sol, well_data, group_nwrk_data);
io.writeTimeStep(action_state,
st,
void msim::output(WellTestState& wtest_state, const UDQState& udq_state, size_t report_step, bool substep, double seconds_elapsed, const data::Solution& sol, const data::Wells& well_data, const data::GroupAndNetworkValues& group_nwrk_data, EclipseIO& io) {
RestartValue value(sol, well_data, group_nwrk_data, {});
io.writeTimeStep(this->action_state,
wtest_state,
this->st,
udq_state,
report_step,
substep,
seconds_elapsed,
value);
std::move(value));
}
void msim::simulate(const Schedule& schedule, const SummaryState& st, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& /* group_nwrk_data */, size_t report_step, double seconds_elapsed, double time_step) const {
void msim::simulate(data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& /* group_nwrk_data */, size_t report_step, double seconds_elapsed, double time_step) {
for (const auto& sol_pair : this->solutions) {
auto func = sol_pair.second;
func(this->state, schedule, sol, report_step, seconds_elapsed + time_step);
func(this->state, this->schedule, sol, report_step, seconds_elapsed + time_step);
}
for (const auto& well_pair : this->well_rates) {
const std::string& well_name = well_pair.first;
const auto& sched_well = schedule.getWell(well_name, report_step);
const auto& sched_well = this->schedule.getWell(well_name, report_step);
bool well_open = (sched_well.getStatus() == Well::Status::OPEN);
data::Well& well = well_data[well_name];
@@ -167,7 +170,7 @@ void msim::simulate(const Schedule& schedule, const SummaryState& st, data::Solu
auto func = rate_pair.second;
if (well_open)
well.rates.set(rate, func(this->state, schedule, st, sol, report_step, seconds_elapsed + time_step));
well.rates.set(rate, func(this->state, this->schedule, this->st, sol, report_step, seconds_elapsed + time_step));
else
well.rates.set(rate, 0.0);
}

View File

@@ -16,6 +16,10 @@ list(APPEND opm-common_DEPS
# various runtime library enhancements
"Boost 1.44.0 COMPONENTS system unit_test_framework REQUIRED"
"OpenMP QUIET"
"cjson"
# Still it produces compile errors complaining that it
# cannot format UDQVarType. Hence we use the same version
# as the embedded one.
"fmt 7.0.3"
)
find_package_deps(opm-common)

View File

@@ -53,7 +53,7 @@
do { \
std::ostringstream oss__; \
oss__ << "[" << __FILE__ << ":" << __LINE__ << "] " << message; \
Opm::OpmLog::error(oss__.str()); \
::Opm::OpmLog::error(oss__.str()); \
throw Exception(oss__.str()); \
} while (false)

View File

@@ -0,0 +1,47 @@
/*
Copyright 2020 Statoil ASA.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INFO_LOGGER_HPP
#define INFO_LOGGER_HPP
#include <cstddef>
#include <string>
namespace Opm {
/*
A small utility class to use in the situation where the first N messages
should go to OpmLog::info() and then the subsequent messages should go to
OpmLog::note()
*/
class InfoLogger {
public:
InfoLogger(const std::string& context_arg, std::size_t info_limit);
void operator()(const std::string& msg);
private:
std::string context;
std::size_t info_limit;
std::size_t info_count=0;
void (*log_function)(const std::string&);
};
}
#endif

View File

@@ -50,9 +50,8 @@ public:
lineno(lno)
{}
std::string message() const {
return this->keyword + " in " + this->filename + " at line " + std::to_string(this->lineno);
}
std::string format(const std::string& msg_fmt) const;
static KeywordLocation serializeObject()
{

View File

@@ -23,10 +23,10 @@
#include <cstdint>
#include <string>
#include <opm/common/OpmLog/KeywordLocation.hpp>
namespace Opm {
class KeywordLocation;
namespace Log {
namespace MessageType {
const int64_t Debug = 1; /* Excessive information */

View File

@@ -88,6 +88,8 @@ public:
}
static bool stdoutIsTerminal();
private:
static std::shared_ptr<Logger> getLogger();
static std::shared_ptr<Logger> m_logger;

View File

@@ -19,7 +19,7 @@
#ifndef ACTIVEGRIDCELLS_HPP
#define ACTIVEGRIDCELLS_HPP
#include <opm/parser/eclipse/EclipseState/Grid/GridDims.hpp>
#include <opm/input/eclipse/EclipseState/Grid/GridDims.hpp>
#include <array>

View File

@@ -19,28 +19,15 @@
#ifndef OPM_FILESYSTEM_HPP
#define OPM_FILESYSTEM_HPP
#if __cplusplus < 201703L || \
(defined(__GNUC__) && __GNUC__ < 8 && !defined(__clang__))
#include <experimental/filesystem>
#else
#include <filesystem>
#endif
#include <string>
namespace Opm
{
#if __cplusplus < 201703L || \
(defined(__GNUC__) && __GNUC__ < 8 && !defined(__clang__))
namespace filesystem = std::experimental::filesystem;
#else
namespace filesystem = std::filesystem;
#endif
// A poor man's filesystem::unique_path
std::string unique_path(const std::string& input);
} // end namespace Opm

View File

@@ -17,14 +17,14 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_SERIALIZER_HPP
#define OPM_SERIALIZER_HPP
#include <cstring>
#include <string>
#include <unordered_map>
#include <vector>
#ifndef OPM_SERIALIZER_HPP
#define OPM_SERIALIZER_HPP
namespace Opm {
/*
This is a very basic serialization class used to support serialization of
@@ -61,8 +61,26 @@ public:
return value;
}
template<typename T>
void put_vector(const std::vector<T>& values) {
this->put(values.size());
this->pack(values.data(), values.size() * sizeof(T));
}
template<typename T>
std::vector<T> get_vector() {
std::size_t size = this->get<std::size_t>();
std::vector<T> values(size);
for (std::size_t index=0; index < size; index++)
values[index] = this->get<T>();
return values;
}
template<typename K, typename T>
void put(const std::unordered_map<K,T>& values) {
void put_map(const std::unordered_map<K,T>& values) {
this->put(values.size());
for (const auto& value_pair : values) {
this->put(value_pair.first);
@@ -71,7 +89,7 @@ public:
}
template<typename K, typename T>
std::unordered_map<K,T> get() {
std::unordered_map<K,T> get_map() {
std::unordered_map<K,T> values;
auto size = this->get<std::size_t>();
for (std::size_t index = 0; index < size; index++) {

View File

@@ -3,6 +3,10 @@
#include <algorithm>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <optional>
#include <sstream>
#include <string>
#include <vector>
@@ -103,6 +107,25 @@ inline std::vector<std::string> split_string(const std::string& input,
return result;
}
inline std::string format_double(double d) {
double integral_part;
const double decimal_part = std::modf(d, &integral_part);
if (decimal_part == 0)
return std::to_string(static_cast<int>(d));
else
return std::to_string(d);
}
inline std::optional<double> try_parse_double(const std::string& token) {
char * end_ptr;
auto value = std::strtod(token.c_str(), &end_ptr);
if (std::strlen(end_ptr) == 0)
return value;
return std::nullopt;
}
}
#endif //OPM_UTILITY_STRING_HPP

View File

@@ -22,9 +22,32 @@
#include <chrono>
#include <ctime>
#include <string>
#include <unordered_map>
#include <opm/input/eclipse/Deck/DeckRecord.hpp>
namespace Opm {
using time_point = std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<int64_t, std::ratio<1,1000>>>;
namespace TimeService {
std::time_t to_time_t(const time_point& tp);
time_point from_time_t(std::time_t t);
time_point now();
std::time_t advance(const std::time_t tp, const double sec);
std::time_t makeUTCTime(std::tm timePoint);
const std::unordered_map<std::string , int>& eclipseMonthIndices();
const std::unordered_map<int, std::string>& eclipseMonthNames();
int eclipseMonth(const std::string& name);
bool valid_month(const std::string& month_name);
std::time_t mkdatetime(int in_year, int in_month, int in_day, int hour, int minute, int second);
std::time_t mkdate(int in_year, int in_month, int in_day);
std::time_t timeFromEclipse(const DeckRecord &dateRecord);
}
class TimeStampUTC
{
public:
@@ -99,6 +122,8 @@ namespace Opm {
TimeStampUTC operator+(const TimeStampUTC& lhs, std::chrono::duration<double> delta);
std::time_t asTimeT(const TimeStampUTC& tp);
std::time_t asLocalTimeT(const TimeStampUTC& tp);
time_point asTimePoint(const TimeStampUTC& tp);
} // namespace Opm

View File

@@ -22,7 +22,9 @@
#define OPM_ROOTFINDERS_HEADER
#include <opm/common/ErrorMacros.hpp>
#include <opm/common/OpmLog/OpmLog.hpp>
#include <string>
#include <algorithm>
#include <limits>
#include <cmath>
@@ -35,8 +37,11 @@ namespace Opm
{
static double handleBracketingFailure(const double x0, const double x1, const double f0, const double f1)
{
OPM_THROW(std::runtime_error, "Error in parameters, zero not bracketed: [a, b] = ["
<< x0 << ", " << x1 << "] f(a) = " << f0 << " f(b) = " << f1);
std::ostringstream sstr;
sstr << "Error in parameters, zero not bracketed: [a, b] = ["
<< x0 << ", " << x1 << "] f(a) = " << f0 << " f(b) = " << f1;
OpmLog::debug(sstr.str());
OPM_THROW_NOLOG(std::runtime_error, sstr.str());
return -1e100; // Never reached.
}
static double handleTooManyIterations(const double x0, const double x1, const int maxiter)

View File

@@ -5,7 +5,7 @@
// Created: Mon Jun 29 15:28:59 2009
//
// Author(s): Atgeirr F Rasmussen <atgeirr@sintef.no>
// B<EFBFBD>rd Skaflestad <bard.skaflestad@sintef.no>
// Bård Skaflestad <bard.skaflestad@sintef.no>
//
// $Date$
//

4
opm/common/utility/numeric/calculateCellVol.hpp Executable file → Normal file
View File

@@ -19,7 +19,11 @@
#include <array>
#include <math.h>
#ifndef CALCULATE_CELLVOL
#define CALCULATE_CELLVOL
double calculateCellVol(const std::array<double,8>& X, const std::array<double,8>& Y, const std::array<double,8>& Z);
double calculateCylindricalCellVol(const double R1, const double R2, const double dTheta, const double dZ);
#endif

View File

@@ -4,7 +4,7 @@
//
// Created: Tue Jun 2 16:00:21 2009
//
// Author(s): B<EFBFBD>rd Skaflestad <bard.skaflestad@sintef.no>
// Author(s): Bård Skaflestad <bard.skaflestad@sintef.no>
// Atgeirr F Rasmussen <atgeirr@sintef.no>
//
// $Date$

View File

@@ -4,7 +4,7 @@
//
// Created: Tue Jun 2 19:11:11 2009
//
// Author(s): B<EFBFBD>rd Skaflestad <bard.skaflestad@sintef.no>
// Author(s): Bård Skaflestad <bard.skaflestad@sintef.no>
// Atgeirr F Rasmussen <atgeirr@sintef.no>
//
// $Date$

View File

@@ -4,7 +4,7 @@
//
// Created: Tue Jun 2 19:06:46 2009
//
// Author(s): B<EFBFBD>rd Skaflestad <bard.skaflestad@sintef.no>
// Author(s): Bård Skaflestad <bard.skaflestad@sintef.no>
// Atgeirr F Rasmussen <atgeirr@sintef.no>
//
// $Date$
@@ -142,7 +142,7 @@ namespace Opm {
assignments.push_back(std::make_pair(name, value));
continue;
}
OpmLog::warning("Too many assignements (' "
OpmLog::warning("Too many assignments (' "
+ ID_delimiter_assignment
+ "') detected in argument " + to_string(i));
}

View File

@@ -4,7 +4,7 @@
//
// Created: Tue Jun 2 19:05:54 2009
//
// Author(s): B<EFBFBD>rd Skaflestad <bard.skaflestad@sintef.no>
// Author(s): Bård Skaflestad <bard.skaflestad@sintef.no>
// Atgeirr F Rasmussen <atgeirr@sintef.no>
//
// $Date$

View File

@@ -4,7 +4,7 @@
//
// Created: Tue Jun 2 19:05:02 2009
//
// Author(s): B<EFBFBD>rd Skaflestad <bard.skaflestad@sintef.no>
// Author(s): Bård Skaflestad <bard.skaflestad@sintef.no>
// Atgeirr F Rasmussen <atgeirr@sintef.no>
//
// $Date$

View File

@@ -4,7 +4,7 @@
//
// Created: Tue Jun 2 19:04:15 2009
//
// Author(s): B<EFBFBD>rd Skaflestad <bard.skaflestad@sintef.no>
// Author(s): Bård Skaflestad <bard.skaflestad@sintef.no>
// Atgeirr F Rasmussen <atgeirr@sintef.no>
//
// $Date$

View File

@@ -4,7 +4,7 @@
//
// Created: Tue Jun 2 19:02:19 2009
//
// Author(s): B<EFBFBD>rd Skaflestad <bard.skaflestad@sintef.no>
// Author(s): Bård Skaflestad <bard.skaflestad@sintef.no>
// Atgeirr F Rasmussen <atgeirr@sintef.no>
//
// $Date$

View File

@@ -0,0 +1,37 @@
/*
Copyright 2022 Equinor ASA.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_UTILITY_SHMATCH_HPP
#define OPM_UTILITY_SHMATCH_HPP
#include <string>
namespace Opm {
/*
The shmatch() function is an implementation of the shell matching algorithm
used in posix function fnmatch(). It is implemented here based on std::regex
to avoid using a posix function.
*/
bool shmatch(const std::string& pattern, const std::string& symbol);
}
#endif //OPM_UTILITY_STRING_HPP

View File

@@ -20,14 +20,18 @@
#ifndef DECK_HPP
#define DECK_HPP
#include <functional>
#include <map>
#include <memory>
#include <ostream>
#include <optional>
#include <vector>
#include <string>
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
#include <opm/input/eclipse/Deck/DeckView.hpp>
#include <opm/input/eclipse/Deck/DeckTree.hpp>
#include <opm/input/eclipse/Deck/DeckKeyword.hpp>
#include <opm/input/eclipse/Units/UnitSystem.hpp>
#ifdef OPM_PARSER_DECK_API_WARNING
#ifndef OPM_PARSER_DECK_API
@@ -54,79 +58,16 @@ namespace Opm {
*/
class DeckOutput;
class DeckView {
class Deck {
public:
typedef std::vector< DeckKeyword >::const_iterator const_iterator;
bool hasKeyword( const DeckKeyword& keyword ) const;
bool hasKeyword( const std::string& keyword ) const;
template< class Keyword >
bool hasKeyword() const {
return hasKeyword( Keyword::keywordName );
}
const DeckKeyword& getKeyword( const std::string& keyword, size_t index ) const;
const DeckKeyword& getKeyword( const std::string& keyword ) const;
const DeckKeyword& getKeyword( size_t index ) const;
DeckKeyword& getKeyword( size_t index );
template< class Keyword >
const DeckKeyword& getKeyword() const {
return getKeyword( Keyword::keywordName );
}
template< class Keyword >
const DeckKeyword& getKeyword( size_t index ) const {
return getKeyword( Keyword::keywordName, index );
}
template< class Keyword >
std::size_t count() const {
return count( Keyword::keywordName );
}
const std::vector< const DeckKeyword* > getKeywordList( const std::string& keyword ) const;
template< class Keyword >
const std::vector< const DeckKeyword* > getKeywordList() const {
return getKeywordList( Keyword::keywordName );
}
size_t count(const std::string& keyword) const;
size_t size() const;
const_iterator begin() const;
const_iterator end() const;
protected:
void add( const DeckKeyword*, const_iterator, const_iterator );
const std::vector< size_t >& offsets( const std::string& ) const;
DeckView( const_iterator first, const_iterator last );
explicit DeckView( std::pair< const_iterator, const_iterator > );
DeckView() = default;
void init( const_iterator, const_iterator );
private:
const_iterator first;
const_iterator last;
std::map< std::string, std::vector< size_t > > keywordMap;
};
class Deck : private DeckView {
public:
using DeckView::const_iterator;
using DeckView::hasKeyword;
using DeckView::getKeyword;
using DeckView::getKeywordList;
using DeckView::count;
using DeckView::size;
using DeckView::begin;
using DeckView::end;
using iterator = std::vector< DeckKeyword >::iterator;
using const_iterator = std::vector< DeckKeyword >::const_iterator;
Deck();
Deck() = default;
Deck( const Deck& );
Deck( Deck&& );
static Deck serializeObject();
@@ -136,8 +77,6 @@ namespace Opm {
void addKeyword( DeckKeyword&& keyword );
void addKeyword( const DeckKeyword& keyword );
DeckKeyword& getKeyword( size_t );
const UnitSystem& getDefaultUnitSystem() const;
const UnitSystem& getActiveUnitSystem() const;
UnitSystem& getActiveUnitSystem();
@@ -145,14 +84,34 @@ namespace Opm {
void selectActiveUnitSystem( UnitSystem::UnitType unit_type );
const std::string& getInputPath() const;
const std::string& getDataFile() const;
std::string getDataFile() const;
void setDataFile(const std::string& dataFile);
std::string makeDeckPath(const std::string& path) const;
DeckTree& tree();
DeckTree tree() const;
std::size_t size() const;
bool empty() const;
iterator begin();
iterator end();
void write( DeckOutput& output ) const ;
friend std::ostream& operator<<(std::ostream& os, const Deck& deck);
const_iterator begin() const;
const_iterator end() const;
Opm::DeckView operator[](const std::string& keyword) const;
const DeckKeyword& operator[](std::size_t index) const;
template< class Keyword >
Opm::DeckView get() const {
return this->operator[](Keyword::keywordName);
}
std::vector< const DeckKeyword* > getKeywordList( const std::string& keyword ) const;
template< class Keyword >
std::vector< const DeckKeyword* > getKeywordList() const {
return getKeywordList( Keyword::keywordName );
}
template<class Serializer>
void serializeOp(Serializer& serializer)
@@ -163,20 +122,42 @@ namespace Opm {
serializer(m_dataFile);
serializer(input_path);
serializer(unit_system_access_count);
if (!serializer.isSerializing())
this->init(this->keywordList.begin(), this->keywordList.end());
}
bool hasKeyword( const std::string& keyword ) const;
template< class Keyword >
bool hasKeyword() const {
return this->hasKeyword( Keyword::keywordName );
}
const std::vector<std::size_t> index(const std::string& keyword) const {
return this->global_view().index(keyword);
}
template< class Keyword >
std::size_t count() const {
return count( Keyword::keywordName );
}
size_t count(const std::string& keyword) const;
private:
Deck(std::vector<DeckKeyword>&& keywordList);
std::vector< DeckKeyword > keywordList;
UnitSystem defaultUnits;
std::unique_ptr<UnitSystem> activeUnits;
std::optional<UnitSystem> activeUnits;
std::string m_dataFile;
std::optional<std::string> m_dataFile;
std::string input_path;
DeckTree file_tree;
mutable std::size_t unit_system_access_count = 0;
const DeckView& global_view() const;
mutable std::unique_ptr<DeckView> m_global_view{nullptr};
};
}
#endif /* DECK_HPP */

View File

@@ -25,10 +25,10 @@
#include <memory>
#include <ostream>
#include <opm/parser/eclipse/Units/Dimension.hpp>
#include <opm/parser/eclipse/Utility/Typetools.hpp>
#include <opm/parser/eclipse/Deck/UDAValue.hpp>
#include <opm/parser/eclipse/Deck/value_status.hpp>
#include <opm/input/eclipse/Units/Dimension.hpp>
#include <opm/input/eclipse/Utility/Typetools.hpp>
#include <opm/input/eclipse/Deck/UDAValue.hpp>
#include <opm/input/eclipse/Deck/value_status.hpp>
namespace Opm {
@@ -77,6 +77,10 @@ namespace Opm {
const std::vector< double >& getSIDoubleData() const;
const std::vector<value::status>& getValueStatus() const;
template< typename T>
void shrink_to_fit();
void push_back( UDAValue );
void push_back( int );
void push_back( double );
@@ -86,15 +90,15 @@ namespace Opm {
void push_back( int, size_t );
void push_back( double, size_t );
void push_back( std::string, size_t );
void push_backDefault( UDAValue );
void push_backDefault( int );
void push_backDefault( double );
void push_backDefault( std::string );
void push_backDefault( RawString );
void push_backDefault( UDAValue, std::size_t n = 1 );
void push_backDefault( int, std::size_t n = 1 );
void push_backDefault( double, std::size_t n = 1 );
void push_backDefault( std::string, std::size_t n = 1 );
void push_backDefault( RawString, std::size_t n = 1 );
// trying to access the data of a "dummy default item" will raise an exception
template <typename T>
void push_backDummyDefault();
void push_backDummyDefault( std::size_t n = 1 );
type_tag getType() const;
@@ -109,7 +113,7 @@ namespace Opm {
account, i.e. two items will compare differently if one is
defaulted and the other has the default value explicitly
set. The default behaviour is cmp_default == false -
itrespective of whether they have been set explicitly or
irrespective of whether they have been set explicitly or
have been defaulted.
*/
bool equal(const DeckItem& other, bool cmp_default, bool cmp_numeric) const;
@@ -126,6 +130,7 @@ namespace Opm {
bool is_double() { return type == get_type< double >(); };
bool is_int() { return type == get_type< int >() ; };
bool is_string() { return type == get_type< std::string >(); };
bool is_raw_string() { return type == get_type< RawString >(); };
UDAValue& get_uda() { return uval[0]; };
@@ -135,6 +140,7 @@ namespace Opm {
serializer(dval);
serializer(ival);
serializer(sval);
serializer.vector(rsval);
serializer.vector(uval);
serializer(type);
serializer(item_name);
@@ -144,6 +150,7 @@ namespace Opm {
serializer.vector(default_dimensions);
}
void reserve_additionalRawString(std::size_t);
private:
mutable std::vector< double > dval;
std::vector< int > ival;
@@ -168,7 +175,7 @@ namespace Opm {
template< typename T > const std::vector< T >& value_ref() const;
template< typename T > void push( T );
template< typename T > void push( T, size_t );
template< typename T > void push_default( T );
template< typename T > void push_default( T, std::size_t n );
template< typename T > void write_vector(DeckOutput& writer, const std::vector<T>& data) const;
};
}

Some files were not shown because too many files have changed in this diff Show More