Compare commits

...

954 Commits

Author SHA1 Message Date
Atgeirr Flø Rasmussen
4a3326a7d8 Merge pull request #3221 from atgeirr/release/2022.10
Bump version for final release candidate
2022-11-15 08:16:10 +01:00
Atgeirr Flø Rasmussen
7f2bdb9d65 Bump version for final release candidate 2022-11-15 08:11:20 +01:00
Atgeirr Flø Rasmussen
8738f78a10 Merge pull request #3216 from atgeirr/release/2022.10
Bump version for release.
2022-11-08 08:48:56 +01:00
Atgeirr Flø Rasmussen
45f01eb2ab Bump version for release. 2022-11-07 18:03:31 +01:00
Atgeirr Flø Rasmussen
5babdb413c Merge pull request #3214 from atgeirr/backport-of-pr-3205
Make sure compilation is not tested.
2022-11-07 16:41:44 +01:00
Markus Blatt
ebc0f30b94 Make sure compilation is not tested.
This is broken for DUNE >= 2.8 and dune module that use  OPM.
2022-11-07 16:41:01 +01:00
Atgeirr Flø Rasmussen
5ae44d0d4c Merge pull request #3213 from atgeirr/backport-of-pr-3203
[bufix,cmake] Fixes simple find_package(opm-module) calls
2022-11-07 16:39:20 +01:00
Markus Blatt
aed0063b61 [bufix,cmake] Fixes simple find_package(opm-module) calls
When not using the OPM CMake build system magic a
find_package(opm-module) did fail in some settings as the
CMAKE_MODULE_PATH did not include the location of OpmPackge.cmake and
the likes.

This fixes this by issuing a find_package(opm-common) for modules that
are not opm-common.
2022-11-07 16:37:47 +01:00
Bård Skaflestad
ba067e4132 Merge pull request #3210 from akva2/backport_3195
Ensure At Least One Well List per Well
2022-11-03 09:49:38 +01:00
Bård Skaflestad
81c8021cdd Ensure At Least One Well List per Well
If the input model sets the maximum number of well lists per well
to zero (or negative), then treat this as if the limit is defaulted
and reset the value to the default (one).
2022-11-03 09:02:11 +01:00
Atgeirr Flø Rasmussen
325da26722 Merge pull request #3209 from atgeirr/backport-of-pr-3198
Backport of pr 3198
2022-11-01 23:33:12 +01:00
Markus Blatt
87b501f7b0 Fixed spelling eror in compareECL 2022-11-01 23:32:24 +01:00
Markus Blatt
1ab30d9182 Fix typos: spesific -> specific 2022-11-01 23:32:24 +01:00
Markus Blatt
330ef3c26a Updated manpages 2022-11-01 23:32:24 +01:00
Atgeirr Flø Rasmussen
0c1ae46f01 Merge pull request #3208 from atgeirr/backport-of-pr-3193
change order of directiona and type and support default ijk
2022-11-01 23:31:42 +01:00
Tor Harald Sandve
81160c55e9 change order of directiona and type and support default ijk 2022-11-01 23:30:38 +01:00
Atgeirr Flø Rasmussen
a52f8bf782 Merge pull request #3207 from atgeirr/backport-of-pr-3192
Update GASVISCT
2022-11-01 23:29:56 +01:00
OPMUSER
43eb1bac37 Update GASVISCT
Fix GASVISCT JSON definition, based on OILVISCT and WATVISCT
2022-11-01 23:28:11 +01:00
Atgeirr Flø Rasmussen
2f0e782dfd Merge pull request #3206 from atgeirr/backport-of-pr-3186
Use MPI_FOUND not MPI_Found.
2022-11-01 23:25:27 +01:00
Atgeirr Flø Rasmussen
5f77a71b8f Use MPI_FOUND not MPI_Found. 2022-11-01 23:22:12 +01:00
Atgeirr Flø Rasmussen
e281a1e661 Merge pull request #3182 from atgeirr/release/2022.10
Bump version for release.
2022-10-19 10:48:23 +02:00
Atgeirr Flø Rasmussen
d894ef99d3 Bump version for release. 2022-10-19 10:04:12 +02:00
Atgeirr Flø Rasmussen
cc81743dad Merge pull request #3181 from akva2/damaris_fixes
Damaris depends on MPI
2022-10-18 15:22:30 +02:00
Bård Skaflestad
a4995686f3 Merge pull request #3180 from akva2/from_intersection
added: FaceDir::FromIntersectionIndex
2022-10-18 13:30:29 +02:00
Arne Morten Kvarving
bd3aa76268 fixed: damaris depends on MPI 2022-10-18 13:08:34 +02:00
Arne Morten Kvarving
6c740656bb changed: do not output damaris info if damaris is not requested 2022-10-18 13:08:33 +02:00
Arne Morten Kvarving
69839e8766 added: FaceDir::FromIntersectionIndex
this translates from a dune intersection id to a FaceDir::DirEnum
2022-10-17 14:44:13 +02:00
Markus Blatt
f414cdd30e Merge pull request #3178 from bska/velocity-unit
Add Unit for Pipeflow Velocity
2022-10-17 12:11:16 +02:00
Markus Blatt
3f8f4d0362 Merge pull request #3177 from blattms/fix-mult-find-dune-fem
Fixes bug that hit only for multiple find calls.
2022-10-17 11:44:23 +02:00
Bård Skaflestad
cba282bd34 Add Unit for Pipeflow Velocity
Needed for summary and RFT file output of fluid flow velocity in
well segments.
2022-10-14 15:24:21 +02:00
Markus Blatt
2a2a9748a3 Prevent Zoltan vars from growing with multiple find_package. 2022-10-12 22:57:43 +02:00
Markus Blatt
20e3202067 Make sure HAVE_${MODULE} is always defined in all scopes.
1. Was a normal variable if no test program was compiled before.
  that meant HAVE_DUNE_FEM was not defined even if dune-fem was found.
2. The if-statement checking whether there is something to compile was
   wrong as this is macro and hence prog is not a variable. Resorted
   to comparison to empty string.
2022-10-12 22:56:00 +02:00
Atgeirr Flø Rasmussen
6c8120abe6 Merge pull request #3176 from akva2/damaris_cmake_script
add cmake script for damaris handling
2022-10-12 14:39:36 +02:00
Markus Blatt
499663f048 Merge pull request #3175 from blattms/fix-mssing-targets-for-multiple-cmake-runs
[cmake] Search for modules/packages each time a search is triggered.
2022-10-12 13:45:16 +02:00
Arne Morten Kvarving
64964c3afe add cmake script for damaris handling 2022-10-12 11:16:43 +02:00
Tor Harald Sandve
6c735230ba Merge pull request #3170 from osae/hysterKillough
Support for capillary pressure hysteresis.
2022-10-12 07:52:10 +02:00
Markus Blatt
3f8195a839 Merge pull request #3171 from bska/support-lowercase-compdat-direction
Support Lower Case COMPDAT Direction Strings
2022-10-11 21:23:05 +02:00
Markus Blatt
2b87eecd68 Search for modules/packages each time a search is triggered.
This is essential if find package modules define imported
targets (usual for modern Cmake). Without this rerunning Cmake another
time in a non-clean build directory will abort with errors if imported
targets are used. E.g. with
```

CMake Error at /home/mblatt/src/dune/opm-2.9/opm-common/cmake/Modules/OpmSatellites.cmake:320 (add_executable):
  Target "test_mpiutil" links to target "ParMETIS::ParMETIS" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?
Call Stack (most recent call first):
  CMakeLists.txt:308 (opm_add_test)

CMake Error at /home/mblatt/src/dune/opm-2.9/opm-common/cmake/Modules/OpmSatellites.cmake:320 (add_executable):
  Target "test_mpiutil" links to target "QuadMath::QuadMath" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?
Call Stack (most recent call first):
  CMakeLists.txt:308 (opm_add_test)
```

This will result in multiple searches, but this should be rather fast
due their previous results being cached.
2022-10-11 20:50:46 +02:00
Markus Blatt
991ea3cf0d Allow find_package calls for METIS/Quadmath if targets already exists 2022-10-11 20:46:38 +02:00
Ove Sævareid
c1d916f66e Neutral initialisation of flags. 2022-10-10 14:17:14 +02:00
Bård Skaflestad
67dbe5c9e7 Support Lower Case COMPDAT Direction Strings
Some models will use lower-case strings to input the direction of
penetration, e.g., 'x' or 'z'.  This commit extends our direction
parser to support such strings.
2022-10-09 18:30:46 +02:00
Markus Blatt
9f02b613e8 Merge pull request #3114 from bska/rst-read-vfpexp
Restore Explicit THP Control Options from Restart File
2022-10-07 09:19:01 +02:00
Ove Sævareid
121a062abe Support for capillary pressure hysteresis. 2022-10-05 14:13:36 +02:00
Bård Skaflestad
00eda12fa0 Restore Explicit THP Control Options from Restart File
In particular, this commit restores all WVFPEXP-related items from
the restart file's IWEL array.
2022-10-05 09:55:03 +02:00
Markus Blatt
0e341ef6e1 Merge pull request #3163 from bska/segment-node-xy
Add XY Coordinates to Segment's Node
2022-10-05 09:52:39 +02:00
Arne Morten Kvarving
8601805d62 Merge pull request #3165 from akva2/add_headers
added: add headers to library definition
2022-10-05 09:52:24 +02:00
Markus Blatt
d410f38e11 Merge pull request #3169 from akva2/fix_python_install_path
fixed: properly export opm-common_PYTHON_COMMON_DIR
2022-10-05 09:44:52 +02:00
Arne Morten Kvarving
57bc9a8f02 added: add headers to library definition
for better IDE integration
2022-10-05 09:18:31 +02:00
Arne Morten Kvarving
ca0246c548 fixed: properly export opm-common_PYTHON_COMMON_DIR
this needs to be different for the in-tree and installed
config files
2022-10-05 08:49:22 +02:00
Bård Skaflestad
4326b8c78e Add XY Coordinates to Segment's Node
These are not used in the simulation, but needed/useful for the SEG
option of the WRFTPLT keyword.
2022-10-04 17:42:38 +02:00
Bård Skaflestad
77676000f7 Merge pull request #3166 from akva2/rename_serialize_object
changed: rename serializeObject to serializationTestObject
2022-10-04 17:04:00 +02:00
Arne Morten Kvarving
fb0f3c451e changed: rename serializeObject to serializationTestObject
makes it more clear what these members are used for.
2022-10-04 14:10:30 +02:00
Bård Skaflestad
1010c81b3d Merge pull request #3162 from tskille/fix_rsm_compare_ecl
additional output from compareECL related to rsm files
2022-10-04 12:03:47 +02:00
Torbjørn Skille
cc6769c1a2 adding new file type RSM to compareECL
When using -t SMRY  the RSM file is not checked
When using -t RSM   the SMRY files is not checked

when running without -t option both RSM and SMRY files are checked together with restart, grid, init and rft file.
2022-10-04 08:51:36 +02:00
Torbjørn Skille
16af572080 additional output from compareECL related to rsm files 2022-10-03 19:16:41 +02:00
Bård Skaflestad
cea1dea368 Merge pull request #3091 from akva2/fix_uninitialized_access
fixed: avoid use of uninitialized SummaryNode::number_
2022-09-30 19:33:36 +02:00
Bård Skaflestad
51ecf87682 fixed: avoid use of uninitialized SummaryNode::number_
SummaryNode::number_ does not have a value for all
summary keywords.
2022-09-30 16:52:34 +02:00
Markus Blatt
a61747eb74 Merge pull request #3154 from tskille/fix_esmry_startd
Fix bug in ExtESmry
2022-09-28 19:57:15 +02:00
Bård Skaflestad
ec7145e817 Merge pull request #3160 from atgeirr/add-item-numbers-netbalan
Add item numbers for NETBALAN.
2022-09-28 18:52:59 +02:00
Atgeirr Flø Rasmussen
e10faa139c Add item numbers for NETBALAN. 2022-09-28 17:39:36 +02:00
Bård Skaflestad
99affa9043 Merge pull request #3110 from bska/rst-read-wgrupcon
Load WGRUPCON Information From Restart File
2022-09-28 15:18:36 +02:00
Bård Skaflestad
f54c3d7480 Load WGRUPCON Information From Restart File 2022-09-28 14:00:11 +02:00
Bård Skaflestad
6af6676d5f Remove Tests Which Only Passed by Accident
There is no reason to expect that, for instance, the dynamic
control mode in a restart file is equal to that of the input file.
2022-09-28 14:00:11 +02:00
Bård Skaflestad
eecb713e00 Pull Helper Functions Out of Opm Namespace
Mostly to more clearly distinguish these from proper library
functions.
2022-09-28 14:00:11 +02:00
Bård Skaflestad
6b05ee2210 Merge pull request #3094 from bska/add-smry-cat-compl
Add New Summary Node Category of Completion
2022-09-28 13:58:21 +02:00
Bård Skaflestad
03a94a7288 Add New Summary Node Category of Completion
This enables detecting the last remaining case that has a valid NUMS
entry despite nominally being a well-level keyword.
2022-09-27 18:16:47 +02:00
Bård Skaflestad
c5158a1c24 Merge pull request #3155 from bska/support-rft-seg-option
Internalise WRFTPLT Segment Option
2022-09-27 18:07:45 +02:00
Bård Skaflestad
1a3166d913 Simplify Erasure From PLT States
Suggested by: [at]blattms
2022-09-27 17:05:53 +02:00
Bård Skaflestad
328ee9b591 Internalise WRFTPLT Segment Option
In preparation of adding RFT file output support for segment data.
2022-09-27 17:05:23 +02:00
Torbjørn Skille
39c1a68f37 Fix bug in ExtESmry
Start date in ESMRY file (format) have 7 elements, last element is milliseconds.
2022-09-27 15:38:24 +02:00
Bård Skaflestad
26a566ef94 Merge pull request #3156 from kjetilly/kjetilly_reserved_keyword_fix
Remove use of reserved identifier in OPM_THROW.
2022-09-27 12:51:42 +02:00
Bård Skaflestad
39c91be4ee Merge pull request #3158 from bska/fix-facedir-switch
Handle All FaceDir Enumerators in Switch Statements
2022-09-27 10:18:42 +02:00
Bård Skaflestad
7a60c4c239 Handle All FaceDir Enumerators in Switch Statements
Forgotten in commit 9e143482c.
2022-09-26 13:19:25 +02:00
Kjetil Olsen Lye
c664a0dfd2 Remove use of reserved identifier in OPM_THROW. 2022-09-26 11:51:37 +02:00
Tor Harald Sandve
7e34f86f42 Merge pull request #3113 from hakonhagland/fieldprops
Add support for directional relative permeabilties
2022-09-26 09:09:52 +02:00
Bård Skaflestad
d609d942db Merge pull request #3152 from OPMUSER/VFPPROD
Update VFPProdTable.cpp
2022-09-23 10:59:33 +02:00
OPMUSER
c67bdf8aeb Update VFPProdTable.cpp
The error message for when VFPPROD tables had non-monotonic entries had the table number and the number of errors reversed. This PR fixes this output discrepancy.
2022-09-23 13:53:29 +08:00
Håkon Hægland
34ea7f3662 Add one more test 2022-09-21 15:47:41 +02:00
Bård Skaflestad
351a5d7292 Merge pull request #3150 from atgeirr/check-backend-exists
Check that backend exists before logging.
2022-09-21 12:02:39 +02:00
Atgeirr Flø Rasmussen
c042c22546 Check that backend exists before logging. 2022-09-21 10:30:47 +02:00
Håkon Hægland
5086d5d74e Add a CopyablePtr class
Adds a template class that wraps a std::unique_ptr and makes it
copyable. See pull #714 in opm-models for a use case.
2022-09-20 01:30:16 +02:00
Bård Skaflestad
1850e45ed5 Merge pull request #3103 from bska/rst-read-wecon
Add Restart Support for Known Well Level Economic Limits
2022-09-19 10:25:07 +02:00
Bård Skaflestad
939b943911 Add Restart Support for Known Well Level Economic Limits
Notably missing are

  - Maximum gas-liquid ratio
  - Maximum temperature
  - Minimum reservoir fluid flow rate
  - Follow-on well

We do not currently write those items to the restart file but will
extend the support as need arises.
2022-09-16 18:32:01 +02:00
Bård Skaflestad
b33d04ebf7 Extract RstState Object Creation to Factory Function
In preparation of adding unit tests for restarted economic limits at
the well level (WECON).
2022-09-16 18:32:01 +02:00
Bård Skaflestad
34ab8d73b0 Tidy Up Implementation of RstWell
In particular, make RstWell::segment() return 'reference-to-const'
instead of an object.  While here, also rewrap the licence blocks
and reorder two data members.  The latter is in preparation of
adding restart support for economic limits (WECON).
2022-09-16 18:32:01 +02:00
Bård Skaflestad
cff70712ca Merge pull request #3149 from akva2/serializer_import
Import serializer code from opm-simulators
2022-09-16 16:02:06 +02:00
Arne Morten Kvarving
d731cd3775 import serializer code from opm-simulators
add tests using a simple memcpy based packer
2022-09-16 15:34:58 +02:00
Bård Skaflestad
95e78f64ad Merge pull request #3148 from akva2/serializer_simplify
changed: only use operator() for the serializer
2022-09-16 13:08:31 +02:00
Håkon Hægland
9e143482cf Add a unknown value to the facedir enum
This is will be used by code in opm-models and opm-simulators to
identify a face direction that is not known or not important.
2022-09-14 23:40:49 +02:00
Håkon Hægland
63f5dbdb81 Add debugging output method to FaceDir 2022-09-14 15:34:33 +02:00
Håkon Hægland
14f9c41613 Add KRNUM to recognized field props 2022-09-14 15:34:33 +02:00
Bård Skaflestad
25daf13909 Merge pull request #3107 from plgbrts/equil
keyword RVWVD to specify vaporized water-gas ratio  vs depth tables
2022-09-14 14:28:45 +02:00
Arne Morten Kvarving
6576370c19 changed: only use operator() for the serializer 2022-09-14 10:33:56 +02:00
Paul Egberts
35cf4761df updated cmake file 2022-09-14 10:27:12 +02:00
Paul Egberts
f55bbefd18 addition of entry in EQUIL keyword for water-gas ratio initialization 2022-09-13 17:58:28 +02:00
Markus Blatt
ff3da8cc79 Merge pull request #3146 from akva2/janitoring
Some janitoring
2022-09-12 12:36:21 +02:00
Tor Harald Sandve
d10ed6c953 Merge pull request #3109 from totto82/tempAquifer
add support for temperature and analytical aquifers
2022-09-12 07:32:49 +02:00
Arne Morten Kvarving
6546b780f8 fixed: respect rule-of-three for EclipseGrid
no need to explicitly declare the cc
2022-09-09 08:06:09 +02:00
Arne Morten Kvarving
1f5b60d651 changed: give variable a name
clang cannot parse the nameless variant for some reason
2022-09-09 07:46:45 +02:00
Arne Morten Kvarving
43c66042da add virtual dtor in class with virtual members 2022-09-09 07:46:18 +02:00
Arne Morten Kvarving
8e2445b4cc fixed: build python bindings on systems without openmp 2022-09-09 07:39:11 +02:00
Bård Skaflestad
b936fe6c0b Merge pull request #3145 from bska/refactor-rft-output
Refactor RFT File Writing Code
2022-09-08 17:05:52 +02:00
Bård Skaflestad
964fdfde12 Refactor RFT File Writing Code
In preparation of supporting new data types (PLT and segment).
Introduce a wrapper class, WellRFTOutputData, which knows about all
supported data types and how to emit the RFT record header.  Defer
specialised data type handling to dedicated record types and, to
this end, rename the existing WellRFT class to RFTRecord.
2022-09-08 16:22:39 +02:00
Bård Skaflestad
b38da649e0 Refactor RFTConfig
Mostly in preparation of adding new data types (e.g., segment),
but also to leverage standard algorithms and to apply 'const' where
possible.
2022-09-08 16:22:39 +02:00
Bård Skaflestad
07b506fc1c Reduce Level of Nesting in WRFT* Keyword Handlers
Mostly by switching from

    if (something) {
        handle case
    }

