Compare commits

...

976 Commits

Author SHA1 Message Date
Arne Morten Kvarving
0a1691fbba bump to final 2021-05-04 10:08:35 +02:00
Arne Morten Kvarving
049394497b bump packaging versions 2021-04-27 09:55:02 +02:00
Arne Morten Kvarving
ca27588d5a fix cherry-picking error 2021-04-26 14:44:58 +02:00
Arne Morten Kvarving
678676484b fixed: missing member initialization
if deck has no rockcomp keyword, variable is not written
2021-04-26 13:35:03 +02:00
Joakim Hove
1415d849de Merge pull request #2434 from akva2/fix_serialize_valgrind
Fix some valgrind errors in test_ParallelRestart
2021-04-26 12:42:45 +02:00
Tor Harald Sandve
7f24108d09 Raise OPM Version to 2021.04-rc2 2021-04-20 10:30:59 +02:00
Bård Skaflestad
bcc96eda2c Merge pull request #2432 from goncalvesmachadoc/welltemp_output
Fix Well Temperature Output
2021-04-19 08:37:29 +02:00
Joakim Hove
75b81a16a5 Merge pull request #2429 from blattms/fix-compile-g++10.2
Include stdexcept header to fix compilation with g++-10
2021-04-19 08:37:23 +02:00
Joakim Hove
7a372c2a43 Merge pull request #2423 from joakim-hove/export-volume
Store the active volume with a mutable in the grid
2021-04-13 07:14:09 +02:00
Markus Blatt
e215098122 Merge pull request #2418 from akva2/fix_lto_python
Fix some python bindings issues
2021-04-12 14:10:42 +02:00
Joakim Hove
97652c1313 Store the active volume with a mutable in the grid 2021-04-12 13:53:59 +02:00
Joakim Hove
877f82ef06 Merge pull request #2422 from joakim-hove/add-compile-guard
Add missing compile guard
2021-04-12 08:32:34 +02:00
Joakim Hove
524be4ca4f Add missing compile guard 2021-04-12 00:10:23 +02:00
Joakim Hove
71a7af3cae Merge pull request #2419 from joakim-hove/pass-affected-wells
Make sure the affected_wells variable is passed to applyWellopen()
2021-04-10 17:16:43 +02:00
Joakim Hove
8a96d9a8d1 Make sure the affected_wells variable is passed to applyWellopen() 2021-04-10 14:10:44 +02:00
Bård Skaflestad
989c3a8396 Merge pull request #2417 from joakim-hove/import-general
Refactor IMPORT handler to accept all data keywords
2021-04-09 14:49:59 +02:00
Arne Morten Kvarving
9402db2421 fix building python bindings (with lto)
need to set the define for header only library with internal libfmt,
and whatever flags are required by external libfmt
2021-04-09 11:56:25 +02:00
Arne Morten Kvarving
5d13b9ed59 fixed: built builtin_pybind11.cpp in python bindings
necessary with lto as symbols are not visible in main library
2021-04-09 11:56:25 +02:00
Joakim Hove
adc52eb870 Refactor IMPORT handler to accept all data keywords 2021-04-09 10:34:16 +02:00
Joakim Hove
88f284ecab Merge pull request #2408 from joakim-hove/rst-test-eclipsestate
Add  EclipseState comparison to rst_test application
2021-04-09 08:51:59 +02:00
Markus Blatt
9a0d26c398 Merge pull request #2386 from blattms/cmake-3.10
Stop pretending that we support CMake 2.8
2021-04-08 10:15:10 +02:00
Joakim Hove
b05da71c57 rst_test application will also compare EclipseState 2021-04-08 09:25:03 +02:00
Joakim Hove
d08d358e5d Add EclipseState::rst_cmp 2021-04-08 09:25:03 +02:00
Joakim Hove
1a1aaa724b Add comparison functions operator== and rst_cmp() to FieldProps 2021-04-08 09:25:03 +02:00
Joakim Hove
d75c704f26 Reformat #include 2021-04-08 09:15:16 +02:00
Joakim Hove
5e4e949d8d Add IOConfig::rst_cmp 2021-04-08 09:15:16 +02:00
Joakim Hove
8214f36b61 Add InitConfig::rst_cmp 2021-04-08 09:15:16 +02:00
Joakim Hove
acae9728df Add SimulationConfig::rst_cmp() 2021-04-08 09:15:16 +02:00
Joakim Hove
646e0cb60f FieldPropsmanager will have a copy of the tables 2021-04-08 09:15:16 +02:00
Joakim Hove
fe5761096d Add ThresholdPressure::rst_cmp() 2021-04-08 09:15:16 +02:00
Joakim Hove
6c71179fa1 Add UnitSystem::rst_cmp() 2021-04-08 09:15:16 +02:00
Joakim Hove
e1e1afccd4 Add Runspec::rst_cmp() 2021-04-08 09:15:16 +02:00
Arne Morten Kvarving
6058d2b4f2 Merge pull request #2415 from akva2/fix_redhat_man_pages
fix redhat packaging
2021-04-08 09:07:36 +02:00
Arne Morten Kvarving
b28eca17e8 fix redhat packaging
handle the new man pages
2021-04-08 09:06:38 +02:00
Joakim Hove
3a733bda6f Add EclipseConfig::rst_cmp() 2021-04-08 09:01:19 +02:00
Joakim Hove
10c8b96fe0 Merge pull request #2414 from bska/write-active-network-only
Output Network Arrays Only if Network is Active
2021-04-07 22:37:51 +02:00
Joakim Hove
7c9fff256c Add const to AquiferConfig::operator==() 2021-04-07 17:52:25 +02:00
Bård Skaflestad
8a72a34ba5 Output Network Arrays Only if Network is Active
This fixes a real field case in which the network is only activated
(keywords BRANPROP and NODEPROP) fairly late in the simulation run.
2021-04-07 16:46:00 +02:00
Atgeirr Flø Rasmussen
659580d749 Merge pull request #2412 from joakim-hove/ep-optional
Use std::optional and value objects instead of std::shared_ptr
2021-04-07 16:20:31 +02:00
Joakim Hove
be451c0ccd Merge pull request #2413 from bska/fix-missing-initializer
Initialise All Well Table Dimensions
2021-04-07 15:22:05 +02:00
Markus Blatt
62b202e85c Stop pretending that we support CMake 2.8
We actually already require at least CMake 2.8.12 due to the embedded
pybind11 (some tests of it are even at 3.0). Anyway as Ubuntu LTS has
3.10.2 I doubt that anything less is tested by us.
2021-04-07 13:56:03 +02:00
Bård Skaflestad
4d4a6b700d Initialise All Well Table Dimensions
Including the maximum number of well lists per well and maximum
dynamic well lists added in commit 278cd0a24 (PR #2368).
2021-04-07 13:50:28 +02:00
Joakim Hove
ce5f0757df Merge pull request #2411 from joakim-hove/jfunc-optional
Use std::optional instead of std::shared_ptr to manage JFunc
2021-04-07 13:40:44 +02:00
Joakim Hove
ec0ca7bd6d Merge pull request #2410 from blattms/fixes-debian-1
Fixes from the debian packages
2021-04-07 10:29:19 +02:00
Joakim Hove
d33e6ba8ef Remove TableManager copy constructor and operator= 2021-04-07 09:31:25 +02:00
Joakim Hove
c55f761905 Use std::optional and value objects instead of std::shared_ptr 2021-04-07 09:13:53 +02:00
Joakim Hove
0d4a514c90 Use std::optional instead of std::shared_ptr to manage JFunc 2021-04-07 08:37:12 +02:00
Markus Blatt
3fd76f9c26 Fixes include paths in pkg-config files (at least in Debian).
Previously we ended up with "-I -I/cjson" for
"/usr/include;/usr/include/cjson" in opm-common_INCLUDE_DIRS.

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

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

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

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

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

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

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

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

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

    AAQTD (dimensionless time), AAQPD (dimensionless pressure)

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

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

    Well::Status dynamicStatus

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

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

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

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

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

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

This also fixes the CMake confusions about multiple linker paths

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

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

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

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

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

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

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

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

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

which is employed elsewhere.

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

    AquiferDimensions

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

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

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

removed changes to test-dataset

changes to adapt to changes of Schedule object

Added test data set

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

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

Added INODE and parts of IBRAN

added contributions for IBRAN and INOBR

added changes for output of RNODE

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

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

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

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

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

Some minor cleaning / corrections

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

further changes for IUDQ revision

further improvments iudq[1] - top parser tree

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

first working version of revised UDQ-restart output

additional improvements SWEL, XCON

initial - unfinished changes of rewriting iudq[1]

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

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

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

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

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

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

    Well::getPreferredPhase()

does not return that value.

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

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

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

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

    getCompletionNumberFromGlobalConnectionIndex

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

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

    WELL_PRODUCTIVITY_INDEX

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

    Well::getWellPIScalingFactor()

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

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

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

  applyWellProdIndexScaling(well_name, report_step, scalingFactor)

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

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

    bool Well::hasSameConnectionsPointers

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

    Well::getWellPIScalingFactor

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

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

For instance, this happens in the following setup:

    WCONINJH
       INJ2   WATER   OPEN  5500 /
    /

    DATES
      1 'JAN' 2020 /
    /

    WELPI
      'INJ2' 0.1E5 /
    /

    WCONINJH
       INJ2   GAS   OPEN   701627 /
    /

    DATES
      1 'FEB' 2020 /
    /

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

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

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

View File

@@ -1,5 +1,5 @@
project(opm-common C CXX)
cmake_minimum_required (VERSION 2.8)
cmake_minimum_required (VERSION 3.10)
option(SIBLING_SEARCH "Search for other modules in sibling directories?" ON)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
@@ -10,7 +10,7 @@ option(ENABLE_ECL_OUTPUT "Enable eclipse output support?" ON)
option(ENABLE_MOCKSIM "Build the mock simulator for io testing" ON)
option(OPM_ENABLE_PYTHON "Enable python bindings?" OFF)
option(OPM_INSTALL_PYTHON "Enable python bindings?" OFF)
option(OPM_ENABLE_EMBEDDED_PYTHON "Enable python bindings?" OFF)
option(OPM_ENABLE_EMBEDDED_PYTHON "Enable embedded python?" OFF)
# Output implies input
if(ENABLE_ECL_OUTPUT)
@@ -64,6 +64,20 @@ include(Findopm-tests)
# with the find module
include (${project}-prereqs)
if(ENABLE_ECL_INPUT)
# source_hook runs before config_hook and the former needs fmt, hence this
# needs to be here.
if(fmt_FOUND)
# OpmSatellites will not add the library, do it here.
list(APPEND opm-common_LIBRARIES fmt::fmt)
else()
add_definitions(-DFMT_HEADER_ONLY)
include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/external/fmtlib/include)
# Not sure why this is needed.
list(APPEND EXTRA_INCLUDES ${PROJECT_SOURCE_DIR}/external/fmtlib/include)
endif()
endif()
# read the list of components from this file (in the project directory);
# it should set various lists with the names of the files to include
include (CMakeLists_files.cmake)
@@ -75,10 +89,7 @@ macro (config_hook)
endif()
# For this project
add_definitions(-DFMT_HEADER_ONLY)
list(APPEND EXTRA_INCLUDES SYSTEM ${PROJECT_SOURCE_DIR}/external/fmtlib/include)
include_directories(${EXTRA_INCLUDES} ${PROJECT_BINARY_DIR}/include)
# For downstreams
list(APPEND EXTRA_INCLUDES ${PROJECT_BINARY_DIR}/include)
set(OPM_PROJECT_EXTRA_CODE_INTREE "${OPM_PROJECT_EXTRA_CODE_INTREE}
@@ -118,6 +129,9 @@ macro (sources_hook)
foreach (name A B C D E F G H I J K L M N O P Q R S T U V W X Y Z)
list(INSERT opm-common_SOURCES 0 ${PROJECT_BINARY_DIR}/ParserKeywords/${name}.cpp)
endforeach()
if (OPM_ENABLE_PYTHON)
list(INSERT opm-common_SOURCES 0 ${PROJECT_BINARY_DIR}/python/cxx/builtin_pybind11.cpp)
endif()
endif()
set_source_files_properties(src/opm/parser/eclipse/Python/Python.cpp
PROPERTIES COMPILE_FLAGS -Wno-shadow)
@@ -148,10 +162,58 @@ endmacro (install_hook)
# OpmnLibMain function. Here only the library dependency is implemented, the
# bulk of the python configuration is further down in the file.
if (OPM_ENABLE_PYTHON)
find_package(PythonInterp REQUIRED)
if (OPM_ENABLE_EMBEDDED_PYTHON)
find_package(PythonLibs REQUIRED)
list(APPEND opm-common_LIBRARIES ${PYTHON_LIBRARY})
# We need to be compatible with older CMake versions
# that do not offer FindPython3
# e.g. Ubuntu LTS 18.04 uses cmake 3.10
if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
find_package(PythonInterp REQUIRED)
if (OPM_ENABLE_EMBEDDED_PYTHON)
find_package(PythonLibs REQUIRED)
list(APPEND opm-common_LIBRARIES ${PYTHON_LIBRARIES})
endif()
if(PYTHON_VERSION_MAJOR LESS 3)
message(SEND_ERROR "OPM requires version 3 of Python but only version ${PYTHON_VERSION_STRING} was found")
endif()
set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
set(Python3_LIBRARIES ${PYTHON_LIBRARIES})
else()
# Be backwards compatible.
if(PYTHON_EXECUTABLE AND NOT Python3_EXECUTABLE)
set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
endif()
if (OPM_ENABLE_EMBEDDED_PYTHON)
find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
get_target_property(_lib_path Python3::Python IMPORTED_LOCATION)
set(PYTHON_LIBRARY ${_lib_path})
set(PYTHON_LIBRARIES {PYTHON_LIBRARY})
list(APPEND opm-common_LIBRARIES ${PYTHON_LIBRARY})
set(PYTHON_INCLUDE_DIRS ${Python3_INCLUDE_DIRS})
else()
find_package(Python3 REQUIRED COMPONENTS Interpreter)
endif()
# Compatibility settings for PythonInterp and PythonLibs
# used e.g. in FindCwrap, pybind11
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
endif()
# We always need the PYTHON_INCLUDE_DIR. Unfortunately
# When we build pypi packages CMake will fail to determine
# these via the usual find_package(PythonLibs or
# find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
# Hence we overwrite them here.
if(NOT PYTHON_INCLUDE_DIRS)
execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" "from distutils import sysconfig; print(sysconfig.get_python_inc(plat_specific=True), end=\"\");"
RESULT_VARIABLE _PYTHON_DIR_SUCCESS
OUTPUT_VARIABLE PYTHON_INCLUDE_DIR
ERROR_VARIABLE _PYTHON_ERROR_VALUE)
if(NOT _PYTHON_DIR_SUCCESS MATCHES 0)
message(FATAL_ERROR "Could not determine Python include directory. Error: ${_PYTHON_ERROR_VALUE}.")
endif()
set(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR})
endif()
find_package(pybind11 2.2 CONFIG)
if (NOT pybind11_FOUND)
# Use full path for reuse with pypi
set(pybind11_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/python/pybind11/include ${PYTHON_INCLUDE_DIRS})
endif()
endif()
@@ -180,6 +242,10 @@ if (ENABLE_MOCKSIM)
endif()
endif()
if (ENABLE_SCHEDULE_DEBUG)
add_compile_definitions( SCHEDULE_DEBUG )
endif()
# Build the compare utilities
if(ENABLE_ECL_INPUT)
add_executable(compareECL
@@ -196,7 +262,11 @@ if(ENABLE_ECL_INPUT)
test_util/summary.cpp
)
foreach(target compareECL convertECL summary)
add_executable(rewriteEclFile
test_util/rewriteEclFile.cpp
)
foreach(target compareECL convertECL summary rewriteEclFile)
target_link_libraries(${target} opmcommon)
install(TARGETS ${target} DESTINATION bin)
endforeach()
@@ -230,7 +300,7 @@ if(ENABLE_ECL_INPUT)
${PROJECT_BINARY_DIR}/tests
)
foreach(test test_EclIO test_EGrid test_ERft test_ERst test_ESmry)
foreach(test test_EclIO test_EGrid test_ERft test_ERst test_ESmry test_EInit)
opm_add_test(${test} CONDITION ENABLE_ECL_INPUT AND Boost_UNIT_TEST_FRAMEWORK_FOUND
LIBRARIES ${_libs}
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/tests)
@@ -238,7 +308,7 @@ if(ENABLE_ECL_INPUT)
endif()
# Install build system files
install(DIRECTORY cmake DESTINATION share/opm)
install(DIRECTORY cmake DESTINATION share/opm USE_SOURCE_PERMISSIONS)
# Install tab completion skeleton
install(FILES etc/opm_bash_completion.sh.in DESTINATION share/opm/etc)
@@ -291,19 +361,35 @@ if (OPM_ENABLE_PYTHON)
set(opm-common_PYTHON_PACKAGE_VERSION ${OPM_PYTHON_PACKAGE_VERSION_TAG})
# Generate versioned setup.py
if (pybind11_INCLUDE_DIRS)
string(REGEX REPLACE ";" "', '" _tmp "${pybind11_INCLUDE_DIRS}")
set(SETUP_PY_PYBIND_INCLUDE_DIR "'${_tmp}'")
endif()
if (TARGET fmt::fmt)
get_target_property(SETUP_PY_FMT_LIBS fmt::fmt LOCATION)
get_target_property(FMT_FLAGS fmt::fmt INTERFACE_COMPILE_DEFINITIONS)
foreach(flag ${FMT_FLAGS})
set(SETUP_PY_FMT_FLAGS "${SETUP_PY_FMT_FLAGS} '-D${flag}',")
endforeach()
list(APPEND opm-common_PYTHON_LINKAGE "'${SETUP_PY_FMT_LIBS}'")
else()
set(SETUP_PY_FMT_FLAGS "'-DFMT_HEADER_ONLY'")
endif()
configure_file (${PROJECT_SOURCE_DIR}/python/setup.py.in ${PROJECT_BINARY_DIR}/python/setup.py)
file(COPY ${PROJECT_SOURCE_DIR}/python/README.md DESTINATION ${PROJECT_BINARY_DIR}/python)
execute_process(COMMAND ${PYTHON_EXECUTABLE} target_name.py
execute_process(COMMAND ${Python3_EXECUTABLE} target_name.py
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/python
OUTPUT_VARIABLE python_lib_target)
add_custom_target(copy_python ALL
COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/python/install.py ${PROJECT_SOURCE_DIR}/python ${PROJECT_BINARY_DIR} 0)
COMMAND ${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/python/install.py ${PROJECT_SOURCE_DIR}/python ${PROJECT_BINARY_DIR} 0)
add_custom_command(OUTPUT python/opm/${python_lib_target}
DEPENDS ${PYTHON_CXX_DEPENDS}
DEPENDS copy_python
COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_BINARY_DIR}/python/setup.py
COMMAND ${Python3_EXECUTABLE} ${PROJECT_BINARY_DIR}/python/setup.py
build
build_ext
--build-lib=${PROJECT_BINARY_DIR}/python
@@ -327,7 +413,7 @@ if (OPM_ENABLE_PYTHON)
# setup.py install manually - optionally with the generated script
# setup-install.sh - and completely bypass cmake in the installation phase.
if (OPM_INSTALL_PYTHON)
install( CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_BINARY_DIR}/python/install.py ${PROJECT_BINARY_DIR}/python/opm ${DEST_PREFIX}${CMAKE_INSTALL_PREFIX}/${PYTHON_INSTALL_PREFIX} 1)")
install( CODE "execute_process(COMMAND ${Python3_EXECUTABLE} ${PROJECT_BINARY_DIR}/python/install.py ${PROJECT_BINARY_DIR}/python/opm ${DEST_PREFIX}${CMAKE_INSTALL_PREFIX}/${PYTHON_INSTALL_PREFIX} 1)")
endif()
# Observe that if the opmcommon library has been built as a shared library the
@@ -335,7 +421,7 @@ if (OPM_ENABLE_PYTHON)
# testing.
add_test(NAME python_tests
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/python
COMMAND ${CMAKE_COMMAND} -E env LD_LIBRARY_PATH=${PROJECT_BINARY_DIR}/lib ${PYTHON_EXECUTABLE} setup.py build_ext --dry-run --build-lib ${PROJECT_BINARY_DIR}/python test
COMMAND ${CMAKE_COMMAND} -E env LD_LIBRARY_PATH=${PROJECT_BINARY_DIR}/lib ${Python3_EXECUTABLE} setup.py build_ext --dry-run --build-lib ${PROJECT_BINARY_DIR}/python test
)
set_target_properties(opmcommon PROPERTIES POSITION_INDEPENDENT_CODE ON)
@@ -368,11 +454,17 @@ if (OPM_ENABLE_PYTHON)
# -------------------------------------------------------------------------
# 2: Embed the Python interpreter for keywords like PYACTION and PYINPUT
target_include_directories(opmcommon SYSTEM PRIVATE "${pybind11_INCLUDE_DIRS}")
if (OPM_ENABLE_EMBEDDED_PYTHON)
add_subdirectory(python/pybind11)
target_include_directories(opmcommon SYSTEM PRIVATE "python/pybind11/include;${PYTHON_INCLUDE_DIRS}")
target_link_libraries(opmcommon PUBLIC ${PYTHON_LIBRARY})
add_definitions(-DEMBEDDED_PYTHON)
endif()
else()
if (OPM_ENABLE_EMBEDDED_PYTHON)
message(WARNING "Inconsistent settings OPM_ENABLE_PYTHON / OPM_ENABLE_EMBEDDED_PYTHON")
set(OPM_ENABLE_EMBEDDED_PYTHON OFF CACHE BOOL "Enable embedded python?" FORCE)
endif()
endif()
install(DIRECTORY docs/man1 DESTINATION ${CMAKE_INSTALL_MANDIR}
FILES_MATCHING PATTERN "*.1")

