Compare commits

...

404 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
Paul Egberts
7956c2d7da added vaporized_water rate type 2022-04-08 21:07:45 +02:00
540 changed files with 14817 additions and 5397 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)
@@ -136,6 +136,7 @@ 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_EMBEDDED_PYTHON)
list(INSERT opm-common_SOURCES 0 ${PROJECT_BINARY_DIR}/python/cxx/builtin_pybind11.cpp)
@@ -163,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
@@ -184,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)
@@ -210,10 +221,21 @@ if (OPM_ENABLE_PYTHON)
"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
@@ -334,34 +356,7 @@ install(FILES cmake/OPM-CMake.md
install(FILES etc/opm_bash_completion.sh.in DESTINATION share/opm/etc)
if (OPM_ENABLE_PYTHON)
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "
import site, sys
try:
sys.stdout.write(site.getsitepackages()[-1])
except e:
sys.stdout.write('')" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES_PATH)
# -------------------------------------------------------------------------
# 1: Wrap C++ functionality in Python
if (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")
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})
@@ -403,34 +398,38 @@ except e:
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)
list(APPEND opm-common_PYTHON_LINKAGE "'${cjson_LIBRARIES}'")
append_quoted(opm-common_PYTHON_LINKAGE cjson_LIBRARIES)
append_quoted(SETUP_PY_INCLUDE_DIRS cjson_INCLUDE_DIRS)
endif()
# opm-common_PYTHON_LINKAGE is used verbatim in a listin python.
# Hence items need to be comma separated.
if (opm-common_PYTHON_LINKAGE)
string(REPLACE ";" "," SETUP_PY_LINKAGE "${opm-common_PYTHON_LINKAGE}")
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
@@ -468,6 +467,9 @@ except e:
# 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

View File