into

    if (! something) {
        continue;
    }

    handle case

While here, also reduce the length of a couple of very long lines.
2022-09-08 16:22:39 +02:00
Bård Skaflestad
d91608eff3 Rewrap WellConnections Code
Mostly to split long lines and to apply 'const' where possible.
2022-09-08 16:22:39 +02:00
Bård Skaflestad
8395ffd904 Merge pull request #3112 from bska/limit-action-messages
Direct Verbose Action Messages to Debug File

Resolves OPM/opm-simulators#4042
2022-09-08 16:10:24 +02:00
Bård Skaflestad
6b94c5091a Direct Verbose Action Messages to Debug File
While useful for analysis in the case of failure, end users will
typically not care that we "rerun" portions of the SCHEDULE section
in response to triggering an action.  In the cases where we do need
those messages they will be available in the CASE.DBG file instead.
2022-09-08 11:44:27 +02:00
Markus Blatt
d21926a837 Merge pull request #3095 from bska/rst-read-netbalan
Add Restart Support for NETBALAN Keyword
2022-09-08 11:16:34 +02:00
Bård Skaflestad
418173bbcc Add Restart Support for NETBALAN Keyword
This commit loads NETBALAN parameters from the restart file and
forms Network::Balance objects from these parameters.
2022-09-07 13:04:54 +02:00
Bård Skaflestad
1670c217ee Rename NETBALAN Items in INTEHEAD
Mostly to make restart code slightly more self explanatory.
2022-09-07 13:04:54 +02:00
Bård Skaflestad
de13002f2f Prepare for Adding NETBALAN Restart Support
Mostly whitespace and sorting headers.
2022-09-07 13:04:54 +02:00
Bård Skaflestad
541fba174a Merge pull request #3144 from akva2/remove_dead_serialization
Remove dead serialization code
2022-09-07 12:54:35 +02:00
Arne Morten Kvarving
d42481b747 add serializeObject to TranCalculator 2022-09-07 10:31:47 +02:00
Arne Morten Kvarving
ada6853a61 changed: remove unused Serialization class 2022-09-07 10:31:47 +02:00
Arne Morten Kvarving
1573ffb8da SummaryState: remove unused serialization code 2022-09-07 10:31:47 +02:00
Arne Morten Kvarving
0b1280ceec FieldProps(Manager): remove unused serialization code 2022-09-07 10:24:01 +02:00
Arne Morten Kvarving
5eb496c79c PAvgCalculator: remove unused serialization code 2022-09-07 10:24:01 +02:00
Arne Morten Kvarving
08830154b6 UDQScalar/UDQSet: remove unused serialization code 2022-09-07 10:08:54 +02:00
Arne Morten Kvarving
7b903660a0 UDQState: remove unused serialization code 2022-09-07 10:08:54 +02:00
Markus Blatt
f018c2e0d9 Merge pull request #3143 from akva2/tran_serialize
added: support serialization for TranCalculator
2022-09-07 10:04:59 +02:00
Arne Morten Kvarving
0c4492500b added: support serialization for TranCalculator
and some accessors to enable downstream to use it
2022-09-07 09:38:27 +02:00
Bård Skaflestad
1a9713278c Merge pull request #3142 from akva2/drop_friends
drop unused friend declarations
2022-09-07 09:36:14 +02:00
Bård Skaflestad
8a67f6606c Merge pull request #3141 from akva2/summarystate_append
added: append function in SummaryState
2022-09-07 09:35:36 +02:00
Arne Morten Kvarving
9690397cc1 drop unused friend declarations 2022-09-07 08:19:22 +02:00
Arne Morten Kvarving
a2bade84a4 added: append function in SummaryState
this appends information from one instance to another.
needed to handle semantics used in parallel serialization
2022-09-07 08:17:48 +02:00
Bård Skaflestad
b1e3774aeb Merge pull request #3140 from akva2/summarystate_serialize
SummaryState: add serializer support
2022-09-06 11:33:05 +02:00
Bård Skaflestad
14c67cdbe6 Merge pull request #3139 from akva2/restartvalue_serialize
RestartValue: add serializer support
2022-09-06 10:41:36 +02:00
Arne Morten Kvarving
a8c0e19424 SummaryState: add serializer support 2022-09-06 10:03:55 +02:00
Arne Morten Kvarving
de7f5a8f69 RestartValue: add serializer support 2022-09-06 10:01:27 +02:00
Bård Skaflestad
e8b9e258b1 Merge pull request #3138 from akva2/aquiferdata_serialize
data::AquiferData: add serializer support
2022-09-06 09:55:29 +02:00
Bård Skaflestad
ae90a27ca1 Merge pull request #3134 from akva2/wells_serialize
data::Wells: add serializer support
2022-09-06 09:28:02 +02:00
Arne Morten Kvarving
64aee42bf1 data::AquiferData: add serializer support 2022-09-06 08:26:32 +02:00
Arne Morten Kvarving
c7329aa527 data::Wells: add serializer support 2022-09-06 08:23:40 +02:00
Bård Skaflestad
f6fa3e9fa5 Merge pull request #3137 from akva2/numericaquiferdata_serialize
data::NumericAquiferData: add serializer support
2022-09-05 16:26:37 +02:00
Bård Skaflestad
016b899ad6 Merge pull request #3136 from akva2/cartertracydata_serialize
data::CarterTracyData: add serializer support
2022-09-05 16:17:34 +02:00
Bård Skaflestad
9da5bbb463 Merge pull request #3135 from akva2/fetkovichdata_serialize
data::FetkovichData: add serializer support
2022-09-05 16:16:59 +02:00
Bård Skaflestad
8d6dbd9a7e Merge pull request #3133 from akva2/well_serialize
data::Well: add serializer support
2022-09-05 16:16:21 +02:00
Bård Skaflestad
6738269487 Merge pull request #3125 from akva2/groupandnetworkvalues_serialize
data::GroupAndNetworkValues: add serializer support
2022-09-05 16:15:49 +02:00
Arne Morten Kvarving
6112a6018b data::NumericAquiferData: add serializer support 2022-09-05 15:21:40 +02:00
Arne Morten Kvarving
1c967f6d70 data::CarterTracyData: add serializer support 2022-09-05 15:15:06 +02:00
Arne Morten Kvarving
1a9e6b3810 data::FetkovichData: add serializer support 2022-09-05 15:08:46 +02:00
Arne Morten Kvarving
bc6d5e38ce data::GroupAndNetworkValues: add serializer support 2022-09-05 14:12:16 +02:00
Bård Skaflestad
231b71a29c Merge pull request #3123 from akva2/groupdata_serialize
data::GroupData: add serializer support
2022-09-05 14:09:21 +02:00
Arne Morten Kvarving
645b3b3eaa data::Well: add serializer support 2022-09-05 13:57:18 +02:00
Arne Morten Kvarving
d68e254811 fixed: missing dynamicStatus in comparison operator 2022-09-05 13:57:18 +02:00
Bård Skaflestad
fbff174cd8 Merge pull request #3131 from akva2/segment_serialize
data::Segment: add serializer support
2022-09-05 13:19:00 +02:00
Arne Morten Kvarving
cb5475d178 data::GroupData: add serializer support 2022-09-05 13:02:47 +02:00
Bård Skaflestad
b05cba5315 Merge pull request #3122 from akva2/groupguiderates_serialize
data::GroupGuideRates: add serializer support
2022-09-05 13:01:15 +02:00
Arne Morten Kvarving
3d36bbcb9c data::Segment: add serializer support 2022-09-05 12:59:17 +02:00
Bård Skaflestad
a90b202b87 Merge pull request #3132 from akva2/currentcontrol_serialize
data::CurrentControl: add serializer support
2022-09-05 12:59:09 +02:00
Bård Skaflestad
0c1186346a Merge pull request #3129 from akva2/connection_serialize
data::Connection: add serializer support
2022-09-05 12:57:30 +02:00
Arne Morten Kvarving
f4af5fd947 data::Connection: add serializer support 2022-09-05 12:22:25 +02:00
Arne Morten Kvarving
ea8f64cb87 data::GroupGuideRates: add serializer support 2022-09-05 12:17:50 +02:00
Bård Skaflestad
524752da63 Merge pull request #3130 from akva2/segmentpressures_serialize
data::SegmentPressures: add serializer support
2022-09-05 12:15:07 +02:00
Bård Skaflestad
6ac5c8127d Merge pull request #3128 from akva2/rates_serialize
data::Rates: add serializer support
2022-09-05 12:14:33 +02:00
Bård Skaflestad
848942317e Merge pull request #3127 from akva2/solution_serialize
data::Solution: add serializer support
2022-09-05 12:14:05 +02:00
Bård Skaflestad
87a736ef84 Merge pull request #3121 from akva2/guideratevalue_serialize
data::GuideRateValue: add serializer support
2022-09-05 12:13:34 +02:00
Arne Morten Kvarving
88d3d86dd6 data::CurrentControl: add serializer support 2022-09-05 11:47:20 +02:00
Bård Skaflestad
4faa9634a0 Merge pull request #3126 from akva2/restartkey_serialize
RestartKey: add serializer support
2022-09-05 11:11:35 +02:00
Arne Morten Kvarving
efe759676b data::SegmentPressures: add serializer support 2022-09-05 11:09:25 +02:00
Bård Skaflestad
a7ecd2aaac Merge pull request #3124 from akva2/nodedata_serialize
data::NodeData: add serializer support
2022-09-05 11:06:57 +02:00
Arne Morten Kvarving
e3a961df2b data::Rates: add serializer support 2022-09-05 10:35:51 +02:00
Arne Morten Kvarving
3abfddd088 data::Solution: add serializer support 2022-09-05 10:27:08 +02:00
Arne Morten Kvarving
7670a0c248 RestartKey: add serializer support 2022-09-05 10:19:26 +02:00
Paul Egberts
feb695e1fd new keyword RVWVD to specify vaporized water-gas ratio RVW vs depth tables 2022-09-05 10:06:12 +02:00
Arne Morten Kvarving
c95cae5c63 data::NodeData: add serializer support 2022-09-05 09:57:58 +02:00
Arne Morten Kvarving
883e701a13 data::GuideRateValue: add serializer support 2022-09-05 09:15:20 +02:00
Bård Skaflestad
2a4f62844d Merge pull request #3120 from akva2/serialize_groupconstraints
data::GroupConstraints: add serializer support
2022-09-02 21:44:08 +02:00
Bård Skaflestad
7f50f7e95d Merge pull request #3118 from akva2/serialize_map_change
adjust for map serializer API change
2022-09-02 20:59:07 +02:00
Bård Skaflestad
3dcc3e35b9 Merge pull request #3117 from akva2/serialize_set_change
adjust for set serializer API change
2022-09-02 20:57:36 +02:00
Arne Morten Kvarving
d5830c0aa0 data::GroupConstraints: add serializer support 2022-09-02 18:12:09 +02:00
Bård Skaflestad
3c48148d8b Merge pull request #3119 from akva2/celldata_serialize
data::CellData: add serializer support
2022-09-02 17:24:36 +02:00
Arne Morten Kvarving
d09c275fe4 adjust for map serializer API change 2022-09-02 17:20:14 +02:00
Arne Morten Kvarving
99ea0ee497 adjust for set serializer API change 2022-09-02 17:17:11 +02:00
Bård Skaflestad
e9e70c6eac Merge pull request #3116 from akva2/serialize_vector_change
adjust for vector serializer API change
2022-09-02 17:08:14 +02:00
Bård Skaflestad
93dbf570d6 Merge pull request #3115 from akva2/serialize_array_change
adjust for array serializer API change
2022-09-02 17:07:29 +02:00
Arne Morten Kvarving
a21680cc96 data::CellData: add serializer support 2022-09-02 15:52:11 +02:00
Arne Morten Kvarving
0de1c488d2 adjust for vector serializer API change 2022-09-02 14:39:16 +02:00
Arne Morten Kvarving
fd3f444c80 adjust for array serializer API change 2022-09-02 14:18:15 +02:00
Bård Skaflestad
17c8b01d4b Merge pull request #3111 from akva2/fix_cell_serialize_object
fixed: initialize dimensions in serializeObject
2022-09-01 13:17:52 +02:00
Tor Harald Sandve
072b8be064 add support for temperature and analytical aquifers 2022-09-01 12:28:22 +02:00
Arne Morten Kvarving
a3a9413ab0 fixed: initialize dimensions in serializeObject
the array is left uninitialized by the constructor
2022-09-01 12:21:58 +02:00
Bård Skaflestad
1522ee4f4d Merge pull request #3035 from GitPaean/throw_wrong_time_stepping
throw when report steps has start time later than end time
2022-08-26 10:59:33 +02:00
Kai Bao
632f1457b1 throw for an inconsistent DATES setup 2022-08-26 10:07:21 +02:00
Markus Blatt
6479f77340 Merge pull request #3105 from bska/serialize-all-schedule-data
Serialize All Schedule Data Members
2022-08-25 14:54:35 +02:00
Kai Bao
3ffc61e221 throw when a negative TSTEP value is input 2022-08-25 14:38:00 +02:00
Bård Skaflestad
9658257960 Serialize Exit Status
While here, also add missing serialization tests for WGNames and
CompletedCells.
2022-08-25 11:22:59 +02:00
Bård Skaflestad
7ee1fd9ed1 Match Member Order in Schedule Serialization
In particular, in Schedule::seralizeOp(), Schedule::operator==(),
and Schedule::serializeObject().
2022-08-25 11:20:51 +02:00
Bård Skaflestad
da6802e787 Prefer Template Argument Deduction
Don't pass 'Serializer' as an explicit template argument.
2022-08-25 11:14:37 +02:00
Kai Bao
f1986689b5 fixing a schedule test and adding another for PR3035 2022-08-24 16:07:19 +02:00
Kai Bao
b9ed81fe2a throw when report steps has start time later than end time 2022-08-24 16:07:19 +02:00
Atgeirr Flø Rasmussen
ba120652b5 Merge pull request #3104 from atgeirr/fix-packing
Prepare for fixing packing of Rates, fix bug in Connection comparison operator
2022-08-24 15:23:44 +02:00
Atgeirr Flø Rasmussen
6c5e2541bc Do not test equality for unneeded objects.
They are not equal in any case, now that the comparison operator
for Connection is fixed.
2022-08-24 14:50:39 +02:00
Atgeirr Flø Rasmussen
2f7f360563 Bugfix: compare trans_factor in Connection::operator==(). 2022-08-24 14:50:39 +02:00
Atgeirr Flø Rasmussen
8754a59d38 Add friend declarations to enable writing out of class packing functions. 2022-08-24 14:50:39 +02:00
Bård Skaflestad
70d45e74dc Merge pull request #3102 from GitPaean/handling_connection_aquifer_mismatch
Handling connection aquifer mismatch
2022-08-24 09:52:22 +02:00
Kai Bao
61e68dccb6 fixing running when only analytical aquifer connections defined
without this, the restart writer will trigger a segmentation fault
error.

And also, some minor refactoring and function development so that the
simulator can check whether there are valid connections defined for
aquifers with certain id.
2022-08-24 09:31:20 +02:00
Atgeirr Flø Rasmussen
e4346da3ea Merge pull request #3101 from atgeirr/use-portable-timegm
Add and use portable_timegm().
2022-08-18 09:58:06 +02:00
Atgeirr Flø Rasmussen
49262ae96d Add and use portable_timegm().
This function converts a std::tm to a std::time_t, assuming UTC
and not local timezone. This is used instead of relying on
repeated calls to mktime(), which can fail on some system (BSD)
for dates before 1900.
2022-08-18 09:21:52 +02:00
Bård Skaflestad
cbab4e50c0 Merge pull request #3100 from tskille/smspec_bug
fixing bug in IO class ESmry
2022-08-17 17:48:40 +02:00
Torbjørn Skille
94150f1a0c fixing bug in IO class ESmry 2022-08-17 15:54:45 +02:00
Bård Skaflestad
ff13f8c091 Merge pull request #3099 from GitPaean/extend_default_aqutab
extend the range of default AQUTAB table (table 1)
2022-08-17 13:35:43 +02:00
Kai Bao
0dadf54a23 extend the range of default AQUTAB table (table 1)
for better accuracy of the extrapolation
2022-08-16 23:43:43 +02:00
Bård Skaflestad
17a08ddcd9 Merge pull request #3098 from atgeirr/modify-aquancon-inactive-cell-warnings
AQUANCON: Add a summarizing warning stating the number of inactive connection ignored
2022-08-16 18:18:09 +02:00
Atgeirr Flø Rasmussen
8e636f22a1 Add a summarizing warning stating the number of inactive connections ignored.
Also add tags to the Aquancon inactive connection warnings.
2022-08-16 15:39:17 +02:00
Bård Skaflestad
e5fdfb16df Merge pull request #3097 from bska/restore-build
Remove Consistency Checks for SPE10 Models
2022-08-16 14:37:57 +02:00
Bård Skaflestad
cc48ad4632 Remove Consistency Checks for SPE10 Models
The input decks were removed from the opm-tests repository.  We
*may* consider readding them from a new location at a later time.
2022-08-16 14:01:33 +02:00
Bård Skaflestad
dacd635c38 Merge pull request #3092 from atgeirr/fix-wpimult-actionx
Enable using WPIMULT in ACTIONX.
2022-08-12 17:56:20 +02:00
Bård Skaflestad
9660189290 Merge pull request #3096 from akva2/remove_empty_well_header
changed: remove (basically) empty Well(Injection|Production)Properties.hpp
2022-08-11 12:55:00 +02:00
Arne Morten Kvarving
5df933460b changed: remove (basically) empty Well(Injection|Production)Properties.hpp 2022-08-11 11:47:54 +02:00
Bård Skaflestad
e4129cf826 Merge pull request #3080 from totto82/add_unit_gas_oil_ratio_rate
add unit gas oil ratio rate for output of drsdt
2022-08-11 11:29:26 +02:00
Tor Harald Sandve
189a043c6d add unit gas oil ratio rate for output of drsdt 2022-08-10 15:42:50 +02:00
Atgeirr Flø Rasmussen
7e8a91b81f Enable using WPIMULT in ACTIONX. 2022-08-04 09:19:44 +02:00
Bård Skaflestad
eb7476e0cf Merge pull request #3089 from atgeirr/add-missing-include
Add <cstddef> include for std::size_t.
2022-08-01 00:05:10 +02:00
Atgeirr Flø Rasmussen
f96290e1df Add <cstddef> include for std::size_t. 2022-07-31 21:24:30 +02:00
Bård Skaflestad
9af8c785b2 Merge pull request #3085 from akva2/cleanup_schedule
Cleanup Schedule.hpp usage
2022-07-30 00:42:06 +02:00
Arne Morten Kvarving
e82ec7a274 clean up includes in Schedule.hpp 2022-07-29 18:37:57 +02:00
Markus Blatt
6561138236 Merge pull request #3067 from GitPaean/fixing_multiple_wpimult
fixing multiple WPIMULT records
2022-07-29 10:24:50 +02:00
Markus Blatt
26886bf4fa Merge pull request #3087 from akva2/small_buildsys_fixes
Small buildsystem fixes
2022-07-28 09:03:48 +02:00
Bård Skaflestad
9ec5680915 Merge pull request #3086 from akva2/remove_unused
remove unused file
2022-07-28 00:58:29 +02:00
Arne Morten Kvarving
0b0f9cab33 remove faulty brace 2022-07-27 18:08:52 +02:00
Arne Morten Kvarving
90f27b58cd fixed: use proper case in find_package_handle_standard_args 2022-07-27 18:08:52 +02:00
Arne Morten Kvarving
1012e15711 remove unused file 2022-07-27 17:51:17 +02:00
Arne Morten Kvarving
ec57a4d10b changed: remove include of Schedule.hpp in header
and deal with the consequences
2022-07-27 17:13:45 +02:00
Markus Blatt
92ebef3bc9 Merge pull request #3084 from akva2/cleanup_stream_includes
clean up stream includes
2022-07-27 17:08:28 +02:00
Markus Blatt
5532176af4 Merge pull request #3083 from akva2/cleanup_deck
changed: remove include of Deck.hpp in header
2022-07-27 17:06:26 +02:00
Markus Blatt
c5b0cd6f61 Merge pull request #3082 from akva2/clean_eclipsestate
changed: remove include of EclipseState.hpp in header
2022-07-27 17:03:17 +02:00
Arne Morten Kvarving
068bff1ebc clean up stream includes 2022-07-27 16:05:01 +02:00
Arne Morten Kvarving
5e7191c79e changed: remove include of Deck.hpp in header
and deal with the consequences
2022-07-26 18:42:39 +02:00
Arne Morten Kvarving
ef6d448077 changed: remove include of EclipseState.hpp in header
and deal with the consequences
2022-07-26 16:03:52 +02:00
Arne Morten Kvarving
10dcb8945f Merge pull request #3081 from Diullei/patch-1
Fix eclipse SOLWNUM json file
2022-07-25 08:33:08 +02:00
Diullei Gomes
cf0eb66009 Fix eclipse SOLWNUM json file property name 2022-07-24 11:11:29 +02:00
Bård Skaflestad
247547355c Merge pull request #3074 from OPMUSER/NNC
Update NNC
2022-07-14 14:13:12 +02:00
OPMUSER
1ea89ab140 Update NNC
Remove erroneous warning messages:

  NNC: invalid value '' in record 1 for item 12
  In file: RON-P50-A01-OPM.DATA, line 3387
  NNC(FACE1): not supported use 1* - will continue