View File

@@ -26,6 +26,8 @@ list (APPEND MAIN_SOURCE_FILES
src/opm/common/OpmLog/LogBackend.cpp
src/opm/common/OpmLog/Logger.cpp
src/opm/common/OpmLog/LogUtil.cpp
src/opm/common/OpmLog/KeywordLocation.cpp
src/opm/common/OpmLog/InfoLogger.cpp
src/opm/common/OpmLog/OpmLog.cpp
src/opm/common/OpmLog/StreamLog.cpp
src/opm/common/OpmLog/TimerLog.cpp
@@ -50,18 +52,23 @@ if(ENABLE_ECL_INPUT)
src/opm/parser/eclipse/Deck/DeckRecord.cpp
src/opm/parser/eclipse/Deck/DeckOutput.cpp
src/opm/parser/eclipse/Deck/DeckSection.cpp
src/opm/parser/eclipse/Deck/ImportContainer.cpp
src/opm/parser/eclipse/Deck/UDAValue.cpp
src/opm/parser/eclipse/Python/Python.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/PyAction.cpp
src/opm/parser/eclipse/EclipseState/AquiferConfig.cpp
src/opm/parser/eclipse/EclipseState/AquiferCT.cpp
src/opm/parser/eclipse/EclipseState/Aquifetp.cpp
src/opm/parser/eclipse/EclipseState/Aquancon.cpp
src/opm/parser/eclipse/EclipseState/Aquifer/AquiferConfig.cpp
src/opm/parser/eclipse/EclipseState/Aquifer/AquiferCT.cpp
src/opm/parser/eclipse/EclipseState/Aquifer/Aquifetp.cpp
src/opm/parser/eclipse/EclipseState/Aquifer/Aquancon.cpp
src/opm/parser/eclipse/EclipseState/Aquifer/AquiferHelpers.cpp
src/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquiferCell.cpp
src/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquiferConnection.cpp
src/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/SingleNumericalAquifer.cpp
src/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquifers.cpp
src/opm/parser/eclipse/EclipseState/checkDeck.cpp
src/opm/parser/eclipse/EclipseState/EclipseConfig.cpp
src/opm/parser/eclipse/EclipseState/EclipseState.cpp
src/opm/parser/eclipse/EclipseState/EndpointScaling.cpp
src/opm/parser/eclipse/EclipseState/Edit/EDITNNC.cpp
src/opm/parser/eclipse/EclipseState/Grid/FieldProps.cpp
src/opm/parser/eclipse/EclipseState/Grid/FieldPropsManager.cpp
src/opm/parser/eclipse/EclipseState/Grid/Box.cpp
@@ -83,7 +90,6 @@ if(ENABLE_ECL_INPUT)
src/opm/parser/eclipse/EclipseState/InitConfig/FoamConfig.cpp
src/opm/parser/eclipse/EclipseState/InitConfig/InitConfig.cpp
src/opm/parser/eclipse/EclipseState/IOConfig/IOConfig.cpp
src/opm/parser/eclipse/EclipseState/IOConfig/RestartConfig.cpp
src/opm/parser/eclipse/EclipseState/Runspec.cpp
src/opm/parser/eclipse/EclipseState/TracerConfig.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionAST.cpp
@@ -124,14 +130,22 @@ if(ENABLE_ECL_INPUT)
src/opm/parser/eclipse/EclipseState/Schedule/OilVaporizationProperties.cpp
src/opm/parser/eclipse/EclipseState/Schedule/RFTConfig.cpp
src/opm/parser/eclipse/EclipseState/Schedule/RPTConfig.cpp
src/opm/parser/eclipse/EclipseState/Schedule/RSTConfig.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp
src/opm/parser/eclipse/EclipseState/Schedule/ScheduleDeck.cpp
src/opm/parser/eclipse/EclipseState/Schedule/ScheduleState.cpp
src/opm/parser/eclipse/EclipseState/Schedule/ScheduleTypes.cpp
src/opm/parser/eclipse/EclipseState/Schedule/SummaryState.cpp
src/opm/parser/eclipse/EclipseState/Schedule/TimeMap.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/Connection.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/injection.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/PAvg.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/PAvgCalculator.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/PAvgCalculatorCollection.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/Well.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellConnections.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/NameOrder.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellMatcher.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WList.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WListManager.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellEconProductionLimits.cpp
@@ -251,6 +265,7 @@ if(ENABLE_ECL_OUTPUT)
src/opm/io/eclipse/EclOutput.cpp
src/opm/io/eclipse/EclUtil.cpp
src/opm/io/eclipse/EGrid.cpp
src/opm/io/eclipse/EInit.cpp
src/opm/io/eclipse/ERft.cpp
src/opm/io/eclipse/ERst.cpp
src/opm/io/eclipse/ERsm.cpp
@@ -264,9 +279,11 @@ if(ENABLE_ECL_OUTPUT)
src/opm/io/eclipse/rst/segment.cpp
src/opm/io/eclipse/rst/state.cpp
src/opm/io/eclipse/rst/well.cpp
src/opm/output/eclipse/ActiveIndexByColumns.cpp
src/opm/output/eclipse/AggregateActionxData.cpp
src/opm/output/eclipse/AggregateConnectionData.cpp
src/opm/output/eclipse/AggregateGroupData.cpp
src/opm/output/eclipse/AggregateNetworkData.cpp
src/opm/output/eclipse/AggregateMSWData.cpp
src/opm/output/eclipse/AggregateUDQData.cpp
src/opm/output/eclipse/AggregateWellData.cpp
@@ -283,6 +300,7 @@ if(ENABLE_ECL_OUTPUT)
src/opm/output/eclipse/LoadRestart.cpp
src/opm/output/eclipse/LogiHEAD.cpp
src/opm/output/eclipse/RestartIO.cpp
src/opm/output/eclipse/Inplace.cpp
src/opm/output/eclipse/Summary.cpp
src/opm/output/eclipse/Tables.cpp
src/opm/output/eclipse/RegionCache.cpp
@@ -324,8 +342,6 @@ if(ENABLE_ECL_INPUT)
tests/parser/CopyRegTests.cpp
tests/parser/DeckValueTests.cpp
tests/parser/DeckTests.cpp
tests/parser/DynamicStateTests.cpp
tests/parser/DynamicVectorTests.cpp
tests/parser/EclipseGridTests.cpp
tests/parser/EmbeddedPython.cpp
tests/parser/EqualRegTests.cpp
@@ -337,6 +353,7 @@ if(ENABLE_ECL_INPUT)
tests/parser/FunctionalTests.cpp
tests/parser/GeomodifierTests.cpp
tests/parser/GroupTests.cpp
tests/parser/ImportTests.cpp
tests/parser/InitConfigTest.cpp
tests/parser/IOConfigTests.cpp
tests/parser/MessageLimitTests.cpp
@@ -348,6 +365,7 @@ if(ENABLE_ECL_INPUT)
tests/parser/ParseContextTests.cpp
tests/parser/ParseContext_EXIT1.cpp
tests/parser/ParseDATAWithDefault.cpp
tests/parser/PAvgTests.cpp
tests/parser/PYACTION.cpp
tests/parser/RawKeywordTests.cpp
tests/parser/test_ReportConfig.cpp
@@ -357,6 +375,7 @@ if(ENABLE_ECL_INPUT)
tests/parser/RockTableTests.cpp
tests/parser/RunspecTests.cpp
tests/parser/SaltTableTests.cpp
tests/parser/ScheduleSerializeTest.cpp
tests/parser/ScheduleRestartTests.cpp
tests/parser/ScheduleTests.cpp
tests/parser/SectionTests.cpp
@@ -377,6 +396,7 @@ if(ENABLE_ECL_INPUT)
tests/parser/TuningTests.cpp
tests/parser/UDQTests.cpp
tests/parser/UnitTests.cpp
tests/parser/integration/NNCTests.cpp
tests/parser/WellSolventTests.cpp
tests/parser/WellTracerTests.cpp
tests/parser/WellTests.cpp
@@ -385,9 +405,11 @@ if(ENABLE_ECL_INPUT)
endif()
if(ENABLE_ECL_OUTPUT)
list (APPEND TEST_SOURCE_FILES
tests/test_ActiveIndexByColumns.cpp
tests/test_AggregateActionxData.cpp
tests/test_AggregateWellData.cpp
tests/test_AggregateGroupData.cpp
tests/test_AggregateNetworkData.cpp
tests/test_AggregateMSWData.cpp
tests/test_AggregateConnectionData.cpp
tests/test_AggregateUDQData.cpp
@@ -398,6 +420,7 @@ if(ENABLE_ECL_OUTPUT)
tests/test_InteHEAD.cpp
tests/test_LinearisedOutputTable.cpp
tests/test_LogiHEAD.cpp
tests/test_LGOData.cpp
tests/test_OutputStream.cpp
tests/test_regionCache.cpp
tests/test_PaddedOutputString.cpp
@@ -406,6 +429,7 @@ if(ENABLE_ECL_OUTPUT)
tests/test_rst.cpp
tests/test_Solution.cpp
tests/test_Serializer.cpp
tests/test_Inplace.cpp
tests/test_Summary.cpp
tests/test_Summary_Group.cpp
tests/test_Tables.cpp
@@ -440,6 +464,7 @@ if(ENABLE_ECL_OUTPUT)
tests/UDQ_TEST_WCONPROD_IUAD-2.DATA
tests/UDQ_ACTIONX_TEST1.DATA
tests/UDQ_ACTIONX_TEST1_U.DATA
tests/TEST_AGGREGATE_MSW.DATA
tests/include_example_pvt.txt
tests/include_example_summary.txt
tests/include_sgof.txt
@@ -450,6 +475,8 @@ if(ENABLE_ECL_OUTPUT)
tests/SPE1CASE2.X0060
tests/PYACTION.DATA
tests/0A4_GRCTRL_LRAT_LRAT_GGR_BASE_MODEL2_MSW_ALL.DATA
tests/2_WLIFT_MODEL5_NOINC.DATA
tests/TEST_NETWORK_ALL.DATA
tests/act1.py
tests/MSW.DATA
tests/EXIT_TEST.DATA
@@ -460,7 +487,7 @@ if(ENABLE_ECL_OUTPUT)
tests/msim/MSIM_PYACTION.DATA
tests/msim/action1.py
tests/msim/action2.py
)
tests/VFP_CASE.DATA)
endif()
list (APPEND EXAMPLE_SOURCE_FILES
@@ -469,6 +496,13 @@ if(ENABLE_ECL_INPUT)
list (APPEND TEST_DATA_FILES
tests/ECLFILE.INIT
tests/ECLFILE.FINIT
tests/LGR_TESTMOD.EGRID
tests/LGR_TESTMOD.INIT
tests/LGR_TESTMOD.UNRST
tests/LGR_TESTMOD.X0002
tests/MODEL1_IX.INIT
tests/MODEL1_IX.SMSPEC
tests/MODEL1_IX.UNSMRY
tests/SPE1CASE1.EGRID
tests/SPE1CASE1.RFT
tests/SPE1_TESTCASE.UNRST
@@ -515,6 +549,7 @@ list( APPEND PUBLIC_HEADER_FILES
opm/common/OpmLog/MessageFormatter.hpp
opm/common/OpmLog/MessageLimiter.hpp
opm/common/OpmLog/KeywordLocation.hpp
opm/common/OpmLog/InfoLogger.hpp
opm/common/OpmLog/OpmLog.hpp
opm/common/OpmLog/StreamLog.hpp
opm/common/OpmLog/TimerLog.hpp
@@ -570,7 +605,6 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/EclipseState/Util/IOrderSet.hpp
opm/parser/eclipse/EclipseState/Util/OrderedMap.hpp
opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp
opm/parser/eclipse/EclipseState/Edit/EDITNNC.hpp
opm/parser/eclipse/EclipseState/Grid/FieldData.hpp
opm/parser/eclipse/EclipseState/Grid/Keywords.hpp
opm/parser/eclipse/EclipseState/Grid/GridDims.hpp
@@ -658,6 +692,7 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/EclipseState/Tables/SgwfnTable.hpp
opm/parser/eclipse/EclipseState/Tables/PvdsTable.hpp
opm/parser/eclipse/EclipseState/Tables/PvtoTable.hpp
opm/parser/eclipse/EclipseState/Tables/PvtsolTable.hpp
opm/parser/eclipse/EclipseState/Tables/Rock2dTable.hpp
opm/parser/eclipse/EclipseState/Tables/Rock2dtrTable.hpp
opm/parser/eclipse/EclipseState/Tables/RockwnodTable.hpp
@@ -673,10 +708,14 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/EclipseState/Tables/TracerVdTable.hpp
opm/parser/eclipse/EclipseState/EclipseState.hpp
opm/parser/eclipse/EclipseState/EclipseConfig.hpp
opm/parser/eclipse/EclipseState/Aquancon.hpp
opm/parser/eclipse/EclipseState/AquiferConfig.hpp
opm/parser/eclipse/EclipseState/AquiferCT.hpp
opm/parser/eclipse/EclipseState/Aquifetp.hpp
opm/parser/eclipse/EclipseState/Aquifer/Aquancon.hpp
opm/parser/eclipse/EclipseState/Aquifer/AquiferConfig.hpp
opm/parser/eclipse/EclipseState/Aquifer/AquiferCT.hpp
opm/parser/eclipse/EclipseState/Aquifer/Aquifetp.hpp
opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquiferCell.hpp
opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquiferConnection.hpp
opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/SingleNumericalAquifer.hpp
opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquifers.hpp
opm/parser/eclipse/EclipseState/Schedule/Action/ActionAST.hpp
opm/parser/eclipse/EclipseState/Schedule/Action/ActionContext.hpp
opm/parser/eclipse/EclipseState/Schedule/Action/ActionResult.hpp
@@ -699,8 +738,13 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/EclipseState/Schedule/Well/Connection.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/ProductionControls.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/InjectionControls.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/PAvg.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/PAvgCalculator.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/PAvgCalculatorCollection.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/WList.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/NameOrder.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/WellMatcher.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/WListManager.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/WellEconProductionLimits.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/WellFoamProperties.hpp
@@ -712,11 +756,13 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/EclipseState/Schedule/Well/WellTestConfig.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/WellTestState.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/WellConnections.hpp
opm/parser/eclipse/EclipseState/Schedule/DynamicVector.hpp
opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp
opm/parser/eclipse/EclipseState/Schedule/RFTConfig.hpp
opm/parser/eclipse/EclipseState/Schedule/RPTConfig.hpp
opm/parser/eclipse/EclipseState/Schedule/RSTConfig.hpp
opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp
opm/parser/eclipse/EclipseState/Schedule/ScheduleDeck.hpp
opm/parser/eclipse/EclipseState/Schedule/ScheduleState.hpp
opm/parser/eclipse/EclipseState/Schedule/ScheduleTypes.hpp
opm/parser/eclipse/EclipseState/Schedule/Tuning.hpp
opm/parser/eclipse/EclipseState/Schedule/Group/GPMaint.hpp
@@ -730,7 +776,6 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/EclipseState/Schedule/MessageLimits.hpp
opm/parser/eclipse/EclipseState/Schedule/Events.hpp
opm/parser/eclipse/EclipseState/Schedule/OilVaporizationProperties.hpp
opm/parser/eclipse/EclipseState/Schedule/DynamicState.hpp
opm/parser/eclipse/EclipseState/Schedule/MSW/icd.hpp
opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.hpp
opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.hpp
@@ -742,7 +787,6 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/EclipseState/SimulationConfig/RockConfig.hpp
opm/parser/eclipse/EclipseState/SimulationConfig/SimulationConfig.hpp
opm/parser/eclipse/EclipseState/Schedule/MSW/Valve.hpp
opm/parser/eclipse/EclipseState/IOConfig/RestartConfig.hpp
opm/parser/eclipse/EclipseState/IOConfig/IOConfig.hpp
opm/parser/eclipse/EclipseState/checkDeck.hpp
opm/parser/eclipse/EclipseState/Runspec.hpp
@@ -757,6 +801,7 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQInput.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQActive.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQSet.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQToken.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunction.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunctionTable.hpp
opm/parser/eclipse/Deck/DeckItem.hpp
@@ -766,6 +811,7 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/Deck/DeckValue.hpp
opm/parser/eclipse/Deck/DeckKeyword.hpp
opm/parser/eclipse/Deck/DeckRecord.hpp
opm/parser/eclipse/Deck/ImportContainer.hpp
opm/parser/eclipse/Deck/UDAValue.hpp
opm/parser/eclipse/Deck/value_status.hpp
opm/parser/eclipse/Python/Python.hpp)
@@ -777,6 +823,7 @@ if(ENABLE_ECL_OUTPUT)
opm/io/eclipse/EclOutput.hpp
opm/io/eclipse/EclUtil.hpp
opm/io/eclipse/EGrid.hpp
opm/io/eclipse/EInit.hpp
opm/io/eclipse/ERft.hpp
opm/io/eclipse/ERst.hpp
opm/io/eclipse/ERsm.hpp
@@ -799,13 +846,16 @@ if(ENABLE_ECL_OUTPUT)
opm/output/eclipse/VectorItems/aquifer.hpp
opm/output/eclipse/VectorItems/connection.hpp
opm/output/eclipse/VectorItems/group.hpp
opm/output/eclipse/VectorItems/network.hpp
opm/output/eclipse/VectorItems/intehead.hpp
opm/output/eclipse/VectorItems/logihead.hpp
opm/output/eclipse/VectorItems/msw.hpp
opm/output/eclipse/VectorItems/tabdims.hpp
opm/output/eclipse/VectorItems/well.hpp
opm/output/eclipse/ActiveIndexByColumns.hpp
opm/output/eclipse/AggregateActionxData.hpp
opm/output/eclipse/AggregateGroupData.hpp
opm/output/eclipse/AggregateNetworkData.hpp
opm/output/eclipse/AggregateConnectionData.hpp
opm/output/eclipse/AggregateMSWData.hpp
opm/output/eclipse/AggregateUDQData.hpp
@@ -820,6 +870,7 @@ if(ENABLE_ECL_OUTPUT)
opm/output/eclipse/RegionCache.hpp
opm/output/eclipse/RestartIO.hpp
opm/output/eclipse/RestartValue.hpp
opm/output/eclipse/Inplace.hpp
opm/output/eclipse/Summary.hpp
opm/output/eclipse/Tables.hpp
opm/output/eclipse/WindowedArray.hpp

View File

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

View File

@@ -44,11 +44,9 @@ list(APPEND EXTRA_TESTS EclipseStateTests)
foreach (test BoxTest
CheckDeckValidity
EclipseGridCreateFromDeck
EDITNNCTests
IncludeTest
IntegrationTests
IOConfigIntegrationTest
NNCTests
ParseKEYWORD
Polymer
ScheduleCreateFromDeck

View File

@@ -41,7 +41,14 @@ configure_file(src/opm/parser/eclipse/keyword_list.argv.in keyword_list.argv)
# Generate keyword source
add_custom_command( OUTPUT
set( genkw_argv keyword_list.argv
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords
${PROJECT_BINARY_DIR}/tmp_gen/ParserInit.cpp
${PROJECT_BINARY_DIR}/tmp_gen/include/
opm/parser/eclipse/Parser/ParserKeywords
${PROJECT_BINARY_DIR}/tmp_gen/TestKeywords.cpp)
set( _tmp_output
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/A.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/B.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/C.cpp
@@ -68,18 +75,11 @@ add_custom_command( OUTPUT
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/X.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/Y.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/Z.cpp
${PROJECT_BINARY_DIR}/tmp_gen/TestKeywords.cpp
COMMAND genkw keyword_list.argv
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords
${PROJECT_BINARY_DIR}/tmp_gen/ParserInit.cpp
${PROJECT_BINARY_DIR}/tmp_gen/include/
opm/parser/eclipse/Parser/ParserKeywords
${PROJECT_BINARY_DIR}/tmp_gen/TestKeywords.cpp
DEPENDS genkw ${keyword_files} src/opm/parser/eclipse/share/keywords/keyword_list.cmake
)
${PROJECT_BINARY_DIR}/tmp_gen/ParserInit.cpp
${PROJECT_BINARY_DIR}/tmp_gen/TestKeywords.cpp)
# To avoid some rebuilds
add_custom_command(OUTPUT
set( _target_output
${PROJECT_BINARY_DIR}/ParserKeywords/A.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/B.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/C.cpp
@@ -107,7 +107,24 @@ add_custom_command(OUTPUT
${PROJECT_BINARY_DIR}/ParserKeywords/Y.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/Z.cpp
${PROJECT_BINARY_DIR}/TestKeywords.cpp
${PROJECT_BINARY_DIR}/ParserInit.cpp
DEPENDS ${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/A.cpp
COMMAND ${CMAKE_COMMAND} -DBASE_DIR=${PROJECT_BINARY_DIR}
-P ${PROJECT_SOURCE_DIR}/CopyHeaders.cmake)
${PROJECT_BINARY_DIR}/ParserInit.cpp)
if (OPM_ENABLE_PYTHON)
list(APPEND genkw_argv ${PROJECT_BINARY_DIR}/tmp_gen/builtin_pybind11.cpp)
list(APPEND _tmp_output ${PROJECT_BINARY_DIR}/tmp_gen/builtin_pybind11.cpp)
list(APPEND _target_output ${PROJECT_BINARY_DIR}/python/cxx/builtin_pybind11.cpp)
endif()
add_custom_command( OUTPUT
${_tmp_output}
COMMAND genkw ${genkw_argv}
DEPENDS genkw ${keyword_files} src/opm/parser/eclipse/share/keywords/keyword_list.cmake)
# To avoid some rebuilds
add_custom_command(OUTPUT
${_target_output}
DEPENDS ${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/A.cpp
COMMAND ${CMAKE_COMMAND} -DBASE_DIR=${PROJECT_BINARY_DIR} -P ${PROJECT_SOURCE_DIR}/CopyHeaders.cmake)

View File

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

View File

@@ -60,6 +60,19 @@ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${MPI_C_COMPILE_FLAGS}")
include(CheckIncludeFile)
check_include_file(parmetis.h PARMETIS_FOUND)
if(NOT PARMETIS_FOUND)
# If we are using the ParMETIS bindings of PTScotch, we need
# to use the scotch include path as partmetis.h includes scotch.h
find_package(PTScotch)
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${PTSCOTCH_INCLUDE_DIR})
unset(PARMETIS_FOUND CACHE) # force recheck of include file
check_include_file(parmetis.h PARMETIS_FOUND)
if(PARMETIS_FOUND)
set(PARMETIS_SCOTCH_INCLUDE_DIRS ${PTSCOTCH_INCLUDE_DIRS})
endif()
endif()
_search_parmetis_lib(PARMETIS_LIBRARY parmetis "The main ParMETIS library.")
# behave like a CMake module is supposed to behave
@@ -77,7 +90,7 @@ find_package_handle_standard_args(
cmake_pop_check_state()
if(PARMETIS_FOUND)
set(PARMETIS_INCLUDE_DIRS ${PARMETIS_INCLUDE_DIR})
set(PARMETIS_INCLUDE_DIRS ${PARMETIS_INCLUDE_DIR} ${PARMETIS_SCOTCH_INCLUDE_DIRS})
set(PARMETIS_LIBRARIES ${PARMETIS_LIBRARY} ${METIS_LIBRARIES} ${MPI_C_LIBRARIES}
CACHE FILEPATH "All libraries needed to link programs using ParMETIS")
set(PARMETIS_LINK_FLAGS "${DUNE_C_LINK_FLAGS}"

View File

@@ -6,10 +6,6 @@
include (FindPackageHandleStandardArgs)
if ((NOT CJSON_ROOT) AND OPM_PARSER_ROOT)
set( CJSON_ROOT ${OPM_PARSER_ROOT})
endif()
if (CJSON_ROOT)
set (_no_default_path "NO_DEFAULT_PATH")
else (CJSON_ROOT)
@@ -18,10 +14,9 @@ endif (CJSON_ROOT)
find_path (CJSON_INCLUDE_DIR
NAMES "cjson/cJSON.h"
NAMES "cJSON.h"
HINTS "${CJSON_ROOT}"
PATHS "${PROJECT_SOURCE_DIR}"
PATH_SUFFIXES "include" "external"
PATH_SUFFIXES "cjson"
DOC "Path to cjson library header files"
${_no_default_path} )
@@ -36,11 +31,7 @@ string(REGEX REPLACE "${PROJECT_SOURCE_DIR}/?(.*)" "\\1" BUILD_DIR_SUFFIX "${PR
find_library (CJSON_LIBRARY
NAMES "cjson"
HINTS "${CJSON_ROOT}"
PATHS "${PROJECT_BINARY_DIR}/../opm-parser"
"${PROJECT_BINARY_DIR}/../opm-parser${BUILD_DIR_SUFFIX}"
"${PROJECT_BINARY_DIR}/../../opm-parser/${BUILD_DIR_SUFFIX}"
PATH_SUFFIXES "lib" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
"opm/json"
DOC "Path to cjson library archive/shared object files"
${_no_default_path} )

View File

@@ -28,7 +28,7 @@ find_opm_package (
"dunecommon"
# defines to be added to compilations
"DUNE_COMMON_FIELDVECTOR_SIZE_IS_METHOD=1"
""
# test program
"#include <dune/common/fvector.hh>

View File

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

View File

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

View File

@@ -163,7 +163,21 @@ macro (find_and_append_package_to prefix name)
string (REPLACE "-" "_" NAME "${NAME}")
if (${name}_FOUND OR ${NAME}_FOUND)
foreach (var IN LISTS _opm_proj_vars)
foreach (var IN LISTS _opm_proj_vars)
if("${var}" STREQUAL "DEFINITIONS"
AND CMAKE_VERSION VERSION_LESS "3.12")
# For old Cmake versions we use add_definitions which
# requires -D qualifier add that
set(_defs)
foreach(_def IN LISTS ${name}_${var})
if(_def MATCHES "^[a-zA-Z].*")
list(APPEND _defs "-D${_def}")
else()
list(APPEND _defs "${_def}")
endif()
endforeach()
set(${name}_${var} "${_defs}")
endif()
if (DEFINED ${name}_${var})
list (APPEND ${prefix}_${var} ${${name}_${var}})
# some packages define an uppercase version of their own name

View File

@@ -135,6 +135,18 @@ if (NOT USE_MPI)
set (CMAKE_DISABLE_FIND_PACKAGE_MPI TRUE)
endif ()
# Compiler standard version needs to be requested here as prereqs is included
# before OpmLibMain and some tests need/use CXX_STANDARD_VERSION (e.g. pybind11)
# Languages and global compiler settings
if(CMAKE_VERSION VERSION_LESS 3.8)
message(WARNING "CMake version does not support c++17, guessing -std=c++17")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
else()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
endif()
# 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)

View File

@@ -20,16 +20,6 @@
include (AddOptions)
no_default_options ()
# Languages and global compiler settings
if(CMAKE_VERSION VERSION_LESS 3.8)
message(WARNING "CMake version does not support c++17, guessing -std=c++17")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
else()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
endif()
# Various compiler extension checks
include(OpmCompilerChecks)

View File

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

View File

@@ -30,7 +30,6 @@ function (configure_pc_file name source dest prefix libdir includedir)
set (minor "${${name}_VERSION_MINOR}")
set (target "${${name}_LIBRARY}")
linker_cmdline (STRING INTO target from ${target})
configure_file (${source} ${dest} @ONLY)
endfunction (configure_pc_file name source dist prefix libdir includedir)
@@ -101,16 +100,24 @@ function (opm_cmake_config name)
# and we have existing entries pointing to that install directory.
# Since they will yield a duplicate in next replace anyways, we filter them out first
# to get avoid those the bogus entries.
string(REPLACE "${CMAKE_INSTALL_PREFIX}/include${${name}_VER_DIR}" "" ${name}_INCLUDE_DIRS "${${name}_INCLUDE_DIRS}")
# First with trailing / to change /usr/include/package to package and not /package
# Fixes broken pkg-config files for Debian/Ubuntu packaging.
string(FIND "${${name}_INCLUDE_DIRS}" "${PROJECT_SOURCE_DIR}" _source_in_include)
# replace the build directory with the target directory in the
# variables that contains build paths
string (REPLACE
"${PROJECT_SOURCE_DIR}"
"${CMAKE_INSTALL_PREFIX}/include${${name}_VER_DIR}"
${name}_INCLUDE_DIRS
"${${name}_INCLUDE_DIRS}"
)
if(_source_in_include GREATER "-1")
string(REGEX REPLACE "${CMAKE_INSTALL_PREFIX}/include${${name}_VER_DIR}[;$]" "" ${name}_INCLUDE_DIRS "${${name}_INCLUDE_DIRS}")
# Get rid of empty entries
string(REPLACE ";;" ";" ${name}_INCLUDE_DIRS "${${name}_INCLUDE_DIRS}")
# replace the build directory with the target directory in the
# variables that contains build paths
string (REPLACE
"${PROJECT_SOURCE_DIR}"
"${CMAKE_INSTALL_PREFIX}/include${${name}_VER_DIR}"
${name}_INCLUDE_DIRS
"${${name}_INCLUDE_DIRS}"
)
endif()
string (REPLACE
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}${${name}_VER_DIR}"

View File

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

View File

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

View File

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

View File

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

View File

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

2
debian/changelog vendored
View File

@@ -1,4 +1,4 @@
opm-common (2019.04-pre~xenial) xenial; urgency=medium
opm-common (2021.04-rfinal-1~bionic) bionic; urgency=medium
* New release

2
debian/rules vendored
View File

@@ -20,7 +20,7 @@ override_dh_auto_build:
# consider using -DUSE_VERSIONED_DIR=ON if backporting
override_dh_auto_configure:
dh_auto_configure --buildsystem=cmake -- -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSTRIP_DEBUGGING_SYMBOLS=ON -DBUILD_SHARED_LIBS=1 -DCMAKE_INSTALL_DOCDIR=share/doc/libopm-common1 -DWHOLE_PROG_OPTIM=ON -DUSE_RUNPATH=OFF -DWITH_NATIVE=OFF -DOPM_ENABLE_PYTHON=1 -DOPM_INSTALL_PYTHON=1 -DPYTHON_EXECUTABLE=/usr/bin/python3
dh_auto_configure --buildsystem=cmake -- -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSTRIP_DEBUGGING_SYMBOLS=ON -DBUILD_SHARED_LIBS=1 -DCMAKE_INSTALL_DOCDIR=share/doc/libopm-common1 -DWHOLE_PROG_OPTIM=ON -DUSE_RUNPATH=OFF -DWITH_NATIVE=OFF -DOPM_ENABLE_PYTHON=1 -DOPM_INSTALL_PYTHON=1 -DPYTHON_EXECUTABLE=/usr/bin/python3 -DOPM_ENABLE_EMBEDDED_PYTHON=1
override_dh_auto_install:
dh_auto_install -- install-html

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

@@ -0,0 +1,65 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.8.
.TH COMPAREECL "1" "April 2021" "compareECL 2020.04" "User Commands"
.SH NAME
compareECL \- Comparator for Eclipse files
.SH DESCRIPTION
compareECL compares ECLIPSE files (restart (.RST), unified restart (.UNRST), initial (.INIT), summary (.SMRY), unified summary (.UNSMRY) or .RFT) and gridsizes (from .EGRID or .GRID file) from two simulations.
The program takes four arguments:
.PP
1. Case number 1, reference case (full path without extension)
2. Case number 2, test case (full path without extension)
3. Absolute tolerance
4. Relative tolerance (between 0 and 1)
.PP
In addition, the program takes these options (which must be given before the arguments):
.PP
\fB\-a\fR Run a full analysis of errors.
\fB\-h\fR Print help and exit.
\fB\-d\fR Use report steps only when comparing results from summary files.
\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\-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
\fB\-t\fR EGRID
Compare two EGrid files (.EGRID).
.TP
\fB\-t\fR INIT
Compare two initial files (.INIT).
.TP
\fB\-t\fR RFT
Compare two RFT files (.RFT).
.TP
\fB\-t\fR SMRY
Compare two cases consistent of (unified) summary files.
.PP
\fB\-x\fR Allow extra keywords in case number 2. These additional keywords (not found in case number1) will be ignored in the comparison.
.PP
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.

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

@@ -0,0 +1,24 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.8.
.TH CONVERTECL "1" "April 2021" "convertECL 2020.04" "User Commands"
.SH NAME
convertECL \- Converter for Eclipse files (binary <-> formatted format)
.SH DESCRIPTION
convertECL needs one argument which is the input file to be converted. If this is a binary file the output file will be formatted. If the input file is formatted the output will be binary.
.PP
In addition, the program takes these options (which must be given before the arguments):
.PP
\fB\-h\fR Print help and exit.
\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
.PP
should give you access to the complete manual.

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

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

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

@@ -0,0 +1,42 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.8.
.TH OPMPACK "1" "April 2021" "opmpack 2020.04" "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.
.PP
By passing the option \fB\-o\fR you can redirect the output to a file
or a directory.
.PP
Print on stdout:
.TP
opmpack
\fI\,/path/to/case/CASE.DATA\/\fP
.PP
Print MY_CASE.DATA in /tmp:
.IP
opmpack \fB\-o\fR \fI\,/tmp\/\fP /path/to/MY_CASE.DATA
.PP
Print NEW_CASE in cwd:
.IP
opmpack \fB\-o\fR NEW_CASE.DATA path/to/MY_CASE.DATA
.PP
As an alternative to the \fB\-o\fR option you can use \fB\-c\fR; that is equivalent to \fB\-o\fR \-
but restart and import files referred to in the deck are also copied. The \fB\-o\fR and
\fB\-c\fR options are mutually exclusive.
.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.

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

@@ -0,0 +1,24 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.8.
.TH SUMMARY "1" "April 2021" "summary 2020.04" "User Commands"
.SH NAME
summary \- Printer for summary keys in Eclipse summary files
.SH DESCRIPTION
summary needs a minimum of two arguments. First is smspec filename and then list of vectors
.PP
In addition, the program takes these options (which must be given before the arguments):
.PP
\fB\-h\fR Print help and exit.
\fB\-l\fR list all summary vectors.
\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: 2020.10-pre
Label: 2020.10-pre
Version: 2021.04
Label: 2021.04
Maintainer: opm@opm-project.org
MaintainerName: OPM community
Url: http://opm-project.org

View File

@@ -25,7 +25,7 @@
#include "config.h"
#if HAVE_OPENMP
#if _OPENMP
#include <omp.h>
#endif
@@ -69,7 +69,7 @@ int main(int argc, char **argv) {
int argOffset = optind;
#if HAVE_OPENMP
#ifdef _OPENMP
int available_threads = omp_get_max_threads();
if (max_threads < 0)

View File

@@ -43,7 +43,7 @@ int main(int /* argc */, char** argv) {
Opm::Deck deck = parser.parseFile(deck_file, parse_context, error_guard);
Opm::EclipseState state(deck);
Opm::Schedule schedule(deck, state, parse_context, error_guard, python);
Opm::SummaryConfig summary_config(deck, schedule, state.getTableManager(), state.aquifer(),
Opm::SummaryConfig summary_config(deck, schedule, state.fieldProps(), state.aquifer(),
parse_context, error_guard);
if (error_guard) {

View File

@@ -19,7 +19,7 @@
#include <getopt.h>
#include <vector>
#include <iostream>
#include <fmt/format.h>
#include <opm/parser/eclipse/Parser/Parser.hpp>

View File

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

View File

@@ -45,7 +45,7 @@ inline void createDot(const Opm::Schedule& schedule, const std::string& casename
os << "// Convert output to PDF with 'dot -Tpdf " << casename << ".gv > " << casename << ".pdf'\n";
os << "strict digraph \"" << casename << "\"\n{\n";
const auto groupnames = schedule.groupNames();
const std::size_t last = schedule.getTimeMap().last();
const std::size_t last = schedule.size() - 1;
// Group -> Group relations.
for (const auto& gn : groupnames) {
const auto& g = schedule.getGroup(gn, last);

View File

@@ -3,7 +3,7 @@
declare -A configurations
declare -A EXTRA_MODULE_FLAGS
EXTRA_MODULE_FLAGS[opm-simulators]="-DBUILD_EBOS_EXTENSIONS=ON -DBUILD_EBOS_DEBUG_EXTENSIONS=ON -DBUILD_FLOW_VARIANTS=ON -DOPM_ENABLE_PYTHON=ON"
EXTRA_MODULE_FLAGS[opm-simulators]="-DBUILD_EBOS_EXTENSIONS=ON -DBUILD_EBOS_DEBUG_EXTENSIONS=ON -DBUILD_FLOW_VARIANTS=ON -DOPM_ENABLE_PYTHON=ON -DBUILD_FLOW_POLY_GRID=ON"
EXTRA_MODULE_FLAGS[opm-common]="-DOPM_ENABLE_PYTHON=ON -DOPM_ENABLE_EMBEDDED_PYTHON=ON -DOPM_INSTALL_PYTHON=ON"
# Parse revisions from trigger comment and setup arrays

View File

@@ -1,9 +1,10 @@
#ifndef ISIM_MAIN_HPP
#define ISIM_MAIN_HPP
#include <chrono>
#include <functional>
#include <string>
#include <map>
#include <string>
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
#include <opm/parser/eclipse/Deck/Deck.hpp>
@@ -44,7 +45,7 @@ public:
void well_rate(const std::string& well, data::Rates::opt rate, std::function<well_rate_function> func);
void solution(const std::string& field, std::function<solution_function> func);
void run(Schedule& schedule, EclipseIO& io, bool report_only);
void post_step(Schedule& schedule, Action::State& action_state, SummaryState& st, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& group_nwrk_data, size_t report_step);
void post_step(Schedule& schedule, Action::State& action_state, SummaryState& st, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& group_nwrk_data, size_t report_step, const time_point& sim_time);
private:
void run_step(const Schedule& schedule, Action::State& action_state, SummaryState& st, UDQState& udq_state, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& group_nwrk_data, size_t report_step, EclipseIO& io) const;

View File

@@ -19,6 +19,7 @@
#include <iostream>
#include <opm/output/eclipse/Inplace.hpp>
#include <opm/output/eclipse/EclipseIO.hpp>
#include <opm/output/eclipse/RestartValue.hpp>
#include <opm/output/eclipse/Summary.hpp>
@@ -46,7 +47,7 @@ msim::msim(const EclipseState& state_arg) :
void msim::run(Schedule& schedule, EclipseIO& io, bool report_only) {
const double week = 7 * 86400;
data::Solution sol;
SummaryState st(std::chrono::system_clock::from_time_t(schedule.getStartTime()));
SummaryState st(TimeService::from_time_t(schedule.getStartTime()));
UDQState udq_state(schedule.getUDQConfig(0).params().undefinedValue());
Action::State action_state;
Python python;
@@ -61,7 +62,8 @@ void msim::run(Schedule& schedule, EclipseIO& io, bool report_only) {
double time_step = std::min(week, 0.5*schedule.stepLength(report_step - 1));
run_step(schedule, action_state, st, udq_state, sol, well_data, group_nwrk_data, report_step, time_step, io);
}
post_step(schedule, action_state, st, sol, well_data, group_nwrk_data, report_step);
auto sim_time = TimeService::from_time_t( schedule.simTime(report_step) );
post_step(schedule, action_state, st, sol, well_data, group_nwrk_data, report_step, sim_time);
const auto& exit_status = schedule.exitStatus();
if (exit_status.has_value())
return;
@@ -73,18 +75,17 @@ UDAValue msim::uda_val() {
}
void msim::post_step(Schedule& schedule, Action::State& action_state, SummaryState& st, data::Solution& /* sol */, data::Wells& /* well_data */, data::GroupAndNetworkValues& /* grp_nwrk_data */, size_t report_step) {
const auto& actions = schedule.actions(report_step);
void msim::post_step(Schedule& schedule, Action::State& action_state, SummaryState& st, data::Solution& /* sol */, data::Wells& /* well_data */, data::GroupAndNetworkValues& /* grp_nwrk_data */, size_t report_step, const time_point& sim_time) {
const auto& actions = schedule[report_step].actions.get();
if (actions.empty())
return;
Action::Context context( st , schedule.getWListManager(report_step));
Action::Context context( st , schedule[report_step].wlist_manager.get());
auto sim_time = schedule.simTime(report_step);
for (const auto& action : actions.pending(action_state, sim_time)) {
for (const auto& action : actions.pending(action_state, std::chrono::system_clock::to_time_t(sim_time))) {
auto result = action->eval(context);
if (result)
schedule.applyAction(report_step, *action, result);
schedule.applyAction(report_step, sim_time, *action, result, {});
}
for (const auto& pyaction : actions.pending_python())
@@ -115,13 +116,14 @@ void msim::run_step(const Schedule& schedule, Action::State& action_state, Summa
io.summary().eval(st,
report_step,
seconds_elapsed,
this->state,
schedule,
well_data,
group_nwrk_data,
{},
{},
{},
{});
schedule.getUDQConfig( report_step ).eval(report_step, st, udq_state);
schedule.getUDQConfig( report_step ).eval(report_step, schedule.wellMatcher(report_step), st, udq_state);
this->output(action_state,
st,

View File

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

View File

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

View File

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

View File

@@ -61,8 +61,26 @@ public:
return value;
}
template<typename T>
void put_vector(const std::vector<T>& values) {
this->put(values.size());
this->pack(values.data(), values.size() * sizeof(T));
}
template<typename T>
std::vector<T> get_vector() {
std::size_t size = this->get<std::size_t>();
std::vector<T> values(size);
for (std::size_t index=0; index < size; index++)
values[index] = this->get<T>();
return values;
}
template<typename K, typename T>
void put(const std::unordered_map<K,T>& values) {
void put_map(const std::unordered_map<K,T>& values) {
this->put(values.size());
for (const auto& value_pair : values) {
this->put(value_pair.first);
@@ -71,7 +89,7 @@ public:
}
template<typename K, typename T>
std::unordered_map<K,T> get() {
std::unordered_map<K,T> get_map() {
std::unordered_map<K,T> values;
auto size = this->get<std::size_t>();
for (std::size_t index = 0; index < size; index++) {

View File

@@ -22,9 +22,25 @@
#include <chrono>
#include <ctime>
#include <string>
#include <unordered_map>
namespace Opm {
using time_point = std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<int64_t, std::ratio<1,1000>>>;
namespace TimeService {
std::time_t to_time_t(const time_point& tp);
time_point from_time_t(std::time_t t);
time_point now();
std::time_t advance(const std::time_t tp, const double sec);
std::time_t makeUTCTime(std::tm timePoint);
const std::unordered_map<std::string , int>& eclipseMonthIndices();
bool valid_month(const std::string& month_name);
}
class TimeStampUTC
{
public:

View File

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

View File

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

View File

@@ -20,6 +20,7 @@
#define OPM_IO_EGRID_HPP
#include <opm/io/eclipse/EclFile.hpp>
#include <opm/common/utility/FileSystem.hpp>
#include <array>
#include <iostream>
@@ -34,7 +35,7 @@ namespace Opm { namespace EclIO {
class EGrid : public EclFile
{
public:
explicit EGrid(const std::string& filename);
explicit EGrid(const std::string& filename, std::string grid_name = "global");
int global_index(int i, int j, int k) const;
int active_index(int i, int j, int k) const;
@@ -44,20 +45,54 @@ public:
std::array<int, 3> ijk_from_active_index(int actInd) const;
std::array<int, 3> ijk_from_global_index(int globInd) const;
void getCellCorners(int globindex, std::array<double,8>& X, std::array<double,8>& Y, std::array<double,8>& Z) const;
void getCellCorners(const std::array<int, 3>& ijk, std::array<double,8>& X, std::array<double,8>& Y, std::array<double,8>& Z) const;
void getCellCorners(int globindex, std::array<double,8>& X, std::array<double,8>& Y, std::array<double,8>& Z);
void getCellCorners(const std::array<int, 3>& ijk, std::array<double,8>& X, std::array<double,8>& Y, std::array<double,8>& Z);
int activeCells() const { return nactive; }
int totalNumberOfCells() const { return nijk[0] * nijk[1] * nijk[2]; }
void load_grid_data();
void load_nnc_data();
bool is_radial() const { return m_radial; }
const std::vector<int>& hostCellsGlobalIndex() const { return host_cells; }
std::vector<std::array<int, 3>> hostCellsIJK();
// zero based: i1, j1,k1, i2,j2,k2, transmisibility
using NNCentry = std::tuple<int, int, int, int, int, int, float>;
std::vector<NNCentry> get_nnc_ijk();
const std::vector<std::string>& list_of_lgrs() const { return lgr_names; }
private:
Opm::filesystem::path inputFileName, initFileName;
std::string m_grid_name;
bool m_radial;
std::array<int, 3> nijk;
std::array<int, 3> host_nijk;
int nactive;
mutable bool m_nncs_loaded;
std::vector<int> act_index;
std::vector<int> glob_index;
std::vector<float> coord_array;
std::vector<float> zcorn_array;
std::vector<int> nnc1_array;
std::vector<int> nnc2_array;
std::vector<float> transnnc_array;
std::vector<int> host_cells;
std::vector<std::string> lgr_names;
int zcorn_array_index;
int coord_array_index;
int actnum_array_index;
int nnc1_array_index;
int nnc2_array_index;
};
}} // namespace Opm::EclIO

102
opm/io/eclipse/EInit.hpp Normal file
View File

@@ -0,0 +1,102 @@
/*
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
(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_IO_EINIT_HPP
#define OPM_IO_EINIT_HPP
#include <opm/io/eclipse/EclFile.hpp>
#include <array>
#include <vector>
#include <map>
namespace Opm { namespace EclIO {
class EInit : public EclFile
{
public:
explicit EInit(const std::string& filename);
const std::vector<std::string>& list_of_lgrs() const { return lgr_names; }
std::vector<EclFile::EclEntry> list_arrays() const;
std::vector<EclFile::EclEntry> list_arrays(const std::string& grid_name) const;
const std::array<int, 3>& grid_dimension(const std::string& grid_name = "global") const;
int activeCells(const std::string& grid_name = "global") const;
bool hasLGR(const std::string& name) const;
template <typename T>
const std::vector<T>& getInitData(const std::string& name, const std::string& grid_name = "global")
{
return this->ImplgetInitData<T>(name, grid_name);
}
protected:
template <typename T>
const std::vector<T>& ImplgetInitData(const std::string& name, const std::string& grid_name = "global")
{
int arr_ind = get_array_index(name, grid_name);
if constexpr (std::is_same_v<T, int>)
return getImpl(arr_ind, INTE, inte_array, "integer");
if constexpr (std::is_same_v<T, float>)
return getImpl(arr_ind, REAL, real_array, "float");
if constexpr (std::is_same_v<T, double>)
return getImpl(arr_ind, DOUB, doub_array, "double");
if constexpr (std::is_same_v<T, bool>)
return getImpl(arr_ind, LOGI, logi_array, "bool");
if constexpr (std::is_same_v<T, std::string>)
{
if (array_type[arr_ind] == Opm::EclIO::CHAR)
return getImpl(arr_ind, array_type[arr_ind], char_array, "char");
if (array_type[arr_ind] == Opm::EclIO::C0NN)
return getImpl(arr_ind, array_type[arr_ind], char_array, "c0nn");
OPM_THROW(std::runtime_error, "Array not of type CHAR or C0nn");
}
OPM_THROW(std::runtime_error, "type not supported");
}
private:
std::array<int, 3> global_nijk;
std::vector<std::array<int, 3>> lgr_nijk;
int global_nactive;
std::vector<int> lgr_nactive;
std::vector<std::string> lgr_names;
std::map<std::string,int> global_array_index;
std::vector<std::map<std::string,int>> lgr_array_index;
int get_array_index(const std::string& name, const std::string& grid_name) const;
int get_lgr_index(const std::string& grid_name) const;
};
}} // namespace Opm::EclIO
#endif // OPM_IO_EINIT_HPP

View File

@@ -27,6 +27,7 @@
#include <unordered_map>
#include <vector>
namespace Opm { namespace EclIO { namespace OutputStream {
class Restart;
}}}
@@ -37,43 +38,73 @@ class ERst : public EclFile
{
public:
explicit ERst(const std::string& filename);
bool hasReportStepNumber(int number) const;
bool hasLGR(const std::string& gridname, int reportStepNumber) const;
void loadReportStepNumber(int number);
template <typename T>
const std::vector<T>& getRst(const std::string& name, int reportStepNumber, int occurrence);
const std::vector<T>& getRestartData(const std::string& name, int reportStepNumber)
{
return getRestartData<T>(name,reportStepNumber, 0);
}
template <typename T>
const std::vector<T>& getRst(int index, int reportStepNumber){
const std::vector<T>& getRestartData(const std::string& name, int reportStepNumber, int occurrence);
template <typename T>
const std::vector<T>& getRestartData(const std::string& name, int reportStepNumber, const std::string& lgr_name);
template <typename T>
const std::vector<T>& getRestartData(int index, int reportStepNumber)
{
auto indRange = this->getIndexRange(reportStepNumber);
return this->get<T>(index + std::get<0>(indRange));
}
int count(const std::string& name, int reportStepNumber) const;
template <typename T>
const std::vector<T>& getRestartData(int index, int reportStepNumber, const std::string& lgr_name)
{
auto indRange = this->getIndexRange(reportStepNumber);
if ((std::get<0>(indRange) + index) > std::get<1>(indRange))
OPM_THROW(std::invalid_argument, "getRestartData, index out of range");
int start_ind = get_start_index_lgrname(reportStepNumber, lgr_name);
return this->get<T>(index + start_ind);
}
int occurrence_count(const std::string& name, int reportStepNumber) const;
size_t numberOfReportSteps() const { return seqnum.size(); };
const std::vector<int>& listOfReportStepNumbers() const { return seqnum; }
std::vector<EclEntry> listOfRstArrays(int reportStepNumber);
std::vector<EclEntry> listOfRstArrays(int reportStepNumber, const std::string& lgr_name);
friend class OutputStream::Restart;
private:
int nReports;
std::vector<int> seqnum; // report step numbers, from SEQNUM array in restart file
std::unordered_map<int,bool> reportLoaded;
mutable std::unordered_map<int,bool> reportLoaded;
std::map<int, std::pair<int,int>> arrIndexRange; // mapping report step number to array indeces (start and end)
std::vector<std::vector<std::string>> lgr_names; // report step numbers, from SEQNUM array in restart file
void initUnified();
void initSeparate(const int number);
int getArrayIndex(const std::string& name, int seqnum, int occurrence) const;
std::tuple<int,int> getIndexRange(int reportStepNumber) const;
int get_start_index_lgrname(int number, const std::string& lgr_name);
int getArrayIndex(const std::string& name, int seqnum, int occurrence);
int getArrayIndex(const std::string& name, int number, const std::string& lgr_name);
std::tuple<int,int> getIndexRange(int reportStepNumber) const;
std::streampos
restartStepWritePosition(const int seqnumValue) const;
};
}} // namespace Opm::EclIO

View File

@@ -28,6 +28,7 @@
#include <stdint.h>
#include <opm/common/utility/FileSystem.hpp>
#include <opm/common/utility/TimeService.hpp>
#include <opm/io/eclipse/SummaryNode.hpp>
namespace Opm { namespace EclIO {
@@ -48,18 +49,18 @@ public:
const std::vector<float>& get(const std::string& name) const;
const std::vector<float>& get(const SummaryNode& node) const;
std::vector<std::chrono::system_clock::time_point> dates() const;
std::vector<time_point> dates() const;
std::vector<float> get_at_rstep(const std::string& name) const;
std::vector<float> get_at_rstep(const SummaryNode& node) const;
std::vector<std::chrono::system_clock::time_point> dates_at_rstep() const;
std::vector<time_point> dates_at_rstep() const;
void LoadData(const std::vector<std::string>& vectList) const;
void LoadData() const;
bool make_lodsmry_file();
std::chrono::system_clock::time_point startdate() const { return startdat; }
time_point startdate() const { return startdat; }
const std::vector<std::string>& keywordList() const;
std::vector<std::string> keywordList(const std::string& pattern) const;
@@ -101,7 +102,7 @@ private:
std::vector<SummaryNode> summaryNodes;
std::unordered_map<std::string, std::string> kwunits;
std::chrono::system_clock::time_point startdat;
time_point startdat;
std::vector<std::string> checkForMultipleResultFiles(const Opm::filesystem::path& rootN, bool formatted) const;

View File

@@ -35,8 +35,13 @@ namespace Opm { namespace EclIO {
class EclFile
{
public:
struct Formatted {
bool value;
};
explicit EclFile(const std::string& filename, bool preload = false);
bool formattedInput() { return formatted; }
EclFile(const std::string& filename, Formatted fmt, bool preload = false);
bool formattedInput() const { return formatted; }
void loadData(); // load all data
void loadData(const std::string& arrName); // load all arrays with array name equal to arrName
@@ -55,6 +60,8 @@ public:
using EclEntry = std::tuple<std::string, eclArrType, int64_t>;
std::vector<EclEntry> getList() const;
const std::vector<int>& getElementSizeList() const { return array_element_size; }
template <typename T>
const std::vector<T>& get(int arrIndex);
@@ -66,6 +73,7 @@ public:
const std::vector<std::string>& arrayNames() const { return array_name; }
std::size_t size() const;
bool is_ix() const;
protected:
bool formatted;
@@ -80,6 +88,7 @@ protected:
std::vector<std::string> array_name;
std::vector<eclArrType> array_type;
std::vector<int64_t> array_size;
std::vector<int> array_element_size;
std::vector<uint64_t> ifStreamPos;
@@ -110,7 +119,11 @@ private:
void loadBinaryArray(std::fstream& fileH, std::size_t arrIndex);
void loadFormattedArray(const std::string& fileStr, std::size_t arrIndex, int64_t fromPos);
void load(bool preload);
std::vector<unsigned int> get_bin_logi_raw_values(int arrIndex) const;
std::vector<std::string> get_fmt_real_raw_str_values(int arrIndex) const;
};
}} // namespace Opm::EclIO

View File

@@ -24,26 +24,28 @@
namespace Opm { namespace EclIO {
// type MESS have no assisiated data
// type MESS have no assisiated data
enum eclArrType {
INTE, REAL, DOUB, CHAR, LOGI, MESS
INTE, REAL, DOUB, CHAR, LOGI, MESS, C0NN
};
// named constants related to binary file format
const unsigned int true_value = 0xffffffff;
const unsigned int true_value_ecl = 0xffffffff;
const unsigned int true_value_ix = 0x1000000;
const unsigned int false_value = 0x00000000;
const int sizeOfInte = 4; // number of bytes pr integer (inte) element
const int sizeOfReal = 4; // number of bytes pr float (real) element
const int sizeOfDoub = 8; // number of bytes pr double (doub) element
const int sizeOfLogi = 4; // number of bytes pr bool (logi) element
const int sizeOfChar = 8; // number of bytes pr string (char) element
const int MaxBlockSizeInte = 4000; // Maximum block size for INTE arrays in binary files
const int MaxBlockSizeReal = 4000; // Maximum block size for REAL arrays in binary files
const int MaxBlockSizeDoub = 8000; // Maximum block size for DOUB arrays in binary files
const int MaxBlockSizeLogi = 4000; // Maximum block size for LOGI arrays in binary files
const int MaxBlockSizeChar = 840; // Maximum block size for CHAR arrays in binary files
const int MaxBlockSizeInte = 4000; // Maximum block size for INTE arrays in binary files
const int MaxBlockSizeReal = 4000; // Maximum block size for REAL arrays in binary files
const int MaxBlockSizeDoub = 8000; // Maximum block size for DOUB arrays in binary files
const int MaxBlockSizeLogi = 4000; // Maximum block size for LOGI arrays in binary files
const int MaxBlockSizeChar = 840; // Maximum block size for CHAR arrays in binary files
// named constants related to formatted file file format
const int MaxNumBlockInte = 1000; // maximum number of Inte values in block => hard line shift
@@ -52,17 +54,17 @@ namespace Opm { namespace EclIO {
const int MaxNumBlockLogi = 1000; // maximum number of Logi values in block => hard line shift
const int MaxNumBlockChar = 105; // maximum number of Char values in block => hard line shift
const int numColumnsInte = 6; // number of columns for Inte values
const int numColumnsReal = 4; // number of columns for Real values
const int numColumnsDoub = 3; // number of columns for Doub values
const int numColumnsLogi = 25; // number of columns for Logi values
const int numColumnsChar = 7; // number of columns for Char values
const int numColumnsInte = 6; // number of columns for Inte values
const int numColumnsReal = 4; // number of columns for Real values
const int numColumnsDoub = 3; // number of columns for Doub values
const int numColumnsLogi = 25; // number of columns for Logi values
const int numColumnsChar = 7; // number of columns for Char values
const int columnWidthInte = 12; // number of characters fore each Inte Element
const int columnWidthReal = 17; // number of characters fore each Inte Element
const int columnWidthDoub = 23; // number of characters fore each Inte Element
const int columnWidthLogi = 3; // number of characters fore each Inte Element
const int columnWidthChar = 11; // number of characters fore each Inte Element
const int columnWidthInte = 12; // number of characters fore each Inte Element
const int columnWidthReal = 17; // number of characters fore each Inte Element
const int columnWidthDoub = 23; // number of characters fore each Inte Element
const int columnWidthLogi = 3; // number of characters fore each Inte Element
const int columnWidthChar = 11; // number of characters fore each Inte Element
}} // namespace Opm::EclIO

View File

@@ -47,59 +47,71 @@ public:
const std::vector<T>& data)
{
eclArrType arrType = MESS;
int element_size = 4;
if (typeid(T) == typeid(int))
arrType = INTE;
else if (typeid(T) == typeid(float))
arrType = REAL;
else if (typeid(T) == typeid(double))
else if (typeid(T) == typeid(double)){
arrType = DOUB;
else if (typeid(T) == typeid(bool))
element_size = 8;
} else if (typeid(T) == typeid(bool))
arrType = LOGI;
else if (typeid(T) == typeid(char))
arrType = MESS;
if (isFormatted)
{
writeFormattedHeader(name, data.size(), arrType);
writeFormattedHeader(name, data.size(), arrType, element_size);
if (arrType != MESS)
writeFormattedArray(data);
}
else
{
writeBinaryHeader(name, data.size(), arrType);
writeBinaryHeader(name, data.size(), arrType, element_size);
if (arrType != MESS)
writeBinaryArray(data);
}
}
// when this function is used array type will be assumed C0NN (not CHAR).
// Also in cases where element size is 8 or less, element size will be 8.
void write(const std::string& name, const std::vector<std::string>& data, int element_size);
void message(const std::string& msg);
void flushStream();
void set_ix() { ix_standard = true; }
friend class OutputStream::Restart;
friend class OutputStream::SummarySpecification;
private:
void writeBinaryHeader(const std::string& arrName, int64_t size, eclArrType arrType);
void writeBinaryHeader(const std::string& arrName, int64_t size, eclArrType arrType, int element_size);
template <typename T>
void writeBinaryArray(const std::vector<T>& data);
void writeBinaryCharArray(const std::vector<std::string>& data);
void writeBinaryCharArray(const std::vector<std::string>& data, int element_size);
void writeBinaryCharArray(const std::vector<PaddedOutputString<8>>& data);
void writeFormattedHeader(const std::string& arrName, int size, eclArrType arrType);
void writeFormattedHeader(const std::string& arrName, int size, eclArrType arrType, int element_size);
template <typename T>
void writeFormattedArray(const std::vector<T>& data);
void writeFormattedCharArray(const std::vector<std::string>& data);
void writeFormattedCharArray(const std::vector<std::string>& data, int element_size);
void writeFormattedCharArray(const std::vector<PaddedOutputString<8>>& data);
void writeArrayType(const eclArrType arrType);
std::string make_real_string(float value) const;
std::string make_doub_string(double value) const;
std::string make_real_string_ecl(float value) const;
std::string make_real_string_ix(float value) const;
std::string make_doub_string_ecl(double value) const;
std::string make_doub_string_ix(double value) const;
bool isFormatted;
bool isFormatted, ix_standard;
std::ofstream ofileH;
};

View File

@@ -35,41 +35,49 @@ namespace Opm { namespace EclIO {
bool isEOF(std::fstream* fileH);
bool fileExists(const std::string& filename);
bool isFormatted(const std::string& filename);
bool is_number(const std::string& numstr);
std::tuple<int, int> block_size_data_binary(eclArrType arrType);
std::tuple<int, int, int> block_size_data_formatted(eclArrType arrType);
std::string trimr(const std::string &str1);
uint64_t sizeOnDiskBinary(int64_t num, Opm::EclIO::eclArrType arrType);
uint64_t sizeOnDiskFormatted(const int64_t num, Opm::EclIO::eclArrType arrType);
uint64_t sizeOnDiskBinary(int64_t num, Opm::EclIO::eclArrType arrType, int elementSize);
uint64_t sizeOnDiskFormatted(const int64_t num, Opm::EclIO::eclArrType arrType, int elementSize);
void readBinaryHeader(std::fstream& fileH, std::string& tmpStrName,
int& tmpSize, std::string& tmpStrType);
void readBinaryHeader(std::fstream& fileH, std::string& arrName,
int64_t& size, Opm::EclIO::eclArrType &arrType);
int64_t& size, Opm::EclIO::eclArrType &arrType, int& elementSize);
void readFormattedHeader(std::fstream& fileH, std::string& arrName,
int64_t &num, Opm::EclIO::eclArrType &arrType);
int64_t &num, Opm::EclIO::eclArrType &arrType, int& elementSize);
template<typename T, typename T2>
std::vector<T> readBinaryArray(std::fstream& fileH, const int64_t size, Opm::EclIO::eclArrType type,
std::function<T(T2)>& flip);
std::function<T(T2)>& flip, int elementSize);
std::vector<int> readBinaryInteArray(std::fstream &fileH, const int64_t size);
std::vector<float> readBinaryRealArray(std::fstream& fileH, const int64_t size);
std::vector<double> readBinaryDoubArray(std::fstream& fileH, const int64_t size);
std::vector<bool> readBinaryLogiArray(std::fstream &fileH, const int64_t size);
std::vector<unsigned int> readBinaryRawLogiArray(std::fstream &fileH, const int64_t size);
std::vector<std::string> readBinaryCharArray(std::fstream& fileH, const int64_t size);
std::vector<std::string> readBinaryC0nnArray(std::fstream& fileH, const int64_t size, int elementSize);
template<typename T>
std::vector<T> readFormattedArray(const std::string& file_str, const int size, int64_t fromPos,
std::function<T(const std::string&)>& process);
std::vector<int> readFormattedInteArray(const std::string& file_str, const int64_t size, int64_t fromPos);
std::vector<std::string> readFormattedCharArray(const std::string& file_str, const int64_t size, int64_t fromPos);
std::vector<std::string> readFormattedCharArray(const std::string& file_str, const int64_t size,
int64_t fromPos, int elementSize);
std::vector<float> readFormattedRealArray(const std::string& file_str, const int64_t size, int64_t fromPos);
std::vector<std::string> readFormattedRealRawStrings(const std::string& file_str, const int64_t size, int64_t fromPos);
std::vector<bool> readFormattedLogiArray(const std::string& file_str, const int64_t size, int64_t fromPos);
std::vector<double> readFormattedDoubArray(const std::string& file_str, const int64_t size, int64_t fromPos);

View File

@@ -21,6 +21,7 @@
#define OPM_IO_OUTPUTSTREAM_HPP_INCLUDED
#include <opm/io/eclipse/PaddedOutputString.hpp>
#include <opm/common/utility/TimeService.hpp>
#include <array>
#include <chrono>
@@ -362,7 +363,7 @@ namespace Opm { namespace EclIO { namespace OutputStream {
class SummarySpecification
{
public:
using StartTime = std::chrono::system_clock::time_point;
using StartTime = time_point;
enum class UnitConvention
{

View File

@@ -48,6 +48,7 @@ struct SummaryNode {
Pressure,
Count,
Mode,
ProdIndex,
Undefined,
};
@@ -56,7 +57,8 @@ struct SummaryNode {
Type type;
std::string wgname;
int number;
std::string fip_region;
std::optional<std::string> fip_region;
constexpr static int default_number { std::numeric_limits<int>::min() };

View File

@@ -44,6 +44,7 @@ struct RstGroup {
int prod_cmode;
int winj_cmode;
int ginj_cmode;
int guide_rate_def;
float oil_rate_limit;
float water_rate_limit;

View File

@@ -84,9 +84,6 @@ struct RstHeader {
int nilbrz;
int ntfip ;
int nmfipr;
int nrfreg;
int ntfreg;
int nplmix;
int ngroup;
int nwgmax;

View File

@@ -69,12 +69,13 @@ struct RstWell {
int well_status;
int active_control;
int vfp_table;
int pred_requested_control;
bool allow_xflow;
int preferred_phase;
int hist_requested_control;
int msw_index;
int completion_ordering;
int pvt_table;
int msw_pressure_drop_model;
float orat_target;
float wrat_target;

View File

@@ -22,9 +22,7 @@
#include <map>
#include <memory>
#include <vector>
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
#include <string>
namespace Opm { namespace data {
@@ -34,43 +32,128 @@ namespace Opm { namespace data {
*/
enum class AquiferType
{
Fetkovich, CarterTracey,
Fetkovich, CarterTracy, Numerical,
};
struct FetkovichData {
struct FetkovichData
{
double initVolume;
double prodIndex;
double timeConstant;
};
struct AquiferData {
int aquiferID; //< One-based ID, range 1..NANAQ
double pressure; //< Aquifer pressure
double fluxRate; //< Aquifer influx rate (liquid aquifer)
// TODO: volume should have a better name, since meaning not clear
double volume; //< Produced liquid volume
double initPressure; //< Aquifer's initial pressure
double datumDepth; //< Aquifer's pressure reference depth
struct CarterTracyData
{
double dimensionless_time;
double dimensionless_pressure;
};
struct AquiferData
{
int aquiferID = 0; //< One-based ID, range 1..NANAQ
double pressure = 0.0; //< Aquifer pressure
double fluxRate = 0.0; //< Aquifer influx rate (liquid aquifer)
double volume = 0.0; //< Produced liquid volume
double initPressure = 0.0; //< Aquifer's initial pressure
double datumDepth = 0.0; //< Aquifer's pressure reference depth
AquiferType type;
std::shared_ptr<FetkovichData> aquFet;
std::shared_ptr<CarterTracyData> aquCT;
double get(const std::string& key) const
{
if ( key == "AAQR" ) {
return this->fluxRate;
} else if ( key == "AAQT" ) {
return this->volume;
} else if ( key == "AAQP" ) {
return this->pressure;
}
return 0.;
}
double get(const std::string& key) const;
// MessageBufferType API should be similar to Dune::MessageBufferIF
template <class MessageBufferType>
void write(MessageBufferType& buffer) const;
// MessageBufferType API should be similar to Dune::MessageBufferIF
template <class MessageBufferType>
void read(MessageBufferType& buffer);
};
// TODO: not sure what extension we will need
using Aquifers = std::map<int, AquiferData>;
inline double AquiferData::get(const std::string& key) const
{
if ((key == "AAQR") || (key == "ANQR")) {
return this->fluxRate;
}
else if ((key == "AAQT") || (key == "ANQT")) {
return this->volume;
}
else if ((key == "AAQP") || (key == "ANQP")) {
return this->pressure;
}
else if ((key == "AAQTD") && (this->aquCT != nullptr)) {
return this->aquCT->dimensionless_time;
}
else if ((key == "AAQPD") && (this->aquCT != nullptr)) {
return this->aquCT->dimensionless_pressure;
}
return 0.0;
}
template <class MessageBufferType>
void AquiferData::write(MessageBufferType& buffer) const
{
buffer.write(this->aquiferID);
buffer.write(this->pressure);
buffer.write(this->fluxRate);
buffer.write(this->volume);
buffer.write(this->initPressure);
buffer.write(this->datumDepth);
const int aqu = (this->aquFet != nullptr) + 2*(this->aquCT != nullptr);
buffer.write(aqu);
if (this->aquFet != nullptr) {
buffer.write(this->aquFet->initVolume);
buffer.write(this->aquFet->prodIndex);
buffer.write(this->aquFet->timeConstant);
}
else if (this->aquCT != nullptr) {
buffer.write(this->aquCT->dimensionless_time);
buffer.write(this->aquCT->dimensionless_pressure);
}
}
template <class MessageBufferType>
void AquiferData::read(MessageBufferType& buffer)
{
buffer.read(this->aquiferID);
buffer.read(this->pressure);
buffer.read(this->fluxRate);
buffer.read(this->volume);
buffer.read(this->initPressure);
buffer.read(this->datumDepth);
int aqu;
buffer.read(aqu);
if (aqu == 1) {
this->type = AquiferType::Fetkovich;
if (this->aquFet == nullptr) {
this->aquFet = std::make_shared<FetkovichData>();
}
buffer.read(this->aquFet->initVolume);
buffer.read(this->aquFet->prodIndex);
buffer.read(this->aquFet->timeConstant);
}
else if (aqu == 2) {
this->type = AquiferType::CarterTracy;
if (this->aquCT == nullptr) {
this->aquCT = std::make_shared<CarterTracyData>();
}
buffer.read(this->aquCT->dimensionless_time);
buffer.read(this->aquCT->dimensionless_pressure);
}
}
}} // Opm::data
#endif // OPM_OUTPUT_AQUIFER_HPP

View File

@@ -197,7 +197,7 @@ namespace Opm {
private:
constexpr static std::size_t numvals = 5;
std::array<double, numvals> values_;
std::array<double, numvals> values_ = {0};
std::size_t index(const Value ix) const
{
@@ -255,6 +255,9 @@ namespace Opm {
double thp;
double temperature;
int control;
::Opm::Well::Status dynamicStatus { Opm::Well::Status::OPEN };
std::vector< Connection > connections;
std::unordered_map<std::size_t, Segment> segments;
CurrentControl current_control;
@@ -538,6 +541,12 @@ namespace Opm {
buffer.write(this->thp);
buffer.write(this->temperature);
buffer.write(this->control);
{
const auto status = ::Opm::Well::Status2String(this->dynamicStatus);
buffer.write(status);
}
unsigned int size = this->connections.size();
buffer.write(size);
for (const Connection& comp : this->connections)
@@ -621,6 +630,12 @@ namespace Opm {
buffer.read(this->temperature);
buffer.read(this->control);
{
auto status = std::string{};
buffer.read(status);
this->dynamicStatus = ::Opm::Well::StatusFromString(status);
}
// Connection information
unsigned int size = 0.0; //this->connections.size();
buffer.read(size);

View File

@@ -0,0 +1,75 @@
/*
Copyright (c) 2021 Equinor ASA
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_ACTIVE_INDEX_BY_COLUMNS_HPP
#define OPM_ACTIVE_INDEX_BY_COLUMNS_HPP
#include <array>
#include <cassert>
#include <cstddef>
#include <functional>
#include <vector>
namespace Opm {
class EclipseGrid;
}
namespace Opm {
/// Special purpose mapping facility to handle the output code's need to
/// enumerate the active cells by columns (layer ID (K) cycling fastest,
/// followed by J, followed by I) for aquifer connections.
class ActiveIndexByColumns
{
public:
bool operator==(const ActiveIndexByColumns& rhs) const;
/// Create natural->columnar active cell index mapping.
///
/// \param[in] numActive Number of active cells in model.
/// \param[in] cartDims Model's Cartesian dimensions.
/// \param[in] getIJK Call-back routine for retrieving the Cartesian
/// (I,J,K) tuple of an active cell index.
explicit ActiveIndexByColumns(const std::size_t numActive,
const std::array<int, 3>& cartDims,
const std::function<std::array<int, 3>(const std::size_t)>& getIJK);
/// Map active index in natural order to active index in columnar order.
///
/// The output code needs return type \c int here, so use that instead
/// of \code std::size_t \endcode.
int getColumnarActiveIndex(const std::size_t naturalActiveIndex) const
{
assert ((naturalActiveIndex < this->natural2columnar_.size())
&& "Natural active cell index out of bounds");
return this->natural2columnar_[naturalActiveIndex];
}
private:
std::vector<int> natural2columnar_;
};
/// Build natural->columnar active cell index mapping from an EclipseGrid instance.
ActiveIndexByColumns buildColumnarActiveIndexMappingTables(const EclipseGrid& grid);
} // namespace Opm
#endif // OPM_ACTIVE_INDEX_BY_COLUMNS_HPP

View File

@@ -30,6 +30,7 @@ namespace Opm {
class EclipseGrid;
class Schedule;
class UnitSystem;
class SummaryState;
} // Opm
namespace Opm { namespace data {
@@ -47,6 +48,7 @@ namespace Opm { namespace RestartIO { namespace Helpers {
const Opm::EclipseGrid& grid,
const Opm::UnitSystem& units,
const Opm::data::WellRates& xw,
const Opm::SummaryState& summary_state,
const std::size_t sim_step);
const std::vector<int>& getIConn() const

View File

@@ -0,0 +1,116 @@
/*
Copyright (c) 2018 Statoil ASA
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_AGGREGATE_NETWORK_DATA_HPP
#define OPM_AGGREGATE_NETWORK_DATA_HPP
#include <opm/output/eclipse/WindowedArray.hpp>
#include <opm/io/eclipse/PaddedOutputString.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Network/ExtNetwork.hpp>
#include <cstddef>
#include <string>
#include <vector>
#include <map>
namespace Opm {
class EclipseState;
class Schedule;
class SummaryState;
//class Group;
class UnitSystem;
} // Opm
namespace Opm { namespace RestartIO { namespace Helpers {
class AggregateNetworkData
{
public:
explicit AggregateNetworkData(const std::vector<int>& inteHead);
void captureDeclaredNetworkData(const Opm::EclipseState& es,
const Opm::Schedule& sched,
const Opm::UnitSystem& units,
const std::size_t lookup_step,
const Opm::SummaryState& sumState,
const std::vector<int>& inteHead);
const std::vector<int>& getINode() const
{
return this->iNode_.data();
}
const std::vector<int>& getIBran() const
{
return this->iBran_.data();
}
const std::vector<int>& getINobr() const
{
return this->iNobr_.data();
}
const std::vector<double>& getRNode() const
{
return this->rNode_.data();
}
const std::vector<double>& getRBran() const
{
return this->rBran_.data();
}
const std::vector<EclIO::PaddedOutputString<8>>& getZNode() const
{
return this->zNode_.data();
}
private:
/// Aggregate 'INODE' array (Integer) for all nodes
WindowedArray<int> iNode_;
/// Aggregate 'IBRAN' array (Integer) for all branches
WindowedArray<int> iBran_;
/// Aggregate 'INOBR' array (Integer) for all nodes
WindowedArray<int> iNobr_;
/// Aggregate 'RNODE' array (Real) for all nodes.
WindowedArray<double> rNode_;
/// Aggregate 'RBRAN' array (Real) for all branches.
WindowedArray<double> rBran_;
/// Aggregate 'ZNODE' array (Character) for all wells.
WindowedArray<EclIO::PaddedOutputString<8>> zNode_;
/// Maximum number of wells in a group.
//int nWGMax_;
/// Maximum number of groups
//int nGMaxz_;
};
}}} // Opm::RestartIO::Helpers
#endif // OPM_AGGREGATE_NETWORK_DATA_HPP

View File

@@ -51,6 +51,12 @@ namespace Opm { namespace RestartIO {
double damping_fact;
};
struct liftOptPar {
double min_int;
double incr;
double min_ec_grad;
};
DoubHEAD();
~DoubHEAD() = default;
@@ -72,6 +78,7 @@ namespace Opm { namespace RestartIO {
DoubHEAD& udq_param(const UDQParams& udqPar);
DoubHEAD& guide_rate_param(const guideRate& guide_rp);
DoubHEAD& lift_opt_param(const liftOptPar& lo_par);
const std::vector<double>& data() const
{

View File

@@ -112,7 +112,7 @@ public:
* are not yet written to disk.
*/
void writeInitial( data::Solution simProps = data::Solution(), std::map<std::string, std::vector<int> > int_data = {}, const NNC& nnc = NNC());
void writeInitial( data::Solution simProps = data::Solution(), std::map<std::string, std::vector<int> > int_data = {}, const std::vector<NNCdata>& nnc = {});
/**
* \brief Overwrite the initial OIP values.

View File

@@ -0,0 +1,89 @@
/*
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
(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 ORIGINAL_OIP
#define ORIGINAL_OIP
#include <string>
#include <unordered_map>
#include <vector>
namespace Opm {
class Inplace {
public:
enum class Phase {
WATER = 0,
OIL = 1,
GAS = 2,
OilInLiquidPhase = 3,
OilInGasPhase = 4,
GasInLiquidPhase = 5,
GasInGasPhase = 6,
PoreVolume = 7,
// The Inplace class is implemented in close relation to the
// ecloutputblackoilmodule in opm-simulators, ane there are certainly
// idiosyncracies here due to that coupling. For instance the three enum
// values PressurePV, HydroCarbonPV and PressureHydroCarbonPV are *not*
// included in the return value from phases().
PressurePV = 8,
HydroCarbonPV = 9,
PressureHydroCarbonPV = 10
};
/*
The purpose of this class is to transport inplace values from the
simulator code to the summary output code. The code is written very much
to fit in with the current implementation in the simulator. The functions
which don't accept region_name & region_number arguments should be called
for totals, i.e. field properties.
*/
void add(const std::string& region, Phase phase, std::size_t region_number, double value);
void add(Phase phase, double value);
double get(const std::string& region, Phase phase, std::size_t region_number) const;
double get(Phase phase) const;
bool has(const std::string& region, Phase phase, std::size_t region_number) const;
bool has(Phase phase) const;
std::size_t max_region() const;
std::size_t max_region(const std::string& region_name) const;
/*
The get_vector functions return a vector length max_region() which
contains the values added with the add() function and indexed with
(region_number - 1). This is an incarnation of id <-> index confusion and
should be replaced with a std::map instead.
*/
std::vector<double> get_vector(const std::string& region, Phase phase) const;
static const std::vector<Phase>& phases();
private:
std::unordered_map<std::string, std::unordered_map<Phase, std::unordered_map<std::size_t, double>>> phase_values;
};
}
#endif

View File

@@ -41,6 +41,8 @@ namespace RestartIO {
int maxWellInGroup;
int maxGroupInField;
int maxWellsInField;
int mxwlstprwel;
int mxdynwlst;
};
struct WellSegDims {
@@ -61,6 +63,10 @@ namespace RestartIO {
int nplmix;
};
struct RockOpts {
int ttyp;
};
struct TimePoint {
int year;
int month; // 1..12
@@ -112,6 +118,20 @@ namespace RestartIO {
struct GuideRateNominatedPhase {
int nominated_phase;
};
struct NetworkDims {
int noactnod;
int noactbr;
int nodmax;
int nbrmax;
int nibran;
int nrbran;
int ninode;
int nrnode;
int nznode;
int ninobr;
};
InteHEAD();
~InteHEAD() = default;
@@ -139,13 +159,16 @@ namespace RestartIO {
InteHEAD& tuningParam(const TuningPar& tunpar);
InteHEAD& variousParam(const int version, const int iprog);
InteHEAD& wellSegDimensions(const WellSegDims& wsdim);
InteHEAD& networkDimensions(const NetworkDims& nwdim);
InteHEAD& regionDimensions(const RegDims& rdim);
InteHEAD& rockOpts(const RockOpts& rckop);
InteHEAD& ngroups(const Group& gr);
InteHEAD& udqParam_1(const UdqParam& udqpar);
InteHEAD& actionParam(const ActionParam& act_par);
InteHEAD& variousUDQ_ACTIONXParam();
InteHEAD& nominatedPhaseGuideRate(GuideRateNominatedPhase nphase);
InteHEAD& whistControlMode(int mode);
InteHEAD& liftOptParam(int in_enc);
const std::vector<int>& data() const
{

View File

@@ -106,6 +106,9 @@ namespace Opm { namespace RestartIO {
return this->data_;
}
/// Logical switch to indicate that the network option is used
///
LogiHEAD& network(const int maxNoNodes);
private:
std::vector<bool> data_;
};

View File

@@ -36,9 +36,12 @@ namespace out {
RegionCache(const std::set<std::string>& fip_regions, const FieldPropsManager& fp, const EclipseGrid& grid, const Schedule& schedule);
const std::vector<std::pair<std::string,size_t>>& connections( const std::string& region_name, int region_id ) const;
// A well is assigned to the region_id where the first connection is
std::vector<std::string> wells(const std::string& region_name, int region_id) const;
private:
std::vector<std::pair<std::string,size_t>> connections_empty;
std::map<std::pair<std::string, int> , std::vector<std::pair<std::string,size_t>>> connection_map;
std::map<std::pair<std::string, int>, std::vector<std::string>> well_map;
};
}
}

View File

@@ -20,12 +20,14 @@
#ifndef OPM_OUTPUT_SUMMARY_HPP
#define OPM_OUTPUT_SUMMARY_HPP
#include <opm/parser/eclipse/EclipseState/Schedule/Well/PAvgCalculatorCollection.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp>
#include <opm/output/data/Aquifer.hpp>
#include <map>
#include <memory>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
@@ -35,6 +37,7 @@ namespace Opm {
class Schedule;
class SummaryConfig;
class SummaryState;
class Inplace;
} // namespace Opm
namespace Opm { namespace data {
@@ -63,17 +66,19 @@ public:
void eval(SummaryState& summary_state,
const int report_step,
const double secs_elapsed,
const EclipseState& es,
const Schedule& schedule,
const data::WellRates& well_solution,
const data::GroupAndNetworkValues& group_and_nwrk_solution,
GlobalProcessParameters single_values,
const Inplace& initial_inplace,
const Inplace& inplace,
const PAvgCalculatorCollection& ,
const RegionParameters& region_values = {},
const BlockValues& block_values = {},
const data::Aquifers& aquifers_values = {}) const;
void write() const;
PAvgCalculatorCollection wbp_calculators(std::size_t report_step) const;
private:
class SummaryImplementation;

View File

@@ -67,6 +67,10 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
WaterRate = 1, // Surface flow rate (water)
GasRate = 2, // Surface Flow rate (gas)
OilRate_Copy = 17, // Surface flow rate (oil)
WaterRate_Copy = 18, // Surface flow rate (water)
GasRate_Copy = 19, // Surface Flow rate (gas)
Pressure = 34, // Connection pressure value
ResVRate = 49, // Reservoir voidage rate

View File

@@ -53,6 +53,9 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
GRpar_d = 90, // Guiderate parameter D
GRpar_e = 91, // Guiderate parameter E
GRpar_f = 92, // Guiderate parameter F
LOminInt = 93, // LIFTOP - Minimum interval between gas lift optimizations
LOincrsz = 95, // LIFTOPT - Increment size for lift gas injection rate
LOminEcGrad = 96, // LIFTOPT - Minimum economic gradient
GRpar_int = 97, // Guiderate parameter delay interval
ThrUPT = 99,
XxxDPR = 100,

View File

@@ -27,6 +27,7 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
namespace SGroup {
enum prod_index : std::vector<float>::size_type {
GuideRate = 2,
OilRateLimit = 6, // Group's oil production target/limit
WatRateLimit = 7, // Group's water production target/limit
GasRateLimit = 8, // Group's gas production target/limit
@@ -52,12 +53,40 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
namespace IGroup {
// Observe that these value should not be used as ordinary indices into
// the the IGRP vector, they should all be used as IGRP[NWGMAX + $index]
enum index : std::vector<int>::size_type {
ProdCMode = 1,
ProdActiveCMode = 1,
GuideRateDef = 6,
ExceedAction = 7,
WInjCMode = 16,
GConProdCMode = 10,
GInjCMode = 21,
GroupType = 26,
GroupLevel = 27,
ParentGroup = 28,
FlowingWells = 33,
};
namespace Value {
enum GuideRateMode : int {
None = 0,
Oil = 1,
Water = 2,
Gas = 3,
Liquid = 4,
Potn = 7,
Form = 8,
Comb = 9,
};
enum GroupType : int {
WellGroup = 0,
TreeGroup = 1,
};
}
}

View File

@@ -57,6 +57,8 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
NXWELZ = 26, // Number of delements per well in XWEL array
NZWELZ = 27, // Number of 8-character words per well in ZWEL array
MXWLSTPRWELL = 30, // Maximum number of well lists pr well
NICONZ = 32, // Number of data elements per completion
// in ICON array (default 19)
NSCONZ = 33, // Number of data elements per completion in SCON array
@@ -80,6 +82,8 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
NGCTRL = 51, // Index indicating if group control is used or not (1 - if group control, 0 if not)
NGRNPH = 58, // Index indicating if group control is used or not (1 - if group control, 0 if not)
EACHNCITS = 59, // Index indicating if lift gas distribution optimized each of the NUPCOL first iterations or not
// 1 - optimized only first newton iteration, 2 - optimized each of NUPCOL newton iterations
DAY = 64, // Calendar day of report step (1..31)
MONTH = 65, // Calendar month of report step (1..12)
@@ -101,6 +105,20 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
IPROG = 94, // IPROG = simulation program identifier: 100 - ECLIPSE 100, 300 - ECLIPSE 300, 500 - ECLIPSE 300
// (thermal option), negative - Other simulator,
NMFIPR = 99, // REGDIMS item2
ROCKOPTS_TABTYP = 103, // ROCKOPTS item3 (PVTNUM=1 - default)
NOACTNOD = 129 , // NOACTNOD = Number of active/defined nodes in the network
NOACTBR = 130 , // NOACTBR = Number of active/defined branches in the network
NODMAX = 131 , // NODMAX = maximum number of nodes in extended network option
NBRMAX = 132 , // NBRMAX = maximum number of branches in extended network option
NIBRAN = 133 , // NIBRAN = number of entries per branch in the IBRAN array
NRBRAN = 134 , // NRBRAN = number of tries per branch in the RBRAN array
NINODE = 135 , // NINODE = number of entries per node in the INODE array
NRNODE = 136 , // NRNODE = number of entries per node in the RNODE array
NZNODE = 137 , // NZNODE = number of entries per node in the ZNODE array
NINOBR = 138 , // NINOBR = size of the INOBR array
NOOFACTIONS = 156, // The number of actions in the dataset
MAXNOLINES = 157, // Maximum number of lines of schedule data for ACTION keyword - including ENDACTIO
MAXNOSTRPRLINE = 158, // Maximum number of 8-chars strings pr input line of Action data (rounded up from input)
@@ -131,6 +149,9 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
NO_IUADS = 290, // No IUADs
NO_IUAPS = 291, // No IUAPs
RSEED = 296,
MAXDYNWELLST = 302, // Maximum number of dynamic well lists (default = 1)
ISECND = 410 // ISECND = current simulation time HH:MM:SS - number of seconds (SS), reported in microseconds
// (0-59,999,999)
};

View File

@@ -40,6 +40,7 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
DirEPS = 17, // Directional end-point scaling
RevEPS = 18, // Reversible end-point scaling
AltEPS = 19, // Alternative (3-pt) end-point scaling
HasNetwork = 37, // Indicates Network option used
ConstCo = 38, // Constant oil compressibility (PVCDO)
HasMSWells = 75, // Whether or not model has MS Wells.
};

View File

@@ -25,6 +25,7 @@
namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems {
namespace ISeg {
enum index : std::vector<int>::size_type {
SegNo = 0, // Segment number (one-based)
OutSeg = 1, // Outlet segment (one-based)
@@ -66,24 +67,30 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
DeviceBaseStrength = 86,
ScalingFactor = 87,
CalibrFluidDensity = 88,
CalibrFluidViscosity = 89,
CriticalWaterFraction = 90,
TransitionRegWidth = 91,
MaxEmulsionRatio = 92,
FlowRateExponent = 95,
ViscFuncExponent = 96,
MaxValidFlowRate = 97,
ICDLength = 102,
ValveAreaFraction = 103,
item106 = 105, // Unknown
item107 = 106, // Unknown
item108 = 107, // Unknown
item109 = 108, // Unknown
item110 = 109, // Unknown
item111 = 110, // Unknown
flowFractionOilDensityExponent = 105,
flowFractionWaterDensityExponent = 106,
flowFractionGasDensityExponent = 107,
flowFractionOilViscosityExponent = 108,
flowFractionWaterViscosityExponent = 109,
flowFractionGasViscosityExponent = 110,
};
} // RSeg

View File

@@ -0,0 +1,66 @@
/*
Copyright (c) 2018 Equinor ASA
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_OUTPUT_ECLIPSE_VECTOR_NETWORK_HPP
#define OPM_OUTPUT_ECLIPSE_VECTOR_NETWORK_HPP
#include <vector>
namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems {
namespace INode {
enum index : std::vector<int>::size_type {
NoBranchesConnToNode = 0,
CumNoBranchesConnToNode = 1,
Group = 2,
FixedPresNode = 3,
};
}
namespace IBran {
enum index : std::vector<int>::size_type {
DownTreeNode = 0,
UpTreeNode = 1,
VfpTableNo = 2,
};
}
namespace RNode {
enum index : std::vector<double>::size_type {
NodePres = 0,
FixedPresNode = 1,
PressureLimit = 2,
};
}
namespace RBran {
enum index : std::vector<double>::size_type {
OilProdRate = 0,
WaterProdRate = 1,
GasProdRate = 2,
OilDensity = 8,
GasDensity = 9
};
}
}}}} // Opm::RestartIO::Helpers::VectorItems
#endif // OPM_OUTPUT_ECLIPSE_VECTOR_NETWORK_HPP

View File

@@ -39,8 +39,7 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
Status = 10, // Well status
VFPTab = 11, // ID (one-based) of well's current VFP table.
PredReqWCtrl = 15, // Well's requested control mode from
// simulation deck (WCONINJE, WCONPROD).
PreferredPhase = 15, // Well's preferred phase (from WELSPECS)
item18 = 17, // Unknown
XFlow = 22,
@@ -51,6 +50,8 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
HistReqWCtrl = 49, // Well's requested control mode from
// simulation deck (WCONHIST, WCONINJH)
LiftOpt = 53, // Well's lift gas injection to be calculated by optimisation or not
MsWID = 70, // Multisegment well ID
// Value 0 for regular wells
// Value 1..#MS wells for MS wells
@@ -111,6 +112,13 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
// COMPDAT keyword.
};
enum Preferred_Phase : int {
Oil = 1,
Water = 2,
Gas = 3,
Liquid = 4,
};
enum PLossMod : int {
HFA = 0, // Components of pressure loss in MSW model for well (WELSEGS item 6)
// Hydrostatic, Friction, Acceleration
@@ -162,6 +170,11 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
HistBHPTarget = 55, // Well's historical/observed bottom
// hole pressure target/limit
LOmaxRate = 56, // Well's maximum lift gas rate
LOweightFac = 57, // Well's wighting factor for preferential allocation of lift gas
LOminRate = 67, // Well's mimimum lift gas rate
};
} // SWell

View File

@@ -24,6 +24,8 @@
#include <string>
#include <vector>
#include <opm/parser/eclipse/EclipseState/Grid/NNC.hpp>
namespace Opm {
class EclipseGrid;
@@ -52,7 +54,7 @@ namespace Opm { namespace InitIO {
const ::Opm::Schedule& schedule,
const ::Opm::data::Solution& simProps,
std::map<std::string, std::vector<int>> int_data,
const ::Opm::NNC& nnc,
const std::vector<::Opm::NNCdata>& nnc,
::Opm::EclIO::OutputStream::Init& initFile);
}} // namespace Opm::InitIO

View File

@@ -135,6 +135,7 @@ namespace Opm {
serializer(dval);
serializer(ival);
serializer(sval);
serializer.vector(rsval);
serializer.vector(uval);
serializer(type);
serializer(item_name);

View File

@@ -44,9 +44,9 @@ namespace Opm {
DeckKeyword();
explicit DeckKeyword(const ParserKeyword& parserKeyword);
DeckKeyword(const KeywordLocation& location, const std::string& keywordName);
DeckKeyword(const ParserKeyword& parserKeyword, const std::vector<std::vector<DeckValue>>& record_list, UnitSystem& system_active, UnitSystem& system_default);
DeckKeyword(const ParserKeyword& parserKeyword, const std::vector<std::vector<DeckValue>>& record_list, const UnitSystem& system_active, const UnitSystem& system_default);
DeckKeyword(const ParserKeyword& parserKeyword, const std::vector<int>& data);
DeckKeyword(const ParserKeyword& parserKeyword, const std::vector<double>& data, UnitSystem& system_active, UnitSystem& system_default);
DeckKeyword(const ParserKeyword& parserKeyword, const std::vector<double>& data, const UnitSystem& system_active, const UnitSystem& system_default);
static DeckKeyword serializeObject();

View File

@@ -0,0 +1,42 @@
/*
Copyright 2021 Equinor ASA.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#define IMPORT_CONTAINER_HPP
#include <vector>
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
namespace Opm {
class Parser;
class ImportContainer {
public:
ImportContainer(const Parser& parser, const UnitSystem& unit_system, const std::string& fname, bool formatted, std::size_t deck_size);
std::vector<DeckKeyword>::iterator begin() { return this->keywords.begin(); }
std::vector<DeckKeyword>::iterator end() { return this->keywords.end(); }
private:
std::vector<DeckKeyword> keywords;
};
}

View File

@@ -38,6 +38,19 @@ public:
UDAValue(double data, const Dimension& dim);
UDAValue(const std::string& data, const Dimension& dim);
/*
The assignment operators have been explicitly deleted, that is to prevent
people from adding them at a later stage. It seems very tempting/natural
to implement these assignment operators, but the problem is that the
resulting UDA object will typically have the wrong dimension member, and
subtle dimension related bugs will arise.
*/
UDAValue& operator=(double value) = delete;
UDAValue& operator=(const std::string& value) = delete;
void update(double d);
void update(const std::string& s);
void update_value(const UDAValue& other);
static UDAValue serializeObject();
/*
@@ -66,9 +79,6 @@ public:
bool operator==(const UDAValue& other) const;
bool operator!=(const UDAValue& other) const;
UDAValue& operator=(double value);
UDAValue& operator=(const std::string& value);
void update_value(const UDAValue& other);
bool is_numeric() { return numeric_value; }

View File

@@ -26,15 +26,16 @@
implement the analytical aquifer models in OPM Flow.
*/
#include <unordered_map>
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/FaceDir.hpp>
#include <opm/parser/eclipse/Parser/ParserKeywords/A.hpp>
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/Deck/DeckItem.hpp>
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
#include <cstddef>
#include <unordered_map>
#include <vector>
namespace Opm {
class EclipseGrid;
class Deck;
}
namespace Opm {
@@ -44,36 +45,40 @@ namespace Opm {
struct AquancCell {
int aquiferID;
std::size_t global_index;
std::pair<bool, double> influx_coeff;
double influx_mult;
double influx_coeff;
double effective_facearea; // Needed for restart output only.
FaceDir::DirEnum face_dir;
AquancCell(int aquiferID_arg, std::size_t gi, const std::pair<bool, double>& ic, double im, FaceDir::DirEnum fd) :
aquiferID(aquiferID_arg),
global_index(gi),
influx_coeff(ic),
influx_mult(im),
face_dir(fd)
AquancCell(const int aquiferID_arg,
const std::size_t gi,
const double ic,
const double eff_faceArea,
const FaceDir::DirEnum fd)
: aquiferID(aquiferID_arg)
, global_index(gi)
, influx_coeff(ic)
, effective_facearea(eff_faceArea)
, face_dir(fd)
{}
AquancCell() = default;
bool operator==(const AquancCell& other) const {
return this->aquiferID == other.aquiferID &&
this->global_index == other.global_index &&
this->influx_coeff == other.influx_coeff &&
this->influx_mult == other.influx_mult &&
this->face_dir == other.face_dir;
return (this->aquiferID == other.aquiferID)
&& (this->global_index == other.global_index)
&& (this->influx_coeff == other.influx_coeff)
&& (this->effective_facearea == other.effective_facearea)
&& (this->face_dir == other.face_dir);
}
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(aquiferID);
serializer(global_index);
serializer(influx_coeff);
serializer(influx_mult);
serializer(face_dir);
serializer(this->aquiferID);
serializer(this->global_index);
serializer(this->influx_coeff);
serializer(this->effective_facearea);
serializer(this->face_dir);
}
};
@@ -88,19 +93,15 @@ namespace Opm {
bool operator==(const Aquancon& other) const;
bool active() const;
const std::vector<Aquancon::AquancCell> operator[](int aquiferID) const;
const std::vector<Aquancon::AquancCell>& operator[](int aquiferID) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.map(cells);
serializer.map(this->cells);
}
private:
static bool cellInsideReservoirAndActive(const EclipseGrid& grid, int i, int j, int k);
static bool neighborCellInsideReservoirAndActive(const EclipseGrid& grid, int i, int j, int k, FaceDir::DirEnum faceDir);
std::unordered_map<int, std::vector<Aquancon::AquancCell>> cells;
};
}

View File

@@ -62,8 +62,7 @@ namespace Opm {
double c2_,
const std::pair<bool, double>& p0_,
const std::vector<double>& td_,
const std::vector<double>& pi_,
const std::vector<int>& cell_id_);
const std::vector<double>& pi_);
int aquiferID;
int inftableID, pvttableID;
@@ -80,7 +79,6 @@ namespace Opm {
std::pair<bool, double> p0; //Initial aquifer pressure at datum depth, d0
std::vector<double> td, pi;
std::vector<int> cell_id;
bool operator==(const AQUCT_data& other) const;
@@ -102,7 +100,6 @@ namespace Opm {
serializer(p0);
serializer(td);
serializer(pi);
serializer(cell_id);
}
};

View File

@@ -20,21 +20,26 @@
#ifndef OPM_AUQIFER_CONFIG_HPP
#define OPM_AUQIFER_CONFIG_HPP
#include <opm/parser/eclipse/EclipseState/Aquancon.hpp>
#include <opm/parser/eclipse/EclipseState/Aquifetp.hpp>
#include <opm/parser/eclipse/EclipseState/AquiferCT.hpp>
#include <opm/parser/eclipse/EclipseState/Aquifer/Aquancon.hpp>
#include <opm/parser/eclipse/EclipseState/Aquifer/Aquifetp.hpp>
#include <opm/parser/eclipse/EclipseState/Aquifer/AquiferCT.hpp>
#include <opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquifers.hpp>
namespace Opm {
class TableManager;
class EclipseGrid;
class Deck;
class FieldPropsManager;
class AquiferConfig {
public:
AquiferConfig() = default;
AquiferConfig(const TableManager& tables, const EclipseGrid& grid, const Deck& deck);
AquiferConfig(const TableManager& tables, const EclipseGrid& grid,
const Deck& deck, const FieldPropsManager& field_props);
AquiferConfig(const Aquifetp& fetp, const AquiferCT& ct, const Aquancon& conn);
void load_connections(const Deck& deck, const EclipseGrid& grid);
static AquiferConfig serializeObject();
@@ -42,20 +47,26 @@ public:
const AquiferCT& ct() const;
const Aquifetp& fetp() const;
const Aquancon& connections() const;
bool operator==(const AquiferConfig& other);
bool operator==(const AquiferConfig& other) const;
bool hasAquifer(const int aquID) const;
bool hasNumericalAquifer() const;
bool hasAnalyticalAquifer() const;
const NumericalAquifers& numericalAquifers() const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
aquifetp.serializeOp(serializer);
aquiferct.serializeOp(serializer);
aqconn.serializeOp(serializer);
numerical_aquifers.serializeOp(serializer);
}
private:
Aquifetp aquifetp;
AquiferCT aquiferct;
NumericalAquifers numerical_aquifers;
Aquancon aqconn;
};

View File

@@ -0,0 +1,69 @@
/*
Copyright (C) 2020 SINTEF Digital
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_NUMERICALAQUIFERCELL_HPP
#define OPM_NUMERICALAQUIFERCELL_HPP
#include <optional>
namespace Opm {
class DeckRecord;
class EclipseGrid;
class FieldPropsManager;
struct NumericalAquiferCell {
NumericalAquiferCell(const DeckRecord&, const EclipseGrid&, const FieldPropsManager&);
NumericalAquiferCell() = default;
size_t aquifer_id;
size_t I, J, K;
double area;
double length;
double porosity;
double permeability;
double depth;
std::optional<double> init_pressure;
int pvttable;
int sattable;
size_t global_index;
double cellVolume() const;
double poreVolume() const;
double transmissiblity() const;
bool operator == (const NumericalAquiferCell& other) const;
template<class Serializer>
void serializeOp(Serializer& serializer) {
serializer(this->aquifer_id);
serializer(this->I);
serializer(this->J);
serializer(this->K);
serializer(this->area);
serializer(this->length);
serializer(this->porosity);
serializer(this->permeability);
serializer(this->depth);
serializer(this->init_pressure);
serializer(this->pvttable);
serializer(this->sattable);
serializer(this->global_index);
}
};
}
#endif //OPM_NUMERICALAQUIFERCELL_HPP

View File

@@ -0,0 +1,74 @@
/*
Copyright (C) 2020 SINTEF Digital
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_NUMERICALAQUIFERCONNECTION_HPP
#define OPM_NUMERICALAQUIFERCONNECTION_HPP
#include <opm/parser/eclipse/EclipseState/Grid/FaceDir.hpp>
#include <map>
#include <array>
#include <vector>
namespace Opm {
class EclipseGrid;
class Deck;
class DeckRecord;
struct NumericalAquiferConnection {
// TODO: I do not think we need all the values here
size_t aquifer_id;
size_t I, J, K;
size_t global_index;
FaceDir::DirEnum face_dir;
double trans_multipler;
int trans_option;
bool connect_active_cell;
// The following are options related to VE simulation
double ve_frac_relperm;
double ve_frac_cappress;
NumericalAquiferConnection(size_t i, size_t j, size_t k, size_t global_index, bool allow_connect_active, const DeckRecord& record);
NumericalAquiferConnection() = default;
bool operator==(const NumericalAquiferConnection& other) const;
template<class Serializer>
void serializeOp(Serializer& serializer) {
serializer(this->aquifer_id);
serializer(this->I);
serializer(this->J);
serializer(this->K);
serializer(this->global_index);
serializer(this->face_dir);
serializer(this->trans_multipler);
serializer(this->trans_option);
serializer(this->connect_active_cell);
serializer(this->ve_frac_relperm);
serializer(this->ve_frac_cappress);
}
static std::map<size_t, std::map<size_t, NumericalAquiferConnection>> generateConnections(const Deck& deck, const EclipseGrid& grid);
private:
static std::vector<NumericalAquiferConnection> connectionsFromSingleRecord(const EclipseGrid& grid, const DeckRecord& record);
};
}
#endif //OPM_NUMERICALAQUIFERCONNECTION_HPP

View File

@@ -0,0 +1,68 @@
/*
Copyright (C) 2020 SINTEF Digital
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_NUMERICALAQUIFERS_HPP
#define OPM_NUMERICALAQUIFERS_HPP
#include <unordered_map>
#include <map>
#include <opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/SingleNumericalAquifer.hpp>
namespace Opm {
class Deck;
class EclipseGrid;
class FieldPropsManager;
struct NumericalAquiferCell;
class NumericalAquifers {
public:
NumericalAquifers() = default;
NumericalAquifers(const Deck& deck, const EclipseGrid& grid, const FieldPropsManager& field_props);
size_t size() const;
bool hasAquifer(size_t aquifer_id) const;
const SingleNumericalAquifer& getAquifer(size_t aquifer_id) const;
const std::map<size_t, SingleNumericalAquifer>& aquifers() const;
bool operator==(const NumericalAquifers& other) const;
std::unordered_map<size_t, const NumericalAquiferCell*> allAquiferCells() const;
std::unordered_map<size_t, double> aquiferCellVolumes() const;
std::vector<NNCdata> aquiferNNCs(const EclipseGrid& grid, const FieldPropsManager& fp) const;
std::unordered_map<size_t, AquiferCellProps> aquiferCellProps() const;
static NumericalAquifers serializeObject();
template <class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.map(this->m_aquifers);
}
private:
std::map<size_t, SingleNumericalAquifer> m_aquifers;
void addAquiferCell(const NumericalAquiferCell& aqu_cell);
void addAquiferConnections(const Deck &deck, const EclipseGrid &grid);
};
}
#endif //OPM_NUMERICALAQUIFERS_HPP

View File

@@ -0,0 +1,87 @@
/*
Copyright (C) 2020 SINTEF Digital
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_SINGLENUMERICALAQUIFER_HPP
#define OPM_SINGLENUMERICALAQUIFER_HPP
#include <vector>
#include <set>
#include <opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquiferConnection.hpp>
#include <opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquiferCell.hpp>
namespace Opm {
class NNC;
struct NNCdata;
class FieldPropsManager;
struct AquiferCellProps {
double volume;
double pore_volume;
double depth;
double porosity;
int satnum;
int pvtnum;
};
class SingleNumericalAquifer {
public:
explicit SingleNumericalAquifer(const size_t aqu_id);
SingleNumericalAquifer() = default;
void addAquiferCell(const NumericalAquiferCell& aqu_cell);
void addAquiferConnection(const NumericalAquiferConnection& aqu_con);
// TODO: the following two can be made one function. Let us see
// how we use them at the end
size_t numCells() const;
size_t id() const;
size_t numConnections() const;
const NumericalAquiferCell* getCellPrt(size_t index) const;
std::unordered_map<size_t, AquiferCellProps> aquiferCellProps() const;
std::vector<NNCdata> aquiferNNCs(const EclipseGrid& grid, const FieldPropsManager& fp) const;
const std::vector<NumericalAquiferConnection>& connections() const;
bool operator==(const SingleNumericalAquifer& other) const;
template<class Serializer>
void serializeOp(Serializer& serializer) {
serializer(this->id_);
serializer.vector(this->cells_);
serializer.vector(this->connections_);
}
private:
// Maybe this id_ is not necessary
// Because if it is a map, the id will be there
// Then adding aquifer cells will be much easier with the
// default constructor
size_t id_;
std::vector<NumericalAquiferCell> cells_;
std::vector<NumericalAquiferConnection> connections_;
std::vector<NNCdata> aquiferCellNNCs() const;
std::vector<NNCdata> aquiferConnectionNNCs(const EclipseGrid &grid, const FieldPropsManager &fp) const;
};
}
#endif //OPM_SINGLENUMERICALAQUIFER_HPP

View File

@@ -42,10 +42,9 @@ namespace Opm {
IOConfig& io();
const IOConfig& io() const;
const InitConfig& init() const;
const InitConfig& getInitConfig() const;
bool operator==(const EclipseConfig& data) const;
static bool rst_cmp(const EclipseConfig& full_config, const EclipseConfig& rst_config);
template<class Serializer>
void serializeOp(Serializer& serializer)
{

View File

@@ -24,10 +24,9 @@
#include <vector>
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
#include <opm/parser/eclipse/EclipseState/AquiferConfig.hpp>
#include <opm/parser/eclipse/EclipseState/Aquifer/AquiferConfig.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseConfig.hpp>
#include <opm/parser/eclipse/EclipseState/TracerConfig.hpp>
#include <opm/parser/eclipse/EclipseState/Edit/EDITNNC.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/FieldPropsManager.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/FaultCollection.hpp>
@@ -78,7 +77,7 @@ namespace Opm {
const InitConfig& getInitConfig() const;
InitConfig& getInitConfig();
const SimulationConfig& getSimulationConfig() const;
virtual const EclipseGrid& getInputGrid() const;
@@ -90,11 +89,6 @@ namespace Opm {
const NNC& getInputNNC() const;
bool hasInputNNC() const;
/// editing non-neighboring connections
/// the non-standard adjacencies as specified in input deck
const EDITNNC& getInputEDITNNC() const;
bool hasInputEDITNNC() const;
// The potentially parallelized field properties
virtual const FieldPropsManager& fieldProps() const;
// Always the non-parallel field properties
@@ -112,7 +106,7 @@ namespace Opm {
std::string getTitle() const;
void applyModifierDeck(const Deck& deck);
void apply_geo_keywords(const std::vector<DeckKeyword>& keywords);
const Runspec& runspec() const;
const AquiferConfig& aquifer() const;
@@ -127,16 +121,18 @@ namespace Opm {
m_eclipseConfig.serializeOp(serializer);
m_deckUnitSystem.serializeOp(serializer);
m_inputNnc.serializeOp(serializer);
m_inputEditNnc.serializeOp(serializer);
m_gridDims.serializeOp(serializer);
aquifer_config.serializeOp(serializer);
m_simulationConfig.serializeOp(serializer);
m_transMult.serializeOp(serializer);
m_faults.serializeOp(serializer);
serializer(m_title);
aquifer_config.serializeOp(serializer);
tracer_config.serializeOp(serializer);
}
static bool rst_cmp(const EclipseState& full_state, const EclipseState& rst_state);
private:
void initIOConfigPostSchedule(const Deck& deck);
void initTransMult();
@@ -152,17 +148,16 @@ namespace Opm {
Runspec m_runspec;
EclipseConfig m_eclipseConfig;
UnitSystem m_deckUnitSystem;
NNC m_inputNnc;
EDITNNC m_inputEditNnc;
EclipseGrid m_inputGrid;
NNC m_inputNnc;
GridDims m_gridDims;
FieldPropsManager field_props;
AquiferConfig aquifer_config;
SimulationConfig m_simulationConfig;
TransMult m_transMult;
FaultCollection m_faults;
std::string m_title;
AquiferConfig aquifer_config;
TracerConfig tracer_config;
};
}

View File

@@ -1,60 +0,0 @@
/*
Copyright 2018 Equinor AS
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_COMMON_EDITNNC_HPP
#define OPM_COMMON_EDITNNC_HPP
#include <opm/parser/eclipse/EclipseState/Grid/NNC.hpp>
namespace Opm
{
/// Represents edit information for non-neighboring connections (NNCs, faults, etc.)
class EDITNNC
{
public:
EDITNNC() = default;
/// Construct from input deck
explicit EDITNNC(const Deck& deck);
/// Returns an instance used for serialization test
static EDITNNC serializeObject();
/// \brief Get an ordered set of EDITNNC
const std::vector<NNCdata>& data() const
{
return m_editnnc;
}
/// \brief Get the number of entries
size_t size() const;
/// \brief Whether EDITNNC was empty.
bool empty() const;
bool operator==(const EDITNNC& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.vector(m_editnnc);
}
private:
std::vector<NNCdata> m_editnnc;
};
}
#endif // OPM_COMMON_EDITNNC_HPP

View File

@@ -33,6 +33,7 @@
#include <memory>
#include <optional>
#include <vector>
#include <unordered_set>
namespace Opm {
@@ -67,7 +68,7 @@ namespace Opm {
EclipseGrid(size_t nx, size_t ny, size_t nz,
double dx = 1.0, double dy = 1.0, double dz = 1.0);
EclipseGrid(std::array<int, 3>& dims ,
EclipseGrid(const std::array<int, 3>& dims ,
const std::vector<double>& coord ,
const std::vector<double>& zcorn ,
const int * actnum = nullptr,
@@ -88,7 +89,7 @@ namespace Opm {
size_t activeIndex(size_t i, size_t j, size_t k) const;
size_t activeIndex(size_t globalIndex) const;
void save(const std::string& filename, bool formatted, const Opm::NNC& nnc, const Opm::UnitSystem& units) const;
void save(const std::string& filename, bool formatted, const std::vector<Opm::NNCdata>& nnc, const Opm::UnitSystem& units) const;
/*
Observe that the there is a getGlobalIndex(i,j,k)
implementation in the base class. This method - translating
@@ -155,7 +156,7 @@ namespace Opm {
std::array<double, 3> getCellCenter(size_t i,size_t j, size_t k) const;
std::array<double, 3> getCellCenter(size_t globalIndex) const;
std::array<double, 3> getCornerPos(size_t i,size_t j, size_t k, size_t corner_index) const;
std::vector<double> activeVolume() const;
const std::vector<double>& activeVolume() const;
double getCellVolume(size_t globalIndex) const;
double getCellVolume(size_t i , size_t j , size_t k) const;
double getCellThickness(size_t globalIndex) const;
@@ -199,6 +200,8 @@ namespace Opm {
PinchMode::ModeEnum m_multzMode;
PinchMode::ModeEnum m_pinchGapMode;
mutable std::optional<std::vector<double>> active_volume;
bool m_circle = false;
size_t zcorn_fixed = 0;
@@ -215,6 +218,14 @@ namespace Opm {
int m_nactive;
std::vector<int> m_active_to_global;
std::vector<int> m_global_to_active;
// Numerical aquifer cells, needs to be active
std::unordered_set<size_t> m_aquifer_cells;
// Radial grids need this for volume calculations.
std::optional<std::vector<double>> m_thetav;
std::optional<std::vector<double>> m_rv;
void updateNumericalAquiferCells(const Deck&);
void initGridFromEGridFile(Opm::EclIO::EclFile& egridfile, std::string fileName);
void resetACTNUM( const int* actnum);
@@ -229,6 +240,8 @@ namespace Opm {
bool keywInputBeforeGdfile(const Deck& deck, const std::string keyword) const;
void initCylindricalGrid(const Deck&);
void initSpiderwebGrid(const Deck&);
void initSpiderwebOrCylindricalGrid(const Deck&, const bool);
void initCartesianGrid(const Deck&);
void initDTOPSGrid(const Deck&);
void initDVDEPTHZGrid(const Deck&);

View File

@@ -25,11 +25,12 @@
#include <opm/parser/eclipse/EclipseState/Grid/FieldData.hpp>
#include <opm/parser/eclipse/Deck/value_status.hpp>
#include<string>
#include<vector>
#include<optional>
#include<array>
#include<algorithm>
#include <string>
#include <vector>
#include <optional>
#include <array>
#include <algorithm>
#include <stdexcept>
namespace Opm
{
@@ -60,6 +61,15 @@ namespace Fieldprops
std::optional<std::vector<value::status>> global_value_status;
mutable bool all_set;
bool operator==(const FieldData& other) const {
return this->data == other.data &&
this->value_status == other.value_status &&
this->kw_info == other.kw_info &&
this->global_data == other.global_data &&
this->global_value_status == other.global_value_status;
}
FieldData() = default;
FieldData(const keywords::keyword_info<T>& info, std::size_t active_size, std::size_t global_size) :
@@ -93,6 +103,11 @@ namespace Fieldprops
return this->all_set;
}
bool valid_default() const {
return std::all_of( this->value_status.begin(), this->value_status.end(), [] (const value::status& status) {return status == value::status::valid_default; });
}
void compress(const std::vector<bool>& active_map) {
Fieldprops::compress(this->data, active_map);
Fieldprops::compress(this->value_status, active_map);

View File

@@ -32,6 +32,7 @@ class Deck;
class FieldProps;
class Phases;
class TableManager;
class NumericalAquifers;
class FieldPropsManager {
@@ -54,7 +55,8 @@ public:
*/
std::size_t active_size() const;
bool operator==(const FieldPropsManager& other) const;
static bool rst_cmp(const FieldPropsManager& full_arg, const FieldPropsManager& rst_arg);
/*
Because the FieldProps class can autocreate properties the semantics of
get() and has() is slightly non intuitve:
@@ -217,6 +219,9 @@ public:
*/
virtual void apply_tran(const std::string& keyword, std::vector<double>& tran_data) const;
void apply_numerical_aquifers(const NumericalAquifers& aquifers);
/*
When using MPI the FieldPropsManager is typically only assembled on the
root node and then distributed to the other nodes afterwards. These

View File

@@ -36,6 +36,15 @@ struct keyword_info {
bool top = false;
bool global = false;
bool operator==(const keyword_info& other) const {
return this->unit == other.unit &&
this->scalar_init == other.scalar_init &&
this->multiplier == other.multiplier &&
this->top == other.top &&
this->global == other.global;
}
keyword_info<T>& init(T init_value) {
this->scalar_init = init_value;
return *this;

View File

@@ -1,18 +1,18 @@
/*
Copyright 2015 IRIS
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/>.
*/
@@ -22,11 +22,17 @@
#include <cstddef>
#include <memory>
#include <optional>
#include <tuple>
#include <vector>
#include <opm/common/OpmLog/KeywordLocation.hpp>
namespace Opm
{
class GridDims;
struct NNCdata {
NNCdata(size_t c1, size_t c2, double t)
: cell1(c1), cell2(c2), trans(t)
@@ -48,41 +54,89 @@ struct NNCdata {
serializer(trans);
}
// Observe that the operator< is only for cell ordering and does not consider the
// trans member
bool operator<(const NNCdata& other) const
{
return std::tie(this->cell1, this->cell2) < std::tie(other.cell1, other.cell2);
}
size_t cell1;
size_t cell2;
double trans;
};
class Deck;
/// Represents non-neighboring connections (non-standard adjacencies).
/// This class is essentially a directed weighted graph.
class Deck;
class EclipseGrid;
/*
This class is an internalization of the NNC and EDITNNC keywords. Because the
opm-common codebase does not itself manage the simulation grid the purpose of
the NNC class is mainly to hold on to the NNC/EDITNNC input and pass it on to
the grid construction proper.
The EDITNNC keywords can operate on two different types of NNCs.
1. NNCs which have been explicitly entered using the NNC keyword.
2. NNCs which are inderectly inferred from the grid - e.g. due to faults.
When processing the EDITNNC keyword the class will search through the NNCs
configured explicitly with the NNC keyword and apply the edit transformation
on those NNCs, EDITNNCs which affect NNCs which are not configured explicitly
are stored for later use by the simulator.
The class guarantees the following ordering:
1. For all NNC / EDITNNC records we will have cell1 <= cell2
2. The vectors NNC::input() and NNC::edit() will be ordered in ascending
order.
While constructing from a deck NNCs connected to inactive cells will be
silently ignored. Do observe though that the addNNC() function does not check
the arguments and alas there is no guarantee that only active cells are
involved.
*/
class NNC
{
public:
NNC() = default;
/// Construct from input deck.
explicit NNC(const Deck& deck);
NNC(const EclipseGrid& grid, const Deck& deck);
static NNC serializeObject();
void addNNC(const size_t cell1, const size_t cell2, const double trans);
const std::vector<NNCdata>& data() const { return m_nnc; }
size_t numNNC() const;
bool hasNNC() const;
bool addNNC(const size_t cell1, const size_t cell2, const double trans);
const std::vector<NNCdata>& input() const { return m_input; }
const std::vector<NNCdata>& edit() const { return m_edit; }
KeywordLocation input_location(const NNCdata& nnc) const;
KeywordLocation edit_location(const NNCdata& nnc) const;
bool operator==(const NNC& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.vector(m_nnc);
serializer.vector(m_input);
serializer.vector(m_edit);
serializer(m_nnc_location);
serializer(m_edit_location);
}
private:
std::vector<NNCdata> m_nnc;
void load_input(const EclipseGrid& grid, const Deck& deck);
void load_edit(const EclipseGrid& grid, const Deck& deck);
void add_edit(const NNCdata& edit_node);
bool update_nnc(std::size_t global_index1, std::size_t global_index2, double tran_mult);
std::vector<NNCdata> m_input;
std::vector<NNCdata> m_edit;
std::optional<KeywordLocation> m_nnc_location;
std::optional<KeywordLocation> m_edit_location;
};

View File

@@ -76,6 +76,15 @@ namespace Opm { namespace satfunc {
/// region All zero values unless gas is an active phase.
std::vector<double> water;
} maximum;
bool operator==(const RawTableEndPoints& other) const {
return this->connate.gas == other.connate.gas &&
this->connate.water == other.connate.water &&
this->critical.gas == other.critical.gas &&
this->critical.water == other.critical.water &&
this->maximum.gas == other.maximum.gas &&
this->maximum.water == other.maximum.water;
}
};
/// Collection of unscaled/raw saturation function value range endpoints
@@ -142,12 +151,12 @@ namespace Opm { namespace satfunc {
} pc;
};
std::shared_ptr<RawTableEndPoints>
RawTableEndPoints
getRawTableEndpoints(const Opm::TableManager& tm,
const Opm::Phases& phases,
const double tolcrit);
std::shared_ptr<RawFunctionValues>
RawFunctionValues
getRawFunctionValues(const Opm::TableManager& tm,
const Opm::Phases& phases,
const RawTableEndPoints& ep);

View File

@@ -45,6 +45,11 @@ public:
struct TranAction {
ScalarOperation op;
std::string field;
bool operator==(const TranAction& other) const {
return this->op == other.op &&
this->field == other.field;
}
};
@@ -97,6 +102,12 @@ public:
}
return kw_info;
}
bool operator==(const TranCalculator& other) const {
return this->m_name == other.m_name &&
this->actions == other.actions;
}
private:
std::string m_name;
std::vector<TranAction> actions;

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