@@ -180,6 +180,7 @@ if(ENABLE_ECL_INPUT)
src/opm/input/eclipse/EclipseState/Tables/Aqudims.cpp
src/opm/input/eclipse/EclipseState/Tables/ColumnSchema.cpp
src/opm/input/eclipse/EclipseState/Tables/DenT.cpp
src/opm/input/eclipse/EclipseState/Tables/JouleThomson.cpp
src/opm/input/eclipse/EclipseState/Tables/Eqldims.cpp
src/opm/input/eclipse/EclipseState/Tables/JFunc.cpp
src/opm/input/eclipse/EclipseState/Tables/PvtxTable.cpp
@@ -301,6 +302,7 @@ if(ENABLE_ECL_OUTPUT)
src/opm/io/eclipse/rst/connection.cpp
src/opm/io/eclipse/rst/group.cpp
src/opm/io/eclipse/rst/header.cpp
src/opm/io/eclipse/rst/netbalan.cpp
src/opm/io/eclipse/rst/network.cpp
src/opm/io/eclipse/rst/udq.cpp
src/opm/io/eclipse/rst/segment.cpp
@@ -363,6 +365,7 @@ list (APPEND TEST_SOURCE_FILES
if(ENABLE_ECL_INPUT)
list(APPEND TEST_SOURCE_FILES
tests/rst_test.cpp
tests/test_CopyablePtr.cpp
tests/test_ERsm.cpp
tests/test_GuideRate.cpp
tests/test_RestartFileView.cpp
@@ -373,6 +376,7 @@ if(ENABLE_ECL_INPUT)
tests/test_ESmry.cpp
tests/test_EInit.cpp
tests/test_ExtESmry.cpp
tests/test_Serialization.cpp
tests/parser/ACTIONX.cpp
tests/parser/ADDREGTests.cpp
tests/parser/AquiferTests.cpp
@@ -473,8 +477,8 @@ if(ENABLE_ECL_OUTPUT)
tests/test_Restart.cpp
tests/test_RFT.cpp
tests/test_rst.cpp
tests/test_rst_netbalan.cpp
tests/test_Solution.cpp
tests/test_Serializer.cpp
tests/test_Inplace.cpp
tests/test_Summary.cpp
tests/test_Summary_Group.cpp
@@ -630,10 +634,10 @@ list( APPEND PUBLIC_HEADER_FILES
opm/common/OpmLog/OpmLog.hpp
opm/common/OpmLog/StreamLog.hpp
opm/common/OpmLog/TimerLog.hpp
opm/common/utility/Serializer.hpp
opm/common/utility/ActiveGridCells.hpp
opm/common/utility/FileSystem.hpp
opm/common/utility/OpmInputError.hpp
opm/common/utility/Serializer.hpp
opm/common/utility/numeric/cmp.hpp
opm/common/utility/platform_dependent/disable_warnings.h
opm/common/utility/platform_dependent/reenable_warnings.h
@@ -694,6 +698,7 @@ if(ENABLE_ECL_INPUT)
opm/input/eclipse/EclipseState/Grid/SatfuncPropertyInitializers.hpp
opm/input/eclipse/EclipseState/Grid/Fault.hpp
opm/input/eclipse/EclipseState/Grid/Box.hpp
opm/input/eclipse/EclipseState/Grid/FieldProps.hpp
opm/input/eclipse/EclipseState/Grid/FieldPropsManager.hpp
opm/input/eclipse/EclipseState/Grid/FaultFace.hpp
opm/input/eclipse/EclipseState/Grid/NNC.hpp
@@ -706,6 +711,7 @@ if(ENABLE_ECL_INPUT)
opm/input/eclipse/EclipseState/TracerConfig.hpp
opm/input/eclipse/EclipseState/MICPpara.hpp
opm/input/eclipse/EclipseState/Tables/DenT.hpp
opm/input/eclipse/EclipseState/Tables/JouleThomson.hpp
opm/input/eclipse/EclipseState/Tables/SimpleTable.hpp
opm/input/eclipse/EclipseState/Tables/StandardCond.hpp
opm/input/eclipse/EclipseState/Tables/PolyInjTable.hpp
@@ -755,6 +761,7 @@ if(ENABLE_ECL_INPUT)
opm/input/eclipse/EclipseState/Tables/WatvisctTable.hpp
opm/input/eclipse/EclipseState/Tables/TableEnums.hpp
opm/input/eclipse/EclipseState/Tables/RvvdTable.hpp
opm/input/eclipse/EclipseState/Tables/RvwvdTable.hpp
opm/input/eclipse/EclipseState/Tables/TableContainer.hpp
opm/input/eclipse/EclipseState/Tables/AqutabTable.hpp
opm/input/eclipse/EclipseState/Tables/PlyadsTable.hpp
@@ -833,10 +840,8 @@ if(ENABLE_ECL_INPUT)
opm/input/eclipse/Schedule/Well/WellEconProductionLimits.hpp
opm/input/eclipse/Schedule/Well/WellFoamProperties.hpp
opm/input/eclipse/Schedule/Well/WellBrineProperties.hpp
opm/input/eclipse/Schedule/Well/WellInjectionProperties.hpp
opm/input/eclipse/Schedule/Well/WellMICPProperties.hpp
opm/input/eclipse/Schedule/Well/WellPolymerProperties.hpp
opm/input/eclipse/Schedule/Well/WellProductionProperties.hpp
opm/input/eclipse/Schedule/Well/WellTracerProperties.hpp
opm/input/eclipse/Schedule/Well/WVFPEXP.hpp
opm/input/eclipse/Schedule/Well/WellTestConfig.hpp
@@ -931,6 +936,7 @@ if(ENABLE_ECL_OUTPUT)
opm/io/eclipse/rst/connection.hpp
opm/io/eclipse/rst/group.hpp
opm/io/eclipse/rst/header.hpp
opm/io/eclipse/rst/netbalan.hpp
opm/io/eclipse/rst/network.hpp
opm/io/eclipse/rst/segment.hpp
opm/io/eclipse/rst/state.hpp
@@ -985,6 +991,7 @@ if(ENABLE_ECL_OUTPUT)
opm/output/eclipse/WriteRPT.hpp
opm/output/eclipse/WriteRestartHelpers.hpp
opm/output/OutputWriter.hpp
opm/utility/CopyablePtr.hpp
opm/utility/EModel.hpp
)
endif()

View File

@@ -59,16 +59,6 @@ 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)
@@ -104,8 +94,6 @@ if(HAVE_OPM_TESTS)
${OPM_TESTS_ROOT}/spe9/SPE9_CP_GROUP.DATA
${OPM_TESTS_ROOT}/spe9/SPE9_CP_SHORT.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

View File

@@ -11,6 +11,7 @@ set(genkw_SOURCES src/opm/json/JsonObject.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
@@ -51,67 +52,20 @@ set( genkw_argv keyword_list.argv
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)
@@ -119,8 +73,6 @@ 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}
@@ -129,5 +81,5 @@ add_custom_command( OUTPUT
# 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

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

@@ -34,16 +34,18 @@ int main(void){
if (QUADMATH_FOUND)
set(QUADMATH_LIBRARIES "quadmath")
set(HAVE_QUAD "${QUADMATH_FOUND}")
add_library(QuadMath::QuadMath INTERFACE IMPORTED)
set_target_properties(QuadMath::QuadMath PROPERTIES
INTERFACE_LINK_LIBRARIES quadmath
INTERFACE_COMPILE_DEFINITIONS _GLIBCXX_USE_FLOAT128
INTERFACE_COMPILE_OPTIONS $<$<CXX_COMPILER_ID:GNU>:-fext-numeric-literals>)
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

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

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

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

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

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

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.

View File

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

View File

@@ -19,6 +19,8 @@
#include <opm/output/eclipse/EclipseIO.hpp>
#include <opm/input/eclipse/Deck/Deck.hpp>
#include <opm/input/eclipse/Parser/Parser.hpp>
#include <opm/input/eclipse/Parser/ParseContext.hpp>
#include <opm/input/eclipse/Parser/ErrorGuard.hpp>

View File

@@ -28,10 +28,6 @@
#include <opm/input/eclipse/Parser/ParseContext.hpp>
#include <opm/input/eclipse/Parser/ErrorGuard.hpp>
#include <opm/input/eclipse/Deck/Deck.hpp>
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
#include <opm/input/eclipse/Schedule/Schedule.hpp>
struct keyword {

View File

@@ -22,6 +22,9 @@
#include <iostream>
#include <getopt.h>
#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>
@@ -29,7 +32,6 @@
#include <opm/input/eclipse/Parser/ErrorGuard.hpp>
#include <opm/input/eclipse/Parser/ParseContext.hpp>
#include <opm/input/eclipse/Parser/InputErrorAction.hpp>
#include <opm/input/eclipse/Deck/Deck.hpp>
namespace fs = std::filesystem;

View File

@@ -20,6 +20,7 @@
#include <filesystem>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <chrono>
#include <sstream>
@@ -28,7 +29,6 @@
#include <opm/input/eclipse/Parser/ErrorGuard.hpp>
#include <opm/input/eclipse/Deck/Deck.hpp>
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
#include <opm/input/eclipse/Schedule/Schedule.hpp>
#include <opm/input/eclipse/Python/Python.hpp>

View File

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

View File

@@ -6,12 +6,8 @@
#include <map>
#include <string>
#include <opm/input/eclipse/Parser/ErrorGuard.hpp>
#include <opm/input/eclipse/Deck/Deck.hpp>
#include <opm/input/eclipse/Schedule/SummaryState.hpp>
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
#include <opm/input/eclipse/Schedule/Schedule.hpp>
#include <opm/input/eclipse/Schedule/Action/State.hpp>
@@ -27,7 +23,6 @@ class EclipseIO;
class ParseContext;
class Parser;
class Python;
class SummaryState;
class UDQState;
class WellTestState;

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

@@ -22,6 +22,7 @@
#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

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

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

View File

@@ -21,9 +21,9 @@
#define DECK_HPP
#include <functional>
#include <iosfwd>
#include <map>
#include <memory>
#include <ostream>
#include <optional>
#include <vector>
#include <string>
@@ -69,7 +69,7 @@ namespace Opm {
Deck( const Deck& );
Deck( Deck&& );
static Deck serializeObject();
static Deck serializationTestObject();
Deck& operator=(const Deck& rhs);
bool operator==(const Deck& data) const;
@@ -116,8 +116,8 @@ namespace Opm {
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);

View File

@@ -23,7 +23,7 @@
#include <string>
#include <vector>
#include <memory>
#include <ostream>
#include <iosfwd>
#include <opm/input/eclipse/Units/Dimension.hpp>
#include <opm/input/eclipse/Utility/Typetools.hpp>
@@ -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;
@@ -140,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

@@ -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();
@@ -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,7 +23,7 @@
#include <string>
#include <vector>
#include <memory>
#include <ostream>
#include <iosfwd>
#include <opm/input/eclipse/Deck/DeckItem.hpp>
@@ -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 );
@@ -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/input/eclipse/Deck/Deck.hpp>
#include <opm/input/eclipse/Deck/DeckView.hpp>
namespace Opm {
class Deck;
enum class Section {
RUNSPEC,
GRID,

View File

@@ -25,7 +25,7 @@
#include <unordered_set>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <iosfwd>
#include <fmt/format.h>
#include <opm/input/eclipse/Deck/DeckKeyword.hpp>

View File

@@ -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,7 +88,7 @@ public:
serializer(numeric_value);
serializer(double_value);
serializer(string_value);
dim.serializeOp(serializer);
serializer(dim);
}
void operator*=(double rhs);

View File

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

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

@@ -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);
}

View File

@@ -69,8 +69,8 @@ namespace Opm {
template<class Serializer>
void serializeOp(Serializer& serializer) {
serializer(this->id_);
serializer.vector(this->cells_);
serializer.vector(this->connections_);
serializer(this->cells_);
serializer(this->connections_);
}
private:

View File

@@ -34,7 +34,7 @@ namespace Opm {
explicit EclipseConfig(const Deck& deck);
EclipseConfig(const InitConfig& initConfig, const IOConfig& io_conf);
static EclipseConfig serializeObject();
static EclipseConfig serializationTestObject();
InitConfig& init();
IOConfig& io();
@@ -46,8 +46,8 @@ namespace Opm {
template<class Serializer>
void serializeOp(Serializer& serializer)
{
m_initConfig.serializeOp(serializer);
io_config.serializeOp(serializer);
serializer(m_initConfig);
serializer(io_config);
}
private:

View File

@@ -116,20 +116,21 @@ namespace Opm {
template<class Serializer>
void serializeOp(Serializer& serializer)
{
// FieldPropsManager is handled otherwise, do not add
m_tables.serializeOp(serializer);
m_runspec.serializeOp(serializer);
m_eclipseConfig.serializeOp(serializer);
m_deckUnitSystem.serializeOp(serializer);
m_inputNnc.serializeOp(serializer);
m_gridDims.serializeOp(serializer);
aquifer_config.serializeOp(serializer);
m_simulationConfig.serializeOp(serializer);
m_transMult.serializeOp(serializer);
m_faults.serializeOp(serializer);
// FieldPropsManager is handled through a different mechanism.
// Do not add the member (i.e., field_props) to this list.
serializer(m_tables);
serializer(m_runspec);
serializer(m_eclipseConfig);
serializer(m_deckUnitSystem);
serializer(m_inputNnc);
serializer(m_gridDims);
serializer(m_simulationConfig);
serializer(aquifer_config);
serializer(m_transMult);
serializer(m_faults);
serializer(m_title);
tracer_config.serializeOp(serializer);
m_micppara.serializeOp(serializer);
serializer(tracer_config);
serializer(m_micppara);
}
static bool rst_cmp(const EclipseState& full_state, const EclipseState& rst_state);
@@ -137,6 +138,9 @@ namespace Opm {
private:
void initIOConfigPostSchedule(const Deck& deck);
void assignRunTitle(const Deck& deck);
void reportNumberOfActivePhases() const;
void conveyNumericalAquiferEffects();
void applyMULTXYZ();
void initFaults(const Deck& deck);
void initPara(const Deck& deck);
@@ -155,14 +159,14 @@ namespace Opm {
NNC m_inputNnc;
GridDims m_gridDims;
FieldPropsManager field_props;
AquiferConfig aquifer_config;
SimulationConfig m_simulationConfig;
AquiferConfig aquifer_config;
TransMult m_transMult;
FaultCollection m_faults;
std::string m_title;
TracerConfig tracer_config;
MICPpara m_micppara;
std::string m_title{};
FaultCollection m_faults{};
};
} // namespace Opm

View File

@@ -30,7 +30,7 @@ class EndpointScaling {
EndpointScaling() noexcept = default;
explicit EndpointScaling( const Deck& );
static EndpointScaling serializeObject();
static EndpointScaling serializationTestObject();
/* true if endpoint scaling is enabled, otherwise false */
operator bool() const noexcept;

View File

@@ -17,61 +17,75 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef BOX_HPP_
#define BOX_HPP_
#include <opm/input/eclipse/EclipseState/Grid/GridDims.hpp>
#include <array>
#include <cstddef>
#include <limits>
#include <functional>
#include <vector>
namespace Opm {
class DeckRecord;
class EclipseGrid;
}
class Box {
namespace Opm
{
class Box
{
public:
using IsActive = std::function<bool(const std::size_t globalIdx)>;
using ActiveIdx = std::function<std::size_t(const std::size_t globalIdx)>;
struct cell_index {
struct cell_index
{
std::size_t global_index;
std::size_t active_index;
std::size_t data_index;
cell_index(std::size_t g,std::size_t a, std::size_t d) :
global_index(g),
active_index(a),
data_index(d)
cell_index(std::size_t g,std::size_t a, std::size_t d)
: global_index(g)
, active_index(a)
, data_index(d)
{}
/*
This constructor should is used by the global_index_list() member
which will return a list of *all* the cells in the box. In this
case the active_index will be set to the global_index. This is a
hack to simplify the treatment of global fields in the FieldProps
implementation.
*/
cell_index(std::size_t g, std::size_t d) :
global_index(g),
active_index(g),
data_index(d)
// This constructor should is used by the global_index_list() member
// which will return a list of *all* the cells in the box. In this
// case the active_index will be set to the global_index. This is a
// hack to simplify the treatment of global fields in the FieldProps
// implementation.
cell_index(std::size_t g, std::size_t d)
: global_index(g)
, active_index(g)
, data_index(d)
{}
};
explicit Box(const EclipseGrid& grid);
Box(const EclipseGrid& grid , int i1 , int i2 , int j1 , int j2 , int k1 , int k2);
explicit Box(const GridDims& gridDims,
IsActive isActive,
ActiveIdx activeIdx);
Box(const GridDims& gridDims,
IsActive isActive,
ActiveIdx activeIdx,
int i1, int i2,
int j1, int j2,
int k1, int k2);
void update(const DeckRecord& deckRecord);
void reset();
size_t size() const;
bool isGlobal() const;
size_t getDim(size_t idim) const;
const std::vector<cell_index>& index_list() const;
const std::vector<Box::cell_index>& global_index_list() const;
bool equal(const Box& other) const;
bool isGlobal() const;
std::size_t size() const;
std::size_t getDim(std::size_t idim) const;
const std::vector<cell_index>& index_list() const;
const std::vector<cell_index>& global_index_list() const;
bool operator==(const Box& other) const;
bool equal(const Box& other) const;
int I1() const;
int I2() const;
@@ -81,17 +95,18 @@ namespace Opm {
int K2() const;
private:
void init(int i1, int i2, int j1, int j2, int k1, int k2);
void initIndexList();
const EclipseGrid& grid;
size_t m_stride[3];
size_t m_dims[3] = { 0, 0, 0 };
size_t m_offset[3];
GridDims m_globalGridDims_{};
IsActive m_globalIsActive_{};
ActiveIdx m_globalActiveIdx_{};
std::array<std::size_t, 3> m_dims{};
std::array<std::size_t, 3> m_offset{};
bool m_isGlobal;
std::vector<cell_index> m_active_index_list;
std::vector<cell_index> m_global_index_list;
void init(int i1, int i2, int j1, int j2, int k1, int k2);
void initIndexList();
int lower(int dim) const;
int upper(int dim) const;
};

View File

@@ -17,15 +17,14 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef BOXMANAGER_HPP_
#define BOXMANAGER_HPP_
#include <vector>
#include <memory>
#include <opm/input/eclipse/EclipseState/Grid/Box.hpp>
#include <opm/input/eclipse/EclipseState/Grid/EclipseGrid.hpp>
#include <opm/input/eclipse/EclipseState/Grid/GridDims.hpp>
#include <memory>
#include <vector>
/*
This class implements a simple book keeping system for the current
@@ -52,9 +51,12 @@
namespace Opm {
class BoxManager {
class BoxManager
{
public:
BoxManager(const EclipseGrid& grid);
explicit BoxManager(const GridDims& gridDims,
Box::IsActive isActive,
Box::ActiveIdx activeIdx);
void setInputBox( int i1,int i2 , int j1 , int j2 , int k1 , int k2);
void setKeywordBox( int i1,int i2 , int j1 , int j2 , int k1 , int k2);
@@ -67,12 +69,20 @@ namespace Opm {
const std::vector<Box::cell_index>& index_list() const;
private:
const EclipseGrid& grid;
GridDims gridDims_{};
Box::IsActive isActive_{};
Box::ActiveIdx activeIdx_{};
std::unique_ptr<Box> m_globalBox;
std::unique_ptr<Box> m_inputBox;
std::unique_ptr<Box> m_keywordBox;
std::unique_ptr<Box>
makeBox(const int i1, const int i2,
const int j1, const int j2,
const int k1, const int k2) const;
};
}
#endif
#endif // BOXMANAGER_HPP_

View File

@@ -60,12 +60,12 @@ namespace Opm {
These constructors will make a copy of the src grid, with
zcorn and or actnum have been adjustments.
*/
EclipseGrid(const EclipseGrid& src) = default;
EclipseGrid(const EclipseGrid& src, const std::vector<int>& actnum);
EclipseGrid(const EclipseGrid& src, const double* zcorn, const std::vector<int>& actnum);
EclipseGrid(size_t nx, size_t ny, size_t nz,
double dx = 1.0, double dy = 1.0, double dz = 1.0);
explicit EclipseGrid(const GridDims& gd);
EclipseGrid(const std::array<int, 3>& dims ,
const std::vector<double>& coord ,
@@ -208,6 +208,17 @@ namespace Opm {
void resetACTNUM( const std::vector<int>& actnum);
bool equal(const EclipseGrid& other) const;
static bool hasDVDEPTHZKeywords(const Deck&);
/*
For ALugrid we can *only* use the keyword <DXV, DXYV, DZV, DEPTHZ> so to
initialize a Regular Cartesian Grid; further we need equidistant mesh
spacing in each direction to initialize ALuGrid (mandatory for
mesh refinement!).
*/
static bool hasEqualDVDEPTHZ(const Deck&);
static bool allEqual(const std::vector<double> &v);
private:
std::vector<double> m_minpvVector;
@@ -260,11 +271,10 @@ namespace Opm {
void initCartesianGrid(const Deck&);
void initDTOPSGrid(const Deck&);
void initDVDEPTHZGrid(const Deck&);
void initGrid(const Deck&);
void initGrid(const Deck&, const int* actnum);
void initCornerPointGrid(const Deck&);
void assertCornerPointKeywords(const Deck&);
static bool hasDVDEPTHZKeywords(const Deck&);
static bool hasDTOPSKeywords(const Deck&);
static void assertVectorSize(const std::vector<double>& vector, size_t expectedSize, const std::string& msg);

View File

@@ -28,12 +28,13 @@ namespace Opm {
namespace FaceDir {
enum DirEnum {
XPlus = 1,
XMinus = 2,
YPlus = 4,
YMinus = 8,
ZPlus = 16,
ZMinus = 32
Unknown = 0,
XPlus = 1,
XMinus = 2,
YPlus = 4,
YMinus = 8,
ZPlus = 16,
ZMinus = 32
};
/**
The MULTREGTScanner will use these values as bitmaps;
@@ -43,6 +44,9 @@ namespace Opm {
DirEnum FromString(const std::string& stringValue);
int FromMULTREGTString(const std::string& stringValue);
DirEnum FromIntersectionIndex(int idx);
const std::string toString(DirEnum dir);
}
}

View File

@@ -35,7 +35,7 @@ public:
Fault() = default;
explicit Fault(const std::string& faultName);
static Fault serializeObject();
static Fault serializationTestObject();
const std::string& getName() const;
void setTransMult(double transMult);
@@ -52,7 +52,7 @@ public:
{
serializer(m_name);
serializer(m_transMult);
serializer.vector(m_faceList);
serializer(m_faceList);
}
private:

View File

@@ -37,7 +37,7 @@ public:
FaultCollection();
FaultCollection(const GRIDSection& gridSection, const GridDims& grid);
static FaultCollection serializeObject();
static FaultCollection serializationTestObject();
size_t size() const;
bool hasFault(const std::string& faultName) const;
@@ -55,14 +55,14 @@ public:
template<class Serializer>
void serializeOp(Serializer& serializer)
{
m_faults.serializeOp(serializer);
serializer(m_faults);
}
private:
void addFaultFaces(const GridDims& grid,
const DeckRecord& faultRecord,
const std::string& faultName);
OrderedMap<std::string, Fault> m_faults;
OrderedMap<Fault, 8> m_faults;
};
}

View File

@@ -36,7 +36,7 @@ public:
size_t K1 , size_t K2,
FaceDir::DirEnum faceDir);
static FaultFace serializeObject();
static FaultFace serializationTestObject();
std::vector<size_t>::const_iterator begin() const;
std::vector<size_t>::const_iterator end() const;

View File

@@ -243,7 +243,11 @@ static const std::unordered_map<std::string, keyword_info<int>> int_keywords = {
{"PVTNUM", keyword_info<int>{}.init(1)},
{"SATNUM", keyword_info<int>{}.init(1)},
{"LWSLTNUM", keyword_info<int>{}},
{"ROCKNUM", keyword_info<int>{}}};
{"ROCKNUM", keyword_info<int>{}},
{"KRNUMX", keyword_info<int>{}},
{"KRNUMY", keyword_info<int>{}},
{"KRNUMZ", keyword_info<int>{}},
};
}
namespace SOLUTION {
@@ -377,8 +381,11 @@ public:
/// Normal constructor for FieldProps.
FieldProps(const Deck& deck, const Phases& phases, const EclipseGrid& grid, const TableManager& table_arg);
/// Special case constructor used to process ACTNUM only.
FieldProps(const Deck& deck, const EclipseGrid& grid);
void reset_actnum(const std::vector<int>& actnum);
void apply_numerical_aquifers(const NumericalAquifers& numerical_aquifers);
@@ -386,6 +393,7 @@ public:
const std::string& default_region() const;
std::vector<int> actnum();
const std::vector<int>& actnumRaw() const;
template <typename T>
static bool supported(const std::string& keyword);
@@ -498,12 +506,17 @@ public:
void handle_schedule_keywords(const std::vector<DeckKeyword>& keywords);
bool tran_active(const std::string& keyword) const;
void apply_tran(const std::string& keyword, std::vector<double>& data);
std::vector<char> serialize_tran() const;
void deserialize_tran(const std::vector<char>& buffer);
bool operator==(const FieldProps& other) const;
static bool rst_cmp(const FieldProps& full_arg, const FieldProps& rst_arg);
const Fieldprops::TranMap& getTran() const
{
return tran;
}
private:
void scanGRIDSection(const GRIDSection& grid_section);
void scanGRIDSectionOnlyACTNUM(const GRIDSection& grid_section);
void scanEDITSection(const EDITSection& edit_section);
void scanPROPSSection(const PROPSSection& props_section);
void scanREGIONSSection(const REGIONSSection& regions_section);
@@ -561,7 +574,7 @@ private:
std::unordered_map<std::string, Fieldprops::FieldData<int>> int_data;
std::unordered_map<std::string, Fieldprops::FieldData<double>> double_data;
std::unordered_map<std::string, Fieldprops::TranCalculator> tran;
Fieldprops::TranMap tran;
};
}

View File

@@ -43,6 +43,8 @@ public:
// The default constructed fieldProps object is **NOT** usable
FieldPropsManager() = default;
FieldPropsManager(const Deck& deck, const Phases& ph, const EclipseGrid& grid, const TableManager& tables);
virtual ~FieldPropsManager() = default;
virtual void reset_actnum(const std::vector<int>& actnum);
const std::string& default_region() const;
virtual std::vector<int> actnum() const;
@@ -228,16 +230,8 @@ public:
void apply_numerical_aquifers(const NumericalAquifers& aquifers);
const Fieldprops::TranMap& getTran() const;
/*
When using MPI the FieldPropsManager is typically only assembled on the
root node and then distributed to the other nodes afterwards. These
methods are support methods for that, the real data used by the
transmissibility calculators is in the form of custom 3D fields, they are
distributed the same way the rest of the 3D fields are distributed.
*/
virtual std::vector<char> serialize_tran() const;
virtual void deserialize_tran(const std::vector<char>& buffer);
private:
/*
Return the keyword values as a std::vector<>. All elements in the return
@@ -274,14 +268,9 @@ private:
template <typename T>
std::vector<T> get_global(const std::string& keyword) const;
std::shared_ptr<FieldProps> fp;
};
void deserialize_tran(std::unordered_map<std::string, Fieldprops::TranCalculator>& tran,
const std::vector<char>& buffer);
template<class MapType>
void apply_tran(const std::unordered_map<std::string, Fieldprops::TranCalculator>& tran,
const MapType& double_data,

View File

@@ -21,8 +21,7 @@
#define OPM_PARSER_GRIDDIMS_HPP
#include <array>
#include <stdexcept>
#include <vector>
#include <cstddef>
namespace Opm {
class Deck;
@@ -31,32 +30,30 @@ namespace Opm {
class GridDims
{
public:
GridDims();
explicit GridDims(std::array<int, 3> xyz);
GridDims(size_t nx, size_t ny, size_t nz);
explicit GridDims(const std::array<int, 3>& xyz);
GridDims(std::size_t nx, std::size_t ny, std::size_t nz);
static GridDims serializeObject();
static GridDims serializationTestObject();
explicit GridDims(const Deck& deck);
size_t getNX() const;
std::size_t getNX() const;
std::size_t getNY() const;
std::size_t getNZ() const;
std::size_t operator[](int dim) const;
size_t getNY() const;
size_t getNZ() const;
size_t operator[](int dim) const;
std::array<int, 3> getNXYZ() const;
const std::array<int, 3> getNXYZ() const;
std::size_t getGlobalIndex(std::size_t i, std::size_t j, std::size_t k) const;
size_t getGlobalIndex(size_t i, size_t j, size_t k) const;
std::array<int, 3> getIJK(std::size_t globalIndex) const;
const std::array<int, 3> getIJK(size_t globalIndex) const;
std::size_t getCartesianSize() const;
size_t getCartesianSize() const;
void assertGlobalIndex(std::size_t globalIndex) const;
void assertGlobalIndex(size_t globalIndex) const;
void assertIJK(size_t i, size_t j, size_t k) const;
void assertIJK(std::size_t i, std::size_t j, std::size_t k) const;
bool operator==(const GridDims& data) const;
@@ -69,9 +66,9 @@ namespace Opm {
}
protected:
size_t m_nx;
size_t m_ny;
size_t m_nz;
std::size_t m_nx;
std::size_t m_ny;
std::size_t m_nz;
private:
void init(const DeckKeyword& keyword);

View File

@@ -23,13 +23,12 @@
#include <opm/input/eclipse/EclipseState/Grid/FaceDir.hpp>
namespace Opm {
class FieldPropsManager;
class DeckRecord;
class DeckKeyword;
class FieldPropsManager;
class GridDims;
namespace MULTREGT {
@@ -93,7 +92,7 @@ namespace Opm {
const FieldPropsManager* fp_arg,
const std::vector< const DeckKeyword* >& keywords);
static MULTREGTScanner serializeObject();
static MULTREGTScanner serializationTestObject();
double getRegionMultiplier(size_t globalCellIdx1, size_t globalCellIdx2, FaceDir::DirEnum faceDir) const;
@@ -106,7 +105,7 @@ namespace Opm {
serializer(nx);
serializer(ny);
serializer(nz);
serializer.vector(m_records);
serializer(m_records);
ExternalSearchMap searchMap = getSearchMap();
serializer(searchMap);
if (m_searchMap.empty())

View File

@@ -106,7 +106,7 @@ public:
/// Construct from input deck.
NNC(const EclipseGrid& grid, const Deck& deck);
static NNC serializeObject();
static NNC serializationTestObject();
bool addNNC(const size_t cell1, const size_t cell2, const double trans);
const std::vector<NNCdata>& input() const { return m_input; }
@@ -120,8 +120,8 @@ public:
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.vector(m_input);
serializer.vector(m_edit);
serializer(m_input);
serializer(m_edit);
serializer(m_nnc_location);
serializer(m_edit_location);
}

View File

@@ -20,6 +20,7 @@
#define TRAN_CALCULATOR_HPP
#include <string>
#include <unordered_map>
#include <vector>
namespace Opm
@@ -50,6 +51,13 @@ public:
return this->op == other.op &&
this->field == other.field;
}
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(op);
serializer(field);
}
};
@@ -57,6 +65,8 @@ public:
m_name(name_arg)
{}
TranCalculator() = default;
std::string next_name() const {
return this->m_name + std::to_string( this->actions.size() );
}
@@ -88,11 +98,27 @@ public:
this->actions == other.actions;
}
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(m_name);
serializer(actions);
}
static TranCalculator serializationTestObject()
{
TranCalculator tran("test");
tran.add_action(ScalarOperation::MIN, "FGOP");
return tran;
}
private:
std::string m_name;
std::vector<TranAction> actions;
};
using TranMap = std::unordered_map<std::string, TranCalculator>;
} // namespace Fieldprops
} // end namespace Opm
#endif // TRAN_CALCULATOR_HPP

View File

@@ -50,7 +50,7 @@ namespace Opm {
TransMult() = default;
TransMult(const GridDims& dims, const Deck& deck, const FieldPropsManager& fp);
static TransMult serializeObject();
static TransMult serializationTestObject();
double getMultiplier(size_t globalIndex, FaceDir::DirEnum faceDir) const;
double getMultiplier(size_t i , size_t j , size_t k, FaceDir::DirEnum faceDir) const;
@@ -67,10 +67,9 @@ namespace Opm {
serializer(m_nx);
serializer(m_ny);
serializer(m_nz);
// map used to avoid explicit instances with FaceDir::DirEnum in serializer
serializer.template map<decltype(m_trans),false>(m_trans);
serializer.template map<decltype(m_names),false>(m_names);
m_multregtScanner.serializeOp(serializer);
serializer(m_trans);
serializer(m_names);
serializer(m_multregtScanner);
}
private:

View File

@@ -152,7 +152,7 @@ namespace Opm {
explicit IOConfig( const Deck& );
explicit IOConfig( const std::string& input_path );
static IOConfig serializeObject();
static IOConfig serializationTestObject();
void setEclCompatibleRST(bool ecl_rst);
bool getEclCompatibleRST() const;

View File

@@ -18,10 +18,11 @@ namespace Opm {
bool liveOilInitConstantRs() const;
bool wetGasInitConstantRv() const;
int initializationTargetAccuracy() const;
bool humidGasInitConstantRvw() const;
EquilRecord();
EquilRecord( double datum_depth_arg, double datum_depth_pc_arg, double woc_depth, double woc_pc, double goc_depth, double goc_pc, bool live_oil_init, bool wet_gas_init, int target_accuracy);
EquilRecord( double datum_depth_arg, double datum_depth_pc_arg, double woc_depth, double woc_pc, double goc_depth, double goc_pc, bool live_oil_init, bool wet_gas_init, int target_accuracy, bool humid_gas_init);
bool operator==(const EquilRecord& data) const;
@@ -37,6 +38,7 @@ namespace Opm {
serializer(live_oil_init_proc);
serializer(wet_gas_init_proc);
serializer(init_target_accuracy);
serializer(humid_gas_init_proc);
}
private:
@@ -50,6 +52,7 @@ namespace Opm {
bool live_oil_init_proc;
bool wet_gas_init_proc;
int init_target_accuracy;
bool humid_gas_init_proc;
};
class Equil {
@@ -59,7 +62,7 @@ namespace Opm {
Equil() = default;
explicit Equil( const DeckKeyword& );
static Equil serializeObject();
static Equil serializationTestObject();
const EquilRecord& getRecord( size_t id ) const;
@@ -74,7 +77,7 @@ namespace Opm {
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.vector(m_records);
serializer(m_records);
}
private:

View File

@@ -39,7 +39,7 @@ public:
FoamData(const DeckRecord& FOAMFSC_record, const DeckRecord& FOAMROCK_record);
explicit FoamData(const DeckRecord& FOAMROCK_record);
static FoamData serializeObject();
static FoamData serializationTestObject();
double referenceSurfactantConcentration() const;
double exponent() const;
@@ -80,7 +80,7 @@ public:
FoamConfig() = default;
explicit FoamConfig(const Deck&);
static FoamConfig serializeObject();
static FoamConfig serializationTestObject();
const FoamData& getRecord(std::size_t index) const;
@@ -99,7 +99,7 @@ public:
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.vector(data_);
serializer(data_);
serializer(transport_phase_);
serializer(mobility_model_);
}

View File

@@ -35,7 +35,7 @@ namespace Opm {
InitConfig();
explicit InitConfig(const Deck& deck);
static InitConfig serializeObject();
static InitConfig serializationTestObject();
void setRestart( const std::string& root, int step);
bool restartRequested() const;
@@ -63,8 +63,8 @@ namespace Opm {
template<class Serializer>
void serializeOp(Serializer& serializer)
{
equil.serializeOp(serializer);
foamconfig.serializeOp(serializer);
serializer(equil);
serializer(foamconfig);
serializer(m_filleps);
serializer(m_gravity);
serializer(m_restartRequested);

View File

@@ -31,7 +31,7 @@ class Deck;
explicit MICPpara(const Deck& deck);
static MICPpara serializeObject()
static MICPpara serializationTestObject()
{
MICPpara mp;
mp.m_density_biofilm = 100;

View File

@@ -60,7 +60,7 @@ class Phases {
Phases( bool oil, bool gas, bool wat, bool solvent = false, bool polymer = false, bool energy = false,
bool polymw = false, bool foam = false, bool brine = false, bool zfraction = false ) noexcept;
static Phases serializeObject();
static Phases serializationTestObject();
bool active( Phase ) const noexcept;
size_t size() const noexcept;
@@ -70,13 +70,7 @@ class Phases {
template<class Serializer>
void serializeOp(Serializer& serializer)
{
if (serializer.isSerializing())
serializer(bits.to_ulong());
else {
unsigned long Bits = 0;
serializer(Bits);
bits = std::bitset<NUM_PHASES_IN_ENUM>(Bits);
}
serializer(bits);
}
private:
@@ -89,7 +83,7 @@ public:
Welldims() = default;
explicit Welldims(const Deck& deck);
static Welldims serializeObject();
static Welldims serializationTestObject();
int maxConnPerWell() const
{
@@ -167,7 +161,7 @@ public:
WellSegmentDims();
explicit WellSegmentDims(const Deck& deck);
static WellSegmentDims serializeObject();
static WellSegmentDims serializationTestObject();
int maxSegmentedWells() const
@@ -206,7 +200,7 @@ public:
NetworkDims();
explicit NetworkDims(const Deck& deck);
static NetworkDims serializeObject();
static NetworkDims serializationTestObject();
int maxNONodes() const
{
@@ -246,7 +240,7 @@ public:
AquiferDimensions();
explicit AquiferDimensions(const Deck& deck);
static AquiferDimensions serializeObject();
static AquiferDimensions serializationTestObject();
int maxAnalyticAquifers() const
{
@@ -278,7 +272,7 @@ public:
EclHysterConfig() = default;
explicit EclHysterConfig(const Deck& deck);
static EclHysterConfig serializeObject();
static EclHysterConfig serializationTestObject();
/*!
* \brief Specify whether hysteresis is enabled or not.
@@ -306,6 +300,20 @@ public:
*/
int krHysteresisModel() const;
/*!
* \brief Regularisation parameter used for Killough model.
*
* default: 0.1
*/
double modParamTrapped() const;
/*!
* \brief Curvature parameter used for capillary pressure hysteresis.
*
* default: 0.1
*/
double curvatureCapPrs() const;
bool operator==(const EclHysterConfig& data) const;
template<class Serializer>
@@ -314,6 +322,8 @@ public:
serializer(activeHyst);
serializer(pcHystMod);
serializer(krHystMod);
serializer(modParamTrappedValue);
serializer(curvatureCapPrsValue);
}
private:
@@ -321,8 +331,12 @@ private:
bool activeHyst { false };
// the capillary pressure and the relperm hysteresis models to be used
int pcHystMod { 0 };
int krHystMod { 0 };
int pcHystMod { -1 };
int krHystMod { -1 };
// regularisation parameter used for Killough model
double modParamTrappedValue { 0.1 };
// curvature parameter for capillary pressure
double curvatureCapPrsValue { 0.1 };
};
class SatFuncControls {
@@ -345,7 +359,7 @@ public:
const ThreePhaseOilKrModel model,
const KeywordFamily family);
static SatFuncControls serializeObject();
static SatFuncControls serializationTestObject();
double minimumRelpermMobilityThreshold() const
{
@@ -386,7 +400,7 @@ public:
void update(int value);
int value() const;
static Nupcol serializeObject();
static Nupcol serializationTestObject();
bool operator==(const Nupcol& data) const;
template<class Serializer>
@@ -420,7 +434,7 @@ public:
serializer(this->min_iter);
}
static Tracers serializeObject();
static Tracers serializationTestObject();
bool operator==(const Tracers& data) const;
private:
@@ -441,7 +455,7 @@ public:
Runspec() = default;
explicit Runspec( const Deck& );
static Runspec serializeObject();
static Runspec serializationTestObject();
std::time_t start_time() const noexcept;
const UDQParams& udqParams() const noexcept;
@@ -469,19 +483,19 @@ public:
void serializeOp(Serializer& serializer)
{
serializer(this->m_start_time);
active_phases.serializeOp(serializer);
m_tabdims.serializeOp(serializer);
m_regdims.serializeOp(serializer);
endscale.serializeOp(serializer);
welldims.serializeOp(serializer);
wsegdims.serializeOp(serializer);
netwrkdims.serializeOp(serializer);
aquiferdims.serializeOp(serializer);
udq_params.serializeOp(serializer);
hystpar.serializeOp(serializer);
m_actdims.serializeOp(serializer);
m_sfuncctrl.serializeOp(serializer);
m_nupcol.serializeOp(serializer);
serializer(active_phases);
serializer(m_tabdims);
serializer(m_regdims);
serializer(endscale);
serializer(welldims);
serializer(wsegdims);
serializer(netwrkdims);
serializer(aquiferdims);
serializer(udq_params);
serializer(hystpar);
serializer(m_actdims);
serializer(m_sfuncctrl);
serializer(m_nupcol);
serializer(m_co2storage);
serializer(m_micp);
}

View File

@@ -24,6 +24,7 @@
#include <cstddef>
#include <opm/input/eclipse/EclipseState/Grid/FaceDir.hpp>
#include <opm/input/eclipse/EclipseState/Grid/GridDims.hpp>
namespace Opm {
@@ -59,9 +60,9 @@ public:
double rate;
BCFace() = default;
explicit BCFace(const DeckRecord& record);
explicit BCFace(const DeckRecord& record, const GridDims& grid);
static BCFace serializeObject();
static BCFace serializationTestObject();
bool operator==(const BCFace& other) const;
@@ -85,7 +86,7 @@ public:
BCConfig() = default;
explicit BCConfig(const Deck& deck);
static BCConfig serializeObject();
static BCConfig serializationTestObject();
std::size_t size() const;
std::vector<BCFace>::const_iterator begin() const;
@@ -95,7 +96,7 @@ public:
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.vector(m_faces);
serializer(m_faces);
}
private:

View File

@@ -61,7 +61,7 @@ struct RockComp {
RockConfig();
RockConfig(const Deck& deck, const FieldPropsManager& fp);
static RockConfig serializeObject();
static RockConfig serializationTestObject();
bool active() const;
const std::vector<RockConfig::RockComp>& comp() const;
@@ -76,7 +76,7 @@ struct RockComp {
void serializeOp(Serializer& serializer)
{
serializer(m_active);
serializer.vector(m_comp);
serializer(m_comp);
serializer(num_property);
serializer(num_tables);
serializer(m_water_compaction);

View File

@@ -38,7 +38,7 @@ namespace Opm {
const Deck& deck,
const FieldPropsManager& fp);
static SimulationConfig serializeObject();
static SimulationConfig serializationTestObject();
const RockConfig& rock_config() const;
const ThresholdPressure& getThresholdPressure() const;
@@ -58,9 +58,9 @@ namespace Opm {
template<class Serializer>
void serializeOp(Serializer& serializer)
{
m_ThresholdPressure.serializeOp(serializer);
m_bcconfig.serializeOp(serializer);
m_rock_config.serializeOp(serializer);
serializer(m_ThresholdPressure);
serializer(m_bcconfig);
serializer(m_rock_config);
serializer(m_useCPR);
serializer(m_DISGAS);
serializer(m_VAPOIL);

View File

@@ -46,7 +46,7 @@ namespace Opm {
{}
//! \brief Returns an instance for serialization tests.
static ThresholdPressure serializeObject();
static ThresholdPressure serializationTestObject();
/*
The hasRegionBarrier() method checks if a threshold pressure

View File

@@ -48,7 +48,7 @@ namespace Opm {
SummaryConfigNode() = default;
explicit SummaryConfigNode(std::string keyword, const Category cat, KeywordLocation loc_arg);
static SummaryConfigNode serializeObject();
static SummaryConfigNode serializationTestObject();
SummaryConfigNode& parameterType(const Type type);
SummaryConfigNode& namedEntity(std::string name);
@@ -76,7 +76,7 @@ namespace Opm {
{
serializer(keyword_);
serializer(category_);
loc.serializeOp(serializer);
serializer(loc);
serializer(type_);
serializer(name_);
serializer(number_);
@@ -160,7 +160,7 @@ namespace Opm {
const std::set<std::string>& shortKwds,
const std::set<std::string>& smryKwds);
static SummaryConfig serializeObject();
static SummaryConfig serializationTestObject();
const_iterator begin() const;
const_iterator end() const;
@@ -206,7 +206,7 @@ namespace Opm {
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.vector(m_keywords);
serializer(m_keywords);
serializer(short_keywords);
serializer(summary_keywords);
}

View File

@@ -38,7 +38,7 @@ namespace Opm {
explicit Aqudims(const Deck& deck);
static Aqudims serializeObject()
static Aqudims serializationTestObject()
{
Aqudims result;
result.m_mxnaqn = 1;

View File

@@ -27,7 +27,7 @@ namespace Opm {
class AqutabTable : public SimpleTable {
public:
AqutabTable( const DeckItem& item );
AqutabTable( const DeckItem& item, const int tableID );
const TableColumn& getTimeColumn() const;
const TableColumn& getPressureColumn() const;

View File

@@ -26,7 +26,7 @@ namespace Opm {
class BrineDensityTable {
public:
static BrineDensityTable serializeObject();
static BrineDensityTable serializationTestObject();
void init(const Opm::DeckRecord& record);
const std::vector<double>& getBrineDensityColumn() const;

View File

@@ -34,7 +34,7 @@ namespace Opm {
ColumnSchema(const std::string& name , Table::ColumnOrderEnum order, Table::DefaultAction defaultAction);
ColumnSchema(const std::string& name , Table::ColumnOrderEnum order, double defaultValue);
static ColumnSchema serializeObject();
static ColumnSchema serializationTestObject();
const std::string& name() const;
bool validOrder( double value1 , double value2) const;

View File

@@ -52,7 +52,7 @@ namespace Opm {
DenT() = default;
explicit DenT(const DeckKeyword& keyword);
static DenT serializeObject();
static DenT serializationTestObject();
const entry& operator[](const std::size_t index) const;
bool operator==(const DenT& other) const;
@@ -61,7 +61,7 @@ namespace Opm {
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.vector(m_records);
serializer(m_records);
}
private:

View File

@@ -28,7 +28,7 @@ namespace Opm {
class EnkrvdTable : public SimpleTable {
public:
EnkrvdTable( const DeckItem& item );
EnkrvdTable( const DeckItem& item, const int tableID );
// using this method is strongly discouraged but the current endpoint scaling

View File

@@ -27,7 +27,7 @@ namespace Opm {
class EnptvdTable : public SimpleTable {
public:
EnptvdTable( const DeckItem& item );
EnptvdTable( const DeckItem& item, const int tableID );
// using this method is strongly discouraged but the current endpoint scaling
// code makes it hard to avoid

View File

@@ -42,7 +42,7 @@ namespace Opm {
m_nstrvd( nstrvd )
{ }
static Eqldims serializeObject()
static Eqldims serializationTestObject()
{
return Eqldims(1, 2, 3, 4, 5);
}

View File

@@ -1,6 +1,11 @@
#ifndef OPM_FLAT_TABLE_HPP
#define OPM_FLAT_TABLE_HPP
#include <cstddef>
#include <initializer_list>
#include <string_view>
#include <vector>
namespace Opm {
class DeckKeyword;
@@ -16,7 +21,86 @@ struct FlatTable : public std::vector< T > {
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.vector(*this);
serializer(static_cast<std::vector<T>&>(*this));
}
};
template <typename RecordType>
class FlatTableWithCopy
{
public:
FlatTableWithCopy() = default;
explicit FlatTableWithCopy(const DeckKeyword& kw,
std::string_view expect = "");
explicit FlatTableWithCopy(std::initializer_list<RecordType> records);
auto size() const { return this->table_.size(); }
bool empty() const { return this->table_.empty(); }
auto begin() const { return this->table_.begin(); }
auto end() const { return this->table_.end(); }
const RecordType& operator[](const std::size_t tableID) const
{
return this->table_[tableID];
}
const RecordType& at(const std::size_t tableID) const
{
return this->table_.at(tableID);
}
bool operator==(const FlatTableWithCopy& other) const
{
return this->table_ == other.table_;
}
template <class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(this->table_);
}
protected:
std::vector<RecordType> table_{};
};
struct GRAVITYRecord {
static constexpr std::size_t size = 3;
double oil_api;
double water_sg;
double gas_sg;
bool operator==(const GRAVITYRecord& data) const {
return this->oil_api == data.oil_api &&
this->water_sg == data.water_sg &&
this->gas_sg == data.gas_sg;
}
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(this->oil_api);
serializer(this->water_sg);
serializer(this->gas_sg);
}
};
struct GravityTable : public FlatTableWithCopy<GRAVITYRecord>
{
GravityTable() = default;
explicit GravityTable(const DeckKeyword& kw);
explicit GravityTable(std::initializer_list<GRAVITYRecord> records);
static GravityTable serializationTestObject()
{
return GravityTable({{1.0, 2.0, 3.0}});
}
template <class Serializer>
void serializeOp(Serializer& serializer)
{
FlatTableWithCopy::serializeOp(serializer);
}
};
@@ -42,43 +126,22 @@ struct DENSITYRecord {
}
};
struct DensityTable : public FlatTable< DENSITYRecord > {
using FlatTable< DENSITYRecord >::FlatTable;
struct DensityTable : public FlatTableWithCopy<DENSITYRecord>
{
DensityTable() = default;
explicit DensityTable(const DeckKeyword& kw);
explicit DensityTable(const GravityTable& gravity);
explicit DensityTable(std::initializer_list<DENSITYRecord> records);
static DensityTable serializeObject()
static DensityTable serializationTestObject()
{
return DensityTable({{1.0, 2.0, 3.0}});
}
};
struct GRAVITYRecord {
static constexpr std::size_t size = 3;
double oil_api;
double water_sg;
double gas_sg;
bool operator==(const GRAVITYRecord& data) const {
return this->oil_api == data.oil_api &&
this->water_sg == data.water_sg &&
this->gas_sg == data.gas_sg;
}
template<class Serializer>
template <class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(this->oil_api);
serializer(this->water_sg);
serializer(this->gas_sg);
}
};
struct GravityTable : public FlatTable< GRAVITYRecord > {
using FlatTable< GRAVITYRecord >::FlatTable;
static GravityTable serializeObject()
{
return GravityTable({{1.0, 2.0, 3.0}});
FlatTableWithCopy::serializeOp(serializer);
}
};
@@ -122,7 +185,7 @@ struct DiffCoeffRecord {
struct DiffCoeffTable : public FlatTable< DiffCoeffRecord > {
using FlatTable< DiffCoeffRecord >::FlatTable;
static DiffCoeffTable serializeObject()
static DiffCoeffTable serializationTestObject()
{
return DiffCoeffTable({{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0}});
}
@@ -156,13 +219,22 @@ struct PVTWRecord {
}
};
struct PvtwTable : public FlatTable< PVTWRecord > {
using FlatTable< PVTWRecord >::FlatTable;
struct PvtwTable : public FlatTableWithCopy<PVTWRecord>
{
PvtwTable() = default;
explicit PvtwTable(const DeckKeyword& kw);
explicit PvtwTable(std::initializer_list<PVTWRecord> records);
static PvtwTable serializeObject()
static PvtwTable serializationTestObject()
{
return PvtwTable({{1.0, 2.0, 3.0, 4.0, 5.0}});
}
template <class Serializer>
void serializeOp(Serializer& serializer)
{
FlatTableWithCopy::serializeOp(serializer);
}
};
struct ROCKRecord {
@@ -187,7 +259,7 @@ struct ROCKRecord {
struct RockTable : public FlatTable< ROCKRecord > {
using FlatTable< ROCKRecord >::FlatTable;
static RockTable serializeObject()
static RockTable serializationTestObject()
{
return RockTable({{1.0, 2.0}});
}
@@ -224,7 +296,7 @@ struct PVCDORecord {
struct PvcdoTable : public FlatTable< PVCDORecord > {
using FlatTable< PVCDORecord >::FlatTable;
static PvcdoTable serializeObject()
static PvcdoTable serializationTestObject()
{
return PvcdoTable({{1.0, 2.0, 3.0, 4.0, 5.0}});
}
@@ -249,7 +321,7 @@ struct PlmixparRecord {
struct PlmixparTable : public FlatTable< PlmixparRecord> {
using FlatTable< PlmixparRecord >::FlatTable;
static PlmixparTable serializeObject()
static PlmixparTable serializationTestObject()
{
return PlmixparTable({PlmixparRecord{1.0}});
}
@@ -283,7 +355,7 @@ struct PlyvmhRecord {
struct PlyvmhTable : public FlatTable<PlyvmhRecord> {
using FlatTable< PlyvmhRecord >::FlatTable;
static PlyvmhTable serializeObject()
static PlyvmhTable serializationTestObject()
{
return PlyvmhTable({{1.0, 2.0, 3.0, 4.0}});
}
@@ -308,7 +380,7 @@ struct ShrateRecord {
struct ShrateTable : public FlatTable<ShrateRecord> {
using FlatTable< ShrateRecord >::FlatTable;
static ShrateTable serializeObject()
static ShrateTable serializationTestObject()
{
return ShrateTable({ShrateRecord{1.0}});
}
@@ -333,7 +405,7 @@ struct Stone1exRecord {
struct Stone1exTable : public FlatTable<Stone1exRecord> {
using FlatTable< Stone1exRecord >::FlatTable;
static Stone1exTable serializeObject()
static Stone1exTable serializationTestObject()
{
return Stone1exTable({Stone1exRecord{1.0}});
}
@@ -361,7 +433,7 @@ struct TlmixparRecord {
struct TlmixparTable : public FlatTable< TlmixparRecord> {
using FlatTable< TlmixparRecord >::FlatTable;
static TlmixparTable serializeObject()
static TlmixparTable serializationTestObject()
{
return TlmixparTable({{1.0, 2.0}});
}
@@ -389,7 +461,7 @@ struct VISCREFRecord {
struct ViscrefTable : public FlatTable< VISCREFRecord > {
using FlatTable< VISCREFRecord >::FlatTable;
static ViscrefTable serializeObject()
static ViscrefTable serializationTestObject()
{
return ViscrefTable({{1.0, 2.0}});
}
@@ -420,12 +492,95 @@ struct WATDENTRecord {
struct WatdentTable : public FlatTable< WATDENTRecord > {
using FlatTable< WATDENTRecord >::FlatTable;
static WatdentTable serializeObject()
static WatdentTable serializationTestObject()
{
return WatdentTable({{1.0, 2.0, 3.0}});
}
};
struct SatFuncLETRecord {
static constexpr std::size_t size = 17;
double s1_residual;
double s1_critical;
double l1_relperm;
double e1_relperm;
double t1_relperm;
double krt1_relperm;
double s2_residual;
double s2_critical;
double l2_relperm;
double e2_relperm;
double t2_relperm;
double krt2_relperm;
double l_pc;
double e_pc;
double t_pc;
double pcir_pc;
double pct_pc;
bool operator==(const SatFuncLETRecord& data) const {
return s1_residual == data.s1_residual &&
s1_critical == data.s1_critical &&
l1_relperm == data.l1_relperm &&
e1_relperm == data.e1_relperm &&
t1_relperm == data.t1_relperm &&
krt1_relperm == data.krt1_relperm &&
s2_residual == data.s2_residual &&
s2_critical == data.s2_critical &&
l2_relperm == data.l2_relperm &&
e2_relperm == data.e2_relperm &&
t2_relperm == data.t2_relperm &&
krt2_relperm == data.krt2_relperm &&
l_pc == data.l_pc &&
e_pc == data.e_pc &&
t_pc == data.t_pc &&
pcir_pc == data.pcir_pc &&
pct_pc == data.pct_pc;
}
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(s1_residual);
serializer(s1_critical);
serializer(l1_relperm);
serializer(e1_relperm);
serializer(t1_relperm);
serializer(krt1_relperm);
serializer(s2_residual);
serializer(s2_critical);
serializer(l2_relperm);
serializer(e2_relperm);
serializer(t2_relperm);
serializer(krt2_relperm);
serializer(l_pc);
serializer(e_pc);
serializer(t_pc);
serializer(pcir_pc);
serializer(pct_pc);
}
};
struct SwofletTable : public FlatTable< SatFuncLETRecord > {
using FlatTable< SatFuncLETRecord >::FlatTable;
static SwofletTable serializationTestObject()
{
return SwofletTable({{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0}});
}
};
struct SgofletTable : public FlatTable< SatFuncLETRecord > {
using FlatTable< SatFuncLETRecord >::FlatTable;
static SgofletTable serializationTestObject()
{
return SgofletTable({{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0}});
}
};
}
#endif //OPM_FLAT_TABLE_HPP

View File

@@ -28,7 +28,7 @@ namespace Opm {
class FoamadsTable : public SimpleTable {
public:
FoamadsTable( const DeckItem& item );
FoamadsTable( const DeckItem& item, const int tableID );
const TableColumn& getFoamConcentrationColumn() const;
const TableColumn& getAdsorbedFoamColumn() const;

View File

@@ -29,7 +29,7 @@ namespace Opm {
class FoammobTable : public SimpleTable {
public:
FoammobTable( const DeckItem& item );
FoammobTable( const DeckItem& item, const int tableID );
const TableColumn& getFoamConcentrationColumn() const;
const TableColumn& getMobilityMultiplierColumn() const;

View File

@@ -27,7 +27,7 @@ namespace Opm {
class ImkrvdTable : public SimpleTable {
public:
ImkrvdTable( const DeckItem& item );
ImkrvdTable( const DeckItem& item, const int tableID );
/*!
* \brief The datum depth for the remaining columns

View File

@@ -29,7 +29,7 @@ namespace Opm {
class ImptvdTable : public SimpleTable {
public:
ImptvdTable( const DeckItem& item );
ImptvdTable( const DeckItem& item, const int tableID );
const TableColumn& getDepthColumn() const;

View File

@@ -34,7 +34,7 @@ public:
JFunc();
explicit JFunc(const Deck& deck);
static JFunc serializeObject();
static JFunc serializationTestObject();
double alphaFactor() const;
double betaFactor() const;

View File

@@ -0,0 +1,70 @@
/*
Copyright (C) 2020 by Equinor
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_PARSER_JOULETHOMSON_HPP
#define OPM_PARSER_JOULETHOMSON_HPP
#include <cstddef>
#include <vector>
namespace Opm {
class DeckKeyword;
class DeckRecord;
class JouleThomson {
public:
struct entry {
double P0;
double C1;
entry() = default;
entry(double P0_, double C1_);
explicit entry(const DeckRecord& record);
bool operator==(const entry& other) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(P0);
serializer(C1);
}
};
JouleThomson() = default;
explicit JouleThomson(const DeckKeyword& keyword);
static JouleThomson serializationTestObject();
const entry& operator[](const std::size_t index) const;
bool operator==(const JouleThomson& other) const;
std::size_t size() const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(m_records);
}
private:
std::vector<entry> m_records;
};
}
#endif

View File

@@ -28,7 +28,7 @@ namespace Opm {
class MiscTable : public SimpleTable {
public:
explicit MiscTable( const DeckItem& item );
MiscTable( const DeckItem& item, const int tableID );
const TableColumn& getSolventFractionColumn() const;
const TableColumn& getMiscibilityColumn() const;

View File

@@ -28,7 +28,7 @@ namespace Opm {
class MsfnTable : public SimpleTable {
public:
explicit MsfnTable( const DeckItem& item );
MsfnTable( const DeckItem& item, const int tableID );
const TableColumn& getGasPhaseFractionColumn() const;
const TableColumn& getGasSolventRelpermMultiplierColumn() const;

View File

@@ -27,7 +27,7 @@ namespace Opm {
class OilvisctTable : public SimpleTable {
public:
OilvisctTable( const DeckItem& item );
OilvisctTable( const DeckItem& item, const int tableID );
const TableColumn& getTemperatureColumn() const;
const TableColumn& getOilViscosityColumn() const;

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