For NNC(FACE1) and NNC(FACE2) by deleting the default "" value in the JSON file.

Client model had hundreds of these messages.
2022-07-14 18:20:39 +08:00
Bård Skaflestad
5cca4b0be0 Merge pull request #3071 from OPMUSER/MINPORV
Support MINPORV
2022-07-12 14:12:34 +02:00
OPMUSER
a8a1d140d5 Update EclipseGrid and JSON Definitions
Update EclipseGrid with checks for MINPVFIL. For JSON definitions: remove MINPVFIL check in MINPV and MINPORV, and all checks from MINPVFIL.
2022-07-12 11:07:10 +08:00
OPMUSER
4fe559ba3c Remove C++ Code and Place Conditions in JSON Files
Remove the C++ code checks and instead place the logic in the keyword JSON files. This is a cleaner approach.
Note we force that only one of the keywords is allowed in the deck to avoid confusion on what cut-off is actually being applied.
2022-07-11 15:02:10 +08:00
OPMUSER
a5cfafe4de Support MINPORV
Add support for MINPORV, which is an alias for MINPV. Also added additional checks, such that only one of MINPV, MINPORV and MINPVFIL can be active in the deck
2022-07-11 14:05:34 +08:00
Markus Blatt
bad915fdf5 Merge pull request #3069 from bska/decouple-box-from-grid
Decouple Opm::Box From EclipseGrid
2022-07-06 15:15:51 +02:00
Kai Bao
96ab0e036d addressing some reviewing comments for PR#3067 2022-07-06 14:32:59 +02:00
Bård Skaflestad
a79ee15082 Decouple Opm::Box From EclipseGrid
This commit switches to constructing Box instances from a GridDims
and two call-back functions instead of taking an EclipseGrid
directly.  The two call-back functions are a predicate for active
cells and a translation from Cartesian to active cell indices
respectively.

This is intended to simplify working with nested boxes, such as
those that occur for local grid refinement.
2022-07-05 14:27:49 +02:00
Markus Blatt
7dd56d2bde Merge pull request #3070 from bska/simplify-griddims-ijk
Streamline GridDims::getIJK()
2022-07-05 14:23:41 +02:00
Kai Bao
b87867d144 multple MPIMULT keywords within one report step is handled
and ScheduleTests is updated with tests
2022-07-05 10:52:25 +02:00
Bård Skaflestad
5377ff3442 Streamline GridDims::getIJK()
This commit switches the Cartesian -> IJK decomposition in GridDims
from K->J->I into the I->J->K order.  The latter is simpler.

While here, also consistently use 'std::size_t' instead of 'size_t'.
2022-07-04 15:06:07 +02:00
Bård Skaflestad
336f7a4159 Merge pull request #3064 from bska/refactor-numerical-aquifer-handling
Handle Active Cell/Numerical Aquifers In Constructor Body
2022-07-04 15:04:55 +02:00
Bård Skaflestad
c740b3705d Handle Active Cell/Numerical Aquifers In Constructor Body
The constructor did implicitly assume that no cell in a numerical
aquifer would be declared inactive in ACTNUM, and this restriction
still applies.  Moving numerical aquifer property and connection
processing into the constructor body enables using existing member
functions for non-neighbouring connections and removes a branch that
obscured the fact that we should have ACTNUM be as close to
finalised as possible before creating analytic aquifer connections.
2022-07-04 14:08:11 +02:00
Bård Skaflestad
c951d7ff6e Merge pull request #3068 from goncalvesmachadoc/temp
fix Bug Temp
2022-07-04 14:06:11 +02:00
goncalvesmachadoc
99702cdf49 fixBugTemp 2022-06-30 13:44:09 +02:00
Kai Bao
ffa12e5d09 adding a test for WPIMULT to test new functionality
from this PR.
2022-06-30 13:30:36 +02:00
Kai Bao
3f025070fe fixing interpreting multiple WPIMULT records
During a report step, if there are multple records for a well has
defaulted connection and completion information, only the last record
will apply to that well.

But the following record is considered not to have defaulted connection
and completion information.

WMPIMUL
  'WEL' 0.8 0 0 0 /
/
2022-06-29 10:54:20 +02:00
Bård Skaflestad
1516b63a39 Merge pull request #3065 from blattms/ordered-map-truncate-key
Use only first 8 characters as fault name when comparing/searching.
2022-06-28 10:22:35 +02:00
Arne Morten Kvarving
fdc0ea3436 Merge pull request #3066 from akva2/janitoring
Some janitoring
2022-06-27 15:27:29 +02:00
Arne Morten Kvarving
114753c459 changed: add initializer
harmless and suppresses compiler diagnostics
2022-06-27 14:44:30 +02:00
Arne Morten Kvarving
e2c99a28e7 changed: remove unused lambda captures 2022-06-27 14:44:30 +02:00
Markus Blatt
80545120b6 Merge pull request #3063 from bska/ensure-correct-initial-actnum
Apply Generalised ACTNUM Handling to All Grid Types
2022-06-27 11:32:48 +02:00
Markus Blatt
35029e0313 Only use first 8 characters as fault names when comparing/searching.
Note this is currently done silently as the warnings will probably
need to go to the validation code in opm-simulators.
2022-06-27 11:14:41 +02:00
Markus Blatt
19c58e33c4 Document at least what OrderedMap class is all about. 2022-06-27 11:14:22 +02:00
Markus Blatt
d4cd92ee40 Support ignoring additional characters in key of OrderedMap.
At least for faults we should only look at the first 8 characters.
2022-06-27 11:14:22 +02:00
Bård Skaflestad
013b279682 Apply Generalised ACTNUM Handling to All Grid Types
Commit eca858335 introduced a more comprehensive way of forming the
initial ACTNUM array used when constructing the EclipseGrid from a
corner-point description.  This commit applies that strategy to all
known grid types.  As an additional benefit this will also cover one
special case that was not handled and would effectively discard the
work done in the generalised initial ACTNUM construction.

Add unit tests to exercise the ACTNUM handling for other grid types.
2022-06-24 14:01:17 +02:00
Markus Blatt
f18ee95574 Merge pull request #3058 from bska/copy-defaulted-pvt-tables
Treat All-Defaulted PVTW Record as Copy of Previous
2022-06-24 13:54:14 +02:00
Bård Skaflestad
254b2e2862 Extract Common Base Class For Flat Tables With Record Copying
This commit introduces a new helper template class,

    FlatTableWithCopy<RecordType>

which wraps a vector<RecordType>, provides constructors from
DeckKeyword and initializer_list<RecordType> and handles copying
tables for all-defaulted records.

We reimplement the PVTW, DENSITY, and GRAVITY tables in terms of
this helper class to reduce duplication.  If the copy behaviour is
generally useful/needed we expect to replace the existing FlatTable
mechanism with the new helper.

Suggested by: Markus Blatt
2022-06-24 12:56:08 +02:00
Markus Blatt
b4eb8fbd4f OrderedMap: Remove template parameter for key type.
It is only used with std::string anyway.
2022-06-24 09:32:10 +02:00
Bård Skaflestad
d35abfddb6 Implement Defaulted Table Copy for DENSITY and GRAVITY
Use the same targeted strategy as for PVTW.
2022-06-23 16:04:50 +02:00
Bård Skaflestad
54ba23d71b Implement Defaulted Table Copy for PVTO and PVTG
The existing mechanism did not handle this case sufficiently well.
It is likely that we will have to polish this approach, but for now
use an explicit table copy to ensure that we have structurally
correct backing table data.
2022-06-23 16:04:50 +02:00
Bård Skaflestad
a066d2b95f Implement Defaulted Table Copy for PVDO and PVDG 2022-06-23 16:04:50 +02:00
Bård Skaflestad
433cc4d649 Treat All-Defaulted PVTW Record as Copy of Previous
A simulation model may choose to give PVTW data as

    PVTW
      1.0 1.0 1.0e-5 0.2 0.0 /
      /  -- record 2 (copied from record 1)

if, for instance, the oil and/or gas tables are different in regions
1 and 2, but the water is the same.  In this case we must properly
copy record 1 into record 2 and essentially recreate the table.

To this end, decouple the 'PvtwTable' from the 'FlatTable' machinery
and make the former into an independent type containing vector<>
instead of inheriting from vector<>.  Implement the default->copy
behaviour in the new PvtwTable::PvtwTable(const DeckKeyword&)
constructor.
2022-06-23 16:04:50 +02:00
Markus Blatt
00ace58e6c Merge pull request #3052 from bska/dont-assume-monotonic-wlist-position-on-restart
Don't Assume Increasing WLIST Position In Restart Files
2022-06-23 15:25:31 +02:00
Bård Skaflestad
042830e860 Don't Assume Increasing WLIST Position In Restart Files
The well list positions for individual wells (i.e,, IWLS) need not,
and typically are not, strictly increasing in the restart files.
Therefore we must only 'resize()' the well name vectors if the
'well_order' is strictly larger than the current size.  Otherwise,
we lose information about which wells are in which well lists.
2022-06-23 10:38:23 +02:00
Atgeirr Flø Rasmussen
5495266115 Merge pull request #3056 from bska/extract-single-record-construction-helper
Extract Helper for Single Table Record Construction
2022-06-23 09:59:20 +02:00
Bård Skaflestad
4d9387ee23 Extract Helper for Single Table Record Construction
Use case is table copy for PVTW.
2022-06-22 16:50:15 +02:00
Bård Skaflestad
531803eb0a Merge pull request #3061 from ElyesAhmed/alugrid
assert if Alugrid can be initialized from Deck: check format and geometry
2022-06-22 16:36:41 +02:00
Atgeirr Flø Rasmussen
c07357cdc3 Merge pull request #3060 from bska/xeff-smry
Add Well and Group Level Efficiency Factor Summary Vectors
2022-06-22 13:26:51 +02:00
Bård Skaflestad
0a287ca914 Add Well and Group Level Efficiency Factor Summary Vectors
This commit adds support for the GEFF, WEFF, and WEFFG summary
vectors that report the efficiency factors at the well (WEFAC) and
group (GEFAC) levels.  WEFFG additionally accounts for efficiency
factors in a well's superior groups in the group tree.
2022-06-22 11:52:58 +02:00
Bård Skaflestad
7b31522fdd Merge pull request #3062 from blattms/import-error-fault
Improves error messages on faults when additional chars are used.
2022-06-22 11:48:00 +02:00
Bård Skaflestad
41d0b21463 Merge pull request #3055 from blattms/improve-error-region-op-multz
Improve error message for region operations on multz
2022-06-22 11:47:27 +02:00
Markus Blatt
9e1aaca9e9 Improves error messages on faults when additional chars are used.
Faults are stored in an OrderedMap with the full string used during
construction even if that is longer than 8 characters. When later
these faults are e.g. modified whith MULTFLT using only the first 8
characters, the only message the user got was

```
An error occurred while creating the reservoir properties
Internal error: Key not found:

Unrecoverable errors while loading input: Key not found
```

With this patch we at least add some more context to the error
message:

```
Error:
An error occurred while creating the reservoir properties
Internal error: [/../EclipseState.cpp:362] Could not set fault transmissibility multiplier 5.23166e-10 for fault CFN2_05t: Key ABCD_05q not found. Similar entries are ABCD_05q_extended_width, UABCD_05q_extended_width.
```
2022-06-22 11:35:40 +02:00
Elyes Ahmed
04736dcbd0 removing methods for specific grid 2022-06-22 11:25:31 +02:00
Markus Blatt
6caebad329 Use OpmInputError instead of std::logic_error.
Message now becomes:
```
Error: Problem with keyword MULTIREG
In /path/to/file.inc line 3
region operation on 3D field MULTZ with global storage is not implemented!
```
2022-06-21 16:38:05 +02:00
Markus Blatt
a4576d253d Add operation name to error. 2022-06-21 15:42:08 +02:00
Markus Blatt
8611f664cb Improve error message for region operations on MULTZ.
MULTZ is the only keyword that is stored in global representation
(i.e. with values for inactive cells, too) to allow the "PINCH ALL"
processing. This produced errors like:

```
Error:
An error occurred while creating the reservoir properties
Internal error: Region operations on 3D fields with global storage is
not implemented
```

With this change the error message has more information for the user
and might help to work around it:

```
Error:
An error occurred while creating the reservoir properties
Internal error: In file /path/to/file.inc line 3: MULTIREG region operation on 3D field MULTZ with global storage is not implemented!
```
2022-06-21 15:42:08 +02:00
Elyes Ahmed
d0a1101bc8 assert if Alugrid can initialized from Deck: check format and geometry 2022-06-21 14:49:13 +02:00
Bård Skaflestad
4d76351111 Merge pull request #3049 from atgeirr/fix-actnum-equals-manipulation
Fix ACTNUM manipulation with EQUALS
2022-06-21 09:59:33 +02:00
Atgeirr Flø Rasmussen
a97df7c889 Use BOOST_CHECK_EQUAL_COLLECTIONS. 2022-06-21 09:32:31 +02:00
Bård Skaflestad
0d6dc717d3 Merge pull request #3059 from tskille/fix_esmry_load
Prevent data vector loading twice
2022-06-20 20:49:29 +02:00
Atgeirr Flø Rasmussen
02c06e9ae3 Add unit tests for new ACTNUM initialization features. 2022-06-20 17:57:25 +02:00
Atgeirr Flø Rasmussen
90d0b6479a Make new ACTNUM initialization unconditional, simplify. 2022-06-20 17:56:56 +02:00
Atgeirr Flø Rasmussen
0dab2aaf2b If no ACTNUM, default to all active in FieldProps. 2022-06-20 17:56:08 +02:00
Torbjørn Skille
f9bbf34b9a Prevent data vector loading twice
if same vector is defined twice in the vector list
2022-06-20 14:24:15 +02:00
Atgeirr Flø Rasmussen
e568d14a87 Future-proof checking for BOX-related keywords. 2022-06-17 13:02:42 +02:00
Atgeirr Flø Rasmussen
86fe7bbc3f Add moved header to public header list. 2022-06-17 13:02:42 +02:00
Atgeirr Flø Rasmussen
bc966fa32a Get actnum vector as it exists in FieldProps without modification. 2022-06-17 13:02:42 +02:00
Atgeirr Flø Rasmussen
eca8583358 Use new FieldProps constructor to get ACTNUM. 2022-06-17 13:02:42 +02:00
Atgeirr Flø Rasmussen
f5a2f6de74 Add new EclipseGrid contructor with no geometry or actnum info. 2022-06-17 13:02:42 +02:00
Atgeirr Flø Rasmussen
29954fd91f Add new constructor to only find correct ACTNUM. 2022-06-17 13:02:42 +02:00
Bård Skaflestad
194a599303 Merge pull request #3054 from hakonhagland/krnum
Fix typo in KRNUM json file
2022-06-17 12:52:04 +02:00
Håkon Hægland
7867bcb5fd Fix some more typos in keyword JSON files 2022-06-17 10:40:04 +02:00
Håkon Hægland
412a11d92f Fix typo in KRNUM json file 2022-06-16 23:36:23 +02:00
Tor Harald Sandve
fae7b5ccfc Merge pull request #2999 from totto82/rsrvinj
implement item 10 WCONINJE
2022-06-16 08:30:20 +02:00
Bård Skaflestad
dd528b74dd Merge pull request #3051 from Tongdongq/add-header-functional
Include header to compile with g++-8.4.0
2022-06-15 11:57:33 +02:00
Tong Dong Qiu
a058253ece Include header to compile with g++-8.4.0 2022-06-15 11:13:55 +02:00
Bård Skaflestad
d42d437e17 Merge pull request #3048 from goncalvesmachadoc/patch-6
Output FOE
2022-06-13 23:06:41 +02:00
Bård Skaflestad
f5b49a19fe Merge pull request #3047 from akva2/improve_error_logging_tableID
changed: pass table ID into SimpleTable constructors
2022-06-13 20:16:12 +02:00
Arne Morten Kvarving
0d1075daee changed: pass table ID into SimpleTable constructors
use this to improve logging in case of failure
2022-06-13 15:48:57 +02:00
Cintia Goncalves Machado
43dafbc995 Output FOE
Keyword is implemented, but missing in Summary.cpp. Small fix also to be pushed in opm-simulators.
2022-06-13 15:20:33 +02:00
Arne Morten Kvarving
e3f97e45d9 Merge pull request #3045 from akva2/improve_error_logging
Improve error logging
2022-06-13 15:11:02 +02:00
Arne Morten Kvarving
050540525f changed: log keyword location when parsing a table failed 2022-06-13 14:59:05 +02:00
Markus Blatt
4a51cfb707 Merge pull request #3046 from akva2/janitoring
changed: use modern include file path
2022-06-13 14:26:10 +02:00
Arne Morten Kvarving
3af1d464eb changed: avoid duplicating code 2022-06-13 13:30:33 +02:00
Arne Morten Kvarving
964f028413 changed: use modern include file path
to avoid deprecation warnings
2022-06-13 12:33:26 +02:00
Bård Skaflestad
d032078634 Merge pull request #3044 from tskille/erft_api_change
API change for I/O classes ERft and ERst
2022-06-10 16:07:09 +02:00
Markus Blatt
b3eddb7061 Merge pull request #3040 from hakonhagland/python_nsp2
Make the Python `opm` package a namespace package
2022-06-10 15:01:07 +02:00
Torbjørn Skille
e778960932 API change of class ERft and ERst
ERft - return false (not throw an exception) if function hasArray( .. ) is used with an
non-existing rftreport.

ERst - new memeber function hasArray ( .. )
2022-06-10 14:27:48 +02:00
Håkon Hægland
046736e45d Make Python opm package a namespace package
Convert the Python opm package from a regular package to a namespace
package such that opm-simulators can contribute to the package from a
different filesystem path. In this way, the two packages opm.simulators
and opm.io (for example) can have a different parent filesystem path.
2022-06-10 09:02:19 +02:00
Markus Blatt
02167f2c2f Merge pull request #3041 from blattms/always-search-superlu
Make sure USE_SUPERLU is defined when calling FindSuperLU.cmake
2022-06-09 16:13:41 +02:00
Markus Blatt
819a28a94d Make sure USE_SUPERLU is defined when calling FindSuperLU.cmake
Previously, touching CMakeLists.txt after a first compilation would
trigger compile errors as the two CMake runs were done with
inconsistent parameters (first one without USE_SUPERLU defined and
second one with -DUSE_SUPERLU=ON). Of course that meant that the
options would also differ from module to module, which seems like a
recipe for desaster.

This patch fixes this by moving the definition of the USE_SUPERLU
option to OpmInit.cmake which is included very early in the top most
CMakeLists.txt of each module.

Closes OPM/opm-simulators#3908
2022-06-09 12:26:56 +02:00
Markus Blatt
dbec8e4466 Merge pull request #3029 from plgbrts/new-jt-table
Joule-Thomson keywords for gas, oil and water phase
2022-06-07 13:17:06 +02:00
Markus Blatt
5a61625768 Merge pull request #3037 from hakonhagland/inst_pyt
WIP: Install the `install.py` script such that it can be reused by opm-simulators
2022-06-07 13:02:09 +02:00
Markus Blatt
3a5b17a070 Merge pull request #3039 from bska/rst-glo-compat
Increase Compatibility of GLO Restart Output
2022-06-07 11:53:31 +02:00
Bård Skaflestad
f6ca3ccaff Increase Compatibility of GLO Restart Output
We need to honour a "small rate threshold" when outputting the lift
gas max supply rate limit and total gas production limit.  This
threshold renders the output discontinuous, but is needed for
compatibility.
2022-06-06 21:18:47 +02:00
Bård Skaflestad
e6d8d59525 Merge pull request #3028 from tskille/esmry_updates
Esmry updates
2022-06-06 21:16:49 +02:00
Håkon Hægland
32c3d9bcb0 Add the python script directory to opm-project-config
Uses GNUInstallDIrs' CMAKE_INSTALL_DATAROOTDIR as top directory for
common python scripts. Also adds that location to
opm-project-config.cmake.in such that other opm modules can
easily lookup the common scripts
2022-06-03 09:03:34 +02:00
Torbjørn Skille
9a97d5c998 updated ExtESmry unit test
Loading summary vector from restart simulation with loadBaseRunData = true and selected summary vector not present in baserun.
Common use case where a new vector added in the restart run.
2022-06-02 19:46:37 +02:00
Torbjørn Skille
1433bc7a55 ExtESmry - support loading when number of time steps have increased (on disk)
The ESMRY file can be updated with more time step data in the time span between opening an ESMRY file
and loading actual summary data from the file. This can happen if the ESMRY is generated by an active
run. Length of summary vectors extracted will be equal to number of time steps on disk when the file was
first opened (with the constructor).
2022-06-02 19:44:20 +02:00
Torbjørn Skille
ab81083e02 Write temporary ESMRY file before renaming this to the actual file name
This increases the availability of the file for other processes. Duration for a
rename file operation is very short relative to writing a new file.
2022-06-02 14:10:17 +02:00
Torbjørn Skille
d34910c27d Minimum time interval between update of ESMRY file
The ESMRY file need a complete rewrite every time this is being updated.
This will makes the file more available for reading by other processes.
2022-06-02 14:10:14 +02:00
Atgeirr Flø Rasmussen
e1e0edba7d Merge pull request #3038 from bska/jfunc-require-endscale
Require ENDSCALE When JFUNC Entered
2022-06-01 08:54:28 +02:00
Bård Skaflestad
4333a69cd4 Require ENDSCALE When JFUNC Entered
We effectively ignore JFUNC data unless end-point scaling is
activated through the ENDSCALE keyword in the RUNSPEC section.
Alert the user to this fact by terminating the simulation run if the
case uses JFUNC without ENDSCALE present in RUNSPEC.  In this case,
issue a diagnostic message of the form

    Error: Unrecoverable errors while loading input: Problem with keyword JFUNC
    In CASE.DATA line 125
    Incompatible keyword combination: JFUNC declared, but ENDSCALE is missing.
2022-05-31 16:56:27 +02:00
Håkon Hægland
89b790d72f Install install.py
Install the install.py python script such that it can be used by
opm-simulators when building against an installed opm-common
2022-05-31 12:19:50 +02:00
Markus Blatt
d278880091 Merge pull request #3032 from bska/netbalan-rst-fixes
Increase Compatibility of NETBALAN Restart Output
2022-05-27 21:46:21 +02:00
Bård Skaflestad
8ff84920ed Increase Compatibility of NETBALAN Restart Output
The current Network::Balance class applies default values a little
too eagerly and this leads to problems for restarted simulation.  We
must take care to preserve the "did this item have a value" state
also in the restart file lest interactions with TUNING be lost
there.

To this end, make the minimum timestep size for network balancing be
an std::optional<> and use std::nullopt to represent "no value set"
in the input file.  While here, also preserve negative balancing
intervals exactly instead of replacing these values by zero.
2022-05-27 17:09:23 +02:00
Markus Blatt
378bd03eef Merge pull request #3033 from tskille/fix_esmry
ESmry and ExtESmry - Prevent loading data multiple times
2022-05-25 15:15:33 +02:00
Torbjørn Skille
607b8e7ebf ESmry and ExtESmry - Prevent loading data multiple times 2022-05-25 12:01:36 +02:00
Bård Skaflestad
4f181ec439 Merge pull request #3021 from bska/wecon-etc-restart-output
Identify Additional IWEL and SWEL Items
2022-05-25 10:54:35 +02:00
Bård Skaflestad
b4cebad6a9 Address Review Comments
In particular, add more unit testing and give names to a number of
index constants.

Thanks to [at]blattms for reviewing the initial version of this
patch.
2022-05-24 18:21:41 +02:00
Bård Skaflestad
188d7802a3 Temporarily Disable Higher-Level Water Injection Control
Instead, just declare that all non-FIELD groups are subject to
higher-level control of the water injection.

This hack is needed for compatibility on a real field case.  We must
revisit this at a later point.
2022-05-24 12:06:57 +02:00
Bård Skaflestad
adb84c15cc Emit Group Control Target of Zero if Explicitly Assigned
If a simulation model explicitly assigns a target or limit of 0.0,
then we must honour that value in the restart file.  Use a more
complete condition to detect whether or not group level targets or
limits are defaulted in GCONPROD and/or GCONINJE.
2022-05-24 12:06:57 +02:00
Bård Skaflestad
b36f415a96 Identify Additional IWEL and SWEL Items
In particular, add entries from WECON, WGRUPCON and, WVFPEXP and fix
an incorrect item attribution for the WTEST 'reason' parameter.

Thanks to [at]tskille for invaluable assistance in identify these
items.
2022-05-24 12:06:57 +02:00
Bård Skaflestad
67b7fe58b3 Don't Assert IWEL[24] == -1 Anymore
This setting is no longer magic.
2022-05-24 12:06:57 +02:00
Bård Skaflestad
6049b6e254 Expose First/Every Reporting
Needed for output to the restart file.
2022-05-24 12:06:57 +02:00
Bård Skaflestad
2aff28dd57 Merge pull request #3002 from bska/bxip-smry-values
Add Support for Block-Level Component-in-Place Summary Values
2022-05-24 12:04:23 +02:00
Bård Skaflestad
c5b9c8ea18 Add Support for Block-Level Component-in-Place Summary Values
This commit outputs the various BxIP* summary output values such as
BOIP (block-level oil-in-place) and BGIPL (block-level gas-in-place
in liquid phase).  While here, also add support for outputting the
block-level dissolved gas-oil-ratio (BRS) and vaporised
oil-gas-ratio (BRV).
2022-05-23 14:51:30 +02:00
Markus Blatt
82a5e7192e Merge pull request #3031 from hakonhagland/python_rates3
Adds a method get_injection_properties() to the Python interface to Opm::Schedule
2022-05-23 14:05:24 +02:00
Håkon Hægland
fa740678e0 Adds a method get_injection_properties()
Adds a method get_injection_properties() to the Python interface to
Opm::Schedule. This method can be used to get information about
Well::WellInjectionProperties for a given report step.

In order to avoid code duplication between opm-simulators and opm-common,
logic in CMakeLists.txt was refactored out into
cmake/Modules/PyInstallPrefix.cmake
2022-05-20 06:27:29 +02:00
Markus Blatt
acd90212d7 Merge pull request #3030 from blattms/bump-version-2022.10
Bump version to 2022.10-pre
2022-05-19 16:52:32 +02:00
Markus Blatt
a036273540 Bump version to 2022.10-pre 2022-05-19 16:46:35 +02:00
Markus Blatt
678114116f Merge pull request #3026 from bska/expose-raw-guiderate-phase
Provide Accessor for WGRUPCON's Raw Phase Value
2022-05-19 15:34:19 +02:00
Markus Blatt
180b7cb664 Merge pull request #3027 from bska/attribute-missing-kw-terminator
Attribute Missing Terminator to Keyword/File/Line
2022-05-19 15:32:44 +02:00
Paul Egberts
d11d7d6ca0 Joule-Thomson keywords for gas, oil and water 2022-05-18 16:16:57 +02:00
Bård Skaflestad
462457fb39 Attribute Missing Terminator to Keyword/File/Line
This will hopefully aid the user in resolving the underlying issue.
2022-05-10 22:01:21 +02:00
Bård Skaflestad
f7ea7674c0 Provide Accessor for WGRUPCON's Raw Phase Value
Needed for restart file compatibility.
2022-05-10 10:03:27 +02:00
Bård Skaflestad
c91bde8182 Merge pull request #3005 from bska/weltarg-uda
Save and Restore UDAs From WELTARG Keyword
2022-05-09 14:09:30 +02:00
Bård Skaflestad
0e2623d6dd List WCONPROD UDAs in Order of Increasing Enum Values
The entries for WRAT and GRAT were listed in reverse order.
2022-05-09 12:24:30 +02:00
Bård Skaflestad
b9e9112c6b Distinguish Well/Group Injection/Production UDA Controls
This avoids add-on logic at the call site to identify UDAs in
WELTARG keywords.

Suggested by: [at]atgeirr
2022-05-09 12:05:28 +02:00
Bård Skaflestad
b9eaa3a6aa Save and Restore UDAs From WELTARG Keyword
This commit hooks the WELTARG UDA support code up to the main path
for saving and reloading the IUAD/IUAP restart arrays.
2022-05-09 11:33:07 +02:00
Bård Skaflestad
f751c46f10 Count Active UDAs From WELTARG Keyword
This commit introduces a new overload of the updateUDQActive member
function of the WellInjectionProperties and WellProductionProperties
classes.  The new overload is specifically targeted at accounting
for any active UDAs in WELTARG records.  It is possible to have
"regular" UDAs introduced in WCONPROD/WCONINJE and also a separate
set of UDAs attributed to WELTARG at the same time so we need to be
able to distinguish the two cases.

Call the new overload from the WELTARG keyword handler.
2022-05-09 11:33:07 +02:00
Bård Skaflestad
14a6a5a4c3 Generate Units of Measurements for WELTARG UDAs
In preparation of loading such UDAs from the restart file.
2022-05-09 11:33:07 +02:00
Bård Skaflestad
25ede43bf7 Implement UDQ::*_control in Terms of UDQ::keyword
This replaces the cost of maintaining sets of switch/case statements
with some additional runtime cost of looking up the corresponding
keyword in a std::map<>, but these functions are not called in inner
loops so the extra cost is justified.
2022-05-09 11:33:07 +02:00
Bård Skaflestad
f4fde15e67 Support Recognizing UDAs in WELTARG Keyword
This commit extends the set of supported UDQ enumators to include
those of the WELTARG keyword.  This is in preparation of adding
restart file support for such cases.
2022-05-09 11:33:07 +02:00
Bård Skaflestad
f467ed7251 Identify More UDA Integer Values
In particular, identify UDA control codes for RESV, BHP, and THP in
WCONPROD as well as BHP and THP in WCONINJE.
2022-05-09 11:33:07 +02:00
Bård Skaflestad
d9ca1fe86f Increase Integer Literal Readability
Use C++14's digit separator character (single quote).
2022-05-09 11:33:07 +02:00
Atgeirr Flø Rasmussen
9a07a5d419 Merge pull request #3024 from atgeirr/use-invoke-result
Use std::invoke and friends instead of the deprecated std::result_of.
2022-05-09 11:31:11 +02:00
Atgeirr Flø Rasmussen
7e9e3e26eb Use std::invoke and friends instead of the deprecated std::result_of. 2022-05-09 10:26:29 +02:00
Markus Blatt
84ef4f6aa3 Merge pull request #3023 from blattms/skip-shared-libs
Do not hard-code shared-libs in package configuration if not needed.
2022-05-06 14:00:38 +02:00
Markus Blatt
cec7cffe7a 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 10:49:46 +02:00
Bård Skaflestad
9a51b6ec7c Merge pull request #3020 from hakonhagland/python_rates
Adds a `get_production_properties()` method to the Python interface to Opm::Schedule
2022-05-05 17:52:46 +02:00
Bård Skaflestad
d345098471 Merge pull request #3019 from blattms/better-actionx-udq-unsupported-message
Improve error message for unsupported categories for UDQ/ACTIONX
2022-05-05 17:23:03 +02:00
Håkon Hægland
d2c778739b Add trailing comma 2022-05-05 17:05:35 +02:00
Markus Blatt
68438e3f79 Improve error message for unsupported categories for UDQ/ACTIONX
We now print
"Keyword category 'Region' (e.g., summary keywords RPR) not supported
by ACTIONX."
instead of
"make_default_nodes does not yet support: RPR"
2022-05-05 15:43:44 +02:00
Håkon Hægland
d2cf59380e Use more compact std::map constructor 2022-05-05 13:58:04 +02:00
Håkon Hægland
dd19213998 Adds get_production_properties()
Adds get_production_properties() to the python interface to Schedule.
This method can be used to get information about
Well::WellProductionProperties for a given report step
2022-05-05 13:04:03 +02:00
Markus Blatt
267f642794 Merge pull request #3018 from totto82/fix_warning_satfunc
fix warning due to  missing else in satfuncs
2022-05-03 15:55:24 +02:00
Tor Harald Sandve
db929b509e fix warning due to missing else in satfuncs 2022-05-03 14:48:13 +02:00
Tor Harald Sandve
2b53a25ff6 Merge pull request #2917 from osae/LETkeywords
LET-based family-I saturation functions.
2022-05-03 13:37:47 +02:00
Bård Skaflestad
90a451c37d Merge pull request #3016 from goncalvesmachadoc/addBXPV
add Block Pore Volumes
2022-04-30 12:03:39 +02:00
Cintia Goncalves Machado
4f46615caa Delete unnecessary BXPV from required fields 2022-04-30 08:39:05 +02:00
goncalvesmachadoc
1d3cb8b2bb addBXPVs 2022-04-29 20:26:31 +02:00
Markus Blatt
5107d8c401 Merge pull request #3015 from blattms/install-python-bindings-by-default
Install python bindings as default.
2022-04-29 17:12:22 +02:00
Markus Blatt
51b73c1997 Install python bindings as default.
This is for consistency with opm-simulators, which (always)
installs them if they are built.

Closes #2976
2022-04-29 12:13:17 +02:00
Markus Blatt
aeb9ae8e1e Merge pull request #3012 from blattms/make-no-quadmath-just-a-warning
Make not finding Quadmath non-fatal (e.g. not available on arm64)
2022-04-29 11:20:35 +02:00
Markus Blatt
b8ab89591a 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 09:18:50 +02:00
Bård Skaflestad
612c156013 Merge pull request #2989 from plgbrts/vapoilwat
added vaporized_water rate type
2022-04-28 15:29:34 +02:00
Markus Blatt
ec7aadd511 Merge pull request #3007 from akva2/avoid_some_float_comps
fixed: avoid direct floating point comparisons in tests
2022-04-27 17:15:33 +02:00
Markus Blatt
410f2ecc34 Merge pull request #3008 from blattms/spelling-fix
Spelling fixes (valied -> valid).
2022-04-27 16:11:19 +02:00
Markus Blatt
7d66ff7c12 Spelling fixes (valied -> valid). 2022-04-27 14:08:53 +02:00
Bård Skaflestad
deffadd92e Merge pull request #3006 from lindjoha/complump_defaults
Added default values for I, J, K1 and K2 in COMPLUMP
2022-04-27 12:40:22 +02:00
Arne Morten Kvarving
4871f618bf fixed: avoid direct floating point comparisons in tests
we want to compare with an epsilon since these have gone
through calculations
2022-04-27 12:24:22 +02:00
Øyvind Lind-Johansen
dff5144d6a Added default values for I, J, K1 and K2 2022-04-27 10:23:29 +02:00
Tor Harald Sandve
2eb49a451c Merge pull request #3003 from bska/fix-update-uda-weltarg
Update THP Target in Case of THP Control
2022-04-26 08:41:58 +02:00
Bård Skaflestad
bf259a5444 Update THP Target in Case of THP Control
Updating the BHP target appears to have been a copy-paste error.
2022-04-25 12:55:46 +02:00
Tor Harald Sandve
3f34913fb0 implement item 10 WCONINJE 2022-04-21 14:58:44 +02:00
Markus Blatt
3349bac28f Merge pull request #2997 from blattms/update-manpages
Cleanup, update and improve man pages for 2022.04
2022-04-21 11:27:29 +02:00
Markus Blatt
635aafa6f8 Merge pull request #2998 from akva2/jenkins_abs_refs
added: ability to use jenkins build scripts for release test building
2022-04-21 11:19:50 +02:00
Arne Morten Kvarving
9f332b87a4 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 09:51:43 +02:00
Markus Blatt
5dc5cd10b6 Cleanup, update and improve man pages for 2022.04 2022-04-20 22:09:17 +02:00
Markus Blatt
ecde5ebc8c Merge pull request #2995 from blattms/use-dune-buildsystem-defaults
Use dune buildsystem defaults for MPI SuperLU, and Quadmath
2022-04-20 19:43:09 +02:00
Markus Blatt
85837a71a5 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 17:31:24 +02:00
Markus Blatt
2f726690e7 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 17:31:23 +02:00
Ove Sævareid
fff89abd6b Sample let-curves for table output to INIT file. 2022-04-20 17:07:13 +02:00
Ove Sævareid
740beea44a Relocate kw defs. 2022-04-20 17:07:13 +02:00
Ove Sævareid
7496599d41 LET-based family-I saturation functions. New keywords SWOFLET and SGOFLET. 2022-04-20 17:07:13 +02:00
Bård Skaflestad
a5d19c4cf0 Merge pull request #2990 from totto82/rename_ext
rename extrapolate to explicit_lookup in vfpexp
2022-04-20 09:54:25 +02:00
Tor Harald Sandve
09f80a3da1 rename extrapolate to explicit_loopup in vfpexp 2022-04-12 09:03:29 +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
Paul Egberts
7956c2d7da added vaporized_water rate type 2022-04-08 21:07:45 +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
Joakim Hove
35f35541ff Add testdata for WLIST restart testing 2021-10-14 11:41:40 +02:00
Arne Morten Kvarving
53cfb50d75 use -e when passing exename to test drivers 2021-10-13 11:27:47 +02:00
2006 changed files with 93522 additions and 12860 deletions

View File

@@ -9,7 +9,7 @@ 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_INSTALL_PYTHON "Install python bindings?" ON)
option(OPM_ENABLE_EMBEDDED_PYTHON "Enable embedded python?" OFF)
# Output implies input
@@ -32,13 +32,13 @@ set(OPM_PROJECT_EXTRA_CODE_INSTALLED "#ENABLE_ECL_INPUT is needed by opm-common
set(ENABLE_ECL_INPUT ${ENABLE_ECL_INPUT})
set(OPM_MACROS_ROOT ${CMAKE_INSTALL_PREFIX}/share/opm)
list(APPEND CMAKE_MODULE_PATH \${OPM_MACROS_ROOT}/cmake/Modules)
include(OpmPackage) #Make macros availabe after find_package(opm-common)")
include(OpmPackage) #Make macros available after find_package(opm-common)")
set(OPM_PROJECT_EXTRA_CODE_INTREE "#ENABLE_ECL_INPUT is needed by opm-common-prereq.cmake
set(ENABLE_ECL_INPUT ${ENABLE_ECL_INPUT})
set(OPM_MACROS_ROOT ${OPM_MACROS_ROOT})
list(APPEND CMAKE_MODULE_PATH \${OPM_MACROS_ROOT}/cmake/Modules)
include(OpmPackage) #Make macros availabe after find_package(opm-common)")
include(OpmPackage) #Make macros available after find_package(opm-common)")
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)
@@ -80,6 +80,13 @@ if(ENABLE_ECL_INPUT)
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)
@@ -129,12 +136,13 @@ macro (sources_hook)
list(INSERT opm-common_SOURCES 0 ${PROJECT_BINARY_DIR}/ParserInit.cpp)
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)
list(INSERT opm-common_HEADERS 0 ${PROJECT_BINARY_DIR}/include/opm/input/eclipse/Parser/ParserKeywords/${name}.hpp)
endforeach()
if (OPM_ENABLE_PYTHON)
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)
@@ -156,6 +164,14 @@ macro (install_hook)
PATTERN *.hpp)
endmacro (install_hook)
# Used to append entries from one list to another.
# The output list is suitable for use in setup.py subtitution
macro(append_quoted OUT IN)
foreach(ENTRY ${${IN}})
list(APPEND ${OUT} "'${ARGN}${ENTRY}'")
endforeach()
endmacro()
# If opm-common is configured to embed the python interpreter we must make sure
# that all downstream modules link libpython transitively. Due to the required
# integration with Python+cmake machinery provided by pybind11 this is done by
@@ -177,6 +193,8 @@ if (OPM_ENABLE_PYTHON)
endif()
set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
set(Python3_LIBRARIES ${PYTHON_LIBRARIES})
set(Python3_VERSION "${PYTHON_VERSION_STRING}")
set(Python3_VERSION_MINOR ${PYTHON_VERSION_MINOR})
else()
# Be backwards compatible.
if(PYTHON_EXECUTABLE AND NOT Python3_EXECUTABLE)
@@ -192,9 +210,32 @@ if (OPM_ENABLE_PYTHON)
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()
if(Python3_VERSION_MINOR LESS 3)
# Python native namespace packages requires python >= 3.3
message(SEND_ERROR "OPM requires python >= 3.3 but only version ${Python3_VERSION} was found")
endif()
# Compatibility settings for PythonInterp and PythonLibs
# used e.g. in FindCwrap, pybind11
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
# Directory to install common (for opm modules) python scripts
include (GNUInstallDirs)
set(OPM_PYTHON_COMMON_DIR "${CMAKE_INSTALL_DATAROOTDIR}/opm/python")
set(OPM_PROJECT_EXTRA_CODE_INTREE "${OPM_PROJECT_EXTRA_CODE_INTREE}
set(opm-common_PYTHON_COMMON_DIR ${PROJECT_SOURCE_DIR}/python)")
set(OPM_PROJECT_EXTRA_CODE_INSTALLED "${OPM_PROJECT_EXTRA_CODE_INSTALLED}
set(opm-common_PYTHON_COMMON_DIR ${CMAKE_INSTALL_PREFIX}/${OPM_PYTHON_COMMON_DIR})")
endif()
# We always need the PYTHON_INCLUDE_DIR. Unfortunately
# When we build pypi packages CMake will fail to determine
@@ -243,10 +284,6 @@ if (ENABLE_MOCKSIM)
endif()
endif()
if (ENABLE_SCHEDULE_DEBUG)
add_compile_definitions( SCHEDULE_DEBUG )
endif()
# Build the compare utilities
if(ENABLE_ECL_INPUT)
add_executable(compareECL
@@ -263,11 +300,15 @@ if(ENABLE_ECL_INPUT)
test_util/summary.cpp
)
add_executable(arraylist
test_util/arraylist.cpp
)
add_executable(rewriteEclFile
test_util/rewriteEclFile.cpp
)
foreach(target compareECL convertECL summary rewriteEclFile)
foreach(target compareECL convertECL summary rewriteEclFile arraylist)
target_link_libraries(${target} opmcommon)
install(TARGETS ${target} DESTINATION bin)
endforeach()
@@ -301,11 +342,6 @@ if(ENABLE_ECL_INPUT)
${PROJECT_BINARY_DIR}/tests
)
foreach(test test_EclIO test_EGrid test_ERft test_ERst test_ESmry test_EInit test_ExtESmry)
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 and documentation
@@ -320,25 +356,7 @@ install(FILES cmake/OPM-CMake.md
install(FILES etc/opm_bash_completion.sh.in DESTINATION share/opm/etc)
if (OPM_ENABLE_PYTHON)
# -------------------------------------------------------------------------
# 1: Wrap C++ functionality in Python
if (EXISTS "/etc/debian_version")
set(PYTHON_PACKAGE_PATH "dist-packages")
else()
set(PYTHON_PACKAGE_PATH "site-packages")
endif()
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")
include(PyInstallPrefix)
make_directory(${PROJECT_BINARY_DIR}/python)
get_target_property(_opmcommon_include_dirs opmcommon INCLUDE_DIRECTORIES)
list(APPEND _opmcommon_include_dirs ${_ecl_include_dirs})
@@ -361,7 +379,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)
@@ -375,24 +398,38 @@ if (OPM_ENABLE_PYTHON)
endif()
set(opm-common_PYTHON_PACKAGE_VERSION ${OPM_PYTHON_PACKAGE_VERSION_TAG})
set(SETUP_PY_FLAGS "'-std=c++17'")
# Generate versioned setup.py
if (pybind11_INCLUDE_DIRS)
string(REGEX REPLACE ";" "', '" _tmp "${pybind11_INCLUDE_DIRS}")
set(SETUP_PY_PYBIND_INCLUDE_DIR "'${_tmp}'")
append_quoted(SETUP_PY_INCLUDE_DIRS pybind11_INCLUDE_DIRS)
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}'")
append_quoted(SETUP_PY_FLAGS FMT_FLAGS "-D")
append_quoted(opm-common_PYTHON_LINKAGE SETUP_PY_FMT_LIBS)
else()
set(SETUP_PY_FMT_FLAGS "'-DFMT_HEADER_ONLY'")
list(APPEND SETUP_PY_FLAGS "'-DFMT_HEADER_ONLY'")
endif()
if(cjson_FOUND)
append_quoted(opm-common_PYTHON_LINKAGE cjson_LIBRARIES)
append_quoted(SETUP_PY_INCLUDE_DIRS cjson_INCLUDE_DIRS)
endif()
if(OpenMP_FOUND)
append_quoted(opm-common_PYTHON_LINKAGE OpenMP_CXX_LIBRARIES)
append_quoted(SETUP_PY_FLAGS OpenMP_CXX_FLAGS)
append_quoted(SETUP_PY_INCLUDE_DIRS OpenMP_CXX_INCLUDE_DIRS)
endif()
# Items need to be comma separated for setup.py generation
string(REPLACE ";" "," SETUP_PY_LINKAGE "${opm-common_PYTHON_LINKAGE}")
string(REPLACE ";" "," SETUP_PY_FLAGS "${SETUP_PY_FLAGS}")
string(REPLACE ";" "," SETUP_PY_INCLUDE_DIRS "${SETUP_PY_INCLUDE_DIRS}")
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 ${Python3_EXECUTABLE} target_name.py
@@ -430,6 +467,9 @@ if (OPM_ENABLE_PYTHON)
# setup-install.sh - and completely bypass cmake in the installation phase.
if (OPM_INSTALL_PYTHON)
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)")
## Need to install this Python script such that it can be used by opm-simulators when building against an installed
## opm-common
install( PROGRAMS "python/install.py" DESTINATION "${OPM_PYTHON_COMMON_DIR}" )
endif()
# Observe that if the opmcommon library has been built as a shared library the
@@ -475,11 +515,6 @@ if (OPM_ENABLE_PYTHON)
target_link_libraries(opmcommon PUBLIC ${PYTHON_LIBRARY})
add_definitions(-DEMBEDDED_PYTHON)
endif()
else()
if (OPM_ENABLE_EMBEDDED_PYTHON)
message(WARNING "Inconsistent settings OPM_ENABLE_PYTHON / OPM_ENABLE_EMBEDDED_PYTHON")
set(OPM_ENABLE_EMBEDDED_PYTHON OFF CACHE BOOL "Enable embedded python?" FORCE)
endif()
endif()
install(DIRECTORY docs/man1 DESTINATION ${CMAKE_INSTALL_MANDIR}

File diff suppressed because it is too large Load Diff

View File

@@ -13,17 +13,17 @@ if (EXISTS ${BASE_DIR}/python/cxx)
endif()
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
${BASE_DIR}/tmp_gen/include/opm/parser/eclipse/Parser/ParserKeywords/Builtin.hpp
${BASE_DIR}/include/opm/parser/eclipse/Parser/ParserKeywords/Builtin.hpp)
${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/parser/eclipse/Parser/ParserKeywords/*.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

@@ -59,21 +59,20 @@ foreach (test BoxTest
list(APPEND EXTRA_TESTS ${test})
endforeach ()
opm_add_test( rst_spe1
SOURCES tests/rst_test.cpp
LIBRARIES ${TEST_LIBS}
TEST_ARGS tests/SPE1CASE2.DATA tests/SPE1CASE2_RESTART.DATA )
opm_add_test( rst_msw
SOURCES tests/rst_test.cpp
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
@@ -94,10 +93,7 @@ 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
${OPM_TESTS_ROOT}/msw_2d_h/2D_H__.DATA
${OPM_TESTS_ROOT}/model2/0_BASE_MODEL2.DATA
${OPM_TESTS_ROOT}/model2/1_MULTREGT_MODEL2.DATA
@@ -120,7 +116,7 @@ if(HAVE_OPM_TESTS)
PROPERTY ENVIRONMENT "OPM_ERRORS_IGNORE=PARSE_RANDOM_SLASH")
add_test( NAME rst_deck_test_norne
COMMAND ${PROJECT_SOURCE_DIR}/tests/rst_test_driver.sh ${CMAKE_BINARY_DIR}/bin/rst_deck ${CMAKE_BINARY_DIR}/bin/opmhash
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

View File

@@ -1,27 +1,30 @@
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/DeckTree.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/Schedule/UDQ/UDQEnums.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
@@ -36,9 +39,9 @@ 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
@@ -46,70 +49,23 @@ 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/parser/eclipse/Parser/ParserKeywords
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
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/D.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/E.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/F.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/G.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/H.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/I.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/J.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/K.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/L.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/M.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/N.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/O.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/P.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/Q.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/R.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/S.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/T.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/U.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/V.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/W.cpp
${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/ParserInit.cpp
${PROJECT_BINARY_DIR}/tmp_gen/TestKeywords.cpp)
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(APPEND _tmp_output ${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/${name}.cpp
${PROJECT_BINARY_DIR}/tmp_gen/include/opm/input/eclipse/Parser/ParserKeywords/${name}.hpp)
list(APPEND _target_output ${PROJECT_BINARY_DIR}/ParserKeywords/${name}.cpp
${PROJECT_BINARY_DIR}/include/opm/input/eclipse/Parser/ParserKeywords/${name}.hpp)
endforeach()
foreach(name TestKeywords.cpp ParserInit.cpp)
list(APPEND _target_output ${PROJECT_BINARY_DIR}/${name})
list(APPEND _tmp_output ${PROJECT_BINARY_DIR}/tmp_gen/${name})
endforeach()
set( _target_output
${PROJECT_BINARY_DIR}/ParserKeywords/A.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/B.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/C.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/D.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/E.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/F.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/G.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/H.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/I.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/J.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/K.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/L.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/M.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/N.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/O.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/P.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/Q.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/R.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/S.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/T.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/U.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/V.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/W.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/X.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/Y.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/Z.cpp
${PROJECT_BINARY_DIR}/TestKeywords.cpp
${PROJECT_BINARY_DIR}/ParserInit.cpp)
list(APPEND _target_output ${PROJECT_BINARY_DIR}/include/opm/input/eclipse/Parser/ParserKeywords/Builtin.hpp)
list(APPEND _tmp_output ${PROJECT_BINARY_DIR}/tmp_gen/include/opm/input/eclipse/Parser/ParserKeywords/Builtin.hpp)
if (OPM_ENABLE_PYTHON)
list(APPEND genkw_argv ${PROJECT_BINARY_DIR}/tmp_gen/builtin_pybind11.cpp)
@@ -117,15 +73,13 @@ if (OPM_ENABLE_PYTHON)
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/parser/eclipse/share/keywords/keyword_list.cmake)
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
DEPENDS ${_tmp_output}
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

@@ -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

@@ -55,11 +55,13 @@ if (METIS_INCLUDE_DIRS OR METIS_LIBRARIES)
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})
if (NOT TARGET METIS::METIS)
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()
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

@@ -102,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,18 @@ int main(void){
if (QUADMATH_FOUND)
set(QUADMATH_LIBRARIES "quadmath")
set(HAVE_QUAD "${QUADMATH_FOUND}")
if (NOT TARGET QuadMath::QuadMath)
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()
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

@@ -3,13 +3,10 @@
# This module defines:
# VALGRIND_INCLUDE_DIR, where to find valgrind/memcheck.h, etc.
# VALGRIND_PROGRAM, the valgrind executable.
# VALGRIND_FOUND, If false, do not try to use valgrind.
# Valgrind_FOUND, If false, do not try to use valgrind.
#
# If you have valgrind installed in a non-standard place, you can define
# VALGRIND_ROOT to tell cmake where it is.
if (VALGRIND_FOUND)
return()
endif()
find_path(VALGRIND_INCLUDE_DIR valgrind/memcheck.h
/usr/include /usr/local/include ${VALGRIND_ROOT}/include)
@@ -18,7 +15,7 @@ find_path(VALGRIND_INCLUDE_DIR valgrind/memcheck.h
# path, but this does not hurt...
find_program(VALGRIND_PROGRAM NAMES valgrind PATH ${VALGRIND_ROOT}/bin)
find_package_handle_standard_args(VALGRIND DEFAULT_MSG
find_package_handle_standard_args(Valgrind DEFAULT_MSG
VALGRIND_INCLUDE_DIR
VALGRIND_PROGRAM)

View File

@@ -24,7 +24,7 @@ find_package(PTScotch)
#find_package(ParMETIS)
# search for files which implements this module
find_path (ZOLTAN_INCLUDE_DIRS
find_path (ZOLTAN_INCLUDE_DIR
NAMES "zoltan.h"
PATHS ${ZOLTAN_SEARCH_PATH}
PATH_SUFFIXES include trilinos
@@ -35,7 +35,7 @@ if (CMAKE_SIZEOF_VOID_P)
math (EXPR _BITS "8 * ${CMAKE_SIZEOF_VOID_P}")
endif (CMAKE_SIZEOF_VOID_P)
find_library(ZOLTAN_LIBRARIES
find_library(ZOLTAN_LIBRARY
NAMES zoltan trilinos_zoltan
PATHS ${ZOLTAN_SEARCH_PATH}
PATH_SUFFIXES "lib/.libs" "lib" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
@@ -50,15 +50,20 @@ include (FindPackageHandleStandardArgs)
find_package_handle_standard_args(ZOLTAN
DEFAULT_MSG
ZOLTAN_LIBRARIES
ZOLTAN_INCLUDE_DIRS
ZOLTAN_LIBRARY
ZOLTAN_INCLUDE_DIR
MPI_FOUND
)
if (ZOLTAN_FOUND)
set(HAVE_ZOLTAN 1)
set(ZOLTAN_LIBRARIES ${ZOLTAN_LIBRARIES} ${PARMETIS_LIBRARIES} ${PTSCOTCH_LIBRARIES})
set(ZOLTAN_INCLUDE_DIRS ${ZOLTAN_INCLUDE_DIRS} ${PARMETIS_INCLUDE_DIRS}
set(ZOLTAN_LIBRARIES ${ZOLTAN_LIBRARY} ${PARMETIS_LIBRARIES} ${PTSCOTCH_LIBRARIES})
set(ZOLTAN_INCLUDE_DIRS ${ZOLTAN_INCLUDE_DIR} ${PARMETIS_INCLUDE_DIRS}
${PTSCOTCH_INCLUDE_DIRS})
# log result
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determing location of ZOLTAN succeeded:\n"
" Include directory: ${ZOLTAN_INCLUDE_DIRS}\n"
" Library directory: ${ZOLTAN_LIBRARIES}\n\n")
endif()

View File

@@ -36,8 +36,8 @@ find_library (CJSON_LIBRARY
${_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)
@@ -72,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"

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

@@ -38,7 +38,7 @@ macro (opm_compile opm)
endif()
set (${opm}_VERSION "${${opm}_VERSION_MAJOR}.${${opm}_VERSION_MINOR}")
if (${opm}_SOURCES)
add_library (${${opm}_TARGET} ${${opm}_LIBRARY_TYPE} ${${opm}_SOURCES})
add_library (${${opm}_TARGET} ${${opm}_LIBRARY_TYPE} ${${opm}_SOURCES} ${${opm}_HEADERS})
set_target_properties (${${opm}_TARGET} PROPERTIES
SOVERSION ${${opm}_VERSION}
VERSION ${${opm}_VERSION}

View File

@@ -128,35 +128,41 @@ macro (find_and_append_package_to prefix name)
# We even need to repeat the search for opm-common once as this is done
# in the top most CMakeLists.txt without querying defines, setting dependencies
# 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})
if(NOT _is_opm)
# 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})
string(REGEX MATCH "(opm)-.*" _is_opm ${name})
if(NOT _is_opm)
# 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()
if(${name}_DIR)
find_package (${name} ${${prefix}_VERSION_MAJOR}.${${prefix}_VERSION_MINOR} ${ARGN} NO_MODULE PATHS ${${name}_DIR} NO_DEFAULT_PATH)
else()
find_package (${name} ${${prefix}_VERSION_MAJOR}.${${prefix}_VERSION_MINOR} ${ARGN} NO_MODULE)
endif()
include(FindPackageHandleStandardArgs)
if(${name}_FOUND AND ${name}_LIBRARY STREQUAL "")
find_package_handle_standard_args(${name}
REQUIRED_VARS ${name}_INCLUDE_DIRS)
else()
find_package_handle_standard_args(${name}
REQUIRED_VARS ${name}_LIBRARY)
endif()
endif ()
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)
else()
find_package (${name} ${${prefix}_VERSION_MAJOR}.${${prefix}_VERSION_MINOR} ${ARGN} NO_MODULE)
endif()
include(FindPackageHandleStandardArgs)
if( CMAKE_VERSION VERSION_GREATER_EQUAL "3.17")
# For some reason we will e.g. call
# find_package_handle_standard_args(opm-common)
# in a find_package(opm-material) call and this will
# usuallly print an annoying warnig. Prevent this at least
# for cmake >=3.17
# \todo Check why/whether these calls are even needed.
set(_NAME_MISMATCHED "NAME_MISMATCHED")
endif()
if(${name}_FOUND AND ${name}_LIBRARY STREQUAL "")
find_package_handle_standard_args(${name}
REQUIRED_VARS ${name}_INCLUDE_DIRS ${_NAME_MISMATCHED})
else()
find_package_handle_standard_args(${name}
REQUIRED_VARS ${name}_LIBRARY ${_NAME_MISMATCHED})
endif()
endif ()
if (NOT DEFINED ${name}_FOUND)
set (${name}_FOUND "${${NAME}_FOUND}")

View File

@@ -130,7 +130,7 @@ 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 ()
@@ -144,7 +144,12 @@ 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 ()
option (USE_SUPERLU "Use SuperLU direct solvers for AMG (if umfpack is not found)" ON)
if (NOT USE_SUPERLU)
set (CMAKE_DISABLE_FIND_PACKAGE_SuperLU TRUE)
endif ()

View File

@@ -63,9 +63,6 @@ find_openmp (${project})
include (UseThreads)
find_threads (${project})
# SuperLU is optional
option (USE_SUPERLU "Use SuperLU direct solvers" OFF)
# PETSc is optional
option (USE_PETSC "Use PETSc iterative solvers" OFF)

View File

@@ -124,7 +124,7 @@ macro (find_opm_package module deps header lib defs prog conf)
# without config.h
config_cmd_line (${module}_CMD_CONFIG ${module}_CONFIG_VARS)
if(prog)
if(prog) # always evaluates to false, but makes tests with DUNE 2.6-2.7 work
# check that we can compile a small test-program
include (CMakePushCheckState)
cmake_push_check_state ()
@@ -138,13 +138,16 @@ macro (find_opm_package module deps header lib defs prog conf)
list (APPEND CMAKE_REQUIRED_DEFINITIONS ${${module}_CMD_CONFIG})
check_cxx_source_compiles ("${prog}" HAVE_${MODULE})
cmake_pop_check_state ()
else(prog)
else()
if(${module}_FOUND)
# No test code provided, mark compilation as successful
# if module was founf
set(HAVE_${MODULE} 1)
# if module was found
# Has to be cached because of scope. Otherwise it is not accessible
# where it is used.
set(HAVE_${MODULE} 1 CACHE BOOL "${module} found")
mark_as_advanced(HAVE_${MODULE})
endif(${module}_FOUND)
endif(prog)
endif()
# write status message in the same manner as everyone else
include (FindPackageHandleStandardArgs)

View File

@@ -54,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)

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

@@ -0,0 +1,28 @@
# We make this a cmake module so it can be used from opm-simulators' CMakeLists.txt also
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 (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()
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")

View File

@@ -0,0 +1,27 @@
if(USE_DAMARIS_LIB AND MPI_FOUND)
if (Damaris_FOUND)
set(HAVE_DAMARIS 1)
message(STATUS "The Damaris library was found: ${Damaris_VERSION} ${Damaris_DIR}")
if (Damaris_HAS_HDF5)
message(STATUS "The Damaris library has HDF5 support: ${HDF5_VERSION}")
else()
message(STATUS "The Damaris library does NOT have HDF5 support")
endif()
if (Damaris_HAS_VISIT)
message(STATUS "The Damaris library has VisIt support: ${VisIt_VERSION}")
else()
message(STATUS "The Damaris library does NOT have VisIt support")
endif()
if (Damaris_HAS_CATALYST)
message(STATUS "The Damaris library has Catalyst support: ${Catalyst_VERSION} ${Paraview_VERSION}")
else()
message(STATUS "The Damaris library does NOT have Catalyst support")
endif()
else()
message(STATUS "The Damaris library was requested but NOT found")
endif()
else() # User did not request Damaris support
unset(HAVE_DAMARIS)
endif()
mark_as_advanced(HAVE_DAMARIS)

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

@@ -58,6 +58,7 @@ if(NOT @opm-project_NAME@_FOUND)
string(REPLACE ${@opm-project_NAME@_PREFIX} ${DEST_PREFIX} @opm-project_NAME@_INCLUDE_DIRS "${@opm-project_NAME@_INCLUDE_DIRS}")
string(REPLACE ${@opm-project_NAME@_PREFIX} ${DEST_PREFIX} @opm-project_NAME@_LIBRARY_DIRS "${@opm-project_NAME@_LIBRARY_DIRS}")
string(REPLACE ${@opm-project_NAME@_PREFIX} ${DEST_PREFIX} @opm-project_NAME@_LIBRARY "${@opm-project_NAME@_LIBRARY}")
string(REPLACE ${@opm-project_NAME@_PREFIX} ${DEST_PREFIX} @opm-project_NAME@_PYTHON_COMMON_DIR "${@opm-project_NAME@_PYTHON_COMMON_DIR}")
endif()
@@ -107,7 +108,18 @@ if(NOT @opm-project_NAME@_FOUND)
# The settings in this block do not mix well with the DEST_PREFIX
# setting.
if (NOT DEST_PREFIX)
# This is required to include OpmPackage
# if this file is not processed using the OPM CMake system but
# simply by a call to find_package(module) then the CMAKE_MODULE_PATH
# might not include the location of the OPM cmake module yet.
# Hence we search for opm-common using config mode to set it up.
# The check for opm-common_PREFIX is there to not do this in
# opm-common-config.cmake
if(NOT opm-common_PREFIX
AND NOT opm-common_FOUND)
# This needed to find the path to the CMake modules
find_package(opm-common CONFIG)
endif()
# This is required to include OpmPackage /opm-common-prereq.cmake
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" @PREREQ_LOCATION@)
# extra code from variable OPM_PROJECT_EXTRA_CODE

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@

View File

@@ -1,4 +1,4 @@
/* Userspesific CSS for doxygen */
/* Userspecific CSS for doxygen */
body, table, div, p, dl {
font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif;
font-size: 16px;

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 -DOPM_ENABLE_EMBEDDED_PYTHON=1
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

@@ -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

11
docs/man1/arraylist.1 Normal file
View File

@@ -0,0 +1,11 @@
.TH SUMMARY "1" "October 2022" "arraylist 2022.10" "User Commands"
.SH NAME
summary \- Printer for list of arrays in Eclipse summary files
.SH DESCRIPTION
List all arrays found in an EclFile specified on the command line.
.PP
.SH OPTIONS
\fB\-h\fR Print help and exit.
.TP
\fB\-r\fR List array for a specific report time step number. Option only valid for a unified restart file.
.PP

View File

@@ -1,5 +1,4 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.8.
.TH COMPAREECL "1" "April 2021" "compareECL 2020.04" "User Commands"
.TH COMPAREECL "1" "October 2022" "compareECL 2022.10" "User Commands"
.SH NAME
compareECL \- Comparator for Eclipse files
.SH DESCRIPTION
@@ -11,55 +10,57 @@ The program takes four arguments:
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
\fB\-l\fR Only do comparison for the last Report Step. This option is only valid for restart files.
\fB\-n\fR Do not throw on errors.
\fB\-p\fR Print keywords in both cases and exit.
\fB\-r\fR compare a spesific report time step number in a restart file.
\fB\-t\fR Specify ECLIPSE filetype to compare, (default behaviour is that all files are compared if found). Different possible arguments are:
.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 specific 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.
.TP
.IP
\fB\-t\fR EGRID
Compare two EGrid files (.EGRID).
.TP
.IP
\fB\-t\fR INIT
Compare two initial files (.INIT).
.TP
.IP
\fB\-t\fR RFT
Compare two RFT files (.RFT).
.TP
.IP
\fB\-t\fR SMRY
Compare two cases consistent of (unified) summary files.
.IP
\fB\-t\fR RSM
Compare RSM file against a summary file.
.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
Example usage of the program:
.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.
.SH "SEE ALSO"
The full documentation for
.B compareECL
is maintained as a Texinfo manual. If the
.B info
and
.B compareECL
programs are properly installed at your site, the command
.IP
.B info compareECL
.PP
should give you access to the complete manual.

View File

@@ -1,5 +1,4 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.8.
.TH CONVERTECL "1" "April 2021" "convertECL 2020.04" "User Commands"
.TH CONVERTECL "1" "October 2022" "convertECL 2022.10" "User Commands"
.SH NAME
convertECL \- Converter for Eclipse files (binary <-> formatted format)
.SH DESCRIPTION
@@ -7,18 +6,13 @@ convertECL needs one argument which is the input file to be converted. If this i
.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.
\fB\-r\fR extract and convert a spesific report time step number from a unified restart file.
.SH "SEE ALSO"
The full documentation for
.B convertECL
is maintained as a Texinfo manual. If the
.B info
and
.B convertECL
programs are properly installed at your site, the command
.IP
.B info convertECL
.TP
\fB\-i\fR Enforce IX standard on output file.
.TP
\fB\-r\fR extract and convert a specific report time step number from a unified restart file.
.PP
should give you access to the complete manual.

View File

@@ -1,5 +1,4 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.8.
.TH OPMHASH "1" "April 2021" "opmhash 2020.04" "User Commands"
.TH OPMHASH "1" "October 2022" "opmhash 2022.10" "User Commands"
.SH NAME
opmhash \- Hasher for summary keywords in Eclipse files
.SH DESCRIPTION
@@ -40,15 +39,11 @@ depends on the keyword order.
\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.
.SH "SEE ALSO"
The full documentation for
.B opmhash
is maintained as a Texinfo manual. If the
.B info
and
.B opmhash
programs are properly installed at your site, the command
.IP
.B info opmhash
.HP
\fB\-S\fR : Silent form \- will not print any deck output.
.PP
should give you access to the complete manual.
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.

View File

@@ -1,10 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.8.
.TH OPMPACK "1" "April 2021" "opmpack 2020.04" "User Commands"
.TH OPMPACK "1" "October 2022" "opmpack 2022.10" "User Commands"
.SH NAME
opmpack \- Validator and printer of deck in Eclipse files without comments
.SH DESCRIPTION
opmpack: invalid option \fB\-\-\fR 'h'
.PP
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.
@@ -28,15 +25,4 @@ opmpack \fB\-o\fR NEW_CASE.DATA path/to/MY_CASE.DATA
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.
.SH "SEE ALSO"
The full documentation for
.B opmpack
is maintained as a Texinfo manual. If the
.B info
and
.B opmpack
programs are properly installed at your site, the command
.IP
.B info opmpack
.PP
should give you access to the complete manual.

View File

@@ -1,7 +1,88 @@
.TH RST_DECK
.TH RST_DECK: "1" "October 2022" "rst_deck 2022.10" "User Commands"
.SH NAME
rst_deck \- Create a version of deck ready for restart
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

View File

@@ -1,5 +1,4 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.8.
.TH SUMMARY "1" "April 2021" "summary 2020.04" "User Commands"
.TH SUMMARY "1" "October 2022" "summary 2022.10" "User Commands"
.SH NAME
summary \- Printer for summary keys in Eclipse summary files
.SH DESCRIPTION
@@ -7,18 +6,10 @@ summary needs a minimum of two arguments. First is smspec filename and then list
.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.
.SH "SEE ALSO"
The full documentation for
.B summary
is maintained as a Texinfo manual. If the
.B info
and
.B summary
programs are properly installed at your site, the command
.IP
.B info summary
.PP
should give you access to the complete manual.

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: 2021.10-pre
Label: 2021.10-pre
Version: 2022.10
Label: 2022.10
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>
@@ -31,7 +32,6 @@
#include <opm/io/eclipse/ESmry.hpp>
#include <opm/io/eclipse/EclUtil.hpp>
#include <opm/common/utility/FileSystem.hpp>
static void printHelp() {
@@ -93,9 +93,9 @@ 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 esmryFileName = inputFileName.parent_path() / inputFileName.stem();
std::filesystem::path esmryFileName = inputFileName.parent_path() / inputFileName.stem();
esmryFileName = esmryFileName += ".ESMRY";
if (Opm::EclIO::fileExists(esmryFileName) && (force))

View File

@@ -19,14 +19,16 @@
#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/Deck/Deck.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/Parser/Parser.hpp>
#include <opm/input/eclipse/Parser/ParseContext.hpp>
#include <opm/input/eclipse/Parser/ErrorGuard.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>
@@ -51,8 +53,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

@@ -24,14 +24,10 @@
#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>
struct keyword {

View File

@@ -21,15 +21,15 @@
#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>

View File

@@ -17,21 +17,23 @@
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/Deck/Deck.hpp>
#include <opm/input/eclipse/EclipseState/InitConfig/InitConfig.hpp>
#include <opm/input/eclipse/EclipseState/IOConfig/IOConfig.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>
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 +156,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 +171,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);
}

View File

@@ -18,28 +18,30 @@
*/
#include <cstdlib>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <getopt.h>
#include <fmt/format.h>
#include <unordered_set>
#include <utility>
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
#include <opm/common/utility/FileSystem.hpp>
#include <opm/parser/eclipse/Units/UnitSystem.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/ParserKeywords/R.hpp>
#include <opm/parser/eclipse/Parser/ParserKeywords/S.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/parser/eclipse/Deck/FileDeck.hpp>
#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 = Opm::filesystem;
namespace fs = std::filesystem;
const std::unordered_set<std::string> remove_from_solution = {"EQUIL", "PRESSURE", "SWAT", "SGAS"};
@@ -63,7 +65,7 @@ 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(2).
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
@@ -76,9 +78,35 @@ Arguments:
1. The data file we are starting with.
2. The basename of the restart file - with an optional path prefix and a :N to
restart from step N(3). 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.
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
@@ -91,7 +119,7 @@ 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. NB: Currently the -s option is required
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
@@ -102,7 +130,7 @@ Options:
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.
based on output in cwd.
Example:
@@ -111,14 +139,6 @@ Example:
1: The program has a compiled list of keywords which will be retained in the
SOLUTION section. The current value of that list is: {}
2: Current version of the program *only* supports the SKIPREST option, and the
-s option is required.
3: The second argument is treated purely as a string and inserted verbatim into
the updated restart deck. In a future version we might interpret the second
argument as a file path and check the content and also do filesystem
manipulations from it.
)", keep_keywords);
std::cerr << help_text << std::endl;
@@ -130,17 +150,19 @@ Example:
struct options {
struct Options {
std::string input_deck;
std::pair<std::string, int> restart;
std::optional<std::string> target;
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::FileDeck load_deck(const options& opt) {
Opm::Deck load_deck(const Options& opt) {
Opm::ParseContext parseContext(Opm::InputError::WARN);
Opm::ErrorGuard errors;
Opm::Parser parser;
@@ -150,8 +172,7 @@ Opm::FileDeck load_deck(const options& opt) {
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);
auto deck = parser.parseFile(opt.input_deck, parseContext, errors);
return Opm::FileDeck{ deck };
return parser.parseFile(opt.input_deck, parseContext, errors);
}
@@ -169,17 +190,86 @@ Opm::FileDeck::OutputMode mode(const std::string& mode_arg) {
return Opm::FileDeck::OutputMode::INLINE;
}
std::pair<std::string, std::size_t> split_restart(const std::string& restart_base) {
auto sep_pos = restart_base.rfind(':');
if (sep_pos == std::string::npos)
print_help_and_exit(fmt::format("Expected restart argument on the form: BASE:NUMBER - e.g. HISTORY:60"));
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");
return std::make_pair(restart_base.substr(0, sep_pos), std::stoi(restart_base.substr(sep_pos + 1)));
}
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;
}
options load_options(int argc, char **argv) {
options opt;
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");
@@ -204,11 +294,21 @@ options load_options(int argc, char **argv) {
print_help_and_exit();
opt.input_deck = argv[arg_offset];
opt.restart = split_restart(argv[arg_offset + 1]);
std::string restart_arg = argv[arg_offset + 1];
if ((argc - arg_offset) >= 3) {
opt.target = argv[arg_offset + 2];
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(opt.target.value()).parent_path();
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))
@@ -220,13 +320,13 @@ options load_options(int argc, char **argv) {
print_help_and_exit("When writing output to stdout you must use inline|share mode");
}
return opt;
return {opt, restart_arg};
}
void update_solution(const options& opt, Opm::FileDeck& file_deck)
void update_solution(const Options& opt, Opm::FileDeck& file_deck)
{
if (opt.restart.second == 0)
if (opt.restart_step == 0)
return;
const auto solution = file_deck.find("SOLUTION");
@@ -237,35 +337,33 @@ void update_solution(const options& opt, Opm::FileDeck& file_deck)
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.first, opt.restart.second);
file_deck.rst_solution(opt.restart_base, opt.restart_step);
}
void update_schedule(const options& opt, Opm::FileDeck& file_deck)
void update_schedule(const Options& opt, Opm::FileDeck& file_deck)
{
if (opt.restart.second == 0)
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 = load_options(argc, argv);
auto file_deck = load_deck(options);
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.has_value())
if (!options.target_path.has_value())
file_deck.dump_stdout(fs::current_path(), options.mode);
else {
std::string target = options.target.value();
if (fs::is_directory(target))
file_deck.dump( fs::absolute(target), fs::path(options.input_deck).filename(), options.mode );
else {
auto target_path = fs::path( fs::absolute(options.target.value()) );
file_deck.dump( fs::absolute(target_path.parent_path()), target_path.filename(), options.mode );
}
}
else
file_deck.dump( options.target_path.value(), options.target_fname.value(), options.mode);
}

View File

@@ -17,24 +17,24 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#include <filesystem>
#include <fstream>
#include <iomanip>
#include <iostream>
#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/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)
@@ -85,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;
}
@@ -123,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 -DBUILD_FLOW_POLY_GRID=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
@@ -226,7 +236,7 @@ function build_module_full {
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/dist-packages"
export PYTHONPATH="$WORKSPACE/$configuration/install/lib/python$PY_MAJOR.$PY_MINOR/site-packages"
# Build upstream modules
build_upstreams

View File

@@ -33,7 +33,7 @@ else
then
cp $OPM_TESTS_ROOT $WORKSPACE/deps/opm-tests -R
pushd $WORKSPACE/deps/opm-tests
echo "opmt-tests-revision: `git rev-parse HEAD`"
echo "opm-tests-revision: `git rev-parse HEAD`"
popd
fi
fi

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
@@ -43,6 +44,12 @@ 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/$configuration/build-opm-simulators $WORKSPACE/$configuration/install/bin/convertECL
if test $? -eq 5

View File

@@ -6,17 +6,15 @@
#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/Schedule/SummaryState.hpp>
#include <opm/input/eclipse/EclipseState/EclipseState.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 {
@@ -25,38 +23,39 @@ class EclipseIO;
class ParseContext;
class Parser;
class Python;
class SummaryState;
class UDQState;
class WellTestState;
namespace Action {
class State;
}
class msim {
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, const time_point& sim_time);
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, WellTestState& wtest_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, WellTestState& wtest_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, WellTestState& wtest_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, WellTestState& wtest_state, 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

@@ -27,32 +27,30 @@
#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/EclipseState/Schedule/Well/WellTestState.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(TimeService::from_time_t(schedule.getStartTime()));
UDQState udq_state(schedule.getUDQConfig(0).params().undefinedValue());
UDQState udq_state(this->schedule.getUDQConfig(0).params().undefinedValue());
WellTestState wtest_state;
Action::State action_state;
Python python;
io.writeInitial();
@@ -60,13 +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, wtest_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, wtest_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);
}
auto sim_time = TimeService::from_time_t( schedule.simTime(report_step) );
post_step(schedule, action_state, st, sol, well_data, group_nwrk_data, report_step, sim_time);
post_step(sol, well_data, group_nwrk_data, report_step, sim_time);
const auto& exit_status = schedule.exitStatus();
if (exit_status.has_value())
return;
@@ -78,33 +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 time_point& sim_time) {
const auto& actions = schedule[report_step].actions.get();
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[report_step].wlist_manager.get());
Action::Context context( this->st , this->schedule[report_step].wlist_manager.get());
for (const auto& action : actions.pending(action_state, std::chrono::system_clock::to_time_t(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, sim_time, *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, WellTestState& wtest_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, wtest_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, WellTestState& wtest_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) {
@@ -112,11 +110,11 @@ void msim::run_step(const Schedule& schedule, Action::State& action_state, WellT
if ((seconds_elapsed + time_step) > end_time)
time_step = end_time - seconds_elapsed;
this->simulate(schedule, wtest_state, 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,
well_data,
@@ -126,11 +124,9 @@ void msim::run_step(const Schedule& schedule, Action::State& action_state, WellT
{},
{});
schedule.getUDQConfig( report_step ).eval(report_step, schedule.wellMatcher(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,
wtest_state,
st,
this->output(wtest_state,
udq_state,
report_step,
(seconds_elapsed < end_time),
@@ -144,11 +140,11 @@ void msim::run_step(const Schedule& schedule, Action::State& action_state, WellT
void msim::output(Action::State& action_state, WellTestState& wtest_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 {
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(action_state,
io.writeTimeStep(this->action_state,
wtest_state,
st,
this->st,
udq_state,
report_step,
substep,
@@ -157,15 +153,15 @@ void msim::output(Action::State& action_state, WellTestState& wtest_state, Summa
}
void msim::simulate(const Schedule& schedule, WellTestState&, 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];
@@ -174,7 +170,7 @@ void msim::simulate(const Schedule& schedule, WellTestState&, const SummaryState
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

@@ -49,22 +49,22 @@
// std::runtime_error.
//
// Usage: OPM_THROW(ExceptionClass, "Error message " << value);
#define OPM_THROW(Exception, message) \
do { \
std::ostringstream oss__; \
oss__ << "[" << __FILE__ << ":" << __LINE__ << "] " << message; \
::Opm::OpmLog::error(oss__.str()); \
throw Exception(oss__.str()); \
#define OPM_THROW(Exception, message) \
do { \
std::ostringstream opmErrorMacroOStringStream; \
opmErrorMacroOStringStream << "[" << __FILE__ << ":" << __LINE__ << "] " << message; \
::Opm::OpmLog::error(opmErrorMacroOStringStream.str()); \
throw Exception(opmErrorMacroOStringStream.str()); \
} while (false)
// Same as OPM_THROW, except for not making an OpmLog::error() call.
//
// Usage: OPM_THROW_NOLOG(ExceptionClass, "Error message " << value);
#define OPM_THROW_NOLOG(Exception, message) \
do { \
std::ostringstream oss__; \
oss__ << "[" << __FILE__ << ":" << __LINE__ << "] " << message; \
throw Exception(oss__.str()); \
#define OPM_THROW_NOLOG(Exception, message) \
do { \
std::ostringstream opmErrorMacroOStringStream; \
opmErrorMacroOStringStream << "[" << __FILE__ << ":" << __LINE__ << "] " << message; \
throw Exception(opmErrorMacroOStringStream.str()); \
} while (false)
// throw an exception if a condition is true

View File

@@ -53,7 +53,7 @@ public:
std::string format(const std::string& msg_fmt) const;
static KeywordLocation serializeObject()
static KeywordLocation serializationTestObject()
{
KeywordLocation result;
result.keyword = "KW";

View File

@@ -21,7 +21,6 @@
#define STREAMLOG_H
#include <fstream>
#include <iostream>
#include <cstdint>
#include <opm/common/OpmLog/LogBackend.hpp>

View File

@@ -19,9 +19,10 @@
#ifndef ACTIVEGRIDCELLS_HPP
#define ACTIVEGRIDCELLS_HPP
#include <opm/parser/eclipse/EclipseState/Grid/GridDims.hpp>
#include <opm/input/eclipse/EclipseState/Grid/GridDims.hpp>
#include <array>
#include <vector>
namespace Opm
{
@@ -69,6 +70,7 @@ public:
/// \param k The index in the k direction
/// \return The local index or -1 if the cell is inactive
int localCell(std::size_t i, std::size_t j, std::size_t k) const;
protected:
/// \brief Maps the cartesian index to a compressed local index.
///

View File

@@ -19,31 +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;
filesystem::path proximate(const filesystem::path& p,
const filesystem::path& base = filesystem::current_path());
#else
namespace filesystem = std::filesystem;
using filesystem::proximate;
#endif
// A poor man's filesystem::unique_path
std::string unique_path(const std::string& input);
} // end namespace Opm

View File

@@ -1,11 +1,9 @@
/*
Copyright 2020 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
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
@@ -15,122 +13,513 @@
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
Consult the COPYING file in the top-level source directory of this
module for the precise wording of the license and the list of
copyright holders.
*/
#ifndef SERIALIZER_HPP
#define SERIALIZER_HPP
#ifndef OPM_SERIALIZER_HPP
#define OPM_SERIALIZER_HPP
#include <cstring>
#include <string>
#include <algorithm>
#include <functional>
#include <map>
#include <memory>
#include <optional>
#include <set>
#include <type_traits>
#include <utility>
#include <unordered_map>
#include <unordered_set>
#include <variant>
#include <vector>
namespace Opm {
/*
This is a very basic serialization class used to support serialization of
small state objects from opm common. The main serialization code used in
opm/flow is initiated and controlled from the restart code, and therefor
slightly cumbersome to use for objects which should be serialized not as part
of the restart code.
*/
namespace detail {
template<typename ...Ts>
struct MakeVariantImpl
{
class Serializer {
public:
Serializer() = default;
explicit Serializer(const std::vector<char>& buffer_arg) :
buffer(buffer_arg)
{}
template<std::size_t Index, typename, typename ...Rest>
static decltype(auto) make_variant(std::size_t index)
{
if(Index == index)
return std::variant<Ts...>{std::in_place_index_t<Index>{}};
if constexpr(sizeof...(Rest) != 0)
return make_variant<Index + 1, Rest...>(index);
else
throw std::runtime_error("Invalid variant index");
}
template <typename T>
void put(const T& value) {
this->pack(std::addressof(value), sizeof(T));
}
template <typename T>
void put(const T* ) {
throw std::logic_error("Serializer can not pack pointers");
}
template <typename T>
T get() {
T value;
std::memcpy(&value, &this->buffer[this->read_pos], sizeof(T));
this->read_pos += sizeof(T);
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_map(const std::unordered_map<K,T>& values) {
this->put(values.size());
for (const auto& value_pair : values) {
this->put(value_pair.first);
this->put(value_pair.second);
}
}
template<typename K, typename T>
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++) {
auto key = this->get<K>();
auto value = this->get<T>();
values.insert( std::make_pair(key,value) );
}
return values;
}
std::vector<char> buffer;
private:
void pack(const void * ptr, std::size_t value_size) {
std::size_t write_pos = this->buffer.size();
std::size_t new_size = write_pos + value_size;
this->buffer.resize( new_size );
std::memcpy(&this->buffer[write_pos], ptr, value_size);
}
std::size_t read_pos = 0;
};
template <>
void inline Serializer::put(const std::string& value) {
this->put(value.size());
if (value.empty())
return;
this->pack(value.c_str(), value.size());
template<typename ...Ts>
decltype(auto) make_variant(std::size_t index)
{
return detail::MakeVariantImpl<Ts...>::template make_variant<0, Ts...>(index);
}
template<>
std::string inline Serializer::get<std::string>() {
std::string::size_type length = this->get<std::string::size_type>();
if (length == 0)
return std::string{};
template<class T>
using remove_cvr_t = std::remove_cv_t<std::remove_reference_t<T>>;
this->read_pos += length;
return {std::addressof(this->buffer[this->read_pos - length]), length};
}
} // namespace detail
/*! \brief Class for (de-)serializing.
*! \details If the class has a serializeOp member this is used,
* if not it is passed on to the underlying packer.
*/
template<class Packer>
class Serializer {
public:
//! \brief Constructor.
//! \param packer Packer to use
explicit Serializer(const Packer& packer) :
m_packer(packer)
{}
//! \brief Applies current serialization op to the passed data.
template<class T>
void operator()(const T& data)
{
if constexpr (is_ptr<T>::value) {
ptr(data);
} else if constexpr (is_pair_or_tuple<T>::value) {
tuple(data);
} else if constexpr (is_variant<T>::value) {
variant(data);
} else if constexpr (is_optional<T>::value) {
optional(data);
} else if constexpr (is_vector<T>::value) {
vector(data);
} else if constexpr (is_map<T>::value) {
map(data);
} else if constexpr (is_array<T>::value) {
array(data);
} else if constexpr (is_set<T>::value) {
set(data);
} else if constexpr (has_serializeOp<detail::remove_cvr_t<T>>::value) {
const_cast<T&>(data).serializeOp(*this);
} else {
if (m_op == Operation::PACKSIZE)
m_packSize += m_packer.packSize(data);
else if (m_op == Operation::PACK)
m_packer.pack(data, m_buffer, m_position);
else if (m_op == Operation::UNPACK)
m_packer.unpack(const_cast<T&>(data), m_buffer, m_position);
}
}
//! \brief Call this to serialize data.
//! \tparam T Type of class to serialize
//! \param data Class to serialize
template<class T>
void pack(const T& data)
{
m_op = Operation::PACKSIZE;
m_packSize = 0;
(*this)(data);
m_position = 0;
m_buffer.resize(m_packSize);
m_op = Operation::PACK;
(*this)(data);
}
//! \brief Call this to serialize data.
//! \tparam T Type of class to serialize
//! \param data Class to serialize
template<class... Args>
void pack(const Args&... data)
{
m_op = Operation::PACKSIZE;
m_packSize = 0;
variadic_call(data...);
m_position = 0;
m_buffer.resize(m_packSize);
m_op = Operation::PACK;
variadic_call(data...);
}
//! \brief Call this to de-serialize data.
//! \tparam T Type of class to de-serialize
//! \param data Class to de-serialize
template<class T>
void unpack(T& data)
{
m_position = 0;
m_op = Operation::UNPACK;
(*this)(data);
}
//! \brief Call this to de-serialize data.
//! \tparam T Type of class to de-serialize
//! \param data Class to de-serialize
template<class... Args>
void unpack(Args&... data)
{
m_position = 0;
m_op = Operation::UNPACK;
variadic_call(data...);
}
//! \brief Returns current position in buffer.
size_t position() const
{
return m_position;
}
//! \brief Returns true if we are currently doing a serialization operation.
bool isSerializing() const
{
return m_op != Operation::UNPACK;
}
protected:
//! \brief Handler for vectors.
//! \tparam T Type for vector elements
//! \param data The vector to (de-)serialize
template <typename T>
void vector(const std::vector<T>& data)
{
if constexpr (std::is_pod_v<T>) {
if (m_op == Operation::PACKSIZE) {
(*this)(data.size());
m_packSize += m_packer.packSize(data.data(), data.size());
} else if (m_op == Operation::PACK) {
(*this)(data.size());
m_packer.pack(data.data(), data.size(), m_buffer, m_position);
} else if (m_op == Operation::UNPACK) {
std::size_t size = 0;
(*this)(size);
auto& data_mut = const_cast<std::vector<T>&>(data);
data_mut.resize(size);
m_packer.unpack(data_mut.data(), size, m_buffer, m_position);
}
} else {
if (m_op == Operation::UNPACK) {
std::size_t size = 0;
(*this)(size);
auto& data_mut = const_cast<std::vector<T>&>(data);
data_mut.resize(size);
std::for_each(data_mut.begin(), data_mut.end(), std::ref(*this));
} else {
(*this)(data.size());
std::for_each(data.begin(), data.end(), std::ref(*this));
}
}
}
//! \brief Handler for bool vectors.
//! \param data The vector to (de-)serialize
void vector(const std::vector<bool>& data)
{
if (m_op == Operation::UNPACK) {
std::size_t size = 0;
(*this)(size);
auto& data_mut = const_cast<std::vector<bool>&>(data);
data_mut.clear();
data_mut.reserve(size);
for (size_t i = 0; i < size; ++i) {
bool entry = false;
(*this)(entry);
data_mut.push_back(entry);
}
} else {
(*this)(data.size());
for (const auto entry : data) { // Not a reference: vector<bool> range
bool b = entry;
(*this)(b);
}
}
}
//! \brief Handler for arrays.
//! \param data The array to (de-)serialize
template <class Array>
void array(const Array& data)
{
using T = typename Array::value_type;
if constexpr (std::is_pod_v<T>) {
if (m_op == Operation::PACKSIZE)
m_packSize += m_packer.packSize(data.data(), data.size());
else if (m_op == Operation::PACK)
m_packer.pack(data.data(), data.size(), m_buffer, m_position);
else if (m_op == Operation::UNPACK) {
auto& data_mut = const_cast<Array&>(data);
m_packer.unpack(data_mut.data(), data_mut.size(), m_buffer, m_position);
}
} else {
std::for_each(data.begin(), data.end(), std::ref(*this));
}
}
//! \brief Handler for std::variant.
//! \param data The variant to (de-)serialize
template<class... Args>
void variant(const std::variant<Args...>& data)
{
if (m_op == Operation::UNPACK) {
std::size_t index = 0;
(*this)(index);
auto& data_mut = const_cast<std::variant<Args...>&>(data);
data_mut = detail::make_variant<Args...>(index);
std::visit(std::ref(*this), data_mut);
} else {
(*this)(data.index());
std::visit(std::ref(*this), data);
}
}
//! \brief Handler for std::optional.
//! \tparam T Type for data
//! \param data The optional to (de-)serialize
template<class T>
void optional(const std::optional<T>& data)
{
if (m_op == Operation::UNPACK) {
bool has = false;
(*this)(has);
if (has) {
T res;
(*this)(res);
const_cast<std::optional<T>&>(data) = res;
}
} else {
(*this)(data.has_value());
if (data.has_value()) {
(*this)(*data);
}
}
}
//! \brief Handler for std::tuple.
//! \param data The tuple to (de-)serialize
template<class Tuple>
void tuple(const Tuple& data)
{
tuple_call(data);
}
//! \brief Handler for maps.
//! \tparam Map map type
//! \param map The map to (de-)serialize
template<class Map>
void map(const Map& data)
{
if (m_op == Operation::UNPACK) {
std::size_t size = 0;
(*this)(size);
auto& data_mut = const_cast<Map&>(data);
for (size_t i = 0; i < size; ++i) {
typename Map::value_type entry;
(*this)(entry);
data_mut.insert(entry);
}
} else {
(*this)(data.size());
std::for_each(data.begin(), data.end(), std::ref(*this));
}
}
//! \brief Handler for sets.
//! \tparam Set set type
//! \param data The set to (de-)serialize
template<class Set>
void set(const Set& data)
{
if (m_op == Operation::UNPACK) {
std::size_t size = 0;
(*this)(size);
auto& data_mut = const_cast<Set&>(data);
for (size_t i = 0; i < size; ++i) {
typename Set::value_type entry;
(*this)(entry);
data_mut.insert(entry);
}
} else {
(*this)(data.size());
std::for_each(data.begin(), data.end(), std::ref(*this));
}
}
template<typename T, typename... Args>
void variadic_call(T& first,
Args&&... args)
{
(*this)(first);
if constexpr (sizeof...(args) > 0)
variadic_call(std::forward<Args>(args)...);
}
template<std::size_t I = 0, typename Tuple>
typename std::enable_if<I == std::tuple_size<Tuple>::value, void>::type
tuple_call(const Tuple&)
{
}
template<std::size_t I = 0, typename Tuple>
typename std::enable_if<I != std::tuple_size<Tuple>::value, void>::type
tuple_call(const Tuple& tuple)
{
(*this)(std::get<I>(tuple));
tuple_call<I+1>(tuple);
}
//! \brief Enumeration of operations.
enum class Operation {
PACKSIZE, //!< Calculating serialization buffer size
PACK, //!< Performing serialization
UNPACK //!< Performing de-serialization
};
//! \brief Predicate for detecting vectors.
template<class T>
struct is_vector {
constexpr static bool value = false;
};
template<class T1, class Allocator>
struct is_vector<std::vector<T1,Allocator>> {
constexpr static bool value = true;
};
//! \brief Predicate for detecting variants.
template<class T>
struct is_variant {
constexpr static bool value = false;
};
template<class... Ts>
struct is_variant<std::variant<Ts...>> {
constexpr static bool value = true;
};
//! \brief Predicate for detecting pairs and tuples.
template<class T>
struct is_pair_or_tuple {
constexpr static bool value = false;
};
template<class... Ts>
struct is_pair_or_tuple<std::tuple<Ts...>> {
constexpr static bool value = true;
};
template<class T1, class T2>
struct is_pair_or_tuple<std::pair<T1,T2>> {
constexpr static bool value = true;
};
//! \brief Predicate for smart pointers.
template<class T>
struct is_ptr {
constexpr static bool value = false;
};
template<class T1>
struct is_ptr<std::shared_ptr<T1>> {
constexpr static bool value = true;
};
template<class T1, class Deleter>
struct is_ptr<std::unique_ptr<T1, Deleter>> {
constexpr static bool value = true;
};
//! \brief Predicate for std::optional.
template<class T>
struct is_optional {
constexpr static bool value = false;
};
template<class T1>
struct is_optional<std::optional<T1>> {
constexpr static bool value = true;
};
//! \brief Predicate for maps
template<class T>
struct is_map {
constexpr static bool value = false;
};
template<class Key, class T, class Compare, class Allocator>
struct is_map<std::map<Key,T,Compare,Allocator>> {
constexpr static bool value = true;
};
template<class Key, class T, class Hash, class KeyEqual, class Allocator>
struct is_map<std::unordered_map<Key,T,Hash,KeyEqual,Allocator>> {
constexpr static bool value = true;
};
//! \brief Predicate for sets
template<class T>
struct is_set {
constexpr static bool value = false;
};
template<class Key, class Compare, class Allocator>
struct is_set<std::set<Key,Compare,Allocator>> {
constexpr static bool value = true;
};
template<class Key, class Hash, class KeyEqual, class Allocator>
struct is_set<std::unordered_set<Key,Hash,KeyEqual,Allocator>> {
constexpr static bool value = true;
};
//! \brief Predicate for arrays
template<class T>
struct is_array {
constexpr static bool value = false;
};
template<class T, std::size_t N>
struct is_array<std::array<T,N>> {
constexpr static bool value = true;
};
//! Detect existence of \c serializeOp member function
//!
//! Base case (no \c serializeOp member function)
template <typename, class = void>
struct has_serializeOp : public std::false_type {};
//! Detect existence of \c serializeOp member function
//!
//! Non-default, albeit common, case (type has \c serializeOp member
//! function)
template <typename T>
struct has_serializeOp<
T, std::void_t<decltype(std::declval<T>().serializeOp(std::declval<Serializer<Packer>&>()))>
> : public std::true_type {};
//! \brief Handler for smart pointers.
template<class PtrType>
void ptr(const PtrType& data)
{
using T1 = typename PtrType::element_type;
bool value = data ? true : false;
(*this)(value);
if (m_op == Operation::UNPACK && value) {
const_cast<PtrType&>(data).reset(new T1);
}
if (data) {
(*this)(*data);
}
}
const Packer& m_packer; //!< Packer to use
Operation m_op = Operation::PACKSIZE; //!< Current operation
size_t m_packSize = 0; //!< Required buffer size after PACKSIZE has been done
int m_position = 0; //!< Current position in buffer
std::vector<char> m_buffer; //!< Buffer for serialized data
};
}
#endif

View File

@@ -24,7 +24,7 @@
#include <ctime>
#include <string>
#include <unordered_map>
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
#include <opm/input/eclipse/Deck/DeckRecord.hpp>
namespace Opm {
@@ -45,6 +45,7 @@ namespace Opm {
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 portable_timegm(const std::tm* t);
std::time_t timeFromEclipse(const DeckRecord &dateRecord);
}
@@ -103,7 +104,7 @@ namespace Opm {
template<class Serializer>
void serializeOp(Serializer& serializer)
{
ymd_.serializeOp(serializer);
serializer(ymd_);
serializer(hour_);
serializer(minutes_);
serializer(seconds_);

View File

@@ -24,7 +24,7 @@
#include <exception>
#include <vector>
#include <utility>
#include <iostream>
#include <ostream>
#include <opm/common/ErrorMacros.hpp>

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

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,16 +20,18 @@
#ifndef DECK_HPP
#define DECK_HPP
#include <functional>
#include <iosfwd>
#include <map>
#include <memory>
#include <ostream>
#include <optional>
#include <vector>
#include <string>
#include <opm/parser/eclipse/Deck/DeckTree.hpp>
#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
@@ -56,85 +58,18 @@ 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;
const DeckKeyword& operator[](std::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 DeckView::operator[];
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();
static Deck serializationTestObject();
Deck& operator=(const Deck& rhs);
bool operator==(const Deck& data) const;
@@ -142,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();
@@ -163,31 +96,68 @@ namespace Opm {
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)
{
serializer.vector(keywordList);
defaultUnits.serializeOp(serializer);
serializer(keywordList);
serializer(defaultUnits);
serializer(activeUnits);
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::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

@@ -23,12 +23,12 @@
#include <string>
#include <vector>
#include <memory>
#include <ostream>
#include <iosfwd>
#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 {
@@ -46,7 +46,7 @@ namespace Opm {
DeckItem( const std::string&, UDAValue, const std::vector<Dimension>& active_dim, const std::vector<Dimension>& default_dim);
DeckItem( const std::string&, double, const std::vector<Dimension>& active_dim, const std::vector<Dimension>& default_dim);
static DeckItem serializeObject();
static DeckItem serializationTestObject();
const std::string& name() const;
@@ -113,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;
@@ -130,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]; };
@@ -139,14 +140,14 @@ namespace Opm {
serializer(dval);
serializer(ival);
serializer(sval);
serializer.vector(rsval);
serializer.vector(uval);
serializer(rsval);
serializer(uval);
serializer(type);
serializer(item_name);
serializer.template vector<value::status, false>(value_status);
serializer(value_status);
serializer(raw_data);
serializer.vector(active_dimensions);
serializer.vector(default_dimensions);
serializer(active_dimensions);
serializer(default_dimensions);
}
void reserve_additionalRawString(std::size_t);

View File

@@ -23,8 +23,8 @@
#include <string>
#include <vector>
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
#include <opm/parser/eclipse/Deck/value_status.hpp>
#include <opm/input/eclipse/Deck/DeckRecord.hpp>
#include <opm/input/eclipse/Deck/value_status.hpp>
#include <opm/common/OpmLog/KeywordLocation.hpp>
namespace Opm {
@@ -46,7 +46,7 @@ namespace Opm {
DeckKeyword(const ParserKeyword& parserKeyword, const std::vector<int>& data);
DeckKeyword(const ParserKeyword& parserKeyword, const std::vector<double>& data, const UnitSystem& system_active, const UnitSystem& system_default);
static DeckKeyword serializeObject();
static DeckKeyword serializationTestObject();
const std::string& name() const;
void setFixedSize();
@@ -77,8 +77,8 @@ namespace Opm {
void write_TITLE( DeckOutput& output ) const;
template <class Keyword>
bool isKeyword() const {
if (Keyword::keywordName == m_keywordName)
bool is() const {
if (Keyword::keywordName == this->m_keywordName)
return true;
else
return false;
@@ -97,8 +97,8 @@ namespace Opm {
void serializeOp(Serializer& serializer)
{
serializer(m_keywordName);
m_location.serializeOp(serializer);
serializer.vector(m_recordList);
serializer(m_location);
serializer(m_recordList);
serializer(m_isDataKeyword);
serializer(m_slashTerminated);
serializer(m_isDoubleRecordKeyword);

View File

@@ -20,7 +20,7 @@
#ifndef DECK_OUTPUT_HPP
#define DECK_OUTPUT_HPP
#include <ostream>
#include <iosfwd>
#include <string>
#include <cstddef>

View File

@@ -23,9 +23,9 @@
#include <string>
#include <vector>
#include <memory>
#include <ostream>
#include <iosfwd>
#include <opm/parser/eclipse/Deck/DeckItem.hpp>
#include <opm/input/eclipse/Deck/DeckItem.hpp>
namespace Opm {
@@ -36,7 +36,7 @@ namespace Opm {
DeckRecord() = default;
DeckRecord( std::vector< DeckItem >&& items, const bool check_for_duplicate_names = true );
static DeckRecord serializeObject();
static DeckRecord serializationTestObject();
size_t size() const;
void addItem( DeckItem deckItem );
@@ -64,8 +64,8 @@ namespace Opm {
const_iterator begin() const;
const_iterator end() const;
void write(DeckOutput& writer) const;
void write_data(DeckOutput& writer) const;
void write(DeckOutput& writer, std::size_t item_offset = 0) const;
void write_data(DeckOutput& writer, std::size_t item_offset = 0) const;
friend std::ostream& operator<<(std::ostream& os, const DeckRecord& record);
bool equal(const DeckRecord& other, bool cmp_default, bool cmp_numeric) const;
@@ -75,7 +75,7 @@ namespace Opm {
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.vector(m_items);
serializer(m_items);
}
private:

View File

@@ -22,10 +22,12 @@
#include <string>
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/input/eclipse/Deck/DeckView.hpp>
namespace Opm {
class Deck;
enum class Section {
RUNSPEC,
GRID,
@@ -43,7 +45,6 @@ enum class Section {
class DeckSection : public DeckView {
public:
using DeckView::const_iterator;
DeckSection( const Deck& deck, const std::string& startKeyword );
const std::string& name() const;
@@ -64,6 +65,46 @@ class DeckSection : public DeckView {
const Parser&,
bool ensureKeywordSectionAffiliation = false);
// ---------------------------------------------------------------------------------
// Highly deprecated shims
const DeckKeyword& getKeyword(const std::string& keyword, std::size_t index) const {
auto view = this->operator[](keyword);
return view[index];
}
const DeckKeyword& getKeyword(const std::string& keyword) const {
auto view = this->operator[](keyword);
return view.back();
}
std::vector<const DeckKeyword*> getKeywordList(const std::string& keyword) const {
std::vector<const DeckKeyword*> kw_list;
auto view = this->operator[](keyword);
for (const auto& kw : view)
kw_list.push_back(&kw);
return kw_list;
}
template <class Keyword>
std::vector<const DeckKeyword*> getKeywordList() const {
return this->getKeywordList(Keyword::keywordName);
}
bool hasKeyword(const std::string& keyword) const {
return this->has_keyword(keyword);
}
template <class Keyword>
bool hasKeyword() const {
return this->has_keyword(Keyword::keywordName);
}
// ---------------------------------------------------------------------------------
private:
std::string section_name;
const UnitSystem& units;
@@ -72,49 +113,41 @@ class DeckSection : public DeckView {
class RUNSPECSection : public DeckSection {
public:
using DeckSection::const_iterator;
explicit RUNSPECSection(const Deck& deck) : DeckSection(deck, "RUNSPEC") {}
};
class GRIDSection : public DeckSection {
public:
using DeckSection::const_iterator;
explicit GRIDSection(const Deck& deck) : DeckSection(deck, "GRID") {}
};
class EDITSection : public DeckSection {
public:
using DeckSection::const_iterator;
explicit EDITSection(const Deck& deck) : DeckSection(deck, "EDIT") {}
};
class PROPSSection : public DeckSection {
public:
using DeckSection::const_iterator;
explicit PROPSSection(const Deck& deck) : DeckSection(deck, "PROPS") {}
};
class REGIONSSection : public DeckSection {
public:
using DeckSection::const_iterator;
explicit REGIONSSection(const Deck& deck) : DeckSection(deck, "REGIONS") {}
};
class SOLUTIONSection : public DeckSection {
public:
using DeckSection::const_iterator;
explicit SOLUTIONSection(const Deck& deck) : DeckSection(deck, "SOLUTION") {}
};
class SUMMARYSection : public DeckSection {
public:
using DeckSection::const_iterator;
explicit SUMMARYSection(const Deck& deck) : DeckSection(deck, "SUMMARY") {}
};
class SCHEDULESection : public DeckSection {
public:
using DeckSection::const_iterator;
explicit SCHEDULESection(const Deck& deck) : DeckSection(deck, "SCHEDULE") {}
};
}

View File

@@ -23,6 +23,7 @@
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <optional>
namespace Opm {

View File

@@ -22,7 +22,8 @@
#include <string>
#include <opm/parser/eclipse/Utility/Typetools.hpp>
#include <opm/input/eclipse/Utility/Typetools.hpp>
#include <opm/input/eclipse/Deck/UDAValue.hpp>
namespace Opm {
@@ -33,7 +34,8 @@ class DeckValue {
explicit DeckValue(int);
explicit DeckValue(double);
explicit DeckValue(const std::string&);
explicit DeckValue(const UDAValue&);
bool is_default() const;
template<typename T>
@@ -48,7 +50,8 @@ class DeckValue {
type_tag value_enum;
int int_value;
double double_value;
std::string string_value;
std::string string_value;
UDAValue uda_value;
};

View File

@@ -0,0 +1,91 @@
/*
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/>.
*/
#ifndef DECKVIEW_HPP
#define DECKVIEW_HPP
#include <opm/input/eclipse/Deck/DeckKeyword.hpp>
#include <unordered_map>
namespace Opm {
class DeckView {
public:
typedef std::vector<std::reference_wrapper<const DeckKeyword>> storage_type;
struct Iterator : public storage_type::iterator {
Iterator(storage_type::const_iterator inner_iter) :
inner(inner_iter)
{}
const DeckKeyword& operator*() { return this->inner->get(); }
const DeckKeyword* operator->() { return &this->inner->get(); }
Iterator& operator++() { ++this->inner; return *this; }
Iterator operator++(int) { auto tmp = *this; ++this->inner; return tmp; }
Iterator& operator--() { --this->inner; return *this; }
Iterator operator--(int) { auto tmp = *this; --this->inner; return tmp; }
Iterator::difference_type operator-(const Iterator &other) { return this->inner - other.inner; }
Iterator operator+(Iterator::difference_type shift) { Iterator tmp = *this; tmp.inner += shift; return tmp;}
friend bool operator== (const Iterator& a, const Iterator& b) { return a.inner == b.inner; };
friend bool operator!= (const Iterator& a, const Iterator& b) { return a.inner != b.inner; };
private:
storage_type::const_iterator inner;
};
Iterator begin() const { return Iterator(this->keywords.begin()); }
Iterator end() const { return Iterator(this->keywords.end()); }
const DeckKeyword& operator[](std::size_t index) const;
DeckView operator[](const std::string& keyword) const;
std::vector<std::size_t> index(const std::string& keyword) const;
std::size_t count(const std::string& keyword) const;
const DeckKeyword& front() const;
const DeckKeyword& back() const;
DeckView() = default;
void add_keyword(const DeckKeyword& kw);
bool has_keyword(const std::string& kw) const;
bool empty() const;
std::size_t size() const;
template<class Keyword>
bool has_keyword() const {
return this->has_keyword( Keyword::keywordName );
}
template<class Keyword>
DeckView get() const {
return this->operator[](Keyword::keywordName);
}
private:
storage_type keywords;
std::unordered_map<std::string, std::vector<std::size_t>> keyword_index;
};
}
#endif

View File

@@ -23,15 +23,15 @@
#include <optional>
#include <string>
#include <unordered_set>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <iosfwd>
#include <fmt/format.h>
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
#include <opm/parser/eclipse/Deck/FileDeck.hpp>
#include <opm/common/utility/FileSystem.hpp>
#include <opm/input/eclipse/Deck/DeckKeyword.hpp>
#include <opm/input/eclipse/Deck/FileDeck.hpp>
namespace fs = Opm::filesystem;
namespace fs = std::filesystem;
namespace Opm {
class Deck;
@@ -39,7 +39,7 @@ class Deck;
class FileDeck {
public:
static const std::unordered_set<std::string> rst_keep_in_solution;
static const std::unordered_set<std::string> rst_keep_in_schedule;
enum class OutputMode {
INLINE = 1,
@@ -66,7 +66,7 @@ struct Index {
bool operator==(const Index& other) const;
bool operator!=(const Index& other) const;
bool operator<(const Index& other) const;
Index operator+(std::size_t shift) const;
private:
const FileDeck * deck;
@@ -79,7 +79,7 @@ public:
explicit Block(const std::string& filename);
std::size_t size() const;
void load(const Deck& deck, std::size_t deck_index);
std::optional<std::size_t> find(const std::string& keyword) const;
std::optional<std::size_t> find(const std::string& keyword, std::size_t keyword_index) const;
bool empty() const;
void erase(const FileDeck::Index& index);
void insert(std::size_t keyword_index, const DeckKeyword& keyword);
@@ -94,7 +94,9 @@ friend FileDeck;
explicit FileDeck(const Deck& deck);
std::optional<Index> find(const std::string& keyword, const Index& offset) const;
std::optional<Index> find(const std::string& keyword) const;
std::size_t count(const std::string& keyword) const;
void erase(const Index& index);
void erase(const Index& begin, const Index& end);
void insert(const Index& index, const DeckKeyword& keyword);
@@ -107,6 +109,7 @@ friend FileDeck;
void rst_solution(const std::string& rst_base, int report_step);
void insert_skiprest();
void skip(int report_step);
private:
std::vector<Block> blocks;

View File

@@ -24,7 +24,7 @@
#include <string>
#include <vector>
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
#include <opm/input/eclipse/Deck/DeckKeyword.hpp>
namespace Opm {

View File

@@ -25,7 +25,7 @@
#include <string>
#include <iosfwd>
#include <opm/parser/eclipse/Units/Dimension.hpp>
#include <opm/input/eclipse/Units/Dimension.hpp>
namespace Opm {
@@ -51,7 +51,7 @@ public:
void update(const std::string& s);
void update_value(const UDAValue& other);
static UDAValue serializeObject();
static UDAValue serializationTestObject();
/*
The get<double>() and get<std::string>() methods will throw an
@@ -80,7 +80,7 @@ public:
bool operator==(const UDAValue& other) const;
bool operator!=(const UDAValue& other) const;
bool is_numeric() { return numeric_value; }
bool is_numeric() const { return numeric_value; }
template<class Serializer>
void serializeOp(Serializer& serializer)
@@ -88,9 +88,12 @@ public:
serializer(numeric_value);
serializer(double_value);
serializer(string_value);
dim.serializeOp(serializer);
serializer(dim);
}
void operator*=(double rhs);
private:
bool numeric_value;
double double_value;

View File

@@ -26,7 +26,7 @@
implement the analytical aquifer models in OPM Flow.
*/
#include <opm/parser/eclipse/EclipseState/Grid/FaceDir.hpp>
#include <opm/input/eclipse/EclipseState/Grid/FaceDir.hpp>
#include <cstddef>
#include <unordered_map>
@@ -93,18 +93,19 @@ namespace Opm {
void pruneDeactivatedAquiferConnections(const std::vector<std::size_t>& deactivated_cells);
void loadFromRestart(const RestartIO::RstAquifer& rst_aquifers);
static Aquancon serializeObject();
static Aquancon serializationTestObject();
const std::unordered_map<int, std::vector<Aquancon::AquancCell>>& data() const;
bool operator==(const Aquancon& other) const;
bool active() const;
const std::vector<Aquancon::AquancCell>& operator[](int aquiferID) const;
bool hasAquiferConnections(int aquiferID) const;
const std::vector<Aquancon::AquancCell>& getConnections(int aquiferID) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.map(this->cells);
serializer(this->cells);
}
private:

View File

@@ -81,7 +81,7 @@ namespace Opm {
std::vector<double> dimensionless_time{};
std::vector<double> dimensionless_pressure{};
static AQUCT_data serializeObject();
static AQUCT_data serializationTestObject();
double timeConstant() const { return this->time_constant_; }
double influxConstant() const { return this->influx_constant_; }
@@ -129,7 +129,7 @@ namespace Opm {
void loadFromRestart(const RestartIO::RstAquifer& rst,
const TableManager& tables);
static AquiferCT serializeObject();
static AquiferCT serializationTestObject();
std::size_t size() const;
std::vector<AquiferCT::AQUCT_data>::const_iterator begin() const;
@@ -142,7 +142,7 @@ namespace Opm {
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.vector(m_aquct);
serializer(m_aquct);
}
private:

View File

@@ -20,10 +20,10 @@
#ifndef OPM_AUQIFER_CONFIG_HPP
#define OPM_AUQIFER_CONFIG_HPP
#include <opm/parser/eclipse/EclipseState/Aquifer/Aquancon.hpp>
#include <opm/parser/eclipse/EclipseState/Aquifer/Aquifetp.hpp>
#include <opm/parser/eclipse/EclipseState/Aquifer/AquiferCT.hpp>
#include <opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquifers.hpp>
#include <opm/input/eclipse/EclipseState/Aquifer/Aquancon.hpp>
#include <opm/input/eclipse/EclipseState/Aquifer/Aquifetp.hpp>
#include <opm/input/eclipse/EclipseState/Aquifer/AquiferCT.hpp>
#include <opm/input/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquifers.hpp>
#include <cstddef>
#include <vector>
@@ -53,7 +53,7 @@ public:
void loadFromRestart(const RestartIO::RstAquifer& aquifers,
const TableManager& tables);
static AquiferConfig serializeObject();
static AquiferConfig serializationTestObject();
bool active() const;
const AquiferCT& ct() const;
@@ -61,6 +61,7 @@ public:
const Aquancon& connections() const;
bool operator==(const AquiferConfig& other) const;
bool hasAquifer(const int aquID) const;
bool hasAnalyticalAquifer(const int aquID) const;
bool hasNumericalAquifer() const;
bool hasAnalyticalAquifer() const;
@@ -70,10 +71,10 @@ public:
template<class Serializer>
void serializeOp(Serializer& serializer)
{
aquifetp.serializeOp(serializer);
aquiferct.serializeOp(serializer);
aqconn.serializeOp(serializer);
numerical_aquifers.serializeOp(serializer);
serializer(aquifetp);
serializer(aquiferct);
serializer(aqconn);
serializer(numerical_aquifers);
}
private:

View File

@@ -57,7 +57,8 @@ class Aquifetp {
const double C_t_,
const double V0_,
const double d0_,
const double p0_);
const double p0_,
const double t0_);
int aquiferID{};
int pvttableID{};
@@ -68,8 +69,9 @@ class Aquifetp {
double datum_depth{};
std::optional<double> initial_pressure{};
std::optional<double> initial_temperature{};
static AQUFETP_data serializeObject();
static AQUFETP_data serializationTestObject();
double timeConstant() const { return this->time_constant_; }
double waterDensity() const { return this->water_density_; }
@@ -89,6 +91,7 @@ class Aquifetp {
serializer(this->initial_watvolume);
serializer(this->datum_depth);
serializer(this->initial_pressure);
serializer(this->initial_temperature);
serializer(this->time_constant_);
serializer(this->water_density_);
serializer(this->water_viscosity_);
@@ -107,7 +110,7 @@ class Aquifetp {
void loadFromRestart(const RestartIO::RstAquifer& rst,
const TableManager& tables);
static Aquifetp serializeObject();
static Aquifetp serializationTestObject();
const std::vector<Aquifetp::AQUFETP_data>& data() const;
@@ -121,7 +124,7 @@ class Aquifetp {
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.vector(m_aqufetp);
serializer(m_aqufetp);
}
private:

View File

@@ -20,7 +20,7 @@
#ifndef OPM_NUMERICALAQUIFERCONNECTION_HPP
#define OPM_NUMERICALAQUIFERCONNECTION_HPP
#include <opm/parser/eclipse/EclipseState/Grid/FaceDir.hpp>
#include <opm/input/eclipse/EclipseState/Grid/FaceDir.hpp>
#include <map>
#include <array>
#include <vector>

View File

@@ -25,7 +25,7 @@
#include <stddef.h>
#include <opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/SingleNumericalAquifer.hpp>
#include <opm/input/eclipse/EclipseState/Aquifer/NumericalAquifer/SingleNumericalAquifer.hpp>
namespace Opm {
class Deck;
@@ -57,11 +57,11 @@ namespace Opm {
void initConnections(const Deck& deck, const EclipseGrid& grid);
void postProcessConnections(const EclipseGrid& grid, const std::vector<int>& actnum);
static NumericalAquifers serializeObject();
static NumericalAquifers serializationTestObject();
template <class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.map(this->m_aquifers);
serializer(this->m_aquifers);
serializer(this->m_num_records);
}

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