Compare commits

..

2904 Commits

Author SHA1 Message Date
Arne Morten Kvarving
ab6a92a1d9 Merge pull request #1529 from akva2/internalize_tlmixpar
internalize TLMIXPAR
2020-03-04 09:58:16 +01:00
Joakim Hove
85ddd2e2e8 Merge pull request #1527 from joakim-hove/move-well-injectortype
Move enum Well:InjectorType to new file ScheduleTypes
2020-03-03 16:36:49 +01:00
Joakim Hove
a02811ed63 Merge pull request #1526 from joakim-hove/wells-rst-units
Wells rst units
2020-03-03 16:35:26 +01:00
Arne Morten Kvarving
7ac9b6cf88 internalize TLMIXPAR 2020-03-03 15:59:08 +01:00
Arne Morten Kvarving
ab757c4a1c Merge pull request #1528 from akva2/internalize_surface_conditions
internalize StandardConditions
2020-03-03 13:46:01 +01:00
Arne Morten Kvarving
f77bef4774 internalize StCond keyword 2020-03-03 12:14:13 +01:00
Joakim Hove
1b2fadcdc4 Move enum Well:InjectorType to new file ScheduleTypes 2020-03-03 09:09:11 +01:00
Joakim Hove
6af2bcdb6f Use named public item for CFInDeck functionality 2020-03-03 08:34:47 +01:00
Joakim Hove
e6af67e897 Well datum depth is loaded from SWEL 2020-03-03 08:34:04 +01:00
Joakim Hove
e1bf7b2298 Well rates which should go to UDA are loaded with input units 2020-03-03 08:33:07 +01:00
Joakim Hove
e3a9174aa3 Merge pull request #1523 from akva2/simplify_oilvap
changed: simplify OilVaporizationProperties
2020-03-03 08:22:36 +01:00
Joakim Hove
e04d10494d Merge pull request #1525 from joakim-hove/opmpack-fixup
Fix bug/problem in copy_file in opmpack
2020-03-03 08:21:59 +01:00
Joakim Hove
ca245136fa Fix bug/problem in copy_file in opmpack 2020-03-02 21:17:14 +01:00
Joakim Hove
0b884fc977 Merge pull request #1521 from tskille/pybind_deckitem
Python bindings for DeckItem, adding support for UDA type
2020-03-02 20:57:54 +01:00
Torbjørn Skille
07a8c5b015 python bindings, adding support for UDA type 2020-03-02 13:50:57 +01:00
Arne Morten Kvarving
710a94709e changed: simplify OilVaporizationProperties
there is no vappars per pvt region. do not store it as such either.
2020-03-02 09:32:40 +01:00
Bård Skaflestad
8a4240b2fe Merge pull request #1518 from joakim-hove/remove-wtype-unknown
Remove opm specific well type WTUnk
2020-03-01 22:39:12 -06:00
Arne Morten Kvarving
bafa28ed76 Merge pull request #1443 from akva2/noecl_virtualize
Add virtual hooks to enable parallel frontends in opm-simulators
2020-02-28 12:29:27 +01:00
Arne Morten Kvarving
dcbf764b41 add a GridDims member in EclipseState
while this is already in the EclipseGrid, we need a
separate copy that we can serialize and broadcast
2020-02-28 10:25:10 +01:00
Arne Morten Kvarving
84e5f7ccbf add equality operator to GridDims
also make it default constructible
2020-02-28 10:25:10 +01:00
Arne Morten Kvarving
e747ce86b7 added: virtual method globalFieldProps to EclipseState
this will always return the global field props, even in parallel.
necessary since certain operations related to IO need to full global
view on the root process, even when running in parallel

also virtualize the EclipseGrid accessor to add assert in parallel
to ensure only root-process access
2020-02-28 10:25:10 +01:00
Arne Morten Kvarving
8cb923bbd8 virtualize some methods in fieldpropsmanager
to allow putting a parallel layer on top in opm-simulators
2020-02-28 10:25:10 +01:00
Arne Morten Kvarving
af4e41943a make EclipseState default constructible 2020-02-28 10:25:10 +01:00
Arne Morten Kvarving
45af93cd93 make Value default constructible 2020-02-28 10:25:10 +01:00
Arne Morten Kvarving
38ede33576 make eclipsegrid default constructible 2020-02-28 10:25:10 +01:00
Arne Morten Kvarving
3b44ee137b changed: make data members in EclipseState protected
to allow subclass access
2020-02-28 10:25:10 +01:00
Atgeirr Flø Rasmussen
dbb78a509b Merge pull request #1520 from atgeirr/add-group-availability
Add Group::isAvailableForGroupControl() method.
2020-02-28 10:03:04 +01:00
Atgeirr Flø Rasmussen
1a0f47f274 Add Group::isAvailableForGroupControl() method.
The method has very similar intended usage as the method of the
same name in the Well class.
2020-02-27 14:56:31 +01:00
Arne Morten Kvarving
406cf45064 Merge pull request #1517 from akva2/internalize_sdensity
added: internalize SDENSITY table
2020-02-27 13:37:25 +01:00
Arne Morten Kvarving
ac2907a876 added: internalize SDENSITY table 2020-02-27 11:52:31 +01:00
Joakim Hove
0f41c73c8e Remove opm specific well type WTUnk 2020-02-27 11:01:15 +01:00
Arne Morten Kvarving
8233ae200c Merge pull request #1515 from akva2/python_debian_packaging
Add debian packaging of python bindings
2020-02-26 12:22:01 +01:00
Joakim Hove
10c2705c07 Merge pull request #1516 from akva2/janitoring
remove unused cmake option
2020-02-26 12:00:37 +01:00
Arne Morten Kvarving
6e0a581764 remove unused cmake option 2020-02-26 11:57:37 +01:00
Arne Morten Kvarving
a9c1c8dedd added: debian packaging for python bindings 2020-02-26 11:56:02 +01:00
Arne Morten Kvarving
585eb609ee fixed: only try around the ccache code
build failed without ccache available
2020-02-26 11:56:02 +01:00
Arne Morten Kvarving
9eec147616 fixed: respect DESTDIR in python binding installation script 2020-02-26 11:56:02 +01:00
Arne Morten Kvarving
c765b769fa fixed: set LD_LIBRARY_PATH so python tests can find the library
necessary when building shared lib
2020-02-26 11:56:02 +01:00
Arne Morten Kvarving
bdca9d9a0d Merge pull request #1514 from akva2/fix_relative_gcc7
changed: use constructs available in filesystem TS to obtain relative path
2020-02-26 11:11:43 +01:00
Arne Morten Kvarving
2994b80a57 changed: use constructs available in filesystem TS to obtain relative path
fixes build with gcc 7
2020-02-26 10:13:21 +01:00
Joakim Hove
8cb65a77a6 Merge pull request #1507 from joakim-hove/dent-keywords
Add simple POD class to internalize keywords xxxDENT
2020-02-26 09:55:58 +01:00
Joakim Hove
3bfef790c6 Merge pull request #1512 from joakim-hove/add-rst-info
Add restart info to TimeMap() constructor
2020-02-25 15:34:25 +01:00
Joakim Hove
a5d396f1fb Merge pull request #1511 from joakim-hove/extract-timestepping
Extracted timestepnning keywords from the regular handleKeyword()
2020-02-25 15:34:14 +01:00
Joakim Hove
964b707b0d Merge pull request #1510 from joakim-hove/invalid-name-report-step
Add report_step argument to Schedule::invalidNamePattern()
2020-02-25 15:34:01 +01:00
Joakim Hove
5797ebd23d Add member gas_comp_index to TableManager 2020-02-25 15:06:34 +01:00
Joakim Hove
24528ea607 Add simple POD class to internalize keywords xxxDENT 2020-02-25 15:06:34 +01:00
Joakim Hove
40dec6bd54 Add restart info to TimeMap() constructor 2020-02-25 09:23:55 +01:00
Joakim Hove
1cdb4aa579 Extracted timestepnning keywords from the regular handleKeyword() 2020-02-25 09:17:47 +01:00
Joakim Hove
b6aea46115 Add report_step argument to Schedule::invalidNamePattern() 2020-02-25 09:10:45 +01:00
Arne Morten Kvarving
989d643140 Merge pull request #1509 from blattms/fix-g++-versioncheck-fs
Fix compiler version check for -lstdc++fs
2020-02-25 08:55:07 +01:00
Joakim Hove
09595b98ad Merge pull request #1495 from joakim-hove/opmpack-copy-restart
The opmpack utility can also copy restart and import files
2020-02-25 08:32:06 +01:00
Joakim Hove
3a69bcbf4a Merge pull request #1503 from joakim-hove/wellsegments-alt-cons
Simplify WellSegments serialization construction
2020-02-25 08:31:30 +01:00
Joakim Hove
e1b4b64497 Merge pull request #1506 from atgeirr/guide-rate-generic
Add overloads to eval() and get() for simpler generic usage.
2020-02-25 08:30:26 +01:00
Bård Skaflestad
df21acfc49 Merge pull request #1492 from akva2/conditional_test_suite
changed: disable building of test suite if Boost::test is not found
2020-02-24 20:30:53 -06:00
Markus Blatt
31e6f316db Fix compiler version check for -lstdc++fs
There was a typo in the if condition which probably always
made it true. Linking to to -lstdc++fs is needed until
g++-9, see e.g. https://gitlab.kitware.com/cmake/cmake/issues/17834
2020-02-24 22:00:10 +01:00
Atgeirr Flø Rasmussen
8b110916e6 Add overloads to eval() and get() for simpler generic usage. 2020-02-24 16:05:48 +01:00
Atgeirr Flø Rasmussen
dae7b2f331 Merge pull request #1504 from akva2/remove_opmfil
remove unused enum entry OpmFIL
2020-02-24 13:31:29 +01:00
Arne Morten Kvarving
aceb3b443a remove unused enum entry OpmFIL 2020-02-24 11:41:50 +01:00
Joakim Hove
815969a7d1 Simplify WellSegments serialization construction 2020-02-22 10:57:57 +01:00
Bård Skaflestad
561a594365 Merge pull request #1501 from goncalvesmachadoc/patch-2
Add SALTVD table to CMake List
2020-02-21 11:44:21 -06:00
Joakim Hove
95d1cc29ff Merge pull request #1500 from goncalvesmachadoc/goncalvesmachadoc-addSaltKeywords
add Keywords for Salt
2020-02-21 18:44:13 +01:00
Cintia Goncalves Machado
80da943b36 Add SALTVD table to CMake 2020-02-21 16:45:07 +01:00
Cintia Goncalves Machado
452a49d56f add Keywords for Salt 2020-02-21 13:47:10 +01:00
Joakim Hove
ae504bcb45 Merge pull request #1499 from totto82/addControlWELTARG
Add production control from WELTARG
2020-02-21 13:25:20 +01:00
Tor Harald Sandve
83a8a9f4fe add test for production control from WELTARG 2020-02-21 12:39:58 +01:00
Joakim Hove
9d1cf2482f Merge pull request #1498 from atgeirr/silence-warnings
Silence warnings.
2020-02-21 11:57:04 +01:00
Tor Harald Sandve
df14e0d66a Add production control from WELTARG 2020-02-21 11:15:18 +01:00
Atgeirr Flø Rasmussen
f35529d7ff Silence warnings.
- One class vs struct declaration.
 - Unused variables in a test.
2020-02-21 10:49:41 +01:00
Joakim Hove
7b145e360f Merge pull request #1497 from joakim-hove/use-size_t
Use std::size_t instead of int for size
2020-02-21 09:30:58 +01:00
Joakim Hove
c11d0bb4cc Use std::size_t instead of int for size 2020-02-21 07:43:25 +01:00
Joakim Hove
1a5cf27418 The opmpack utility can also copy restart and import files 2020-02-20 15:12:38 +01:00
Joakim Hove
4816777700 Merge pull request #1494 from joakim-hove/use-size_t
Use std::size_t instead of int for size
2020-02-20 13:57:16 +01:00
Joakim Hove
412909fa3a Use std::size_t instead of int for size 2020-02-20 11:54:40 +01:00
Joakim Hove
a3c634b1f8 Merge pull request #1458 from joakim-hove/eclstate-aquifer-config
Eclstate aquifer config
2020-02-20 08:25:25 +01:00
Joakim Hove
6a87be8512 Merge pull request #1490 from joakim-hove/use-complnum
Store complnum value directly without taking std::abs()
2020-02-20 08:24:28 +01:00
Joakim Hove
6a0785b172 Merge pull request #1477 from joakim-hove/move-restart-config
Move RestartConfig to Schedule
2020-02-20 07:06:58 +01:00
Joakim Hove
aed8c78af5 Move RestartConfig from EclipseState to Schedule 2020-02-19 12:35:07 +01:00
Joakim Hove
269802ae48 Add comment about locating shared library while testing Python 2020-02-19 12:33:50 +01:00
Joakim Hove
59f6cc7c11 Remove moot test 2020-02-19 12:33:50 +01:00
Joakim Hove
89cf50e0d5 Remove hack for Python 3D testing 2020-02-19 12:33:50 +01:00
Joakim Hove
b3601c7357 Merge pull request #1489 from akva2/more_boost_prune
Continue replacing boost usage
2020-02-19 12:29:06 +01:00
Arne Morten Kvarving
f76daabbb4 changed: disable building of test suite if Boost::test is not found 2020-02-19 12:25:32 +01:00
Joakim Hove
36e40040a0 Merge pull request #1491 from atgeirr/accept-mixed-case-months
Use upper case to look up month numbers.
2020-02-19 11:38:46 +01:00
Arne Morten Kvarving
36d4fa2923 replace boost with std in comment 2020-02-19 09:53:01 +01:00
Arne Morten Kvarving
3d83512f09 get rid of usage of boost::join 2020-02-19 09:51:57 +01:00
Arne Morten Kvarving
26c9a1e3f1 changed: get rid of boost::lexical_cast
replace with std::strtoul. not as pretty, but boost is not popular in
here
2020-02-19 09:51:57 +01:00
Arne Morten Kvarving
83a7cd04c3 remove unused boost includes
and deal with missing include fallout
2020-02-19 09:51:46 +01:00
Atgeirr Flø Rasmussen
4a16f6022d Use upper case to look up month numbers.
This means we accept strings such as "Sep" and "oCT" as valid months,
not just "SEP" and "OCT".
2020-02-19 09:37:28 +01:00
Arne Morten Kvarving
2b6754151f add internal replacement for boost::split and use it 2020-02-19 09:29:25 +01:00
Joakim Hove
20afa1ed31 Store complnum value directly without taking std::abs() 2020-02-19 07:16:03 +01:00
Joakim Hove
01aa3692fa Add AquiferConfig to EclipseState 2020-02-18 18:07:02 +01:00
Joakim Hove
7daf77ef59 Added AquiferConfig class 2020-02-18 15:30:09 +01:00
Joakim Hove
a4d745b895 Merge pull request #1484 from joakim-hove/brine-table-size
Add size() method to BrineDesityTable
2020-02-18 15:11:25 +01:00
Arne Morten Kvarving
57d88dea7e add a replacement for boost::replace_all and use it 2020-02-18 14:48:40 +01:00
Arne Morten Kvarving
82491aaf2e changed: use internal method to uppercase a string instead of boost 2020-02-18 14:31:41 +01:00
Arne Morten Kvarving
c8458049e8 changed: use internal trim methods instead of boost 2020-02-18 14:31:03 +01:00
Arne Morten Kvarving
ec1dabf80e Merge pull request #1488 from akva2/less_boost_debian
remove libboost-regex-dev, libboost-filesystem-dev from debian packaging
2020-02-18 12:03:04 +01:00
Arne Morten Kvarving
ee90d5f094 Merge pull request #1487 from akva2/redhat_dt8
Use devtoolset-8 in redhat packaging
2020-02-18 12:02:06 +01:00
Joakim Hove
fc82988c9c Merge pull request #1475 from joakim-hove/schedule-addwell-refactor
Add new Schedule::addWell() overload + update Well constructor args
2020-02-18 11:58:37 +01:00
Joakim Hove
084ff09e78 Merge pull request #1476 from joakim-hove/timemap-skiprest
Internalize the existence of SKIPREST in the TimeMap
2020-02-18 11:57:24 +01:00
Arne Morten Kvarving
14548852d7 remove libboost-regex-dev, libboost-filesystem-dev from debian packaging 2020-02-18 11:08:32 +01:00
Kai Bao
e2b4759b23 Merge pull request #1452 from joakim-hove/eclstate-aquifer-aquancon
Eclstate aquifer aquancon
2020-02-18 11:08:14 +01:00
Joakim Hove
c5e1826498 Add size() method to BrineDesityTable 2020-02-18 07:49:48 +01:00
Joakim Hove
32227236fa Refactor AQUANCON implementation 2020-02-18 07:33:05 +01:00
Arne Morten Kvarving
3f20edbfcb Merge pull request #1482 from akva2/fix_brine
fixed: add begin/end members to BrineDensityTable
2020-02-17 16:08:56 +01:00
Arne Morten Kvarving
c2aca49a2a fixed: add begin/end members to BrineDensityTable 2020-02-17 15:13:36 +01:00
Joakim Hove
91c886465a Merge pull request #1478 from akva2/vfp_boost_prune
Drop use of boost::multi_array in VFP classes
2020-02-17 13:57:32 +01:00
Arne Morten Kvarving
a43062ed7f go back to boost 1.48 on rhel6 and rhel7 2020-02-17 13:34:09 +01:00
Arne Morten Kvarving
a594483d02 bump to devtoolset-8 in redhat packaging 2020-02-17 13:34:04 +01:00
Joakim Hove
dd04b1d9df Merge pull request #1467 from joakim-hove/rst-units
Add units to rst classes
2020-02-17 13:23:01 +01:00
Arne Morten Kvarving
fa572188fa changed: avoid use of boost::multi_array in VFPProdTable 2020-02-17 13:08:14 +01:00
Arne Morten Kvarving
143c8ec3bf changed: avoid use of boost::multi_array in VFPInjTable 2020-02-17 13:08:14 +01:00
Joakim Hove
dbf1929349 Merge pull request #1481 from akva2/remove_stale_flag
remove stale cmake options from jenkins scripts
2020-02-17 13:06:24 +01:00
Arne Morten Kvarving
f152ac1127 remove stale cmake options from jenkins scripts 2020-02-17 11:59:58 +01:00
Arne Morten Kvarving
de39bb5a7c Merge pull request #1479 from akva2/fix_cxx17_rh6
fixed: guess -std=c++17 flag if cmake version is too old
2020-02-17 11:30:59 +01:00
Arne Morten Kvarving
2b5a21085c fixed: guess -std=c++17 flag if cmake version is too old
to aid compilation on rhel6
2020-02-17 11:30:26 +01:00
Joakim Hove
cad54feafb Internalize the existence of SKIPREST in the TimeMap 2020-02-16 17:53:27 +01:00
Bård Skaflestad
13fa36f63b Merge pull request #1472 from akva2/fix_gcc_check
fixed: wrong preprocessor check for gcc7
2020-02-14 10:32:38 -06:00
Arne Morten Kvarving
e0939b69f1 fixed: gcc8+ filesystem will collapse the multiple slashes 2020-02-14 16:14:15 +01:00
Joakim Hove
1b0af2954d Add new Schedule::addWell() overload + update Well constructor args 2020-02-14 14:21:08 +01:00
Atgeirr Flø Rasmussen
fa5050f18a Merge pull request #1474 from joakim-hove/schedule-add-rst-argument
Schedule add rst argument
2020-02-14 14:00:20 +01:00
Joakim Hove
15861f1dde Merge pull request #1473 from joakim-hove/rm-rst-load-test
Remove rst_load based test
2020-02-14 12:51:52 +01:00
Joakim Hove
0b3f885b33 Started to add skeleton load_rst function 2020-02-14 12:51:26 +01:00
Joakim Hove
5399c4f37f Add optional RstState * argument to Schedule constructors 2020-02-14 12:05:24 +01:00
Joakim Hove
a50efdf7da Remove rst_load based test 2020-02-14 11:59:24 +01:00
Atgeirr Flø Rasmussen
4516b23a14 Merge pull request #1410 from joakim-hove/group-multiple-phases
Support multiple phases in group injection
2020-02-14 11:10:37 +01:00
Arne Morten Kvarving
a049cd5b03 fixed: wrong preprocessor check for gcc7 2020-02-14 09:42:31 +01:00
Tor Harald Sandve
e9318b1457 continue the work of allowing for phase dependent injection control 2020-02-14 09:30:58 +01:00
Joakim Hove
45dfd4ffe0 Change UDQ restart data for injection groups
The code changes required to support multiple phases in a UDQ controlled
injection group is an educated guess.
2020-02-14 09:30:58 +01:00
Joakim Hove
0b2dbf7fc2 GroupInjection is a map over phases + implement topup_phase 2020-02-14 09:30:58 +01:00
Joakim Hove
ecd8d98aab Merge pull request #1469 from atgeirr/fix-fmap-comparison
Fix operator==() of UDQFunctionTable.
2020-02-14 09:06:39 +01:00
Joakim Hove
9ce0e6783d Add datum_depth as member to RstWell 2020-02-14 07:27:05 +01:00
Joakim Hove
e4955d3d94 Merge pull request #1468 from joakim-hove/connection-segment
Connection segment
2020-02-14 06:49:43 +01:00
Joakim Hove
9e72cd3c82 Restart well - store allow xlflow in bool 2020-02-14 06:43:25 +01:00
Joakim Hove
7da79ae532 Convert rst quantities to SI units 2020-02-14 06:43:25 +01:00
Joakim Hove
50d1108e61 Merge pull request #1455 from joakim-hove/boost-remove
Boost remove
2020-02-13 22:46:42 +01:00
Joakim Hove
36662b2734 Use internal string trim functions instead of boost algorithm 2020-02-13 18:25:37 +01:00
Joakim Hove
1205e8c03c Avoid use of raw pointer 2020-02-13 17:08:36 +01:00
Joakim Hove
1c07a8f251 Code to connect segment <-> connection in *one* function call 2020-02-13 16:02:21 +01:00
Joakim Hove
9ac9e53d68 Remove unused include 2020-02-13 15:29:52 +01:00
Atgeirr Flø Rasmussen
5ab15783e2 Fix operator==() of UDQFunctionTable. 2020-02-13 15:04:02 +01:00
Arne Morten Kvarving
4f63172dc9 Merge pull request #1461 from akva2/use_std_filesystem
Replace boost::filesystem with std::filesystem
2020-02-13 15:01:02 +01:00
Kai Bao
8ddf71a67f Merge pull request #1460 from joakim-hove/wellsegments-state
Wellsegments state
2020-02-13 14:39:29 +01:00
Joakim Hove
349fb1f4f5 White space 2020-02-13 13:54:27 +01:00
Arne Morten Kvarving
fb75bcd4e2 changed: use std::filesystem instead of boost::filesystem
since we still support g++-7, where filesystem is marked experimental,
we introduce a wrapper header and expose the namespace to use
as Opm::filesystem.

for gcc we unconditionally link with libstdc++fs in the python bindings.
the setup.py stuff links as c code, not c++ code, so it is not
automatically added on any gcc version. this might prove unportable
later.
2020-02-13 12:34:19 +01:00
Joakim Hove
9099c8a12a Merge pull request #1466 from joakim-hove/segments-updates2
Segments updates2
2020-02-13 11:45:05 +01:00
Joakim Hove
899f698f73 Add message on stdout 2020-02-13 11:05:35 +01:00
Joakim Hove
ac2cac9f16 Remove member multiphase model from WellSegments 2020-02-13 11:03:14 +01:00
Joakim Hove
121386914b WellSegments - remove member length_depth 2020-02-13 11:03:14 +01:00
Joakim Hove
8657d59696 Remove name member from WellSegments class 2020-02-13 11:03:14 +01:00
Joakim Hove
b5d3af49e9 Remove variables: depth, length and volume from WellSegmentSet 2020-02-13 11:03:14 +01:00
Joakim Hove
185c715cff Remove WellSegments::operator<<() 2020-02-13 11:03:14 +01:00
Joakim Hove
bd688edfde Wellsegments are created with constructor 2020-02-13 11:03:14 +01:00
Joakim Hove
cac1dac893 Remove unused bool flag 2020-02-13 11:03:14 +01:00
Joakim Hove
b3d306482c Use const ref argument 2020-02-13 11:03:14 +01:00
Joakim Hove
ade0a78a06 Remove mutable accessors to set volume, depth and length 2020-02-13 11:03:14 +01:00
Joakim Hove
dd49f359f5 Grouped mutable accessors 2020-02-13 11:03:14 +01:00
Joakim Hove
95bda6f3f1 Merge pull request #1465 from atgeirr/fix-warnings
Silence a few warnings, remove some end-of-line whitespace.
2020-02-13 11:02:10 +01:00
Joakim Hove
b0fbb794d2 Remove WellSegments::operator<< 2020-02-13 09:23:33 +01:00
Joakim Hove
0525ea52a9 White space reformatting 2020-02-13 09:23:33 +01:00
Joakim Hove
7829895b3b Use raw pointer 2020-02-13 09:23:33 +01:00
Joakim Hove
2d858c43e3 Use proper SegmentType enum in RstSegment class 2020-02-13 09:23:33 +01:00
Atgeirr Flø Rasmussen
74129a2866 Silence a few warnings, remove some end-of-line whitespace. 2020-02-13 09:13:29 +01:00
Joakim Hove
921a68fc73 Merge pull request #1463 from joakim-hove/segment-updates
Segment updates
2020-02-13 07:47:27 +01:00
Joakim Hove
9bed25f035 Use common ICDStatus class for both Valve and SpiralICD 2020-02-12 15:09:26 +01:00
Joakim Hove
e2b58cecda Inetrnalize segment type in proper enum 2020-02-12 14:18:24 +01:00
Joakim Hove
f80160e6c0 Add icd file with status enum common to SpiralICD and Valve 2020-02-12 14:15:13 +01:00
Joakim Hove
963387da56 Removed invalid_value as member variable 2020-02-12 10:01:45 +01:00
Joakim Hove
cd990599b4 The type of a segment must be explicitly initialized 2020-02-12 10:00:31 +01:00
Arne Morten Kvarving
679c7a2a5c remove locale workaround for older boost versions 2020-02-12 09:14:30 +01:00
Markus Blatt
c7eb410309 Merge pull request #1456 from akva2/bump_to_cxx17
changed: remove the CXX11Features module
2020-02-11 17:51:18 +01:00
Joakim Hove
425769712e Merge pull request #1459 from akva2/janitoring
changed: initialize members to avoid potential unused warnings downstream
2020-02-11 13:30:01 +01:00
Bård Skaflestad
978ab75d3a Merge pull request #1026 from akva2/use_cxx11
changed: use std::regex instead of boost::regex
2020-02-11 05:39:52 -06:00
Arne Morten Kvarving
8d3ded8eb3 changed: initialize members to avoid potential unused warnings downstream 2020-02-11 10:51:42 +01:00
Arne Morten Kvarving
0f31f83483 changed: simplify seqnumFromSeparateFilename by using a regex 2020-02-11 08:49:08 +01:00
Arne Morten Kvarving
7876f530a1 changed: use std::regex instead of boost::regex 2020-02-11 08:49:08 +01:00
Arne Morten Kvarving
44f2af0589 changed: do not mess with flags in config file
abi is ensured in other ways now
2020-02-10 11:45:06 +01:00
Arne Morten Kvarving
c272ebba62 fixed: build python bindings as c++17 2020-02-10 11:36:56 +01:00
Arne Morten Kvarving
d8aae55837 changed: remove the CXX11Features module
instead use standard CMake mechanism to set cxx standard to 17
move some of the tests to a OpmCompilerChecks.cmake file
2020-02-10 11:36:56 +01:00
Joakim Hove
01b0dcaedf Merge pull request #1454 from joakim-hove/fix-switch
Fix bug in switch default case
2020-02-07 17:32:42 +01:00
Arne Morten Kvarving
28c9db0dcd Merge pull request #1453 from tskille/compareECL
Disable checking of DOUBHEAD[1] with compareECL
2020-02-07 15:25:21 +01:00
Joakim Hove
a396b9004a Remove problematic test 2020-02-07 15:12:24 +01:00
Joakim Hove
2b0e06994d Fix bug in switch default case 2020-02-07 15:10:48 +01:00
Joakim Hove
07cb2fe0d6 Merge pull request #1451 from joakim-hove/eclstate-aquifer
Eclstate aquifer
2020-02-07 14:27:56 +01:00
Torbjørn Skille
bfca7c9fe8 Disable checking of DOUBHEAD[1] with compareECL 2020-02-07 12:53:45 +01:00
Joakim Hove
1a1b796cb6 Refactor Aquifetp class
- Make constructor and operator== for struct
- Make constructor and accessor for serialization
- Initial pressure stored in std::pair<bool, double>
- Add size() and begin() and end()
- Remove unused memmbers cell_id and inftableID
- Use ParserKeywords::AQUIFETP class instead of string lookup
2020-02-07 07:30:22 +01:00
Joakim Hove
140a1c0bf3 Add accessor and constructor for serialization 2020-02-07 07:30:22 +01:00
Joakim Hove
f91630a62d Add operator== to AQuiferCT
Initial pressure is stored as std::pair<bool, double> instead of
std::shared_ptr<double>.
2020-02-07 07:30:22 +01:00
Joakim Hove
f666ab0544 Refactored the AquiferCT class to construct AQUCT_data struct 2020-02-07 07:30:22 +01:00
Joakim Hove
a505f59096 Add begin(), end() and size() to AquiferCT class 2020-02-07 07:30:22 +01:00
Joakim Hove
ca4c10f810 Use TableManager in AquiferCT constructor 2020-02-07 07:30:22 +01:00
Joakim Hove
b57a4a39a3 Merge pull request #1448 from joakim-hove/rst-testing
Rst testing
2020-02-07 07:29:40 +01:00
Joakim Hove
9f18d86a5e Merge pull request #1446 from bska/currctrl-restart-support
Add Restart Infrastructure for Well's Active Control
2020-02-06 16:35:46 +01:00
Bård Skaflestad
38f458a672 Add Restart Infrastructure for Well's Active Control
This commit introduces a new protocol for communicating a well's
active constraint (i.e., its current target control mode) between
the running simulator and the restart file.  In particular, we add a
new type

    Opm::data::CurrentControl

whose data members indicate if the well is a producer or injector
and, depending on that state, carries information about the
pertinent active control mode.  The 'prod' member should be defined
for producing wells and the 'inj' member should be defined for
injectors.  Default-constructed objects of this type are 'invalid'
and not output to the restart file.  Add a CurrentControl member to
the Opm::data::Well type to enable communicating this information
using existing restart interfaces.

Expand existing unit tests to exercise the new data member.
2020-02-06 12:01:41 +01:00
Joakim Hove
112a0d1f2d Add test for testing of restart loaded well and connection 2020-02-06 11:59:10 +01:00
Joakim Hove
42fc0666be Rst connection - use proper enums for direction and state 2020-02-06 11:59:10 +01:00
Joakim Hove
b3dc5483f1 Rst connection insert_index has offset 0 2020-02-06 11:59:10 +01:00
Joakim Hove
de471c8244 Shift RstConnection::segment to offset 0 2020-02-06 11:59:10 +01:00
Joakim Hove
6afd05db1b Add group mamber to RstWell 2020-02-06 11:59:10 +01:00
Joakim Hove
6d3cb49c11 Add method get_well() to RstState 2020-02-06 11:59:10 +01:00
Joakim Hove
c69ff506d8 Merge pull request #1432 from joakim-hove/python-rpath
Pass RPATH to the python setup.py based build system
2020-02-06 10:54:10 +01:00
Joakim Hove
833933e954 Remove superfluous extra extension 2020-02-06 10:18:07 +01:00
Joakim Hove
22787eea61 Add boost_system to the list of libraries in setup.py 2020-02-06 10:16:43 +01:00
Joakim Hove
6b0073455b Pass RPATH to the python setup.py based build system 2020-02-06 10:15:40 +01:00
Bård Skaflestad
8225ea87d4 Merge pull request #1450 from joakim-hove/unitsystem-ecl-id
Add UnitSystem functionality to handle eclipse integer id
2020-02-05 20:42:51 +01:00
Joakim Hove
8f213b19d6 Merge pull request #1447 from akva2/simplify_tuning
changed: simplify Tuning handling
2020-02-05 07:50:41 +01:00
Joakim Hove
35a580f610 Add UnitSystem functionality to handle eclipse integer id
Writing of INTEHEAD keyword uses UnitSystem class instead of intermediate enum
UnitSystem.
2020-02-05 07:38:00 +01:00
Arne Morten Kvarving
dab3ba807a changed: simpify Tuning handling
make Tuning a simple struct, and store as a DynamicState<Tuning>.

in the process the unused setTuningInitialValue is removed. it was
only used in unit tests and seem like a leftover
2020-02-04 10:42:43 +01:00
Joakim Hove
378431024e Merge pull request #1445 from joakim-hove/addwell-refactor
Add Schedule::addWell() overload which does not take Deck arguments
2020-02-02 09:37:35 +01:00
Joakim Hove
3c5ae4bf44 Add Schedule::addWell() overload which does not take Deck arguments 2020-01-30 10:38:41 +01:00
Bård Skaflestad
b8386eb7bf Merge pull request #1444 from joakim-hove/rst-schedule-prep
Rst schedule prep
2020-01-30 10:26:43 +01:00
Joakim Hove
78f4e59fc8 Add output of missing date when TimeMap::TimeMap() fails 2020-01-30 10:20:01 +01:00
Joakim Hove
cdbccce62a Ensure base restart file is written before loading restarted case 2020-01-30 10:20:01 +01:00
Joakim Hove
9456d05ec4 Fix keyword inconsistency in test data 2020-01-30 10:20:01 +01:00
Joakim Hove
fc20150336 Use time points from Schedule in restart testing 2020-01-30 10:20:01 +01:00
Joakim Hove
993511e347 Merge pull request #1417 from bska/filleps
INIT File: Reenable FILLEPS for Two-Phase Systems
2020-01-29 21:25:17 +01:00
Bård Skaflestad
79a3ec6e84 INIT File: Reenable FILLEPS for Two-Phase Systems
This reverts commit c736e71e46.
2020-01-29 16:34:15 +01:00
Bård Skaflestad
19ecc3d30e Consider Active Phases When Initializing Satfunc Endpoints
This commit passes the run's notion of its active phases, an object
of type Opm::Phases, through to the initialisation layer for the
saturation functions' scaling properties.  In particular, this
allows us to discriminate between the phases and to not index into
tables or properties that would not be appropriate (e.g., maximum
gas saturation (SGU) in a simulation run without active gas).

Moreover, we now have enough information to know to look for SOF2 in
two-phase run using family II saturation function keywords.  These
changes are necessary in order to extend Flow's support for the
FILLEPS output request to two-phase runs.
2020-01-29 16:34:15 +01:00
Joakim Hove
847182c25a Merge pull request #1442 from joakim-hove/use-set
Fixup
2020-01-29 15:28:15 +01:00
Joakim Hove
2b4f6bc73d Fixup 2020-01-29 15:11:42 +01:00
Joakim Hove
60abde0ffe Merge pull request #1433 from joakim-hove/rock-config
Rock config
2020-01-29 15:05:40 +01:00
Joakim Hove
936f142233 Add class RockConfig under SimulationConfig 2020-01-29 15:04:31 +01:00
Bård Skaflestad
41417c9d6a Merge pull request #1441 from joakim-hove/restart-fixup
Restart fixup
2020-01-29 14:11:16 +01:00
Joakim Hove
a33108dee0 Properly differentiate between base case and restart case in test 2020-01-29 12:45:42 +01:00
Joakim Hove
1d8ea3c92e Remove unused inline test data 2020-01-29 11:35:28 +01:00
Joakim Hove
d7a0693d08 Merge pull request #1440 from joakim-hove/ecl-config-cleanup
Ecl config cleanup
2020-01-29 08:05:41 +01:00
Joakim Hove
ae80f4521c Merge pull request #1439 from bska/tolcrit-for-sfunc-output
Make Saturation Function Output Aware of TOLCRIT
2020-01-29 00:46:42 +01:00
Joakim Hove
76229f95be Made IOConfig a member of RestartConfig 2020-01-29 00:27:35 +01:00
Joakim Hove
7036c3ee45 Remove unused constructor 2020-01-29 00:27:35 +01:00
Joakim Hove
3730cadcd8 Minor reorder 2020-01-29 00:27:35 +01:00
Joakim Hove
0b19eb7ffb Remove unused method declarations 2020-01-29 00:27:35 +01:00
Bård Skaflestad
c8d23c8d0a Merge pull request #1438 from joakim-hove/timemap-schedule-only
TimeMap iterate only over SCHEDULE section

Closes OPM/opm-simulators#2306
2020-01-29 00:08:06 +01:00
Joakim Hove
86367a78b8 Fix typo in json defintion of ENDSCALE 2020-01-28 20:40:42 +01:00
Joakim Hove
d36b6fa287 TimeMap iterate only over SCHEDULE section 2020-01-28 20:38:45 +01:00
Bård Skaflestad
fee20972b4 Make Saturation Function Output Aware of TOLCRIT
This commit switches to outputting all relative permeability values
less than TOLCRIT (default 1.0E-6) as zero when writing saturation
function tables to the INIT file's TAB vector.  Doing so also
nominally affects the relative permeability function derivatives for
small values of Kr.

Update the SPE1-based unit test since this has very low Kr values
for water and some of the nodes now fall below the 1.0e-6 threshold.
2020-01-28 16:38:29 +01:00
Arne Morten Kvarving
5e546086fb Merge pull request #1435 from akva2/hide_fprops_ifaces
changed: hide the templated 'has' and 'get' interfaces in FieldPropsManager
2020-01-28 15:33:49 +01:00
Joakim Hove
084b4721f9 Merge pull request #1437 from joakim-hove/schedule-testdata
Schedule testdata
2020-01-28 14:35:31 +01:00
Arne Morten Kvarving
9e8a765b93 quell warning when building without python
anonymize the parameter like is done for the rest of them
2020-01-28 14:32:27 +01:00
Arne Morten Kvarving
ae10af208f changed: hide the templated 'has' and 'get' interfaces in FieldPropsManager
motivation: an upcoming parallel frontend to the field props manager.
templated functions cannot be virtualized, and thus having these exposed
would give a great chance of confusing the users in the downstream
code, where properties would be caught from the (potentially) empty
backend instead of from the frontend.
2020-01-28 14:31:25 +01:00
Joakim Hove
79a75eba2a Add public accessor TimeMap::restart_offset() 2020-01-28 12:49:27 +01:00
Joakim Hove
8480e37975 Add header member to RstState 2020-01-28 12:49:27 +01:00
Joakim Hove
dcc52eb225 Add testdata 2020-01-28 12:46:18 +01:00
Joakim Hove
d1608ea2cf Merge pull request #1430 from joakim-hove/ecl-bc
Add class to internalize BC keyword - and add to SimulationConfig
2020-01-28 11:03:43 +01:00
Joakim Hove
c9f6326dc5 Add class to internalize BC keyword - and add to SimulationConfig 2020-01-27 11:55:15 +01:00
Joakim Hove
eed3c290b3 Merge pull request #1431 from bska/expose-tolcrit
Internalise TOLCRIT Keyword
2020-01-27 09:45:05 +01:00
Bård Skaflestad
7c1b77ec5d Internalise TOLCRIT Keyword
This commit internalises the TOLCRIT keyword into the EclipseState
for subsequent use in determining critical saturations when
processing saturation function keywords such as SGOF and SOF3.
Specifically, we add a new type

    Opm::SatFuncControls

that, at present, stores only the TOLCRIT data item (defaulted to
the keyword's default value).  Client code can then retrieve the
value by calling the

    SatFuncControls::minimumRelpermMobilityThreshold()

member function.

Add a new data member of this type to the Opm::Runspec class so that
we complete the chain from EclipseState, and a few simple unit tests
to exercise the expected functionality.
2020-01-24 20:58:38 +01:00
Bård Skaflestad
4094e4957a Merge pull request #1427 from joakim-hove/time-map-restart
Time map restart
2020-01-24 20:25:44 +01:00
Joakim Hove
db8ded1f09 Pass restart info to TimeMap constructor 2020-01-24 19:27:53 +01:00
Joakim Hove
0ba3a65d16 Merge pull request #1429 from akva2/remove_ioconfig_member
Fix TimeMap constructor and remove IOConfig member
2020-01-24 15:15:02 +01:00
Joakim Hove
c7023ab3c6 Merge pull request #1428 from atgeirr/avoid-repeated-warnings
Remove duplicate warnings for unhandled summary keywords.
2020-01-24 14:09:45 +01:00
Arne Morten Kvarving
1c2a284ee8 remove unused member m_first_restart_step from IOConfig 2020-01-24 13:13:22 +01:00
Arne Morten Kvarving
d885c09ffd fixed: add additional members also in std::vector<std::time_t> constructor
this is done in the deck based constructor, so we have to do the same
2020-01-24 13:13:21 +01:00
Atgeirr Flø Rasmussen
3ee092792c Remove duplicate warnings for unhandled summary keywords. 2020-01-24 12:27:32 +01:00
Joakim Hove
67fbdd3102 Merge pull request #1426 from joakim-hove/time-map-rm-cons
Time map rm cons
2020-01-23 09:15:20 +01:00
Joakim Hove
fd698139f5 Remove special code for serialization 2020-01-22 18:50:59 +01:00
Bård Skaflestad
2539a0d0e9 Merge pull request #1425 from joakim-hove/time-map-immutable
Time map immutable
2020-01-22 18:45:34 +01:00
Joakim Hove
fc9958bb0c Remove TimeMap( start_time ) constructor 2020-01-22 16:56:42 +01:00
Joakim Hove
63e99fb807 Make mutable accessors in TimeMap private 2020-01-22 16:23:37 +01:00
Joakim Hove
2d8151808f Add TimeMap(std::vector<std::time_t>& ) constructor 2020-01-22 16:23:37 +01:00
Joakim Hove
dd4a68b0a2 Merge pull request #1424 from akva2/add_gravity_flag
added: gravity flag to InitConfig
2020-01-22 14:15:59 +01:00
Joakim Hove
1cc2293c05 Merge pull request #1419 from joakim-hove/rst-state
POD classes for restart info
2020-01-22 13:33:26 +01:00
Arne Morten Kvarving
448ea5f3ab added: gravity flag to InitConfig 2020-01-22 12:47:39 +01:00
Joakim Hove
69822e880f Add POD struct for state with wells and groups from restart file 2020-01-22 12:23:26 +01:00
Joakim Hove
51daf43cef Merge pull request #1422 from akva2/noecl_flush_prestate
More serialization preparation
2020-01-22 06:30:57 +01:00
Arne Morten Kvarving
6a1acc15b8 make FaultCollection constructible from variables
also add accessor and equality operator
2020-01-21 15:22:10 +01:00
Arne Morten Kvarving
d5d5a01503 make Fault constructible from variables
also add default constructor and accessor
2020-01-21 15:22:10 +01:00
Arne Morten Kvarving
86b3566229 make FaultFace constructible from variables
also add default constructor and equality operator
2020-01-21 15:22:10 +01:00
Arne Morten Kvarving
be799586c8 make TransMult constructible from variables
also add default constructor and equality operator
2020-01-21 15:22:10 +01:00
Arne Morten Kvarving
43fae042b1 make EclipseConfig constructible from variables
also add default constructor and equality operator
2020-01-21 15:22:10 +01:00
Arne Morten Kvarving
4c49aea83e allow construction MULTREGTScanner from variables
also add accessors, equality operator, copy constructor,
assignment operator and make it default constructible
2020-01-21 15:22:10 +01:00
Arne Morten Kvarving
48bca722f5 changed: store reference to FieldPropsManager as a pointer
default initialization required for serialization
is not possible with a const ref member
2020-01-21 15:22:10 +01:00
Arne Morten Kvarving
83b3b5bab6 add equality operator to MULTREGTRecord 2020-01-21 14:36:00 +01:00
Joakim Hove
9c6a74043c Merge pull request #1420 from joakim-hove/remove-eclipse-3dproperties
Remove old 3D property implementation
2020-01-20 11:35:08 +01:00
Joakim Hove
ce9d325719 Merge pull request #1418 from joakim-hove/trim-padded-string
Add trim method to PaddedOutputString<N>
2020-01-20 08:37:40 +01:00
Joakim Hove
28d77dacd8 Add templated method create trimmed copy of string with c_str() 2020-01-19 23:18:49 +01:00
Joakim Hove
691296f91a Remove old 3D property implementation 2020-01-19 23:04:46 +01:00
Bård Skaflestad
1132857324 Merge pull request #1407 from akva2/noecl_flush_schedule
More serialization effort
2020-01-17 15:35:51 +01:00
Arne Morten Kvarving
6986436073 make TimeStampUTC constructible from variables
also add accessor
2020-01-17 10:08:50 +01:00
Arne Morten Kvarving
df5baad233 fixed: return by const ref 2020-01-17 10:08:50 +01:00
Arne Morten Kvarving
13db196c5c fixed: missing CTFKind parameter in Connection 2020-01-17 10:08:50 +01:00
Arne Morten Kvarving
c4936d55e1 fixed: update UDAValue constructors for new dim member 2020-01-17 10:08:50 +01:00
Arne Morten Kvarving
7ac2febae2 changed: allow disabling sanity check in Dimension constructor
while this makes sense to do in general, it causes issues
when reconstructing after deserialization.
we have dimensions with '/' and '*' in the name that was
constructed through newComposite.
2020-01-17 10:08:50 +01:00
Arne Morten Kvarving
828cd2ee9a fixed: add missing initializer 2020-01-17 10:08:50 +01:00
Bård Skaflestad
33fdacea54 Merge pull request #1415 from berland/wconhist-fix
Clean up item names in json for WCONHIST
2020-01-16 16:56:50 +01:00
Bård Skaflestad
7fb66a589e Merge pull request #1416 from akva2/janitoring
quell signed/unsigned comparison warnings
2020-01-16 15:48:25 +01:00
Arne Morten Kvarving
2951bf01d4 quell signed/unsigned comparison warnings 2020-01-16 14:54:48 +01:00
Håvard Berland
81701b72ba Clean up item names in json for WCONHIST
Consistency with other keywords
Change corresponding code that reads this.
2020-01-16 13:45:02 +01:00
Bård Skaflestad
a8d05385e6 Merge pull request #1387 from bska/dont-output-rft-unless-requested
Don't Output RFT Files Unless Specifically Requested
2020-01-15 12:45:40 +01:00
Bård Skaflestad
8440ac3bd1 Don't Output RFT Files Unless Specifically Requested
This commit ensures that we do not create RFT output files unless
the simulation model specifically requests such output (e.g.,
through keywords WRFT or WRFTPLT).  Notably, the OutputStream::RFT
constructor will also create the file so we must take care not to
form an object of this type unless actually needed.
2020-01-15 09:33:21 +01:00
Bård Skaflestad
3d94dc7e63 Merge pull request #1411 from joakim-hove/rst-connectin
Simple POD class for connection info loaded from restart file
2020-01-15 00:48:20 +01:00
Joakim Hove
66fd1d39e9 Small POD class for connections loaded from restart file 2020-01-14 23:04:57 +01:00
Joakim Hove
75b64025a3 Merge pull request #1412 from bska/first-rft-output-event
Rework RFT Config to Handle More Cases
2020-01-14 17:39:57 +01:00
Bård Skaflestad
8f182db27a Rework RFT Config to Handle More Cases
Generally, this commit captures more of the surrounding context of
calls to the updateRFT() and updatePLT() member functions.  We need
this additional context in order to handle the conflicting semantics
of output requests WRFT and WRFTPLT:FOPN.  The former generates RFT
output when the well opens if this event does not happen earlier in
the simulation schedule than the output request.  Otherwise no RFT
data is emitted.  The latter outputs RFT data at request time if
well opens no later than the request; otherwise at well-open time.

To this end, switch the well_open_rft_name data member from an
unordered_set of well names into an unordered_map from well names to
RFT output request times.  With this additional information we can
use well_open_rft_time to infer the appropriate response to whether
or not to activate RFT output at well open time.  Moreover, we now
guarantee that no RFT output is ever activated before the first RFT
output request.

Switching the type of the well_open_rft_name data member also begets
an API update to the serialization related RFTConfig constructor and
to the return type of RFTConfig::wellOpenRftName().

We furthermore switch to caching the first RFT output event in a new
scalar data member, first_rft_event.  This caching, coupled with the
additional calling context mentioned earlier, means we are now able
to report a high-fidelity, constant time answer to the

    RFTConfig::firstRFTOutput()

request.  This, in turn, is very useful for the RFT output code.
Finally, we also add a couple of new, private member functions to
simplify updating first_rft_event depending on context.

As part of this update, member function

    RFTConfig::setWellOpenRFT(report_step)

will now use the minimum of all 'report_step' values to support the
WRFT keyword being specified more than once.

Finally, add a set of unit tests to exercise the various RFT output
request combinations.

While here, also switch to using unordered_map::find() and emplace()
where possible to limit repeated look-up of the same keys.
2020-01-14 15:58:34 +01:00
Joakim Hove
ecb5fce19b Only active cells (#1298)
Use FieldProps implementation for 3D properties
2020-01-13 15:46:06 +01:00
Joakim Hove
13b3d1e17b Merge pull request #1395 from joakim-hove/use-pyaction
Use pyaction
2020-01-13 15:16:24 +01:00
Joakim Hove
a6ddce5d92 Add basic Python exec of PYACTION 2020-01-13 15:15:21 +01:00
Arne Morten Kvarving
e2719f02b6 Merge pull request #1409 from akva2/fix_python_superbuild
fixed: use PROJECT_XXX instead of CMAKE_XXX
2020-01-13 15:08:54 +01:00
Arne Morten Kvarving
8cf1497ccb fixed: use PROJECT_XXX instead of CMAKE_XXX
make it work fine with the 'super-build' CMakeLists.txt
2020-01-13 13:38:47 +01:00
Joakim Hove
b9c3df5f42 Add has_xxx and __contains__ to Python SummaryState 2020-01-13 11:43:58 +01:00
Joakim Hove
9ae007ddc9 Merge pull request #1405 from joakim-hove/well-warning
Add default: clause in switch
2020-01-13 11:42:23 +01:00
Joakim Hove
8bda586eee Merge pull request #1406 from atgeirr/silence-warnings
Silence some warnings.
2020-01-13 11:42:09 +01:00
Atgeirr Flø Rasmussen
b3f8209542 Silence some warnings. 2020-01-13 10:07:33 +01:00
Joakim Hove
83966eb565 Add default: clause in switch 2020-01-13 08:41:21 +01:00
Joakim Hove
1985f094a3 Merge pull request #1394 from joakim-hove/schedule-update-well
Schedule update well
2020-01-11 17:03:56 +01:00
Bård Skaflestad
17815f7487 Merge pull request #1400 from joakim-hove/rst-header
Rst header
2020-01-11 09:17:33 +01:00
Joakim Hove
7d1d08d4a8 Merge pull request #1399 from joakim-hove/py-code-records
Py code records
2020-01-11 06:57:45 +01:00
Joakim Hove
35619721a3 Well::updateStatus can optionally update status of connections 2020-01-11 06:55:22 +01:00
Joakim Hove
67f95e8548 Add Schedule::xxx_well() for well status manipulations from Python 2020-01-11 06:54:25 +01:00
Joakim Hove
5fb03ec44f Make POD class RestartIO::Header which internalizes restart header 2020-01-11 06:54:01 +01:00
Joakim Hove
16f0869bc0 Expose more indices in the INTEHEAD vector publicly 2020-01-11 06:54:01 +01:00
Joakim Hove
aa9bab75d9 Merge pull request #1391 from totto82/trinemykk-smartwater
Rebased brine module
2020-01-11 06:50:29 +01:00
Joakim Hove
0f29249478 Merge pull request #1402 from bska/record-all-wellopen-events
Schedule: Record RFT Well Open Events on Status Changes
2020-01-10 19:57:39 +01:00
Bård Skaflestad
33ef89487b Schedule: Record RFT Well Open Events on Status Changes
This commit ensures that we record a "well open" event whenever

    Schedule::updateWellStatus

switches a well's status to OPEN.  We need this information in order
to correctly output RFT data configured with WRFT or the FOPN option
of keyword WRFTPLT.  Previously, we recorded such events only in the
context of the WELOPEN keyword.
2020-01-10 18:21:19 +01:00
Bård Skaflestad
8cb1d62f29 Merge pull request #1398 from joakim-hove/py-refactor
Use 'PYEND' instead of '<<<' to terminate PYACTION and PYINPUT
2020-01-09 17:01:51 +01:00
Joakim Hove
9c99c681c9 Add ParseRecord::end_string member 2020-01-09 16:35:22 +01:00
Joakim Hove
5ea70d256d Extract ParserKeyword and ParserRecord 2020-01-09 15:48:25 +01:00
Joakim Hove
c025754834 Add size() method to RawKeyword 2020-01-09 09:42:16 +01:00
Joakim Hove
f3797e8877 Python code must be properly terminated 2020-01-09 09:26:35 +01:00
Joakim Hove
6199b81e60 Use 'PYEND' instead of '<<<' to terminate PYACTION and PYINPUT 2020-01-09 08:21:59 +01:00
Arne Morten Kvarving
ff156fd53c make BrineDensityTable constructible from variables
also add equality operator
2020-01-08 15:31:35 +01:00
Arne Morten Kvarving
763c931726 add equality operator to WellBrineProperties 2020-01-08 15:31:35 +01:00
Arne Morten Kvarving
eb6159fceb make PvtwsaltTable constructible from variables
also add accessor and equality operator
2020-01-08 15:31:35 +01:00
Arne Morten Kvarving
bc67976cb3 update TableManager constructor, assignment and equality operator
due to brine additions
2020-01-08 15:31:35 +01:00
Arne Morten Kvarving
affbfe3bae update well constructor for BrineProperties addition 2020-01-08 15:31:35 +01:00
Tor Harald Sandve
c5e68b82e8 Fix rebase smartwater 2020-01-08 15:31:35 +01:00
Trine S. Mykkeltvedt
b85871c4e8 renamed saltwater-->brine and edited BDENSITY 2020-01-08 15:31:35 +01:00
Trine S. Mykkeltvedt
aa19f38a54 Added keywords PVTWSALT and modified SALTVD, WSALT and BDENSITY for a simple salt/brine implementation 2020-01-08 15:31:35 +01:00
Bård Skaflestad
5fd756699e Merge pull request #1393 from akva2/noecl_flush
make SummaryConfig constructible from variables
2020-01-08 13:11:23 +01:00
Arne Morten Kvarving
8fbff44d22 make SummaryConfig constructible from variables
also add accessors and equality operator
2020-01-08 09:58:20 +01:00
Arne Morten Kvarving
d9c7260784 make SummaryNode default constructible 2020-01-08 09:58:10 +01:00
Joakim Hove
d127173ce2 Merge pull request #1392 from berland/opmioport
Port python examples from sunbeam to opm.io
2020-01-07 19:06:17 +01:00
Håvard Berland
62c97b8ca2 Port python examples from sunbeam to opm.io 2020-01-07 17:14:44 +01:00
Joakim Hove
b65e5547aa Merge pull request #1386 from joakim-hove/uda-raw-data
Uda raw data
2020-01-07 15:04:29 +01:00
Joakim Hove
bf697180d7 Merge pull request #1388 from tskille/pybind_eclipse_grid
additional python bindings for eclipse_grid
2020-01-07 07:10:34 +01:00
Joakim Hove
d2260e60b9 Merge pull request #1389 from joakim-hove/alternating-records
Fixup of alternating records special case
2020-01-06 18:12:29 +01:00
Joakim Hove
dfa318ec4d Merge pull request #1390 from joakim-hove/split-codegen-fixup
Fixup: leftover from code generation refactor
2020-01-06 18:12:03 +01:00
Torbjørn Skille
4136868592 additional python bindings for eclipse_grid 2020-01-06 17:43:32 +01:00
Joakim Hove
b72fd84e24 Fixup: leftover from code generation refactor 2020-01-06 16:20:16 +01:00
Joakim Hove
6f330a7482 Fixup of alternating records special case 2020-01-06 15:50:36 +01:00
Joakim Hove
b7cebb1907 Refactored the handling of BHP / THP 2020-01-06 15:28:04 +01:00
Joakim Hove
0d08986a06 Remove unit version when handling WELTARG
The WELTARG keyword will write into UDA instances, and they assume that the
internal data is in raw deck units.
2020-01-06 12:05:51 +01:00
Joakim Hove
ecd3ffdb49 Add method UDAValue::zero() 2020-01-06 12:05:51 +01:00
Joakim Hove
8f6c2c70f6 UDAalue::get<double>() will return raw value - not SI.
Add new function UDAValue::getSI() which will return SI value of numerical
input, and throw an exception if internal state is not numeric.
2020-01-06 12:05:51 +01:00
Joakim Hove
40ea92ac81 Reenable BHP testing 2020-01-06 12:05:51 +01:00
Joakim Hove
c2b4d30be5 Merge pull request #1377 from joakim-hove/pyaction
Add PyAction skeleton code
2020-01-06 12:04:26 +01:00
Joakim Hove
d2392c4ea4 Add PyAction skeleton code 2020-01-06 10:28:19 +01:00
Joakim Hove
4e899503e2 Merge pull request #1380 from joakim-hove/split-codegen
Split codegen
2020-01-06 10:27:14 +01:00
Joakim Hove
3c29d4c410 Merge pull request #1385 from akva2/noecl_flush
More serialization preparation
2020-01-03 20:15:31 +01:00
Arne Morten Kvarving
f8bf446d45 make Schedule constructible from variables
also add accessors and equality operator
2020-01-03 13:20:36 +01:00
Arne Morten Kvarving
2ca198d687 add equality operator to DynamicVector 2020-01-03 13:20:36 +01:00
Arne Morten Kvarving
9d74b51024 make Action::Actions constructible from variables
also add accessor and equality operator
2020-01-03 13:20:36 +01:00
Arne Morten Kvarving
e0502a1970 make Action::ActionX constructible from variables
also make it default constructible, add accessors
and equality operator
2020-01-03 13:20:36 +01:00
Arne Morten Kvarving
24bfa2e75b add equality operator to Action::Condition
also make it default constructible
2020-01-03 13:20:36 +01:00
Arne Morten Kvarving
65b958cbcd add equality operator to Action::Quantity 2020-01-03 13:20:36 +01:00
Arne Morten Kvarving
e7e2458951 make Action::AST constructible from variables
also add accessors and equality operator
2020-01-03 13:20:36 +01:00
Bård Skaflestad
5fb4d355ec Merge pull request #1383 from joakim-hove/fp-section
Fp section
2020-01-03 11:33:54 +01:00
Arne Morten Kvarving
73001501f0 make ASTNode constructible from variables
also add accessors and equality operator
2020-01-03 08:34:28 +01:00
Arne Morten Kvarving
9c187ad0c1 changed: make ASTNode part of public API
required for serialization
2020-01-03 08:34:28 +01:00
Arne Morten Kvarving
fda4862bb7 make Tuning constructible from variables
also make it default constructible, add accessors
and equality operator
2020-01-03 08:32:54 +01:00
Arne Morten Kvarving
b0f262374e make Deck constructible from variables
also make it default constructible, add accessors
assignment operator and equality operator
2020-01-03 08:30:42 +01:00
Arne Morten Kvarving
2d750b1b0b make DeckKeyword constructible from variables
also make it default constructible and add accessors
2020-01-03 08:28:07 +01:00
Arne Morten Kvarving
3cf79037e2 add equality operator to Location
also put it in Opm namespace
2020-01-03 08:24:33 +01:00
Joakim Hove
5e10c94f9f Merge pull request #1375 from joakim-hove/actionx-bug
Actionx bug
2020-01-02 21:27:20 +01:00
Joakim Hove
b7fcded7ef Merge pull request #1378 from joakim-hove/wrap-summarystate
python wrapper for summarystate
2020-01-02 20:54:48 +01:00
Joakim Hove
c42be3d345 Fixed bug in SORTA and SORTD functions 2020-01-02 20:18:19 +01:00
Joakim Hove
b1dc69d8a6 Refactored internals of UDQSet 2020-01-02 20:16:37 +01:00
Joakim Hove
0ea6f93074 Merge pull request #1384 from akva2/noecl_flush
More serialization preparation
2020-01-02 20:01:11 +01:00
Arne Morten Kvarving
bd3923ad1d add accessor to DeckRecord 2020-01-02 15:33:41 +01:00
Arne Morten Kvarving
3105799f0f make DeckItem constructible from variables
also make it default constructible, add accessors
and equality operator
2020-01-02 15:31:27 +01:00
Arne Morten Kvarving
55c8d69890 make RFTConfig constructible from variables
also make it default constructible, add accessors
and equality operator
2020-01-02 15:28:45 +01:00
Joakim Hove
087aec6e01 Refactored generated keyword test to reduce compilation time 2020-01-02 15:27:54 +01:00
Joakim Hove
3c6a60c4a9 Code genereator will create many source files 2020-01-02 15:27:54 +01:00
Joakim Hove
aaee287dac Code generation file update routines are void 2020-01-02 15:27:54 +01:00
Joakim Hove
c3a038c2b6 Refactor code generation to facilitate multiple source files 2020-01-02 15:27:54 +01:00
Joakim Hove
141000b750 FieldProps parsing is section aware - handle MULT in EDIT 2020-01-02 15:27:22 +01:00
Joakim Hove
8cba2777cd Add Section enum 2020-01-02 15:27:22 +01:00
Joakim Hove
90d30e3bc9 Rename class Section -> DeckSection 2020-01-02 15:27:22 +01:00
Arne Morten Kvarving
97319d4831 make GConSump constructible from variables
also make it default constructible, add accessors
and equality operator
2020-01-02 15:25:42 +01:00
Arne Morten Kvarving
e7d7e2e232 make GConSale constructible from variables
also make it default constructible, add accessors
and equality operator
2020-01-02 15:22:59 +01:00
Arne Morten Kvarving
01dd29278a make GuideRateConfig constructible from variables
also make it default constructible, add accessors
and equality operator
2020-01-02 15:20:16 +01:00
Arne Morten Kvarving
e803f97374 make GuideRateModel constructible from variables
also make it default constructible, add accessors
and equality operator
2020-01-02 15:17:08 +01:00
Joakim Hove
9363905e03 Merge pull request #1382 from akva2/noecl_flush
More serialization preparation
2020-01-02 15:08:22 +01:00
Arne Morten Kvarving
2a8f944b6f make UDQActive constructible from variables
also make it default constructible, add accessors
and equality operator
2020-01-02 12:17:26 +01:00
Arne Morten Kvarving
5c203e29b5 make UDQConfig constructible from variables
also make it default constructible, add accessors
and equality operator
2020-01-02 12:12:59 +01:00
Arne Morten Kvarving
763bc69211 add equality operator to UDQIndex 2020-01-02 12:11:28 +01:00
Arne Morten Kvarving
ec907c22c1 make UDQAssign constructible from variables
also make it default constructible, add accessors
and equality operator
2020-01-02 12:10:00 +01:00
Arne Morten Kvarving
426ee94a75 add equality operator to UDQAssign::AssignRecord 2020-01-02 12:10:00 +01:00
Arne Morten Kvarving
5d6046fdae make UDQDefine constructible from variables
also make it default constructible, add accessors
and equality operator
2020-01-02 12:08:27 +01:00
Arne Morten Kvarving
45aad7e7fd remove unused member variable from UDQDefine 2020-01-02 12:08:27 +01:00
Arne Morten Kvarving
6720e6a6cb make UDQASTNode constructible from variables
also make it default constructible, add accessors
and equality operator
2020-01-02 12:06:34 +01:00
Arne Morten Kvarving
9c991241c0 changed: make UDQASTNode part of public API
needed for serialization
2020-01-02 12:06:34 +01:00
Arne Morten Kvarving
dab5f226e1 make UDQFunctionTable constructible from variables
also make it default constructible, add accessors
and equality operator
2020-01-02 12:04:05 +01:00
Arne Morten Kvarving
c0183ae78a make UDQFunction constructible from variables
also make it default constructible and add equality operator
2020-01-02 12:02:31 +01:00
Arne Morten Kvarving
4c626c2265 make WListManager constructible from variables
also make it default constructible, add accessors
and equality operator
2020-01-02 12:00:15 +01:00
Arne Morten Kvarving
12f87578d6 make WList constructible from variables
also make it default constructible, add accessors
and equality operator
2020-01-02 11:59:09 +01:00
Joakim Hove
af477900b9 Merge pull request #1381 from akva2/noecl_flush
More serialization preparation
2020-01-02 11:50:03 +01:00
Arne Morten Kvarving
c8c5102e9d make Group constructible from variables
also make it default constructible, add accessors
and equality operator
2020-01-02 09:17:33 +01:00
Arne Morten Kvarving
0fc57a2bd8 make IOrderSet constructible from variables
also make it default constructible, add accessors
and equality operator
2020-01-02 09:17:33 +01:00
Arne Morten Kvarving
a58fd61fdd allow constructing Well from variables
also add accessors
2020-01-02 09:17:33 +01:00
Arne Morten Kvarving
d1d2414f4e make WellSegments constructible from variables
also add accessors and equality operator
2020-01-02 08:31:22 +01:00
Arne Morten Kvarving
6ea8dd8104 make UnitSystem constructible from variables
also make it default constructible and add accessors
2020-01-02 08:27:31 +01:00
Arne Morten Kvarving
7c3f89b0a1 add non-throwing accessor for si scaling factor in Dimension 2020-01-02 08:25:51 +01:00
Arne Morten Kvarving
8b33a0e36a allow constructing Segment from variables 2020-01-02 08:22:42 +01:00
Arne Morten Kvarving
7f570d1404 make Valve constructible from variables
also make it default constructible and equality operator
2020-01-02 08:19:31 +01:00
Arne Morten Kvarving
a4f97e84b6 allow constructing SpiralICD from variables
also make it default constructible and add equality operator
2020-01-02 08:17:36 +01:00
Joakim Hove
20c5a2b50e python wrapper for summarystate 2019-12-27 10:08:46 +01:00
Joakim Hove
a2def0ea5b Merge pull request #1372 from stefoss23/python_field_props
Python: added class FieldProperties.
2019-12-23 23:06:05 +01:00
Joakim Hove
4528109245 Merge pull request #1374 from joakim-hove/isolnum
Add integer property ISOLNUM
2019-12-23 13:29:02 +01:00
Joakim Hove
b95f7bd6bf Add integer property ISOLNUM 2019-12-23 12:23:41 +01:00
Steinar Foss
dc8acb494c python FieldProperties can return numpy int arrays. 2019-12-23 11:58:05 +01:00
Steinar Foss
d3a4b536d2 python FieldProperties can return numpy double arrays. 2019-12-23 11:35:52 +01:00
Joakim Hove
99791032b3 Merge pull request #1373 from joakim-hove/fp-cache-valid
Add internal flag to check if all FieldProps values have been set
2019-12-23 10:54:58 +01:00
Joakim Hove
ce49db8438 Add internal flag to check if all FieldProps values have been set 2019-12-23 10:11:39 +01:00
Joakim Hove
5060813c4e Merge pull request #1371 from joakim-hove/opmi-time
Add time summaries to opmi
2019-12-23 08:01:33 +01:00
Steinar Foss
d6c1d64ba0 Python: added class FieldProperties.
test_props.py: added check for 3d_properties/field_props extraction.

cxx/eclipse_state.cpp: adding function field_props.

added python class FieldProperties.

python FieldProps: added __contains__.

python FieldProps: added __getitem__.

python field_props: images all 3dprops tests.
2019-12-22 15:25:16 +01:00
Joakim Hove
4048b8774e Add time summaries to opmi 2019-12-22 12:42:56 +01:00
Bård Skaflestad
2438e46d8a Merge pull request #1370 from joakim-hove/init-speedup
Init speedup
2019-12-20 23:08:13 +01:00
Joakim Hove
c8b0da82c0 Merge pull request #1366 from joakim-hove/fp-spoly
Fp spoly
2019-12-20 17:24:08 +01:00
Bård Skaflestad
4b8152d8e1 Merge pull request #1367 from akva2/noecl_flush
More serialization preparation
2019-12-20 17:06:55 +01:00
Kai Bao
8284634cc5 Merge pull request #1239 from GitPaean/removing_whitespace_test_ERst.cpp
[PR to update_data] removing whitespaces from test_ERst.cpp
2019-12-20 16:43:53 +01:00
Joakim Hove
fbe3d34acb Merge pull request #1369 from stefoss23/udt
Parser will skip keyword UDT.
2019-12-20 16:30:24 +01:00
Bård Skaflestad
188d6ca179 Merge pull request #1361 from joakim-hove/multregp
Multregp
2019-12-20 16:04:00 +01:00
Arne Morten Kvarving
40e09f9169 Merge pull request #1368 from akva2/fix_no_data_to_update
fixed: do not open a issue/PR if no tests failed
2019-12-20 16:01:14 +01:00
Arne Morten Kvarving
a060cb2d17 make WellProductionProperties constructible from variables
also make it default constructible and add an accessor
2019-12-20 15:47:13 +01:00
Arne Morten Kvarving
84eb1542ef fixed: do not open a issue/PR if no tests failed 2019-12-20 15:20:49 +01:00
Joakim Hove
f03aeabc38 Refactored cell volume calculations for speed 2019-12-20 14:24:31 +01:00
Steinar Foss
e2e8d1eb22 Parser will skip keyword UDT.
Parser will skip UDT.
2019-12-20 12:40:20 +01:00
Joakim Hove
3fd9b20cd7 White space changes 2019-12-20 12:23:14 +01:00
Arne Morten Kvarving
69f4b72b3a make WellConnections constructible from variables
also make it default constructible and add accessors
2019-12-20 11:54:02 +01:00
Arne Morten Kvarving
cc4c5c1fbd add equality operator to WellGuideRate 2019-12-20 11:51:56 +01:00
Arne Morten Kvarving
7eeadd8cb5 make WellEconProductionLimit constructible from variables 2019-12-20 11:48:57 +01:00
Arne Morten Kvarving
80702dba06 make WellInjectionProperties constructible from variables
also make it default constructible
2019-12-20 11:41:54 +01:00
Arne Morten Kvarving
e4361cd1e0 make Connection constructible from variables
also make default constructible
2019-12-20 11:40:58 +01:00
Arne Morten Kvarving
e6f2bd0eac allow constructing WelltracerProperties from variables
also add accessor and convenience type alias
2019-12-20 11:39:24 +01:00
Arne Morten Kvarving
0e8ae81440 add equality operator to WellFoamProperties 2019-12-20 11:39:24 +01:00
Arne Morten Kvarving
72cd4cf1ad allow constructing WellPolymerProperties from variables 2019-12-20 11:39:24 +01:00
Bård Skaflestad
30773db877 Merge pull request #1365 from akva2/noecl_flush
More serialization preparation
2019-12-20 10:41:44 +01:00
Joakim Hove
cf3a4ffe25 Add keyword SSOL to FieldProps 2019-12-20 09:09:35 +01:00
Joakim Hove
e50f05ca9a Add keyword SPOLYMW to FieldProps 2019-12-20 09:09:35 +01:00
Joakim Hove
33bcbb26e6 Add RS and RV to FieldProps 2019-12-20 09:09:35 +01:00
Joakim Hove
b3dfe95b43 Add SPOLY keyword to FieldProps 2019-12-20 09:09:35 +01:00
Arne Morten Kvarving
4c331ae655 allow constructing MessageLimits from data
also add default constructor, equality operator and accessor
2019-12-20 08:20:15 +01:00
Arne Morten Kvarving
a91ce46ca3 allow constructing WellTestConfig from variables
also add accessor and equality operator
2019-12-20 08:15:22 +01:00
Arne Morten Kvarving
f0786fb88a add equality operator to WTestWell 2019-12-20 08:15:22 +01:00
Arne Morten Kvarving
9050bdb08e allow constructing VFPProdTable from data
also add default constructor, assignment operator
and equality operator
2019-12-20 08:14:43 +01:00
Arne Morten Kvarving
3e46908041 allow constructing VFPInjTable from data
also add default constructor, assignment operator
and equality operator
2019-12-20 08:13:01 +01:00
Arne Morten Kvarving
ae13dd1867 allow constructing Events from data
also add default constructor, equality operator and accessor
2019-12-20 08:10:54 +01:00
Arne Morten Kvarving
eadca769a0 allow constructing DynamicVector for data
also add default constructor and accessor
2019-12-20 08:10:03 +01:00
Arne Morten Kvarving
74e57deac2 allow constructing OilVaporizationProperties from data
also add default constructor and accessors
2019-12-20 08:08:32 +01:00
Joakim Hove
067fcd636c Merge pull request #1362 from joakim-hove/python-has-alue
Python has alue
2019-12-20 07:31:13 +01:00
Joakim Hove
4f11b7846c Add support for MULTREGP in FieldProps::porv implementation 2019-12-20 07:28:48 +01:00
Joakim Hove
fde5c0b096 Merge pull request #1359 from joakim-hove/fp-comments
Fp comments
2019-12-20 07:27:17 +01:00
Joakim Hove
5cf0d0393b Merge pull request #1363 from stefoss23/add_some_uknown_size_keywords
keyword ROCK: size->UNKNOWN. Added keyword ADSORP.
2019-12-19 20:14:36 +01:00
Steinar Foss
a5c245bc6c keyword ROCK: size->UNKNOWN. Added keyword ADSORP.
added keyword ADSOPR w/ test.

keyword ADSORP: size set to NTSFUN, TABDIMS.

keyword ADSORP size shift:1.

ParserTests: added test for kw ROCK.
2019-12-19 15:27:55 +01:00
Joakim Hove
465b2b6a1d Add Python methods DeckItem.has_value() and DeckItem.defaulted() 2019-12-19 15:22:16 +01:00
Joakim Hove
378d5c120b Remove trailing whitespace 2019-12-19 15:20:15 +01:00
Joakim Hove
46999f418f Refactored FieldProps
- The lowest level get method is called init_get() - this will unconditionally
  create new keyword. The init_get() method is private.

- Introduced FieldDataManager which keeps track of data pointer and status.

- Refactored get( ) implementation
2019-12-19 15:06:20 +01:00
Joakim Hove
ce5b9b1e1d Add documentation to the FieldPropsManager 2019-12-19 10:55:57 +01:00
Joakim Hove
7cfb51dfe6 Merge pull request #1195 from jalvestad/actionx-udq-rst
Code to write UDQ and ACTIONX data to the Eclipse compatible restart file
2019-12-19 10:27:51 +01:00
Arne Morten Kvarving
306af1b445 Merge pull request #1360 from akva2/noecl_flush
Yet another round of serialization preparation
2019-12-19 10:25:25 +01:00
Arne Morten Kvarving
0841a28776 allow constructing TableManager from variables
also add accessor, assignment operator and equality operator
2019-12-19 09:29:26 +01:00
Arne Morten Kvarving
8e1a332920 add equality operator to ROCKRecord 2019-12-19 09:29:26 +01:00
Arne Morten Kvarving
7b36d325b5 allow constructing Aqudims from variables
also add equality operator
2019-12-19 09:28:23 +01:00
Arne Morten Kvarving
8c61d6fff5 add equality operator to Eqldims 2019-12-19 09:28:23 +01:00
Arne Morten Kvarving
90bb9abf31 add equality operator to Regdims 2019-12-19 09:28:23 +01:00
Arne Morten Kvarving
415fda815f allow constructing SkprwatTable from variables
also add equality operator
2019-12-19 09:26:57 +01:00
Arne Morten Kvarving
1ecbc75bfb allow constructing SkprpolyTable from variables
also add equality operator
2019-12-19 09:26:57 +01:00
Arne Morten Kvarving
d7acc1ee0f allow constructing PlymwinjTables from variables
also add equality operator
2019-12-19 09:26:57 +01:00
Arne Morten Kvarving
6ccdaaa635 allow constructing PolyInjTables from variables
also add equality operator
2019-12-19 09:24:34 +01:00
Bård Skaflestad
ceb4b1e287 Merge pull request #1354 from stefoss23/add_some_keywords
Adding some keywords
2019-12-18 22:19:14 +01:00
Bård Skaflestad
0b4b3cf22b Merge pull request #1355 from joakim-hove/switch-warning
Add default: clause in switch
2019-12-18 20:37:34 +01:00
Arne Morten Kvarving
87ca5e6f58 Merge pull request #1356 from akva2/noecl_flush
Another round of serialization preparation
2019-12-18 16:56:09 +01:00
Arne Morten Kvarving
2ae7921fcb add equality operator to WATDENTRecord 2019-12-18 14:27:02 +01:00
Arne Morten Kvarving
49b8bff030 add equality operator to VISCREFRecord 2019-12-18 14:27:02 +01:00
Arne Morten Kvarving
b0ab7fdf8d add equality operator to DENSITYRecord 2019-12-18 14:27:02 +01:00
Arne Morten Kvarving
d992bfc1e0 add equality operator to PVCDORecord 2019-12-18 14:25:51 +01:00
Arne Morten Kvarving
98a332fc5f allow constructing FlatTable from vector 2019-12-18 14:25:08 +01:00
Joakim Hove
6a03d72a4e Add default: clause in switch 2019-12-18 14:24:21 +01:00
Arne Morten Kvarving
59235b5a11 add equality operator to PVTWRecord 2019-12-18 14:24:17 +01:00
Arne Morten Kvarving
39ab36819e allow constructing JFunc from variables
also add equality operator
2019-12-18 14:23:11 +01:00
Arne Morten Kvarving
73be14b7b8 Merge pull request #1353 from akva2/noecl_flush
Next round of serialization preparation
2019-12-18 14:16:44 +01:00
Atgeirr Flø Rasmussen
7c77d9e2a7 Merge pull request #1351 from joakim-hove/weltarg-unit-conversio
Temporarily bypass the unit conversion in handleWELTARG
2019-12-18 13:56:02 +01:00
Joakim Hove
a89063e6a4 Merge pull request #1346 from stefoss23/dynamicr
DYNAMICR
2019-12-18 13:50:21 +01:00
Jostein Alvestad
b519d825f2 corrections to test_msim_ACTIONX and SCON[40] 2019-12-18 13:27:34 +01:00
Steinar Foss
429a5be890 added keywords ACTIONS, AMALGAM, APILIM, APIVD, AQUALIST, AQUCHGAS, AQUCHWAT, BDENSITY, BGGI, BOGI.
added keywords AMALGAM, APILIM, APIVD.

added keyword AQUALIST.

added keywords AQUCHGAS, AQUCHWAT, BDENSITY.

added keywords BGGI, BOGI.

altered list of 'special' keywords.
2019-12-18 12:46:09 +01:00
Steinar Foss
01b62e4617 added keyword DYNAMICR.
added keyword DYNAMICR.
2019-12-18 09:34:40 +01:00
Arne Morten Kvarving
07a782d9c0 allow constructing Pvt(g|o|x)Tables from variables
also add equality operator
2019-12-18 09:18:29 +01:00
Arne Morten Kvarving
9ff8cb9f15 allow constructing Runspec from variables
also add equality operator
2019-12-18 09:18:29 +01:00
Arne Morten Kvarving
33e14dd3cf allow constructing Actdims from variables
also add equality operator
2019-12-18 09:17:12 +01:00
Arne Morten Kvarving
dc1168edb4 allow constructing EclHysterConfig from variables
also add equality operator
2019-12-18 09:17:12 +01:00
Arne Morten Kvarving
d5384aa659 allow constructing UDQParams from variables
also add equality operator
2019-12-18 09:17:12 +01:00
Arne Morten Kvarving
14c67975cb allow constructing WellSegmentDims from variables
also add equality operator
2019-12-18 09:14:45 +01:00
Arne Morten Kvarving
7c4b63c4bd allow constructing Welldims from variables
also add equality operator
2019-12-18 09:14:45 +01:00
Arne Morten Kvarving
3f1aa7f4df allow constructing EndpointScaling from variables
also add accessors and equality operator
2019-12-18 09:14:45 +01:00
Markus Blatt
43116d3c45 Merge pull request #1352 from akva2/noecl_flush
Next round of serialization preparation
2019-12-18 08:11:23 +01:00
Joakim Hove
3a87395419 Merge pull request #1348 from joakim-hove/udq-parse-diff
UDQ parse A - B - C
2019-12-17 18:55:06 +01:00
Joakim Hove
46f6aaec02 Merge pull request #1338 from stefoss23/double_records
Can parse keywords of type double-record.
2019-12-17 17:09:11 +01:00
Joakim Hove
89ab99e6b9 UDQ: fix bug with parsing of expressions like A - B - C - D
- In the case of several tokens separated with +/- the final tree is assembled
   from left, was previously from the right. This fixes evaluation bug with
   expressions like A - B - C which were eventually evaluated as A - (B - C).

 - Improved handling of different types; both transiton from scalar to sets of
   wells and groups, and also groups in general. In particular you can now
   assign to a group variable:

        DEFINE GUXXX  WOPR * 0.25

 - Actually hook up the evaluation of group variables from the Summary code.
2019-12-17 16:59:06 +01:00
Arne Morten Kvarving
582e08692b allow constructing Tabdims from variables
also add equality operator
2019-12-17 16:36:42 +01:00
Arne Morten Kvarving
6069867b32 allow constructing Phases from variables
also add accessors and equality operator
2019-12-17 16:36:42 +01:00
Arne Morten Kvarving
95680c70c3 allow constructing IOConfig from variables
also add accessors and equality operator
2019-12-17 16:36:06 +01:00
Jostein Alvestad
1e0a43c4f8 corrections to unit tests 2019-12-17 16:34:45 +01:00
Arne Morten Kvarving
9825e25740 allow constructing RestartConfig from tables
also add accessors and equality operator
2019-12-17 16:34:24 +01:00
Arne Morten Kvarving
6ee97a3f9a allow constructing DynamicState from tables
also add accessor and equality operator
2019-12-17 16:34:24 +01:00
Arne Morten Kvarving
6378d55fa9 allow constructing TimeMap from tables
also add accessors and equality operators
2019-12-17 16:33:46 +01:00
Arne Morten Kvarving
d78319222f Merge pull request #1349 from akva2/noecl_flush
Another round of serialization preparation
2019-12-17 15:45:39 +01:00
Joakim Hove
8573c947fa Temporarily bypass the unit conversion in handleWELTARG 2019-12-17 15:28:08 +01:00
Atgeirr Flø Rasmussen
6c1c6e2c13 Merge pull request #1350 from akva2/janitoring
add a default to quell unhandled value in switch warning
2019-12-17 13:40:13 +01:00
Arne Morten Kvarving
b7be32fadc allow constructing SimulationConfig from tables
also equality operator
2019-12-17 12:46:27 +01:00
Arne Morten Kvarving
b4066d40f5 allow constructing InitConfig from tables
also add accessors and equality operator
2019-12-17 12:46:27 +01:00
Arne Morten Kvarving
d13b9a0a15 allow constructing FoamConfig from tables
also add accessors and equality operator
2019-12-17 12:46:27 +01:00
Jostein Alvestad
3fa8c25b47 remove debug print 2019-12-17 12:30:50 +01:00
Jostein Alvestad
cf82a90815 Add changes for WHISTCTL data in ECL restart 2019-12-17 12:30:48 +01:00
Jostein Alvestad
ae47d39a1a further corrections 2019-12-17 12:30:47 +01:00
Jostein Alvestad
0c9a2cbbf6 initial changes to test output of UDQ and ACTIONX data to ecl-restart
change to avoid zero-size windows in Actionx

changes to improve Restart output content

change to correct IUDQ for DEFINE

corrections to IACN and SACN

initial changes to add item to ZWEL

further changes to add Action to well

further changes to allow for action name in ZWEL

more changes

further changes to output action name to ZWEL

changes to test/debug Restart write

turn on writing of ZWEL again

First running version of udq-actionx-rst

use Action::Result direkte

first working! version

some corrections

changes to allow for output of SACN [4.6.8]

added debug print

changes to improve IACN and IACT

further corrections to Actionx IACN pluss error messages

changes to adapt to well2 converted to well class

further changes to enable restart with group control

changes to adapt to newly merged code in master

changes to include Intehead [51] - group control

test

changes to iGrp[nwgmax +7]

initial changes for GUIDERATE

changes to add guiderate parameters to the restart file

add comment

correction to guiderate - test if exist

correction to DoubHead - test if GR exist

correction to ISEG[8]

correction for eclipse version Restart-file

Cosmetic change

corrections to igrp

correction to segment type in iseg
2019-12-17 12:30:40 +01:00
Arne Morten Kvarving
a63bde6bba add a default to quell unhandled value in switch warning 2019-12-17 11:57:08 +01:00
Joakim Hove
132665e469 Merge pull request #1270 from bska/restart-wsegvalv
Add Restart File Support for WSEGVALV Devices
2019-12-17 11:29:37 +01:00
Arne Morten Kvarving
b56cef3103 allow constructing FoamData from doubles
also add accessors and equality operator
2019-12-17 11:04:12 +01:00
Arne Morten Kvarving
0741f4c099 allow constructing Equil from tables
also add accessors and equality operator
2019-12-17 10:31:23 +01:00
Arne Morten Kvarving
d532f861ac add equality operator and a default constructor to EquilRecord 2019-12-17 10:31:23 +01:00
Arne Morten Kvarving
850c91f047 add accessors to TableContainer
also add equality operator and default constructor
2019-12-17 10:26:42 +01:00
Arne Morten Kvarving
baef4f00fa allow constructing SimpleTable from tables
also add accessors and equality operator
2019-12-17 10:25:12 +01:00
Arne Morten Kvarving
3b49c8a63c allow constructing TableColumn from tables
also add accessors and equality operator
2019-12-17 10:25:12 +01:00
Bård Skaflestad
ebfa768fd2 Segment: Make Type Predicates Free Functions
That way, we won't have to pollute the Segment API when adding new
segment types.  While here, also reduce header file coupling by
forward-declaring SpiralICD and Valve in Segment.hpp.
2019-12-17 09:14:17 +01:00
Bård Skaflestad
21de27a1cb Output Valve Characteristics to Restart File
This commit identifies well segments that correspond to valves
(input keyword WSEGVALV) and captures those in the ISEG vector.
Furthermore, we output characteristic properties of such valve
segments (e.g, the valve length, the base strength, and
cross-sectional area) in the RSEG vector.
2019-12-17 09:14:17 +01:00
Bård Skaflestad
40e0f83b7b Segment: Add Means of Identifing Valve Devices
This commit adds a simple predicate, Segment::isValve(), that lets
client code query whether or not a particular segment represents a
valve--created through the WSEGVALV keyword.

If so, the client can also request the valve itself to inspect the
pertinent valve properties.
2019-12-17 09:14:17 +01:00
Atgeirr Flø Rasmussen
64fd78694e Merge pull request #1347 from akva2/janitoring
Some janitoring
2019-12-17 08:44:04 +01:00
Arne Morten Kvarving
77cadac586 anonymize unused parameters 2019-12-16 16:14:28 +01:00
Arne Morten Kvarving
c57466aa70 remove unused function 2019-12-16 16:14:21 +01:00
Arne Morten Kvarving
6237cdeba6 Merge pull request #1344 from akva2/noecl_flush
Preparation for serialization support
2019-12-16 16:01:15 +01:00
Bård Skaflestad
61c698b9c2 Merge pull request #1345 from stefoss23/fix_writeinit
WriteInit.cpp fix
2019-12-16 15:04:06 +01:00
Steinar Foss
c0410143c2 writeinit_fix. 2019-12-16 15:01:09 +01:00
Arne Morten Kvarving
c94dbd4fcd allow constructing TableSchema from tables
also add accessor and equality operator
2019-12-16 14:44:36 +01:00
Arne Morten Kvarving
5237dad89a allow constructing OrderedMap from tables
also make typedefs public, add accessors and equality operator
2019-12-16 14:44:36 +01:00
Arne Morten Kvarving
b357e211a5 add accessors to ColumnSchema
also add equality operator and a default constructor
2019-12-16 14:38:56 +01:00
Arne Morten Kvarving
b66bc61b51 added: allow constructing Rock2dtrTables from vectors
also add accessors
2019-12-16 14:34:40 +01:00
Arne Morten Kvarving
9877e237b1 added: allow constructing Rock2dTables from vectors
also add accessors
2019-12-16 14:31:53 +01:00
Arne Morten Kvarving
2ec73f479e added: allow construction (EDIT)NNC from a vector 2019-12-16 14:29:01 +01:00
Arne Morten Kvarving
cf29bd0933 allow construction ThresholdPressure from tables
add some convenience type aliases and const accessors to data

this is used to reconstruct the class in parallel simulations
2019-12-16 14:27:56 +01:00
Steinar Foss
77cc47d6f8 added keywords GCUTBACT, GECONT, MPFNNC. 2019-12-16 13:53:24 +01:00
Steinar Foss
0be84e6529 DeckKeyword: double_record style keywords has empty records as block seperators. 2019-12-16 13:11:20 +01:00
Joakim Hove
acd57b2d0a Merge pull request #1236 from joakim-hove/writeinit-fp
Writeinit fp
2019-12-16 13:08:54 +01:00
Joakim Hove
1f9378ca7a Merge pull request #1342 from joakim-hove/fieldprops-manager-active-size
Add active_size() method to FieldPropsManager
2019-12-16 12:12:10 +01:00
Joakim Hove
d2da9fd534 Fixed: wrong satfunc endpoints 2019-12-16 12:11:06 +01:00
Joakim Hove
6c46e50142 Add special case *SWL* subtraction to *SOGCR* keywords 2019-12-16 12:11:06 +01:00
Joakim Hove
6b71e30a38 Add test for SOGCR keyword 2019-12-16 12:11:06 +01:00
Joakim Hove
26644b1e9f Temporary: allow keyword reordering errors INIT file regression test 2019-12-16 12:11:06 +01:00
Joakim Hove
819f30eabc Rewrite writeInit to use FieldPropsManager 2019-12-16 12:11:06 +01:00
Joakim Hove
db47314fb4 Merge pull request #1317 from joakim-hove/enable-3d-props
Enable 3D props testing in opm-simulators and opm-grid
2019-12-16 12:10:48 +01:00
Joakim Hove
617bb07b0b Add active_size() method to FieldPropsManager 2019-12-16 09:42:40 +01:00
Atgeirr Flø Rasmussen
bff545696a Merge pull request #1325 from joakim-hove/grid-mem
Grid mem
2019-12-16 09:38:21 +01:00
Joakim Hove
1e221e478c Merge pull request #1341 from joakim-hove/fp-thermal
Add support for keywords THxxxx in FieldProps
2019-12-16 09:05:58 +01:00
Joakim Hove
2abbc474a4 Add support for keywords THxxxx in FieldProps 2019-12-16 08:23:44 +01:00
Joakim Hove
283ead605c Merge pull request #1339 from bska/track-ctf-origin
Add Means of Tracking Origin of Connection's CTF
2019-12-16 07:30:31 +01:00
Bård Skaflestad
50181c279d Add Means of Tracking Origin of Connection's CTF
This commit adds a new type (Connection::CTFKind), and new data
member of this type (Connection::m_ctfkin, initialised in the
constructor) that tracks the source of the connection's
transmissibility factor (Connection::m_CF).  The primary user of
this information is the restart file writing code which needs to
know if the connection transmissbility factor is assigned from the
input file (e.g., directly from the COMPDAT keyword) or if the value
is calculated from other information.

Add a convenience predicate function,

    Connection::ctfAssignedFromInput

that returns true if the connection transmissibility factor source
indeed is a direct assignment in the COMPDAT keyword.

Update Connection constructor callers accordingly.
2019-12-15 22:43:35 +01:00
Joakim Hove
040c310b48 Merge pull request #1340 from joakim-hove/fp-rtemp
Add RTEMPVD based initialization of the TEMPI keyword
2019-12-15 21:15:51 +01:00
Joakim Hove
a56e4daac7 Add RTEMPVD based initialization of the TEMPI keyword 2019-12-15 19:29:43 +01:00
Steinar Foss
87bbc46bbb can parse keywords of type double-record.
...

ParserKeyword: bool double_records set.

added keywords CECONT.

ParserKeywords: double_records set by keyword generator.

Parsertests: added test for parsing double_records.

ParserKeywords.parse: if double_records returns empty.

double_records keywords set to SLASH_TERMINATED.

...

ParserKeyword: for double records size_type = DOUBLE_SLASH_TERMINATED.

double_records: RawKeyword is Raw::DOUBLE_SLASH_TERMINATED.

RawKeyword uses m_isTempFinished.

Parser: can parse files with double-record keywords.

Parser.cpp/RawRecord.cpp: removed comments.

DeckKeyword has param m_isDoubleRecordKeyword.

test ParseDoubleRecords: double records to have linear structure.

DeckKeyword: Can create records of type double_record.

double-records parser test transferred to ParserTests.cpp.

...

...
2019-12-14 18:42:31 +01:00
Joakim Hove
a62d9df61f Merge pull request #1335 from akva2/remove_unused_member
remove unused member parser_keyword from DeckKeyword
2019-12-14 14:51:36 +01:00
Joakim Hove
8ab1d2b894 Enable 3D props testing in opm-simulators and opm-grid 2019-12-14 12:50:30 +01:00
Joakim Hove
c26f1655c8 Merge pull request #1330 from joakim-hove/udq-well
Udq well
2019-12-14 00:19:25 +01:00
Joakim Hove
af1b140723 Some improvements to runtime type conversion when evaluating UDQ 2019-12-13 23:17:07 +01:00
Joakim Hove
a595e68608 EclipseGrid: calculate cell dimensions and center on demand 2019-12-13 16:03:00 +01:00
Joakim Hove
643c775d4d EclipseGrid: calculate cell thickness on demand 2019-12-13 16:03:00 +01:00
Joakim Hove
f1d937205f EclipseGrid: calculate cell depth on demand 2019-12-13 16:03:00 +01:00
Joakim Hove
e3e11019dd EclipseGrid: calculate volume on demand 2019-12-13 16:03:00 +01:00
Joakim Hove
3541aa1601 EclipseGrid: Add getCellCorners( ) overload 2019-12-13 16:03:00 +01:00
Joakim Hove
60e6144f7f Remove unused member from EclipseGrid 2019-12-13 16:03:00 +01:00
Joakim Hove
fdd159cc75 Altered comment for group sets 2019-12-13 15:41:51 +01:00
Joakim Hove
56997e7d5c Replace compatibleTypes with static and runtime checks 2019-12-13 15:41:21 +01:00
Joakim Hove
b4fd949ca8 Change exception + test 2019-12-13 15:39:34 +01:00
Joakim Hove
11bf449281 Add method UDQSet::wgnames() 2019-12-13 15:33:42 +01:00
Joakim Hove
d520cfa8db Improved error message 2019-12-13 14:54:58 +01:00
Joakim Hove
964fba4ffb Merge pull request #1326 from stefoss23/add_alternating_keywords
Add alternating keywords
2019-12-13 09:40:26 +01:00
Joakim Hove
43b67e687f Merge pull request #1337 from bska/prune-duplicate-updateconnections
COMPDAT: Prune Duplicate 'updateConnctions' Call
2019-12-12 20:31:36 +01:00
Bård Skaflestad
063bc73a40 COMPDAT: Prune Duplicate 'updateConnctions' Call
Possibly introduced in an earlier rebase operation.
2019-12-12 18:33:31 +01:00
Arne Morten Kvarving
c68ab70eec remove unused member parser_keyword from DeckKeyword 2019-12-12 16:02:13 +01:00
Joakim Hove
7a648cae7f Merge pull request #1329 from akva2/fix_comparison
fixed: wrong things compared in equality operator
2019-12-12 12:28:39 +01:00
Joakim Hove
59e9b92486 Merge pull request #1332 from akva2/janitoring
fix initialization list order
2019-12-12 12:28:25 +01:00
Joakim Hove
9c54371c2c Merge pull request #1331 from akva2/remove_unused_member
remove unused member from UDQActive::InputRecord
2019-12-12 11:40:26 +01:00
Joakim Hove
f544fb2883 Merge pull request #1333 from joakim-hove/gconprod-rates
Add GuideRate properties to GroupProduction::operator==
2019-12-12 11:37:37 +01:00
Joakim Hove
9abbcfb6fa Add GuideRate properties to GroupProduction::operator== 2019-12-12 11:17:46 +01:00
Arne Morten Kvarving
715d368d94 fix initialization list order 2019-12-12 10:59:59 +01:00
Arne Morten Kvarving
b8f7f61851 remove unused member from UDQActive::InputRecord 2019-12-12 10:56:48 +01:00
Atgeirr Flø Rasmussen
c343651f44 Merge pull request #1257 from GitPaean/support_wsegvalv
Support wsegvalv
2019-12-11 21:07:11 +01:00
Joakim Hove
dbf276b2db Merge pull request #1328 from joakim-hove/fp-temp-test
Add some extra testing of FieldPropsManager::get_copy
2019-12-11 15:23:45 +01:00
Joakim Hove
537120049f Merge pull request #1327 from joakim-hove/test-fixup
Add missing #ifdef
2019-12-11 14:47:07 +01:00
Kai Bao
aff2baf9f2 adding test for WSEGVALV 2019-12-11 14:38:43 +01:00
Arne Morten Kvarving
d64edfbe09 fixed: wrong things compared in equality operator 2019-12-11 13:48:58 +01:00
Joakim Hove
05b93e7ea1 Add #ifdef for ENABLE_3D_TESTING 2019-12-11 13:20:04 +01:00
Joakim Hove
20c9b0b1e5 Add some extra testing of FieldPropsManager::get_copy 2019-12-11 13:02:27 +01:00
Kai Bao
6be5e104b0 addressing the reviewing comments from PR#1257 2019-12-11 13:00:34 +01:00
Kai Bao
46bcd7a499 adding a few segment summary keywords to SEGMENT_PROBE
to it can run the WSEGVALV case in opm-tests without modifying the deck.
2019-12-11 13:00:34 +01:00
Kai Bao
80159c4374 adding support for WSEGVALV 2019-12-11 13:00:34 +01:00
Joakim Hove
20cd54b939 Merge pull request #1324 from joakim-hove/fp-get-temp
Add FieldPropsManager::get_copy() which does not add to container
2019-12-11 12:24:29 +01:00
Joakim Hove
68fe71baf0 Merge pull request #1321 from joakim-hove/fi-memory
Add small struct to report memory usage from FieldPropsManager
2019-12-11 12:23:58 +01:00
Joakim Hove
dd26d9b83f Merge pull request #1323 from joakim-hove/allow-region-too-large
THPRES: Warning if region values exceed max(EQLNUM)
2019-12-11 12:23:20 +01:00
Joakim Hove
81cdfd46e3 Merge pull request #1318 from joakim-hove/fp-operate
Fp operate
2019-12-11 12:22:53 +01:00
Steinar Foss
e875d9b7d4 added keywords STOW, STWG. 2019-12-11 11:31:55 +01:00
Steinar Foss
2a90e9a154 added keywords PVTWSALT, PZVG. 2019-12-11 11:18:30 +01:00
Markus Blatt
44ffa6e871 Merge pull request #1319 from blattms/active-cells-utility
Use minimal information when filtering connections
2019-12-11 09:02:27 +01:00
Joakim Hove
6d7b621fb8 Add FieldPropsManager::get_copy() which does not add to container 2019-12-11 08:02:10 +01:00
Joakim Hove
be64447cee Add small struct to report memory usage from FieldPropsManager 2019-12-10 22:10:19 +01:00
Joakim Hove
68dd1e9de8 THPRES: Warning if region values exceed max(EQLNUM) 2019-12-10 21:56:28 +01:00
Bård Skaflestad
dc5b6e4465 Merge pull request #1272 from bska/restart-wsegsicd
Add Restart File Support for Spiral Inflow-Control Devices
2019-12-10 16:30:04 +01:00
Bård Skaflestad
5629098503 Output SICD Characteristics to Restart File
This commit identifies well segments that correspond to SICDs
(input keyword WSEGSICD) and captures those in the ISEG vector.
Furthermore, we output characteristic properties of such SICD
segments (e.g, the length, the base strength, calibration fluid
properties) in the RSEG vector.
2019-12-10 15:15:10 +01:00
Bård Skaflestad
953abdc496 Segment: Add Means of Identifying SICDs
This commit adds a simple predicate, Segment::isSpiralICD(), that
lets client code query whether or not a particular segment
represents a spiral ICD.  These are created through the WSEGSICD
input keyword.
2019-12-10 14:27:03 +01:00
Joakim Hove
2fb0cd599b PORV is treated more as a regular keyword 2019-12-10 14:06:14 +01:00
Joakim Hove
a9cfa083b6 Merge pull request #1320 from akva2/fix_accessor_type
Fix accessor type
2019-12-10 13:50:40 +01:00
Markus Blatt
a1471c80b5 Use ActiveGridCells when filtering connections. 2019-12-10 13:49:04 +01:00
Markus Blatt
36e1ef69ef Added utility for querying (only) active cells.
This will relieve us from building up a full EclipseGrid
just for filtering well connections.
2019-12-10 13:49:04 +01:00
Arne Morten Kvarving
3b66c03d31 fixed: this should be an int, not a double 2019-12-10 11:56:18 +01:00
Joakim Hove
0f609083c3 Add support for OPERATE in FieldProps 2019-12-10 11:43:05 +01:00
Joakim Hove
c9111d3785 Change testdata to be compliant with section requirements 2019-12-10 11:43:05 +01:00
Joakim Hove
9f09cbe14a Merge pull request #1315 from joakim-hove/fp-reset-actnum
Fp reset actnum
2019-12-09 07:26:21 +01:00
Joakim Hove
e96f49c5f9 Implement FieldProps::reset_actnum() instead of reset_grid() 2019-12-08 23:37:51 +01:00
Joakim Hove
377727c470 Merge pull request #1314 from joakim-hove/satfunc-depth-init
Satfunc initializers get cell_depth instead of grid argument
2019-12-08 23:33:51 +01:00
Joakim Hove
d57e67a06b Merge pull request #1316 from joakim-hove/warning
Quell warning
2019-12-08 23:33:30 +01:00
Joakim Hove
04aead1f27 Remove shadow warning in ParserKeyword::parseRecords( ) 2019-12-08 15:43:36 +01:00
Joakim Hove
8b881a2cb1 Use default: in switch statement 2019-12-08 15:40:47 +01:00
Joakim Hove
63bf6b26c7 Satfunc initializers get cell_depth instead of grid argument 2019-12-08 15:09:55 +01:00
Joakim Hove
bbee8606bf Merge pull request #1313 from joakim-hove/aquifetp-minor
Some whitespace cleanup and remove unused includes in Aquifetp
2019-12-08 14:42:24 +01:00
Joakim Hove
bbbe2c88ef Some whitespace cleanup and remove unused includes in Aquifetp 2019-12-08 14:05:07 +01:00
Joakim Hove
8c6755d0f8 Merge pull request #1308 from stefoss23/parserkeyword_alternating_records
introducing keywords using alternating records.
2019-12-08 13:39:58 +01:00
Steinar Foss
52d69ca167 alernating records: not limited to 2 records. 2019-12-08 05:03:07 +01:00
Joakim Hove
709373086d Merge pull request #1311 from joakim-hove/fp-tran
Add default init for TRAN keywords + dimension
2019-12-07 15:40:03 +01:00
Joakim Hove
fa939f585f Add default init for TRAN keywords + dimension 2019-12-07 15:07:22 +01:00
Joakim Hove
eb9856f9e2 Merge pull request #1310 from joakim-hove/fp-late-get-satfunc
Add autocreation of saturation functions from get<T>(keyword)
2019-12-07 15:01:37 +01:00
Joakim Hove
b7f8d72bbe Add autocreation of saturation functions from get<T>(keyword) 2019-12-07 13:37:58 +01:00
Steinar Foss
6ee678048e alternating_keyword may repeat over more than 2 records. 2019-12-07 13:31:17 +01:00
Bård Skaflestad
c9b277446a Merge pull request #1309 from akva2/janitoring
Janitoring
2019-12-07 01:25:08 +01:00
Arne Morten Kvarving
606c4146c1 remove unused functions 2019-12-06 22:24:27 +01:00
Arne Morten Kvarving
88516218e7 fix initializer list order 2019-12-06 22:24:25 +01:00
Bård Skaflestad
0cc6ab250c Merge pull request #1307 from bska/sicd-strength-unit
Add Dedicated Units of Measurement for SICD Strength Parameter
2019-12-06 17:01:13 +01:00
Steinar Foss
8f8d45532e introducing keywords using alternating records.
added function parseRecords.

introducing alternating keywords.

parserkw: added member isAlternatingKeyword.

kw alternating_records conditions.

...

added keyword STOG.

alternating keyword: created generatortest.

alternating keyword sets bool to true by codegenerator.

alternating_records_kw returns that.

...
2019-12-06 15:51:42 +01:00
Bård Skaflestad
bce49165ba WSEGSICD: Use New 'GeometricVolume' Parser Dimension
Slightly simplifies specifying the unit of measure for the strength
parameter.
2019-12-06 14:32:07 +01:00
Bård Skaflestad
3f2b143b30 Unit System: Add New ICD-Related Units
This commit introduces a couple of new units of measure for
ICD-related quantities, especially AICD and SICD strength
parameters.  Add base unit "GeomVolume" ([Length]**3) and 'measure'
entities

    geometric_volume      (= GeomVolume)
    geometric_volume_rate (= GeomVolume / Time)
    icd_strength          (= Pressure / (GeomVolume / Time)**2)

Add conversion factor unit tests for these, and also complete the
set of unit tests for FIELD, LAB, and PVT_M to cover measures that
were not already there.

Also add a parser Dimension ("GeometricVolume") to play the role of
[Length]**3 in .json files.
2019-12-06 14:32:07 +01:00
Bård Skaflestad
8fe4691639 addDimension(): Don't Risk Reading from Moved-From Object
We don't control which side of the assignment is evaluated first, so
get a copy of the name and use that for indexing purposes.
2019-12-06 14:32:07 +01:00
Joakim Hove
273c512c2a Merge pull request #1306 from joakim-hove/fp-global-porv
Add optional global flag to FieldPropsManager::porv()
2019-12-06 14:22:06 +01:00
Joakim Hove
f4882522cb Add optional global flag to FieldPropsManager::porv() 2019-12-06 08:47:08 +01:00
Joakim Hove
1534570b3d Merge pull request #1305 from joakim-hove/allow-init-reorder
Regression testing: Detect reordering of keywords in the INIT file
2019-12-05 17:12:20 +01:00
Joakim Hove
dda295f23f Merge pull request #1221 from joakim-hove/fp-fluid
Fp fluid
2019-12-05 16:37:23 +01:00
Joakim Hove
fc6f77e50a Merge pull request #1207 from stefoss23/parse_pyinput
Parse PYINPUT
2019-12-05 15:17:01 +01:00
Joakim Hove
d990932d0c Special case reordering of keywords in the INIT file regression test 2019-12-05 14:25:14 +01:00
Joakim Hove
26773359a4 compareECL: Set throwOnError to false together with analysis=true 2019-12-05 14:25:14 +01:00
Steinar Foss
04895d3728 Python.cpp using macro for conditional Python instance. 2019-12-05 13:02:57 +01:00
Atgeirr Flø Rasmussen
3645151309 Merge pull request #1251 from GitPaean/support_wsegsicd_rebase
Support WSEGSICD rebase
2019-12-05 12:43:32 +01:00
Kai Bao
254cee34bd addingress reviewing comments for PR#1251 2019-12-05 11:48:59 +01:00
Kai Bao
973fe9823b adapting and fix the code after rebasing for WSEGSICD 2019-12-05 11:48:59 +01:00
Kai Bao
fea4c4c8fa adding support for WSEGSICD 2019-12-05 11:48:59 +01:00
Joakim Hove
1c29829dae Merge pull request #1238 from joakim-hove/enable-3d-testing-jenkins
Enable 3D property testing in opm-material on jenkins
2019-12-05 10:53:16 +01:00
Joakim Hove
27da0024af Merge pull request #1288 from joakim-hove/flowing
Determine that wells are flowing from nonzero rates
2019-12-05 10:09:39 +01:00
Steinar Foss
d348f170f2 PYBIND11_EMBEDDED_MODULE replaced by OPM_EMBEDDED_MODULE.
python.cpp: PythonInterp created within contr. brackets.

PYBIND11_EMBEDDED_MODULE commented out.

opm_python: added file Embed.hpp.

introduced macro OPM_EMBEDDED_MODULE.

added opm_embedded_module.

using opm_embedded_module.

opm_embedded_module: commented out PyInstance check.

added namespace Opm::embed.

Embed.hpp -> EmbedModule.hpp.

Python.cpp: added exception if PyIsinstance.

parserstate: python is a unique_ptr.

Parser.cpp: exception if no Opm::python obj.
2019-12-05 09:19:43 +01:00
Steinar Foss
f3701c3f93 Parser: handles PYINPUT. Python code in eclipse .Data files now possible!!!
test EmbeddedPython: now with actual python code.

parser.cpp: parsing python code.

introduced RawConst::pyinput.

EmbeddedPython: tests with data keyword.
2019-12-05 09:19:43 +01:00
Steinar Foss
277ec850a7 PYINPUT: name -> PYINPUT. 2019-12-05 09:19:43 +01:00
Joakim Hove
ee2850e8cc Merge pull request #1304 from joakim-hove/satfunc-refactor
Reorganize satfunc initializers
2019-12-05 08:57:54 +01:00
Joakim Hove
4d3567bffd Initialize saturation functions in FieldProps 2019-12-05 08:49:47 +01:00
Joakim Hove
b3c14b1d12 Merge pull request #1250 from stefoss23/action_token_func
added enum class FuncType for ASTNode.
2019-12-05 08:18:08 +01:00
Joakim Hove
18f5e1a9b9 Reorganize satfunc initializers 2019-12-05 08:08:55 +01:00
Joakim Hove
04234ec625 Merge pull request #1301 from joakim-hove/deck-diff-default
Differentiate between valid and invalid default values while parsing
2019-12-05 08:04:22 +01:00
Bård Skaflestad
58eac1c338 Merge pull request #1277 from bska/load-aquifer-data
Load Restart: Support Basic Quantities from Analytic Aquifers
2019-12-04 22:55:18 +01:00
Joakim Hove
08dd12f644 Merge pull request #1300 from totto82/fixGconsumpSale
FIX avoid double conversion
2019-12-04 22:40:17 +01:00
Joakim Hove
1599cc5698 Differentiate between valid and invalid default values while parsing 2019-12-04 22:36:28 +01:00
Steinar Foss
3d37551ef9 checks for FuncType::time. 2019-12-04 21:10:11 +01:00
Bård Skaflestad
25931145e0 Aquifer Restart: Load Values Pertinent to Fetkovich Model
This commit expands the basic aquifer restart support to also
include essential values for the Fetkovich analtic model.  In
particular, we now also load the initial aquifer pressure and the
initial aquifer volume directly from the SAAQ restart vector, but
only if we know that the aquifer in question is of Fetkovich type.
2019-12-04 19:57:14 +01:00
Steinar Foss
4ae8b4a5fe Removes FuncType in ParserNode.
removed FuncType from ParserNode.
2019-12-04 18:13:44 +01:00
Bård Skaflestad
7b3de57e92 Load Restart: Support Basic Quantities from Analytic Aquifers
This adds a basic protocol for retrieving simple scalar data for
each analytic aquifer, specifically from XAAQ.  At the moment we
only support retrieving the aquifer pressure and the total produced
liquid volume from the aquifer and into the reservoir model.
2019-12-04 17:43:27 +01:00
Joakim Hove
3deef64d19 Use numerical flow rates to determine Well::flowing() 2019-12-04 17:15:30 +01:00
Joakim Hove
e0e371291d Merge pull request #1297 from joakim-hove/dont-write-ACTNUM
Make sure the ACTNUM field is not output to the INIT file
2019-12-04 17:06:42 +01:00
Steinar Foss
dc0ab8a8ad Action::Parser:get_func: returns multiple types. 2019-12-04 16:24:58 +01:00
Steinar Foss
4b5ef93293 added enum class FuncType for ASTNode.
ActionParserNode takes functype arg.

ActionParser getfunc.

ASTNode constr take func_type-arg.

ASTNode: throws exception if not FunctionType well.

FuncType: expanded list.

ActionParser: gettype distnguishes types.

ACTIONX.cpp: added test with group*.

parseKeywordCategory made public.

ActionParser: uses parseCategory.
2019-12-04 16:24:58 +01:00
Tor Harald Sandve
996f844ac7 FIX avoid double conversion 2019-12-04 12:02:28 +01:00
Joakim Hove
206e0b3b25 Merge pull request #1299 from joakim-hove/transmult-fp
Use std::vector<double> instead of GridProperty<double> in TransMult
2019-12-04 10:22:32 +01:00
Joakim Hove
7dc0e52e2d Merge pull request #1296 from joakim-hove/fp-keys-special
Special case ACTNUM and PORV in the FieldProps keys() method
2019-12-04 10:21:59 +01:00
Joakim Hove
34d4514164 Enable FieldProps for EclipseState::initTransMult() 2019-12-04 07:39:04 +01:00
Joakim Hove
bb314f13ae Use std::vector<double> instead of GridProperty<double> in TransMult 2019-12-03 20:24:11 +01:00
Joakim Hove
159412bba6 Make sure the ACTNUM field is not output to the INIT file 2019-12-03 17:34:15 +01:00
Joakim Hove
87ddebd192 Special case ACTNUM and PORV in the FieldProps keys() method 2019-12-03 17:21:28 +01:00
Joakim Hove
8783d8cf0a Merge pull request #1262 from joakim-hove/fp-porv
Fp porv
2019-12-03 09:49:18 +01:00
Joakim Hove
1090328ee3 Add methods porv() and actnum() to FieldPropsManager 2019-12-03 08:47:23 +01:00
Joakim Hove
019db953d9 Merge pull request #1294 from joakim-hove/remove-microseconds
Remove microseconds from TimeStampUTC add test
2019-12-03 00:55:57 +01:00
Joakim Hove
ba59707672 Remove microseconds from TimeStampUTC add test 2019-12-03 00:36:30 +01:00
Joakim Hove
527f7b39d0 Merge pull request #1293 from joakim-hove/timeservice-plus
Add operator+(double seconds) to TimeStampUTC
2019-12-02 23:18:03 +01:00
Joakim Hove
200f3a55bd Add operator+ to TimeStampUTC 2019-12-02 22:30:00 +01:00
Joakim Hove
5f699679a9 Merge pull request #1287 from joakim-hove/remove-grid
Remove grid member from FieldProps
2019-12-02 14:34:10 +01:00
Joakim Hove
da99852bfd Merge pull request #1292 from joakim-hove/add-PORO
Add PORO to testdata
2019-12-02 14:25:45 +01:00
Joakim Hove
30d6f51faf Merge pull request #1291 from joakim-hove/auto-shut-well
Make sure well is closed if all connections are closed for ACTIONX
2019-12-02 13:57:47 +01:00
Joakim Hove
19c5475715 Add PORO to testdata 2019-12-02 12:06:09 +01:00
Joakim Hove
2193118a5c Make sure well is closed if all connections are closed for ACTIONX 2019-12-02 11:53:16 +01:00
Joakim Hove
0a56331b28 Remove grid member from FieldProps 2019-12-02 11:47:28 +01:00
Joakim Hove
c65796a9a6 Merge pull request #1290 from joakim-hove/fieldprops-default
Add temporary default constructor for FieldPropsManager
2019-12-02 11:44:15 +01:00
Joakim Hove
0824a68783 Add temporary default constructor for FieldPropsManager 2019-12-02 10:46:45 +01:00
Joakim Hove
1bf3ee859f Merge pull request #1285 from joakim-hove/transmult-regions
Transmult regions
2019-12-02 07:24:56 +01:00
Joakim Hove
f5ca256eaf Internalize default region name in MULTREGTScanner 2019-12-02 06:30:58 +01:00
Joakim Hove
f066cea90a Enable FieldPropsManager for TRANSMULT regions 2019-12-02 06:30:58 +01:00
Joakim Hove
434f671391 Cache the region vectors in the MULTREGT scanner 2019-12-02 06:30:58 +01:00
Joakim Hove
9b9ba2c88c Merge pull request #1286 from joakim-hove/fp-default
Fp default
2019-12-02 06:30:42 +01:00
Joakim Hove
b8d3b8a16e Remove FieldPropsManager default constructor 2019-12-01 21:19:02 +01:00
Joakim Hove
296288bce4 Remove FieldProps->tables member 2019-12-01 18:01:01 +01:00
Joakim Hove
c9ac9eaec1 Merge pull request #1284 from joakim-hove/disable-fp
Disable use of FieldPropsManager in MULTREGTScanner
2019-12-01 11:34:40 +01:00
Joakim Hove
7a9409fc08 Disable use of FieldPropsManager in MULTREGTScanner 2019-12-01 09:43:07 +01:00
Joakim Hove
4893f534f7 Merge pull request #1282 from joakim-hove/add-PORO
Add poro
2019-11-30 09:43:10 +01:00
Joakim Hove
c403db8379 Merge pull request #1240 from joakim-hove/transmult-fp
Add FieldPropsManager argument to TransMult constructors
2019-11-30 08:46:43 +01:00
Joakim Hove
bb032c6182 Add PORO to testdata 2019-11-30 08:35:39 +01:00
Joakim Hove
9e3b8a94e8 Add missing "GRID" section in testdata 2019-11-30 08:35:34 +01:00
Joakim Hove
b04cd0b207 Merge pull request #1281 from joakim-hove/report-wellopen-status
Log message when a well status changes from WELOPEN
2019-11-29 19:17:12 +01:00
Joakim Hove
d53d8b4947 Enable testing of FieldPropsManager in transmult classes 2019-11-29 19:12:46 +01:00
Joakim Hove
0514b6bb52 Add FieldPropsManager argument to TransMult constructors 2019-11-29 18:16:20 +01:00
Joakim Hove
cb8cc2c5b2 Remove unused argument 2019-11-29 18:15:35 +01:00
Joakim Hove
61fd4e0c88 FieldProps::default_region() - public property 2019-11-29 18:15:35 +01:00
Joakim Hove
b5f3a94842 Merge pull request #1249 from joakim-hove/wellconnection-fp
Use FieldPropsManager in WellConnection
2019-11-29 18:14:18 +01:00
Joakim Hove
bdea9b4da7 Log message when a well status changes from WELOPEN 2019-11-29 18:11:45 +01:00
Joakim Hove
198b208258 Test use of FieldPropsManager in WellConnections 2019-11-29 16:42:29 +01:00
Joakim Hove
8211007714 Merge pull request #1278 from joakim-hove/add-PORO
Add poro
2019-11-29 12:46:34 +01:00
Joakim Hove
74704f4cc6 Merge pull request #1280 from joakim-hove/lwsltnum
add lwsltnum
2019-11-29 09:32:03 +01:00
Tor Harald Sandve
fddaa46e98 add lwsltnum 2019-11-29 08:42:08 +01:00
Joakim Hove
c3ab4829e0 Merge pull request #1275 from joakim-hove/enable-ROCKNUM
Enable ROCKNUM in FieldProps
2019-11-29 08:38:17 +01:00
Bård Skaflestad
27f1c5b998 Merge pull request #1279 from akva2/fix_xwel
fixed: serialize thp to OPM_XWEL
2019-11-28 23:39:19 +01:00
Arne Morten Kvarving
529a181617 fixed: serialize thp to OPM_XWEL 2019-11-28 23:22:14 +01:00
Joakim Hove
e9b6ac54d9 Add PORO keyword to testdata 2019-11-28 20:06:39 +01:00
Joakim Hove
e5b40870b6 Remove unused testdata 2019-11-28 20:06:39 +01:00
Arne Morten Kvarving
ef9bc3cf3f Merge pull request #1265 from akva2/comparison_operators_output_structures
added: comparison operators for various output structures
2019-11-28 15:19:23 +01:00
Joakim Hove
5cd4814de1 Enable ROCKNUM in FieldProps 2019-11-28 15:14:31 +01:00
Bård Skaflestad
8cd7481d14 Merge pull request #1255 from jalvestad/iseg_0_fix
correction to ISEG[0] in AggregateMSWData.cpp
2019-11-28 14:44:37 +01:00
Joakim Hove
13bdd5e5a0 Merge pull request #1273 from joakim-hove/DEST_PREFIX
Use DEST_PREFIX when installing python code
2019-11-28 13:41:49 +01:00
Arne Morten Kvarving
6600994104 added: comparison operators for various output structures 2019-11-28 13:30:48 +01:00
Joakim Hove
221d6e21f6 Merge pull request #1274 from joakim-hove/disable-rocknum
Disable 3D property testing of ROCKNUM
2019-11-28 11:32:44 +01:00
Joakim Hove
25631acbc9 Disable 3D property testing of ROCKNUM 2019-11-28 11:18:38 +01:00
Jostein Alvestad
4743584d37 removed unused vector tempOrdVect 2019-11-28 09:41:02 +01:00
Jostein Alvestad
1a4bef80b3 correction to ISEG[0] in AggregateMSWData.cpp 2019-11-28 09:41:00 +01:00
Tor Harald Sandve
d4c680ba68 Merge pull request #1258 from totto82/add_sales_PR
Convert UDA in GCONSALE and GCONSUMP
2019-11-28 09:04:28 +01:00
Tor Harald Sandve
7b41397f6f Merge pull request #1252 from totto82/gprodEvent
add group events
2019-11-28 08:23:18 +01:00
Joakim Hove
885093d472 Use DEST_PREFIX when installing python code 2019-11-27 23:46:32 +01:00
Bård Skaflestad
78e8acf21f Merge pull request #1269 from bska/prepare-valve_icd-restart
Prepare Restart File Support for Valves and ICDs
2019-11-27 23:37:31 +01:00
Bård Skaflestad
c333b21c90 Prepare Restart File Support for Valves and ICDs
This commit identifies certain items in restart vectors ISEG and
RSEG that pertain to valves (keyword WSEGVALV) and spiral ICDs
(keyword WSEGSICD).  In particular, we identify segment type flag
and a couple of relevant values for this flag.  Also, relevant
parameters that describe the geometry and pressure drops of these
devices.
2019-11-27 22:12:43 +01:00
Joakim Hove
ba65222caf Merge pull request #1268 from joakim-hove/plyrock-fixup
Fix internal name in PLYROCKM json file
2019-11-27 18:38:12 +01:00
Joakim Hove
11c6d43e22 Merge pull request #1267 from joakim-hove/region-cache-fixup
Bugfix: use correct 3D property container
2019-11-27 17:14:04 +01:00
Joakim Hove
70066df8ee Merge pull request #1266 from akva2/serialize_whole_connection
added: serialize the whole connection struct to OPM_XWEL
2019-11-27 17:13:19 +01:00
Joakim Hove
6019ad9d42 Fix internal name in PLYROCKM json file 2019-11-27 16:51:29 +01:00
Joakim Hove
ce3b1554db Temporarily added plain FIPNUM as region keyword 2019-11-27 16:31:10 +01:00
Joakim Hove
8fdbde5a48 Bugfix: use correct 3D property container 2019-11-27 16:19:16 +01:00
Joakim Hove
a9ebca90fd Merge pull request #1264 from atgeirr/speedup-eclfile-construction
Use seekg() rather than ignore() to skip ahead.
2019-11-27 15:00:40 +01:00
Arne Morten Kvarving
a34bc76b46 added: serialize the whole connection struct to OPM_XWEL 2019-11-27 14:13:31 +01:00
Joakim Hove
854b79c280 Merge pull request #1233 from joakim-hove/thpres-refactor
Thpres refactor
2019-11-27 10:46:18 +01:00
Atgeirr Flø Rasmussen
e4e3b3bde8 Use seekg() rather than ignore() to skip ahead. 2019-11-27 10:17:30 +01:00
Joakim Hove
ca95ff1b86 Merge pull request #1235 from joakim-hove/fp-keys
Add FieldPropsManager::keys<T>() method for iteration
2019-11-27 10:06:23 +01:00
Joakim Hove
0380b9911e Merge pull request #1261 from joakim-hove/udqtest-data-fixup
Update test fixture to use correct grid
2019-11-27 10:02:58 +01:00
Joakim Hove
94a58e87bf Merge pull request #1234 from joakim-hove/region-cache-fp
Region cache fp
2019-11-27 09:50:29 +01:00
Joakim Hove
29b5f1e8b6 Use FieldPropsManager for THPRES initialization 2019-11-27 09:48:13 +01:00
Tor Harald Sandve
5d28ff7d24 store well and group event in same map 2019-11-27 08:58:57 +01:00
Joakim Hove
b2d9e92e25 Update test fixture to use correct grid 2019-11-26 21:34:04 +01:00
Joakim Hove
866aa5c5ca Add alternative FieldPropsManager argument to THPRES constructor 2019-11-26 20:49:15 +01:00
Joakim Hove
8e76b1346a Moved some variables closer to use-site 2019-11-26 20:49:15 +01:00
Arne Morten Kvarving
c2de0e09a3 Merge pull request #1259 from akva2/rename_accessor
changed: rename accessor to data()
2019-11-26 14:28:33 +01:00
Arne Morten Kvarving
0d6ed7cfb6 changed: rename accessor to data()
the two classes EDITNNC and NNC are very similar, which makes templating
useful. this small difference makes it hard to do. unify them.
2019-11-26 13:20:17 +01:00
Joakim Hove
d3cc7303b4 Merge pull request #1256 from akva2/fix_forwards
fixed: forward declared the intended classes
2019-11-26 13:03:37 +01:00
Tor Harald Sandve
e1029e956b convert from UDA to double for GCONSALE and GCONSUMP 2019-11-26 11:14:12 +01:00
Tor Harald Sandve
225d6ea26d Make GCONSALE an injector 2019-11-26 11:14:12 +01:00
Arne Morten Kvarving
e1e9fb7110 fixed: forward declared the intended classes 2019-11-26 10:40:03 +01:00
Tor Harald Sandve
b109331163 add group events 2019-11-25 09:55:32 +01:00
Bård Skaflestad
be27bb6154 Merge pull request #1248 from berland/wpotcalc
Change section for WPOTCALC keyword to RUNSPEC
2019-11-21 16:03:33 +01:00
Joakim Hove
91c40e60c6 Add FieldPropsManager::keys<T>() method for iteration 2019-11-21 10:21:01 +01:00
Joakim Hove
b3d28e10cc Merge pull request #1246 from joakim-hove/fp-default-region
FieldProps::default_region() - public property
2019-11-21 10:19:16 +01:00
Håvard Berland
9cefcaf49b Change section for WPOTCALC keyword to RUNSPEC 2019-11-21 09:59:50 +01:00
Arne Morten Kvarving
049ddf74f4 Merge pull request #1247 from akva2/fix_rh_regression
fixed: a regression snuck in while enabling redhat 8
2019-11-21 09:55:19 +01:00
Arne Morten Kvarving
9bb8a35f8f fixed: a regression snuck in while enabling redhat 8
for some reason, rh7 does not link cmake3 to cmake,
while rh6 and rh8 does. cmake3 works everywhere
2019-11-21 09:01:39 +01:00
Joakim Hove
be895ce0b1 FieldProps::default_region() - public property 2019-11-21 08:43:48 +01:00
Joakim Hove
3672a29b0a Merge pull request #1237 from joakim-hove/fp-defaulted
Fp defaulted
2019-11-21 08:39:04 +01:00
Joakim Hove
5d588fd56e Merge pull request #1242 from akva2/add_rh8_packaging
added: support rhel8
2019-11-20 19:33:19 +01:00
Joakim Hove
eb1c9a71c7 Merge pull request #1241 from stefoss23/reorganize_krangle
added some 'special' keywords. Reorganized list of 'special' keywords.
2019-11-20 19:12:29 +01:00
Arne Morten Kvarving
3f6097bf16 added: support rhel8 2019-11-20 15:50:01 +01:00
Steinar Foss
bebcdbc43c added some 'special' keywords. Reorganized list of 'special' keywords.
added kw GCONPRI.

added kw GIALL.

added kw MASSFLOW.

added keywords MESSAGE.

RPTRST: deckname OUTSOL.

added keyword PARAOPTS.

FOAMDCN: changed structure ofg keyword.

added keywords PVG32D, PCW32D.

keyword_list.cmake: reaorginzed list of 'special' keywords.
2019-11-20 15:19:22 +01:00
Kai Bao
967d58ca7c removing whitespaces from test_ERst.cpp 2019-11-20 14:16:16 +01:00
Joakim Hove
a15a724e76 Enable 3D property testing in opm-material on jenkins 2019-11-20 14:13:50 +01:00
Joakim Hove
f0547009fd Merge pull request #1232 from joakim-hove/get-fp
Add EclipseState::fieldProps() method
2019-11-20 11:43:59 +01:00
Joakim Hove
f4cd0c4052 Merge pull request #1231 from joakim-hove/fp-value-status
Fp value status
2019-11-20 11:43:02 +01:00
Joakim Hove
42757a02fd Add FieldPropsManager::defaulted() property 2019-11-20 11:29:47 +01:00
Joakim Hove
11ca1194b0 Use enum value::status to keep track of value status in FieldProps 2019-11-20 10:40:51 +01:00
Joakim Hove
517dbfddc5 Use FieldProps to get FIPNUM for region cache 2019-11-20 08:38:26 +01:00
Joakim Hove
8bd9aeaf9d Change RegionCache constructor to accept std::vector<int> fipnum 2019-11-20 08:36:03 +01:00
Joakim Hove
52fabf37c7 Merge pull request #1230 from joakim-hove/deckitem-size-rename
Remove / rename DeckItem::size()
2019-11-19 20:39:33 +01:00
Joakim Hove
d8bb92b7b2 Add EclipseState::fieldProps() method 2019-11-18 10:14:59 +01:00
Joakim Hove
6cc3b578f5 Use value::status to keep track of data status in DeckItem
With this commit the DeckItem::push_backDummyDefault() function will push back a
default value T( ). This will give a change in behaviour in downstream code
which has used getData<T> to get DeckItem data unchecked.
2019-11-17 17:23:42 +01:00
Joakim Hove
3156448f99 Add enum value::status to handle the set/unset status of items 2019-11-17 11:18:05 +01:00
Joakim Hove
6dbbc8c037 Remove / rename DeckItem::size() 2019-11-16 18:31:12 +01:00
Joakim Hove
da625838b6 Merge pull request #1229 from joakim-hove/minor
Minor step in default rewrite ...
2019-11-16 12:15:04 +01:00
Joakim Hove
e15dcb216d Improved error message 2019-11-16 10:38:16 +01:00
Joakim Hove
3982e6a8c9 Renamed variables 2019-11-16 00:44:20 +01:00
Joakim Hove
4514955778 Merge pull request #1227 from stefoss23/ACTIONXtests_reinstate_tests
testfile ACTIONC.cpp: removed 'if 0'.
2019-11-16 00:39:47 +01:00
Steinar Foss
239d562581 testfile ACTIONC.cpp: removed 'if 0'.
test ACTIONX, uncommented TestActions.

ACTIONX tests: uncommented all.
2019-11-15 15:24:16 +01:00
Joakim Hove
c309c6a7e6 Merge pull request #1226 from blattms/fix-type-more-info-compareECL
Fixed typos and included more info into compareECL's exceptions
2019-11-15 11:41:11 +01:00
Markus Blatt
6761f3dc57 Fixed typos and included more info into compareECL's exceptions 2019-11-15 10:20:33 +01:00
Joakim Hove
6388fbe584 Merge pull request #1224 from joakim-hove/satfunc-init-refactor
Satfunc lookup: prepare for only active cells
2019-11-15 09:59:48 +01:00
Joakim Hove
d99d1dfcc3 Merge pull request #1220 from joakim-hove/COPYREG
More 3D Property changes
2019-11-15 09:59:33 +01:00
Joakim Hove
05e006e7a9 Changed SatfuncPropertyInitializers to use references internally 2019-11-15 08:03:03 +01:00
Joakim Hove
63f4b5494d Prepare saturation function lookup to only consider active cells 2019-11-15 08:03:03 +01:00
Joakim Hove
c8e2925134 Split saturation functions satnumApply and imbnumApply 2019-11-15 08:03:03 +01:00
Joakim Hove
7b2048ec22 Add assign(const std::vector<T>&) to FieldProps::FieldData 2019-11-15 07:55:29 +01:00
Joakim Hove
ffc67f05cf Reorganise in FieldProps 2019-11-15 07:55:29 +01:00
Joakim Hove
5d852bf3f1 Merge pull request #1223 from joakim-hove/fp-tables
Add TableManager argument to FieldProps constructor
2019-11-15 07:54:33 +01:00
Joakim Hove
36c1798a38 Merge pull request #1222 from joakim-hove/grid-properties-testdata
Update testdata to one element for each cell
2019-11-15 07:54:15 +01:00
Atgeirr Flø Rasmussen
0ea0f07b20 Merge pull request #1225 from atgeirr/fix-abs
Fix abs() ambiguity, add copyright headers.
2019-11-14 23:11:01 +01:00
Atgeirr Flø Rasmussen
87a0e0e402 Fix abs() ambiguity, add copyright headers. 2019-11-14 13:09:35 +01:00
Joakim Hove
feec9c150d Merge pull request #1219 from joakim-hove/box-keyword-constructor
Simplify the BOX implementation - prepare to drop the manager
2019-11-14 12:15:53 +01:00
Atgeirr Flø Rasmussen
6d83672f94 Merge pull request #1217 from joakim-hove/rename-well2
Rename Well2 -> Well and  Group2 -> Group
2019-11-14 10:33:45 +01:00
Joakim Hove
7fbbb6d71a Add TableManager argument to FieldProps constructor 2019-11-14 07:14:54 +01:00
Joakim Hove
60d3a074b9 Update testdata to one element for each cell 2019-11-13 23:57:59 +01:00
Joakim Hove
613ec70dab Rename Well2 -> Well and Group2 -> Group 2019-11-13 23:19:26 +01:00
Joakim Hove
3f1cf0bc8a Changed box implementation 2019-11-13 20:19:47 +01:00
Bård Skaflestad
8cd72f1ff0 Merge pull request #1209 from atgeirr/fix-timemap-restartintervals
Fix TimeMap::isTimestepInFirstOfMonthsYearsSequence() method.
2019-11-13 15:00:45 +01:00
Arne Morten Kvarving
dd8c328ca7 Merge pull request #1150 from tskille/summary
new program summary
2019-11-12 14:50:37 +01:00
Torbjørn Skille
59e0c39558 New program summary based on OPM I/O classes 2019-11-12 13:27:26 +01:00
Joakim Hove
eda68f74ae Merge pull request #1191 from joakim-hove/field-properties-regions
Field properties regions
2019-11-12 08:37:19 +01:00
Joakim Hove
6afc118c94 Started on region operations in FieldProps implementation 2019-11-12 08:18:13 +01:00
Joakim Hove
3421b25d8e Merge pull request #1211 from joakim-hove/monkey-patch-rename
Minor refactor to monkey-patching
2019-11-11 16:38:43 +01:00
Joakim Hove
d0685c1e6c Merge pull request #1212 from joakim-hove/item-rename
Item rename
2019-11-11 16:38:26 +01:00
Joakim Hove
7356c76c58 Merge pull request #1204 from joakim-hove/summarynode-location
Add Location member to SummaryNode instances
2019-11-11 16:37:43 +01:00
Joakim Hove
f17eefcaf7 Add Location member to SummaryNode instances 2019-11-11 15:31:36 +01:00
Joakim Hove
0988f26ad9 Merge pull request #1213 from goncalvesmachadoc/patch-1
Add summary keywords FCPR, FCPT and CCPT
2019-11-11 13:26:44 +01:00
Cintia Goncalves Machado
7a274b2717 Add summary keywords FCPR, FCPT and CCPT 2019-11-11 09:26:36 +01:00
Joakim Hove
af4a2d78f9 Update test data to use correct region 2019-11-11 07:48:47 +01:00
Joakim Hove
24469f7a5e Renamed item in COPYEREG keyword 2019-11-11 07:35:25 +01:00
Joakim Hove
efac465ebd Minor refactor to monkey-patching 2019-11-10 21:09:35 +01:00
Atgeirr Flø Rasmussen
4fc71e352e Merge pull request #1205 from totto82/defaultNUPCOL
Change default NUPCOL to 12
2019-11-08 17:38:20 +01:00
Atgeirr Flø Rasmussen
b787a1a259 Fix TimeMap::isTimestepInFirstOfMonthsYearsSequence() method. 2019-11-08 17:26:02 +01:00
Tor Harald Sandve
0771e555a7 Change default NUPCOL to 12 2019-11-08 10:44:32 +01:00
Joakim Hove
1d95cd8248 Merge pull request #1200 from goncalvesmachadoc/goncalvesmachadoc-addProdInjReportPRT
Add WVIR
2019-11-07 16:22:06 +01:00
Joakim Hove
6a01e4af35 Merge pull request #1201 from stefoss23/gconsump
Schedule handles keyword GCONSUMP.
2019-11-07 12:07:31 +01:00
Joakim Hove
632708acd2 Merge pull request #1203 from GitPaean/fixing_aqufetp_unit
correcting the unit in the AQUFETP definition
2019-11-07 10:20:39 +01:00
Steinar Foss
a1c5aaa4d4 GConSump/sale: add does not rewrite groups. 2019-11-07 10:00:54 +01:00
Steinar Foss
d86ea3cb30 GConSump/Sale: using default constructor. 2019-11-07 09:42:41 +01:00
Kai Bao
cda9ba9363 correcting the unit in the AQUFETP definition 2019-11-06 22:05:35 +01:00
Joakim Hove
a3090fd88f Merge pull request #1181 from joakim-hove/tskille_pybind_eclio
Tskille pybind eclio
2019-11-06 16:39:30 +01:00
Steinar Foss
f75c3921e5 Schedule handles keyword GCONSUMP.
GConSump: added and linked soruce files.

gconsump added to dynamicstate.

added handleGCONSUMP.

GConSump: add.

GConSump: has.

GConSump: get.

GConSump: added UDA values.

GConSump: added network_node.
2019-11-06 15:12:25 +01:00
Cintia Goncalves Machado
db34bcaa21 Add WVIR
Add well voidage injection rate.
2019-11-06 14:58:35 +01:00
Joakim Hove
d66852d8de Rewrite EclFile wrapping
- Include the eclipse_io.cpp file in existing extension library - do not create
   a new library.

 - Remove Python class EclFile - just expose the C++ through Pybind1, include
   some monkey-patching of the class to ensure proper Python strings for CHAR
   keywords.

 - Remove string based keyword lookup.

 - Use standard Python methods __len__, __getitem__ and __contains__; get() is
   an equivalent alternative to __getitem__().

 - Add property arrays in addition to getListOfArrays()
2019-11-06 09:59:07 +01:00
Joakim Hove
629606c5d8 Use test utility to get test filenames 2019-11-06 09:59:07 +01:00
Joakim Hove
179be0d519 Add converter to convert CHAR arrays 2019-11-06 09:59:07 +01:00
Joakim Hove
438a71de1c Remove unused includes 2019-11-06 09:59:07 +01:00
Torbjørn Skille
7cacc734e8 python binding for EclFile 2019-11-06 09:59:07 +01:00
Joakim Hove
0b8a42fd1f Fix cmake find pythonlibs 2019-11-06 09:59:07 +01:00
Joakim Hove
3bf3c34899 Merge pull request #1194 from tskille/convertECL
updates of ERst API, supports multiple occurrence of array names
2019-11-06 09:06:00 +01:00
Joakim Hove
af34571d5f Merge pull request #1198 from akva2/janitoring
fixed: wrong init list order
2019-11-06 07:10:54 +01:00
Torbjørn Skille
c6f8a41c43 updates of ERst api, supports multiple occurrences of array names 2019-11-05 15:01:17 +01:00
Arne Morten Kvarving
dd8f0b2164 Merge pull request #1199 from akva2/bump_version
bump version to 2020.04-pre
2019-11-05 14:26:51 +01:00
Atgeirr Flø Rasmussen
d6cd0ff871 Merge pull request #1197 from atgeirr/add-regula-falsi-bisection
Add combined regula falsi + bisection method, and test.
2019-11-05 13:00:36 +01:00
Arne Morten Kvarving
a8e9ed2deb bump version to 2020.04-pre 2019-11-05 10:50:03 +01:00
Arne Morten Kvarving
845613c03a fixed: wrong init list order 2019-11-05 10:46:17 +01:00
Atgeirr Flø Rasmussen
2951df2bfb Add combined regula falsi + bisection method, and test. 2019-11-05 10:33:02 +01:00
Joakim Hove
810fc19ea3 Merge pull request #1196 from joakim-hove/actionresult-copy
Add copy constructor + contains() method to Action::Result
2019-11-04 16:07:55 +01:00
Joakim Hove
9e898055a8 Merge pull request #1185 from joakim-hove/field-properties-downstream
Field properties downstream
2019-11-04 16:04:21 +01:00
Joakim Hove
8c6768cc89 Merge pull request #1193 from stefoss23/gconsale
Adding keyword GCONSALE to Schedule.
2019-11-04 15:02:19 +01:00
Joakim Hove
450bb96c9b Add scalar auto create for SATNUM 2019-11-04 14:51:58 +01:00
Joakim Hove
02d4e98f1f Add WellConnections() overload which uses FieldPropsManager 2019-11-04 14:51:58 +01:00
Joakim Hove
56d32f7fa0 Use vectors with nactive elements in WellConnections 2019-11-04 14:51:58 +01:00
Joakim Hove
77ef195b46 Early exit in wellconnection code 2019-11-04 14:51:58 +01:00
Steinar Foss
17d11e9a60 GConSaleGroup: MaxProcedure static, simplified get and add. 2019-11-04 13:59:54 +01:00
Joakim Hove
015559b5cf Merge pull request #1187 from joakim-hove/field-props-has
Add has<T>() method to FieldPropsManager
2019-11-04 13:17:06 +01:00
Joakim Hove
0d2f57354a Merge pull request #1184 from joakim-hove/python-dep
Add Python library to opm-common_LIBRARIES cmake variable
2019-11-04 13:16:32 +01:00
Joakim Hove
cfcfc08520 Merge pull request #1192 from joakim-hove/box-constructor
Add constructor to Box::cell_index
2019-11-04 13:16:06 +01:00
Joakim Hove
b5b54cf162 Merge pull request #1190 from joakim-hove/eclfile-preload
Add optional argument preload=false to EclFile constructor
2019-11-04 13:15:30 +01:00
Joakim Hove
1750767a1f Merge pull request #1180 from joakim-hove/eclfile-size
Add size() method to EclFile
2019-11-04 13:15:16 +01:00
Joakim Hove
f33c4f749e Add copy constructor + contains() method to Action::Result 2019-11-04 12:54:14 +01:00
Steinar Foss
ec07dca68b Added GConSale.hpp to CMakeLists_files.cmake. 2019-11-04 09:31:45 +01:00
Steinar Foss
d2dce88411 Adding keyword GCONSALE to Schedule.
added files GConSale cpp/hpp.

Schedule: adde GConSale as DynamicState.

Shcedule: added function gConSale.

added function handleGCONSALE.

GConsale: added substruct GCONSALEGroup.

GConSale: empty records added.

GConSale: all values set to zero.

GCONSALE: values stored as UDA.

GConSale: UDAValues to SI.

GConSale: max_proc parsed.
2019-11-03 11:37:28 +01:00
Joakim Hove
8b2cab3244 Add constructor to Box::cell_index 2019-11-02 14:45:58 +01:00
Joakim Hove
53619980c5 Merge pull request #1188 from joakim-hove/P
Keywords on P
2019-11-02 09:10:13 +01:00
Joakim Hove
74aa7bbd48 Add optional argument preload=false to EclFile constructor 2019-11-01 17:01:07 +01:00
Joakim Hove
bb4426ff6b Keywords on P 2019-11-01 15:14:33 +01:00
Joakim Hove
d3aec121f1 Merge pull request #1189 from totto82/supportSepGroup
Add support for item 11 and 12 in GCONINJE
2019-11-01 13:41:21 +01:00
Tor Harald Sandve
64f4919085 Add support for item 11 and 12 in GCONINJE 2019-11-01 13:15:52 +01:00
Joakim Hove
8268c877fd Add has<T>() method to FieldPropsManager 2019-11-01 08:13:42 +01:00
Joakim Hove
e296140f75 Merge pull request #1186 from stefoss23/add_keywords_P
added keywords beginning w/ P.
2019-10-31 16:48:52 +01:00
Steinar Foss
59fddbf998 added keywords beginning w/ P.
added keywords PINCHXY, PLYATEMP, PLYCAMAX.
2019-10-31 13:05:49 +01:00
Joakim Hove
0fb55b23c0 Merge pull request #1056 from joakim-hove/field-properties
Add FieldProps skeleton
2019-10-31 11:36:29 +01:00
Joakim Hove
64095f0885 Create default FieldPropsManager - for the testing phase 2019-10-31 11:18:55 +01:00
Joakim Hove
a7187abc17 Initial implementation of 3D properties 2019-10-31 11:18:55 +01:00
Joakim Hove
18eb7a2de3 Check if have grid before fault initialization 2019-10-31 11:18:54 +01:00
Joakim Hove
176e7f75ed Add Python library to opm-common_LIBRARIES cmake variable 2019-10-31 07:07:07 +01:00
Joakim Hove
abe2013624 Merge pull request #1182 from stefoss23/add_keyword_N1
Added keywords beginning with N, O, P.
2019-10-30 23:34:40 +01:00
Markus Blatt
bea4a81a3c Merge pull request #1176 from blattms/changelog-2019.10
Added entries to changelog concerning 2019.10 release
2019-10-30 21:51:53 +01:00
Steinar Foss
78a37d2a33 added keywords beginning with N, O, P.
added keywords NODPPM, NOHMD, NOHMO.

added keywords NOHYST, NOWARNEP, NRSOUT.

added keywords NWATREM, NXFIN, NYFIN, NZFIN.

added keywords OFM, OILAPI, OLDTRAN, OLDTRANR.

added keywords PARTTRAC, PBUB, PCW.

added keywords PDEW, PEBI, PECOEFS.

removed keyword NEWTON.

added keywords PEDIMS, PEGTABX.

added keywords PEKTABX, PENUM, PERMAVE.

added keywords PETGRID, PICOND.
2019-10-30 15:37:14 +01:00
Joakim Hove
290368985a Add size() method to EclFile 2019-10-30 09:31:10 +01:00
Joakim Hove
292d00417c Merge pull request #1166 from joakim-hove/parsetest-model2-decks
Add parse testing of model2 decks
2019-10-30 07:40:20 +01:00
Joakim Hove
92188eea8a Merge pull request #1167 from stefoss23/add_keyword
Add keyword, python deck
2019-10-29 16:54:22 +01:00
Joakim Hove
8a36be210b Add bullet point about Eclipse restart capabilities 2019-10-29 16:32:08 +01:00
Markus Blatt
28b2b437c8 Skipped python and restart in changelog 2019-10-29 16:24:55 +01:00
Arne Morten Kvarving
f494df4f3d Merge pull request #1178 from akva2/fix_rebuild_on_install
fixed: let's not copy the files twice
2019-10-29 15:17:28 +01:00
Arne Morten Kvarving
95a129cbed fixed: let's not copy the files twice 2019-10-29 14:59:08 +01:00
Joakim Hove
d465409acf Merge pull request #1177 from joakim-hove/install-copy-on-change
Only copy python files when they have changed
2019-10-29 13:57:54 +01:00
Joakim Hove
7e3c34c682 Only copy python files when they have changed 2019-10-29 12:34:46 +01:00
Markus Blatt
21673903dd Added entries to changelog concerning 2019.10 release 2019-10-29 10:40:04 +01:00
Joakim Hove
fd3b6f8999 Merge pull request #1174 from bska/record-restart-output
Record Output of Restart File Data
2019-10-29 08:21:34 +01:00
Joakim Hove
6894aaf03b Merge pull request #1173 from joakim-hove/python3
Python3
2019-10-29 08:07:22 +01:00
Bård Skaflestad
023333936c Record Output of Restart Files in .PRT File (and to screen)
This commit adds a simple one-line record to the screen and,
typically, the .PRT file, each time a set of restart values are
output to the (or a) restart file.  Format of the output is along
the lines of

  Restart file written for report step: 169/247.  Date: 2003/09/13
2019-10-28 23:32:33 -05:00
Bård Skaflestad
d19f9d6899 INTEHEAD: Promote Day, Month, Year to Public Indices
This commit makes the (Day, Month, Year) indices of the restart
file's INTEHEAD vector to the publicly available VectorItems.  This,
in turn, makes the entries more readily accessible outside of
InteHEAD.cpp.
2019-10-28 23:27:39 -05:00
Joakim Hove
9d1b7a83d9 Changes in Python build:
- Use python/install.py to copy from source tree to build tree
- List Cxx source files in CMakeLists_files.cmake
2019-10-28 21:42:57 +01:00
Joakim Hove
99e32edd78 Use try: except: to import test utility code 2019-10-28 20:30:39 +01:00
Joakim Hove
d382c57145 Add small python script to determine extension suffix 2019-10-28 20:30:39 +01:00
Markus Blatt
e9367d5116 Merge pull request #1171 from akva2/update_rh_packaging
update redhat packaging
2019-10-28 11:58:37 +01:00
Arne Morten Kvarving
e15d8eea4a update redhat packaging 2019-10-28 11:36:57 +01:00
Joakim Hove
4e8a0eac9f Merge pull request #1170 from bska/resolve-asan-issues
Resolve Address Sanitizer Issues
2019-10-27 23:25:30 +01:00
Joakim Hove
baf4f7fbac Merge pull request #1168 from stefoss23/add_keywords_N
added keywords beginning w/ N.
2019-10-27 16:12:50 +01:00
Bård Skaflestad
3ad7771306 EclipseState Unit Test: Don't Leak Memory
The construction

    Parser parser(new Parser{})

effectively ends up calling the constructor

    Parser::Parser(bool)

which, besides leaking memory, is typically not what we want.
2019-10-26 18:22:52 -05:00
Bård Skaflestad
2558320aa3 UDQ Unit Test: Don't Create Dangling References
This fixes an issue identified by Address Sanitizer.
2019-10-26 18:18:38 -05:00
Bård Skaflestad
3b9ea5dcd8 Consume Owning Raw Pointers in Smart Pointers
This fixes several memory leaks identified by Address Sanitizer.
2019-10-26 18:17:19 -05:00
Bård Skaflestad
50460ec8de Don't Leak Memory in case of Exceptions
Wrap the internal 'WellConnections' pointer of function

    newConnectionsWithSegments

in a unique_ptr that will release the memory if an exception is
thrown--e.g., from the error guard.

This function should arguably return a unique_ptr rather than a raw
pointer.
2019-10-26 18:02:39 -05:00
Bård Skaflestad
0e39b03f3f Don't Use ACTNUM Unless Correctly Sized
We must explicitly check that the deck supplies a correctly sized
ACTNUM vector before using its .data() pointer.  Otherwise, we risk
indexing out of bounds.

This fixes an ASan error in a unit test

While here, also remove stray semicolons on function closing braces.
2019-10-26 17:59:44 -05:00
Steinar Foss
cc11890e31 added keywords beginning w/ N.
added keywords NETWORK, NEWTON.

added keywords NEXT, NEXTSTPL, NINENUM.
2019-10-26 12:32:57 +02:00
Steinar Foss
0e1e9b7ac7 test EmbeddedPython: added test for add keyword to deck. 2019-10-25 17:15:56 +02:00
Joakim Hove
d217bdf458 Add parse testing of model2 decks 2019-10-25 14:43:19 +02:00
Steinar Foss
576ddd4987 python deck: added member add(keyword). 2019-10-25 14:11:52 +02:00
Joakim Hove
390a29d425 Merge pull request #1164 from stefoss23/deckkeyword_vector_unit
DeckKeyword w/ vectors: takes numpy vectors.
2019-10-25 12:07:34 +02:00
Joakim Hove
0fb92e9121 Merge pull request #1157 from joakim-hove/udq-token-types
Udq token types
2019-10-25 11:58:08 +02:00
Steinar Foss
02cc292f38 python numpy array conversion function in namespace conv ert. 2019-10-25 11:06:12 +02:00
Joakim Hove
a6db850230 Merge pull request #1165 from joakim-hove/python-testdata-path
Python testdata path
2019-10-25 10:54:24 +02:00
Joakim Hove
5ec24199de Merge pull request #1163 from joakim-hove/python-test-main
Python test main
2019-10-25 10:38:56 +02:00
Joakim Hove
78b32803ff Merge pull request #1162 from joakim-hove/python-enable
Minor change to python enable script
2019-10-25 10:00:23 +02:00
Joakim Hove
e51b14f6fd Use utility function for path to testdata 2019-10-25 09:57:38 +02:00
Steinar Foss
ce3781775f DeckKeyword w/ vectors: takes unit system as arg.
DeckKeyword w/ vector: added unit as arg.

DeckKeyword vector works with units.

DecValuetests: use zcorn instead of poro.

python: deckkweyword works with int data.

...

python deckkeyword. cant init with double array.

moved numpy_array converters to converters.hpp.
2019-10-25 09:31:03 +02:00
Joakim Hove
2fb3ce4957 Add if __name__ == "__main__" in Python test 2019-10-25 09:14:25 +02:00
Joakim Hove
622409bfb6 White space change 2019-10-25 09:14:15 +02:00
Joakim Hove
464cf6a51f Merge pull request #1068 from GitPaean/fixing_aquifer
improvements related to Aquifer modeling
2019-10-25 09:01:19 +02:00
Joakim Hove
162d0e0902 Minor change to python enable script 2019-10-25 08:54:40 +02:00
Kai Bao
b9bc222e81 addressing reviewing comments from PR #1068 2019-10-24 23:01:34 +02:00
Kai Bao
3691c6e724 an aquifer connection need to between active and inactive cells
unless we specify we want to have aquifer within the inner cell of the
reservoir.
2019-10-24 22:01:28 +02:00
Kai Bao
a58daf17b5 correcting the definition of keyword AQUFETP
default_value looks like not working in term of specifying default value
for the item.
2019-10-24 22:01:28 +02:00
Joakim Hove
50b3aef1fa Merge pull request #1158 from joakim-hove/Q
Keywords on Q
2019-10-24 18:41:30 +02:00
Joakim Hove
4b8628a873 Keywords on Q 2019-10-24 17:06:28 +02:00
Joakim Hove
0af4a5510e Merge pull request #1154 from stefoss23/add_keywords_M1
Added more keywords beginning with M.
2019-10-24 16:53:25 +02:00
Joakim Hove
7e2d45cf66 Export all UDQTokens in use from UDQDefine 2019-10-24 16:51:15 +02:00
Joakim Hove
4c4bee4285 Merge pull request #1156 from atgeirr/add-missing-include
Add missing <string> include, necessary on clang.
2019-10-24 16:39:07 +02:00
Atgeirr Flø Rasmussen
4cc54aa324 Add missing <string> include, necessary on clang. 2019-10-24 15:44:34 +02:00
Steinar Foss
11a25e02c2 added more keywords beginning with M.
added keywords MULTOUTS, MULTREAL, MULTREGD.

added keywords MULTREGH, MULTSIG, MULTSIGV.

added keywords NARROW, NCONSUMP, NEFAC.
2019-10-24 11:48:02 +02:00
Joakim Hove
a9a7166e3d Merge pull request #1153 from joakim-hove/move-fluxnum
Moved FLUXNUM to GRID section
2019-10-24 09:42:28 +02:00
Joakim Hove
0421173686 Merge pull request #1152 from joakim-hove/deckkeyword-unit
Deckkeyword unit
2019-10-24 08:43:18 +02:00
Joakim Hove
15eda478f3 Merge pull request #1149 from tskille/ESmry
fixing severe performance issue with ESmry
2019-10-24 08:42:50 +02:00
Joakim Hove
d7a52167f3 Moved FLUXNUM to GRID section 2019-10-24 08:39:53 +02:00
Joakim Hove
8f0aa75509 Merge pull request #1148 from joakim-hove/extract-operate
Extract operate
2019-10-24 07:18:09 +02:00
Joakim Hove
6525a7b19f Merge pull request #1143 from joakim-hove/box-data-index
Add data_index to Box::index_list
2019-10-24 07:17:57 +02:00
Steinar Foss
d05b3323b3 DeckKeyword: constr. with records takes unitsystem args.
Deckkeyword constr w/ records also takes unit_systems.

DeckKeyword w/ records uses input args to get dims.

DeckValue unit system works w/ records.

Deckkeyword w/ records: rearranged default/active unit args.

..

python deckkeywords: workable.

python deckkeyword: testing rewrite.

python deckkeyword w/units: most test work.

...

python support for deckkeyword w/ dimensions.
2019-10-24 07:13:31 +02:00
Joakim Hove
1a05f2fcd1 Merge pull request #1151 from stefoss23/box_bug
BOX keyword: using defaultApplied.
2019-10-24 07:08:11 +02:00
Steinar Foss
1a8e9979d8 BOX keyword: using defaultApplied.
moved failed box-test from python to cpp.

setKeywordBox: using defaultApplied rather than hasvalue.

EclipseStateTEsts. TextBox: use 1* instead of *.

corrected box_bug.
2019-10-23 15:47:25 +02:00
Torbjørn Skille
e3e2a6e8ea fixing severe performance issue with ESmry 2019-10-23 14:33:17 +02:00
Joakim Hove
35ed4bbca4 Use a lambda for the operate functions 2019-10-23 07:49:26 +02:00
Joakim Hove
ccb3ddced9 Extracted OPERATE function to separate file 2019-10-23 07:25:41 +02:00
Joakim Hove
cadadbde4d Merge pull request #1145 from joakim-hove/properties-testdata
Properties testdata
2019-10-22 17:18:48 +02:00
Arne Morten Kvarving
76c866f816 Merge pull request #1146 from akva2/fix_closed_tests_prs
fixed: allow branch to exist in opm-tests PR repo, but no PR
2019-10-22 10:11:59 +02:00
Joakim Hove
304791683f Merge pull request #1121 from joakim-hove/multregt-edit-warning
Add warning for MULTREGT in EDIT section
2019-10-22 10:02:00 +02:00
Arne Morten Kvarving
d472485418 fixed: allow branch to exist in opm-tests PR repo, but no PR
happens when people manually close a previously opened PR
for the branch.
2019-10-22 08:38:41 +02:00
Joakim Hove
fb63f61385 Merge pull request #1141 from joakim-hove/formatted-inf
Formatted inf
2019-10-22 08:25:16 +02:00
Joakim Hove
1af3ab2008 Merge pull request #1142 from joakim-hove/multz-edit
Multiply MULT(XYZ) keywords in the EDIT section
2019-10-22 08:24:32 +02:00
Joakim Hove
f81a84da42 Update testdata for a stricter 3D property parser
- Keywords should have correct number of elements
 - Should be in the correct section
2019-10-22 08:23:00 +02:00
Joakim Hove
760140397d Add dimension "1" to factor in MULTIPLY keyword 2019-10-22 08:22:51 +02:00
Atgeirr Flø Rasmussen
cf26ecac5e Merge pull request #1138 from bska/transpose-density-table
TAB Vector (INIT): Store Phase Density Data By Columns
2019-10-21 23:06:27 +02:00
Joakim Hove
2f8916392c Merge pull request #1144 from GitPaean/converting_aquifer_test_unix
converting AquanconTests.cpp to be unix format.
2019-10-21 18:27:19 +02:00
Kai Bao
18564a465c converting AquanconTests.cpp to be unix format. 2019-10-21 17:00:12 +02:00
Joakim Hove
1ad4a03ac1 Add data_index to Box::index_list 2019-10-21 15:45:39 +02:00
Joakim Hove
5741ff8034 Multiply MULT(XYZ) keywords in the EDIT section 2019-10-21 11:53:09 +02:00
Joakim Hove
abb70835fb Read and write formatted representations of NAN and INF 2019-10-21 09:29:13 +02:00
Joakim Hove
33e72c2a77 Slightly more relaxed conversion of formatted double string 2019-10-21 09:24:03 +02:00
Joakim Hove
e02cce3fde Use pass by value in string to double conversion 2019-10-21 09:24:03 +02:00
Joakim Hove
08d6888992 Remove trailing whitespace 2019-10-21 09:24:03 +02:00
Bård Skaflestad
18a840edba Add Unit Tests for Density Table Output 2019-10-21 00:16:30 -05:00
Bård Skaflestad
af97eaf821 TAB Vector (INIT): Store Phase Density Data By Columns
Specifically, store oil density values for every region before water
density values for every region, and gas density values after water
density values for every region.

This is the format expected in ECLIPSE's INIT file, and used by
ResInsight's fall-back flux calculator mode for flow diagnostics.
2019-10-20 23:25:57 -05:00
Joakim Hove
737b2127d8 Merge pull request #1100 from totto82/convertTargets
convert targets.
2019-10-20 17:50:25 +02:00
Joakim Hove
4fabb7b486 Merge pull request #1122 from joakim-hove/location
Add small struct DeckKeyword::Location to simplify error reporting
2019-10-19 23:30:43 +02:00
Joakim Hove
d3f33882b9 Merge pull request #1128 from joakim-hove/exc-warning
Exc warning
2019-10-19 22:34:15 +02:00
Joakim Hove
f39de00b4a Add warning for MULTREGT in EDIT section 2019-10-19 20:13:48 +02:00
Joakim Hove
2534bbe0a3 Merge pull request #1123 from blattms/fix-unused-parameter-oython
Fixed unused parameter warning in PythonInterp.hpp
2019-10-19 20:13:14 +02:00
Markus Blatt
5584d6bb0a Fixed unused parameter warning in PythonInterp.hpp 2019-10-18 08:36:28 +02:00
Joakim Hove
e7e25beea5 Use const& to avoiw warnings 2019-10-18 08:34:12 +02:00
Joakim Hove
0c50d96ed0 Remove trailing whitespace 2019-10-18 08:32:49 +02:00
Joakim Hove
f274257c94 Pass location when constructing DeckKeyword 2019-10-18 08:26:33 +02:00
Joakim Hove
781ced7294 Use struct Location to record file position for keywords 2019-10-17 23:57:01 +02:00
Joakim Hove
2be6235ab7 Add small struct DeckKeyword::Location to simplify error reporting 2019-10-17 23:56:34 +02:00
Markus Blatt
007abc79f9 Merge pull request #1125 from blattms/fix-memory-error-eclipsegrid-actnum
Fix memory error during EclipseGrid creation with Actnum.
2019-10-17 20:24:51 +02:00
Markus Blatt
a3daeb9c45 Fix memory error during EclipseGrid creation with Actnum.
We pass an int pointer to the function initCornerPointGrid.
With ACTNUM  this pointer was initialized with data pointer
of an int vector that we threw away before the function call
(otherwise it was null). To fix this we move the int-vector up one
scope.
2019-10-17 19:09:24 +02:00
Joakim Hove
a0d5776eb9 Merge pull request #1119 from stefoss23/add_keywords_M
Added keywords beginning w/ M.
2019-10-17 15:06:19 +02:00
Joakim Hove
abbdcc9c6c Merge pull request #1117 from akva2/move_parserkeywords_build
changed: put the generated ParserKeywords.cpp first in list
2019-10-17 15:05:59 +02:00
Joakim Hove
65095af82e Merge pull request #1101 from joakim-hove/R
Add keywords starting with R
2019-10-17 14:53:22 +02:00
Steinar Foss
f5c1ede8ee Added keywords beginning w/ M.
added keywords MINPORV, MLANG, MLANGSLV.
2019-10-17 13:00:28 +02:00
Joakim Hove
b47d808416 Merge pull request #1116 from akva2/fix_expl_constructor_gcc5
fixed: build using gcc 5 (ubuntu xenial)
2019-10-17 12:54:10 +02:00
Arne Morten Kvarving
93ac533373 changed: put the generated ParserKeywords.cpp first in list
this improves build throughput on jenkins since building this
large file will overlap more with other build tasks.
2019-10-17 11:40:48 +02:00
Joakim Hove
8bed569f7e Merge pull request #1021 from joakim-hove/use-parser-dimensions
Use parser dimensions
2019-10-17 11:34:49 +02:00
Tor Harald Sandve
d1d665c343 Convert targets. Tested on simple problems. 2019-10-17 11:33:17 +02:00
Joakim Hove
60870b0f5a Add keywords starting with R 2019-10-17 11:24:13 +02:00
Arne Morten Kvarving
c06d5912ea fixed: build using gcc 5 (ubuntu xenial)
the tuple-from-initializer-list constructor is explicit.
2019-10-17 09:49:15 +02:00
Joakim Hove
e815194e21 Merge pull request #1112 from stefoss23/remove_common_state
Remove common state
2019-10-17 06:58:25 +02:00
Bård Skaflestad
3ea66e41dc Merge pull request #1107 from bska/decouple-libecl-final
Decouple OPM Flow From Libecl
2019-10-16 21:44:53 -05:00
Bård Skaflestad
288be7f0dc Drop libecl From Python Setup
Suggested by [at]akva2.
2019-10-16 20:03:08 -05:00
Arne Morten Kvarving
247b5685cc remove libecl from buildsystem, jenkins and packaging 2019-10-16 20:03:08 -05:00
Bård Skaflestad
d1db2ec396 Reimplement test_Restart in Terms of TimeStampUTC
Only affects the 'first_sim()' helper function.
2019-10-16 20:03:08 -05:00
Bård Skaflestad
7eec899130 Reimplement test_EclipseIO in Terms of TimeStampUTC
Mostly just to provide a simple overload of the utility function

    ecl_util_make_date

from libecl.  The rest of the test code remains intact.
2019-10-16 20:03:08 -05:00
Bård Skaflestad
7e160cb99a Reimplement ScheduleTests in Terms of TimeStampUTC
Note that we have to reduce the year-range in the specific test

    createDeckWithDRSDTthenDRVDT

in order not to wrap around for system_clock.  This is a deficency of
the new time-service protocol.
2019-10-16 20:03:08 -05:00
Bård Skaflestad
428d4c41f0 Reimplement TimeMap in Terms of TimeStampUTC 2019-10-16 20:03:08 -05:00
Bård Skaflestad
eea51a12b4 Add Simple Time-Service Protocol
Mostly for converting between std::time_t and broken-down time
stamps.  Uses UTC and std::chrono::system_clock.  May wrap in as
little as 292 years, depending on the period of system_clock.

Intended to replace various timestamping utility functions from
libecl.  A comprehensive time-service protocol for Flow is much more
work than this, and will likely not be easily realized before we
have C++17 and its much expanded time/calendar library.
2019-10-16 20:03:08 -05:00
Bård Skaflestad
738f98a4ac Defaulted Table Column: Don't Use 'ssize_t'
Instead, switch to 'int' for the 'before' and 'after' row indices.
The 'ssize_t' Posix type alias is not appropriate for this usage
since its range is only guaranteed to be [ -1 .. (1<<15)-1 ].
2019-10-16 20:03:08 -05:00
Bård Skaflestad
4e3693896e Reimplement 'test_EclipseIO' in Terms of Opm-Common Classes
In particular, use EGrid, ERst and EclFile as appropriate.
2019-10-16 20:03:08 -05:00
Joakim Hove
693181187c Adapt to new DeckKeyword constructor 2019-10-16 21:40:31 +02:00
Joakim Hove
697545cf54 Use dimensions from ParserKeyword 2019-10-16 21:03:02 +02:00
Joakim Hove
233f55c4e2 Update the Deck unitsystem using select method instead of mutable ref. 2019-10-16 21:03:02 +02:00
Joakim Hove
3d94bc6baf Simplify Deck constructors 2019-10-16 21:03:02 +02:00
Joakim Hove
7b35e68221 Merge pull request #1115 from akva2/janitoring
remove unused variables
2019-10-16 20:51:58 +02:00
Joakim Hove
5aa3369be6 Merge pull request #1113 from totto82/addEdit
Apply MULTZ also in the edit section
2019-10-16 16:12:43 +02:00
Arne Morten Kvarving
2253448eed remove unused variables 2019-10-16 16:07:29 +02:00
Joakim Hove
c8597419e1 Merge pull request #1109 from stefoss23/add_keywords_L
Added keywords beginning w/ L.
2019-10-16 15:11:49 +02:00
Tor Harald Sandve
3a3808b204 Apply MULTZ also in the edit section 2019-10-16 14:22:59 +02:00
Steinar Foss
fe8692f623 schedule.cpp: removed unused function. 2019-10-16 14:20:16 +02:00
Steinar Foss
0e5c14568e removed common_state. 2019-10-16 13:59:00 +02:00
Markus Blatt
ae08281927 Merge pull request #1110 from blattms/allow-building-one-by-one-with-installed
Allow building a module with dependencies installed but source lying …
2019-10-16 13:50:13 +02:00
Steinar Foss
7d0004f915 added keywords beginning w/ L.
added keywords LSLTWNUM, LSNUM, LSOGCR.

added keywords LSOWCR, LSWCR, LSWL.

LSWLPC, LSWU, LTOSIGMA.

added keywords LWKRO, LWKRORG, LWKRORW.

added keywords LWKRW, LWKRWR, LWPCW.

LWSLTNUM, LWSNUM, LWSOGCR.

added keywords LWSOWCR, LWSWCR, LWSWL.

added keywords LWSWLPC, LWSWU, LX.

added keywords LY, LZ, MATCORR.

...
2019-10-16 12:50:23 +02:00
Markus Blatt
a862c14873 Allow building a module with dependencies installed but source lying around.
If you set CMAKE_INSTALL_PREFIX, have the dependencies installed there, but
the source of them lying around in the parent directory of the build
directory, then the build will fail starting with opm-models because
we assume that ../opm-material is a build directory and set opm-material_DIR
to it. CMake will complain about not finding opm-material-config.cmake or
Opm-materialConfig.cmake. With this commit we will only set opm-material_DIR
if the directory contains a file CMakeCache.txt (which should be the case in
a configured build directory.

Directory outline of the failing situation is
- ${CMAKE_INSTALL_PREFIX} # where all dependencies are installed
- parent_dir
|____ opm-common #source dir
|____ opm-material #source dir
|____ ...
|____ build #build directory for current module (e.g. opm-modules)

Change is tested with sibling build

- build
|___ opm-common #build dir
|___ opm-material #build dir
|___ ...

and the dune version of it

- parent_dir
|___ opm-common # source dir
    |____ build # build dir opm-common

|___ opm-material # source dir
    |____ build # build dir opm-material
...
2019-10-16 12:38:51 +02:00
Joakim Hove
b5ab3e2047 Merge pull request #1092 from tskille/ESmry
Updates of ESmry - now supporting non-unified result files.
2019-10-15 23:02:02 +02:00
Joakim Hove
0f03777b16 Merge pull request #1106 from joakim-hove/setup-test-fixup
Fix spelling error
2019-10-15 09:51:50 +02:00
Torbjørn Skille
e36e87ccde Update of ESmry, now supporting non-unified result files. 2019-10-15 09:23:40 +02:00
Joakim Hove
1bab7f7aa3 Fix spelling error 2019-10-15 08:11:04 +02:00
Joakim Hove
7b55f10dc0 Merge pull request #1051 from joakim-hove/remove-props-iget
Remove index access to GridProperty<T>
2019-10-15 07:53:38 +02:00
Joakim Hove
01c5fe9d1d Merge pull request #1105 from joakim-hove/python-util-rm
Use absolute import for test util
2019-10-15 06:51:54 +02:00
Joakim Hove
2c6d1e0e37 Use absolute import for test util 2019-10-15 00:39:13 +02:00
Joakim Hove
5269f52291 Merge pull request #1075 from joakim-hove/python-install
Add Python copy/install hack
2019-10-14 18:46:48 +02:00
Joakim Hove
8c417a51e6 Merge pull request #1098 from joakim-hove/actionx-rst
Actionx rst
2019-10-14 18:00:21 +02:00
Joakim Hove
368910a7c2 Merge pull request #1099 from stefoss23/add_keywords_I
Added keywords beginning w/ I, J, K and L.
2019-10-14 18:00:07 +02:00
Joakim Hove
583ac5a756 Merge pull request #1094 from blattms/default-constructable-restartkey
Make RestartKey default contructable.
2019-10-14 17:29:31 +02:00
Joakim Hove
ce2d8ce211 Merge pull request #1090 from joakim-hove/S
Add S keywords up to SURFST
2019-10-14 16:27:33 +02:00
Joakim Hove
7dc77d1ca3 Install PYTHON Modules when running jenkins 2019-10-14 15:53:31 +02:00
Joakim Hove
1ff41de3eb Avoid use of include/ directory in test data 2019-10-14 15:46:02 +02:00
Jostein Alvestad
5d54d1a2fe change to avoid error in test_AggregateIntehead 2019-10-14 15:46:02 +02:00
Jostein Alvestad
1f79e2f0e3 corrected merge conflict that was missed in previous commit 2019-10-14 15:46:02 +02:00
Jostein Alvestad
84300d19f3 changes to avoid warnings in compilation 2019-10-14 15:46:02 +02:00
Jostein Alvestad
7973585db0 Initial work to add Actionx data to Eclipse compatible restart file
further changes to Actionx - restart

further changes for Actionx data to Restart file

additional changes to output Actionx data to Restart file

add test data for UDQ-ACTIONX

changes to add unit tests for InteHead - Actionx

Added changes to allow for output of IACT, SACT and ZACT to the E100 compatible restart file

changes to add ZLACT to restart output

Further changes - add ZACN - prelim

further changes to add ZACN to restart file

Additional changes to output IACN and SACN to restart

further changes to add IACN and SACN to the restart file

further changes to make unit tests for Actionx data / keywords

further changes to actionx restart and unit tests therefore

Added code for unit tests - not finished

some changes to correct for changes in upstream/master

changes correct errors in IACN and SACN

Initial work to add Actionx data to Eclipse compatible restart file

further changes to Actionx - restart

further changes for Actionx data to Restart file

additional changes to output Actionx data to Restart file

add test data for UDQ-ACTIONX

changes to add unit tests for InteHead - Actionx

Added changes to allow for output of IACT, SACT and ZACT to the E100 compatible restart file

changes to add ZLACT to restart output

Further changes - add ZACN - prelim

further changes to add ZACN to restart file

Additional changes to output IACN and SACN to restart

further changes to add IACN and SACN to the restart file

further changes to make unit tests for Actionx data / keywords

further changes to actionx restart and unit tests therefore

Added code for unit tests - not finished

some changes to correct for changes in upstream/master

changes correct errors in IACN and SACN

changes to avoid change in output data for restart file

further changes to avoid change in RESTART data

minor change to avoid data change in Restart file
2019-10-14 15:45:24 +02:00
Steinar Foss
3ca8cf896e added keywords beginning w/ I, J, K and L.
added keyword JFUNCR.

added keywords KRNUN, KRNUMMF.

added keywords LANGMPL, LANGMUIR, LANGSOLV.

added keywords LGRCOPY, LGRFREE, LGRLOCK.

added keywords LGROFF, LGRON, LINKPERM.

added keywords LKRO, LKRORG, LKRORW.

added keywords LKRW, LKRWR, LOAD.
2019-10-14 15:39:16 +02:00
Markus Blatt
c379e7e3b0 Make RestartKey default contructable.
Otherwise we cannot even resize a vector of it and this will be needed
for restart when getting rid off the global grid on all processes.
2019-10-14 15:17:57 +02:00
Bård Skaflestad
1db06277ce Merge pull request #1088 from bska/further-decouple-from-libecl
Further Decouple OPM-Common From libecl
2019-10-14 08:12:40 -05:00
Joakim Hove
8576bf5809 Merge pull request #1093 from stefoss23/python_unit_system
python: added class UnitSystem.
2019-10-14 14:03:18 +02:00
Bård Skaflestad
662e44683c INTEHEAD Test: Initialize Maximum Number of Wells in Field
Fixes a warning about missing initializers.
2019-10-14 06:14:09 -05:00
Bård Skaflestad
411da1d8a5 Make 'test_Restart' Mostly Independent of libecl
In particular, swith to using class EclIO::ERst to read the files
produced by RestartIO::save().
2019-10-14 06:13:38 -05:00
Bård Skaflestad
3802b4574a Make 'test_Summary' Independent of LibeECL
This commit switches the 'test_Summary' unit test to use class ESmry
for inspecting the values output to disk by 'out::Summary'.  As a
consequence, we are not able to verify units of measure for the
parameters, at least not for the time being.  Moreover, class ESmry
exclusively uses the "i,j,k" sub-key for block-related parameters so
switch those to reference the IJK identifiers.

Finally, as class ESmry currently does not support reading separate
(multiple) summary files, switch the input decks to generate unified
output.
2019-10-14 06:13:38 -05:00
Bård Skaflestad
c013639b51 Make Most Unit Tests Independent of LibECL
This commit switches a set of OPM-Common's unit tests away from
using direct calls to libecl functions and into using base types
from OPM-Common itself (along with Boost.Filesystem).

In particular summary related queries are replaced by calls to ESmry
member functions (wrapped in libecl-like interfaces to minimise code
changes).  We disable checks on unit strings since ESmry currently
does not have a way of associating those with individual variables.
2019-10-14 06:13:38 -05:00
Bård Skaflestad
bcfe700461 Decouple Most of OPM-Common From LibECL
This commit takes a pass at the implementation files in opm-common
and removes references to libecl functions where practical.  In
particular we switch to using types from C++'s standard library (and
Boost.Filesystem) to achieve the effects of the interfaces being
replaced.

We also insert direct calls to Posix function fnmatch() to preserve
existing pattern matching behaviour (well lists and well templates).
2019-10-14 06:13:38 -05:00
Bård Skaflestad
d84b7e19ee ESmry: Add Way of Retrieving Ministep Index at Start of Report Step
This commit introduces a new member function

    int ESmry::miniStepIdxAtReportStep(rptStep)

which returns the zero-based ministep corresponding to the start of
the given report step (one-based indexing).  This will simplify
decoupling a few unit tests from libecl.
2019-10-14 06:13:38 -05:00
Joakim Hove
59b73a0667 Change the python installation code
- Main cmake based python installation is based on small script install.py and
  not setup.py
- Python installation is guarded by cmake switch OPM_INSTALL_PYTHON
- Configure convenience shell script setup-install.sh for setup.py based
  installation.
- Remove PYTHONPATH hacks from setup.py
2019-10-14 13:13:09 +02:00
Atgeirr Flø Rasmussen
d4cfa5127f Merge pull request #1097 from akva2/enable_flow_variants
changed: build flow variants on jenkins
2019-10-14 12:59:30 +02:00
Steinar Foss
a089f9ff47 CMakeLists_files.cmake added unit_system to EMBEDDED_PYTHON. 2019-10-14 12:54:17 +02:00
Joakim Hove
87362c1336 Merge pull request #1095 from joakim-hove/inner-exc
Rephrased error message
2019-10-14 12:50:55 +02:00
Joakim Hove
635071d492 Merge pull request #1082 from bska/new-summary-writer
New summary writer
2019-10-14 12:25:44 +02:00
Joakim Hove
a47ffcc349 Remove index access to GridProperty<T> 2019-10-14 12:23:18 +02:00
Joakim Hove
2d4f941718 Merge pull request #1096 from akva2/janitoring
Some janitoring
2019-10-14 12:19:13 +02:00
Arne Morten Kvarving
9b44a8f5ce changed: build flow variants on jenkins 2019-10-14 11:06:42 +02:00
Arne Morten Kvarving
4e720c5d74 remove noop explicit template instantation after specialization 2019-10-14 08:54:05 +02:00
Arne Morten Kvarving
d98518c023 avoid returning uninitialized result if wrong indices are given 2019-10-14 08:53:44 +02:00
Arne Morten Kvarving
b0273485c7 remove unused assignment 2019-10-14 08:53:33 +02:00
Arne Morten Kvarving
463d9eb53d remove unused initialization 2019-10-14 08:53:12 +02:00
Arne Morten Kvarving
11462f7618 add missing initializer 2019-10-14 08:36:42 +02:00
Arne Morten Kvarving
73866b97f2 remove unused variable 2019-10-14 08:36:36 +02:00
Arne Morten Kvarving
8979fe25af remove unused function 2019-10-14 08:36:26 +02:00
Steinar Foss
a2a016951f python unit_system name. 2019-10-13 22:53:56 +02:00
Bård Skaflestad
2eb3a06024 Replace Writer for Summary/SMSPEC Files
This commit replaces the existing system for writing summary and
specification (SMSPEC) files with a new implementation based on
class EclOutput.  We package the evaluators of individual parameters
in a set of classes determined by the parameter's category which
each implement a virtual 'update()' function.  This update function
ultimately writes new values into a SummaryState object.

Add a factory-like system for instantiating the appropriate class
depending on a SummaryNode's 'category()'.  Also, add a helper class
for managing the parameters that a configured in a simulation
model's SUMMARY section in order to distinguish these from those
parameters that are merely needed for restart purposes.  The summary
class's 'eval()' function then becomes a loop over the evaluators
for parameters in SUMMARY followed by a loop over the evaluators for
restart vectors.

We reimplement the 'internal_store()' function in terms of an
std::vector of a helper structure 'MiniStep' which holds a ministep
ID (contiguous counter started at zero), a report step ID, and all
the evaluated parameters of this ministep.  The final write function
then consists of outputting those ministep structures that have
accumulated since the previous call to write().  If a simulation
does not call write at all, then this will accumulate all parameters
for all ministeps throughout the simulation history.

We create the SMSPEC file at most once, and write to it at most each
report step.  We create the summary file once (if unified) or at
each report step (if separate).
2019-10-12 20:21:17 -05:00
Bård Skaflestad
7d11a59197 SMSPEC: Temporarily Restore Unconditional RESTART Vector
Needed to ensure we create the same summary/specification files as
the existing system.  We will revert this change once the new system
is in place and we can afford to update the reference solutions.
2019-10-12 18:38:20 -05:00
Joakim Hove
8409c205ae Rephrased error message 2019-10-12 08:04:37 +02:00
Steinar Foss
a177d3b887 python/cxx/export.hpp: rearranged UnitSystem position. 2019-10-11 22:40:35 +02:00
Steinar Foss
c0bd19c59e python: added class UnitSystem. 2019-10-11 22:02:54 +02:00
Joakim Hove
32ac0034a7 Merge pull request #1091 from stefoss23/deck_keyword_vector
deckkeyword: new constructors takes (ParserKeyword, std::vector).
2019-10-11 20:04:50 +02:00
Joakim Hove
a710e9b8b8 Add S keywords up to SURFST 2019-10-11 15:55:29 +02:00
Steinar Foss
17f246c1a7 deckkeyword: new constructors takes (ParserKeyword, std::vector).
DeckKeyword: test for vector<int> data constructor.

DeckKeyword takes std::vector<int> and std::vector<double>.

...

...

...

...
2019-10-11 13:47:14 +02:00
Joakim Hove
d66f0a664c Merge pull request #1067 from joakim-hove/box-grid
Consider active cells in BOX implementation
2019-10-11 10:57:39 +02:00
Joakim Hove
9af248f889 Merge pull request #1072 from stefoss23/python_deck_values
python: new DeckKeyword constructor takes DeckRecords
2019-10-11 10:57:14 +02:00
Joakim Hove
3c26314475 Merge pull request #1087 from bska/bypass-filleps-for-2p
INIT File: Bypass FILLEPS for Two-Phase Systems
2019-10-11 10:56:25 +02:00
Joakim Hove
12e2c9c545 Merge pull request #1081 from bska/prepare-new-summary-writer
Prepare New Summary Writer
2019-10-11 10:39:59 +02:00
Joakim Hove
79d3f236c2 Merge pull request #1086 from stefoss23/python_conn
Python: removed properties.py, shedule.py, parser_module.py and sunbeam.py
2019-10-11 08:42:07 +02:00
Joakim Hove
5c280ed72a Merge pull request #1083 from joakim-hove/T
Keywords on starting with T
2019-10-11 08:39:19 +02:00
Joakim Hove
73cc9cff3a Merge pull request #1085 from stefoss23/add_keywords_H
Adding keywords beginning w/ H and I.
2019-10-11 08:39:07 +02:00
Bård Skaflestad
c736e71e46 INIT File: Bypass FILLEPS for Two-Phase Systems
Flow's saturation function finalizers don't currently handle models
with fewer than three active phases.  Don't attempt to fill in
scaled endpoint vectors in this case, but issue a warning that we're
ignoring FILLEPS here.
2019-10-10 22:28:41 -05:00
Steinar Foss
92f69d7648 removed sunbeam.py. 2019-10-10 12:57:49 +02:00
Steinar Foss
bad1b1d3fb removed parser_module.py. 2019-10-10 12:56:51 +02:00
Steinar Foss
0e1339e648 removed all test suppoert for parser_module.py. 2019-10-10 12:54:22 +02:00
Steinar Foss
3cc205ee93 ELIMINATED 'properties.py'. 2019-10-10 12:54:22 +02:00
Steinar Foss
ad564ad651 python connection: exposed directly via pybind11.
python connection. added property pos.

removed shedule.py.

test_connection.py passed.

test_wells.py: test_completion passes.

removed opm.io.config.

renamed test_state2.py -> test_state.py.
2019-10-10 12:54:40 +02:00
Steinar Foss
39c1056c87 added keywords beginning w/ H and I.
added keywords HMWELCON, HMWPIMPLT.

added keyword HMxxxxxx.

added keywords HRFIN, HWKRO, HWKRORH.

added keywords HWKRORW, HWKRWM HWKRWR.

added keyword HWPCW.

added keywords HWSNUM, HWSOGCR, HWSOWCR.

added keyword HWSWCR.

added keywords HWSWL, HWSWLPC, HWSWU.

added keywords HXFIN, HYDRHEAD, HYFIN.

added keywords HYMOBGDR, HYST, HYSTCHCK.

added keyword HZFIN.

added keywords IHOST, IMBNUMMF, IMPCVD.

IMPLICIT, IMPORT, IMSPCVD.

added keywords INSPEC, INTPC, IONROCK.

added keywords IONXROCK, IONXSURF.

...
2019-10-09 15:29:48 +02:00
Joakim Hove
9f1858265a Create ParserKeywords in try catch block 2019-10-09 11:53:25 +02:00
Joakim Hove
5a9f5c0999 Keywords on starting with T 2019-10-09 08:10:50 +02:00
Bård Skaflestad
a5d943fd8f Unit System: Use Plural for TIME Names
The summary file must have DAYS (&c) for its TIME vector unit.  This
is a step towards enabling new summary writer functionality.

Update the RFT writer accordingly.
2019-10-08 23:25:48 -05:00
Bård Skaflestad
e598aa8cae Output Stream: Add File Creation for Summary Files
This commit adds a single function, createSummaryFile, that opens an
EclOutput object on a file named as an ECLIPSE summary file
(formatted vs. unformatted, unified vs. separate) and returns a
unique_ptr to this.

This is a step towards enabling new summary writer functionality.
2019-10-08 23:20:39 -05:00
Bård Skaflestad
359558536e Output: Support More Than 10,000 Report Steps
This commit extends Flow's support for separate restart files to
more than 10,000 report steps (not necessarily restart steps).  In
particular, add support for generating separate restart files named

    CASE.X000n, CASE.Y000n, CASE.Z000n (unformatted)
    CASE.F000n, CASE.G000n, CASE.H000n (formatted)

This is mostly for completeness.  We do not really expect to run
simulation models with more than 10,000 (or 20,000) report steps.
2019-10-08 23:12:37 -05:00
Bård Skaflestad
e6e8b070d7 Merge pull request #1077 from joakim-hove/compile-fixup
Compile fixup
2019-10-08 17:36:51 -05:00
Joakim Hove
278f4ff3c9 Merge pull request #1079 from stefoss23/python_context_recovery
python: rewrite of tests using ParseContext.
2019-10-08 23:42:44 +02:00
Joakim Hove
2f6160ec17 Minor change to fix compile error 2019-10-08 18:47:26 +02:00
Joakim Hove
a319d7be4f Add missing GPL / Copyright header 2019-10-08 18:42:58 +02:00
Joakim Hove
8101591277 White space 2019-10-08 18:42:58 +02:00
Steinar Foss
223fe5e7df python: rewrite of tests using ParseContext.
test_state: recalled slash test and made it work.

...

test_parse_deck ok.
2019-10-08 17:30:56 +02:00
Joakim Hove
b6824af640 Merge pull request #967 from jalvestad/udq_dynamic
Code to write dynamic UDQ data to Eclipse compatible restart file
2019-10-08 12:47:11 +02:00
Steinar Foss
3bce48586a Python: DeckKeyword: can accept DeckValues( parserkw, [["5*$VALUE"]])
python : deckkeyword accepts 5*.

...
2019-10-08 11:04:15 +02:00
Jostein Alvestad
d1d651a70d commented out change of Doubhead to avoid test-problems 2019-10-08 08:27:51 +02:00
Bård Skaflestad
4de3391fda Merge pull request #1076 from bska/private-smryfcn-table
Make Summary.cpp's Function Table Fully Private
2019-10-07 15:49:54 -05:00
Jostein Alvestad
90d0deeafb further changes to remove changes to data in the pull request 2019-10-07 16:34:35 +02:00
Bård Skaflestad
2fa017b29b Summary Evaluation: Make Efficiency Factor Function Private
This commit pulls the 'well_efficiency_factor' function into
Summary.cpp's private/anonymous namespace.  In addition to being a
step towards enabling new writer code for Flow's summary file, this
also fixes a "no previous declaration" warning on GCC.
2019-10-07 13:44:51 +02:00
Bård Skaflestad
e495207e9f Summary Evaluation: Make Function Table Private
This commit pulls the table of evaluation functions out of the Opm
namespace and into the existing anonymous namespace of Summary.cpp.

This is an intermediate step towards enabling new writer code for
Flow's summary files.
2019-10-07 13:32:31 +02:00
Jostein Alvestad
5d9a9880ec comment unused function getRandSeedPar 2019-10-07 12:52:12 +02:00
Jostein Alvestad
390b6c6f5c changes to ensure no change in data for pull request 2019-10-07 12:35:22 +02:00
Jostein Alvestad
b7543d4bc9 made change to allow for change of Summarystate object 2019-10-07 09:54:44 +02:00
Jostein Alvestad
967954fc4b corrections and changes according to comments from maintainer 2019-10-07 09:54:42 +02:00
Jostein Alvestad
d99791d442 corrections to allocation function plus addition to unit tests 2019-10-07 09:54:40 +02:00
Jostein Alvestad
20523b46cc additions and corrections for restart export DUDF, DUDG andn DUDW 2019-10-07 09:54:38 +02:00
Jostein Alvestad
202651c34d corrections after complex rebase to write DUDW data to ECL-compatible restart file 2019-10-07 09:54:36 +02:00
Joakim Hove
16a8f4040c Renamed UDQInput -> UDQCOnfig
UDQConfig object has merged DEFINE & ASSIGN

Log use of UDA for output purposes

Output UDQ keywords to restart file

Add size() method to UDQConfig

Add UDQVarTYpe member to UDQInput class

Add UDQIndex type to keep track of sequence number of variable types

Add unit to UDQInput class

use maps

Add operator[] to UDQConfig class

Use UDQInput class when creating restart file

UDQInput: use correct input index

Add UDQActive::get() method

Make sure UDQ DEFINE overwrite correctly

WIP

WIP - further code to output IGPH vector

WIP

Fix IUAD input index

Output use_index for IUAD

Fix bug with size of IUAD array

UAD usage hashing based on udqstring and controltype

Add UDQ test and input file

Refactor UDQActive - handles vanishing UDA

minor correction for iuad[1] and for test_UDQ_x.cpp

Further work for making unit tests for UDQ restart data

WIP Further work unit tests

WIP some minor corrections

WIP changes to add first version of BOOST test for IUDQ

WIP Added code to write InteHead and DoubHead data as well as IGPH to restart file,

Further added unit tests to the writing of UDQ data

add code to output IUAP array

Fixed group-group2 transition, disable Restart output

WIP Initial changes to add DUDW array to restart output

WIP further work on DUDW data

WIP - further work to output and test DUDW vector data to restart file

Further changes to write DUDW array to Restartfile
2019-10-07 09:54:34 +02:00
Joakim Hove
f2bc961bd4 Merge pull request #1074 from bska/prepare-new-summary-writer
Prepare New Summary Writer
2019-10-07 08:56:07 +02:00
Steinar Foss
7555c00ac3 python DeckKeyword constr. resolved nested try blocks.
...
2019-10-06 19:17:14 +02:00
Bård Skaflestad
68ff2f08a7 Test Summary: Ensure Uppercase Case Names in Result Sets
Simplifies introduction of a new writer for the summary file.
2019-10-05 14:33:55 +02:00
Bård Skaflestad
7bac89429e Summary Test: Include ert_unique_ptr.hpp
Intermediate step towards enabling a new summary writer that is
independent of libecl.
2019-10-05 14:32:13 +02:00
Bård Skaflestad
032de6c289 SummaryConfig: Capture Keyword Type for Connection Keywords
Overlooked when making the 'SummaryNode' class independent of LibECL.
2019-10-05 14:29:22 +02:00
Bård Skaflestad
aa9471dff1 Forward Declare 'out::Summary' Class in EclipseIO
Mostly to reduce build coupling.  Include Summary.hpp where needed.
2019-10-05 14:27:51 +02:00
Bård Skaflestad
5a5a87d602 EclOutput: Add Stream Flushing Operation
Calls '.flush()' on the contained 'ofstream' object.  Needed as a
means of ensuring that bits in the internal buffers of the I/O
system are promptly output to permanent storage.  This, in turn, is
needed in upcoming work on the summary writing feature.
2019-10-05 14:23:21 +02:00
Joakim Hove
cefdd86f1b Merge pull request #1071 from joakim-hove/python-install
Use ${PYTHON_EXECUTABLE} instead of 'python' in CMakeLists.txt
2019-10-05 07:37:38 +02:00
Steinar Foss
6865278ac5 pyhon DeckKeyword: New constructor takes parserkeyword and list of records.
python Deckkeyword: can init with empty records.

python Deckkeyword: can record simple records, but not defaults.

python deckvalue: can take defauløt values.
2019-10-04 21:07:06 +02:00
Joakim Hove
204ea1a1a2 Use ${PYTHON_EXECUTABLE} instead of 'python' in CMakeLists.txt 2019-10-04 20:14:27 +02:00
Joakim Hove
b4908c6fa0 Box: add active index property
To support field properties with only active cells the Box class has been
extended to give a set of active indices for a box. In addition the BoxManager
has been refactored:

 - Use std::unique_ptr<Box> to enable "has no box" situation.
 - Removed several unused getXXX() methods.

And the begin() and end() iterators have been removed from the Box class.
2019-10-04 17:02:13 +02:00
Joakim Hove
2991ce0aea Merge pull request #1070 from stefoss23/deck_keyword_value_constructor
DeckKeyword constructor w/ DeckValue records
2019-10-04 11:49:17 +02:00
Steinar Foss
b9ded4433a DeckKeyword constructor w/ DeckValue fails for sizetype ALL. 2019-10-04 10:51:25 +02:00
Steinar Foss
7199e1ede4 DeckValueTests: added test for DeckKeyword constructor taking DeckValue vectors.
DeckKeyword: new constructor takes recordlist.

DeckKeyword: invalid arg for wrong nr. of records.

DeckValue: type_tag replaces DeckValueEnum.

DeckValue: added as source for genkw.

DeckValue: default is unknown type.

DeckKeyword cosntr w/ record-lists works, but not for defaults.

DeckKeyword: added function add_deckvalue.

.. xx --

...

...

...

...

...

...

...

DeckValue: is<double> true also if integer.

...

...

last commit .m
2019-10-04 10:13:56 +02:00
Bård Skaflestad
3280f26f10 Merge pull request #1069 from joakim-hove/degenrate-cells
Degenrate cells
2019-10-03 19:26:23 +02:00
Joakim Hove
fbe1d211b2 Protect against division by zero in degenerate cells 2019-10-03 18:19:06 +02:00
Joakim Hove
9167359570 Remove trailing whitespace in EclipseGrid files 2019-10-03 18:19:06 +02:00
Joakim Hove
07a998f3c2 Merge pull request #1058 from bska/new-smspec-writer
Add File Manager Stream for Summary Specification
2019-10-03 10:08:33 +02:00
Bård Skaflestad
080225d8e5 Add File Manager Stream for Summary Specification
This commit introduces a new OutputStream class for representing the
summary specification file (.SMSPEC).  The stream is constructed
with constant data (output directory, basename, start date &c), and
provides a single write() member function that outputs a summary
specification.

Each call to write rewinds the underlying stream's output position.
Class EclOutput grants friendship to the new output stream class in
order to support easy stream rewinding.

Add a unit test to exercise the new class.
2019-10-03 10:04:10 +02:00
Joakim Hove
37203833b3 Merge pull request #1066 from bska/uncouple-table-linearisation
Decouple Table Linearisation from LibECL
2019-10-03 09:46:22 +02:00
Bård Skaflestad
c01dae67f9 Decouple Table Linearisation from LibECL
This commit makes the table linearisation code independent of
LibECL's "ecl_kw_magic.h" header.  In particular, we add a new set
of vector items (tabdims.hpp) that describe the items we currently
define and reimplement the member functions of the 'Tables' class in
terms of these items.

Update the unit test accordingly.
2019-10-02 23:11:56 +02:00
Joakim Hove
b8cfa8be68 Merge pull request #1064 from joakim-hove/W
Add remaining W keywords
2019-10-02 19:31:00 +02:00
Joakim Hove
b28540c57f Merge pull request #1065 from joakim-hove/python-link-zlib
Link to zlib in setup.py libraries
2019-10-02 19:24:28 +02:00
Joakim Hove
1aa4685b62 Link to zlib in setup.py libraries 2019-10-02 18:42:23 +02:00
Joakim Hove
0d31e87072 Merge pull request #1063 from stefoss23/add_keywords_G1
Adding keywords beginning w/ G and H.
2019-10-02 16:52:46 +02:00
Joakim Hove
c1cb489106 Add remaining W keywords 2019-10-02 16:51:21 +02:00
Steinar Foss
c60032e227 added keywords beginning w/ G and H.
added keywords GSEPCOND, GSSCPTST, GSWING, GTADD.

added keywords GTMULT, GUIDECAL, GUPFREQ.

added keyword GWRTWC.

added keywords HALFTRAN, HMPROPS.

added keywords HAxxxxxx, HBNUM, HDISP.

added keywords HMADUCT, HMAQUFET, HMAQUNUM.

added keywords HDIMS, HMFAULTS, FMNLAQUN.

added keywords HMMLCTAW, HMMLFTAQ, HMMLTWCN.

added HMMULTFT, HMMULTXX.
2019-10-02 15:32:13 +02:00
Joakim Hove
d9916d6e50 Merge pull request #1062 from alfbr/log-consistent
Made Reading message consistent with other messages.
2019-10-02 15:28:16 +02:00
Alf Birger Rustad
19d12e7ba2 Made Reading message consistent with other messages. 2019-10-02 14:09:37 +02:00
Joakim Hove
ab14d99f0a Merge pull request #1061 from bska/remove-original-pvttable-linearisation
Table Linearisation: Remove Original PVT Functions
2019-10-02 07:46:48 +02:00
Bård Skaflestad
3db106dd5c Table Linearisation: Remove Original PVT Functions
This commit removes the original member functions

    void Tables::addPVTO()
    void Tables::addPVTW()
    void Tables::addPVTG()

since these are no longer needed.  The PVT tables are now defined in
terms of the 'addPVTTables()' member function

While here, also remove the fwrite() free function which was defined
in terms of LibECL types.

Update the unit test accordingly.
2019-10-02 00:47:35 +02:00
Joakim Hove
adebeba784 Merge pull request #1060 from joakim-hove/debug-msg
Modify warning message
2019-10-01 22:30:05 +02:00
Joakim Hove
44ae1fd574 Modify warning message 2019-10-01 21:12:18 +02:00
Joakim Hove
04eb33771c Merge pull request #1045 from joakim-hove/guide-rate-nnn
Guide rate nnn
2019-10-01 07:27:22 +02:00
Joakim Hove
78820654c7 Merge pull request #1057 from bska/uncouple-libecl
Make UnitSystem Independent of LibECL
2019-10-01 07:26:30 +02:00
Bård Skaflestad
c51842d65b Make UnitSystem Independent of LibECL
This commit decouples the UnitSystem class from the LibECL type
ert_ecl_unit_enum.  This, in turn, makes UnitSystem independent of
LibECL.

Update the unit test accordingly, and include <ert/util/util.h>
where needed.  This header was included transitively through
UnitSystem.hpp before.
2019-09-30 23:49:57 +02:00
Atgeirr Flø Rasmussen
51b3d14851 Merge pull request #1044 from joakim-hove/deck-sistate
DeckItem - use same store for both si and raw
2019-09-30 23:14:37 +02:00
Joakim Hove
650dd32274 Ensure that DeckItem is written raw in output 2019-09-30 19:08:06 +02:00
Joakim Hove
809177af03 Update DeckItem::equal() implementation
When the DeckItem::dval vector is used transparently for both raw values and SI
values the ::equal implementation must be aware of this.
2019-09-30 18:51:35 +02:00
Joakim Hove
6c34aee00e Use only one double vector in DeckItem 2019-09-30 18:51:35 +02:00
Joakim Hove
25f8ec6641 Merge pull request #1049 from bska/revised-summary-node
Decouple SummaryConfig Class From LibECL
2019-09-30 18:50:22 +02:00
Joakim Hove
c55c1799f6 Merge pull request #1053 from joakim-hove/W
Add W keywords up to WSEGTABL
2019-09-30 18:43:27 +02:00
Joakim Hove
6cdd4fd76f Protext against zero potential 2019-09-30 16:15:35 +02:00
Joakim Hove
3f83f2ed56 Fix bug 2019-09-30 16:15:24 +02:00
Tor Harald Sandve
f7b611afec various fixes to make guiderate work 2019-09-30 14:14:09 +02:00
Joakim Hove
a55f691581 Improvements to GuideRate 2019-09-30 14:14:09 +02:00
Joakim Hove
e738712ad5 GuideRateConfig class has a pointer to GuideRateModel 2019-09-30 14:14:09 +02:00
Bård Skaflestad
70daf0f2c8 Decouple SummaryConfig From LibECL
This commit reimplements the SummaryNode class in order not to use
the ecl::smspec_node class from LibECL.  Consequently, we remove
class SummaryConfig's binding to LibECL.

Class SummaryNode maintains the same information as before.  We also
implement a "named constructor" strategy to assign data members that
only make sense for a subset of the node categories.  The previous
member function 'type' is renamed to 'category' to identify the
attachment category (e.g., Well, Group, Field, Block, Region).  In
turn, we introduce a new 'type' member function to identify the
parameter kind (e.g, pressure, rate, cumulative total, well count)
represented by a given node.  We furthermore capture whether or not
the node is a user defined quantity (i.e., a UDQ).

We reimplement the keyword classifier operations that are currently
needed as free functions named 'is_*()' in SummaryConfig.cpp.

Note that in addition to the renamed member functions of class
SummaryNode, this commit also switches the summary key strategy for
block parameters.  Rather than capturing the 'ijk' values
individually as "BOSAT:3,3,6", we now store the equivalent global
(Cartesian) index (i.e., as "BOSAT:523").  Code that directly
constructs block parameter keys must be updated accordingly.

Chase the API change in the 'Summary' constructor and update unit
tests as needed.
2019-09-30 13:59:34 +02:00
Bård Skaflestad
dff62946dd Summary Config: Simplify Derivation of Maximum Number of Segments
Since switching to Well2 we no longer need a time loop to derive the
maximum number of segments in an MSW.
2019-09-30 13:27:32 +02:00
Bård Skaflestad
0a6dda5d6d Summary Config: Make 'is_udq' Predicate More Robust
In particular, don't classify 'RUNSUM' as a UDQ keyword.  Moreover,
restrict the known UDQ patterns to

    AU*, BU*, CU*, FU*, GU*, RU*, SU*, and WU*
2019-09-30 13:27:32 +02:00
Bård Skaflestad
d2db04ec13 Uncouple SummaryState from LibECL
This commit removes the member function

    void SummaryState::update(const ecl::smspec_node&, double)

and places an equivalent implementation into Summary.cpp's private
helper function namespace.  Doing so allows us to make the summary
state object independent of the 'libecl' library.
2019-09-30 13:27:32 +02:00
Joakim Hove
f799d7c6b9 Merge pull request #1055 from joakim-hove/rename-debug-class
Renamed DEBUG -> DEBUG_LEVEL
2019-09-30 12:57:14 +02:00
Joakim Hove
ce95cd5721 Renamed DEBUG -> DEBUG_LEVEL 2019-09-30 12:29:37 +02:00
Joakim Hove
4416721686 Merge pull request #1048 from stefoss23/deck_value
introduced new class DeckValue.
2019-09-30 10:16:13 +02:00
Steinar Foss
9c4ccd0ff6 DeckValue: DeckValueEnum as enum class. 2019-09-30 09:57:37 +02:00
Joakim Hove
4ca993400b Merge pull request #1052 from tskille/EGrid
Changed EGrid API, function getCellCorners.
2019-09-30 08:31:49 +02:00
Joakim Hove
1b63b8193b Add W keywords up to WSEGTABL 2019-09-30 08:13:18 +02:00
Steinar Foss
584f7ed5ca DeckValue: DeckValueEnum. 2019-09-29 20:12:57 +02:00
Steinar Foss
dc636e244c DeckValue: removed reset method. 2019-09-29 14:29:33 +02:00
Steinar Foss
7af66a6eab DeckValue: single arg constructors are explicit. 2019-09-29 14:20:02 +02:00
Torbjørn Skille
7b2a7aa419 Changed EGrid API, function getCellCorners. Changed from std::vector<double> to std::array<double,8> 2019-09-28 17:46:04 +02:00
Joakim Hove
3d3f315b0a Merge pull request #1050 from joakim-hove/keywords-V
Keywords v
2019-09-28 16:43:19 +02:00
Joakim Hove
fe99293f33 T keywords up to TRACTVD 2019-09-28 15:02:02 +02:00
Joakim Hove
c312c05732 Add T keywords up to TIGHTEN 2019-09-27 21:27:33 +02:00
Joakim Hove
b9fa2ec10d Add keywords on U 2019-09-27 21:27:33 +02:00
Joakim Hove
82a28a29bf Keywords on V 2019-09-27 21:27:20 +02:00
Joakim Hove
41a350ad23 Merge pull request #1047 from stefoss23/add_keywords_G
added keywords beginning w/ G only.
2019-09-27 20:57:16 +02:00
Steinar Foss
fd986cb397 DeckValue under namespace Opm. 2019-09-26 15:08:21 +02:00
Steinar Foss
af878ba229 introduced new class DeckValue.
added DeckValue.cpp.

completed DeckValue.
2019-09-26 14:12:05 +02:00
Steinar Foss
8c5ef89bd3 added keywords beginning w/ G only.
added keywords GCVD, GDCQ, GDCQECON.

added keywords GDIMS, GDRILPOT.

added keywords GETGLOB, GI.

added keywords GIMODEL, GINODE, GLIFTLIM.

added keywords GNETDP, GNETPUMP.

added keywords GRADGRUP, GRADRESV.

added keywords GRADRFT, GRADWELL, GRAVCONS.

added keywords GRAVDR, GRAVDRB, GRAVDRM.

keyword GRACONS set to size unlimited.

added keyword GRDREACH.

added keywords GRUPMAST, GRUPRIG.
2019-09-25 15:32:33 +02:00
Atgeirr Flø Rasmussen
0edd5c2207 Merge pull request #1035 from joakim-hove/equil-data
Changed EquilRecord to take SI values instead of DeckRecord
2019-09-24 08:28:17 +02:00
Joakim Hove
3f8a8f9de8 Merge pull request #1042 from joakim-hove/create_dkw
python: DeckKeyword constructor, w/ ParserKeyword arg.
2019-09-23 23:48:02 +02:00
Steinar Foss
11d1c7d634 python: DeckKeyword constructor, w/ ParserKeyword arg.
parserkeyword can create deckkeyword.

python parserkeyword: removed create_deckkeyword.

DeckKeyword: member parser_keyword is shared_ptr.

python DeckKeyword constructor.

python: no exposure of ParserKeyword.

DeckKeyword: shared_ptr<ParserKeyword> -> ParskerKeyword.

python/cxx/deck_keyword.cpp: cosntructor takes arg const ParskerKeyword&.

test_parser.py: simplified test_pyinut.

...
2019-09-23 23:27:03 +02:00
Joakim Hove
3229c343f7 Merge pull request #1010 from joakim-hove/python-context
Python context
2019-09-23 22:04:24 +02:00
Joakim Hove
9c96588f36 Changed EquilRecord to take SI values instead of DeckRecord 2019-09-23 21:44:59 +02:00
Joakim Hove
69ddffc966 Expose C++ objects to Python runtime 2019-09-23 21:31:45 +02:00
Bård Skaflestad
604c476554 Merge pull request #1041 from bska/fix-build-gcc49
Construct tuple<> Objects Explicitly
2019-09-23 19:01:34 +02:00
Bård Skaflestad
060fb59c57 Merge pull request #1040 from bska/index-out-of-bounds
Ensure ACTNUM Has Expect Number of Elements
2019-09-23 19:00:58 +02:00
Bård Skaflestad
d4ab231124 Construct tuple<> Objects Explicitly
Needed in GCC 4.9 due to incomplete standard library implementation
of class template tuple<>--especially its conditionally implicit
constructors.
2019-09-23 17:38:40 +02:00
Bård Skaflestad
c429a8a800 Ensure ACTNUM Has Expect Number of Elements 2019-09-23 17:32:52 +02:00
Joakim Hove
40570f1aba Merge pull request #1019 from joakim-hove/opmlog-python
Add Python wrapping for OpmLog
2019-09-23 16:54:18 +02:00
Atgeirr Flø Rasmussen
a5e897bdc7 Merge pull request #1039 from akva2/janitoring
fixed: remove unused variable
2019-09-23 15:59:32 +02:00
Atgeirr Flø Rasmussen
6100a90e49 Merge pull request #1009 from tskille/EclipseGrid2
ERT/libecl routines used in the EclipseGrid class has been replace by…
2019-09-23 15:55:28 +02:00
Arne Morten Kvarving
b41865d268 fixed: remove unused variable 2019-09-23 15:36:45 +02:00
Joakim Hove
a4c9b05000 Merge pull request #1032 from joakim-hove/deckitem-value-return
Misc small items
2019-09-23 15:03:48 +02:00
Joakim Hove
230c4494ed Add Python wrapping for OpmLog 2019-09-23 14:35:25 +02:00
Joakim Hove
883fb1a337 Merge pull request #1034 from stefoss23/python_replace_schedule
Python replace schedule
2019-09-23 14:22:35 +02:00
Joakim Hove
ca744afa27 Renamed the default dimension to "Dimensionless" 2019-09-21 20:47:46 +02:00
Joakim Hove
9eb0a01c7b Simplify ParserItem::dimensions() api 2019-09-21 20:47:46 +02:00
Joakim Hove
17c6d7dbad Remove unused DeckItem size hint 2019-09-21 19:24:05 +02:00
Joakim Hove
622a093315 Remove unused DeckItem constructor 2019-09-21 19:24:05 +02:00
Joakim Hove
388d0e99c3 The DeckItem::get() method returns a value 2019-09-21 19:24:05 +02:00
Joakim Hove
f3c065a899 Merge pull request #1033 from joakim-hove/dont-import-parserkeyword
Do not import ParserKeyword in Python
2019-09-21 18:13:39 +02:00
Steinar Foss
dd4cce4e9a python: removed group_tree. 2019-09-21 11:52:44 +02:00
Steinar Foss
0bc150794d python: Schedule bound directly by pybind11.
python: exposes Schedule.

python: added constructor for Schedule.

test_schedule: reintroduced most tests.

python test_schedule: all test works.

python test_wells. opened up some tests.

test_wells: opened up most.

test_wells.py ok.
2019-09-21 11:53:29 +02:00
Joakim Hove
f7a434f274 Do not import ParserKeyword in Python 2019-09-21 07:31:03 +02:00
Torbjørn Skille
34410cbe41 ERT/libecl routines used in the EclipseGrid class has been replace by new member functions. Grid properties are
calculated and stored as private data members in EclipseGrid.

The API for the class is unchanged except for some minor changes for exportACTNUM, exportZCORN and exportCOORD.

These changes have triggered some very few modifications in the opm-grid and opm-simulators repo.
2019-09-20 14:21:23 +02:00
Bård Skaflestad
c3b0dab6e5 Merge pull request #1030 from joakim-hove/summary-state-time
Add std::time start_time argument to SummaryState
2019-09-20 13:32:26 +02:00
Joakim Hove
b5ba3405af Merge pull request #1031 from bska/has-group-time-predicate
Schedule: Add Query For Particular Group at Particular Time
2019-09-20 10:33:18 +02:00
Bård Skaflestad
882ce83e91 Schedule: Add Query For Particular Group at Particular Time
This commit adds a new query method,

    bool Schedule::hasGroup(groupName, timeStep)

which report whether or not a particular named group exists at a
particular time step (zero-based report step index).  If this
function returns 'true', then it is always safe to call

    Schedule::getGroup2(groupName, timeStep)

with the same arguments.  Otherwise, the latter will throw an exception.

The new 'hasGroup' overload thus enables the same query types as the
existing 'hasWell' overload set.  The immediate use case for this
new overload is a reworking of the system for evaluating derived
summary parameters (e.g., FOPT or GGLR).

Add a new unit test to exercise the new overload.
2019-09-20 08:29:36 +02:00
Joakim Hove
a91c755194 Merge pull request #977 from bska/hookup-rft-writer
Hook New RFT File Writer up to Central ECLIPSE I/O Facility
2019-09-20 07:21:35 +02:00
Joakim Hove
727abd0907 Update DAY, MNTH and YEAR fields in SummaryState 2019-09-20 00:34:36 +02:00
Bård Skaflestad
f214c2cf0f Eclipse IO: Hook Up New RFT File Writer
This commit replaces the existing RFT file output defined in terms
of private class 'RFT' with the function RftIO::write().  While
here, also explicitly add requisite headers that were included only
transitively.
2019-09-19 22:31:45 +02:00
Joakim Hove
ff69737b99 Add start_time argument to SummaryState 2019-09-19 22:09:15 +02:00
Joakim Hove
ed5b8d0620 Merge pull request #1028 from stefoss23/py_install
setup.py: package_data: readjusted target and origin of libopmcommon.so
2019-09-19 22:07:40 +02:00
Steinar Foss
b1974db82c setup.py: package_data: readjusted target and origin of libopmcommon_python.so. 2019-09-19 14:14:55 +02:00
Joakim Hove
ae75aa3255 Merge pull request #1027 from stefoss23/add_keywords_F1
added keywords beginning w/ F and G.
2019-09-19 11:50:48 +02:00
Joakim Hove
4f276b896c Merge pull request #976 from bska/rft-through-eclio
Add New RFT File Writer
2019-09-18 21:59:17 +02:00
Bård Skaflestad
6c47cdb22f Add New RFT File Writer
This commit implements a new file writing function

    void Opm::RftIO::write()

that is intended to replace the current RFT output functionality
defined in terms of private class 'RFT' in EclipseIO.cpp.  We
support the basic RFT output consisting of

    - Timestamp (elapsed and date)
    - WELLETC metadata including all unit conventions
    - Connection cell (I,J,K), connection cell hostgrid (blank for
      main grid only), connection cell centre depth, connection cell
      pressure, and connection cell water and gas saturations

Connections in inactive cells are omitted.  Note that unit of
measure strings aren't implemented in terms of UnitSystem::name()
due to the strings being padded on the left for centering effect.

Add unit tests to exercise the new writer.
2019-09-18 16:48:53 +02:00
Bård Skaflestad
a281a3c6f4 Add RFT Output Stream
This commit introduces a new output stream, 'RFT', that is intended
as a new backend for writing RFT files.  At present this supports
integer, float, and PaddedOutputString<8> element types since those
are the types needed for basic RFT data.  We will extend the element
support if needed for PLT and/or Segment data.

We support formatted and unformatted output streams and distinguish
between opening a new stream and opening an existing output stream
(essentially between open modes ios_base::out and ios_base::app).

Add unit tests to exercise the possible combinations.
2019-09-18 16:48:53 +02:00
Joakim Hove
4388c9d72f Merge pull request #1015 from joakim-hove/actionx-restart
Actionx restart
2019-09-18 16:45:24 +02:00
Steinar Foss
897edca773 added keywords beginning w/ F and G.
added keywords FOAMFSO, FOAMFST, FOAMFSW.

added keywords FOAMMOBP.

added keywords FOAMOBS, FORMFEED.

added keywords GASBEGIN, GASCONC.

added keywords GASEND, GASFCOMP.

added keywords GASFDECR, GASFDELC.

added keywords GASFIELD, GASFTARG.

added keywords GASMONTH, GASPERIO.

added keywords GASSATC, GASYEAR.

added keyword GCALECON.

added keywords GCONCAL, GCONENG.

added keyword GCONCAL.

keywords GASFCOMP, GCALECON: L*L*L -> GasSurfaceVolume.

FOAMFST: Density -> FoamDensity.
2019-09-18 15:49:58 +02:00
Joakim Hove
7d32890d99 Merge pull request #1025 from atgeirr/add-clang-format-spec
Add .clang-format specification.
2019-09-18 15:34:39 +02:00
Joakim Hove
4bed60df0f Merge pull request #1024 from akva2/janitoring
Some janitoring
2019-09-18 15:28:30 +02:00
Atgeirr Flø Rasmussen
93e4c2ffec Add .clang-format specification. 2019-09-18 14:15:21 +02:00
Arne Morten Kvarving
6bbf1fcde2 remove unused UDQParams member in UDQContext 2019-09-18 13:21:00 +02:00
Arne Morten Kvarving
93439cf41e quell shadowing warnings 2019-09-18 13:21:00 +02:00
Arne Morten Kvarving
8c874bf741 fixed: move file into correct directory 2019-09-18 13:21:00 +02:00
Arne Morten Kvarving
0e108311e3 changed: disable unused function
kept around as it is handy for debugging
2019-09-18 13:20:43 +02:00
Arne Morten Kvarving
d2aaff46e0 Merge pull request #1018 from tskille/convertECL
convertECL update, fixed bug with file extensions
2019-09-18 10:33:26 +02:00
Joakim Hove
8a88d64bd1 Merge pull request #1023 from joakim-hove/guiderate-warnings
Fix GuideRate warnings
2019-09-17 19:37:51 +02:00
Joakim Hove
d1fd6359af Merge pull request #1022 from joakim-hove/check-CC-env-variable
Check CC environment variable
2019-09-17 16:56:47 +02:00
Joakim Hove
2b75ff1c19 Fix GuideRate warnings 2019-09-17 16:52:34 +02:00
Joakim Hove
b7459231d2 Check CC environment variable 2019-09-17 14:18:36 +02:00
Joakim Hove
143d0d097a Merge pull request #1012 from joakim-hove/parser-value-semantics
Use ParserKeyword values in Parser instead std::unique_ptr<>
2019-09-17 13:53:46 +02:00
Tor Harald Sandve
efe7a97b1d Merge pull request #994 from joakim-hove/guide-rate
GuideRateConfig object
2019-09-17 13:12:24 +02:00
Joakim Hove
18ead60ccc Merge pull request #1020 from joakim-hove/W
W keywords up to WSEGAICD
2019-09-16 22:49:32 +02:00
Joakim Hove
f9a2c02c5e W keywords up to WSEGAICD 2019-09-16 21:45:29 +02:00
Joakim Hove
f375213d4b Merge pull request #1017 from tskille/EclFile
Ecl file
2019-09-16 18:37:33 +02:00
Joakim Hove
a1f35584a9 Add GuideRate state/cache object 2019-09-16 16:28:45 +02:00
Joakim Hove
dd609e857a Add keywords LINCOM and LCUNIT 2019-09-16 16:28:45 +02:00
Torbjørn Skille
8664ce4af7 convertECL update, fixed bug with file extensions when converting from formatted to binary 2019-09-16 15:02:21 +02:00
Torbjørn Skille
0c526b39f5 EclFile update, fix on reading CHAR type from formatted eclfile 2019-09-16 14:02:42 +02:00
Joakim Hove
de7752b3e5 GuideRateConfig object 2019-09-16 10:52:35 +02:00
Atgeirr Flø Rasmussen
48aba21941 Merge pull request #1016 from joakim-hove/deck-constructor
Deck constructor
2019-09-16 08:59:20 +02:00
Joakim Hove
3070bf4a31 Change DeckKeyword constructor
The DeckKeyword::DeckKeyword(const std::string&) constructor has been removed
and the DeckKeyword now requires a ParserKeyword pointer in the constructor.
2019-09-16 00:47:34 +02:00
Joakim Hove
c8919ba088 Fix typo in NLINEARS keyword 2019-09-16 00:29:31 +02:00
Joakim Hove
4078451840 Action::Condition has lhs and rhs member properties 2019-09-14 08:26:51 +02:00
Joakim Hove
1a23df1e2f Merge pull request #1013 from stefoss23/properties_py_decap
Replace python class EclipseState
2019-09-14 08:23:55 +02:00
Joakim Hove
8efe3cf6a6 Remove unused member Condition::expression 2019-09-13 19:24:53 +02:00
Joakim Hove
546cd46926 Add cmp_string() method to Action::Condition class 2019-09-13 19:22:02 +02:00
Joakim Hove
74291cc57f Merge pull request #1014 from joakim-hove/w
W keywords including WPOTCALC
2019-09-13 19:05:11 +02:00
Joakim Hove
fd0cb01957 Add W keywords - up to WPOTCALC 2019-09-13 18:40:48 +02:00
Joakim Hove
f3bd813f46 Use ParserKeyword values in Parser instead std::unique_ptr<> 2019-09-13 16:21:31 +02:00
Steinar Foss
b957ca6a69 opm.io.ecl_state: unexposes constructor free classes. 2019-09-13 16:17:35 +02:00
Steinar Foss
b68fe2e63a test_state2: added test_config. 2019-09-13 16:17:35 +02:00
Steinar Foss
c826e24607 test_props: uncommented tests. 2019-09-13 16:17:35 +02:00
Steinar Foss
41a05a7a98 test_state.py: uncommented test_summary. 2019-09-13 16:17:35 +02:00
Steinar Foss
4504b8812f test_state2. added function test_jfunc. 2019-09-13 16:17:35 +02:00
Steinar Foss
365fbd355b test_state2: added test_faults. 2019-09-13 16:17:35 +02:00
Steinar Foss
78ab86e2a3 test_state2.py: added test_tables. 2019-09-13 16:17:35 +02:00
Steinar Foss
0ae8c4b235 python grid: properties as small cap. 2019-09-13 16:17:35 +02:00
Steinar Foss
3ecb446c20 test_state2: added test_simulation. 2019-09-13 16:17:35 +02:00
Steinar Foss
97728e9fda test_state2.py: added test_grid. 2019-09-13 16:17:35 +02:00
Steinar Foss
af096fddf9 test_state2: added test_state_nnc. 2019-09-13 16:17:35 +02:00
Steinar Foss
0257528ea9 test_state2: added test_repr_title. 2019-09-13 16:17:35 +02:00
Steinar Foss
fcca1fa823 python EclipseState: added constructor. 2019-09-13 16:17:35 +02:00
Steinar Foss
7fc7a8f0ba python class Sunbeamstate: remove state. 2019-09-13 16:17:35 +02:00
Steinar Foss
15d70c446f properties.py: removed class EclipseState. 2019-09-13 16:17:35 +02:00
Steinar Foss
b97503d34d exposed class TableManager as Tables. 2019-09-13 16:17:35 +02:00
Steinar Foss
c01d3b0139 propertes.py: removed Tables. 2019-09-13 16:17:35 +02:00
Steinar Foss
7811054029 properties.py: EclipeState: removed faults. 2019-09-13 16:17:35 +02:00
Steinar Foss
e1bffe7b3d python: exposed class Eclipse3DProperties. 2019-09-13 16:17:35 +02:00
Steinar Foss
525dfdcd69 properties.py: removed Eclipse3DProperties. 2019-09-13 16:17:35 +02:00
Steinar Foss
369a99a64a python: exposed class EclipseGrid. 2019-09-13 16:17:35 +02:00
Steinar Foss
d5e0d72f0f properties.py: removed class EclipseGrid. 2019-09-13 16:17:35 +02:00
Joakim Hove
6dee117f55 Merge pull request #1011 from joakim-hove/python-namespace
Python namespace
2019-09-13 10:05:29 +02:00
Joakim Hove
d2ff536cf3 Renamed python/cxx/common -> python/cxx/export 2019-09-13 09:40:13 +02:00
Joakim Hove
f264c358e7 Placed the Python cxx wrapping in namespace python::common 2019-09-13 09:22:49 +02:00
Joakim Hove
edf6440113 Merge pull request #1007 from stefoss23/add_keywords_F
Add keywords F
2019-09-13 07:30:24 +02:00
Joakim Hove
ab51fce599 Merge pull request #1008 from joakim-hove/remove-invalid-keyword
Will not attempt to internalize invalid keywords
2019-09-12 13:50:06 +02:00
Joakim Hove
f7d4ba037d Will not attempt to internalize invalid keywords 2019-09-12 13:21:37 +02:00
Steinar Foss
77d6cb24ad keyword FOAMFCN as 'special'. 2019-09-12 12:00:55 +02:00
Steinar Foss
4000b3226b added keywords FOAMDCYO, FOAMDCYW. 2019-09-12 11:54:24 +02:00
Steinar Foss
1e10398b52 added keyword FMTHMD. 2019-09-12 11:37:19 +02:00
Steinar Foss
b07632ee50 added keyword FLUXREG. 2019-09-12 11:30:17 +02:00
Steinar Foss
bd18a82ae3 added keywords FIPNUM, FIPSEP. 2019-09-12 11:06:13 +02:00
Steinar Foss
a0f05b380b FIP as 'special' kw. 2019-09-12 10:21:34 +02:00
Steinar Foss
b15b0bbec7 added keyword FHERCHBL. 2019-09-12 10:04:38 +02:00
Steinar Foss
832a3222fb added keywords NNEWTF. 2019-09-12 09:53:52 +02:00
Steinar Foss
377513fec9 added keywords EXTREPGL, FBHPDEF. 2019-09-12 09:42:34 +02:00
Steinar Foss
7ad764f92f added keywords EXTHOST. 2019-09-12 09:16:34 +02:00
Joakim Hove
6676eb9953 Merge pull request #984 from joakim-hove/python-runtime
Python runtime
2019-09-11 23:23:40 +02:00
Joakim Hove
7dce180581 Merge pull request #1006 from stefoss23/add_keywords_E
Add keywords E
2019-09-11 23:21:49 +02:00
Steinar Foss
a88c1d0513 added keyword ENDDYN, EXCAVATE, ESSNODE, EQLZCORN, EPSDEBUG, EPSDBGS, ENSPCVD, ENPCVD, EHYSTRR, ENDDYN.
added keyword EHYSTRR.

added keyword ENPCVD.

added keyword ENSPCVD.

added keyword EPSDBGS.

added keyword EPSDEBUG.

added keyword EQLZCORN.

added keyword ESSNODE.

added keyword EXCAVATE.

added keyword EXTFIN.

...
2019-09-11 15:12:46 +02:00
Steinar Foss
58bca59892 added keywords DZNET, ECLMC, EDITNNCR 2019-09-10 11:11:45 +02:00
Joakim Hove
5267c07444 Merge pull request #1004 from joakim-hove/keywords-W
Add W keywords - including WNETCTRL
2019-09-10 09:31:28 +02:00
Joakim Hove
ad96affbbf Add W keywords - including WNETCTRL 2019-09-10 07:32:02 +02:00
Joakim Hove
c8e09ff751 Merge pull request #1001 from joakim-hove/add-parserkeyword-member
Add ParserKeyword member to DeckKeyword
2019-09-09 16:00:14 +02:00
Arne Morten Kvarving
16d38c3245 fix python link for dependents 2019-09-09 11:16:58 +02:00
Arne Morten Kvarving
97ad4baa99 quell warnings 2019-09-09 11:16:58 +02:00
Joakim Hove
690cf8c43b Pass -DOPM_ENABLE_EMBEDDED_PYTHON when building for tests 2019-09-09 11:16:55 +02:00
Joakim Hove
15c2e69e9f Add ParserKeyword member to DeckKeyword 2019-09-09 11:12:59 +02:00
Joakim Hove
058cefeafa Merge pull request #1000 from joakim-hove/actionx-cmp
Accept <= and >= in the ActionX::Condition
2019-09-09 11:10:05 +02:00
Joakim Hove
e7639f77d0 Merge pull request #1003 from akva2/remove_disabled_ctest_option
changed: remove ADD_DISABLED_CTEST option
2019-09-09 11:08:07 +02:00
Joakim Hove
ab2ea1acf3 Add basic manager class fro Python interpreter 2019-09-09 10:58:26 +02:00
Arne Morten Kvarving
1edf46ffd1 changed: remove ADD_DISABLED_CTEST option
a disabled test is disabled. end of story.
2019-09-09 10:42:29 +02:00
Atgeirr Flø Rasmussen
1c6e5f5099 Merge pull request #1002 from akva2/remove_option
remove unused opm-common module specific OPM_PREFIX_PATH option
2019-09-09 10:38:21 +02:00
Arne Morten Kvarving
5ad0c66f55 remove unused opm-common module specific OPM_PREFIX_PATH option 2019-09-09 09:31:39 +02:00
Joakim Hove
04239afc03 Remove debug output 2019-09-07 18:19:01 +02:00
Joakim Hove
6683ac1be6 Accept <= and >= in the ActionX::Condition 2019-09-07 18:17:05 +02:00
Joakim Hove
49d61cb4f6 Merge pull request #999 from stefoss23/PYINPUT
Can extract parserkw's in python.
2019-09-06 23:22:26 +02:00
Steinar Foss
318d396adc Parserkeyword property -> name/ ParserKW -> ParserKeyword. 2019-09-06 22:50:25 +02:00
Arne Morten Kvarving
5455bc8425 Merge pull request #998 from akva2/quell_pythonpath_exception
fixed: quell exception if PYTHONPATH env var is nonexistent
2019-09-06 16:00:35 +02:00
Steinar Foss
ff79a404be Can extract parserkw's in python.
added keyword PYINPUT.

added pythonclass ParserKW.

python acces to ParserKW.

removed wrong kw PYINPUT.

...
2019-09-06 15:40:31 +02:00
Arne Morten Kvarving
1c988dc721 fixed: quell exception if PYTHONPATH env var is nonexistent 2019-09-06 14:57:52 +02:00
Joakim Hove
7577e6d851 Merge pull request #997 from atgeirr/check-file-streamlog
Make StreamLog throw if it fails to open file.
2019-09-06 13:41:57 +02:00
Joakim Hove
7c2a2e574d Merge pull request #996 from joakim-hove/keywords-W
W keywords up to an including WFRICTNL
2019-09-06 13:26:32 +02:00
Atgeirr Flø Rasmussen
752a9e2501 Make StreamLog throw if it fails to open file. 2019-09-06 13:11:54 +02:00
Joakim Hove
2c8d827945 W keywords up to an including WFRICTNL 2019-09-06 11:18:58 +02:00
Joakim Hove
cf9744ff1f Merge pull request #995 from stefoss23/remove_py_class_EclipseConfig
Remove py class eclipse config
2019-09-06 10:39:44 +02:00
Steinar Foss
132fc1ff1b moved pyclass EclipseConfig to ecl_state. 2019-09-06 09:42:46 +02:00
Steinar Foss
6dfab9c621 added new python test state2. 2019-09-06 09:13:30 +02:00
Steinar Foss
dedc74f299 exposed cxx class EclipseConfig to python dir. via pybind11. 2019-09-06 09:05:02 +02:00
Joakim Hove
11eb0049da Merge pull request #973 from stefoss23/add_keywords_D1
Add keywords D1
2019-09-06 07:24:00 +02:00
Joakim Hove
753d6dcb92 Merge pull request #992 from atgeirr/add-missing-include
Add missing include.
2019-09-06 06:40:50 +02:00
Joakim Hove
db6b5d2502 Merge pull request #991 from bska/fix-nwgmax-check
Fix ArrayDimsChecker's Maximum Group Size (WELLDIMS) Check
2019-09-05 22:58:37 +02:00
Steinar Foss
ad50a22ed7 removed python class EclipseConfig. 2019-09-05 21:05:19 +02:00
Steinar Foss
e0ff18ee09 added kw DIFF(deck_names), DIFFCOAL, DEPTHTAB, CSKIN, COMPVEL, COMPRPL, COMPRP, COMPVE, COMPDATX(deck_names).
added keywords COMPRP, COMPVE.

added keyword COMPRPL.

added keyword COMPVEL.

addded keyword CSKIN.

added keyword DEPTHTAB.

added keyword DIFFCOAL.

added deck_names DIFF.

...

...
2019-09-05 13:54:51 +02:00
Atgeirr Flø Rasmussen
1588f3227e Add missing include. 2019-09-05 13:52:42 +02:00
Bård Skaflestad
f813a04269 Consider Node Group Size When Calculating Maximum Group Size
This commit extends the 'maxGroupSize' function to also consider the
sizes of node groups (i.e., the number of child nodes/child groups)
when determining what the largest group size is on a particular step.

Add a unit test to demonstrate.
2019-09-05 13:36:35 +02:00
Bård Skaflestad
705be62be6 ArrayDimChecker Unit Test: Refactor ParseContext Update
This commit adds a little helper function to simplify assigning the
same InputError::Action to all WELLDIMS-related contexts.
2019-09-05 13:32:18 +02:00
Joakim Hove
7a3b693471 Merge pull request #986 from joakim-hove/python-parser
Python parser
2019-09-05 10:49:07 +02:00
Joakim Hove
08c5e342b2 Merge pull request #987 from joakim-hove/overload-sans-error-guard
Add Parser::parseFile(fname, parseContext) overload
2019-09-05 10:48:22 +02:00
Joakim Hove
7984d2a0f4 Expose the Parser class properly to Python 2019-09-05 08:44:47 +02:00
Joakim Hove
1d8f07fe62 Rename parser/parser.py -> parser/parser_module.py 2019-09-05 08:44:47 +02:00
Joakim Hove
723113b3b9 Add small shell script templates to simplify Python development 2019-09-05 08:44:47 +02:00
Joakim Hove
922afa26c4 Merge pull request #985 from akva2/janitoring
Some janitoring
2019-09-05 08:40:54 +02:00
Joakim Hove
41bd1eb449 Add missing const to Parser methods 2019-09-05 08:14:55 +02:00
Joakim Hove
17e6599749 Add Parser overloads without ErrorGuard 2019-09-05 07:42:13 +02:00
Joakim Hove
c54639fc34 Merge pull request #935 from joakim-hove/parse-python
Started to parse Python code
2019-09-04 23:09:43 +02:00
Joakim Hove
74baa18cd9 Merge pull request #972 from joakim-hove/class-enum
Move Well status enum to Well2 class
2019-09-04 16:29:18 +02:00
Joakim Hove
807fa9ecdb Add keyword PYINPUT 2019-09-04 15:20:13 +02:00
Joakim Hove
4073722771 Basic support for parsing verbatim keywords with code 2019-09-04 15:20:13 +02:00
Joakim Hove
8553bbf326 Remove ScheduleEnum files 2019-09-04 14:49:12 +02:00
Joakim Hove
7bdd294ec5 Refactor Well GuideRateTarget enum 2019-09-04 14:49:12 +02:00
Joakim Hove
ee26316f92 Refactor Group GuideRateTarget enum 2019-09-04 14:49:12 +02:00
Joakim Hove
af72086db8 Refactor enum for GuideRate target 2019-09-04 14:49:12 +02:00
Joakim Hove
e026660c80 Move / refactor Group production control enum 2019-09-04 14:49:12 +02:00
Joakim Hove
0296759ad0 Move GroupType enum to Group2 2019-09-04 14:49:12 +02:00
Joakim Hove
9d442d3d4f Refactor Group injection enum 2019-09-04 14:49:12 +02:00
Joakim Hove
5d5bcf6f24 Refactor enum exceed action 2019-09-04 14:49:12 +02:00
Joakim Hove
9690588dd4 Refactor enums for Segments 2019-09-04 14:49:12 +02:00
Joakim Hove
7021669758 Remove enum WellQueryMode 2019-09-04 14:49:12 +02:00
Joakim Hove
3c22559849 Refactor OilVap enum 2019-09-04 14:49:12 +02:00
Joakim Hove
5965b194df Refactor RFT enums 2019-09-04 14:49:12 +02:00
Joakim Hove
a449636dde Enum refactor EconLimits 2019-09-04 14:49:12 +02:00
Joakim Hove
9e6f8bd1c1 Move well production control enum to Well2 2019-09-04 14:49:12 +02:00
Joakim Hove
a2fc480e16 Move enum CompletionOrder to Connection class 2019-09-04 14:46:58 +02:00
Joakim Hove
15e192876e Move direction enum to Connection class 2019-09-04 14:46:58 +02:00
Joakim Hove
dcf4347aee Moved connection state enum to Connection class 2019-09-04 14:46:58 +02:00
Joakim Hove
82accba45b Move injection control enum to Well2 class 2019-09-04 14:46:58 +02:00
Joakim Hove
22a9ffa7d9 Move Injection properties inside Well2 class 2019-09-04 14:46:58 +02:00
Joakim Hove
a7c5483b0f Move Well status enum to Well2 class 2019-09-04 14:46:58 +02:00
Atgeirr Flø Rasmussen
be795af931 Merge pull request #979 from joakim-hove/actionx-dynamic
Convert Schedule::Actions to a DynamicState<Actions>
2019-09-04 14:25:06 +02:00
Steinar Foss
4cce5f5f1c keyword_list.cmake: added record of 'special' keywords. 2019-09-03 23:06:12 +02:00
Steinar Foss
3e1822770d added keywords DZMATRIX, DZMTRX, DZMTRXV. 2019-09-03 23:06:12 +02:00
Steinar Foss
f124fc692f added keyword DYNRDIMS. 2019-09-03 23:06:12 +02:00
Steinar Foss
dc26fd6364 added keywords DUALPORO, DUMPCUPL. 2019-09-03 23:06:12 +02:00
Steinar Foss
80afcd852f added keywords DRILPRI, DSDPEINT, DUALPERM. 2019-09-03 23:06:12 +02:00
Steinar Foss
17e5e3fec3 added keywords DPGRID, DPKRMOD, DPNUM. 2019-09-03 23:06:12 +02:00
Steinar Foss
ab235a1eae added keywords DIMPES, DISPERSE, DOMAINS. 2019-09-03 23:06:12 +02:00
Steinar Foss
974fef2c44 modified kw DIFFC, added keywords DIMPLICT, DISPDIMS. 2019-09-03 23:06:12 +02:00
Steinar Foss
440049ab6c added keywords DIFFX, DIFFY, DIFFZ. 2019-09-03 23:06:12 +02:00
Steinar Foss
6cdae955d2 added keywords DIFFR, DIFFTHT, DIFFUSE. 2019-09-03 23:06:12 +02:00
Joakim Hove
af2a09bde5 Make sure actionx keywords can be redefined 2019-09-03 13:47:30 +02:00
Joakim Hove
2aa10a0435 Internalize ActionX conditions to enable restart 2019-09-03 13:47:30 +02:00
Joakim Hove
208c1a7143 Convert Schedule::Actions to a DynamicState<Actions> 2019-09-03 13:47:30 +02:00
Joakim Hove
12a8656647 Changed Actions::at() to const 2019-09-03 13:46:02 +02:00
Joakim Hove
de5246c701 Add DeckKeyword::location() 2019-09-03 13:46:02 +02:00
Arne Morten Kvarving
c0c6f35099 fixed: use of iterator after erase 2019-09-03 12:33:11 +02:00
Arne Morten Kvarving
8d858903f1 changed: reduce scope of variable 2019-09-03 12:28:29 +02:00
Joakim Hove
fa964b5820 Merge pull request #983 from joakim-hove/welldims-exception
Default error handler for WELLDIMS errors is exception
2019-09-02 10:15:58 +02:00
Joakim Hove
dad13d2633 Default error handler for WELLDIMS errors is exception 2019-08-31 15:23:02 +02:00
Joakim Hove
6b2aadaef7 Merge pull request #981 from totto82/nupcol
support nupcol
2019-08-31 07:27:51 +02:00
Joakim Hove
ec36c227d7 Merge pull request #982 from akva2/fix_negative_index_deref
fixed: dereferencing string at index -1 is not adviced.
2019-08-30 19:09:13 +02:00
Arne Morten Kvarving
d097660fcc fixed: dereferencing string at index -1 is not adviced.
if there is no dot, p is -1 which leads to an exception thrown
2019-08-30 14:59:58 +02:00
Tor Harald Sandve
09b445f69d support nupcol 2019-08-30 13:07:13 +02:00
Arne Morten Kvarving
8ef902bee5 Merge pull request #980 from bska/fix-nightly
RFT Unit Test: Use Actual 'BOOST_FAIL' Macro
2019-08-30 11:36:38 +02:00
Bård Skaflestad
38b6451c73 RFT Unit Test: Use Actual 'BOOST_FAIL' Macro
BOOST_TEST_FAIL was a figment of my imagination.
2019-08-30 09:39:15 +02:00
Joakim Hove
ec250f19f8 Merge pull request #974 from bska/rft-utest-through-erft
Reimplement RFT Unit Test in Terms of 'ERft' Class
2019-08-29 17:10:37 +02:00
Bård Skaflestad
f0adb01941 Reimplement RFT Unit Test in Terms of 'ERft' Class
This commit switches the `test_RFT` unit test to using the `ERft`
class introduced in commit 24a8efb2 (PR #699).  This is the first
step towards reimplementing the RFT file output in terms of class
EclOutput.  The downside to doing this is that we can no longer use
the node-based queries of libecl and have to implement a wrapper on
top of the raw vectors to be able to ask for the pressure in a given
connection's cell.
2019-08-29 09:24:31 +02:00
Joakim Hove
a69b0bd06f Merge pull request #978 from joakim-hove/ACTDIMS
Add micro class to contain information from ACTDIMS keyword
2019-08-29 07:14:52 +02:00
Joakim Hove
07b2f47c7d Add micro class to contain information from ACTDIMS keyword 2019-08-28 23:22:02 +02:00
Bård Skaflestad
a7956bcf31 Merge pull request #975 from joakim-hove/icon-bug
Correct ICON and SCON when flow has deacivated connection cell
2019-08-28 12:10:28 +02:00
Joakim Hove
aa9ed7a995 Correct ICON and SCON when flow as deacivated connection cell 2019-08-27 22:00:10 +02:00
Joakim Hove
d06c0bfebb Merge pull request #971 from joakim-hove/python-reorg
Python reorg
2019-08-24 05:30:56 +02:00
Joakim Hove
c516f868e4 Slight reorganizing of Python tree 2019-08-23 19:15:51 +02:00
Atgeirr Flø Rasmussen
a9cff8f7a1 Merge pull request #970 from akva2/rename_ewoms
changed: rename ewoms to opm-models
2019-08-23 16:21:12 +02:00
Joakim Hove
8e8abee556 Renamed opm.parser -> opm.io 2019-08-23 11:24:15 +02:00
Joakim Hove
c0d95e01db Merge pull request #963 from tskille/EclFile
EclFile - improved ascii read efficiency
2019-08-23 11:16:03 +02:00
Joakim Hove
b00615d21f Merge pull request #968 from joakim-hove/guiderate-model
Adds GuideRateModel
2019-08-23 10:05:40 +02:00
Joakim Hove
16daa52fbc Merge pull request #969 from joakim-hove/w-kw
W keywords up to and including WELOPENL
2019-08-23 09:32:41 +02:00
Arne Morten Kvarving
41f18d718c changed: rename ewoms to opm-models 2019-08-23 08:29:28 +02:00
Joakim Hove
00661d6767 W keywords up to and including WELOPENL 2019-08-23 08:28:18 +02:00
Joakim Hove
44bedf0f23 Adds GuideRateModel 2019-08-23 08:21:14 +02:00
Joakim Hove
65f9fdec5c Merge pull request #966 from stefoss23/add_keywords_D
Add keywords D
2019-08-22 16:51:25 +02:00
Steinar Foss
611dc0b565 added keywords DIFFMX, DIFFMY, DIFFMZ. 2019-08-22 15:26:12 +02:00
Steinar Foss
eb30af2b11 added keywords DIFFMMF, DIFFMR, DIFFMTHT. 2019-08-22 15:26:12 +02:00
Steinar Foss
31357cf40d added keywords DIAGDISP, DIFFC, DIFFDP. 2019-08-22 15:26:12 +02:00
Steinar Foss
3a15a16848 added keywords DELAYACT. 2019-08-22 15:26:12 +02:00
Steinar Foss
19ca93f227 added keywords DATUMR, DATUMRX, DCQDEFN. 2019-08-22 15:26:12 +02:00
Joakim Hove
ba34a9fed0 Merge pull request #961 from stefoss23/GUIDE_RATE
WIP: kw GCONPROD: reads GUIDE_RATE.
2019-08-22 13:28:19 +02:00
Steinar Foss
7f484b736d ScheduleTests: removed whitespace. 2019-08-22 12:15:42 +02:00
Steinar Foss
30b44ef233 SheduleEnums: GuideRateDef as enum class.
...
2019-08-22 12:00:50 +02:00
Joakim Hove
c7497497f6 Merge pull request #964 from joakim-hove/add-gpmaint
Add JSON keyword WSEGVALV
2019-08-22 11:08:41 +02:00
Joakim Hove
df4e94e351 Merge pull request #954 from joakim-hove/rawkeyword-partial
Rawkeyword + Parser: simplifications
2019-08-22 11:08:17 +02:00
Joakim Hove
f7b50a97f7 Add JSON keyword WSEGVALV 2019-08-22 10:47:19 +02:00
Torbjørn Skille
6f7d45750f changed from int to size_t for index. Changed loading of all data, reading data from disk array by array 2019-08-22 10:28:13 +02:00
Joakim Hove
e5013125f1 Refactor initial parsing stage
- Reduced the amount of state in the RawKeyword and ParserState classes.
 - RawKeyword class has normal constructor - remove init method.
 - The Rawxxx symbols are module private and the header files are not installed.
 - Removed several unused static methods from Rawxxx and ParserKeyword.
2019-08-22 09:32:11 +02:00
Steinar Foss
9a6065509b kw GCONPROD: GUIDE_RATE_DEF INJ, POTN, FORM handled as warning.
added enum guide_ref_enum.

...

field.

.tt
2019-08-21 12:46:50 +02:00
Joakim Hove
441b065b3d Merge pull request #962 from joakim-hove/empty__init
Emptied the opm/__init__.py file and create opm.parser package
2019-08-20 16:19:59 +02:00
Torbjørn Skille
6d79ab4715 EclFile - improved ascii read efficiency 2019-08-20 13:37:22 +02:00
Joakim Hove
86b7d4406e Merge pull request #933 from joakim-hove/parser-print-progress
Add log message with parsing progress
2019-08-19 16:52:58 +02:00
Joakim Hove
7e775ecd17 Emptied the opm/__init__.py file and create opm.parser package 2019-08-19 16:01:19 +02:00
Steinar Foss
6e93c5ee1f kw GCONPROD: reads GUIDE_RATE.
group2: production_properties: added guide_rate.

..

GCONPROD reads meaningless GUIDE_RATE.

guide_rate_def.

..2

...
2019-08-19 15:41:32 +02:00
Arne Morten Kvarving
d6cbf47e38 Merge pull request #940 from akva2/parallel_tests_in_check_target
Execute tests in parallel for the 'check' target
2019-08-19 13:51:23 +02:00
Atgeirr Flø Rasmussen
079cb5fd0b Merge pull request #960 from joakim-hove/rm-printf
Remove printf debug
2019-08-19 12:34:50 +02:00
Joakim Hove
6f7a6d47f2 Remove printf debug 2019-08-19 11:59:22 +02:00
Joakim Hove
a6eef07c76 Merge pull request #951 from stefoss23/sunbeam_to_opm
Sunbeam to opm
2019-08-19 09:57:42 +02:00
Joakim Hove
a961f38c63 Merge pull request #959 from joakim-hove/move-tests
Move tests
2019-08-18 15:30:04 +02:00
Joakim Hove
bc2e5f7d00 Moved test in filesystem 2019-08-18 13:21:04 +02:00
Joakim Hove
3846c8c7ab Moved ResinsightTest 2019-08-18 13:21:04 +02:00
Joakim Hove
e186761f4a Merge pull request #958 from joakim-hove/inline-resinsight-data
Inlined deck data for test
2019-08-17 12:57:34 +02:00
Joakim Hove
8efaa4dc66 Inlined deck data for test 2019-08-17 12:00:44 +02:00
Joakim Hove
bb6fb37ea1 Add log message with parsing progress 2019-08-16 19:50:23 +02:00
Joakim Hove
97a73ea5a5 Merge pull request #953 from joakim-hove/w-keywords
Add some W keywords
2019-08-16 17:44:10 +02:00
Joakim Hove
eee75da9ef Merge pull request #957 from stefoss23/add_keywords_c
Add keywords c
2019-08-16 16:30:42 +02:00
Steinar Foss
cb165fb418 removed keywords file CECONT. 2019-08-16 14:41:07 +02:00
Steinar Foss
c9420d1883 added keywords COMPRIV, COMPSEGL, COPYBOX, CRITPERM. 2019-08-16 14:25:08 +02:00
Steinar Foss
01f0beb8ca added keywords: COMPFLSH, COMPLMPL, COMPOFF. 2019-08-16 13:41:43 +02:00
Steinar Foss
7e62206481 added keywords COARSEN, COLLAPSE, COLUMNS. 2019-08-16 12:45:48 +02:00
Steinar Foss
3aefa3a953 added keywords COAL, COALADS, COALPP. 2019-08-16 11:54:33 +02:00
Joakim Hove
e32853808f Merge pull request #955 from joakim-hove/string_view_find_char
String view find char
2019-08-16 11:29:26 +02:00
Steinar Foss
10142b482e setup.py discontinue glob use. 2019-08-16 10:37:48 +02:00
Steinar Foss
522dee0a47 setuptools install PYTHONPATH circumvention. 2019-08-16 10:35:28 +02:00
Joakim Hove
659fb45d04 Changed string_view::substr() to take(from, len) arguments 2019-08-16 09:04:49 +02:00
Joakim Hove
cf6161ecfe Add method string_view::find( char ) 2019-08-16 09:04:49 +02:00
Joakim Hove
03b81d116f Add some W keywords 2019-08-15 17:05:06 +02:00
Steinar Foss
554ceb87dd setup.py will install python packages.
setup.py install to CMAKE_INSTALL_PREFIX.

cmake will create python install dir.
2019-08-15 17:00:43 +02:00
Joakim Hove
7e3ad77329 Merge pull request #952 from joakim-hove/rawkeyword-refactor
Rawkeyword refactor
2019-08-15 16:45:29 +02:00
Joakim Hove
31bb6a0164 Merge pull request #945 from joakim-hove/keywords-z
Keywords Z and W
2019-08-15 14:29:54 +02:00
Joakim Hove
4eb9d5d46a Remove ParserState member rawKeyword 2019-08-15 14:26:25 +02:00
Joakim Hove
4258bce6c5 Use reference instead of pointer 2019-08-15 13:39:33 +02:00
Joakim Hove
1d5326f664 Change std::shared_ptr -> std::unique_ptr 2019-08-15 13:23:21 +02:00
Joakim Hove
79a2c1bd4d Removed public property from RawKeyword class 2019-08-15 12:23:29 +02:00
Joakim Hove
e3ade4dff9 Use reference instead of pointer 2019-08-15 11:51:08 +02:00
Steinar Foss
36338c8a71 namespace sunbeam -> opmcommon_python. 2019-08-15 11:35:28 +02:00
Steinar Foss
c94ed2f643 renaming python/cxx/sunbeam*.* -> common *.* 2019-08-15 11:19:18 +02:00
Joakim Hove
5cd93cd702 Add some keywords on W 2019-08-15 11:13:23 +02:00
Joakim Hove
6dc4804a57 Add keyword ZIPP2OFF 2019-08-15 11:13:23 +02:00
Joakim Hove
d0634114c7 Add some this-> and an explicit throw for unrecognized dimension 2019-08-15 11:13:22 +02:00
Joakim Hove
ee482b9a5f Merge pull request #948 from joakim-hove/unit-system-api-energy
Add missing energy to unit system measure table
2019-08-15 11:07:01 +02:00
Steinar Foss
e25416c236 renamed python pkg sunbeam -> opm.
setup.py: test_suite -> tests_suite .

libsunbeam -> libopmcommon_python.

sunbeam -> opm: test_connection ok.

test_deck ok.

test_group_tree ok.

test_grupnet ok.

test_parse_deck.py ok.

test_parse.py ok.

python all tests ok.
2019-08-15 11:02:09 +02:00
Joakim Hove
c40eed027b Merge pull request #937 from joakim-hove/rawkeyword-minor
Remove superfluos check in RawKeyword assembly
2019-08-15 08:17:45 +02:00
Joakim Hove
bef36f6c0d Add missing energy to unit system measure table 2019-08-15 07:10:44 +02:00
Joakim Hove
1ff60496c6 Merge pull request #946 from atgeirr/remove-slow-call
Remove an unused call that is very slow.
2019-08-15 06:57:10 +02:00
Atgeirr Flø Rasmussen
b0ad018a74 Remove an unused call that is very slow. 2019-08-14 23:02:50 +02:00
Joakim Hove
f898d33e65 Merge pull request #876 from tskille/compareECL2
Update of compareECL - check output files for reference case
2019-08-14 16:31:16 +02:00
Joakim Hove
e79b546544 Merge pull request #938 from joakim-hove/gconprod-exceed-action
GCONPROD: The exceed action should be unconditionally set to RATE
2019-08-14 16:30:17 +02:00
Arne Morten Kvarving
1903b9517b Merge pull request #944 from tskille/compareECL
Updated with vector of back listed keywords. These keywords will not b…
2019-08-14 13:42:45 +02:00
Arne Morten Kvarving
d12426b9e8 Merge pull request #939 from akva2/parallel_tests
added: environment variable TESTTHREADS in build-opm-module.sh
2019-08-14 12:54:04 +02:00
Torbjørn Skille
d51c31634a Updated with vector of backlisted keywords. These keywords will not be checked.
This list contains only summary vector TCPU.

keywordsBlackList will work on all file types (INIT, UNRST, RFT and SMSPEC/UNSMRY)

wildcards (*) not supported
2019-08-14 12:25:38 +02:00
Steinar Foss
cbf477e502 keywords CECONT started. 2019-08-14 10:36:22 +02:00
Steinar Foss
51517ec6a3 Merge remote-tracking branch 'origin/add_keywords_C' into add_keywords_c 2019-08-14 10:01:17 +02:00
Joakim Hove
50902686b5 Merge pull request #936 from joakim-hove/string-view-methods
Add string_view::starts_with() and string_view::find() methods
2019-08-14 07:50:22 +02:00
Joakim Hove
2002be13e2 Remove unused method declaration 2019-08-14 07:41:57 +02:00
Joakim Hove
5103e7b604 Removed filename and keyword members from RawRecord 2019-08-14 07:34:56 +02:00
Joakim Hove
de107379a1 Return if final keyword in file is of type Raw::UNKNOWN 2019-08-14 07:34:56 +02:00
Joakim Hove
b70140dd4e Add newlines in if 2019-08-14 07:34:56 +02:00
Joakim Hove
ae27c8a9c6 Reorganized if ( ) testing slightly 2019-08-14 07:34:56 +02:00
Joakim Hove
1936f12356 Add small method RawKeyword::terminateRecord() 2019-08-14 07:34:56 +02:00
Joakim Hove
de19aca322 Remove superfluos check in RawKeyword assembly 2019-08-14 07:34:56 +02:00
Joakim Hove
f51420c6c6 Merge pull request #942 from akva2/improve_sunbeam_build
Improve sunbeam build
2019-08-13 19:36:33 +02:00
Joakim Hove
27ffc41361 Merge pull request #928 from jalvestad/udqrst-pull909
Output of UDQ properties to Eclipse compatible restart file
2019-08-13 19:33:50 +02:00
Arne Morten Kvarving
ca42ca5968 changed: use a custom output to avoid rebuilds
currently, the python bindings are built on every make invocation,
including the 'make install' command.

this improves on this situation by tracking whether or not the target
needs to be rebuilt through a custom output and dependencies.

the list of dependencies is not very pretty, but necessary when
linking two build systems like this.
2019-08-13 15:56:45 +02:00
Arne Morten Kvarving
86b1a93b0e fixed: clean python bindings with 'make clean' 2019-08-13 15:56:45 +02:00
Jostein Alvestad
84116a7d70 Merge remote-tracking branch 'upstream/master' into udqrst-pull909 2019-08-13 13:05:28 +02:00
Arne Morten Kvarving
7c15d79a93 changed: run tests in parallel with the 'check' target 2019-08-13 12:35:12 +02:00
Atgeirr Flø Rasmussen
eb1d00f9dc Merge pull request #941 from atgeirr/make-prodinjprops-public
Make two headers public again.
2019-08-13 12:28:35 +02:00
Atgeirr Flø Rasmussen
d20c58da07 Make two headers public again. 2019-08-13 11:56:17 +02:00
Arne Morten Kvarving
a1edb0a1f7 changed: simplify by using built-in support
use built-in support to obtain number of processor cores
instead of custom osx and linux code.
2019-08-13 11:33:43 +02:00
Jostein Alvestad
ff956e7aff Made changes to avoid compiler warnings, ref comments from akva2 2019-08-13 11:23:18 +02:00
Arne Morten Kvarving
377294316e added: environment variable TESTTHREADS in build-opm-module.sh
set this to run tests in parallel
2019-08-13 10:47:13 +02:00
Jostein Alvestad
1715565920 Merge pull request #6 from joakim-hove/remove-udqParam
Remove struct udqParam use existing class UDQParams
2019-08-13 08:26:08 +02:00
Joakim Hove
f467d05035 Remove struct udqParam use existing class UDQParams 2019-08-13 08:21:46 +02:00
Jostein Alvestad
02278912d6 Merge pull request #5 from joakim-hove/udq-output-fixup
Minor update to UDQ settings of DoubHEAD
2019-08-13 08:20:00 +02:00
Joakim Hove
3f773b956f Minor update to UDQ settings of DoubHEAD 2019-08-13 08:06:08 +02:00
Joakim Hove
4334256c5b GCONPROD: The exceed action should be unconditionally set to RATE 2019-08-12 17:28:47 +02:00
Jostein Alvestad
a3f74c19c4 WIP removed additional code that altered DoubHEAD data 2019-08-12 13:04:59 +02:00
Jostein Alvestad
d6d1dbd38b code changes to avoid changes in InteHead and DoubHead in Restart file 2019-08-12 13:04:57 +02:00
Jostein Alvestad
1a02bb105a Fixed group-group2 transition, disable Restart output 2019-08-12 13:04:55 +02:00
Jostein Alvestad
e3dc5e07d7 add code to output IUAP array 2019-08-12 13:04:53 +02:00
Jostein Alvestad
af811d2eaf WIP Added code to write InteHead and DoubHead data as well as IGPH to restart file,
Further added unit tests to the writing of UDQ data
2019-08-12 13:04:51 +02:00
Jostein Alvestad
083742c368 WIP changes to add first version of BOOST test for IUDQ 2019-08-12 13:04:50 +02:00
Jostein Alvestad
2bfad7ae37 minor correction for iuad[1] and for test_UDQ_x.cpp
Further work for making unit tests for UDQ restart data

WIP Further work unit tests

WIP some minor corrections
2019-08-12 13:04:48 +02:00
Joakim Hove
c8cd730d5c Refactor UDQActive - handles vanishing UDA 2019-08-12 13:04:47 +02:00
Joakim Hove
4cde3e7e44 More UDQ fixes 2019-08-12 13:04:45 +02:00
Joakim Hove
8416680368 Add UDQ test and input file 2019-08-12 13:04:44 +02:00
Joakim Hove
44ddd382a3 UAD usage hashing based on udqstring and controltype 2019-08-12 13:04:42 +02:00
Joakim Hove
79da1ba5eb Fix bug with size of IUAD array 2019-08-12 13:04:41 +02:00
Joakim Hove
a218a1c936 Remove unused arg 2019-08-12 13:04:40 +02:00
Joakim Hove
e00a32f75c Output use_index for IUAD 2019-08-12 13:04:38 +02:00
Joakim Hove
29c3310671 Fix IUAD input index 2019-08-12 13:04:37 +02:00
Joakim Hove
e02fa5d04f WIP 2019-08-12 13:04:35 +02:00
Jostein Alvestad
9eda0ee1b8 WIP - further code to output IGPH vector 2019-08-12 13:04:34 +02:00
Joakim Hove
0fb287b789 WIP 2019-08-12 13:04:32 +02:00
Joakim Hove
858e0b84cf Make sure UDQ DEFINE overwrite correctly 2019-08-12 13:04:31 +02:00
Joakim Hove
39346c3b97 Add UDQActive::get() method 2019-08-12 13:04:30 +02:00
Joakim Hove
bcfc8b4966 Add operator bool() to UDQActive 2019-08-12 13:04:28 +02:00
Joakim Hove
98338e3326 UDQInput: use correct input index 2019-08-12 13:04:27 +02:00
Joakim Hove
fadcddbc92 Use UDQInput class when creating restart file 2019-08-12 13:04:26 +02:00
Joakim Hove
1a79e811dd Add operator[] to UDQConfig class 2019-08-12 13:04:24 +02:00
Arne Morten Kvarving
1caca2df4a use maps 2019-08-12 13:04:23 +02:00
Joakim Hove
5e751bb26c Add unit to UDQInput class 2019-08-12 13:04:21 +02:00
Joakim Hove
520df29bd8 Add UDQIndex type to keep track of sequence number of variable types 2019-08-12 13:04:20 +02:00
Joakim Hove
354c20786d Add UDQVarTYpe member to UDQInput class 2019-08-12 13:04:18 +02:00
Joakim Hove
9e309375b6 Add size() method to UDQConfig 2019-08-12 13:04:17 +02:00
Jostein Alvestad
74d0703dc2 Output UDQ keywords to restart file 2019-08-12 13:04:14 +02:00
Joakim Hove
5064519e83 Add function to get keyword enum 2019-08-12 13:04:12 +02:00
Joakim Hove
1a62ceff7d Log use of UDA for output purposes 2019-08-12 13:04:10 +02:00
Joakim Hove
4d1b747b42 UDQConfig object has merged DEFINE & ASSIGN 2019-08-12 13:04:08 +02:00
Joakim Hove
28c2e7024c Renamed UDQInput -> UDQCOnfig 2019-08-12 13:04:07 +02:00
Joakim Hove
9ff301625b Merge pull request #931 from joakim-hove/group-controls-space
Add ParseContext behaviour to trimming of well/group names
2019-08-12 11:05:28 +02:00
Joakim Hove
49d32a02fb Add ParseContext behaviour to trimming of well/group names 2019-08-12 11:01:14 +02:00
Joakim Hove
9d9099a8fc Add string_view::starts_with() and string_view::find() methods 2019-08-10 18:05:22 +02:00
Joakim Hove
ef91e18586 Merge pull request #934 from joakim-hove/parse-test-spe9
Add parse testing of SPE9 variations
2019-08-09 19:53:05 +02:00
Joakim Hove
31176bacbb Add parse testing of SPE9 variations 2019-08-09 18:46:53 +02:00
Steinar Foss
d1052d2034 setup.py: uses ccache c++. 2019-08-09 18:14:02 +02:00
Steinar Foss
cf9aa917dc setup.py: may use ccache.
added note.
2019-08-09 18:14:02 +02:00
Joakim Hove
de641d83d6 Merge pull request #873 from joakim-hove/actionx-eval-field
ACTIONX: Fix bug with matching wells + refactor
2019-08-09 17:41:08 +02:00
Joakim Hove
359955efc3 Action: capture matching wells correctly + large refactor
With this commit the result of a ACTIONX evaluation goes to the new type
Action::Result which in addition to the overall thruthness of the expression
keeps track of the list of matching wells.

Introduced a new namespace Action for everything related to the ACTIONX
implemenentation.
2019-08-09 15:43:58 +02:00
Joakim Hove
2747f20e24 Add utility to output Action::TokenType to string 2019-08-09 15:43:58 +02:00
Joakim Hove
27e1cc654a ActionContext uses a reference to SummaryState 2019-08-09 15:43:58 +02:00
Joakim Hove
f0c5b914ad Merge pull request #930 from GitPaean/recovering_ALL_Summary_2
removing potential keywords from ALL in SUMMARY (attempt no. 2)
2019-08-09 14:41:27 +02:00
Joakim Hove
37b49cabf6 Merge pull request #917 from stefoss23/setuptools
Setuptools
2019-08-09 13:45:50 +02:00
Steinar Foss
b0ad3a2b26 resolved merge conflict. 2019-08-09 10:48:43 +02:00
Steinar Foss
c208a59597 Sunbeam will be compiled with setuptools.
setup.py moved to python/python.

moved python tests to python/python.

added __init__.py under python/tests.

added 'test_' before all python test names.

test_ prefix added to tests.

setup.py and python tests moved back to python base.

setuptools executes from root python.

python: tests run from root python w/ setup.py.

python tests: temp reduced to test_deck only.

python setup.py: manually linked opmcommon.

setup.py: linked ecl.

setup.py linked boost_filesystem.

setup.py: linked boost_regex.

python all tests run.

removec usr/local from setup.py ext_module.

cmake make copies entire python dir to build.

setup.py can execute from build.

setup.py executes from build/python.

python tests run under setup.py.

setup.py library_dirs and include-dirs set by cmake command.

removed cmake files from sunbeam.

sunbeam: added code for install.

setup.py: removed 'import ecl'.

python/src -> python->src_sunbeam.

setup.py: discontinued use of glob, all files listed instead.

build-opm_module.sh: added prefix_path to opm.

build-opm-module.sh: changed spell error for EXTRA_MODULE_FLAGS[opm-common].

setup.py: infer include directories from cmake target

CMakeLists.txt: under python: align install statement.

CMakeLists build python: removed find_package.

src_sunbeam -> cxx.

setup.py: test_suite as string.

setup.py: tests_suite -> test_suite.

setup.py: added exception if 'build_ext' not used.

temporarily moved files to python/sunbeam.
2019-08-09 10:40:33 +02:00
Joakim Hove
b55e073182 Merge pull request #923 from joakim-hove/group-uda
Group uda
2019-08-09 08:50:20 +02:00
Steinar Foss
e013066040 added keyword CECONT. 2019-08-09 08:32:19 +02:00
Joakim Hove
f63c408ba4 Add has_control() functionality to group 2019-08-08 18:43:19 +02:00
Joakim Hove
bd28038327 Add Group2 getters for cmode and phase 2019-08-08 17:28:34 +02:00
Joakim Hove
02c43b7a09 Merge pull request #927 from stefoss23/add_keywords_B
Add keywords beginning w/ B
2019-08-08 17:22:56 +02:00
Steinar Foss
3852c5224e added keywords CALTRAC, CART, CMBOPTS. 2019-08-08 16:03:04 +02:00
Steinar Foss
692edfbf5c added keywords BPDIMS, BRINE, BTOBALFA, BTOBALFV. 2019-08-08 15:10:08 +02:00
Steinar Foss
887a567869 added keywords BIGMODEL, BOUNDARY, BPARA. 2019-08-08 15:10:08 +02:00
Joakim Hove
8ff8d23146 Merge pull request #926 from stefoss23/add_keywords_A
WIP: Add keywords a
2019-08-08 14:03:28 +02:00
Steinar Foss
0bfe490609 AUTOREF: corrected name. 2019-08-08 11:54:42 +02:00
Steinar Foss
0f7062ef2a added keywords: AQUNNC, AUTOCOAR, AUTOREF. 2019-08-08 11:50:54 +02:00
Joakim Hove
6016cd43b3 Evaluate UDA variuables for group rates 2019-08-08 06:52:48 +02:00
Joakim Hove
93b53df02a Merge pull request #900 from joakim-hove/remove-group
Use new Group2 class
2019-08-07 21:52:56 +02:00
Kai Bao
a06194ecae fixing requiredRestartVectors() in Summary.cpp
adding the following to the requiredRestartVectors()

    “OPP”, “WPP”, “GPP”,
    “OPI”, “WPI”, “GPI”
2019-08-07 10:55:58 +02:00
Kai Bao
8a57e491c2 removing potential keywords from ALL in SUMMARY
which were added from OPM/opm-common#585
2019-08-07 10:55:58 +02:00
Steinar Foss
9516fdd3e6 added keywords AQUFET, AQUFLUX. 2019-08-07 10:29:30 +02:00
Joakim Hove
7c856f681d Use new classes Group2 and GTNode 2019-08-06 22:59:16 +02:00
Bård Skaflestad
9875d5fbd8 Merge pull request #925 from atgeirr/fix-satfuncpropertyinitializers-slgof
Bugfix: multiple bugs in dealing with SLGOF dealt with.
2019-08-06 15:29:47 +02:00
Atgeirr Flø Rasmussen
b9cdb9fb78 Minor modifications requested by reviewer. 2019-08-06 14:14:00 +02:00
Atgeirr Flø Rasmussen
8c9674856a Bugfix: multiple bugs in dealing with SLGOF dealt with. 2019-08-06 11:10:57 +02:00
Joakim Hove
8633f07018 Merge pull request #913 from joakim-hove/sort-wells
Sort the child wells according to insert index
2019-08-06 09:24:10 +02:00
Joakim Hove
22ef5a4cd2 Merge pull request #924 from joakim-hove/group-add-unitsystem
Add UnitSystem member ot Group2 class
2019-08-06 06:38:18 +02:00
Joakim Hove
ed4bf054fa Add UnitSystem member ot Group2 class 2019-08-05 18:37:01 +02:00
Joakim Hove
5bb56ff4a8 Merge pull request #922 from joakim-hove/well_uda_rename
Minor reorg to use the same UDA code for wells and groups
2019-08-05 17:11:13 +02:00
Joakim Hove
bab637ab67 Merge pull request #921 from bska/include-stdexcept
Include <stdexcept> Where Necessary
2019-08-05 17:11:01 +02:00
Joakim Hove
658dc20f36 Minor reorg to use the same UDA code for wells and groups 2019-08-05 14:35:00 +02:00
Bård Skaflestad
7d26cf44e1 Include <stdexcept> Where Necessary
Issue hidden by transitive includes in some standard library
implementations.
2019-08-05 11:12:06 +02:00
Steinar Foss
7dfc20a4cc added keywords AQANCONL, AQANNC, AQANTRC, AQUCWFAC. 2019-08-05 10:12:24 +02:00
Joakim Hove
119cbc33f7 Sort the child wells according to insert index 2019-07-31 13:28:24 +02:00
Joakim Hove
24393cc2ef Merge pull request #892 from joakim-hove/group2-testing
Group2
2019-07-31 08:18:28 +02:00
Joakim Hove
9e6666357b Add method Group2::wellgroup() 2019-07-31 07:13:08 +02:00
Joakim Hove
2d66d15d96 Refactor GroupTree - create on demand 2019-07-30 09:37:55 +02:00
Joakim Hove
dc4aa882be Integration testing of Group2 in Schedule constructor 2019-07-30 09:36:57 +02:00
Joakim Hove
12294cb637 Initialize Group2 structure during Schedule construction 2019-07-30 09:36:48 +02:00
Joakim Hove
8a52da5851 Replace SCHEDULE_WELL_ERROR -> SCHEDULE_GROUP_ERROR 2019-07-30 09:33:48 +02:00
Joakim Hove
b48f0affea Add size() method to DynamicState 2019-07-30 09:32:26 +02:00
Bård Skaflestad
cc14a83ecf Merge pull request #912 from joakim-hove/windowed-array-zero-size
Add invalid size zero in WindowArray and WindowMatrix
2019-07-29 07:56:38 -05:00
Joakim Hove
ad9448c87d Add invalid size zero in WindowArray and WindowMatrix 2019-07-29 14:09:07 +02:00
Joakim Hove
3655aeb579 Merge pull request #910 from stefoss23/add_keywords_1
Added keywords beginning w/ A
2019-07-27 08:19:09 +02:00
Steinar Foss
57c27d603a added keywords: ALPOLADS, ALSURFAD, ALSURFST. 2019-07-26 18:01:59 +02:00
Steinar Foss
d35a321214 added keywords ALKALINE, ALKROCK. 2019-07-26 16:47:18 +02:00
Joakim Hove
c7532005b2 Merge pull request #905 from joakim-hove/handle-seqindex-private
Make GroupTree::handleSeqIndex() private
2019-07-26 16:40:37 +02:00
Steinar Foss
c24e220626 added keywords: ADDZCORN, AITSOFF, ALKADS. 2019-07-26 16:30:22 +02:00
Steinar Foss
bb8cfc2e60 added keywords: ACTIONR, ACTIONW, ACTPARAM. 2019-07-26 14:22:59 +02:00
Joakim Hove
a304f560d5 Merge pull request #907 from stefoss23/add_keywords_0
added keywork ACTIONG.
2019-07-26 13:59:46 +02:00
Steinar Foss
1073ef3d55 added keywork ACTIONG. 2019-07-26 12:21:09 +02:00
Joakim Hove
787d9d3948 Refactor sequende index mapping in GroupTree 2019-07-26 08:50:53 +02:00
Joakim Hove
8873eb29e4 Merge pull request #906 from joakim-hove/private-iter
Make GroupTree iterators private
2019-07-26 08:45:32 +02:00
Joakim Hove
03b2a5c946 Make GroupTree iterators private 2019-07-26 07:47:54 +02:00
Bård Skaflestad
729948b712 Merge pull request #849 from bska/initfile-sfunc-eps
INIT File Saturation Function End-Point Scaling
2019-07-25 19:47:56 -05:00
Bård Skaflestad
d9fea19c5b INIT: Don't Write Empty TRANNC Vector
This commit makes the TRANNC INIT file output conditional on the vector
being non-empty.  Previously we would alway output that vector even if
it did not contain any non-neighbouring connections.
2019-07-25 07:15:15 +02:00
Bård Skaflestad
7639dd7e5f INIT/EPS: Output Sentinel Value if Input Defaulted
This commit extends the previous support for writing scaled end-points
(and scaled function values) to outputting the sentinel value -1.0e+20
for those items (cell values) that have been defaulted in the input.
This operation does not apply if the simulation run specifies FILLEPS,
in which case we always output the actual scaled end-points, whether
taken from explicit assignment or derived from table values.

The overall approach is to pass an additional flag (needDflt) to
function writeDoubleCellProperties(), which then dispatches to two new
helper functions

    writeCellPropertiesWithDefaultFlag()
    writeCellPropertiesValuesOnly()

The former then expects a three-argument callable (lambda), the second
of which is the compressed version of the Property<T>::wasDefaulted()
value.  This is then used to infer for which elements to output the
sentinel value.  The ValuesOnly() property writer is the previous
version of writeDoubleCellProperties() and is mainly used to support the
FILLEPS operation.
2019-07-25 07:08:52 +02:00
Bård Skaflestad
43a5a153b1 INIT: Activate EPS-Related Flags in LOGIHEAD
This commit ensures that we set the correct end-point scaling flags in
LOGIHEAD (items 17..20, zero-based indices 16..19) according to the
run's requested end-point scaling behaviour.  This in turn enables the
ResInsight postprocessor to distinguish between scaled and unscaled
saturation function curves in its "RelPerm" plot window.

Note that in order to set the correct flags and to not impact the
restart files, we've elected to copy the CreateLogiHead function here.
This incurs non-zero technical debt.  We should seek to reunify the two
implementations to the extent possible.
2019-07-25 04:17:58 +02:00
Bård Skaflestad
a06a49b4d8 Refactor EPS Vector Collection to New Helper Class
This commit extracts the hard-coded list of end-point scaling vectors
out to a new helper class, ScalingVectors, and makes the specific list
dependent on the run's active phases.  This means, in particular, that
we won't output water vectors unless water is an active phase and
similarly for gas and oil.

The added logic of active phases only was complicated enough to warrant
an encapsulating scope.
2019-07-25 04:17:58 +02:00
Bård Skaflestad
cd48199c1e INIT File: Honour FILLEPS Keyword
If the input deck specifies FILLEPS, we should always output
end-point arrays whether or not the vectors are explictly assigned
in the input deck.
2019-07-25 04:17:58 +02:00
Bård Skaflestad
5bcb80ba70 INIT File: Output Scaled End-Point Arrays for Saturation Functions
This commit introduces a new helper function,

    writeSatFuncScaling()

that will extract scaled end-point arrays like SWL, SGCR, SOWCR,
KRORW, and PCG and output these to the INIT file.  We support both
the drainage and imbibition keywords, but do not support the
directional versions of these keywords at this time.

Note that this first draft uses the keyword values directly from the
Eclipse3DProperties container.  Therefore, the output behaves as if
the input deck always specifies the 'FILLEPS' option.  Outputting
only the values that were specified in the input will be the subject
of future work.
2019-07-25 04:17:58 +02:00
Bård Skaflestad
ccefe04230 Cell Properties (INIT): Refactor Write Loop Into Helper
This commit introduces a new helper function,

    writeCellProperties()

that accepts a list of properties to output as well as a property
container (GridProperties<T>), an EclipseGrid and call-back write
function for individual properties.  The helper invokes the callback
for each property that exists in the property container, passing it
the property description and the property values compressed to
active cells.

Reimplement function writeDoubleCellProperties() in terms of the new
helper.
2019-07-25 04:17:58 +02:00
Joakim Hove
65c4d91b19 Merge pull request #902 from joakim-hove/iorder-set
Add insert ordered set
2019-07-24 15:03:56 +02:00
Joakim Hove
f386404408 Add insert ordered set 2019-07-24 14:52:49 +02:00
Joakim Hove
28e0b1cc3a Merge pull request #899 from joakim-hove/invalid-group-rate
Remove #define INVALID_GROUP_RATE - just use 0
2019-07-24 08:10:50 +02:00
Joakim Hove
5b1020151b Merge pull request #901 from joakim-hove/reformat-aggregate-group-data
Indentation changes
2019-07-24 08:10:33 +02:00
Joakim Hove
3c77d66cd7 Indentation changes 2019-07-22 17:34:54 +02:00
Joakim Hove
fd49cb7787 Merge pull request #866 from joakim-hove/udq-usage-wip
Udq usage - preparations
2019-07-22 17:13:52 +02:00
Joakim Hove
e14b938fde Add UDAControl enum 2019-07-22 16:07:36 +02:00
Joakim Hove
11fe1d6e03 Maintain insert order in UDQINput 2019-07-22 16:07:36 +02:00
Joakim Hove
2fb64e21d9 Add method UDQDefine::input_string() 2019-07-22 16:07:36 +02:00
Joakim Hove
370ce5de1f Removed public tokens() property for UDQDefine 2019-07-22 16:07:36 +02:00
Joakim Hove
5a39b0e249 Remove #define INVALID_GROUP_RATE - just use 0 2019-07-22 09:21:01 +02:00
Bård Skaflestad
2e1ef048df Merge pull request #897 from joakim-hove/unit-system-refactor
Unit system refactor
2019-07-21 16:55:08 -05:00
Joakim Hove
2ff8816bb7 UnitSystem refactor
- Add new constructor based on deck names 'FIELD', 'METRIC', 'PVT-M' and 'LAB'.
 - Refactor UnitSystem construction.
2019-07-21 13:12:01 +02:00
Bård Skaflestad
eede6b05b5 Merge pull request #896 from tskille/convertECL
convertECL, new option for unified restart file
2019-07-19 22:22:01 -05:00
Torbjørn Skille
a23c87be94 convertECL, new option for unified restart file 2019-07-19 10:39:12 +02:00
Joakim Hove
693395e78d Merge pull request #894 from joakim-hove/group-types
Add enum GroupType
2019-07-19 08:26:26 +02:00
Joakim Hove
6324d5d6c8 Add enum GroupType 2019-07-19 07:20:21 +02:00
Bård Skaflestad
bc1403e1c6 Merge pull request #895 from tskille/ERst
Enabling load on the demand for class ERst
2019-07-18 08:35:17 -05:00
Torbjørn Skille
f509c3e236 Enabling load on the demand for class ERst 2019-07-18 14:49:51 +02:00
Bård Skaflestad
f2fe00b819 Merge pull request #869 from bska/adjust-sogcr-with-swl
Adjust Critical Oil-in-Gas Saturation with Scaled Connate Water Saturation
2019-07-16 08:06:11 -05:00
Bård Skaflestad
a886a2334b GridProperty: Collect Paired Assignment in Single Operation
This commit introduces a new helper function

    void GridProperty<>::setElement(i, val, dflt)

that handles paired assignments to 'm_data' and 'm_defaulted'[%].
This simplifies the bookkeeping and implementation of the various
assignment and value operations.

While here, also add a unit test to demonstrate expected behaviour
of the m_defaulted flag.  The only really questionable setting is
what happens if the deck applies a relative operator (e.g., ADD or
MULTIPLY) to a value that would otherwise be defaulted.  In the
current implementation the m_defaulted flag will remain set in this
case, but it arguably should be switched to unset (false).

[%]: Suggested by [at]akva2
2019-07-15 13:03:21 +02:00
Bård Skaflestad
e79d1396df GridProperty<T>: Track Defaulted Cell Status In More Operations
In particular, update 'm_defaulted' in

  - maxvalue, minvalue
  - maskedSet, maskedCopy
  - copyFrom
  - setScalar
2019-07-15 13:03:21 +02:00
Bård Skaflestad
63c6eeb30e SupportedKeywordInfo: Remark on Hacky Nature of setPostProcessor
This commit adds a comment block to the new

    setPostProcessor

member function, explaining the reasoning behind its excistence and
remarking on the fact that the ability to replace the post-processor
is essentially a hack.  The hack suggests that we need to rethink
our handling of (3D) grid properties.
2019-07-15 13:03:21 +02:00
Bård Skaflestad
10890cc793 3D Properties: Hook Up adjustSOGCRwithSWL for SGOF
This commit calls the SOGCR post-processor hook if the simulation
run uses SGOF.  In this case we need to subtract (scaled) connate
water saturations from defaulted SOGCR values.

This revealed a problem in one of the unit tests which used the
incorrect critical oil saturation due to a missing SGOF record.
2019-07-15 13:03:21 +02:00
Bård Skaflestad
7494990611 3D Properties: Add Special Purpose Treatment for SOGCR
This commit adds a new member function

    Eclipse3DProperties::adjustSOGCRwithSWL

which mutates the SupportedKeywordInformation of the various *SOGCR*
keywords created by makeSupportedDoubleKeywords().  Specifically,
adjust*() installs new post-processors for the critical oil-in-gas
saturations--post-processors that subtract the (scaled) connate
water saturation from the defaulted SOGCR.  This is only applicable
if the simulation run uses Family I (SWOF/SGOF) saturation function
keywords, because the SGOF table is implicitly defined in terms of
the connate water saturation.
2019-07-15 13:03:21 +02:00
Bård Skaflestad
9bb64df26e Keyword Information: Add Means to Replace Post-Processor
This is a special purpose hook that is mainly intended to add a
post-processor after the keyword information is established only if
certain conditions are satisfied (e.g., if certain keyword relations
like the run using 'SGOF' tables hold).

Immediate use case is to install a post-processor for SOGCR to
subtract the scaled connate water saturation from defaulted SOGCR
values if the simulation run uses family I (SWOF/SGOF) saturation
function descriptions.
2019-07-15 13:03:21 +02:00
Bård Skaflestad
ceb9f01571 GridProperty: Pass 'Defaulted' Flag to Post-Processor
This commit alters the post-processor API to accept a vector<bool>
of defaulted flags (true if defaulted, false if explicitly
assigned).  This, in turn, enables running the post-processor only
on defaulted (or assigned) property values.

Update existing post-processor implementation to honour the new
calling conventions.
2019-07-15 13:03:21 +02:00
Bård Skaflestad
430cc9d7b2 GridProperty<T>: Track Defaulted Cell Status
This commit adds a new data member (GridProperty<T>::m_defaulted)
that keeps track of whether or not a particular data item has been
implicitly assigned from the input deck.  GridProperty::setDataItem
assigns 'false', while the constructor initialises 'm_defaulted' to
true for all Cartesian cells.

The main objective is to be able to apply a post processor only to
those cells for which the input deck does not supply an explicit
value.
2019-07-15 13:03:21 +02:00
Joakim Hove
ffba2b114b Merge pull request #888 from joakim-hove/group-names
Add method Schedule::groupNames()
2019-07-15 07:42:22 +02:00
Joakim Hove
160f0f83e1 Remove Schedule::getGroups() 2019-07-15 06:01:44 +02:00
Joakim Hove
7559c31e43 Use Schedule::groupNames() intead of getGroups() 2019-07-15 06:01:44 +02:00
Joakim Hove
6426644ce4 Add method Schedule::groupNames() 2019-07-15 06:01:44 +02:00
Joakim Hove
3d07072f08 Merge pull request #893 from joakim-hove/remove-group-injection-rate
Remove unused group rate
2019-07-14 10:57:21 +02:00
Joakim Hove
2248a1133d Remove unused group rate 2019-07-14 08:33:45 +02:00
Arne Morten Kvarving
2c8e4cb6b0 Merge pull request #891 from akva2/janitoring
Various janitoring
2019-07-10 15:51:10 +02:00
Arne Morten Kvarving
492fba07fc fixed: remove unused assignments 2019-07-10 15:10:29 +02:00
Arne Morten Kvarving
c87acf6571 fixed: remove unused variable and limit scope for another 2019-07-10 15:10:29 +02:00
Arne Morten Kvarving
c720dfe8a8 fixed: move string to avoid copy 2019-07-10 15:10:18 +02:00
Arne Morten Kvarving
b860fdbccc fixed: use initializer list 2019-07-10 09:03:36 +02:00
Arne Morten Kvarving
4dbb33cce6 changed: rescope code relying on grid under if()
rewrite to aid static code analyzer
2019-07-10 09:03:36 +02:00
Arne Morten Kvarving
6a7191c376 fixed: sources should include the extension 2019-07-10 09:03:36 +02:00
Arne Morten Kvarving
6039cfa7ed Merge pull request #890 from akva2/improve_sca_support
Improve static analysis support
2019-07-09 14:40:14 +02:00
Arne Morten Kvarving
3e078e76b1 fix indenting 2019-07-09 14:39:11 +02:00
Arne Morten Kvarving
43c504593f added: static analysis for targets added using opm_add_test 2019-07-09 10:35:40 +02:00
Arne Morten Kvarving
3e576b6332 added: support object libraries in static analysis macro 2019-07-09 10:35:40 +02:00
Arne Morten Kvarving
748fd20e57 fixed: make sure path is absolute before attempting conversion to relative 2019-07-09 10:35:40 +02:00
Arne Morten Kvarving
8d59054112 fixed: make sure not to re-add static analysis tests 2019-07-09 09:49:16 +02:00
Joakim Hove
8d439e6260 Merge pull request #880 from joakim-hove/opmi-loggin
Add basic log output to the opmi application
2019-07-08 13:51:32 +02:00
Joakim Hove
085d7d23b6 Merge pull request #889 from akva2/janitoring
mark constructor explicit
2019-07-08 13:29:52 +02:00
Arne Morten Kvarving
83e2029af4 mark constructor explicit 2019-07-08 11:17:45 +02:00
Joakim Hove
88afb50d09 Merge pull request #881 from joakim-hove/group2
WIP: Group2
2019-07-06 07:30:25 +02:00
Joakim Hove
f0215f1a3d Merge pull request #887 from joakim-hove/normal-libecl-build
Remove hardcoded libecl commit in jenkins pipeline
2019-07-05 17:42:43 +02:00
Kai Bao
2b41c40c58 Merge pull request #878 from GitPaean/welopen_wtest
WELOPEN and WCON* interact with WECON and WTEST
2019-07-05 11:43:14 +02:00
Joakim Hove
1c777c5ba5 Remove hardcoded libecl commit in jenkins pipeline 2019-07-05 11:16:09 +02:00
Kai Bao
011666b3f9 WELOPEN and WCON* interact with WECON and WTEST
WELOPEN and WCON* can open well closed due to various reasons, physical
or economic.

If a well is shut with WELOPEN and WCON*, we do not try to re-open it
through WTEST.
2019-07-05 10:01:03 +02:00
Atgeirr Flø Rasmussen
6aabb6958d Merge pull request #883 from atgeirr/allow-no-foamfsc
Allow FOAM without FOAMFSC
2019-07-05 09:24:13 +02:00
Joakim Hove
0694515c69 Merge pull request #886 from joakim-hove/jenkins-libecl-build
Jenkins libecl build
2019-07-05 07:07:04 +02:00
Joakim Hove
7f521652f4 Update libecl pr build 2019-07-04 20:17:21 +02:00
Joakim Hove
8740a8dc1a Update libecl github organisation to equinor 2019-07-04 19:06:35 +02:00
Atgeirr Flø Rasmussen
3f5f4c1b40 Merge pull request #885 from atgeirr/use-fixed-libecl-jenkins
Set default commit to use for libecl to a known OPM-compatible commit
2019-07-04 17:42:27 +02:00
Atgeirr Flø Rasmussen
54c8e107b7 Do not use master branch for libecl by default. 2019-07-04 16:35:48 +02:00
Atgeirr Flø Rasmussen
c3dcedc392 Allow FOAM without FOAMFSC
This is necessary to support the table-based gas mobility reduction model.
In order to extend support to the function-based model the FOAMFSC-related
things have been kept.
2019-07-04 12:57:43 +02:00
Atgeirr Flø Rasmussen
e877de94bb Merge pull request #882 from atgeirr/add-wfoam-support
Add WFOAM support
2019-07-04 11:16:46 +02:00
Atgeirr Flø Rasmussen
5144456aa4 Address review comments.
- Use const reference to the dynamic state in handleWFOAM() and handleWPOLYMER().
 - Throw if trying to set foam or polymer injection properties on a production well.
 - Update some tests that failed due to the point above.
2019-07-04 09:23:11 +02:00
Atgeirr Flø Rasmussen
5f8d24c431 Add tests for WFOAM. 2019-07-03 12:39:35 +02:00
Atgeirr Flø Rasmussen
13bd564edf Add WFOAM support to Schedule and Well2. 2019-07-03 12:39:35 +02:00
Atgeirr Flø Rasmussen
0aaf9823c1 Merge pull request #879 from atgeirr/add-foammob
Add FOAMMOB and friends
2019-07-03 12:38:33 +02:00
Joakim Hove
a64745193d Add empty Group2 skeleton 2019-07-03 11:15:51 +02:00
Joakim Hove
fe83324746 Moved Group related files to Group/ folder in filesystem 2019-07-03 11:15:51 +02:00
Atgeirr Flø Rasmussen
f48462841f Add table support for FOAMMOB. 2019-07-03 11:12:12 +02:00
Atgeirr Flø Rasmussen
89acca0fd7 Add FOAMMOB, FOAMOPTS and WFOAM keywords. 2019-07-03 11:12:12 +02:00
Joakim Hove
c41ea17ba6 Add basic log output to the opmi application 2019-07-03 10:16:16 +02:00
Atgeirr Flø Rasmussen
1cd6ebb403 Merge pull request #877 from atgeirr/add-foamrock
Add FOAMROCK including FoamConfig support and test.
2019-07-02 17:53:51 +02:00
Atgeirr Flø Rasmussen
522db6d093 Address issues from review. 2019-07-02 16:58:04 +02:00
Torbjørn Skille
a7aa78b7e9 Update of compareECL. Checks that at least one output file (EGRID, INIT, SMSPEC, RFT or UNRST) present for reference case. Throws if not the case 2019-07-02 15:46:48 +02:00
Atgeirr Flø Rasmussen
33783b1e9f Add FOAMROCK including FoamConfig support and test. 2019-07-02 13:55:42 +02:00
Atgeirr Flø Rasmussen
d61d9c920b Merge pull request #875 from atgeirr/add-foamconfig
Add FoamConfig class and support
2019-07-02 11:45:37 +02:00
Atgeirr Flø Rasmussen
17a2e5d334 Address review comments.
- Use a raw literal.
 - Use 'index', not 'id'.
 - Use FoamConfig(const Deck&) constructor.
2019-07-02 10:43:13 +02:00
Joakim Hove
8f7e6ccd94 Merge pull request #874 from tskille/compareECL
Added new option to compareECL
2019-07-02 07:24:48 +02:00
Torbjørn Skille
51adb23728 Added new option (report steps only) for compareECL for comparing summary results 2019-07-01 16:37:49 +02:00
Atgeirr Flø Rasmussen
7245598952 Include cstddef for std::size_t. 2019-07-01 15:29:21 +02:00
Atgeirr Flø Rasmussen
ba462d67cf Add test for FoamConfig. 2019-07-01 14:40:59 +02:00
Atgeirr Flø Rasmussen
62a3b7334d Add FoamConfig to InitConfig. 2019-07-01 14:40:37 +02:00
Atgeirr Flø Rasmussen
c314464ef3 Add unit support for FoamSurfactantConcentration.
Note that FoamDensity and FoamSurfactantConcentration differ in field units,
as one is then poind/barrel and the other is pound/(1000 cubic feet)!
2019-07-01 14:40:05 +02:00
Atgeirr Flø Rasmussen
57cc97af47 Bugfix: do not use std::fixed output format.
This change lets 1e-20 be printed correctly.
2019-07-01 14:19:41 +02:00
Atgeirr Flø Rasmussen
34d1918a2d Add copyright notice to new files. 2019-07-01 10:49:33 +02:00
Atgeirr Flø Rasmussen
39f8eb18c7 Change class name Foam -> FoamConfig. 2019-07-01 10:47:48 +02:00
Steinar Foss
597bbde151 jenkins will build python. (#865)
Jenkins will build with -DOPM_ENABLE_PYTHON=ON
2019-06-29 08:20:00 +02:00
Joakim Hove
28ba27184a Merge pull request #870 from joakim-hove/udq-summary-name
Make sure that well UDQ with last letter 'L' are included in output
2019-06-29 00:17:53 +02:00
Franz G. Fuchs
4baff64d63 implemented faom config 2019-06-28 12:37:04 +02:00
Joakim Hove
0cf83567eb Make sure that well UDQ with last letter 'L' are included in output 2019-06-28 12:23:33 +02:00
Kai Bao
034488c902 Merge pull request #864 from GitPaean/fixing_maximum_wtest_attempt_with_multiple_wtest
recording the report step that WTEST keyword is specified
2019-06-28 10:36:29 +02:00
Kai Bao
fb8de64487 addressing comments for PR#864 2019-06-28 09:47:40 +02:00
Kai Bao
7c0b2df272 adding test to test the functionality 2019-06-28 09:47:40 +02:00
Kai Bao
290123bc33 Do not keep multiple WTESTWell has same name and reason
when add_well in WellTestConfig .
2019-06-28 09:47:40 +02:00
Kai Bao
11bc26d28d recording the report step that WTEST keyword is specified
so we can easily tell when a new WTEST keyword joins.

When a new WTEST keyword, we will reset the counting of the num_attempt
and maximum number of attempts for the associated well.
2019-06-28 09:47:40 +02:00
Franz G. Fuchs
a68db0a857 update 2019-06-28 09:44:33 +02:00
Franz G. Fuchs
563c6317d4 udpate 2019-06-28 09:43:20 +02:00
Joakim Hove
8dbb8d70fc Merge pull request #868 from joakim-hove/ignore-SUMTHIN
Do not classify 'SUMTHIN' directive as UDQ keyword
2019-06-27 17:53:35 +02:00
Joakim Hove
90ebc66c0b Merge pull request #867 from joakim-hove/rename-enable-python
Rename cmake symbol ENABLE_PYTHON -> OPM_ENABLE_PYTHON
2019-06-27 16:17:37 +02:00
Joakim Hove
d32e0f6eaf Do not classify 'SUMTHIN' directive as UDQ keyword 2019-06-27 16:11:02 +02:00
Joakim Hove
dba43a4a5e Rename cmake symbol ENABLE_PYTHON -> OPM_ENABLE_PYTHON 2019-06-27 15:19:03 +02:00
Joakim Hove
82535a9136 Merge pull request #863 from stefoss23/python_subdir
Python subdirectory
2019-06-27 12:54:43 +02:00
Joakim Hove
ad9c818574 Merge pull request #858 from atgeirr/more-warnings
Turn on -Wextra and -Wshadow warning flags.
2019-06-27 12:53:45 +02:00
Steinar Foss
143c73cdd0 ENABLE_PYTHON OFF. 2019-06-27 12:31:38 +02:00
Steinar Foss
ef936afeaa opm set to PIC with PYTHON ON. 2019-06-27 12:10:02 +02:00
Bård Skaflestad
5bed559f96 Merge pull request #860 from atgeirr/foam_module
Foam module
2019-06-26 11:54:17 +02:00
Atgeirr Flø Rasmussen
c26538f433 Merge pull request #862 from joakim-hove/warnings
Warnings
2019-06-26 11:04:00 +02:00
Joakim Hove
0d5cd70536 Merge pull request #854 from GitPaean/fixing_maximum_wtest_attempt
not removing the well from WellTestState when testing is successful
2019-06-26 09:20:31 +02:00
Joakim Hove
7475636610 Rename arguments to avoid shadowing 2019-06-26 07:51:36 +02:00
Joakim Hove
cd43bb7a5f Remove debug printf() 2019-06-26 07:51:36 +02:00
Joakim Hove
b116eda8bc Remove unused arguments 2019-06-26 07:51:36 +02:00
Joakim Hove
29697a0906 Remove members keywords1 and keywords2 from EclFilesComparator 2019-06-26 07:51:36 +02:00
Kai Bao
28110584a3 removing funciton dropWell for WellTestState 2019-06-25 22:18:55 +02:00
Kai Bao
c0c9d70dcf not removing the well from WellTestState when testing is successful 2019-06-25 22:15:28 +02:00
Joakim Hove
fbfdf5c244 Merge pull request #844 from GitPaean/fixing_warnings
Fixing warnings
2019-06-25 21:08:12 +02:00
Bård Skaflestad
c63e23c140 Allow Saturation Region = 0 in Deactivated Cells
There are models for which SATNUM and/or IMBNUM is zero in
deactivated cells (those for which ACTNUM is also zero in the input
deck).  Allow this case in the initializers for the saturation
function properties (i.e., the endpoint arrays).
2019-06-25 20:51:11 +02:00
Bård Skaflestad
465ab091e0 Support Automatic Generation of Scaled Endpoint Arrays
The endpoint arrays (SWLPC, SGU, KRORW etc) can all be automatically
generated from the unscaled input saturation function tables.
2019-06-25 20:51:11 +02:00
Joakim Hove
189e84d40e Merge pull request #856 from bska/internalize-filleps-kw
InitConfig: Internalize FILLEPS Keyword
2019-06-25 20:49:25 +02:00
Joakim Hove
b0d180b409 Merge pull request #861 from GitPaean/default_reason_wtest
for WTEST, the reason default to be ``
2019-06-25 20:43:38 +02:00
Kai Bao
a8396de668 for WTEST, the reason default to be `` 2019-06-25 15:13:46 +02:00
Atgeirr Flø Rasmussen
ae7ea2a286 Silence some switch-case warnings. 2019-06-25 14:51:40 +02:00
Franz G. Fuchs
694d17a228 added copyright statement 2019-06-25 13:32:11 +02:00
Franz G. Fuchs
a84771013b remove commented out code 2019-06-25 13:32:11 +02:00
Franz G. Fuchs
31415679f7 defined FoamDensity, added test 2019-06-25 13:32:11 +02:00
Franz G. Fuchs
ecc653cce4 foamadstable added 2019-06-25 13:32:11 +02:00
Franz G. Fuchs
bb292365ff added Foamadstable 2019-06-25 13:32:11 +02:00
Franz G. Fuchs
95070310f3 changed order 2019-06-25 13:32:11 +02:00
Franz G. Fuchs
6efe981234 use correct size of bit set, test added 2019-06-25 13:32:11 +02:00
Franz G. Fuchs
2fbf3c4fc9 added keyword for foam 2019-06-25 13:32:11 +02:00
Kai Bao
ca7fe55934 silencing shadowing warnings 2019-06-25 13:16:41 +02:00
Kai Bao
a3d411279f removing redeclaration of function setKeywordBox 2019-06-25 11:44:35 +02:00
Atgeirr Flø Rasmussen
4de0a7e9e3 Turn on -Wextra and -Wshadow warning flags. 2019-06-25 11:18:47 +02:00
Bård Skaflestad
ffecc035c0 InitConfig: Internalize FILLEPS Keyword
This commit extends the InitConfig class to support querying whether
or not the FILLEPS keyword is present in the PROPS section.  Note
that we only look for the keyword in PROPS (not the whole input
deck), since the keyword is only permitted in PROPS.

Add unit tests to exercise the new ability.
2019-06-24 14:15:55 +02:00
Joakim Hove
763702fd0f Merge pull request #774 from joakim-hove/use-UDAValue
Use uda value
2019-06-24 13:56:25 +02:00
Joakim Hove
6eea66a332 Use UDAValue for rates and pressure limits in WCONPROD & WCONINJE 2019-06-24 12:54:07 +02:00
Joakim Hove
a4eeb57a58 Merge pull request #855 from joakim-hove/uda-value-raw
When writing deck output the UDAValue will write raw values
2019-06-24 12:53:44 +02:00
Joakim Hove
4a08b57b23 When writing deck output the UDAValue will write raw values 2019-06-24 11:53:56 +02:00
Joakim Hove
65f8812e46 Merge pull request #847 from joakim-hove/rft-first-open-bug
Fix bug in RFTConfig first open - for WRFTPLT keyword
2019-06-24 10:02:03 +02:00
Joakim Hove
b14bd5acce Merge pull request #848 from joakim-hove/scan-ignore-SOH
Ignore character SOH (ASCII 1) while parsing
2019-06-24 10:01:51 +02:00
Joakim Hove
677009317e Merge pull request #834 from bska/init-from-EclOutput
Replace LibECL Backend in Flow's INIT File Writing
2019-06-24 10:01:40 +02:00
Bård Skaflestad
e487dc1da5 writeInitial: Switch to Using InitIO::write() for INIT
This commit switches the implementation of

    EclipseIO::Impl::writeINITFile()

to using the new helper function Opm::InitIO::write().  This, in
turn, replaces LibECL with the EclOutput class in writing the INIT
file similarly to the previous work on the restart files.
2019-06-24 09:52:56 +02:00
Bård Skaflestad
281f701f27 writeInitial(): Don't Copy 'int_data' Unnecessarily
The object does potentially hold multiple grid-sized vectors and we
already have a copy on entry into the function.  We can use move().
2019-06-24 09:52:56 +02:00
Bård Skaflestad
fa37250446 INIT File: Add Writer Based on OutputStream::Init
This commit adds a new facility for creating the simulation runs'
INIT file.  This is intended to replace the implementation of class
EclipseIO::Impl's writeINITFile.  Initial structure taken from
current implementation of EclipseIO::Impl::writeINITFile().
2019-06-24 09:52:56 +02:00
Bård Skaflestad
323e9903b4 File Output: Add Manager for 'INIT' File Based on EclOutput
This commit introduces a new file manager,

    Opm::EclIO::OutputStream::Init

that's intended to replace the low-level operations of Flow's INIT
file writer.  The implementation uses the 'EclOutput' class and is
very similar to that of the 'Restart' stream introduced in commit
992d3b0c.  The commonality between the two file managers might
possibly be extracted to a base class at a later time.

As of right now, the Init class supports outputting vectors of
'int', 'bool', 'float', and 'double'.  Additional types will be
supported when needed.
2019-06-24 09:52:56 +02:00
Joakim Hove
a4b9b0d460 Merge pull request #851 from joakim-hove/uda-wconprod-resv
Use UDA for WCONPROD::RESV
2019-06-24 09:33:28 +02:00
Joakim Hove
cbc7394d60 Use UDA for WCONPROD::RESV 2019-06-24 08:29:14 +02:00
Joakim Hove
9ed68a9f1f Merge pull request #850 from joakim-hove/add-uda-test-deck
Add test deck for UDA simulation
2019-06-24 07:49:28 +02:00
Joakim Hove
ab6ea86eac Add test deck for UDA simulation 2019-06-24 07:36:36 +02:00
Joakim Hove
747a643288 Ignore character SOH (ASCII 1) while parsing 2019-06-23 12:09:54 +02:00
Joakim Hove
41a74beb3e Fix bug in RFTConfig first open - for WRFTPLT keyword 2019-06-23 10:21:40 +02:00
Joakim Hove
886e90c770 Merge pull request #846 from joakim-hove/remove-summarystate-reset-testing
Remove SUmmaryState::reset() testing
2019-06-23 10:14:58 +02:00
Joakim Hove
6bbfd66744 Minor testing of UDQValue 2019-06-23 09:10:39 +02:00
Joakim Hove
0f52c6a0ee Cleanuup 2019-06-23 08:45:59 +02:00
Joakim Hove
fe6fdf4589 Remove SUmmaryState::reset() testing 2019-06-23 08:32:22 +02:00
Joakim Hove
0631d4ad01 Merge pull request #842 from joakim-hove/well-prop-name
Well prop name
2019-06-22 11:47:43 +02:00
Joakim Hove
746a62b149 Add udq_default argument when creating ProductionControls 2019-06-22 08:01:25 +02:00
Joakim Hove
e4d030c891 Add argument when calling injection controls 2019-06-22 08:01:25 +02:00
Joakim Hove
bf6a0335b0 Add name property to WellInjectionProperties 2019-06-22 08:01:25 +02:00
Joakim Hove
96b7797c4e Add name to WellProductionPropertis 2019-06-22 08:01:25 +02:00
Joakim Hove
f8aa13f6e8 Merge pull request #841 from joakim-hove/add-st-arg
Add st arg
2019-06-21 22:38:06 +02:00
Joakim Hove
ead8cfc1e9 Merge pull request #840 from joakim-hove/aggregate-well-data-uda
Aggregate well data uda
2019-06-21 22:23:44 +02:00
Joakim Hove
98aafa4a9e Pass unused SummaryState argument 2019-06-21 21:24:07 +02:00
Joakim Hove
260365870a Merge pull request #839 from joakim-hove/summarystate-operator<<
Summarystate operator<<
2019-06-21 21:03:31 +02:00
Joakim Hove
df74ac102e Use proper SummaryState argument in AggregateWellData 2019-06-21 21:01:25 +02:00
Joakim Hove
2ecfa6e7b2 Add basic operator<< for SummaryState 2019-06-21 19:32:51 +02:00
Joakim Hove
5604c4c3ba Add basic operator<< for SummaryState 2019-06-21 19:22:27 +02:00
Joakim Hove
3d7bcb19ee Merge pull request #837 from bska/fix-aquct-numrec
Don't Infer Number of AQUFETP Records from AQUDIMS
2019-06-21 18:57:50 +02:00
Bård Skaflestad
63c802666d Don't Infer Number of AQUFETP Records from AQUDIMS
The number of records is unrelated to AQUDIMS Item 5 (NANAQU).  That
item sets the maximum aquifer ID permissible as Item 1 of AQUFETP.

Update unit test accordingly.
2019-06-21 18:06:43 +02:00
Joakim Hove
036951444c Merge pull request #838 from joakim-hove/udq-ast-something
UDQASTNode: check if well/group exists before assigning
2019-06-21 18:04:16 +02:00
Joakim Hove
217e63b1fd UDQASTNode: check if well/group exists before assigning 2019-06-21 16:53:23 +02:00
Joakim Hove
c9ca9717bc Merge pull request #836 from atgeirr/silence-warnings
Silence shadowing warnings
2019-06-21 16:21:42 +02:00
Atgeirr Flø Rasmussen
4018e4b70b This silences many, but not all shadowing warnings in opm-common.
Includes minor refactoring of ESMry and AggregateGroupData undertaken
with the aid of the original authors to ensure correctness.
2019-06-21 14:48:23 +02:00
Bård Skaflestad
b72439387e Merge pull request #835 from bska/fix-test-failures
Copy SPE1_TESTCASE.[FX]0025 to Build Directory
2019-06-21 12:40:18 +02:00
Bård Skaflestad
5395add039 Copy SPE1_TESTCASE.[FX]0025 to Build Directory
Restores 'test_ERst' Unit Test.

Pointy Hat: @bska
2019-06-21 10:29:54 +02:00
Bård Skaflestad
f71dec426a Merge pull request #832 from tskille/ERst
Modified class ERst, added 1 new test to test_ERst
2019-06-21 10:10:55 +02:00
Joakim Hove
bf752c81a5 Merge pull request #833 from joakim-hove/usa-UDAValue-init
Usa uda value init
2019-06-20 14:09:19 +02:00
Joakim Hove
fcdca4a4d7 UDA: GCONPROD 2019-06-20 12:38:20 +02:00
Joakim Hove
acfa281f77 UDA: GCONINJE 2019-06-20 12:36:23 +02:00
Joakim Hove
1da4bd2ea4 UDA: GECON 2019-06-20 12:14:13 +02:00
Joakim Hove
729dc8dbd9 UDA: WSOLVENT 2019-06-20 12:11:57 +02:00
Joakim Hove
7a8d092c8b UDA: WTRACER 2019-06-20 12:11:17 +02:00
Joakim Hove
1c8d0bb0ab UDA: WECON 2019-06-20 12:08:13 +02:00
Joakim Hove
36651b803c UDA: WPOLYMER 2019-06-20 12:07:29 +02:00
Joakim Hove
e360b4b34e Add private utility to evaluate well related UDA 2019-06-20 12:05:10 +02:00
Steinar Foss
af2e3190a2 python tests: runs ok directly under opm-common. 2019-06-20 12:04:09 +02:00
Joakim Hove
73839c43d2 Moved file injection.hpp 2019-06-20 11:24:49 +02:00
Joakim Hove
3f2eefc638 UDQContext:
- add member const UDQParams&
- add functions has_well_var() and has_group_var()
2019-06-20 11:20:47 +02:00
Steinar Foss
da1fb0b744 python compiles directly. 2019-06-20 10:05:53 +02:00
Torbjørn Skille
7394a654bb Modified class ERst, added 1 new test to test_ERst 2019-06-19 22:35:49 +02:00
Joakim Hove
7e5c9dee67 Merge pull request #830 from stefoss23/compile_sunbeam2
Compile sunbeam2
2019-06-19 15:41:17 +02:00
Joakim Hove
c638e5d1a0 Merge pull request #828 from joakim-hove/well-udq-params
Add member udq_undefined to Well2 object
2019-06-19 15:37:29 +02:00
Joakim Hove
2da74c7d80 Merge pull request #829 from bska/groupid-out-of-bounds
INTEHEAD: Store Actual Maximum Number of Groups in Item 21
2019-06-19 15:36:33 +02:00
Steinar Foss
5e88782e51 sunbeam test schedule.py works for new Well2. 2019-06-19 14:43:59 +02:00
Steinar Foss
24f44c1c64 sunbeam test connections.py works for new Well2. 2019-06-19 14:06:20 +02:00
Steinar Foss
4161a1339a test well.py all pass with new Well2. 2019-06-19 13:51:43 +02:00
Joakim Hove
7d0b6f1bf6 Add member udq_undefined to Well2 object 2019-06-19 13:24:21 +02:00
Bård Skaflestad
212150e7b8 INTEHEAD: Store Actual Maximum Number of Groups in Item 21
Commit 7986e99e intended to make OPM Flow able to run simulation
cases whose active number of groups might exceed the declared
maximum number of (non-FIELD) groups (Item 3 of WELLDIMS).  However,
we did not ensure that Item 21 of INTEHEAD contained the larger of
WELLDIMS(3) and the actual number of active groups.

This, in turn, meant that downstream consumers--such as the code to
enumerate groups according to their order of appearance in the
simulation deck--would generate subscripts/indices that were out of
bounds for the allocated tables.  Flow's restart code would then not
produce any output and the user would not be aware of the problem
until attempting to restart a simulation or trying to visualise 3D
simulation results.

This commit corrects the situation by ensuring that we always store
the larger of the two sizes in INTEHEAD(21).

Pointy Hat: @bska
2019-06-19 13:23:34 +02:00
Steinar Foss
a1d4fe13af sunbeam scheduls: get_wells as a function. 2019-06-19 11:51:38 +02:00
Steinar Foss
55f9c8c24f can compile sunbeam. 2019-06-19 11:41:37 +02:00
Joakim Hove
599ed7136f Merge pull request #819 from stefoss23/compile_sunbeam
WIP: Compile sunbeam
2019-06-19 09:47:06 +02:00
Atgeirr Flø Rasmussen
93256637af Merge pull request #825 from akva2/janitoring
More janitoring
2019-06-19 09:35:49 +02:00
Arne Morten Kvarving
fc4fa45b69 mark constructors explicit 2019-06-19 08:19:56 +02:00
Arne Morten Kvarving
faff634bab use initializer list 2019-06-19 08:19:56 +02:00
Arne Morten Kvarving
b259c807fd remove unused variable 2019-06-19 08:19:56 +02:00
Joakim Hove
ef949aef7e Merge pull request #822 from bska/fix-groupsize-criterion
Array Dimension Checker: Correct Groupsize Criterion
2019-06-18 17:33:30 +02:00
Bård Skaflestad
52881467d6 Array Dimension Checker: Correct Groupsize Criterion
It is perfectly fine to have groups whose size (number of children)
is equal to the declared maximum (Item 4 of WELLDIMS).  It is only
questionable to have groups whose active size exceeds that of the
declared maximum.

Pointy Hat: @bska
2019-06-18 15:31:06 +02:00
Joakim Hove
d2f692ebae Merge pull request #818 from joakim-hove/udq-eval-scalar-wells
UDQSet::eval - make sure to return well node
2019-06-17 18:56:35 +02:00
Joakim Hove
e6d299c726 Merge pull request #821 from akva2/janitoring
remove unused variables
2019-06-17 18:55:12 +02:00
Joakim Hove
a2817325fd Merge pull request #820 from joakim-hove/well2-injector-type
Add Well2::injectorType() accessor
2019-06-17 18:50:18 +02:00
Steinar Foss
ea208bbd56 pybind11: added note to README file. 2019-06-17 09:55:59 +02:00
Steinar Foss
79a5ba09e2 removed sunbeam specific files. 2019-06-17 09:42:01 +02:00
Arne Morten Kvarving
2c82787ee9 remove unused variables
quell warnings
2019-06-17 09:08:47 +02:00
Joakim Hove
1bc47ca8a2 Add Well2 accesor functions which bypass SummaryState 2019-06-17 07:39:23 +02:00
Steinar Foss
d73d0ccc99 added from libecl FindPythonModule/PythonPackage, from pycmake pycmake_test_runner. 2019-06-16 22:00:41 +02:00
Steinar Foss
5bc282d60e removed pycmake. 2019-06-16 19:13:47 +02:00
Joakim Hove
c09bc36c03 UDQSet::eval - make sure to return well node 2019-06-16 08:42:54 +02:00
Joakim Hove
87d13c24f1 Merge pull request #817 from akva2/janitoring
Some janitoring
2019-06-15 07:49:39 +02:00
Joakim Hove
f01ed130af Merge pull request #813 from joakim-hove/udq-eval-set
Udq eval set
2019-06-14 16:55:51 +02:00
Steinar Foss
51b484d930 python/CMakeLists: changed pycmake path. 2019-06-14 16:42:37 +02:00
Arne Morten Kvarving
cc5b74fa94 fix parameter and member name being the same
this might have worked as-is, but it is very very confusing.
change parameter name to make code clearer.
2019-06-14 16:18:47 +02:00
Arne Morten Kvarving
53c1e07edf initialize variables
strictly speaking we throw whenever these are used uninitialized,
but the compiler does not realize -> initialize to quell warnings.
2019-06-14 16:17:41 +02:00
Arne Morten Kvarving
542353b118 remove unused lambda capture
consequently the variable is unused. remove it
2019-06-14 16:17:14 +02:00
Arne Morten Kvarving
2c5d0af37a remove unused lambda capture 2019-06-14 16:16:53 +02:00
Joakim Hove
51a779df67 Merge pull request #816 from joakim-hove/remove-summary-args
Remove unused arguments from EclipseIO::writeTimestep()
2019-06-14 16:05:50 +02:00
Arne Morten Kvarving
7a1ed147f4 fixed: forward struct as struct 2019-06-14 16:05:21 +02:00
Steinar Foss
141aa41e30 added embedded repo pycmake. 2019-06-14 14:45:08 +02:00
Joakim Hove
5748d06914 Remove unused arguments from EclipseIO::writeTimestep() 2019-06-14 14:38:25 +02:00
Steinar Foss
8d2398612b added embedded repo pybind11. 2019-06-14 14:34:20 +02:00
Steinar Foss
327e6c3a5c removed submodules pycmake and pybind11. 2019-06-14 14:32:08 +02:00
Steinar Foss
d45731a205 added option ENABLE_PYTHON. 2019-06-14 13:20:51 +02:00
Joakim Hove
772bd3cee5 UDQ: Ensure that scalar right hand side is accepted into sets 2019-06-14 11:54:12 +02:00
Joakim Hove
83cb209ad8 DeckItem: call set_dim for UDAValue objects 2019-06-14 11:47:59 +02:00
Joakim Hove
49ac8e85d6 DeckItem: improve error message for value type mismatch 2019-06-14 11:47:59 +02:00
Joakim Hove
a19d253aa7 UDQParser: verify the UDQVarType of the expression 2019-06-14 11:47:59 +02:00
Joakim Hove
eb05c5b6aa Add SummaryState argument to Summary fn_args context 2019-06-14 11:47:59 +02:00
Joakim Hove
9087323265 UDQ: add function for string name of UDQ variable types 2019-06-14 11:47:59 +02:00
Joakim Hove
fac74432d4 msim updates:
- add boolean flag report_only to simulation run.
 - add SummaryState argument to well rate callbacks
2019-06-14 11:47:59 +02:00
Joakim Hove
6376e4dcc6 Merge pull request #810 from bska/drop-libeclrestart
Drop "libeclrestart"
2019-06-14 11:17:26 +02:00
Bård Skaflestad
b630ecfb5b RestartIO: Drop LibECLRestart Component
It is no longer needed since both save() and load() now use ERst and
EclOutput.
2019-06-13 16:06:48 +02:00
Bård Skaflestad
8cdc72549d RestartIO: Prune Unused Headers in Public Interface 2019-06-13 16:06:48 +02:00
Bård Skaflestad
6aea354ff4 Merge pull request #811 from tskille/master
Use tolerances from command line for restart array SWEL
2019-06-13 15:32:09 +02:00
Torbjørn Skille
66e8068494 Use tolerances from command line for restart array SWEL 2019-06-12 19:06:52 +02:00
Joakim Hove
193eeca5ff Merge pull request #797 from bska/load-using-ERst
Reimplement RestartIO::load() in Terms of Class ERst
2019-06-12 13:50:22 +02:00
Bård Skaflestad
d1ec2e151c RestartIO::load: Prune 'sim_step' Where Possible 2019-06-12 12:03:55 +02:00
Bård Skaflestad
3d6ace0f97 RestartIO: Reimplement load() in Terms of ERst
This commit reimplements the private RestartFileView class in terms
of the ERst class.  The latter supports all operations we currently
need, although we can no longer use a 'const' object since loading
arrays mutates the ERst instance.

Most changes here are fairly mechanic and most of the new complexity
concerns how to identify a vector (keyword) of a particular element
type.  We make special concessions for INTEHEAD, since this vector
plays a central role in accessing the other data vectors.  The
mutability of RestartFileView is underscored by using shared_ptr<>
in the various helper facilities.
2019-06-12 12:03:55 +02:00
Bård Skaflestad
71c046bef4 Merge pull request #808 from joakim-hove/injection-unitsystem
Add UnitSystem member to Well2 class
2019-06-12 11:46:45 +02:00
Bård Skaflestad
0a3d26e9be Merge pull request #806 from joakim-hove/UDAValue-reset
Uda value reset
2019-06-12 11:02:48 +02:00
Joakim Hove
edbc9d2af7 UDAValue: add reset() methods 2019-06-12 10:13:01 +02:00
Joakim Hove
44e21101bc UDAValue: the get<double>() method will return SI values 2019-06-12 10:13:01 +02:00
Joakim Hove
f3abbf4981 UDAValue: add method assert_numeric() 2019-06-12 10:13:01 +02:00
Bård Skaflestad
ba2a12e876 Merge pull request #795 from joakim-hove/use-eval-timestep
Use eval timestep
2019-06-11 20:34:31 +02:00
Atgeirr Flø Rasmussen
1c14c0d921 Merge pull request #807 from GitPaean/tesing_master
some white space cleaning up
2019-06-11 15:50:28 +02:00
Joakim Hove
3961f724db Add UnitSsystem member to Well2 class 2019-06-08 12:39:22 +02:00
Kai Bao
0c43f49f13 some white space cleaning up 2019-06-07 14:57:54 +02:00
Joakim Hove
08305b6e30 Extract Summary::eval() out from Summary::add_timestep() 2019-06-07 14:45:18 +02:00
Joakim Hove
51bd7a197d Merge pull request #805 from OPM/joakim-hove-patch-1
Update url to equinor repo in submodule
2019-06-07 09:06:52 +02:00
Joakim Hove
498a1bb677 Update url to equinor repo in submodule 2019-06-07 08:43:28 +02:00
Joakim Hove
bab231287e Merge pull request #804 from markusdregi/submodule_fix
Move .gitmodules to root
2019-06-07 08:27:09 +02:00
Markus Fanebust Dregi
ebcac44715 Move .gitmodules to root 2019-06-07 08:26:15 +02:00
Joakim Hove
edfacf2af8 Merge pull request #801 from joakim-hove/uda-operator<<
Add operator<< support to UDAValue
2019-06-06 17:14:08 +02:00
Joakim Hove
40b556112f Add operator<< support to UDAValue 2019-06-06 15:58:36 +02:00
Bård Skaflestad
7413ce5a40 Merge pull request #800 from joakim-hove/add-report-step-accessor
Add public access to report_step in RestartView()
2019-06-06 13:35:13 +02:00
Joakim Hove
66fee23319 Add public access to report_step in RestartView() 2019-06-06 12:19:10 +02:00
Bård Skaflestad
dff91dd742 Merge pull request #798 from joakim-hove/summary-total-fixup
Update total check in SummaryState
2019-06-06 11:06:54 +02:00
Joakim Hove
82f88ce973 Update total check in SummaryState 2019-06-06 09:39:33 +02:00
Bård Skaflestad
b1067dbc98 Merge pull request #793 from joakim-hove/serialize-summary-state
Add serialization of SummaryState
2019-06-05 15:45:13 +02:00
Bård Skaflestad
4cde0ac8a8 Merge pull request #796 from bska/ERst-separate-files
Teach ERst About Separate Restart Files
2019-06-04 23:53:06 +02:00
Bård Skaflestad
a3074d12b5 Teach ERst About Separate Restart Files
This commit makes class 'Opm::EclIO::ERst' able to open separate
restart files (*.X000n, *.F000n).  Specifically, we refactor the
existing class constructor body into a new helper function
'initUnified'.  We add a new helper function 'initSeparate' that
builds the requisite indices in the case of a single report step,
and make the constructor body call 'initUnified' or 'initSeparate'
depending on whether or not the SEQNUM keyword exists in the restart
stream.

Add two new unit tests to exercise the new ability.
2019-06-04 11:01:13 +02:00
Joakim Hove
6af9b00bee Merge pull request #792 from bska/save-using-EclOutput
Re-implement RestartIO::save() in Terms of OutputStream::Restart
2019-06-03 22:57:39 +02:00
Joakim Hove
ec20274fa3 Add serialization of SummaryState 2019-06-03 14:55:38 +02:00
Bård Skaflestad
8d65ba4e49 OutputStream::Restart: Don't Mention 'prepareStep'
The member function does not exist.
2019-06-03 14:19:48 +02:00
Bård Skaflestad
16e49a0223 RestartIO: Reimplement save() in Terms of OutputStream::Restart
This commit switches the file handling operations of the gateway
function RestartIO::save() to using the OutputStream::Restart
component.  Briefly, this means replacing write_kw() function calls
with calls to Restart::write(), especially since the latter natively
handles PaddedString<8> data.
2019-06-03 14:19:48 +02:00
Bård Skaflestad
c98bf7d4c8 Ecl Output: Add write<>() Support for PaddedOutputString<8>
This is in preparation of using the EclOutput output facility in

    RestartIO::save()
2019-06-03 14:19:48 +02:00
Bård Skaflestad
725ac521ba Promote 'CharArrayNullTerm' to EclIO::PaddedOutputString
Space-padded vectors of N (usually 8) characters is the typical
representation of character data in ECLIPSE output files.  Support
this type natively in the ECLIPSE IO library.
2019-06-03 14:19:48 +02:00
Bård Skaflestad
82b0a2d82b ECLIPSE I/O: Rename Namespace Opm::ecl -> Opm::EclIO
This reduces the risk of conflicting with the 'ecl' namespace from
LibECL, especially when the latter name is used from within the Opm
namespace.
2019-06-03 14:19:48 +02:00
Bård Skaflestad
cb106240bf Merge pull request #794 from joakim-hove/summary-state-totals
Correctly detect totals in SummaryState
2019-06-03 14:17:34 +02:00
Joakim Hove
89c8cb886b Correctly detect totals in SummaryState 2019-06-03 12:42:51 +02:00
Bård Skaflestad
9aee2bee71 Merge pull request #668 from joakim-hove/udq-fieldset
UDQ field and group variables
2019-06-03 12:01:37 +02:00
Bård Skaflestad
0757bd97cf Merge pull request #791 from bska/restart-output-code-reformat
Restart Output Code Reformatting
2019-05-29 11:07:17 +02:00
Bård Skaflestad
add1a96d99 Restart Well Data: Restore Indentation
Whitespace only.
2019-05-29 09:28:40 +02:00
Bård Skaflestad
8eda3aaa15 Restart::save(): Prune 'sim_step' Where Possible
Enabled by commit 94b16025.
2019-05-29 09:12:58 +02:00
Joakim Hove
32a1c3b5da Merge pull request #762 from joakim-hove/well-controls
Well controls
2019-05-29 06:46:47 +02:00
Arne Morten Kvarving
7ec2ee9bff Merge pull request #789 from akva2/fix_filesystem_generic
fixed: avoid usage of boost::filesystem::path::generic()
2019-05-28 09:11:37 +02:00
Arne Morten Kvarving
c9d1c50986 fixed: avoid usage of boost::filesystem::path::generic()
this is not supported in older version of boost::filesystem.
furthermore, it was always an experimental feature and
and has been deprecated in newer versions.

generic_string is available in all versions, so use that.
2019-05-28 06:28:57 +02:00
Joakim Hove
48c363dafa Merge pull request #783 from bska/add-restart-io-operations
Add Restart I/O Operations to New ECLIPSE I/O Classes
2019-05-27 23:06:54 +02:00
Bård Skaflestad
a2ec7d7f6d OutputStream::Restart: Pull File Creation Into Constructor
Then we don't have to store copies of the 'formatted' and 'unified'
flags, and are also able to remove the 'prepareStep()' function.  We
will reintroduce these features if we decide to add support for
keeping the output stream open between separate restart output
requests (i.e., between calls to EclipseIO::writeTimeStep()).
2019-05-27 21:00:52 +02:00
Bård Skaflestad
df1a011b78 Redo Public Interface of OutputStream::Restart
In particular, make the stream() function into a private detail of
the implementation and add an overload set for outputting keyword
data and messages to the underlying output stream.  Update unit test
accordingly.

Suggested by: Atgeirr F. Rasmussen
2019-05-27 21:00:52 +02:00
Bård Skaflestad
992d3b0ce5 Restart Output: Add File Management Facility
This commit introduces a new class,

    Opm::ecl::OutputStream::Restart

that handles the details of opening restart output streams (all
combinations of formatted/unformatted and unified/separate), as well
as correctly positioning the stream 'put' indicator if we're opening
an existing unified restart file.  In most cases, this will be a
simple append operation (std::ios_base::app), but there are some
subtleties that require more precise control.  The new class is
befriended by EclOutput and ERst in order to access private member
functions and data members of these classes.  That is needed in
order to handle file resize operations since some of the requisite
information is only available in those two classes.

We use Boost.Filesystem to implement file resize, as if by POSIX
function ::truncate(), and also to simplify filename generation.
These calls can be switched to std::filesystem once the project
requires C++17.

Intended use of the Restart class is

    Restart rst(resultSet, formatted, unified);
    rst.prepareStep(17);  // Report step/SEQNUM 17.

    rst.write("INTEHEAD", ihead);
    // ...

The 'prepareStep' operation opens the file stream (if needed) and
also outputs a SEQNUM record in the case of a unified output stream.
Moreover, the 'resultSet' is a pair of output directory and case's
base name (e.g., "./mpi.np4/2019.05.14.01" and "NORNE_ATW2013") and
the formatted/unified flags are bools wrapped in structures.

The Restart class is intended to take over the role of the
'filename' string parameter of RestartIO::save().

Add a set of unit tests to demontrate usage and abilities of class
Restart.
2019-05-27 21:00:52 +02:00
Bård Skaflestad
c71f57f635 Ecl Output: Add Support for Opening File in Specific Mode
This commit extends the EclOutput constructor to support letting the
client specify a particular open mode.  This in turn prepares using
EclOutput as the basis for a restart file writer.  Passing
mode=openmode::out is the common case for a new restart file, while
mode=openmode::app is the common case for an existing restart file.
2019-05-27 21:00:52 +02:00
Bård Skaflestad
2580a273f4 Ecl Output: Add Support for Generating Messages
Specifically, add a member function

    EclOutput::message(const std::string&)

that outputs the string as an 'eclArrType::MESS'.  This is in order
to support outputting 'STARTSOL' and 'ENDSOL' demarcations in a
restart file.
2019-05-27 21:00:52 +02:00
Bård Skaflestad
b9aeeab005 ERst: Support Retrieving File Position of Particular SEQNUM
This commit introduces a new member function,

    ERst::restartStepWritePosition(seqnum)

that translates a SEQNUM ID into a std::streampos object pointing to
the start of the data for that SEQNUM ID.  Return std::streampos(-1)
if the sequence number exceeds all known sequence numbers in this
restart set.

The member function is private because it is supposed to be called
only by the class itself and a select set of class friends.
2019-05-27 21:00:52 +02:00
Bård Skaflestad
0dfe6ce7da Ecl File: Add Method to Convert Linear Array Index to File Position
This commit introduces a new member function

    EclFile::seekPosition(arrayIndex)

that retrieves the file (seek) position of the start of the header
of the arrayIndex-th keyword.  The expected use case for this is
seeking to the start of a particular SEQNUM value in a unified
restart file.  If the array index exceeds all supported index
values, then we return the position of the file's EOF mark (captured
as the last item in the EclFile constructor).

The member function is protected to be accessible in derived classes
and by friends of derived classes.
2019-05-27 21:00:52 +02:00
Joakim Hove
2682eef9b3 Merge pull request #788 from joakim-hove/remove-welltest
Removed well testing from Schedule constructor
2019-05-27 20:13:45 +02:00
Joakim Hove
8189dd8c9f Merge pull request #785 from joakim-hove/summary-state-num
Add size() and num_wells() methods to SummaryState
2019-05-27 20:13:35 +02:00
Joakim Hove
5c65299c0a Add size() and num_wells() methods to SummaryState 2019-05-27 17:56:27 +02:00
Joakim Hove
35a70310c6 Removed well testing from Schedule constructor 2019-05-27 17:47:55 +02:00
Joakim Hove
54af290cc0 Extend UDQ eval code
With this commit the code to evaluate UDQ values has been extended/refactored in
many ways:

 - There is an increased awarenwss of variable type, i.e. a well related UDQ
   versus a field related UDQ. The variable type flows through the AST, and it
   is verified that the expression to evaluate and the target variable are of
   compatible types.

 - Have added support for UDQ field variables and UDQ group variables.

 - The UDQSet type and the UDQDefine::eval() have been refactored to multiplex
   on all the UDQ types, and the specialized UDQWellSet has been removed.
2019-05-27 16:43:22 +02:00
Joakim Hove
c8b0988191 Add size() and num_wells() methods to SummaryState 2019-05-27 16:43:22 +02:00
Joakim Hove
e6b8e53d0a Merge pull request #786 from joakim-hove/summarystate-group-var
Add group awareness to SummaryState
2019-05-27 16:43:00 +02:00
Joakim Hove
779a2b8d89 Add group awareness to SummaryState 2019-05-27 14:38:13 +02:00
Joakim Hove
0c23aafc34 Merge pull request #784 from joakim-hove/UDQ-test-only-one
UDQ error test - use correct well variablec
2019-05-27 12:32:01 +02:00
Joakim Hove
4439882402 UDQ error test - use correct well variablec 2019-05-27 09:44:14 +02:00
Joakim Hove
8e87ffc7da Merge pull request #781 from akva2/janitoring
Remove unused variables and reduce scope
2019-05-24 15:44:48 +02:00
Joakim Hove
418241137c Rebase fixup 2019-05-24 15:31:27 +02:00
Joakim Hove
01db100439 WellProductionProperties and WellInjectionProperties are private 2019-05-24 15:31:27 +02:00
Joakim Hove
e3d9ef07eb Temporarily reverted UDA -> double in keyword def. 2019-05-24 15:31:27 +02:00
Joakim Hove
51aee6e8cb Add structs InjectionControls and ProductionControls 2019-05-24 15:31:27 +02:00
Joakim Hove
73667596fc Add some testing 2019-05-24 15:31:27 +02:00
Arne Morten Kvarving
9dacc42c8a reduce scope of variables 2019-05-24 14:31:26 +02:00
Arne Morten Kvarving
8fdb08b0ad remove unused variables 2019-05-24 14:31:21 +02:00
Joakim Hove
0942e2dce1 Merge pull request #720 from GitPaean/throw_for_problem_in_compsegs
throw when end distance not bigger than start distance in COMPSEGS
2019-05-24 13:34:45 +02:00
Kai Bao
01c0820d4c addressing reviewing comments from PR#720
and adding more tests
2019-05-24 10:19:50 +02:00
Kai Bao
d11d26a2f1 adding test WrongDistanceCOMPSEGS 2019-05-24 10:19:50 +02:00
Kai Bao
584defebe0 ParseContext is used to handle the exceptions when parsing COMPSEGS 2019-05-24 10:19:50 +02:00
Kai Bao
43c5d3509a throw when end distance not bigger than start distance in COMPSEGS 2019-05-24 10:19:50 +02:00
Joakim Hove
1caf9ecff0 Merge pull request #761 from joakim-hove/sunbeam
Sunbeam import
2019-05-24 09:44:12 +02:00
Bård Skaflestad
51c805d280 Merge pull request #763 from bska/import-eclio-into-common
Import New ECLIPSE I/O Classes Into Main OPM Common Library
2019-05-23 15:07:30 +02:00
Bård Skaflestad
eb24f72e5e Ecl Output: Consume Facilities from 'std' Namespace
No functional changes.
2019-05-23 10:23:02 +02:00
Bård Skaflestad
e654915069 Move ECLIPSE I/O Into Main OPM Common Library
This makes the facility usable for the restart read/write code.

Specifically, import the I/O classes into namespace Opm::ecl, and
place the files in physical location opm/io/eclipse, and move the
test utilities to new top-level directory 'test_util/'.  While here,
discontinue the 'testutil' static library since most of its features
are now available in the main 'opmcommon' library.  This does entail
compiling a few of the test_util/ CPP files multiple times, and
adding the objects to each executable independently.
2019-05-23 10:23:01 +02:00
Joakim Hove
464bc4b795 Merge pull request #731 from joakim-hove/remove-old-well
Remove old well
2019-05-22 23:15:58 +02:00
Joakim Hove
94b160258e Remove old well implementation 2019-05-22 21:44:50 +02:00
Bård Skaflestad
1d31de03c7 Merge pull request #765 from tskille/compareECL
update of compareECL, failes test if output file present for reference
2019-05-22 13:32:10 +02:00
Joakim Hove
ad9cc20258 Merge pull request #779 from joakim-hove/new-keywords
New keywords
2019-05-22 11:52:47 +02:00
Joakim Hove
c0ccd06250 Add keyword GCONSALE 2019-05-22 07:13:57 +02:00
Joakim Hove
eb2c0b7441 Add keyword BRANPROP 2019-05-22 07:13:57 +02:00
Joakim Hove
c986c49113 Add keyword NODEPROP 2019-05-22 07:13:57 +02:00
Joakim Hove
5a31ae874b Add keyword GUIDERAT 2019-05-22 07:13:57 +02:00
Joakim Hove
cd55d69ef7 Add keyword GCONSUMP 2019-05-22 07:13:57 +02:00
Joakim Hove
76acb98c67 Add keyword GPMAINT 2019-05-22 07:13:57 +02:00
Joakim Hove
30a1a0b26e Improve error message for invalid json 2019-05-22 07:13:57 +02:00
Joakim Hove
16dabd5dc4 Merge pull request #777 from joakim-hove/well2-prediction-mode
Add method bool Well2::predictionMode()
2019-05-21 06:52:59 +02:00
Joakim Hove
272d0fc9a1 Merge pull request #776 from joakim-hove/parse-WOPRL
Parse WOPRL
2019-05-20 16:31:35 +02:00
Joakim Hove
8231b84a11 Add method bool Well2::predictionMode() 2019-05-20 16:13:20 +02:00
Joakim Hove
c1f60b769c Split summary keywords WxxxL in separate config 2019-05-20 12:52:05 +02:00
Joakim Hove
d42e86426f Remove extra whitespace 2019-05-20 12:34:37 +02:00
Bård Skaflestad
4010399f08 Merge pull request #773 from tskille/convertECL
Fix issue with missing STARTSOL and ENDSOL headers when converting un…
2019-05-15 16:01:43 +02:00
Bård Skaflestad
5f43a18050 Merge pull request #758 from jalvestad/pvt-type-eclrst
Generalize eclipse compatible restart to a broad set of PVT-options
2019-05-15 13:44:33 +02:00
Torbjørn Skille
cf970df48f Fix issue with missing STARTSOL and ENDSOL headers when converting unified restart files 2019-05-15 10:25:55 +02:00
Atgeirr Flø Rasmussen
c1f4c69c30 Merge pull request #772 from blattms/alternative-clang-fix
Fixes clang linking error when using std::vector<bool>::const_reference.
2019-05-15 09:20:07 +02:00
Joakim Hove
0c70d71df8 Merge pull request #766 from joakim-hove/summary-eval
Split Summary::add_timestep in eval()
2019-05-15 07:02:57 +02:00
Joakim Hove
07b02ed151 Factor out eval() method from Summary::add_timestep() 2019-05-15 06:58:10 +02:00
Bård Skaflestad
2c7eb20726 Merge pull request #724 from jalvestad/cell-summary-props
Changes to provide Summary output of more Block properties
2019-05-14 18:30:36 +02:00
Markus Blatt
255ffc5bba Fixes clang linking error when using std::vector<bool>::const_reference.
Turns out that for clang this is no a bool and therefore a template
specialization is missing. We workaround this by some template (black) magic
that does the explicit instantiation for clang and for others adds another
unused instantiation for char.
2019-05-14 14:12:42 +02:00
Jostein Alvestad
d7e41a5ac0 Remove two tests for initalisation in conflict with more general model 2019-05-14 09:40:13 +02:00
Bård Skaflestad
d554334316 Merge pull request #768 from joakim-hove/summary-state-update
Summary state update
2019-05-13 18:22:02 +02:00
Jostein Alvestad
4989c6cfec Added change to improve code quality
Make sure that the changes made in PVTModel is not overwritten by
variousParam
2019-05-13 15:36:20 +02:00
Jostein Alvestad
c92d74107f Initial changes for allowing all pvt-type data for eclipse restart file 2019-05-13 15:36:19 +02:00
Jostein Alvestad
8126e8cb66 Added initial change to account for different PVT-types in ECL Restart file
Copied changes already made for INIT-file export to restart file export
for eclipse compatible restart file export. The changes apply to
LOGIHEAD and account for whether live oil or wet gas is present
2019-05-13 15:36:18 +02:00
Jostein Alvestad
ba1c30fd4a Added unit tests for grid block summary data variables 2019-05-13 15:29:57 +02:00
Jostein Alvestad
25f25d15bf Added unit tests to new grid block summary properties 2019-05-13 15:29:56 +02:00
Jostein Alvestad
bd58468930 changes to allow Summary output of additional block variables
Allow output of:
BOSAT
BWKR
BOKR
BKRO
BGKR
BKRG
BKRW
BWPC
BGPC
BVWAT
BWVIS
BVGAS
BGVIS
BVOIL
BOVIS

For this to work, appropriate changes to opm-simulators in
ecloutputblackoilmodule.hh needs to be included. This is
made in a separate branch since it belongs to a different repo.
2019-05-13 15:29:56 +02:00
Jostein Alvestad
546517784e Initial changes to add more block props to summary file
this  branch will add
BOSAT
BWKR
BKRW (=BWKR)
BOKR
BKRO (=BOKR)
BGKR
BKRG (=BGKR)
to summary file
2019-05-13 15:29:55 +02:00
Joakim Hove
9e288a9d78 Refactor SummaryState
- Change SummaryState::add() -> SummaryState::update(), the
   SummaryState::update() method is semantically aware of totals.

 - Add an internal variable to the SummaryState class to keep track of the
   elapsed simulation time.
2019-05-13 11:06:32 +02:00
Joakim Hove
294c8aa2f7 Merge pull request #767 from GitPaean/fixing_wconprod
clearning existing controls when handleWCONPROD
2019-05-12 11:58:37 +02:00
Kai Bao
de17c851bc clearning existing controls when handleWCONPROD 2019-05-11 14:07:15 +02:00
Torbjørn Skille
50f907f608 update of compareECL, failes if output file present in reference folder, but not in test folder" 2019-05-10 15:07:04 +02:00
Joakim Hove
38f483ae37 Merge pull request #764 from akva2/janitoring
mark constructors explicit
2019-05-10 14:56:00 +02:00
Arne Morten Kvarving
9b9fc2ef37 mark constructors explicit 2019-05-10 12:43:02 +02:00
Joakim Hove
a8e7c03a4f Merge pull request #740 from joakim-hove/well-static
Add alternative well implementation Well2
2019-05-09 11:07:34 +02:00
Joakim Hove
1c82a8ad39 Add alternative well implementation Well2 2019-05-09 09:20:23 +02:00
Arne Morten Kvarving
0ddf4d675e Merge pull request #703 from akva2/compareECL
Use new ECL I/O classes in compareECL
2019-05-09 08:54:03 +02:00
Bård Skaflestad
bce535c19f Merge pull request #707 from bska/print-pvtfunc-to-init
Structurally Correct PVT Tables in INIT File (Part 2)
2019-05-08 21:24:32 +02:00
Bård Skaflestad
a265a99469 Init File LOGIHEAD: Correctly Set Constant Co Flag
We were simply defaulting this flag to fals for all runs.  While
using constant Co is uncommon for real field models, it does come up
in academic settings.

Pointy Hat: @bska
2019-05-08 11:24:02 +02:00
Bård Skaflestad
7835eeb142 Init File: Activate New PVT Table Normalisation
This commit replaces the existing calls to

    Tables::addPVTO()
    Tables::addPVTG()
    Tables::addPVTW()

with the new umbrella member function

    Tables::addPVTTables()

This, in turn, activates table normalisation for all PV{D,T}{G,O},
PVCDO, and PVTW keywords and produces ECLIPSE compatibly sized TAB
vector representations for these data sources.

As a prerequisite for this work, to enable users such as ResInsight
to correctly interpret the table contents, we need to ensure that
the contents of LOGIHEAD reflect the data sources used to form TAB.
As a consequence, we now control the contents of INTEHEAD, LOGIHEAD,
and DOUBHEAD directly from EclipseIO.cpp rather than from LibECL
library function ecl_init_file_fwrite_header().

We reuse header functionality from the restart files.  This changes
the size of the *HEAD vectors in the init file:

    Vector    Old  New
    INTEHEAD   95  411
    LOGIHEAD   80  121
    DOUBHEAD    1  229

which matches ECLIPSE 2017.2.  Note that this is taking a bit of a
shortcut, because there are items in restart files that differ from
those of the init file.  However, for the items that affect tables,
the items are the same in both init and restart files.  We will need
to refine this at a later point.
2019-05-08 11:24:02 +02:00
Bård Skaflestad
4b8743d10f Eclipse IO: Add Ability to Output vector<bool> Data
Needed to support dynamically controlling contents of LOGIHEAD
vector in the INIT file.
2019-05-08 11:24:02 +02:00
Bård Skaflestad
30733e4966 LogiHEAD: Add Protocol for Communicating PVT and Satfunc Models
This commit introduces two functions,

    LogiHEAD::pvtModel()
    LogiHEAD::saturationFunction()

that set LOGIHEAD flags pertaining to a subset of activated
features.  In particular, we add the ability to control whether or
not a particular run applies to a live/dead oil case, a wet/dry gas
case and/or whether or not a dead oil case is specified in terms of
constant oil compressibility (PVCDO keyword).  Saturation function
flags identify attributes of end-point scaling and directionally
dependent and/or reversible relative permeability functions.

Add unit tests to exercise these features.
2019-05-08 11:24:02 +02:00
Bård Skaflestad
9fe4b23dcb LogiHEAD: Identify Selection of Array Elements
Information mostly gleaned from LibECL's ecl_kw_magic.h.
2019-05-08 11:24:02 +02:00
Arne Morten Kvarving
eb30732444 Merge pull request #753 from tskille/fixESmry
Fixed defect in ESmry constructor.
2019-05-08 10:56:35 +02:00
Joakim Hove
77795b5005 Add 'python/' from commit '278373703455ea6562a0f8e5278b4db46eb1fc7e'
git-subtree-dir: python
git-subtree-mainline: e8dbf7d8ee
git-subtree-split: 2783737034
2019-05-08 07:20:29 +02:00
Atgeirr Flø Rasmussen
e8dbf7d8ee Merge pull request #754 from joakim-hove/whistctl-unknown-well
Internalize a global WHISTCTL setting in the Schedule object
2019-05-03 10:37:55 +02:00
Joakim Hove
0660ced877 Merge pull request #752 from joakim-hove/region-wells-required
Add query function need_wells() in the Summary implementation
2019-05-03 07:18:24 +02:00
Kai Bao
ccd6a2b9da Merge pull request #751 from GitPaean/fixing_over_flow_of_c_string
fixing an overflow problem in EclOutput::make_doub_string
2019-05-02 21:35:13 +02:00
Joakim Hove
452742a6a2 Add query function need_wells() in the Summary implementation 2019-05-02 19:08:26 +02:00
Joakim Hove
0f3dabc3aa Internalize a global WHISTCTL setting in the Schedule object 2019-05-02 16:01:29 +02:00
Torbjørn Skille
49cc815136 Fixed defect in ESmry constructor. Fails when using class on Summary files generated from commercial simulator Eclipse 2019-05-02 10:32:18 +02:00
Kai Bao
a3da1e23a2 fixing an overflow problem in EclOutput::make_doub_string 2019-05-02 10:18:48 +02:00
Joakim Hove
7dba7a50cf Merge pull request #748 from GitPaean/test_WCONHIST_control_mode
modifying the ScheduleTests to handle control mode change with WCONHIST
2019-05-02 10:13:38 +02:00
Kai Bao
8687a8a709 modifying the ScheduleTests to handle control mode change with WCONHIST 2019-05-02 09:25:52 +02:00
Joakim Hove
92caf4f010 Merge pull request #747 from joakim-hove/grouptree<<
Add operator<< to GroupTree class + whitespace
2019-05-01 14:42:26 +02:00
Joakim Hove
894ad7a226 Add operator<< to GroupTree class + whitespace 2019-05-01 13:42:07 +02:00
Bård Skaflestad
a9775f6945 Merge pull request #746 from atgeirr/minor-fixes
Two small but critical fixes
2019-04-30 17:38:03 +02:00
Atgeirr Flø Rasmussen
559783d311 Bugfix: do not keep old control modes.
They will be treated as limits, and cause wrong behaviour.
2019-04-30 14:48:49 +02:00
Joakim Hove
b7b9697fc5 Merge pull request #745 from joakim-hove/upgrade-dune-module
Change version and label in dune.module file
2019-04-30 12:55:45 +02:00
Joakim Hove
35516f1b90 Change version and label in dune.module file 2019-04-30 12:54:45 +02:00
Atgeirr Flø Rasmussen
7a47f7cf2d Add missing standard library includes. 2019-04-30 11:39:21 +02:00
Joakim Hove
0466effc93 Merge pull request #725 from joakim-hove/uda-value
UDA values in the deck
2019-04-30 07:57:08 +02:00
Atgeirr Flø Rasmussen
bf6964522e Merge pull request #744 from bska/continuous-cumulatives-opm-ext-rst
Restart: Provide Continuous Cumulatives in OPM Extended Files
2019-04-29 14:30:40 +02:00
Bård Skaflestad
d08760a922 Restart: Provide Continuous Cumulatives in OPM Extended Files
This commit removes the restriction that cumulative totals are not
output in the case of creating OPM Extended Restart files.  There
was a reason why we did not do this when the new restart facility
was introduced, but that reason no longer applies.
2019-04-28 21:44:13 +02:00
Joakim Hove
b148769cc6 Internalize UDA values in the deck 2019-04-28 16:08:02 +02:00
Joakim Hove
656878d649 Add class UDAValue to hold UDA values from the Deck 2019-04-28 16:08:02 +02:00
Joakim Hove
8f7724409c UDA datatype can only be used with scalar input data 2019-04-28 16:08:02 +02:00
Joakim Hove
de96af682a Rename variable to increase readability 2019-04-28 16:08:02 +02:00
Joakim Hove
f4009fc6d8 Add default constructor for unit Dimension 2019-04-28 16:08:02 +02:00
Arne Morten Kvarving
9d8b08a8d8 Merge pull request #699 from akva2/new_ecl_io
New ECL I/O classes
2019-04-26 09:53:01 +02:00
Bård Skaflestad
605d7399a6 Merge pull request #742 from jalvestad/msw-rstout-corr
An improvement / correction of the writing of MSW data to Eclipse compatible restart file
2019-04-26 08:28:59 +02:00
Jostein Alvestad
58a039c04a Added a improvement to the handling of MSW data for writing to restart file
Improvement to handle more general MSW data  for writing to
Eclipse compatible restart file
2019-04-25 19:14:55 +02:00
Atgeirr Flø Rasmussen
e954836774 Merge pull request #741 from hnil/fixed_unset_return
fixed unset return value causing segfault in release build on ubuntu …
2019-04-25 08:29:52 +02:00
hnil
2d69121b5a fixed unset return value causing segfault in release build on ubuntu 18.10 2019-04-24 13:11:20 +02:00
Joakim Hove
1cde5a4879 Merge pull request #739 from joakim-hove/minor-minor
Misc minor changes: whitespace++
2019-04-23 08:32:02 +02:00
Joakim Hove
fffe259621 Misc minor changes: whitespace++ 2019-04-23 07:25:05 +02:00
Joakim Hove
b955ecf6b4 Merge pull request #737 from joakim-hove/process-segments
Add WellSegments::process() front-end method
2019-04-20 13:14:01 +02:00
Joakim Hove
5cfb91df24 Merge pull request #736 from joakim-hove/remove-branch-number
Remove unused member WellSegments::m_branch_number
2019-04-20 13:13:46 +02:00
Joakim Hove
a4bdba5841 Merge pull request #734 from joakim-hove/del-getwells
Use wellNames() instead of getWells()
2019-04-20 13:12:56 +02:00
Joakim Hove
dcdcc659b2 Merge pull request #738 from joakim-hove/segment-cmp-bug
Fix bug in WellSegments==
2019-04-20 12:59:22 +02:00
Joakim Hove
e833377bea Fix bug in WellSegments== 2019-04-20 10:55:22 +02:00
Joakim Hove
fbece57167 Add WellSegments::process() front-end method 2019-04-19 12:35:10 +02:00
Joakim Hove
54f45eaba7 Remove unused member WellSegments::m_branch_number 2019-04-19 12:03:01 +02:00
Joakim Hove
7aa55f86a0 Merge pull request #735 from joakim-hove/FLUXNUM
Add configuration for keyword FLUXTYPE
2019-04-19 12:02:30 +02:00
Joakim Hove
c3bd4b9e3a Add configuration for keyword FLUXTYPE 2019-04-19 10:57:23 +02:00
Joakim Hove
688edd6f63 Remove well iteration out of function 2019-04-19 08:08:22 +02:00
Joakim Hove
c1af5a313f Use wellNames() instead of getWells() 2019-04-19 07:24:10 +02:00
Joakim Hove
167a7a8c38 Merge pull request #733 from joakim-hove/use-wellname
Use wellname in Group::addWell()
2019-04-18 21:12:29 +02:00
Joakim Hove
abc674d40f Merge pull request #732 from joakim-hove/use-to_bool
Use DeckItem::to_bool( )
2019-04-18 21:11:49 +02:00
Joakim Hove
9c93a9349c Use wellname in Group::addWell() 2019-04-18 16:45:24 +02:00
Joakim Hove
44f8a5d94e Use DeckItem::to_bool( ) 2019-04-18 16:24:54 +02:00
Joakim Hove
7ef2d8b9a3 Merge pull request #729 from joakim-hove/dynamic-state-unique
Implement unique() method on DynamicState
2019-04-18 08:57:06 +02:00
Joakim Hove
efb8375bac Merge pull request #730 from joakim-hove/white-space
White space
2019-04-18 08:56:07 +02:00
Joakim Hove
eff44e4fdc White space 2019-04-18 08:29:10 +02:00
Joakim Hove
d5f240050a Implement unique() method on DynamicState 2019-04-18 08:09:31 +02:00
Joakim Hove
454a933b5a Merge pull request #727 from joakim-hove/get-child-wells
Remove Schedule::getWells(group, step)
2019-04-17 15:50:49 +02:00
Joakim Hove
5e76f624ef Remove Schedule::getWells(group, step) 2019-04-17 14:47:00 +02:00
Joakim Hove
14168f3ea6 Merge pull request #728 from joakim-hove/inline-ncwmax
Inline Schedule::getMaxNumCompletionsForWells() in test
2019-04-17 14:29:50 +02:00
Joakim Hove
b5dbc3d8e5 Delete unused code for ?CON serialization 2019-04-17 14:28:58 +02:00
Joakim Hove
34dfbee01b Merge pull request #726 from joakim-hove/parse-invalid-keyword
Add "size" : 1 attribute to CARFIN keyword
2019-04-17 07:20:27 +02:00
Joakim Hove
027be42f70 Add "size" : 1 attribute to CARFIN keyword 2019-04-17 06:38:34 +02:00
Bård Skaflestad
eef4cad54f Merge pull request #722 from blattms/remove-warnings-g++-8.3
Removes nearly all warnings experienced with g++-8.3
2019-04-12 23:09:12 +02:00
Markus Blatt
19ccc21786 Reintroduce overeagerly removed const qualifiers before function parameters.
Actually, the compiler does not complain about const in void func(const T type).
It just complains about const qualifiers before by-value return types.
2019-04-12 21:31:51 +02:00
Markus Blatt
521838dbdd reintroduce some const with elegance 2019-04-12 21:14:36 +02:00
Markus Blatt
393a543ed5 Removes nearly all warnings experienced with g++-8.3
Namely:
- unused parameter
- type qualifiers ignored ...
- catchinhg polymorphic type ... by value
2019-04-12 13:37:03 +02:00
Joakim Hove
b562bef1af Merge pull request #719 from joakim-hove/aquancon-segfault
Aquancon segfault
2019-04-11 15:29:02 +02:00
Andreas Lauser
414b6820b4 Merge pull request #721 from andlaus/fix_FILEUNIT
fix FILEUNIT
2019-04-11 14:51:04 +02:00
Andreas Lauser
5dbc22484e fix FILEUNIT
the FILEUNIT functionality currently does not work because the name of
the unit system specified by the keyword is almost always fully
capitalized (e.g., "FIELD"), while the name of the unit system
returned by the parser isn't (e.g., "Field"). This patch "fixes" this
by simply capitalizing all strings.
2019-04-11 14:20:44 +02:00
Joakim Hove
8b838264dd Add comment about face when comparing AQUANCON records 2019-04-11 14:09:28 +02:00
Joakim Hove
c533e1206f Protect against nullptr access when combining AQUANCON records 2019-04-11 14:09:28 +02:00
Joakim Hove
d87f9edf60 Minor refactor of temporary variable
- Move declaration inside { ... } scope
 - Use vector.push_back() instead of resize() and at()
2019-04-11 14:09:15 +02:00
Joakim Hove
dbff25f79b Remove m_ prefix from local variables 2019-04-11 14:03:08 +02:00
Joakim Hove
4b657fc4cf Use reference instead of value 2019-04-11 14:03:08 +02:00
Joakim Hove
a4e66a5484 White space change 2019-04-11 14:03:08 +02:00
Joakim Hove
226bfbe524 Merge pull request #718 from joakim-hove/weltarg
Weltarg
2019-04-11 12:14:23 +02:00
Joakim Hove
164ab30fa1 The WELTARG treatment is moved out from Schedule.cpp 2019-04-11 12:13:43 +02:00
Joakim Hove
d5ce2b6a76 Merge pull request #713 from joakim-hove/cjson-update
Update cJSON library to version 1.7.10
2019-04-10 09:19:36 +02:00
Joakim Hove
2997338eb2 Merge pull request #712 from joakim-hove/udq-tokens
Internalize UDQ tokens in the UDQ define keyword
2019-04-09 18:29:27 +02:00
Joakim Hove
ebedc9b0b6 Merge pull request #711 from joakim-hove/prod-properties-refactor
Refactor WellProductionProperties construction
2019-04-09 18:27:04 +02:00
Joakim Hove
ac58d8428c Refactor WellProductionProperties construction
Use default copy constructor and handleWCONPROD() and handleWCONHIST() for
prediction and history wells respectively.
2019-04-09 17:25:00 +02:00
Joakim Hove
ba58cbc166 Update cJSON library to version 1.7.10 2019-04-09 00:34:49 +02:00
Joakim Hove
bd0c0f6356 Internalize UDQ tokens in the UDQ define keyword 2019-04-08 15:12:15 +02:00
Torbjørn Skille
135f2d491a remove unused summary comparison classes 2019-04-08 11:38:34 +02:00
Torbjørn Skille
fbfac1f797 update compareECL to use new ECL I/O classes 2019-04-08 11:38:34 +02:00
Torbjørn Skille
4768f72400 added: new utility convertECL
for converting between formatted and binary ecl files
2019-04-08 11:36:20 +02:00
Torbjørn Skille
db142f698b added: ESmry class for reading summary data from ECL files 2019-04-08 11:36:20 +02:00
Torbjørn Skille
c54cb2195b added: ERst class for reading restart simulation data from ECL files 2019-04-08 11:36:20 +02:00
Torbjørn Skille
24a8efb2e3 added: ERft class for reading RFT simulation data from ECL files 2019-04-08 11:36:20 +02:00
Torbjørn Skille
181eeffbdb added: EGrid class for reading GRID data from ECL files 2019-04-08 11:36:20 +02:00
Torbjørn Skille
46f2542487 finish class EclFile
this is a base class for ECL I/O classes
2019-04-08 11:36:20 +02:00
Torbjørn Skille
6d1b2f3f4f added: EclOutput class for writing ECL files 2019-04-08 11:36:20 +02:00
Torbjørn Skille
188f78f2d6 add some common utilities used by Ecl IO classes 2019-04-08 11:36:20 +02:00
Joakim Hove
de9a93377c Merge pull request #710 from andlaus/implement_FILEUNIT
Implement FILEUNIT
2019-04-05 12:07:19 +02:00
Atgeirr Flø Rasmussen
55057540e2 Merge pull request #709 from bska/restart_msw_fix
RSEG: Index Results by Segment Number
2019-04-05 10:49:20 +02:00
Andreas Lauser
fe1272a2e6 add the FILEUNIT keyword
currently, this keyword is basically ignored: setting the unit system
of a file to something different than the deck unit system will cause
`Opm::checkDeck()` to produce a warning.
2019-04-04 16:55:19 +02:00
Andreas Lauser
c25275d0ee add parseContext and errorGuard parameters to Opm::checkDeck()
this requires a small downstream cleanup.
2019-04-04 16:55:19 +02:00
Bård Skaflestad
ffba48d7f2 RSEG: Index Results by Segment Number
This commit switches the segment result reload code to indexing the
RSEG vector primarily by the segment number from the input file.
The original scheme of using the linear index and extracting the
segment number from ISEG was based on a terrible misunderstanding [%].

This is the second half of commit 0a730d94 (PR #697)

[%] Pointy Hat: @bska
2019-04-04 15:26:15 +02:00
Joakim Hove
dbfad81253 Merge pull request #700 from bska/print-pvtfunc-to-init-pt1
Structurally Correct PVT Tables in INIT File (Part 1)
2019-04-04 15:11:20 +02:00
Joakim Hove
a0aafc5d5b Merge pull request #672 from jalvestad/restart_conn_test
Unit tests for writing well connection data to Eclipse Compatible restart file
2019-04-04 15:06:00 +02:00
Andreas Lauser
9afaa32ca7 checkDeck(): only require a const reference to the deck 2019-04-04 14:17:30 +02:00
Bård Skaflestad
68a254ffdc Create Prop-Func Table: Elucidate Motives for Unusual Loop Counters
Thanks to my colleague Francesca Watson for wording assistance.
2019-04-04 14:11:07 +02:00
Bård Skaflestad
4dafe9456a Create Prop-Func Table: Switch to std::function
This commit switches to using the explicit type std::function rather
than an implied callable entity whose interface is defined only in a
comment.  That adds compiler type checking at the cost of (possibly)
introducing virtual function calls.  The size overhead in the object
file is mostly negligible in Release mode.

Suggested by: [at]joakim-hove
2019-04-04 14:11:07 +02:00
Bård Skaflestad
8e49c35c18 Create Prop-Func Table: Prune Vacuous Assignment
Left over from when the function was extracted from the saturation
function code.  While here, fix an incorrect comment that mistakenly
implied that the primary key of PVTO is pressure rather than the
dissolved gas/oil ratio (Rs), and correct a type in 'composition'.
2019-04-04 14:11:07 +02:00
Bård Skaflestad
25d7b538aa Tables: Add Structurally Correct Gas PVT Output from PVTG
This commit expands the private member function

    Tables::addGasPVTTables(const EclipseState&)

to create structurally correct TAB vector entries from the PVTG
(wet gas) input table data when gas is an active phase in a
simulation run.  Specifically, the main result array has the columns

    [ Rv, 1/Bg, 1/(Bg*mu_g), d(1/Bg)/dRv, d(1/(Bg*mu_g))/dRv ]

and the ancillary table (base pointer JBPVTG) holds the gas pressure
nodes.

Note that while we do create structurally correct output tables, we
do not fill in undersaturated states that have been defaulted in the
input table.

The number of table rows in the main table is equal to number of PVT
regions times the number of declared pressure nodes (TABDIMS item 4,
NPPVT) times the number of declared composition nodes (TABDIMS item
6, NRPVT).  In other words, the main result array is expanded to
fill NRPVT rows per gas pressure node per PVT region.  Fill value
-2.0e+20.  We have verified the results with ECLIPSE 100.  The
ancillary table is expanded to the number of declared pressure nodes
for each PVT region.  Here the fill value is +2.0e+20.

As an OPM extension, we will use the maximum number of active
composition and pressure nodes across all PVTG tables if the
declared maximum pressure nodes in TABDIMS is too small.  This will
create TAB vector representations that are not compatible with
ECLIPSE, but which will nevertheless be useful in the context of
ResInsight's flux calculation.

Add unit tests for all gas-related PVT tables.
2019-04-04 14:11:07 +02:00
Bård Skaflestad
877ff028be Tables: Add Structurally Correct Gas PVT Output from PVDG
This commit expands the public member function

    Tables::addPVTTables(const EclipseState&)

to call into a new private member function

    Tables::addGasPVTTables(const EclipseState&)

which will create structurally correct TAB vector entries from the
PVDG (dry gas) input table data when gas is an active phase in a
simulation run.  Specifically, the result array has the columns

    [ Pg, 1/Bg, 1/(Bg*mu_g), d(1/Bg)/dPg, d(1/(Bg*mu_g))/dPg ]

The number of table rows is equal to number of PVT regions times the
number of pressure nodes declared in input keyword TABDIMS (NPPVT,
Item 4).  In other words, the result array is expanded to fill NPPVT
rows per PVT region.  Fill value +2.0e+20.  We have verified the
results with ECLIPSE 100.

As an OPM extension, we will use the maximum number of active
pressure nodes across all PVDG tables if the declared maximum
pressure nodes in TABDIMS is too small.  This will create a TAB
vector that is not compatible with ECLIPSE, but which will
nevertheless be useful in the context of ResInsight's flux
calculation.
2019-04-04 14:11:07 +02:00
Bård Skaflestad
c5eca4b1e4 Tables: Add Structurally Correct Oil PVT Output from PVTO
This commit expands the private member function

    Tables::addOilPVTTables(const EclipseState&)

to create structurally correct TAB vector entries from the PVTO
(live oil) input table data when oil is an active phase in a
simulation run.  Specifically, the main result array has the columns

    [ Po, 1/Bo, 1/(Bo*mu_o), d(1/Bo)/dPo, d(1/(Bo*mu_o))/dPo ]

and the ancillary table (base pointer JBPVTO) holds the composition
nodes.

Note that while we do create structurally correct output tables, we
do not fill in undersaturated states that have been defaulted in the
input table.

The number of table rows in the main table is equal to number of PVT
regions times the number of declared composition nodes (TABDIMS item
6, NRPVT) times the number of declared pressure nodes (TABDIMS item
4, NPPVT).  In other words, the main result array is expanded to
fill NPPVT rows per Rs node per PVT region.  Fill value +2.0e+20.
We have verified the results with ECLIPSE 100.  The ancillary table
is expanded to number of declared composition nodes for each PVT
region.  Fill value +2.0e+20.

As an OPM extension, we will use the maximum number of active
pressure and composition nodes across all PVTO tables if the
declared maximum pressure nodes in TABDIMS is too small.  This will
create a TAB vector representations that are not compatible with
ECLIPSE, but which will nevertheless be useful in the context of
ResInsight's flux calculation.

Add unit tests for all supported oil-related PVT tables.
2019-04-04 14:11:07 +02:00
Bård Skaflestad
b4915e7b55 Tables: Add Structurally Correct Oil PVT Output from PVDO
This commit expands the private member function

    Tables::addOilPVTTables(const EclipseState&)

to create structurally correct TAB vector entries from the PVDO
(dead oil) input table data when oil is an active phase in a
simulation run.  Specifically, the result array has the columns

    [ Po, 1/Bo, 1/(Bo*mu_o), d(1/Bo)/dPo, d(1/(Bo*mu_o))/dPo ]

The number of table rows is equal to number of PVT regions times the
number of pressure nodes declared in input keyword TABDIMS (NPPVT,
Item 4).  In other words, the result array is expanded to fill NPPVT
rows per PVT region.  Fill value +2.0e+20.  We have verified the
results with ECLIPSE 100.

As an OPM extension, we will use the maximum number of active
pressure nodes across all PVDO tables if the declared maximum
pressure nodes in TABDIMS is too small.  This will create a TAB
vector that is not compatible with ECLIPSE, but which will
nevertheless be useful in the context of ResInsight's flux
calculation.
2019-04-04 14:11:07 +02:00
Bård Skaflestad
b2a37d1e54 Tables: Add Structurally Correct Oil PVT Output from PVCDO
This commit expands the public member function

    Tables::addPVTTables(const EclipseState&)

to call into a new private member function

    Tables::addOilPVTTables(const EclipseState&)

which will create structurally correct TAB vector entries from the
PVCDO input table data when oil is an active phase in a simulation
run.  Specifically, the result array has the columns

    [ Po, Bo, Co, mu_o, Cv ]

in which 'Co' denotes the oil compressibility and 'Cv' denotes the
oil viscosibility.  The number of table rows is equal to number of
PVT regions times the number of pressure nodes declared in input
keyword TABDIMS (NPPVT, Item 4).  In other words, the result array
is a copy of the input table but expanded to fill NPPVT rows per PVT
region.  Fill value -1.0e+20.  We have verified the results with
ECLIPSE 100.

At present the function is not called by Flow's INIT file writer.
2019-04-04 14:11:07 +02:00
Bård Skaflestad
466341fa0f Tables: Add Structurally Correct Water PVT Output
This commit adds a new public member function

    Tables::addPVTTables(const EclipseState&)

that calls into a new private member function

    Tables::addWaterPVTTables(const EclipseState&)

to create structurally correct TAB vector entries from the PVTW
input table data when water is an active phase in a simulation run.
Specifically, the result array has the columns

    [ Pw, 1/Bw, Cw, 1/(Bw * mu_w), Cw - Cv ]

in which 'Cw' denotes the water compressibility and 'Cv' denotes the
water viscosibility.  Column 4 and 5 follow ECLIPSE 100 conventions.
Number of table rows equal to number of PVT regions.  This result
array differs from the existing Tables::addPVTW() member function in
the treatment of viscosity and viscosibility data.  We have verified
the results with ECLIPSE 100.

At present the function is not called by Flow's INIT file writer.

Add a unit test to exercise the new member function.
2019-04-04 14:11:07 +02:00
Bård Skaflestad
c279184229 Tables: Make Table Constructor More Generally Callable
In particular, expose the internals of

    SatFunc::detail::createSatfuncTable()

as a new free function, createPropfuncTable().  The latter knows
about sub-tables as present in live oil (PVTO) and wet gas (PVTG)
input data and will loop over all primary keys of a single table
(i.e., region) before advancing to the next table.

The primary purpose of createPropfuncTable() is to support creating
the normalised (ECLIPSE 100 style) INIT file tables for PVT data.
2019-04-04 14:11:07 +02:00
Bård Skaflestad
bd73bb6c55 Linearised Table: Add Constructor with User-Defined Fill Value
Reimplement original constructor in terms of the new constructor.
The main purpose of the new constructor is to support PVT tables
which use a fill/padding value different from 1.0e+20.
2019-04-04 14:11:07 +02:00
Joakim Hove
78170ccfce Merge pull request #704 from joakim-hove/rft_config
Add class RFTConfig
2019-04-04 14:05:07 +02:00
Joakim Hove
7852e584f9 Slight reorganisation to avoid possible memory leak 2019-04-03 19:46:08 +02:00
Joakim Hove
a9bb73559d Use RFTConfig instead of per well RFT configuration 2019-04-03 19:46:08 +02:00
Joakim Hove
be36439600 Add class RFTConfig to manage when RFTs should be created 2019-04-03 19:46:07 +02:00
Joakim Hove
9e40f3be4f Add DynamicState::find_if() 2019-04-03 19:46:07 +02:00
Joakim Hove
0d172c9a1c Merge pull request #705 from totto82/fix_well_event2
update well event also for WCONINJH
2019-04-02 17:51:00 +02:00
Joakim Hove
ad6c98e0da Merge pull request #706 from totto82/fix_overburd
Fix the unit of the overburden pressure
2019-04-02 17:50:17 +02:00
Tor Harald Sandve
8fb0e1e222 Fix overburden units 2019-04-02 13:42:38 +02:00
Tor Harald Sandve
d7bd8d25cd update well event also for WCONINJH 2019-04-02 13:40:47 +02:00
Bård Skaflestad
d0d6d57472 Merge pull request #695 from joakim-hove/data-type-UDA
Input Data type uda
2019-04-01 19:53:22 +02:00
Joakim Hove
0923ffeef2 Replace std::endl with \n in code generator 2019-04-01 18:32:06 +02:00
Joakim Hove
7a158fc45c Use UDA datatype in the keyword configuration 2019-04-01 18:32:06 +02:00
Joakim Hove
fdac0f576c Add input type UDA -> double 2019-04-01 18:32:06 +02:00
Joakim Hove
e6aecbd7ac ParserItem: differentiate between input type and internal data type
Differentiate between the input type, as specified in the json configuration
file, and the internal native type used to store data. This is a many-to-one
mapping, where e.g. both the input types STRING and RAW_STRING map to the
internal datatype std::string.

Additional changes:

 - Have removed several ParserItem() constructors.
 - The size_type::SINGLE is default for a ParserItem, and not set explicitly in
   the generated ParserKeywords.cpp file.
 - Have removed a call to boost::lexical_cast<> - just use std::to_string()
2019-04-01 18:32:06 +02:00
Jostein Alvestad
5083db3715 Has added name for integer shift values as requested 2019-04-01 16:09:30 +02:00
Jostein Alvestad
1247309b3f Corrections / improvments according to comments from maintaniners 2019-04-01 14:52:27 +02:00
Jostein Alvestad
a1365ffc99 Added test to account for inactive well connections
That is handling of well connections that are defined by COMPDAT
and that become inactive of some reason.
2019-04-01 14:52:27 +02:00
Jostein Alvestad
4b62303f36 Added unit tests for the writing of well connection data
That is writing well connection data to eclipse compatible restart file
2019-04-01 14:52:26 +02:00
Jostein Alvestad
d7249ea6e6 Initial work on unit tests for well connection data to restart file
Establish framework and test data
2019-04-01 14:52:25 +02:00
Joakim Hove
810aa6970b Merge pull request #702 from joakim-hove/udq-summary-bug
Section keyword 'SUMMARY' was incorrectly identified as UDQ a keyword
2019-03-29 17:12:36 +01:00
Joakim Hove
598b5b1ff4 Section keyword 'SUMMARY' was incorrectly identified as UDQ a keyword 2019-03-29 15:40:37 +01:00
Joakim Hove
5734923b1e Add size() method to SummaryConfig class 2019-03-29 15:40:37 +01:00
Joakim Hove
4eb41c569e Merge pull request #692 from andlaus/add_SWLPC_et_all
add the S[WG]LPC and IS[WG]LPC keywords
2019-03-28 14:32:51 +01:00
Arne Morten Kvarving
85f13c3e64 Merge pull request #698 from akva2/extra_cmake_params_jenkins
added: array of extra cmake parameters for each module
2019-03-28 14:22:38 +01:00
Joakim Hove
01090a8722 Merge pull request #693 from andlaus/add_THPRESFT
add the THPRESFT keyword
2019-03-28 12:57:43 +01:00
Andreas Lauser
2b4212bac0 add comment about the value of the SWLPC keywords being sometimes wrong
This is a corner case that I don't think will matter in practice.
2019-03-28 12:01:41 +01:00
Arne Morten Kvarving
4bee03be6f added: array of extra cmake parameters for each module
use this to enable ebos extensions in opm-simulators
2019-03-28 11:45:40 +01:00
Andreas Lauser
7360755c63 fix detection of mixed satfunc family usage
We now simply complain if the deck features keywords from more than
one family.
2019-03-28 09:37:25 +01:00
Andreas Lauser
f7cf50830d add the THPRESFT keyword
it is like THPRES, but for faults instead of PVT regions.
2019-03-28 09:37:00 +01:00
Joakim Hove
21dbd82bb9 Merge pull request #697 from jalvestad/restart_msw_fix
Added a fix for an index error in writing of RSEG data to ECL Restart file
2019-03-27 20:24:18 +01:00
Jostein Alvestad
0a730d949f Added correction to segment number index for RSEG
Added correction to segment number index
for writing of RSEG data to eclipse compatible
restart file. AggregateMSWData.cpp
2019-03-27 16:59:35 +01:00
Jostein Alvestad
ba1f9e882b Back to master equal to upstream 2019-03-27 16:56:57 +01:00
Jostein Alvestad
745720ef99 Added correction to writing MSW data to restart file
Corrected segment number index for writing of
RSEG data to eclipse compatible restart file
in AggregateMSWData.cpp
2019-03-27 16:52:49 +01:00
Andrea Brambilla
2783737034 Fixed travis build status in README.md 2019-03-27 13:41:06 +01:00
Tor Harald Sandve
3595eb7c82 Merge pull request #685 from totto82/refactorBC
Combine BCRATE and FREEBC to BC
2019-03-27 10:21:46 +01:00
Joakim Hove
75d28fc6ce Merge pull request #691 from joakim-hove/wellproperties-constructor
Wellproperties constructor
2019-03-26 21:07:51 +01:00
Andreas Lauser
ade0cd059e add the S[WG]LPC and IS[WG]LPC keywords
they are just like their non-PC postfixed counterparts, except that
they only apply to capillary pressures, not to the relperms and they
seem to overwrite the values specified via S[WG]L for the capillary
pressures but not for relperms.
2019-03-25 11:36:02 +01:00
Joakim Hove
daf9337599 Extract phase dependent SI conversion to separate file 2019-03-25 10:36:40 +01:00
Joakim Hove
9bff0094f1 Extract WellInjectionProperties from Schedule.cpp 2019-03-25 10:36:16 +01:00
Joakim Hove
c3e992f996 Use constructor for WellProductionProperties 2019-03-25 10:23:13 +01:00
Joakim Hove
d9c81da18c Merge pull request #690 from joakim-hove/use-wellnames
Use wellnames
2019-03-25 10:20:06 +01:00
Joakim Hove
94fae0da30 Remove Schedule::getWells(pattern) 2019-03-24 07:54:39 +01:00
Joakim Hove
6cd420ed9b All Schedule::handleWxxxx() functions go via well name 2019-03-24 07:54:33 +01:00
Joakim Hove
19dde5e6d3 Add Schedule::wellNames() overloads 2019-03-24 07:54:33 +01:00
Joakim Hove
5b1065df45 For a connection set with 0 connections is "OPEN" 2019-03-23 16:13:11 +01:00
Joakim Hove
e452058b4e Merge pull request #686 from totto82/fix_units_fip
Output FIP as surface volumes
2019-03-21 17:54:14 +01:00
Joakim Hove
e84edae209 Merge pull request #688 from joakim-hove/remove-well-events
Remove well events
2019-03-21 14:51:58 +01:00
Joakim Hove
a3f08ca6ea Disable POLYMER related events 2019-03-21 13:08:25 +01:00
Joakim Hove
858e06044e Move well specific event logging from Well to Schedule 2019-03-21 13:08:25 +01:00
Joakim Hove
1812acccec Merge pull request #684 from joakim-hove/update-testdata
Add PERM values to testdata
2019-03-20 15:38:43 +01:00
Joakim Hove
1d402bdca3 Add PERM values to testdata 2019-03-20 15:10:08 +01:00
Tor Harald Sandve
d24c327a90 Output FIP as surface volumes 2019-03-20 15:06:54 +01:00
Bård Skaflestad
fe12e48b5c Merge pull request #683 from joakim-hove/udq-define-bug
Fix bug with ouf of bounds access in UDQ parser

Fixes: #682
2019-03-20 09:21:25 +01:00
Tor Harald Sandve
088f8ff9e0 Combine BCRATE and FREEBC to BC 2019-03-20 08:49:21 +01:00
Joakim Hove
57c1c2d984 Merge pull request #680 from joakim-hove/enable-welltest
Add optional code for well testing
2019-03-19 17:53:30 +01:00
Joakim Hove
7335d72e8b Fix bug with ouf of bounds access in UDQ parser 2019-03-19 17:05:59 +01:00
Joakim Hove
b741a73957 Merge pull request #679 from joakim-hove/remove-totno-conn
Removed well property total number of connections
2019-03-19 16:52:50 +01:00
Joakim Hove
bf971c0ede Pass -DENABLE_WELL_TEST when coniguring jenkins build 2019-03-19 16:51:46 +01:00
Joakim Hove
c910a51359 Add optional code for well testing 2019-03-19 16:51:46 +01:00
Joakim Hove
a73e82110c Merge pull request #681 from joakim-hove/well-static-util
Well static util
2019-03-18 17:11:34 +01:00
Tor Harald Sandve
daa67dc8d6 Add parser support for water induced rock compaction (#676)
Add support for water induced rock compaction
2019-03-18 17:08:38 +01:00
Joakim Hove
eb15695ed0 Removed well property total number of connections
For the output code the total number of connections entered in the input deck is
required, we therefor keep track of the number of connections filtered out due
to inactive cells - and return the total in WellConnection::inputSize()
2019-03-18 15:44:18 +01:00
Joakim Hove
75e196cdd8 Add PERM values to testdata 2019-03-18 14:46:03 +01:00
Joakim Hove
00cc2b9075 Remove unused keywords from test input 2019-03-18 11:24:02 +01:00
Joakim Hove
53c29e56d4 Wellname pattern '*' should not be interpreted as WLIST 2019-03-18 10:44:11 +01:00
Joakim Hove
205c4a94db Add method DynamicState::find_not() 2019-03-18 10:34:18 +01:00
Joakim Hove
25522dc424 Add to_bool(string) function 2019-03-18 10:34:18 +01:00
Joakim Hove
5421efd79d Merge pull request #677 from joakim-hove/well-names
Implement Schedule::wellNames()
2019-03-17 08:03:25 +01:00
Joakim Hove
c5935c97f6 Implement Schedule::wellNames() 2019-03-17 07:26:40 +01:00
Joakim Hove
fa77187871 Merge pull request #656 from joakim-hove/udq-parse
UDQ: Complete well related UDQ's
2019-03-14 13:45:55 +01:00
Joakim Hove
345452109f Merge pull request #678 from akva2/janitoring
fix warnings
2019-03-14 13:30:44 +01:00
Arne Morten Kvarving
4d8f75e24d fix warnings
- signed/unsigned comparisons
- unused variables
- unused typedefs
2019-03-14 13:06:57 +01:00
Joakim Hove
c9821faddc Changed UDQDefine to take UDQParams argument 2019-03-14 12:40:57 +01:00
Joakim Hove
ef5f90c12b Add ParseContext and ErrorGuard arguments to UDQDefine 2019-03-14 12:40:57 +01:00
Joakim Hove
066dca43ba UDQ Parsing - rest 2019-03-14 12:40:57 +01:00
Joakim Hove
16c9d7d04d UDQFunctionTable: const arg + default constructor 2019-03-14 09:28:26 +01:00
Joakim Hove
2a07a2e8a2 Removed extra pow function in functiontable 2019-03-14 09:28:26 +01:00
Joakim Hove
118f4dd3de Update eval_udq() in Summary 2019-03-14 09:28:26 +01:00
Joakim Hove
7a2c1157a0 Merge pull request #673 from joakim-hove/udq-parsecontext
Udq parsecontext
2019-03-14 09:27:30 +01:00
Joakim Hove
0caf039bcb Merge pull request #670 from joakim-hove/ordered-map
Change OrderMap to more closely resemble std::map
2019-03-11 11:37:43 +01:00
Joakim Hove
f80b220b44 Change OrderMap to more closely resemble std::map
- Removed the hasKey() and get() methods.
 - Key type is a template parameter
 - insert takes a pair
 - implement count()
 - implement find()
 - implement operator[]
 - implement erase
2019-03-11 10:34:04 +01:00
Joakim Hove
3542d43c72 Merge pull request #675 from joakim-hove/aquifer-include
Aquifer include
2019-03-11 10:20:39 +01:00
Joakim Hove
8c6cfdc704 Forward declare EclipseState in AquiferCT header 2019-03-11 08:58:43 +01:00
Joakim Hove
f38e1511b5 White space 2019-03-11 08:54:33 +01:00
Joakim Hove
130208b20e Merge pull request #669 from totto82/fix_bgsat
Fix bgsat
2019-03-11 06:51:56 +01:00
Joakim Hove
094f17532d Check if UDQ unit is assigned before 2019-03-09 10:19:27 +01:00
Joakim Hove
f4196ff25e Add ParseContext for undefined UDQ 2019-03-09 10:19:11 +01:00
Joakim Hove
25d7e99413 Add UDQInput methods has_keyword() and has_unit() 2019-03-09 10:19:03 +01:00
Joakim Hove
b4edd0acda White space 2019-03-09 09:01:21 +01:00
Joakim Hove
9c5acbb304 Merge pull request #649 from jalvestad/restart_msw_test
Unit tests for writing of multisegment well (MSW) data to Eclipse Compatible restart file.
2019-03-08 21:04:33 +01:00
Joakim Hove
1ecd62d98d Merge pull request #667 from joakim-hove/move-wells
Move all well related files to subfolder Well/
2019-03-08 12:42:08 +01:00
Joakim Hove
f293bcfc3c Merge pull request #666 from andlaus/add_DEFAULT_ENABLE_IF
opm_add_test(): add condition to specify if a test ought to be compiled by default
2019-03-08 10:31:50 +01:00
Tor Harald Sandve
7e70d85c83 Fix bgsat 2019-03-08 08:52:23 +01:00
Joakim Hove
595efe7e48 Merge pull request #665 from joakim-hove/udq-parse-pre
Udq parse pre commits
2019-03-08 07:23:13 +01:00
Joakim Hove
04d42c2f4e Move well and well related files to Well/ subfolder 2019-03-08 07:15:49 +01:00
Andreas Lauser
f700053736 opm_add_test(): add condition to specify if a test ought to be compiled by default
this argument is optional and called *drumroll* `DEFAULT_ENABLE_IF`.
2019-03-07 12:44:28 +01:00
Joakim Hove
ccba767b24 Add utility constructors and testing to UDQWellSet 2019-03-07 11:35:55 +01:00
Joakim Hove
568506627e Minor improvement in error message 2019-03-07 11:35:55 +01:00
Joakim Hove
585447fd22 Move UDQ action enum to UDQEnums 2019-03-07 11:35:55 +01:00
Joakim Hove
fa2e0efd17 Make UDQFunctionTable copyable with std::shared 2019-03-07 11:35:55 +01:00
Joakim Hove
c244625865 Add wells() method to SummaryState 2019-03-07 11:35:55 +01:00
Joakim Hove
15a7d7597d Update ASTNode::eval() to handle Well selectors like 'P*' 2019-03-07 11:35:55 +01:00
Joakim Hove
c7368949dd Merge pull request #662 from joakim-hove/raw-strings
Raw strings
2019-03-07 11:13:16 +01:00
Joakim Hove
9b383db145 Merge pull request #664 from andlaus/improve_tab_completors
tab completors: be quiet even if the `which` command would like to complain
2019-03-07 09:56:42 +01:00
Andreas Lauser
201978c9b2 tab completors: be quiet even if the which command would like to complain
if `which` thought there was an error, some ugly error messages were
printed when pressing the tabulator key. note that this probably obly
affected people who used this as the default completor...
2019-03-07 09:33:15 +01:00
Arne Morten Kvarving
8058167310 Merge pull request #663 from akva2/fix_rh_packaging
fixed: redhat packaging
2019-03-06 11:18:09 +01:00
Arne Morten Kvarving
dcdbf36ec3 fixed: redhat packaging
something changes in os image so these directories
are not guaranteed to exists any longer. make them
2019-03-06 11:14:05 +01:00
Jostein Alvestad
3e03a7d93f Final changes / improvements to multisegment well restart data unit tests
Minor code changes to adapt to coding style
2019-03-06 08:31:13 +01:00
Jostein Alvestad
db0139e842 Added unit tests to AggregateMSWData.cpp, i.e. for the writing of multisegment well data to the restart file 2019-03-06 08:31:12 +01:00
Jostein Alvestad
6df9cf66ea Changes to allow for more general MSW structure with discontinuous segment numbering, initial work for making unit tests for writing MSW data to restart file 2019-03-06 08:23:37 +01:00
Joakim Hove
8967c13d3e Merge pull request #653 from jalvestad/restart_group_test
Added unit tests to the functions that writes group & field data to Eclipse-restart file
2019-03-06 07:17:05 +01:00
Jostein Alvestad
167b344506 Added adjustments and corrections
Corrections to code for compile errors for boost check of string-variables
and adjustments of code according to comments from maintainer (Joakim)
2019-03-05 14:26:29 +01:00
Jostein Alvestad
6b8e04460c Added some corrections / improvements 2019-03-05 14:26:28 +01:00
Jostein Alvestad
184ba02df8 Added unit tests to the code that writes the group and field data to the eclipse compatible restart file
The unit tests covers the group numbering structure stored in IGRP,
the summary data export in XGRP and the group name export
into ZGRP
2019-03-05 14:26:27 +01:00
Jostein Alvestad
6eff5158df Initial changes to implement unit tests for AggregateGroupData 2019-03-05 14:26:25 +01:00
Joakim Hove
af7693ef6b Add parse option keep '/' in data sections
The records are norally terminated on the first unquoted '/', but for the UDQ
and ACTIONX keywords the data sections of a keyword contain mathematical
expressions which can contain '/' literals. This commit adds a per-keyword
ability to terminate the records on the last '/' instead of the first '/'.
2019-03-05 07:15:29 +01:00
Joakim Hove
03a2bbdf80 Add UDQ / parsing test with '/' in data item 2019-03-05 07:15:29 +01:00
Joakim Hove
43cc132651 Merge pull request #660 from akva2/janitoring
mark constructor explicit
2019-02-27 11:18:06 +01:00
Arne Morten Kvarving
f55d3e1578 mark constructor explicit
pass string by const ref
avoid a potential no return from function
2019-02-27 11:14:36 +01:00
Joakim Hove
3dc347f894 Merge pull request #659 from sogoogos/patch-2
Include <string>
2019-02-27 07:47:34 +01:00
Sogo Shiozawa
275cf03f0d Include <string> 2019-02-27 15:42:21 +09:00
Joakim Hove
6ff4d8b136 Merge pull request #651 from joakim-hove/udq-summary-assign
Udq summary assign
2019-02-25 12:54:36 +01:00
Joakim Hove
010dd03c6d UDQ ASSIGN keywords will appear in Summary output 2019-02-25 11:15:12 +01:00
Joakim Hove
6bf64b18fe Add method to get filtered UDQ assignment types 2019-02-25 11:15:12 +01:00
Joakim Hove
a91d47f191 Add name property to UDQSet 2019-02-25 11:15:12 +01:00
Joakim Hove
228aacd390 Merge pull request #654 from joakim-hove/opm-summarize
Small utility to hash a deck
2019-02-25 10:37:31 +01:00
Joakim Hove
40aad6d64e Merge pull request #638 from joakim-hove/udq-functions
Udq functions
2019-02-25 09:35:00 +01:00
Joakim Hove
7425f8b988 Implement UDQ functions 2019-02-25 08:37:04 +01:00
Joakim Hove
945438b210 Add rng to UDQParams 2019-02-25 08:36:33 +01:00
Joakim Hove
f0eed83b12 Merge pull request #652 from joakim-hove/udq-types
Udq types
2019-02-22 09:18:43 +01:00
Joakim Hove
b02578655d Small utility to hash deck 2019-02-22 08:54:49 +01:00
Joakim Hove
19988494c0 Add UDQVartype member to assignment and expression 2019-02-21 13:36:08 +01:00
Joakim Hove
b5542c4e56 Add UDQEnum type for the different variable types 2019-02-21 13:36:08 +01:00
Joakim Hove
40bd7b86b0 Renamed UDQ -> UDQInput 2019-02-21 13:36:08 +01:00
Joakim Hove
ab737ab4d3 Merge pull request #647 from joakim-hove/udq-assign
Udq assign
2019-02-21 08:27:31 +01:00
Joakim Hove
732c5ae4d2 Add class UDQAssign 2019-02-20 18:21:23 +01:00
Joakim Hove
999b06b0eb Add dervied class UDQWellSet : UDQSet 2019-02-20 18:21:23 +01:00
Joakim Hove
e27933270a Change UDQExpression() constructor to take enum 2019-02-20 18:21:23 +01:00
Joakim Hove
e00a5d5fa9 Merge pull request #645 from joakim-hove/use-slash-termination
Use slash termination to determine size of keywords SKPRPOLY SKPRWAT
2019-02-20 17:53:33 +01:00
Joakim Hove
785d80b677 Use slash termination to determine size of keywords SKPRPOLY SKPRWAT 2019-02-20 16:57:10 +01:00
Joakim Hove
ef19a67617 Merge pull request #648 from totto82/massratebc
WIP Add OPM keyword for setting massrate for the boundary
2019-02-20 11:30:29 +01:00
Joakim Hove
10a225785e Merge pull request #644 from joakim-hove/vfp-parse-error
Vfp parse error
2019-02-19 16:22:55 +01:00
Tor Harald Sandve
4e8352dabb Add OPM keyword for setting massrate for the boundary 2019-02-19 15:52:43 +01:00
Joakim Hove
1617d2b434 Merge pull request #642 from joakim-hove/udq-scalar
Udq set
2019-02-18 11:02:58 +01:00
Joakim Hove
946d1cb877 Add subdirectory Schedule/UDQ/ 2019-02-18 08:58:20 +01:00
Joakim Hove
a1b8303ac3 Add class UDQSet() to hold UDQ values 2019-02-18 08:58:20 +01:00
Joakim Hove
4c0c394b77 Changed copyright holder 2019-02-18 08:58:20 +01:00
Joakim Hove
5b86ef115c Clear trailing part of string when looking for possible valid keyword 2019-02-17 15:55:55 +01:00
Joakim Hove
1fee73481e Merge pull request #633 from tskille/Ecl_IO
New class (EclIO) for formatted and binary eclipse format results files.
2019-02-17 15:53:35 +01:00
Torbjørn Skille
c914b7e07c updated path for EclIOdata.hpp in CMakeLists_files.cmake 2019-02-17 14:39:47 +01:00
Torbjørn Skille
ff68195c4f 1) Updated test for EclFile. 2019-02-15 18:01:38 +01:00
Joakim Hove
a1c7e8f5d4 Merge pull request #643 from akva2/bsys_cleanup
some cleanup in buildsystem
2019-02-15 16:22:51 +01:00
tskille
a27b39ff05 changed copyright header for EclIOdata.hpp 2019-02-15 14:05:58 +01:00
Torbjørn Skille
1be3e88f58 New routines for reading binary eclipse format files
1) Start of new class EclFile which includes one anonomus namespace with routines for reading binary eclipse format files
  2) One very basic test of EclFile constructor included in test_EclFile.cpp
      - testing that file exist, throwing an exception if not.
2019-02-15 13:04:06 +01:00
Arne Morten Kvarving
7c3aacd118 some cleanup in buildsystem 2019-02-15 11:03:08 +01:00
Joakim Hove
159ffeaef3 Merge pull request #548 from bska/flow-flow-restart
Add Support for Restarting Flow from ECLIPSE Compatible Restart File
2019-02-13 18:49:30 +01:00
Bård Skaflestad
c345aa3f4e Restart Output: Move Group Name Assignment to Separate Helper
Mostly for consistency.  Also, look up window index by group name.
2019-02-10 19:14:30 -06:00
Bård Skaflestad
a51d18cab0 Restart Output: Adjust Whitespace
Mostly removing leading 'tab' characters, splitting long lines and
realigning '=' characters where appropriate.  Also make a few more
objects 'const'.

Finally, don't copy large objects (e.g., the Schedule) when we only
need to read from it.
2019-02-10 19:14:30 -06:00
Bård Skaflestad
0d0b8b257f Well Data: Prune Disabled Code Blocks
These have not been used for a long time.
2019-02-10 19:14:30 -06:00
Bård Skaflestad
c9331d7fed Save: Simplify Main Gateway Function
In particular, defer unit conversion to the member function

  RestartValue::convertFromSI()

and detect presence of multisegment wells using std::any_of().  We
don't need to know the exact number of MS wells to activate segment
output.
2019-02-10 19:14:30 -06:00
Bård Skaflestad
849eb80e41 IWEL: Identify Items for Active and Requested Well Controls
This commit refines our understanding of IWEL items relating to well
constraints.  In particular Item 8 is the well's active control mode
as determined by the simulator from dynamic state variables.  On the
other hand, Item 16 is the constraint that is requested in the
simulation run input for prediction wells (keywords WCONINJE,
WCONPROD) while Item 50 is the requested constraint for wells
controlled by observed rates (WCONINJH, WCONHIST).

Special Note: This commit outputs the requested control mode to Item
8 and will need an update later once the simulator becomes aware of
the distinction.
2019-02-10 19:14:30 -06:00
Bård Skaflestad
e685eccdc9 Restart: Save/Restore Historical Cumulative Production
This commit adds support for saving and restoring cumulative
production quantities like WOPTH, GWPTH, FGPTH, GGITH, and WWITH.
While here, also cater to the case of wells alternating between
injecting gas and injecting water.  This means that we'll save and
restore cumulative gas/water injection for all injectors,
irrespective of current injecting phase.

Update unit tests accordingly.
2019-02-10 19:14:30 -06:00
Bård Skaflestad
169ec76605 Save/Restore: Support ECLIPSE Compatible Hysteresis Vectors
This commit adds an intermediate layer to the save/restore code that
will translate between Flow's hysteresis parameters and a compatible
subset of ECLIPSE's hysteresis model parameters when creating a
stricly ECLIPSE compatible restart file.  In particular we save and
restore Flow's KRNSW_OW and PCSWM_OW parameters in terms of the
SOMAX parameter using the relations

    KRNSW_OW = 1 - SOMAX
    PCSWM_OW = 1 - SOMAX

Similarly, we save and restore Flow's KRNSW_GO and PCSWM_GO
parameters in terms of ECLIPSE's SGMAX parameter using the relations

    KRNSW_GO = 1 - SGMAX
    PCSWM_GO = 1 - SGMAX

This does implicitly assume that KRNSW_OW = PCSWM_OW and that
KRNSW_GO = PCSWM_GO and will likely need refinement later.  On the
other hand, the current relations are sufficient for the Norne
model.
2019-02-10 19:14:30 -06:00
Bård Skaflestad
b311fbb9d0 Save/Restore Connection Index and Pressure Values
Further analysis suggests Item 35 (index 34) of XCON is the
connection pressure.  Use this information to save/restore the
values of data::Connection::pressure.

While here, also fix a spelling error in LoadRestart.cpp.
2019-02-10 19:14:30 -06:00
Bård Skaflestad
bfe2507184 Restart Facility: Output Suggested Next Timestep as TSINIT
This commit activates the support for storing Flow's suggested next
timestep size as the TSINIT item (zero-based index 1) of the restart
file's DOUBHEAD vector.  Local testing suggests that this value is
essential to even being able to restart Flow from a result set
generated by Flow itself.
2019-02-10 19:14:30 -06:00
Bård Skaflestad
466693f1d0 Load Restart: Add Means of Retrieving Next Timestep From DOUBHEAD
This commit restores Flow's suggested next timestep size from the
TSINIT item of the DOUBHEAD vector pertaining to a particular
restart/report step.  If the item is defaulted, which typically
happens if the result set is created by ECLIPSE, then we don't try
to restore the stepsize and RestartValue::hasExtra("OPMEXTRA") will
be false.
2019-02-10 19:14:30 -06:00
Bård Skaflestad
ecca78af85 DOUBHEAD: Add OPM-Specific Method for Storing Next Timestep
This commit creates an OPM-specific extension of the DOUBHEAD vector
of a restart step.  We reuse the TSINIT item (zero-based index 1) to
store the next timestep.  Local testing suggests that ECLIPSE does
not use this value as part of restarting a simulation so this item
is a reasonable compromise for creating a mostly ECLIPSE-compatible
restart file that still enables communicating the suggested next
timestep if we're restarting Flow from a result set created by Flow.
2019-02-10 19:14:29 -06:00
Bård Skaflestad
551f1f8c76 Connection Rates: Lookup Connections by (I,J,K) Index
This is more robust than the linear index.
2019-02-10 19:14:29 -06:00
Bård Skaflestad
9e97dde466 Restore Cumulative Summary Quantities in Restart
This commit hooks the new helper function restore_cumulative() up to
the gateway restart function

    RestartIO::load()

by changing the return type from "RestartValue" to

    std::pair<RestartValue, SummaryState>

with the pair's '.second' being restore_cumulative()'s return value.

Update callers including unit tests accordingly, specifically such
that the gateway function

    EclipseIO::loadRestart()

internally resets its Summary object's cumulative quantities using
'load().second'.  This is, strictly speaking, a violation of the
"const" qualifier on EclipseIO::loadRestart(), but the language
permits the usage because the 'impl' pointer in this case will be a
constant pointer to a mutable 'Impl' object.
2019-02-10 19:14:29 -06:00
Bård Skaflestad
b3cfb4ee78 Load Restart: Add Means of Restoring Cumulative Quantities
This commit introduces a new helper function

    restore_cumulative()

which creates a SummaryState object containing a subset of known
cumulative quantities--notably cumulative phase and reservoir
voidage production and cumulative water and gas injection for
individula wells and groups--including FIELD.  This is the main
facility for resetting the simulator's notion of cumulative
production following simulation restart.
2019-02-10 19:14:29 -06:00
Bård Skaflestad
bed76c330b Summary: Add Means of Resetting Cumulative Quantities
This commit introduces a new mutating operation on Summary objects,

    Summary::reset_cumulative_quantities(const SummaryState&)

which overwrites the values of cumulative ("total") summary
quantities with those of the input argument.  The only *intended*
use case is reinitialising cumulative quantities in the case of
simulation restart, but other uses may exist.

Add a test case to exercise the new interface.
2019-02-10 19:14:29 -06:00
Bård Skaflestad
8f2a36593d Load Restart: Load Segment Vectors if Available
This commit extends RestartIO::load() to also pick up segment
related quantities (flow rates SOFR, SGFR, SWFR, and pressure SPR)
if these are available in the current restart file.
2019-02-10 19:14:29 -06:00
Bård Skaflestad
5736dd6e9c Load Restart: Add Windowed Views into Well and Group Data
This commit adds two new helper classes, {Well,Group}Vectors which
simplify accessing the portions of {I,X}{CON,WEL,GRP} pertaining to
any individual connection, well or group.  These classes are both
implemented in terms of the existing helper functions

    getPtr()
    getDataWindow()
    getInteHeadElem()

but hide away the complexity of passing the correct maximum number
of connections and number of vector elements per connection, well or
group.

Reimplement the vector queries in terms of these helper classes to
(hopefully) reduce the mental load when reading the restart code.
2019-02-10 19:14:29 -06:00
Bård Skaflestad
ff1b245b8f Restart Facility: Idenfity Certain Items in XGRP and RSEG
This commit adds a few identifiers for items in the XGRP and RSEG
restart vectors to enable restoring segment rates and cumulative
group production/injection quantities.
2019-02-10 19:14:29 -06:00
Bård Skaflestad
e77bd172c5 Solution Output: Remove Special Treatment for TEMP
It is no longer needed as this aspect is handled further up in the
call chain.
2019-02-10 19:14:29 -06:00
Bård Skaflestad
0301d402a4 Load Restart: Chase Semantic Update of data::Connection
Commit ef606711 switched to saving data::Connection::index as the
global cell index of the reservoir connection.  Update restore layer
accordingly.
2019-02-10 19:14:29 -06:00
Joakim Hove
fde95a69d1 Merge pull request #641 from totto82/freeBC
Add input keywords for setting free boundary conditions
2019-02-08 18:18:14 +01:00
Joakim Hove
75d93f196d Merge pull request #625 from joakim-hove/summary-udq
Summary udq
2019-02-08 17:03:36 +01:00
Tor Harald Sandve
62b826e14f Add input keywords for setting free boundary conditions 2019-02-08 13:27:12 +01:00
Joakim Hove
96c02c9d35 UDQ - hooked up to the Summary Output 2019-02-08 06:42:38 +01:00
Joakim Hove
3d4b467a2f Add UDQContext class to be used while evaluating UDQ keywords 2019-02-08 06:34:05 +01:00
Joakim Hove
7451e6618f Minor reformatting/white space change 2019-02-08 06:34:05 +01:00
Joakim Hove
cf0b7db534 Merge pull request #640 from bska/arraydim-consistency-checker
Add Array Dimension Consistency Checker (Take 2)
2019-02-07 18:37:55 +01:00
Bård Skaflestad
7986e99e61 Intehead: Use Maximum of Declared/Dynamic Sizes
This commit revises the output layer to size object arrays according
to the maximum of the static, declared maximum sizes (from WELLDIMS)
and the actual dynamic array sizes from the simulation run itself.

When creating strictly ECLIPSE compatible restart files, this
maximum must always be the value from WELLDIMS, but Flow might
support sizes that are more lenient.
2019-02-07 14:29:08 +01:00
Bård Skaflestad
6cc65ada59 Add Tool for Checking Array Dimensions
This commit introduces a new function,

    Opm::checkConsistentArrayDimensions()

that inspects various dynamic array/table sizes and compares those
to the maximum dimensions requested in the relevant *DIMS keywords
of the RUNSPEC section.

At present we check only items one through four of WELLDIMS since
those are directly relevant for the ECLIPSE-compatible output code.
We leverage the ErrorGuard to integrate into the existing mechanism
for terminating a simulation run if there's a parse failure.
2019-02-07 14:29:08 +01:00
Bård Skaflestad
7bf635ef59 Parse Context: Add Keys for Items 1-4 of WELLDIMS
This commit introduces Parse Context keys that govern the parser's
behaviour in the case of a simulation run using dynamic sizes that
happen to exceed the maximum sizes declared in the RUNSPEC keyword
WELLDIMS.  The default action for these keys is DELAYED_EXIT1, which
reflects the fact that it is impossible to create ECLIPSE-compatible
restart files if the run exceeds those maximum sizes.
2019-02-07 14:29:08 +01:00
Bård Skaflestad
c138e78ddb Group Tree: Prune Undefined Function
Member function GroupTree::groupTreeSize() was never defined (or
used).  Remove its declaration to reduce opportunity for confusion.
2019-02-07 14:29:08 +01:00
Bård Skaflestad
1bca0f6480 Merge pull request #637 from joakim-hove/long-keywords
Add ParseContext::PARSE_LONG_KEYWORD
2019-02-07 14:26:29 +01:00
Bård Skaflestad
16f6e3ee0c Merge pull request #639 from joakim-hove/remove-warning
Temporarily remove warning about missing summary variables
2019-02-07 14:16:37 +01:00
Joakim Hove
d6a9ea162d Temporarily remove warning about missing summary variables 2019-02-07 12:07:19 +01:00
Joakim Hove
b900441ac6 Merge pull request #610 from jalvestad/restart_hyster
Add changes to correct problems/errors with Eclipse restarts from flow  with hysteresis and well crossflow
2019-02-06 16:45:17 +01:00
Joakim Hove
65b629e423 Add ParseContext::PARSE_LONG_KEYWORD
The ParserContext error mode PARSE_LONG_KEYWORD is used to handle keywords
longer than 8 characters. The lenient option is to only consider the first 8
characters.
2019-02-04 17:17:00 +01:00
Joakim Hove
76f709aa70 Merge pull request #635 from joakim-hove/multio
Read keywords MULTIN and MULTOUT
2019-02-04 12:52:10 +01:00
Joakim Hove
57d19c9cdb Read keywords MULTIN and MULTOUT 2019-02-04 09:55:40 +01:00
Bård Skaflestad
e9756c3ee5 Merge pull request #622 from joakim-hove/udq-units
UDQ - hook the configuration up in the Schedule object
2019-02-03 22:24:02 +01:00
Bård Skaflestad
19c81fad9c Merge pull request #632 from joakim-hove/summary-pull
Change from push to pull when initializing ecl_sum object
2019-02-03 22:23:07 +01:00
Bård Skaflestad
ecca175ccd Merge pull request #615 from joakim-hove/msim-actionx
Msim actionx
2019-02-03 22:19:54 +01:00
Joakim Hove
2caf82baff Move check for legitimate keywords to ActionX 2019-02-03 18:07:04 +01:00
Joakim Hove
d82be29745 ACTIONX: Works with WELOPEN and msim 2019-02-02 17:35:56 +01:00
Joakim Hove
8eb10b33ce Change from push to pull when initializing ecl_sum object 2019-02-02 17:21:41 +01:00
Joakim Hove
42d08db25b Add UDQ configuration as DynamicState<> to schedule 2019-02-02 17:09:44 +01:00
Joakim Hove
d7d3d2538a Merge pull request #634 from sogoogos/patch-1
include `<cstdlib>`
2019-02-02 08:20:38 +01:00
Sogo Shiozawa
e0fad15f0a include <cstdlib>
add `#include <cstdlib>` to support older version of clang.
2019-02-02 09:38:33 +09:00
Jostein Alvestad
4c2105f85c changes to correct problem / error on output of historical injection rates and cumulatives 2019-02-01 08:36:12 +01:00
Jostein Alvestad
981e6c9b22 Added changes to improve code quality according to comments from Joakim Hove 2019-02-01 08:36:11 +01:00
Jostein Alvestad
4e83b63a0d minor change on code in CreateDoutHead to avoid conflicts with pullrequest 548 2019-02-01 08:36:09 +01:00
Jostein Alvestad
4c1333fb4f Added correction to element [25] in DoubHead (DRSDT) to account for unitsystem conversion of time 2019-02-01 08:36:07 +01:00
Jostein Alvestad
6db8a45d88 Changes to avoid name conflict 2019-02-01 08:36:05 +01:00
Jostein Alvestad
c33f69fd1b Added changes to extend the eclipse restart file export to handle hysteresis option in eclipse 2019-02-01 08:33:13 +01:00
tskille
92b1b34dca new class Ecl_IO including 14 unit tests 2019-01-31 22:07:41 +01:00
Joakim Hove
bb5b2f4232 Merge pull request #629 from joakim-hove/initial-complump
Initial completion number set to connection number
2019-01-31 15:42:48 +01:00
Joakim Hove
ebe2f28c67 Initial completion number set to connection number 2019-01-31 12:40:39 +01:00
Joakim Hove
414661b898 Merge pull request #630 from akva2/janitoring
changed: add some harmless comparisons to test
2019-01-31 11:31:40 +01:00
Arne Morten Kvarving
4e00897117 changed: add some harmless comparisons to test
to avoid unused variable compiler warnings
2019-01-31 10:26:48 +01:00
Bård Skaflestad
98133f44fc Merge pull request #627 from GitPaean/fixing_restart_perf
[Disussion]using global_index in serialize_OPM_XWEL()
2019-01-31 10:05:19 +01:00
Joakim Hove
1574d7714d Merge pull request #617 from joakim-hove/simulator-missing-keyword
Simulator missing keyword
2019-01-30 16:26:50 +01:00
Joakim Hove
3c41d4c17a Merge pull request #626 from joakim-hove/MINVALUE-bug
Ensure units are applied with the MINVALUE and MAXVALUE keywords
2019-01-30 11:44:05 +01:00
Kai Bao
ef606711f2 using global_index in serialize_OPM_XWEL()
it looks like in data::Wells the index is global index.
2019-01-30 10:35:33 +01:00
Joakim Hove
ed9827bfcf Ensure units are applied with the MINVALUE and MAXVALUE keywords 2019-01-29 20:58:39 +01:00
Joakim Hove
fcadc69e49 Merge pull request #621 from joakim-hove/rename-UDQConfig
Renamed UDQConfig -> UDQParams
2019-01-28 17:40:39 +01:00
Joakim Hove
27eaeb2ec9 Renamed UDQConfig -> UDQParams 2019-01-28 16:53:01 +01:00
Joakim Hove
420b66822b Add iterators to the keywords in the body of ACTIONX 2019-01-28 11:58:31 +01:00
Joakim Hove
9913cb8600 Merge pull request #620 from joakim-hove/schedule-minor
Schedule minor
2019-01-28 11:58:09 +01:00
Joakim Hove
c874c8b6ea Add Schedule::simTime() method 2019-01-28 10:32:57 +01:00
Joakim Hove
6ca6f27640 White space cleanup 2019-01-28 10:32:22 +01:00
Joakim Hove
bd4e872230 Merge pull request #618 from joakim-hove/get-summary-state
Export SummaryState from EclipseIO object
2019-01-28 10:31:52 +01:00
Joakim Hove
3a9bab6285 Merge pull request #619 from atgeirr/fix-missing-include
Add missing <string> include.
2019-01-28 09:30:49 +01:00
Atgeirr Flø Rasmussen
30e2577f31 Add missing <string> include. 2019-01-28 09:13:27 +01:00
Joakim Hove
959502e8cd Export SummaryState from EclipseIO object 2019-01-28 08:59:19 +01:00
Joakim Hove
4a3c6b2058 Left adjust error messages from ErrorGuard 2019-01-25 18:07:46 +01:00
Joakim Hove
29db657757 Add new error modes SIMULATOR_KEYWORD_NOT_SUPPORTED 2019-01-25 18:07:46 +01:00
Joakim Hove
91734f13c4 Merge pull request #616 from joakim-hove/msim-actionx-preparations
Msim actionx preparations
2019-01-23 10:34:58 +01:00
Joakim Hove
b4c86e73af Members ActionX::last_run and ActionX::run_count mutable 2019-01-22 18:08:14 +01:00
Joakim Hove
f3a82ddd70 Add Schedule::simTime() method 2019-01-22 18:08:14 +01:00
Joakim Hove
4174602da2 Remove Schedule::evalAction() and add Schedule::actions() 2019-01-22 16:36:11 +01:00
Andrea Brambilla
a6587b3f68 Remove unneeded printout of gcc version in travis 2019-01-22 16:18:13 +01:00
Markus Fanebust Dregi
6ab8c9611c Add optional log argument to getWriteRestartFile 2019-01-22 16:18:13 +01:00
Markus Fanebust Dregi
249cee7766 Use gcc 4.9 for build on Travis 2019-01-22 16:18:13 +01:00
Jørgen Kvalsvik
70ba4fbc81 Run tests against opm-parser upstream HEAD 2019-01-22 16:18:13 +01:00
Jørgen Kvalsvik
93485e2aec Pass ErrorGuard to parse file/string function
The upstream signature is updated to take an error guard, which on top
of breaking the interface since no default is provided, tears down (!)
the host process on invalid input.

The way of stopping this happening is to call the clear() method after
running the parser.
2019-01-22 16:18:13 +01:00
Joakim Hove
749353a4b0 Merge pull request #614 from joakim-hove/msim-on
Turn on the mock simulator by default
2019-01-22 15:56:22 +01:00
Joakim Hove
a8db1f155c Default building of MOCK simulator to ON 2019-01-22 13:12:06 +01:00
Joakim Hove
59b4ca4b20 Change msim simulator to not hold Schedule object 2019-01-22 13:12:06 +01:00
Joakim Hove
261f7c3c03 Merge pull request #609 from joakim-hove/capture-wells-operation
Capture wells operation
2019-01-22 12:03:37 +01:00
Joakim Hove
a1214ba49e Merge pull request #613 from totto82/tstepLAB
Fix TSTEP unit in LAB mode
2019-01-21 19:05:48 +01:00
Joakim Hove
d9585d6585 Reorganized the ACTIONX implementation - made large parts private 2019-01-21 18:07:24 +01:00
Tor Harald Sandve
a668248aa1 Fix TSTEP unit in LAB mode
If unit system is LAB, the TSTEP is interpreted as hours not days
2019-01-21 15:37:15 +01:00
Atgeirr Flø Rasmussen
d40177dacb Merge pull request #612 from akva2/janitoring
Some janitoring
2019-01-21 14:53:09 +01:00
Arne Morten Kvarving
67acaaa637 Merge pull request #611 from andlaus/fix_jenkins_warning
try to get around a non-fatal bash warning in the jenkins build script
2019-01-21 14:23:13 +01:00
Andreas Lauser
33c5b79d98 fix the pre-build hook logic
currently, the following message is produced:

```
/var/lib/jenkins/workspace/opm-material-PR-builder/deps/opm-common/jenkins/build-opm-module.sh: line 88: cd: -D: invalid option
```

this is caused by trying to change the working directory to $1 which
represents additional cmake parameters, instead of to $3 which
represents the source directory. This mistake currently (probably)
prevents the pre-build hook from ever being executed.
2019-01-21 12:59:47 +01:00
Arne Morten Kvarving
7790fe743e initialize variable to quell compiler warning 2019-01-21 12:36:20 +01:00
Arne Morten Kvarving
40a2e848cb fixed: signed/unsigned comparison warning 2019-01-21 12:21:32 +01:00
Joakim Hove
7f6fd34fd3 Merge pull request #585 from jalvestad/group-field-potentials
Add output of group and field phase potential injection and production rates to Summary file
2019-01-17 15:02:44 +01:00
Joakim Hove
586f296de0 The matching wells are compined with && or || 2019-01-17 11:33:57 +01:00
Joakim Hove
8a2c2304e7 Merge pull request #608 from joakim-hove/wlist
Add WList implementation
2019-01-17 11:33:44 +01:00
Joakim Hove
9df659370c Merge pull request #605 from andlaus/add_jenkins_pre-build_hook
jenkins: allow modules to specify a pre-build check
2019-01-15 19:47:27 +01:00
Joakim Hove
66650a20fb Add WLIST implentation to Schedule 2019-01-14 23:26:02 +01:00
Joakim Hove
eae4a080cd Add WList manager 2019-01-14 11:30:29 +01:00
Joakim Hove
eb5454aeaf Add WList implementation 2019-01-14 11:30:28 +01:00
Atgeirr Flø Rasmussen
dc0ccc010a Merge pull request #607 from joakim-hove/errguard-dump-format
Format the ErrorGuard::dump() nicer
2019-01-14 09:20:00 +01:00
Joakim Hove
aa63d772d7 Merge pull request #593 from GitPaean/fixing_history_mode_part_2
fixing the BHP limit for the history matching wells
2019-01-11 18:04:45 +01:00
Joakim Hove
91afb0b656 Format the ErrorGuard::dump() nicer 2019-01-11 18:00:17 +01:00
Kai Bao
666cc9210b fxing some reviewing comments. 2019-01-11 14:27:49 +01:00
Jostein Alvestad
bdd82445d2 changed name of function for calculation of potential rates 2019-01-11 09:56:41 +01:00
Jostein Alvestad
bf9a142b6d Added corrections to tests/parser/SummaryConfigTests.cpp for list of ALL summary vectors
Removed comments from  Summary.cpp
2019-01-11 09:56:39 +01:00
Jostein Alvestad
9bbacfe710 Final changes to add unit tests for the well, group and field production / injection potential rates 2019-01-11 09:56:38 +01:00
Jostein Alvestad
982b221753 Initial changes to add unit tests for well potential rates 2019-01-11 09:56:36 +01:00
Jostein Alvestad
a4d0bb685b Additional changes to accomodate for loop over several wells beloning to
either a group or the field in generation of the group or field production or
injection potential rates
2019-01-11 09:56:35 +01:00
Jostein Alvestad
3429db8fc1 Initial changes to allow for writing group and field production / injection potential rates to
the summary file
2019-01-11 09:56:33 +01:00
Joakim Hove
fc0e61518b Merge pull request #566 from joakim-hove/capture-wells
Add functionality to capture matching wells when evaluating ACTIONX
2019-01-09 18:05:56 +01:00
Andreas Lauser
b7eefe8b18 jenkins: allow modules to specify a pre-build check
this is purely optional. opm-material will use this to make sure that
auto-generated code does not get manually modified.
2019-01-09 15:09:12 +01:00
Joakim Hove
0d5b3a5285 Merge pull request #604 from atgeirr/silence-warnings
Silence various warnings discovered with new version of clang.
2019-01-09 07:51:42 +01:00
Joakim Hove
3eef43b904 Merge pull request #589 from totto82/sort_multregt
Make the ordering of MULTREGT arbitary
2019-01-08 21:55:44 +01:00
Atgeirr Flø Rasmussen
db90ecd88c Silence various warnings discovered with new version of clang. 2019-01-08 14:51:20 +01:00
Tor Harald Sandve
68769e5b1d Make the ordering of MULTREGT arbitary
With this fix

MULTREGT
1 2 1 /
2 1 2 /
/

will multiply transmissibilities between region 1 and 2 with 2.
2019-01-08 08:35:15 +01:00
Joakim Hove
85949d44ac Merge pull request #602 from joakim-hove/error-list
Add small class ErrorGuard to store errors from parsing
2019-01-08 07:46:57 +01:00
Joakim Hove
690e00a079 Merge pull request #601 from joakim-hove/summary-state-wells
Add method wells() to the SummaryState class
2019-01-08 07:44:56 +01:00
Joakim Hove
cf42146d84 Add error mode DELAYED_EXIT1 to collect all errors 2019-01-07 12:38:05 +01:00
Joakim Hove
23cbe9035b Add separate - non BOOST - test program to test exit(1) 2019-01-04 16:52:10 +01:00
Joakim Hove
2cd6fa2f49 Add overloads without ParseContext and ErrorGuard - update all tests 2019-01-04 13:59:28 +01:00
Kai Bao
1b1f7b807d re-organizing the handleWCONINH from Schedule 2019-01-03 13:26:29 +01:00
Joakim Hove
bf52e6d123 Added ErrorGuard& arguments to library 2019-01-03 13:14:40 +01:00
Kai Bao
c6bbe5d24b re-organizing the history() for WellProductionProperties 2019-01-03 12:21:25 +01:00
Joakim Hove
ad001df804 Add small class ErrorGuard to manage errors from parsing 2019-01-03 11:54:48 +01:00
Joakim Hove
69e921b33a Merge pull request #603 from joakim-hove/rm-parsecontext
Rm parsecontext
2019-01-03 11:54:37 +01:00
Kai Bao
875626b738 handling the transition between injector and producer 2019-01-03 09:47:11 +01:00
Kai Bao
7e05d51e6f handle the WELTARG with WCONINJH 2019-01-03 09:47:11 +01:00
Kai Bao
0dc80689c0 assigning BHP limit for WCONHIST and WCONINJH keywords 2019-01-03 09:47:11 +01:00
Joakim Hove
ae8b81c7ae Changed EclipseState constructor to use const ParseContext& 2019-01-02 18:52:54 +01:00
Joakim Hove
ba0675997a Remove unused ParseContext member in EclipseState 2019-01-02 18:52:54 +01:00
Joakim Hove
15c473e3bb Implement support for well capture when evaluating ACTIONX 2019-01-02 14:03:25 +01:00
Joakim Hove
6465b5b23c Add small class ActionValue to hold action eval result 2019-01-02 14:03:25 +01:00
Joakim Hove
9e93dc5af2 Add method wells() to ActionContext class 2019-01-02 11:30:56 +01:00
Joakim Hove
481123ed25 Add method wells() to the SummaryState class 2019-01-02 11:22:07 +01:00
Joakim Hove
4968c35ad8 Add method wells() to the SummaryState class 2019-01-02 11:13:49 +01:00
Joakim Hove
f6136e69fe Merge pull request #599 from joakim-hove/parsecontext-RPT
Fix mismerge of broken formatting
2018-12-20 18:19:55 +01:00
Joakim Hove
6832788eef Fix mismerge of broken formatting 2018-12-20 16:40:03 +01:00
Joakim Hove
4c0776e3d2 Merge pull request #598 from joakim-hove/parsecontext-RPT
Parsecontext rpt
2018-12-20 15:21:09 +01:00
Joakim Hove
00d1607347 Add error modes RPT_MIXED_STYLE and RPT_UNKNOWN_MNEONIC 2018-12-20 13:47:31 +01:00
Atgeirr Flø Rasmussen
142c0a12c3 Merge pull request #597 from atgeirr/workaround-liq
Workaround: LIQ preferred phase treated as OIL.
2018-12-20 13:25:59 +01:00
Joakim Hove
25fbff2632 Add ParseContext argument to the RPTxxx parsing 2018-12-20 12:27:49 +01:00
Atgeirr Flø Rasmussen
1833ee2c43 Workaround: LIQ preferred phase treated as OIL. 2018-12-20 12:10:14 +01:00
Atgeirr Flø Rasmussen
f5851bcb92 Merge pull request #596 from blattms/fix-pr-578
[bugfix] Fix influence of logging on return of getWriteRestartFile
2018-12-20 00:21:39 +01:00
Markus Blatt
5632fc6662 [bugfix] Fix influence of logging on return of getWriteRestartFile
In PR #578 a bool was introduced that should determine whether we log warnings
during RestartConfig::getWriteRestartFile. Unfortunately, it introduced a bug that
made a false value of log return false from the function. This is fixed by this commit.
2018-12-19 23:05:17 +01:00
Joakim Hove
8375516c82 Merge pull request #595 from joakim-hove/region2region
Region2region
2018-12-19 15:40:52 +01:00
Joakim Hove
bf6732559f Add ParseContext error mode SUMMARY_UNHANDLED_KEWORD 2018-12-19 10:09:02 +01:00
Joakim Hove
3b951985ec Initial support for region 2 region keywords 2018-12-19 10:01:38 +01:00
Joakim Hove
9c98b5ceb4 Merge pull request #590 from joakim-hove/rptrst-bug
Handle space in the 'BASIC = ?' RPT mnemonics
2018-12-18 14:00:28 +01:00
Joakim Hove
161f555bc0 Handle space in the 'BASIC = ?' RPT mnemonics 2018-12-18 08:48:59 +01:00
Atgeirr Flø Rasmussen
39a6871b1d Merge pull request #588 from atgeirr/add-last-test-time
Add function WellTestState::lastTestTime().
2018-12-17 11:47:40 +01:00
Atgeirr Flø Rasmussen
175da3d436 Add function WellTestState::lastTestTime(). 2018-12-14 11:38:28 +01:00
Joakim Hove
cf61068ad1 Merge pull request #587 from bska/compare-ecl-ignoreextra
Make Summary Comparison Able to Ignore Different Number of Keywords
2018-12-13 21:31:28 +01:00
Joakim Hove
bf7b2697ee Merge pull request #586 from joakim-hove/remove-compare-summary
Removed unused file compareSummary.cpp
2018-12-13 21:10:37 +01:00
Bård Skaflestad
9098316775 Make Summary Comparison Able to Ignore Different Number of Keywords
This commit adds the ability of SummaryRegressionTest to bypass the
check for equal number keywords/summary vectors in the two result
sets being compared.  The primary purpose of this is to continue
comparing contents of existing summary vectors if new summary
keywords are introduced in a GitHub Pull Request.

Extend the 'compareECL' utility to take advantage of this ability.
2018-12-13 20:10:34 +01:00
Joakim Hove
1249ef0dd2 Removed unused file compareSummary.cpp 2018-12-13 19:16:05 +01:00
Bård Skaflestad
2b2d4901d1 Merge pull request #584 from bska/fix-open-conn-logic-for-output
Check Size Inconsistencies Only for Open Connections
2018-12-12 14:00:42 +01:00
Bård Skaflestad
d4740ae249 Check Size Inconsistencies Only for Open Connections
The previous logic was slightly incomplete in that it checked size
inconsistencies for all connections, not just open connections.
This, in turn would in turn generate diagnostics like

    Report step 19/247 at day 252/3312, date = 16-Jul-1998

    Time step 0, stepsize 16 days.
    ERROR: Uncaught std::exception when running tasklet: Inconsistent number of open connections I in vector<Opm::data::Connection*> (3) in Well B-4H. Trying to continue.

With this update we look for size inconsistencies between a well's
open connections and data::Wells::connections only.
2018-12-12 12:40:18 +01:00
Atgeirr Flø Rasmussen
49eda9fc72 Merge pull request #580 from bska/restore-gcc49
Restore Build on GCC 4.9
2018-12-11 19:11:40 +01:00
Bård Skaflestad
3ea522d7ba Restore Build on GCC 4.9
Commit 334dbe4e broke GCC 4.9 (invoking explicit constructor with an
empty initializer_list).  Restore build by using the actual type.
2018-12-11 17:30:43 +01:00
Atgeirr Flø Rasmussen
70172f5771 Merge pull request #579 from atgeirr/silence-warnings
Silence various warnings
2018-12-11 12:52:38 +01:00
Bård Skaflestad
91306c12f4 Merge pull request #549 from jalvestad/segment-summary
Improve eclipse-restart file for multi segment wells
2018-12-10 17:03:03 +01:00
Atgeirr Flø Rasmussen
67f96f4996 Fix: add required include and std:: qualification. 2018-12-10 16:10:25 +01:00
Atgeirr Flø Rasmussen
39bb94c2c8 Silence unused argument warnings. 2018-12-10 16:10:25 +01:00
Atgeirr Flø Rasmussen
7955805dd5 Do not return by const value (no effect). 2018-12-10 16:10:25 +01:00
Atgeirr Flø Rasmussen
74c06ea703 Silence various warnings in libECLRestart.cpp.
There are still systematic warnings that need suppression in this file:
 -Wgnu-zero-variadic-macro-arguments
 -Wformat-nonliteral
 -Wcast-align
These are too hard to fix quickly, and likely not indicating errors.
2018-12-10 16:10:25 +01:00
Atgeirr Flø Rasmussen
71b0c2883f Avoid shadowing of variables. 2018-12-10 16:10:25 +01:00
Atgeirr Flø Rasmussen
334dbe4e1f Initialize all struct elements. 2018-12-10 16:10:25 +01:00
Atgeirr Flø Rasmussen
53252e6694 Use struct for MULTREGTRecord, match order of variables to usage. 2018-12-10 16:10:25 +01:00
Atgeirr Flø Rasmussen
e27df951f6 Merge pull request #578 from blattms/allow-silent-getWriteRestartFile-call
Allow to switch of logging during getWriteRestartFile call.
2018-12-07 18:53:41 +01:00
Markus Blatt
1062fb836b Allow to switch of logging during getWriteRestartFile call.
This needed for parallel runs as otherwise all processes will
do logging.
2018-12-07 15:52:53 +01:00
Jostein Alvestad
343d060118 changed CMakeLists_files.cmake to account for unit tests which are not finished and ready for use yet
The changes and additions in this version have been extensively tested on various input data
sets and proved to work properly and correctly
2018-12-07 12:38:33 +01:00
Jostein Alvestad
b15fab221b Corrected tests to be consistent with changes / corrections made to the various parameters 2018-12-07 12:38:31 +01:00
Jostein Alvestad
88b16f981c Removed test/debug comments 2018-12-07 12:38:30 +01:00
Jostein Alvestad
dc3f1cbf40 Added improvements to handle more general recompletion strategies
to eclipse compatible restart file
2018-12-07 12:38:29 +01:00
Jostein Alvestad
01e3aa377c Corrections to Summary.cpp for sicontinuities in rates/cumulatives
Improved messages from AggregateMSWData
2018-12-07 12:38:27 +01:00
Jostein Alvestad
44102f83a0 one more minor correction to test_AggregateMSWData.cpp 2018-12-07 12:38:26 +01:00
Jostein Alvestad
2c13cdfa18 Added minor correction to test_AggregateMSWData.cpp 2018-12-07 12:38:24 +01:00
Jostein Alvestad
1d22e3b0ed Reset change to complump for output to Restart file 2018-12-07 12:38:23 +01:00
Jostein Alvestad
2add79d122 Added corrections / improvements - generalisations for Eclipse compatible restartfiles 2018-12-07 12:38:22 +01:00
Jostein Alvestad
0cfbfb9957 Added ZGRP data to the eclipse restart file 2018-12-07 12:38:20 +01:00
Jostein Alvestad
92f65b7958 Additional changes to handle --use-multisegment-well=false 2018-12-07 12:38:19 +01:00
Jostein Alvestad
79037f93b2 Initial changes to allow for eclipse restart when using option --enable-opm-rst-file=false 2018-12-07 12:38:17 +01:00
Jostein Alvestad
633a5883f7 Added changes to prepare for unit testing of AggregateMSWdata 2018-12-07 12:38:15 +01:00
Jostein Alvestad
63590f95b0 Added initial changes to enable unit testing for AggregateMSWData 2018-12-07 12:38:14 +01:00
Jostein Alvestad
e783eaafc0 Added unit test for AggregateMSWdata 2018-12-07 12:38:13 +01:00
Atgeirr Flø Rasmussen
e341bd1c08 Merge pull request #577 from GitPaean/updating_liquid_rate_for_wconhist
updating liquid rate for WCONHIST
2018-12-07 09:58:18 +01:00
Atgeirr Flø Rasmussen
f9ce82547c Merge pull request #559 from kel85uk/fix_influx_coeff
Fix for aquifer making connection
2018-12-07 09:56:40 +01:00
Kai Bao
b349b3b217 updating liquid rate for WCONHIST 2018-12-03 16:40:42 +01:00
Joakim Hove
983ed5fcb8 Merge pull request #575 from joakim-hove/smspec-c++
Adapt to C++ changes in libecl
2018-11-30 08:09:31 +01:00
Joakim Hove
f414f5b8ad Adapt to C++ changes in libecl 2018-11-26 17:30:09 +01:00
Joakim Hove
7c52f6f5a8 Merge pull request #560 from blattms/edit-nnc-2nd-try
Represent EDITNNC in the deck representation.
2018-11-26 16:57:18 +01:00
Joakim Hove
188eb23911 Merge pull request #574 from joakim-hove/parsecontext-exit1
Parsecontext exit1
2018-11-26 14:25:34 +01:00
Joakim Hove
72ad2eaa7f Merge pull request #562 from trinemykk/addtracer
Added missing support for tracers in the parser
2018-11-26 13:02:19 +01:00
Joakim Hove
92870dc1e9 Merge pull request #576 from akva2/janitoring
Some SCA error janitoring
2018-11-26 11:56:38 +01:00
Arne Morten Kvarving
2d43ccaf8f fixed: initialize members 2018-11-26 10:41:29 +01:00
Arne Morten Kvarving
b2e0eb2507 fixed: remove unnecessary variable initialization 2018-11-26 10:41:29 +01:00
Trine S Mykkeltvedt
5085fb35c0 removed WTRACER from RPTRST_DECK.DATA to make tests pass 2018-11-26 09:44:31 +01:00
Joakim Hove
8d33ec55bd Add ParseContext error handler EXIT1 for user error 2018-11-25 11:53:34 +01:00
Joakim Hove
d70b86484d White space 2018-11-25 08:56:20 +01:00
Joakim Hove
0089fa9287 Merge pull request #572 from nairr/fix_influx_mult
fix default value influx_mult
2018-11-24 00:14:32 +01:00
6b80dd10e6 fix default value influx_mult 2018-11-23 17:42:48 +01:00
Joakim Hove
f4a9298cf4 Merge pull request #569 from joakim-hove/OPERATER
Add support for OPERATER keyword
2018-11-23 13:05:08 +01:00
Atgeirr Flø Rasmussen
7de217b8fb Merge pull request #567 from joakim-hove/normalize-case
Force UPPER_CASE when input deck has MixeDCase basename
2018-11-23 11:08:54 +01:00
Joakim Hove
039fdb70de Merge pull request #520 from GitPaean/adding_injectivity_keywords_june
Adding injectivity keywords
2018-11-23 10:56:18 +01:00
Bård Skaflestad
2f7a0bc532 Merge pull request #570 from bska/fix-rsconst-kw
Correct RSCONST and RSCONSTT Specifications
2018-11-22 14:38:16 +01:00
Bård Skaflestad
fda1719eab Correct RSCONST and RSCONSTT Specifications
This commit ensures that we never try to read more than a single
record of data when parsing the RSCONST keyword.  Previously, the
parser would attempt to parse RSCONST as if it were an unbounded
keyword that was terminated by an empty record.  This, in turn,
would produce the diagnostic message

    Inner exception: Malformed floating point number 'INCLUDE'

when trying to read a specification like

    RSCONST
     0.35  932  /

    -- Check for these data in the future this is important
    INCLUDE
      'RP.dat'  /

While here, also implement 'getSIDouble()' for the Rs value (item 1)
in keywords RSCONST and RSCONSTT by adding the correct unit of
measurement ("dimension") to the keyword specification.

Add unit tests to verify new behaviours.
2018-11-22 13:28:39 +01:00
Joakim Hove
c0e9b71eec Add postAddKeyword() overload for initializable properties 2018-11-22 12:06:12 +01:00
kel85uk
d93bd35b8e Change influx_coeff to double. Remove test of influx_coeff as it is difficult to check for equal collections of pointers. Change from false to nullptr when making AquiferCTTests. 2018-11-22 09:35:01 +01:00
kel85uk
afab0103e3 Fix memory leak due to pointer errors for influx_coeff. 2018-11-22 09:34:59 +01:00
kel85uk
62f39dacce Fixes the data type to shared_ptr for the working_buffer vector 2018-11-22 09:34:57 +01:00
kel85uk
1d7a12442e Fixes the default behaviour for the influx_coeff and default aquifer pressure with AQUCT by providing nullptr instead of values. 2018-11-22 09:34:55 +01:00
Markus Blatt
d69bf47a28 Added test for parsing EDITNNC 2018-11-21 22:14:27 +01:00
Markus Blatt
7064b96260 Test for next neighbour without using abs.
Substraction of two unsigned int might cause trouble as
the result might have to be signed to be meaningful. In
addition there have overload resolution issues with g++-7.
2018-11-21 22:14:27 +01:00
Joakim Hove
e0d5711f8e Add support for OPERATER keyword 2018-11-21 16:56:28 +01:00
Joakim Hove
3677f470fb Force UPPER_CASE when input deck has MixeDCase basename 2018-11-21 13:07:33 +01:00
Joakim Hove
44409c7a30 Merge pull request #565 from joakim-hove/schedule-eval-actions
Add method Schedule::evalActions() to evaluate ACTIONX
2018-11-21 08:21:08 +01:00
Markus Blatt
7c1e868973 Store EDITNNC in the EclipseState for latter usage by the simulator.
Only the simulator is able to determine all NNCs and therefore it needs
to apply the multiplicators itself.
2018-11-20 13:58:08 +01:00
Markus Blatt
0768c5a8b3 Revert "Merge pull request #535 from blattms/support-editnnc"
This reverts commit 7ebadbb055, reversing
changes made to 0f485c7801.
2018-11-20 13:58:08 +01:00
Trine Solberg Mykkeltvedt
ea7cb8d2c6 adding support for WTRACER keyword in EclipseState 2018-11-19 13:10:02 +01:00
Kai Bao
6858bd4578 adding the ScheduleTests for the following keywords
WPMITAB and WSKPTAB
2018-11-19 12:27:52 +01:00
Kai Bao
1b8680df7d implmentation of the polymer injectivity tables in one file
Moving PlymwinjTable.cpp PolyInjTable.cpp SkprpolyTable.cpp
SkprwatTable.cpp into one single file PolyInjTables.cpp

for better organization
2018-11-19 12:08:04 +01:00
Kai Bao
316324a78e renaming Simple2DTable to PolyInjTable
make it more clear that it is a talbe introduced for the polymer
injectivity study, not intended for general usage.
2018-11-19 12:08:04 +01:00
Kai Bao
2bf33c30d8 some cleaning up and sanity checks. 2018-11-19 12:08:04 +01:00
Kai Bao
862b3450d3 adding test for the following three keywords
SKPRWAT, SKPRPOLY and PLYMWINJ .
2018-11-19 12:08:04 +01:00
Kai Bao
082476f840 fixing errors from rebasing. 2018-11-19 12:08:04 +01:00
Kai Bao
49655b464c adding support for the few skin pressure related keywords
SKPRWAT SKPRPOLY WSKPTAB
2018-11-19 12:08:04 +01:00
Kai Bao
1432367e07 adding a few keywords related to skin pressure
SKPRPOLY, SKPRWAT, WSKPTAB
2018-11-19 12:08:04 +01:00
Kai Bao
e4912d4fcf adding keyword WPMITAB 2018-11-19 12:08:04 +01:00
Kai Bao
d0e5f8f470 beginning working on PlymwinjTable
it will go to Tables.cpp later.
2018-11-19 12:08:04 +01:00
Kai Bao
65ef90f471 removing NPLYVMH from PINTDIMS
from now on, the number of NPLYVMH will depend on the number of polymer
mixing regions, which is defined with NPLMIX from REGDIMS.
2018-11-19 12:08:04 +01:00
Kai Bao
bcb852e8f2 adding keyword PLYMWINJ 2018-11-19 12:08:04 +01:00
Trine Solberg Mykkeltvedt
927bf09688 added TBLK keyword 2018-11-19 10:25:42 +01:00
Joakim Hove
6921801eec Add method Schedule::evalActions() to evaluate ACTIONX 2018-11-19 09:57:06 +01:00
Joakim Hove
f21e2035c4 Merge pull request #563 from joakim-hove/msim-functions
Add functions for well rates and solutions to mock simulator
2018-11-16 12:43:56 +01:00
Joakim Hove
c1ffeeef53 Merge pull request #557 from joakim-hove/actioncontext-summary-state
Actioncontext summary state
2018-11-16 11:31:20 +01:00
Joakim Hove
e27abdd1a0 Merge pull request #561 from joakim-hove/dynamicstate-update-equal
Add method update_equal() to DynamicState
2018-11-16 09:43:25 +01:00
Joakim Hove
8b8285ae2b Merge pull request #556 from joakim-hove/summarystate-well-api
Summarystate well api
2018-11-16 09:42:01 +01:00
Joakim Hove
bdcb227a53 Add functions for well rates and solutions to mock simulator 2018-11-15 15:45:29 +01:00
Joakim Hove
88f043645a Removed two unused includes 2018-11-14 09:38:43 +01:00
Joakim Hove
ad55655a08 Add method update_equal() to DynamicState 2018-11-14 09:34:13 +01:00
Atgeirr Flø Rasmussen
6af3194c6c Merge pull request #554 from totto82/addPP
Add output of well phase potential
2018-11-13 14:30:17 +01:00
Joakim Hove
bb96eb9b70 Merge pull request #558 from bska/enable-stone2-kw
Recognise Requests for Stone's Second Model of 3-Phase Oil Relperm
2018-11-12 16:41:35 +01:00
Bård Skaflestad
baae4a3faf Recognise Requests for Stone's Second Model of 3-Phase Oil Relperm
This commit makes the parser aware of the keywords STONE and STONE2
which both request that the simulation run use Stone's second model
for three-phase relative permeability for oil.
2018-11-12 11:50:45 +01:00
Joakim Hove
36c3080f85 ActionContext internalizes a SummaryState object 2018-11-09 21:58:36 +01:00
Joakim Hove
c35832b155 Changed exception to std::out_of_range 2018-11-09 21:14:03 +01:00
Joakim Hove
ca9da29c53 Add well_var methods to SummaryState 2018-11-09 20:45:20 +01:00
Joakim Hove
1ba51534ae Move SummaryState implementation to EclipseState/Schedule/ 2018-11-09 20:44:37 +01:00
Joakim Hove
01abada947 Merge pull request #542 from joakim-hove/actionx-parse
Actionx parse
2018-11-09 20:20:26 +01:00
Joakim Hove
212a1fde5f Parse condition part in ACTIONX 2018-11-09 20:19:34 +01:00
Joakim Hove
0b8adcbee3 Merge pull request #555 from joakim-hove/minor
Minor
2018-11-08 12:25:17 +01:00
Joakim Hove
1d755859a6 Update msim after upstream changes 2018-11-07 15:45:25 +01:00
Tor Harald Sandve
5d3125c532 Add output of well phase potential 2018-11-07 15:38:23 +01:00
Joakim Hove
971d300243 Merge pull request #553 from akva2/fix_test_macro
Fix test macro
2018-11-07 14:14:27 +01:00
Arne Morten Kvarving
199b7d710a fixed: set property for correct test name 2018-11-07 11:33:31 +01:00
Arne Morten Kvarving
d60787188e fixed: simplify boost_dyn_test code and add to opm_add_test as well 2018-11-07 11:33:31 +01:00
Joakim Hove
819ad1bf9e Merge pull request #551 from akva2/janitoring
Some small cleanups
2018-11-07 10:59:34 +01:00
Arne Morten Kvarving
3cbc40bd4d remove unused variable 2018-11-07 09:46:10 +01:00
Arne Morten Kvarving
8e92a84c09 fix indent 2018-11-07 09:46:05 +01:00
Arne Morten Kvarving
ff8ab1c1dc changed: mark constructor explicit 2018-11-07 09:43:14 +01:00
Joakim Hove
9d45632628 Make Eclipse month indices available for use outside TimeMap 2018-11-07 09:25:02 +01:00
Joakim Hove
e3e67874dd Merge pull request #91 from joakim-hove/version-0.1.2
Set __version__ to 0.1.2
2018-11-06 11:49:50 +01:00
Joakim Hove
b7fc40078b Set __version__ to 0.1.2 2018-11-06 11:18:00 +01:00
Joakim Hove
089b58f101 Merge pull request #547 from totto82/productivity_index
Add support for output of well productivity index
2018-11-06 09:38:55 +01:00
Joakim Hove
967e3ad3af Merge pull request #526 from totto82/addDRSDTR
Add DRSDTR and DRVDTR
2018-11-06 08:21:32 +01:00
Tor Harald Sandve
e2d748906e Fix failure in actionx test after rebase 2018-11-05 13:48:36 +01:00
Tor Harald Sandve
95179f393c Fix vappars and dr[sv]dt logic
The simulator should either use VAPPERS or dr[sv]dt, both the
combination drsdt and drvdt is allowed.
2018-11-05 13:38:42 +01:00
Tor Harald Sandve
6fee172f16 Add DRSDTR and DRVDTR 2018-11-05 13:37:22 +01:00
Joakim Hove
a241a1bd07 Merge pull request #545 from bska/summary-ensure-inc-elapsed
Summary: Ensure that we don't step backwards during simulation
2018-11-05 13:35:38 +01:00
Bård Skaflestad
4348438044 Summary: Ensure that we don't step backwards during simulation
This commit, a preparation for restoring cumulative quantities from
a restart file, reinitialises Summary::prev_time_elapsed in the case
of simulation restart and adds a check to

    Summary::write_timestep()

which throws if the input argument 'secs_elapsed' is prior to the
previously recorded elapsed time.  The latter is a change in the
behaviour of write_timestep(), but ensures that we don't integrate
rate quantities across a very large timestep in the case of
simulation restart and also prevents double accumulation.

Update impacted unit tests accordingly, and move FIRST_SIM's START
date into the RUNSPEC section where it belongs.
2018-11-04 21:48:35 +01:00
Joakim Hove
70cb7f0084 Merge pull request #90 from joakim-hove/find-boos
Use find_package(Boost ...) to find and link with Boost
2018-11-04 09:18:31 +01:00
Joakim Hove
8e801a1fae Merge pull request #546 from bska/detect-thermal-run
Simulation Config: Add Predicate for Thermal Simulations
2018-11-03 19:28:32 +01:00
Tor Harald Sandve
2d5d0953ee Add support for output of well productivity index 2018-11-02 15:57:21 +01:00
Bård Skaflestad
9df3bea857 Simulation Config: Add Predicate for Thermal Simulations
This commit introduces a new predicate,

    bool SimulationConfig::isThermal() const

that determines whether or not either of the keywords

    TEMP or THERMAL

are specified in the RUNSPEC section of a simulation run.
2018-11-02 13:45:50 +01:00
Joakim Hove
056d6bccb4 Merge pull request #539 from joakim-hove/actionx-whitelist
ACTIONX container
2018-11-02 12:19:26 +01:00
Joakim Hove
68e6926355 Add Actions container and ActionContext for eval 2018-11-02 10:55:29 +01:00
Atgeirr Flø Rasmussen
2df9779a62 Merge pull request #544 from joakim-hove/parser-error-msg
Add a better error message for parse errors
2018-11-02 07:59:25 +01:00
Joakim Hove
cf7c2ee537 Use find_package(Boost ...) to find and link with Boost 2018-11-02 07:14:46 +01:00
Joakim Hove
60fb68d3fc Add a better error message for parse errors 2018-11-01 20:59:49 +01:00
Joakim Hove
ae9d5e97c7 Merge pull request #541 from lars-petter-hauge/include_wpimult_ctfac
Include WPIMULT for CTFAC output
2018-10-29 11:29:38 +01:00
Lars Petter Øren Hauge
d958da6542 Include WPIMULT for CTFAC output 2018-10-29 09:12:50 +01:00
Joakim Hove
b8c5d8c129 Add whitelist of keywords allowed in ACTIONX block 2018-10-27 15:59:32 +02:00
Joakim Hove
e7660b0613 White space change 2018-10-27 15:59:32 +02:00
Joakim Hove
7ebadbb055 Merge pull request #535 from blattms/support-editnnc
Added support for honoring keyword EDITNNC during deck parsing.
2018-10-25 15:49:06 +02:00
Joakim Hove
0f485c7801 Merge pull request #514 from bska/segment-summary
Serialization: Add Initial Support for Segment Information
2018-10-25 15:19:22 +02:00
Markus Blatt
a6ec18cd4e Use an approach for processing nncs without lambda. 2018-10-25 09:13:35 +02:00
Bård Skaflestad
af8f8c6bfd Segment Summary Vectors: Use Explict Keyword Whitelisting
We only support a small subset of segment-related summary vectors
and must avoid being tricked by other SUMMARY section keywords that
happen to begin with a character 'S' (e.g., SUMMARY itself or the
SUMTHIN keyword).  Add an explicit white-list of the vectors we do
support and bypass all others in helper function 'keywordS()'.

Introduce a dummy 'SUMTHIN' specification to SOFR_TEST.DATA to
ensure that we don't accidentally match this in 'keywordS()'.
2018-10-25 09:09:32 +02:00
Bård Skaflestad
258bcbc186 Restart_Segment/Vectors_Present: Include SOFR Existence
We were checking "SGFR" twice due to copy-paste...

Pointy Hat: bska
2018-10-25 09:09:32 +02:00
Bård Skaflestad
2260efaad9 RSEG: Alert Reader that 'stringSegNum' is 1 .. #Segments Inclusive
Suggested by: [at]joakim-hove
2018-10-25 09:09:32 +02:00
Bård Skaflestad
624dec542a {I,R}SEG: Don't Copy Segment or Connection Sets
We only read from these objects so they can be reference-to-const.
2018-10-25 09:09:32 +02:00
Bård Skaflestad
7ca8b46167 SummaryConfig: Consider All Timesteps for MS Well Predicate
This commit extends the logic of determining which wells to consider
as multi-segmented to scanning all declared report steps.  We also
use a similar protocol to determine the maximum number of segments
for an MS well across all declared report steps.
2018-10-25 09:09:32 +02:00
Bård Skaflestad
8fbb93497a Summary: Include <map> in Public Interface
Needed to honour requirements of class Summary in isolation.  While
here, also move <unordered_map> to implementation file.
2018-10-25 09:09:32 +02:00
Bård Skaflestad
ef5465dcfc MSWData/RSEG: Use SummaryState Values Directly
Segment flow rates and pressures retrieved from a SummaryState
object do not need additional processing steps.  The SummaryState
protocol guarantees that the quantities are already stored according
to their proper output unit conventions and abide by the flow rate
sign requirements of the summary/restart files (production
flows--from reservoir to well--treated as positive).

Remove the pertinent processing from RSeg::staticContrib().
2018-10-25 09:09:32 +02:00
Bård Skaflestad
f9eb32a235 Segment Summary: Test Read/Write Support
This commit completes the set of unit tests for the segment-related
summary vectors

    SOFR, SGFR, SWFR, and SPR

by adding a test (Restart_Segment/Write_Read) that serializes the
result of multiple Summary::add_timestep() calls for SOFR_TEST.DATA
and reads that summary file back in.
2018-10-25 09:09:32 +02:00
Bård Skaflestad
f275fd6089 Summary: Transmit Segment Values to "prev_state"
This commit makes the helper function find_wells() aware of summary
vectors defined on segments.  Previously, this helper function would
return an empty list of wells in the case of ECL_SMSPEC_SEGMENT_VAR
whence all segment-related summary vectors would be zero at all
times.

Add a small set of unit tests to verify that we transmit the known
(small) set of segment-related summary vectors (SOFR, SGFR, SWFR,
SPR) to the internal "prev_state" with correct output units and sign
convention (producing flow rates--reservoir to well--positive).
2018-10-25 09:09:32 +02:00
Bård Skaflestad
decd0b10a9 SummaryConfig: Expand Segment Vector Record Processing
This commit extends the processing of segment-related summary
vectors to also support specifications of the form

    SOFR
    /

designating all segments of all multi-segmented wells at all times.

Expand SummaryConfig unit test to exercise this extended record
processing mode.
2018-10-25 09:09:32 +02:00
Bård Skaflestad
10c9da1a36 Summary: Guarantee Existence of Segment-Related Restart Vectors
This commit extends the set of summary vectors needed for restart to
include those needed for RSEG[8 .. 11] in the case of
multi-segmented wells.
2018-10-25 09:09:31 +02:00
Bård Skaflestad
47141dfabf data::Wells: Remove a few blank lines
Suggested by: [at]joakim-hove
2018-10-25 09:09:31 +02:00
Jostein Alvestad
613aafe4ae Changes in AggregateMSW data to write segment data to restart file
Changes in RestartIO to avoid writing of well and MSW data when wells not present
2018-10-25 09:09:31 +02:00
Bård Skaflestad
f867d7f82c SummaryConfig: Recognise Subset of Segment Vectors
This commit extends the SummaryConfig class to recognise a small
subset of segment-related summary vectors.  In particular, this
brings support for 'SGFR', 'SOFR', 'SPR', and 'SWFR'--at least in a
restricted sense.  We do not yet support cases like

    SOFR
    /

which designates all segments in all wells at all times.

The unit testing is presently minimal and must be expanded before
this is ready for inclusion into master.  In particular, we only
check that cases like

    SOFR
      'PROD01' 1 /
    /

generate the expected summary vector nodes (class SummaryNode).
2018-10-25 09:09:31 +02:00
Jostein Alvestad
fe060c7f48 Changes to contribute to write segment data to summary file 2018-10-25 09:09:31 +02:00
Bård Skaflestad
80154e8f5f Serialization: Add Initial Support for Segment Information
This commit extends Opm::data::Wells to include a set of output
vectors for well segment information.  At present we define output
structures for segment rates and segment pressures.  The immediate
use case is properly assigning restart vector items RSEG[8 .. 11],
but these same values are also usable for outputting the summary
vectors SPR, SOFR, SGFR, and SWFR.  Future expansion is likely.
2018-10-25 09:09:31 +02:00
Joakim Hove
ae0cb3e5ad Merge pull request #528 from totto82/minpvv
Add support for minpvv
2018-10-25 09:04:32 +02:00
Joakim Hove
133f89198f Merge pull request #507 from WesselDeZeeuw/aquifet
Aquifet parser implementation
2018-10-25 09:01:29 +02:00
Markus Blatt
03bb4da004 Added warning about ignored EDITNNC entries 2018-10-25 08:04:38 +02:00
Joakim Hove
e356a16ab2 Merge pull request #462 from joakim-hove/tranx-modifier
Add deckAssigned() method to GridProperty + default construct TRAN
2018-10-24 10:36:19 +02:00
Joakim Hove
eea23abedd Merge pull request #533 from joakim-hove/GDFILE-location
Update GDFILE hadling to parse DATA outside cwd
2018-10-22 13:45:27 +02:00
Markus Blatt
5f620f7451 Added support for honoring keyword EDITNNC during deck parsing.
If the keyword is present then the transimissibilities of the corresponding NNC
entries will be scalled with the factor specified via EDITNNC. Multiple entries
for the same cell pairs are allowed and will result in multiple scalings.
Cell pairs specified in EDITNNC that are not present in NNC are silently ignored.
2018-10-18 15:26:31 +02:00
Joakim Hove
c76ee877aa Update GDFILE handling to account for out-of-cwd
Make sure path to GDFILE is correct
2018-10-18 10:47:38 +02:00
Joakim Hove
fd36bf88fb Add function Deck::makeDeckPath() 2018-10-18 10:47:37 +02:00
Joakim Hove
24bd410313 Merge pull request #521 from joakim-hove/input-sim
Add skeleton for input simulator
2018-10-17 17:28:25 +02:00
Joakim Hove
984a308e24 Add skeleton for mock simulator 2018-10-17 17:21:11 +02:00
Joakim Hove
6ea7a1796d Merge pull request #530 from joakim-hove/GDFILE
Gdfile
2018-10-17 15:01:57 +02:00
Joakim Hove
ee0d256a12 Add method seconds() to Schedule and TimeMap 2018-10-17 12:09:45 +02:00
Joakim Hove
42d7587e1b Add size() method to the Schedule class 2018-10-17 06:47:57 +02:00
Joakim Hove
c75a50796b White space change 2018-10-16 00:21:49 +02:00
Joakim Hove
1190260d7d Add support for GDFILE keyword 2018-10-16 00:21:35 +02:00
Joakim Hove
5b8882d6f0 Add methods save() and addNNC() to EclipseGrid 2018-10-16 00:20:09 +02:00
Joakim Hove
f8e711246f GridDims class can initialize from binary file 2018-10-16 00:14:33 +02:00
Joakim Hove
5283611695 Add static method for conversion between unit system enums 2018-10-16 00:12:53 +02:00
Tor Harald Sandve
ca8e2f279b Add support for minpvv 2018-10-15 13:35:04 +02:00
Joakim Hove
c49b51ab23 Add test to prevent using ADD on TRANX 2018-10-15 10:50:58 +02:00
Joakim Hove
7c65850894 Merge pull request #525 from joakim-hove/find-alberta-fixup
Fixed ALBERTA_FOUND to OFF when not found
2018-10-15 10:44:29 +02:00
Joakim Hove
7279fd5ea8 Add deckAssigned() method to GridProperty + default construct TRAN
The deckAssigned() query method is added to the GridProperty class to enable the
simulator to check whether a property has been explicitly assigned in the deck
or autocreated through the use of some EDIT operators like MULTIPLY.
2018-10-15 10:29:01 +02:00
Joakim Hove
f279c7e374 Fixed ALBERTA_FOUND to OFF when not found 2018-10-15 09:42:13 +02:00
WesselZ
7b1595d0b2 Modification of the Aquifetp header and class files for the handling the default value of p0.
Small Changes to unit test of Aquifetp
2018-10-15 09:28:39 +02:00
Joakim Hove
8c8290f614 Merge pull request #505 from blattms/fix-alberta-linker-issues
Also search for Alberta (Fixes ebos compile issue with g++-8.2)
2018-10-11 16:32:44 +02:00
WesselZ
3819910396 Modification of AquifetpTests.cpp -- 100% test passing
Added nempty Aquifetp container -- Null object -- No parsing, succesfull
2018-10-10 12:00:15 +02:00
Joakim Hove
72b39e513a Merge pull request #515 from joakim-hove/parsecontext-ignore-kw
Ability to ignore named keywords in ParseContext
2018-10-09 17:06:33 +02:00
WesselZ
04a9e710d5 Added Improved Header Files and Class files, without the ecl dependency.
Added Testfile for fetkovich implementation
2018-10-09 16:42:39 +02:00
Bård Skaflestad
1c771a66fc Merge pull request #516 from atgeirr/fix-const-map-types
Use non-const string type in map.
2018-10-08 18:32:30 +02:00
Joakim Hove
c938765224 Ability to ignore named keywords in ParseContext 2018-10-08 18:07:21 +02:00
Atgeirr Flø Rasmussen
a37625b2cf Use non-const string type in map.
Using const string as key type instead of plain string fails with libc++,
the standard library implementation used by clang. The libc++ implementation
assumes that map keys can be copied, and the standard requires map keys to be
copyable.

Using const string as a value also fails with clang, I am not 100% sure why.
It does severely restrict how you can interact with the container, and seems to
make it noncopyable. The error is reported from DynamicState<GroupTree>::update(),
the std::fill() call.
2018-10-08 11:02:22 +02:00
Joakim Hove
83331033b5 Merge pull request #511 from bska/wellconnections-ctor
WellConnections: Initialise Head in Copy Constructor
2018-10-02 21:02:53 +02:00
Bård Skaflestad
58a5a4e371 WellConnections: Initialise Head in Copy Constructor
This commit ensures that the data members 'headI' and 'headJ' are
properly initialised in the constructor

    WellConnections(const WellConnections&, const EclipseGrid&)

which powers the implementation of

    Well::getActiveConnections()
2018-10-02 15:59:04 +02:00
Joakim Hove
3655213c40 Merge pull request #513 from joakim-hove/bump-versions-master
Bump versions
2018-10-02 15:50:50 +02:00
Joakim Hove
2844aa4468 Bump versions 2018-10-02 15:43:01 +02:00
Joakim Hove
c81e5027c9 Merge pull request #510 from bska/difftime
TimeMap: Use difftime() for Time Deltas as double
2018-10-02 14:44:44 +02:00
Bård Skaflestad
23950403f1 TimeMap: Use difftime() for Time Deltas as double
Reduces the amount of explicit arithmetic on std::time_t values and
thereby, implicitly, the assumption of targeting Posix systems only.
2018-10-02 13:11:02 +02:00
Bård Skaflestad
33372a3337 Merge pull request #506 from jalvestad/flow-flow-restart
EclipseRestart-improvements
2018-10-02 13:05:43 +02:00
Jostein Alvestad
c067e48276 Additional improvement and correction for writing of eclipse compatible restart file 2018-09-28 15:39:25 +02:00
Jostein Alvestad
5d398565c2 Improved the code structure - current improvement 2018-09-28 11:23:42 +02:00
Jostein Alvestad
a9a82e3814 Minor correction to previous commit rseg [39] was not properly assigned 2018-09-28 09:56:03 +02:00
Jostein Alvestad
3f94b580a2 Added changes to improve treatment of multi segment wells in Eclipse Restart
Added flowing well bottom hole pressure to item[8] and [39] plus adjusted item[9]
2018-09-28 09:48:03 +02:00
Jostein Alvestad
cfc1b29c08 Added improvements and corrections to handle writing of eclipse compatible restart file
for more general well data
2018-09-27 16:23:34 +02:00
Jostein Alvestad
264d451d56 Added additional changes to handle repeated read of COMPDAT
for same grid i,j,k cell.
Corrections for handling wells with only 1 connection
Correction for XWEL - BG being NaN
2018-09-27 16:23:32 +02:00
Jostein Alvestad
21eddfbdf2 Added changes to handle repeated read of COMPDAT for same grid cells 2018-09-27 16:23:31 +02:00
Markus Blatt
22b38f1031 Also search for Alberta
We do not use it in OPM, but for whatever reason I was experiencing
linker errors (unresolved symbol) when compiling ebos with DUNE 2.6
and g++-8.2. dune-grid exports its alberta wrapper libraries in dune-grid_LIBRARIES. Previously this did not pose a problem. Somehow it does now. If
I strip the libraries from the linker line everything is fine but this
is not a good solution.

Therefore I have added a test for Alberta that is triggered by the test of
dune-grid.
2018-09-27 15:05:04 +02:00
Joakim Hove
34b9cbcaa4 Merge pull request #502 from GitPaean/alq_unit_wcon
not converting the unit of ALQ value in VFPPROD
2018-09-26 20:16:42 +02:00
Kai Bao
8721385104 not converting the unit of ALQ value in VFPPROD
since the ALQ value in WCON* keywords are not converted based on the
unit of ALQ in the VFPPROD keyword. Easiest fix is not to convert either
of them.
2018-09-26 13:01:29 +02:00
Arne Morten Kvarving
fa85844a9b Merge pull request #500 from akva2/bash_completion
added: cmake glue for adding bash tab completion for an installed product
2018-09-25 12:32:03 +02:00
Arne Morten Kvarving
e3bc8a6ad7 fixed: fail build in jenkins scripts if installation target fails 2018-09-25 12:31:11 +02:00
Arne Morten Kvarving
564f064392 added: cmake glue for adding bash tab completion for an installed product 2018-09-25 12:31:11 +02:00
Arne Morten Kvarving
5477711420 Merge pull request #504 from akva2/restart_fixups
Fixups after restart merge
2018-09-25 10:58:21 +02:00
Arne Morten Kvarving
23c1aa9308 changed: use memcpy to avoid aliasing warnings 2018-09-25 10:04:39 +02:00
Arne Morten Kvarving
0e2dbf737e fixed: do not try to append size_t to string using + 2018-09-25 10:04:39 +02:00
Arne Morten Kvarving
5a2eec25b2 fixed: change to signed loop counters
avoids signed/unsigned comparison warnings
2018-09-25 10:04:39 +02:00
Arne Morten Kvarving
ae7c7fdf74 changed: flip comparison to avoid warnings
warning: assuming signed overflow does not occur when assuming that (X +
c) < X is always false [-Wstrict-overflow]
2018-09-25 10:04:39 +02:00
Arne Morten Kvarving
ddf6f153f7 fixed: use constructor argument instead of (broken) init loop 2018-09-25 10:04:39 +02:00
Arne Morten Kvarving
9f7b9be7f4 changed: make unsigned to avoid narrowing warnings/errors 2018-09-25 10:04:39 +02:00
Arne Morten Kvarving
0b85652c35 remove unused symbols 2018-09-25 10:04:39 +02:00
Arne Morten Kvarving
4bb0ede6b4 Merge pull request #503 from rolk/503_warncompat
Do not warn if just def'ed HAVE_ vars are set to 1
2018-09-24 08:54:54 +02:00
Joakim Hove
c4b9378245 Merge pull request #89 from joakim-hove/komodo-build
Deteect DEST_PREFIX when adding lib dependencies
2018-09-21 14:17:49 +02:00
Joakim Hove
55eeb620ac Deteect DEST_PREFIX when adding lib dependencies 2018-09-21 14:16:38 +02:00
Roland Kaufmann
d847e10d96 Do not warn if just def'ed HAVE_ vars are set to 1
Some configuration scripts probe and just set HAVE_FOO without any
values, whereas others set it explicitly to 1. If these two are mixed,
for instance that the same package is used by two of our prerequisites,
but in different manner, then we get compatibility warnings when we try
to run the configuration script, even though there is no real conflict.

dune-fem, dune-alugrid and dune-localfunctions have this problem (around
release 2018.04).

This patch special-code the test so if the old value was previously
either just defined or explicitly set to the value 1, a warning will not
be issued if then suddenly the other variant is used.
2018-09-21 13:49:39 +02:00
Atgeirr Flø Rasmussen
5fb0c91c05 Merge pull request #454 from jalvestad/restart-group+mswell
Restart group+mswell
2018-09-21 10:14:47 +02:00
Bård Skaflestad
ff53a2334c Merge pull request #499 from totto82/fix_save_keywords
BugFix size of save_keywords
2018-09-20 17:59:30 +02:00
Tor Harald Sandve
776d851b26 Fix size of save_keywords 2018-09-20 13:50:23 +02:00
Joakim Hove
2884d02a71 Merge pull request #501 from joakim-hove/komodo-fixup
Add quotes to ensure string evaluation
2018-09-20 13:18:13 +02:00
Joakim Hove
90459cac7e Add quotes to ensure string evaluation 2018-09-19 23:33:54 +02:00
Bård Skaflestad
b03ccdc6e1 SWEL/XWEL: Guard Against Missing Summary Vectors
Commit 36af2aad (PR #496) switched to not calculating the well's
summary vectors in the case of outputting the initial condition
(SEQNUM=0).  Account for this possibility when creating SWEL and
XWEL.
2018-09-19 16:02:17 +02:00
Jostein Alvestad
fa9275f1af Added correction to treatment of multisegment wells in preparation for writing of eclipse
compatible restart file
2018-09-19 16:02:17 +02:00
Jostein Alvestad
ef6e0b084d Corrected merge conflicts with upstream master
Write cumulative production / injection only in eclipse compatible mode
2018-09-19 16:02:17 +02:00
Bård Skaflestad
a3b37eee4f Support Retrieving Well Vectors from {I,X}{WEL,CON}
This commit extends function RestartIO::load() to retrieve most of
the well restart data (aggregate flow rates per well connection,
or per well) from the standard ECL restart vectors IWEL, XWEL, ICON,
and XCON.  We still prefer the dedicated OPM_* variants if
available, but this commit brings us closer to being able to retire
OPM_XWEL.

While here, also add WELLDIMS to FIRST_SIM_THPRES to restore the
STORE_THPRES unit test.
2018-09-19 16:02:16 +02:00
Bård Skaflestad
980f55271f Connection Data: Write Flow Rates to XCON
This commit adds a simple facility for outputting surface rates of
the oil, gas, and water components for each well connection, as well
as total reservoir voidage rate per well connection if available in
the data::Connection object.
2018-09-19 16:02:16 +02:00
Bård Skaflestad
335b070564 Aggregate Connection Data: Use Named Indices
This commit introduces a new set of named indices pertaining to the
*CON vectors (ICON, SCON, XCON).  Use these where appropriate in
ICON and SCON.
2018-09-19 16:02:15 +02:00
Bård Skaflestad
d42c98223c Refactor Implementation of RestartIO::save()
In particular, reimplement write_kw() in terms of vector<T> rather
than EclKW<T> to simplify callers.  While here, also move some file
handling operations out to separate helper functions to make control
flow more linear in the body of RestartIO::save(), and prune unused
arguments from other helper functions.
2018-09-19 16:02:15 +02:00
Bård Skaflestad
2f868a7325 Split RestartIO into Separate Load/Save Files
This is in preparation of introducing support for loading most
well-related solution items from the regular vectors IWEL, XWEL,
ICON, and XCON.
2018-09-19 16:02:14 +02:00
Jostein Alvestad
96f2528083 Added changes to CMakeLists_files.cmake to correct for rebase 2018-09-19 16:02:14 +02:00
Bård Skaflestad
38c4d07282 Aggregate Well Data: Miscellaneous Cleanup
Fix a few white-space issues and use 'atm' unit of measurement for
the default lower BHP limit of producers.
2018-09-19 16:02:14 +02:00
Bård Skaflestad
77904d6aab Aggregate Well Data: Fix SWEL UoM for Injectors
Unit of measurement for non-gas injectors must be liquid surface
rate for O/W injectors and 'rate' (reservoir voidage rate) for RESV
injectors.
2018-09-19 16:02:13 +02:00
Bård Skaflestad
6688a9286f Unit Tests: Fix Comparison Values 2018-09-19 16:02:13 +02:00
Bård Skaflestad
9637109ca8 Test Data: Add WELLDIMS for Restart Purposes
The new restart code depends on having WELLDIMS available in order
to allocate appropriately sized output vectors.
2018-09-19 16:02:13 +02:00
Bård Skaflestad
41d0a56967 Test Restart: Use Non-Default SummaryState Values
Needed by the new restart code.
2018-09-19 16:02:12 +02:00
Jostein Alvestad
9d32793796 Added improvements to connection data ICON (account for inactive cells) etc. 2018-09-19 16:02:12 +02:00
Jostein Alvestad
13e849140c Added changes to identify issues for improving ICON 2018-09-19 16:02:11 +02:00
Jostein Alvestad
0e1e4e08e7 Added changes to improve handling of ICON 2018-09-19 16:02:11 +02:00
Jostein Alvestad
3fb7149226 Added change to rseg item 11 2018-09-19 16:02:10 +02:00
Jostein Alvestad
2889a829f8 Additional corrections to restart file (iseg, rseg, icon and scon) 2018-09-19 16:02:10 +02:00
Jostein Alvestad
ccb223521f Added corrections to construction of ISEG for more general segmented well trajectories 2018-09-19 16:02:09 +02:00
Jostein Alvestad
409a497396 Added corrections to code to generate Eclipse compatible Restart file: i) two changes to intehead, [49] and [50] -> 1 (based on tests), ii) corrections to ISEG mainly for multisegmented wells and iii) change to ICON to allow for default saturation table implying ICON[6] and [9] = 0 2018-09-19 16:02:09 +02:00
Jostein Alvestad
5cf35e03c7 Added other correction to account for compatibility with Eclipse 2017 and not 2014 2018-09-19 16:02:08 +02:00
Jostein Alvestad
4f9f952e77 Added corrections to SWEL and ISEG plus InteHead[179] to 146 2018-09-19 16:02:08 +02:00
Jostein Alvestad
a41596004a Added correction for writing of unformatted restart 2018-09-19 16:02:07 +02:00
Jostein Alvestad
6ea83724d6 corrected code for write of unformatted restart 2018-09-19 16:02:07 +02:00
Jostein Alvestad
0a96fc012e Corrected code for differences in buffer size for read from restart files 2018-09-19 16:02:06 +02:00
Jostein Alvestad
5d860f8b03 corrected default injector and producer bhp pressures for restart file 2018-09-19 16:02:06 +02:00
Jostein Alvestad
9ea6c034e2 Disable extra flow restart output that Eclipse cannot handle in a Restart run
As of now we are able to run an ECL restart from a flow generated restart file for
a specific realistic model test case
2018-09-19 16:02:06 +02:00
Jostein Alvestad
17966d098b Added unit conversion for MSW data pluss correctin for complum 2018-09-19 16:02:05 +02:00
Jostein Alvestad
9d0604ad99 additions to handle segmented wells for ICON and SCON 2018-09-19 16:02:05 +02:00
Jostein Alvestad
36de4a4a31 Added changes needed to provide connection index for restart file 2018-09-19 16:02:04 +02:00
Jostein Alvestad
690fe11e58 Additional changes for restart writing og well and connection data 2018-09-19 16:02:03 +02:00
Jostein Alvestad
bce55f7087 Added changes to remove debug print plus some code comments 2018-09-19 16:02:03 +02:00
Jostein Alvestad
dc64b6eb86 Add correction due to non-resolved conflict during rebase operation 2018-09-19 16:02:02 +02:00
Jostein Alvestad
c720c48ba0 Added correction for IGRP array 2018-09-19 16:02:02 +02:00
Jostein Alvestad
5b1ec7b5b0 Added code to write restart data for groups and segmented wells to restart file - consistent with Eclipse 100 2018-09-19 16:02:02 +02:00
Jostein Alvestad
439bc30ea3 Final changes for first "beta" version of segmented well ++ for restart 2018-09-19 16:02:01 +02:00
Jostein Alvestad
888326b32c Initial changes to add group data to restart output plus adding changes to include no of groups in inteHEAD 2018-09-19 16:02:01 +02:00
Jostein Alvestad
6ed9c356a9 Final changes for first "beta" version of segmented well ++ for restart 2018-09-19 16:02:00 +02:00
Jostein Alvestad
d9adf7ccc2 Further changes to include iSeg and rSeg data to Restart file 2018-09-19 16:01:59 +02:00
Jostein Alvestad
c5a1b30dc1 Added code to finalize writing of group data to restart file 2018-09-19 16:01:59 +02:00
Jostein Alvestad
cedadaf649 Added code to implement writing XGRP to the restart file. 2018-09-19 16:01:58 +02:00
Jostein Alvestad
949fb3d944 Add summary vectors for group and field for restart 2018-09-19 16:01:58 +02:00
Jostein Alvestad
86ca704d75 Further changes to implement group output to the restart file.
Starting to use the SummaryState class to include summary data
2018-09-19 16:01:57 +02:00
Jostein Alvestad
53d19e8a44 Further changes to implement group data (IGRP and SGRP)
Plus updating source code to the latest github version of the rest of the OPM code
2018-09-19 16:01:57 +02:00
Jostein Alvestad
f7d975920b Added changes to serialize IGRP and SGRP and write to restart file 2018-09-19 16:01:56 +02:00
Jostein Alvestad
531581762f Further additions and changes to implement preparation and writing of group data to the restart file 2018-09-19 16:01:56 +02:00
Jostein Alvestad
402a5f0965 Initial changes to implement group data into writing of restart file 2018-09-19 16:01:55 +02:00
Jostein Alvestad
79d0081369 Added changes to include no of groups in InteHEAD 2018-09-19 16:01:55 +02:00
Jostein Alvestad
0f26e2e958 Initial changes to add group data to restart output
While here also add changes to include no of groups in InteHEAD
2018-09-19 16:01:55 +02:00
Jostein Alvestad
9cf9bf310d Added changes to serialize IGPR and SGRP and write to restart file
Well info at correct step for save & load RESTART

Retrieve number of wells and completions at the beginning of the
simulated step. Otherwise a well introduced at the same time step as the
report will be included - even though there doesn't exist any simulated
data yet.

This issue would trigger a throw if WRFTPLT was added at the same time
step as a well is introduced in the schedule section.

Removed one DATES item in FIRST_SIM.DATA. The
EclipseReadWriteWellStateData in test_Restart compared state at T1,
which did not include any well data as it was. No other tests were
affected.

Added new implementation of serialize_ICON

The new function has been added to the file WriteRestartHelpers, and
intended to take over for the local function 'serialize_ICON' in
`restartIO.cpp` when `restartIO::save()` is to be updated.  The purpose
of the new implementation is to be compatible with Eclipse.

Handle wildcard in group keywords

Added function getGroups(pattern) to allow records with wildcard.

Included the functionality for GCONPROD, GCONINJE and GEFAC - currently
the only group keywords that should accept wildcards.

Add key string to RestartKey

Pass dimension information for extra fields in restart

Verify that the extra container has THPRES
2018-09-19 16:01:54 +02:00
Jostein Alvestad
a284acc3ed Further additions and changes to implement preparation and writing of group data to the restart file 2018-09-19 16:01:54 +02:00
Jostein Alvestad
19bb0e0077 Additional changes to create restart group data in general and igrp data in particular 2018-09-19 16:01:53 +02:00
Jostein Alvestad
89b11dfd26 Further changes to write group data to restart file 2018-09-19 16:01:53 +02:00
Jostein Alvestad
2552750bed Initial changes to implement group data into writing of restart file 2018-09-19 16:01:52 +02:00
Jostein Alvestad
7b2c36bde5 Added changes to include no of groups in InteHEAD 2018-09-19 16:01:52 +02:00
Jostein Alvestad
b9bb0ae60a Initial changes to add group data to restart output plus adding changes to include no of groups in inteHEAD 2018-09-19 16:01:51 +02:00
Joakim Hove
dcb4528e71 Merge pull request #88 from joakim-hove/connection-updates
Update sunbeam to use opm-common/2018.09
2018-09-19 15:12:56 +02:00
Arne Morten Kvarving
4c6d4ee201 Merge pull request #498 from joakim-hove/komodo
Komodo: cmake config changes
2018-09-19 09:08:53 +02:00
Joakim Hove
906ff3f4b5 Add ability to CMAKE variable DIST_PREFIX before find_package(opm--) 2018-09-19 09:07:05 +02:00
Joakim Hove
0a378bd49d Update sunbeam to use opm-common/2018.09 2018-09-17 21:34:39 +02:00
Joakim Hove
238d3ddb58 Move CMAKE_MODULE_PATH manipulations before @OPM_PROJECT_EXTRA_CODE@ 2018-09-17 09:12:29 +02:00
Joakim Hove
42745e0bfc Merge pull request #493 from joakim-hove/default-ecl-compatible
Make ecl compatible restart files default
2018-09-15 11:09:44 +02:00
Bård Skaflestad
4e593da140 Merge pull request #497 from totto82/start2
Write restart when SAVE keyword is in the schedule file
2018-09-14 19:54:25 +02:00
Joakim Hove
662d673c44 Merge pull request #496 from joakim-hove/summary-start-at1
Summary start at1
2018-09-14 17:13:45 +02:00
Tor Harald Sandve
fdc4b0142e Write restart when SAVE keyword is in the schedule file 2018-09-14 13:36:22 +02:00
Arne Morten Kvarving
142994dde6 Merge pull request #491 from akva2/improve_lto
improve lto support
2018-09-14 12:30:16 +02:00
Arne Morten Kvarving
d58001f608 improve lto support
need to use the wrappers for ar and ranlib, or static
libraries are problematic.
2018-09-14 10:29:59 +02:00
Joakim Hove
7dccd13c50 Merge pull request #492 from totto82/minpvfil
fix unit of minpvfil
2018-09-13 19:08:45 +02:00
Joakim Hove
fb5e1229ef Merge pull request #495 from joakim-hove/remove-include
Remove include + use plain C api for test_area
2018-09-13 19:07:37 +02:00
Joakim Hove
d30fc975e3 Merge pull request #444 from lars-petter-hauge/support_ctfac
Support CTFAC
2018-09-13 18:21:24 +02:00
Joakim Hove
36af2aadb5 Will not write summary data for report step == 0 2018-09-13 18:08:57 +02:00
Joakim Hove
cf754c499d White space change 2018-09-13 18:07:37 +02:00
Joakim Hove
9d7ec59e9e Use plain C api for test area 2018-09-13 17:25:33 +02:00
Joakim Hove
eded8bacfc Remove unused include 2018-09-13 17:11:49 +02:00
Lars Petter Øren Hauge
87e3beb601 Support CTFAC in output 2018-09-13 10:23:47 +02:00
Joakim Hove
079d946723 Make ecl compatible restart files default 2018-09-12 18:02:47 +02:00
Joakim Hove
492a240f09 Merge pull request #488 from joakim-hove/opm-formatted-rst
Add opm_formatted property to the IOConfig
2018-09-12 12:57:26 +02:00
Tor Harald Sandve
e6c0ccb5bf fix unit of minpvfil 2018-09-12 11:44:33 +02:00
Joakim Hove
71d92c3dc8 Add opm_formatted property to the IOConfig 2018-09-12 11:34:57 +02:00
Bård Skaflestad
2ea1b7860f Merge pull request #490 from bska/fix-index-oob
Ensure Correctly Sized ACTNUM Vector
2018-09-12 10:09:24 +02:00
Bård Skaflestad
9fd5ce396b Ensure Correctly Sized ACTNUM Vector
Size must be equal to number of global (Cartesian) cells.
2018-09-12 09:46:53 +02:00
Arne Morten Kvarving
bff3c0bff1 Merge pull request #489 from joakim-hove/ignore-extra-kwII
Add option to ignore extra keywords in the regresstion testing
2018-09-11 16:09:53 +02:00
Joakim Hove
7cd29ea7d7 Add option to ignore extra keywords in the regresstion testing 2018-09-11 13:34:51 +02:00
Arne Morten Kvarving
a3c9943a5e Merge pull request #487 from joakim-hove/fix-shared-build
Fix build of tests when using shared library
2018-09-11 13:27:06 +02:00
Joakim Hove
552c390465 Merge pull request #464 from joakim-hove/peaceman-formula
Peaceman formula
2018-09-11 13:18:40 +02:00
Joakim Hove
9f9041dcae Fix build of tests when using shared library 2018-09-10 18:33:47 +02:00
Joakim Hove
c870172a30 Merge pull request #484 from joakim-hove/use-c-smspec
Using plain C api for smspec_nodes
2018-09-10 17:51:23 +02:00
Arne Morten Kvarving
80918f030b Merge pull request #486 from akva2/combine_compare_apps
Combine comparison applications into one
2018-09-10 11:06:31 +02:00
Joakim Hove
1d55e923f9 Merge pull request #483 from joakim-hove/use-c-testare
Use c testare
2018-09-10 10:15:23 +02:00
Arne Morten Kvarving
cb525c5c75 changed: fold compareSummary into compareECL application 2018-09-10 08:42:26 +02:00
Joakim Hove
4a5b71d8c1 Include Peaceman calculation in Connection class
- The calculation of well connection transmissibility CF and effective
   permeability is calculated.

 - The Connection objects are immutable; should never be updated.

 - The properties of the Connection class are just plain properties, have
   removed getter methods and the use of Value<double>.
2018-09-09 11:16:42 +02:00
Joakim Hove
ff939b44f2 Add testdecks SPE1 and SPE9 2018-09-09 11:16:42 +02:00
Joakim Hove
9e8110e67b Add Peaceman utility functions from opm-simulators 2018-09-09 11:16:42 +02:00
Arne Morten Kvarving
b877c8b340 changed: put Deviation struct in a separate header
ODR
2018-09-07 15:33:50 +02:00
Arne Morten Kvarving
7a034ffd01 changed: split ECL(Integration|Regression)Test classes to separate files
to unify code with the summary comparison classes
2018-09-07 15:33:46 +02:00
Arne Morten Kvarving
6e0c31bed4 changed: make getCellVolume a static member of ECLFilesComparator
needed in upcoming splitting commit
2018-09-07 14:38:03 +02:00
Arne Morten Kvarving
ef63206925 changed: rename (Integration|Regression)Test ECL(Integration|RegressionTest)
for clarity
2018-09-07 14:38:03 +02:00
Arne Morten Kvarving
0b6d36658d changed: pass basenames as std::string
to unify code with the other comparison classes
2018-09-07 14:38:03 +02:00
Arne Morten Kvarving
44f3b86547 changed: rename the summary regression/integrationtest classes
it restores c++ ODR which is nice, but the main reason is to
allow usage of summary and generic comparison classes in the
the same application.
2018-09-07 14:38:03 +02:00
Arne Morten Kvarving
bee4590aaa changed: move the comparison classes out of libopmcommon
these classes are really not made for reusability.
thus they should only be built into the applications.
2018-09-07 14:38:03 +02:00
Joakim Hove
5aa0bfadf0 Use plain C api for smspec_nodes 2018-09-07 13:56:04 +02:00
Joakim Hove
e1948ccf99 Add operator[] to GridDims 2018-09-07 10:20:50 +02:00
Joakim Hove
45e81a02fa Use plain C api for temporary testarea 2018-09-07 05:53:20 +02:00
Joakim Hove
085bbc263b Merge pull request #482 from joakim-hove/thpres-fixup
Fixup: THPRESPR -> THRESPR
2018-09-05 21:10:34 +02:00
Joakim Hove
3e95d3f42b Fixup: THPRESPR -> THRESHPR 2018-09-05 17:53:33 +02:00
Joakim Hove
6b93051616 Merge pull request #480 from joakim-hove/thrpes-solution-section
Thrpes solution section
2018-09-04 14:18:14 +02:00
Joakim Hove
d3249d965f Merge pull request #477 from joakim-hove/multregt-default
Multregt default
2018-09-04 14:17:50 +02:00
Joakim Hove
4a10023c0d Make sure the THPRESPR field is written in solution section 2018-09-04 08:38:15 +02:00
Joakim Hove
065b9c9c9f Merge pull request #479 from joakim-hove/thpres-move-it
Rename THPRES string to THPRESPR
2018-09-04 08:25:55 +02:00
Joakim Hove
ae3c4e0d8c Rename THPRES string to THPRESPR 2018-09-03 17:15:01 +02:00
Joakim Hove
4d5ef337ec Accept default values when parsing MULTREGT keyword 2018-08-31 15:47:28 +02:00
Joakim Hove
a2394c06f5 Refacored MULTREGT scanner 2018-08-31 14:32:10 +02:00
Atgeirr Flø Rasmussen
43e4f0ca87 Merge pull request #473 from alfbr/master
Make compiling with OpenMP default.
2018-08-27 13:28:38 +02:00
Joakim Hove
cdf876fa15 Merge pull request #475 from dhan16opm/dhan16_fixes
fix missing "include <string>" in InitConfig.hpp
2018-08-25 09:24:34 +02:00
CDN MacbookPro13
12402916a7 See #https://github.com/OPM/opm-common/issues/474. header files should be self-sufficient 2018-08-25 12:50:58 +05:30
Joakim Hove
6d2a4b5daa Merge pull request #86 from Statoil/joakim-hove-patch-1
Update README.md
2018-08-25 07:25:17 +02:00
Joakim Hove
e46f3bf48a Update README.md 2018-08-25 07:24:48 +02:00
Alf Birger Rustad
0183fa884a Make compiling with OpenMP default. 2018-08-17 13:39:44 +02:00
Arne Morten Kvarving
e407e65b54 Merge pull request #472 from akva2/add_analysis
added: error analysis support in compareSummary / compareECL
2018-08-15 08:08:47 +02:00
Arne Morten Kvarving
e072365234 added: error analysis support in compareSummary / compareECL
useful for debugging purposes. replaces scripts in opm-simulators
2018-08-14 11:02:56 +02:00
Joakim Hove
070acf4bef Merge pull request #460 from joakim-hove/ACTIONX
Actionx
2018-08-10 20:26:03 +02:00
Joakim Hove
451d52c18a Refactor iteration over Schedule section to for ACTIONX 2018-08-10 11:30:07 +02:00
Joakim Hove
bbb5e27e90 Add basic ACTIONX keyword 2018-08-10 11:29:46 +02:00
Joakim Hove
37ddd82545 Fix typo in keyword defintion 2018-08-10 11:28:52 +02:00
Joakim Hove
3c90adeea9 Remove unused functionality for directory loading of keywords 2018-08-10 11:28:52 +02:00
Joakim Hove
903118736a Remove unused include 2018-08-10 11:28:52 +02:00
Joakim Hove
18a22d8f68 Merge pull request #463 from joakim-hove/restart-cwd
Restart cwd
2018-08-10 11:26:33 +02:00
Joakim Hove
f3f702e503 Merge pull request #85 from joakim-hove/use-opm-common
Use opm-common
2018-08-09 10:41:27 +02:00
Joakim Hove
eed1309b7a Adapt to api changes in opm-common 2018-08-09 08:13:35 +02:00
Joakim Hove
d6147c386f Use opm-common
fixup! WIP: Use opm-common
2018-08-09 08:13:35 +02:00
Atgeirr Flø Rasmussen
46be17cf58 Merge pull request #470 from joakim-hove/set-opm-pack
Add cmake variable $OPM_PACK_COMMAND
2018-08-08 13:26:47 +02:00
Joakim Hove
ce5c617f41 Add cmake variable $OPM_PACK_COMMAND 2018-08-07 22:50:56 +02:00
Joakim Hove
ca1833e6ed Merge pull request #471 from joakim-hove/parse-test-spe9
Add precision property to DeckOutput class - default = 10
2018-08-07 18:45:05 +02:00
Joakim Hove
bb2e5e0370 Add precision property to DeckOutput class - default = 10 2018-08-07 18:44:05 +02:00
Atgeirr Flø Rasmussen
f6cc04a4ab Merge pull request #467 from akva2/remove_deck_assignment_operator
changed: delete assignment operator in Deck class
2018-08-03 14:55:35 +02:00
Arne Morten Kvarving
d6c56982cc Merge pull request #469 from akva2/update_data_with_pr
fixed: allow using update_data with a opm-tests PR
2018-08-03 12:58:44 +02:00
Arne Morten Kvarving
ee6fab7395 Merge pull request #468 from akva2/strip_test_prefix
added: strip test_ prefix from tests added with opm_add_test
2018-08-03 12:08:15 +02:00
Arne Morten Kvarving
93b8d26f86 fixed: allow using update_data with a opm-tests PR
the update_data command needs a full opm-tests checkout,
not just a shallow clone of the PR branch. we thus first
copy the shared copy, then we pull the PR branch into that copy.
2018-08-03 10:19:08 +02:00
Arne Morten Kvarving
0627a9f8ef added: strip test_ prefix from tests added with opm_add_test 2018-08-03 09:58:59 +02:00
Arne Morten Kvarving
3c88335852 changed: delete assignment operator in Deck class 2018-08-01 13:37:21 +02:00
Atgeirr Flø Rasmussen
ef3ef3142a Merge pull request #465 from joakim-hove/opm-pack
Add application opmpack to load a deck and dump it again as one stream
2018-08-01 08:16:03 +02:00
Joakim Hove
9c6a0cc5d9 Add application opmpack to load a deck and dump it again as one stream 2018-07-31 15:05:34 +02:00
Joakim Hove
4502333751 Ensure that path to restart file is interpreted relative to DATAFILE 2018-07-20 22:11:12 +02:00
Joakim Hove
64e5d123a2 Deck will internalize path to datafile 2018-07-19 08:20:04 +02:00
Joakim Hove
f80644b616 Remove special case for Travis 2018-07-19 06:44:20 +02:00
Joakim Hove
514df9c289 Merge pull request #84 from joakim-hove/delete-bug
Fix bug with TimeVector.delet()
2018-06-15 09:53:02 +02:00
Joakim Hove
b50da115b9 Fix bug with TimeVector.delet() 2018-06-14 16:03:42 +02:00
Joakim Hove
d22ba5b19a Merge pull request #83 from joakim-hove/drop-dates
Implement functionality to delete dates from TimeVector
2018-06-12 10:11:48 +02:00
Joakim Hove
7ab73165be Implement functionality to delete dates from TimeVector 2018-06-11 17:12:32 +02:00
Joakim Hove
800a4221ec Merge pull request #82 from joakim-hove/issues
Verify that first keyword in TimeVector is not dates
2018-06-11 16:56:33 +02:00
Joakim Hove
ef2384baf7 Verify that first keyword in TimeVector is not dates 2018-06-11 16:36:20 +02:00
Joakim Hove
ca4400224f Merge pull request #76 from joakim-hove/time-vector-bug
Time vector bug??
2018-05-31 21:34:13 +02:00
Joakim Hove
7dc82a43e3 Fix bug with DATES with no interleaved data 2018-05-31 21:24:37 +02:00
Joakim Hove
9f802a30ee Add utils.py with testing utilities 2018-05-31 20:48:39 +02:00
Joakim Hove
1f9de9be02 Add decorator as required module 2018-05-31 20:48:38 +02:00
Joakim Hove
4591353f68 Merge pull request #72 from joakim-hove/time-vector-reorg
Changed time_vector to start with DATES. Ignore TSTEP
2018-03-23 13:50:37 +01:00
Joakim Hove
2252a7bd33 Changed time_vector to start with DATES. Ignore TSTEP 2018-03-22 10:17:45 +01:00
Joakim Hove
23153f32ab Merge pull request #71 from joakim-hove/version-0.0.6
Set version to 0.0.6
2018-03-21 12:41:08 +01:00
Joakim Hove
83428bd716 Set version to 0.0.6 2018-03-21 12:40:41 +01:00
Joakim Hove
0ae305fc5d Merge pull request #70 from joakim-hove/version-0.0.5
Raised version to 0.0.5
2018-03-21 12:36:34 +01:00
Joakim Hove
cc82c1241e Raised version to 0.0.5 2018-03-21 12:35:48 +01:00
Joakim Hove
86625ee014 Merge pull request #69 from joakim-hove/sched-tool
Schedule merge functionality.
2018-03-20 22:16:10 +01:00
Joakim Hove
d33a5a39b6 Added class TimeVector to be used as basis for Schedule merging. 2018-03-15 10:10:01 +01:00
Kristian Reed
371f8fe59e Merge pull request #66 from ReedOnly/groupnet_v2
Add VFP table to Group
2018-02-27 14:29:53 +01:00
ReedMe
60f1ac8c67 Add vfp_table_nr to Group
VFP table nr  is added from GRUPNET for further use
related to GroupTree in Webportalen
2018-02-27 10:49:01 +01:00
Joakim Hove
baa4524a56 Merge pull request #62 from joakim-hove/opm-parser-masterII
Opm parser master ii
2018-02-23 15:54:03 +01:00
Joakim Hove
66cf592e8d Added package sunbeam.deck and function sunbeam.deck.parse() 2018-02-23 13:50:02 +01:00
Joakim Hove
83f2714766 Have create SunbeamState object for access to four top level objects. 2018-02-22 20:54:23 +01:00
Joakim Hove
c61218c496 Removed test which used to work due to side-effect 2018-02-22 15:15:28 +01:00
Joakim Hove
f22e884eb4 Merge pull request #64 from ReedOnly/python3
Python3 support
2018-02-22 10:30:15 +01:00
Kristian Reed
491c1461f2 add python 3 support and travis test 2018-02-22 10:19:32 +01:00
Joakim Hove
4f26da6e20 Merge pull request #61 from Statoil/0.0.4
Raised version number to 0.0.4
2018-02-14 21:21:03 +01:00
Joakim Hove
ee0bbb70bb Raised version number to 0.0.4 2018-02-14 21:19:15 +01:00
Pål Grønås Drange
86215b69a1 Merge pull request #58 from joakim-hove/use-pybind11
Use pybind11
2018-02-09 12:18:09 +01:00
Joakim Hove
c708381f52 Update travis to use pyenv 2018-02-08 18:53:15 +01:00
Joakim Hove
5eed642924 Fix testing of times:
- The first seven timesteps were specified as steps of length 365/7.0 days,
   when converted to seconds one second was lost due to rounding. This has been
   changed by using integer length TSTEP.

 - assertEqual() statements use full datetime; which has been shifted one full
   day forward to account for rounding errors due to the lost seconds.

 - EclipseState.getFirstRestartStep( ) is changed because we have configured to
   get restart data for the first report step every year, and that is now step 7
   instead of step 8.
2018-02-08 18:53:15 +01:00
Joakim Hove
67b30fe715 Use pybind11 as binding framework
This commit changes the api for the Schedule class, the various time related
methods now return datetime.datetime instances instead of datetime.data.
2018-02-08 18:53:15 +01:00
Joakim Hove
1566cd4e37 Change to pointer semantics in return value.
This change has been necessary to avoid premature destruction of the EclipseState
object.
2018-02-08 18:53:15 +01:00
Joakim Hove
2318c7cea4 Add pybind11 as git submodule 2018-02-08 18:35:53 +01:00
Joakim Hove
b5336fb128 Add if __name__ == "__main__" to all tests. 2018-02-08 18:35:47 +01:00
Joakim Hove
54f66af2bd Merge pull request #57 from joakim-hove/test-callable
Added if __name__ == "__main__" to test module.
2017-12-11 13:53:53 +01:00
Joakim Hove
6f6cdbc1dc Added if __name__ == "__main__" to test module. 2017-12-11 12:57:22 +01:00
Pål Grønås Drange
ffe2babdd9 Merge pull request #55 from joakim-hove/class-setup
Class setup
2017-12-06 18:01:27 +01:00
Joakim Hove
5d13eddfc8 Use setUpClass() method instead of class member variable. 2017-12-06 17:31:57 +01:00
Joakim Hove
e2a66f2bfe Using per test instance of EclipseState 2017-12-06 17:11:24 +01:00
Jens Gåsemyr Magnus
524af0dcf0 Extend Completion class implementation (#54)
* Extend Completion class implementation

Added access to several variables from the completion class. The Well
interface has been changed so that completions for any timestep can be
accessed rather than just the last.

* Bump version to 0.0.3

* Removed single space
2017-12-05 17:48:07 +01:00
abramb
69f74c858a Update the address of the submodule
The previous setting was correct, but was a bit of a problem cloning on
the linux laptop. Because of an issue with the VPN and SSH (ask Kjell
for the details), repos with git: must be cloned with the VPN off, while
repos with https: require the VPN to be on. After this change, both
sunbeam and pycmake can be cloned with the VPN off (now you can do git
clone --recursive)
2017-11-10 17:58:44 +01:00
Andrea Brambilla
d89412e238 Workaround for missing import in Equil.hpp in opm-parser 2017.10/final 2017-11-06 15:25:34 +01:00
Andrea Brambilla
c5fc5a0120 Make sunbeam compatible with opm-parser 2017.10 2017-11-06 15:25:34 +01:00
Joakim Hove
02f41b0524 Merge pull request #49 from pgdr/minor-cleanup
Remove redundant parameter
2017-10-18 08:29:26 +02:00
Pål Grønås Drange
2b9691e62c Remove redundant parameter 2017-10-17 22:15:44 +02:00
Pål Grønås Drange
800a06c253 Merge pull request #48 from joakim-hove/opm-parser-tag
Added tag instructions to Sunbeam readme.
2017-10-16 14:59:23 +02:00
Joakim Hove
490a0ac15c Use tag sunbeam-2017.10 when building opm-parser. 2017-10-16 12:12:29 +02:00
JensGM
2823c0672a Merge pull request #44 from JensGM/pydoc
Pydoc for user facing parse functions and rename action to recovery in user facing parse functions
2017-10-09 10:16:21 +02:00
Jens Gåsemyr Magnus
a1424cc2fa Pydoc for user facing parse functions
Rename action to recovery

Changed the name of actions to recoveries in the user facing parse
functions. Updated tests to reflect this.
2017-10-09 10:07:26 +02:00
Pål Grønås Drange
b21d3e84c4 Expose grouptree ultimate (#47) 2017-10-03 20:18:29 +02:00
Pål Grønås Drange
501235485f Merge pull request #46 from ReedOnly/update_ecl_conf
Build sunbeam with previous commit of OPM-parser
2017-10-03 18:24:54 +02:00
ReedMe
b15ab2dd01 Build sunbeam with previous commit of OPM-parser
8d202adefd
2017-10-03 17:06:33 +02:00
Joakim Hove
eaee5429df Merge pull request #42 from JensGM/expose-deck-data
Added support for reading Deck data
2017-09-22 09:04:58 +02:00
Jens Gåsemyr Magnus
2cfdfc8b98 Added support for reading Deck data 2017-09-21 10:30:14 +02:00
JensGM
56f326eec8 Merge pull request #43 from JensGM/forward-cpp-docstrings
Forward docstrings from C++
2017-09-15 14:34:36 +02:00
Jens Gåsemyr Magnus
fc594faaa4 Forward docstrings from C++
Some of the user facing functions and methods in sunbeam have no
implementation in the python-defined classes, but are forwarded from
boost python. This forwarding is done by hijacking the method call at
runtime, which means that python help() cannot resolve the docstring.

Copy the docstring into the hijacking attribute so that the docstring is
available as if the method/function was implemented directly in python.

help(eclipse_state_object) will now correcly forward the docstrings from
the forwarded EclipseState class.
2017-09-14 16:56:38 +02:00
Joakim Hove
4be3d3ccd2 Merge pull request #39 from JensGM/expose-deck
WIP: Expose deck features
2017-09-11 14:50:49 +02:00
Jens Gåsemyr Magnus
0ab722902d Combined header files to a single header file 2017-09-07 14:41:31 +02:00
Jens Gåsemyr Magnus
e1d860506a Started exposing deck 2017-09-07 12:36:10 +02:00
Jens Gåsemyr Magnus
11fe32df4f Add support for dynamic parser extensions
Sunbeam can now be used to parse eclipse files to deck representations.
Added support for dynamic parser extensions which can be used to handle
unsupported eclipse keywords when parsing to deck representations.

Fixed missing function declarations
2017-09-05 13:24:06 +02:00
Joakim Hove
9acb937361 Merge pull request #38 from ReedOnly/split-sunbeam-cpp
Split sunbeam cpp
2017-09-04 17:33:34 +02:00
Jens Gåsemyr Magnus
8f89b598f4 Split sunbeam.cpp
Split file in order to enhance c++ source file structure
2017-09-04 15:40:22 +02:00
Joakim Hove
79b9f66609 Merge pull request #35 from JensGM/separate-cpp-and-python
Separated C++ and python source files
2017-09-01 18:36:47 +02:00
Jens Gåsemyr Magnus
e92bd4bd36 Separated C++ and python source files
Separating the C++ and python source files to make the repository more
structures as we will create additional C++ source files.
2017-09-01 10:17:57 +02:00
Joakim Hove
4f2a8f8651 Merge pull request #33 from joakim-hove/use-rpath
Optionally enable RPATH in top level cmake file.
2017-08-30 13:51:08 +02:00
Joakim Hove
132ed34fa3 Travis will install and test using RPATH. 2017-08-29 09:42:15 +02:00
Joakim Hove
287834134c Using CMAKE_PREFIX:PATH in .travis.yml 2017-08-29 09:40:54 +02:00
Joakim Hove
4982f0fd61 Optionally enable RPATH in top level cmake file. 2017-08-28 23:15:19 +02:00
Pål Grønås Drange
4607224642 Merge pull request #32 from pgdr/parser-timemap-api-change
Adapt to change in schedule.getTimeMap in opm-parser
2017-08-18 09:44:46 +02:00
Pål Grønås Drange
163af49d18 Fix readme & travis with libecl, remove opm-common 2017-08-18 09:33:36 +02:00
Pål Grønås Drange
d5efa529ab Adapt to change in schedule.getTimeMap in opm-parser 2017-08-11 12:48:49 +02:00
Pål Grønås Drange
1959bce335 Merge pull request #31 from pgdr/add-norne
Add norne
2017-05-16 15:44:05 +02:00
Pål Grønås Drange
875c4efa8c added figures in examples 2017-05-16 13:54:04 +02:00
Pål Grønås Drange
1615417bd6 added norne integration-style test 2017-05-16 13:54:04 +02:00
Pål Grønås Drange
0e5fb1e0e0 added norne data files 2017-05-16 09:36:12 +02:00
Pål Grønås Drange
836098e6a8 Merge pull request #30 from pgdr/cell_vol
added getCellVolume on sunbeam.grid
2017-03-31 12:36:49 +02:00
Pål Grønås Drange
dd56505825 added getCellVolume on sunbeam.grid 2017-03-31 12:19:39 +02:00
Pål Grønås Drange
68a3df64c2 Merge pull request #29 from pgdr/table_lookup
Table lookup
2017-02-17 18:05:17 +01:00
Pål Grønås Drange
a4ff0e1114 parser changed default behaviour, update test 2017-02-17 16:09:24 +01:00
Pål Grønås Drange
c66cf7e159 added matplotlib example 2017-02-17 15:53:52 +01:00
Pål Grønås Drange
e1f64e83e0 table lookup in norne example 2017-02-17 15:15:05 +01:00
Pål Grønås Drange
1ed4517d65 implemented table lookup for eclipse_state 2017-02-17 15:07:09 +01:00
Pål Grønås Drange
d966376562 added basic tables support, and cornerpoint test data (#27)
* added basic tables support, and cornerpoint test data
2017-02-16 15:43:59 +01:00
Pål Grønås Drange
7a6fff51ca Update README.md 2017-02-09 14:46:21 +01:00
Pål Grønås Drange
0d8610ad04 JFunc now returns dict (#25)
made jfunc return dict
2017-02-05 10:41:28 +01:00
Joakim Hove
a30de369f9 Merge pull request #26 from joakim-hove/sunbeam-install
Add install( ) of libsunbeam.
2017-02-05 08:32:56 +01:00
Joakim Hove
8e5d3149c0 Add install( ) of libsunbeam. 2017-02-04 13:43:07 +01:00
Pål Grønås Drange
e2485b0c22 Jfunc (#24)
jfunc support
2017-02-03 11:31:22 +01:00
Pål Grønås Drange
af518e8908 Merge pull request #23 from pgdr/fault-example
added faults example
2017-01-14 13:06:21 +01:00
Pål Grønås Drange
7bdb0c7250 added faults example 2017-01-14 13:05:28 +01:00
Pål Grønås Drange
62de76c8f3 Merge pull request #22 from pgdr/faults
added faults
2017-01-13 14:50:15 +01:00
Pål Grønås Drange
d52da78ecc added faults test 2017-01-13 14:40:25 +01:00
Pål Grønås Drange
42fc9b27d1 added faults 2017-01-13 14:30:07 +01:00
Pål Grønås Drange
70a9ef173e Merge pull request #20 from pgdr/permx-test
added permx and globIdx test
2017-01-13 13:25:02 +01:00
Pål Grønås Drange
38e483fa5f Merge pull request #21 from pgdr/completion-support
added basic completions support
2017-01-13 13:08:52 +01:00
Pål Grønås Drange
39fa96b02f added some config classes, refactored out files 2017-01-13 12:52:50 +01:00
Pål Grønås Drange
afb28c00c2 added basic completions support 2017-01-12 17:17:01 +01:00
Pål Grønås Drange
cd75e134d5 added permx and globIdx test, test darcy conversion 2017-01-12 16:24:33 +01:00
Pål Grønås Drange
c606a2cc6e Merge pull request #19 from pgdr/spe3case1-whitespace
whitespace changes in SPE3CASE1.DATA
2017-01-12 15:31:53 +01:00
Pål Grønås Drange
1a419c88b6 whitespace changes in SPE3CASE1.DATA 2017-01-12 13:56:10 +01:00
Pål Grønås Drange
4f89ed02af Merge pull request #18 from pgdr/parseData
Added parseData and test
2017-01-12 13:41:34 +01:00
Pål Grønås Drange
2d1b96d908 added es.grid() to example 2017-01-12 13:12:00 +01:00
Pål Grønås Drange
dc293f9ec6 Made EclipseGrid type with tests 2017-01-12 12:54:21 +01:00
Pål Grønås Drange
bdb579b8db added parseData and test 2017-01-12 12:54:21 +01:00
Pål Grønås Drange
f6a6afa998 Merge pull request #17 from pgdr/griddims
added griddims accessors
2017-01-11 19:05:40 +01:00
Pål Grønås Drange
f26bc01f54 added griddims accessors 2017-01-11 16:53:52 +01:00
Pål Grønås Drange
82e18c5147 Merge pull request #16 from pgdr/e3dprops
Added  Eclipse3DProperties and NNC support
2017-01-11 13:18:34 +01:00
Pål Grønås Drange
2408611fb8 Added tests for props and state, refactor test setup 2017-01-11 12:43:35 +01:00
Pål Grønås Drange
f70793129d Added e3Dprops w regs, state.nnc and fixed comment 2017-01-11 12:42:38 +01:00
Pål Grønås Drange
2eab759227 Merge pull request #13 from pgdr/travis-build-and-test
added build and ctest
2017-01-10 12:41:32 +01:00
Pål Grønås Drange
a4d61d3493 deleted run_tests file no longer in use 2017-01-10 12:31:58 +01:00
Pål Grønås Drange
435d0d3a2e added build and ctest 2017-01-10 12:23:28 +01:00
Pål Grønås Drange
8ac3570255 Merge pull request #12 from pgdr/example
added small example
2017-01-10 08:57:08 +01:00
Pål Grønås Drange
60f1c983c6 add norne example, needs opm-data 2017-01-09 21:22:43 +01:00
Pål Grønås Drange
1903790bbe added example file 2017-01-09 20:01:51 +01:00
Pål Grønås Drange
0edb093b41 Merge pull request #11 from pgdr/repr-state-well-schedule
repr for state, schedule, well
2017-01-09 15:48:13 +01:00
Pål Grønås Drange
15362a145e repr for state, schedule, well 2017-01-09 15:41:52 +01:00
jokva
793f0b7be7 Merge pull request #10 from jokva/groups
Early group support
2016-12-19 09:31:37 +01:00
Jørgen Kvalsvik
c2d4372a1e Well status functions 2016-12-18 10:51:17 +01:00
Jørgen Kvalsvik
3876d67a96 Schedule.groups support 2016-12-18 10:30:57 +01:00
Jørgen Kvalsvik
a96a1317b0 Group disambiguations and massagers in namespaces 2016-12-17 13:04:10 +01:00
Jørgen Kvalsvik
c1bfade15f Split out converters in separate file. 2016-12-17 12:46:25 +01:00
Jørgen Kvalsvik
d3618225f0 KeyError exception translator; schedule.getitem 2016-12-17 12:10:14 +01:00
Jørgen Kvalsvik
b655f2d178 Get groups 2016-12-16 16:38:24 +01:00
Jørgen Kvalsvik
0f59ab1755 Allow delegate-decorated class constructors 2016-12-16 16:38:09 +01:00
jokva
bd5fa1e335 Merge pull request #9 from jokva/schedule.__contains__
Schedule.  contains
2016-12-16 12:44:03 +01:00
Jørgen Kvalsvik
b33190d30c Schedule.timesteps 2016-12-11 16:11:50 +01:00
Jørgen Kvalsvik
6426407d9b Schedule.start and Schedule.end 2016-12-11 13:00:00 +01:00
Jørgen Kvalsvik
9110164aa1 Preferred phase, group control+name, guide rate 2016-12-11 12:09:20 +01:00
Jørgen Kvalsvik
d669187eea Well.status 2016-12-11 11:45:36 +01:00
Jørgen Kvalsvik
bd3fae1b83 Richer Schedule; name property for Well. 2016-12-11 01:18:51 +01:00
Jørgen Kvalsvik
b2b5c471c1 Free functions on Well for filtering purposes 2016-12-11 01:16:55 +01:00
Jørgen Kvalsvik
f82990404f Schedule.contains and file for Schedule tests 2016-12-09 15:51:29 +01:00
Jørgen Kvalsvik
25bd997ffd Remove broken well test 2016-12-09 15:51:07 +01:00
Pål Grønås Drange
19fcb1f6b8 Merge pull request #8 from pgdr/travis-opm
added travis for opm-common and -parser
2016-12-09 13:11:12 +01:00
Pål Grønås Drange
b2748596ca build parser wo test 2016-12-08 15:58:03 +01:00
Pål Grønås Drange
a324a008fd added travis for opm-common and -parser 2016-12-08 15:46:29 +01:00
jokva
96892ec07a Merge pull request #7 from jokva/wells.py
Rudimentary Wells support.
2016-12-05 20:03:03 +01:00
Jørgen Kvalsvik
463659047e Primitive well support; delegate decorator
Some primitive Well support, and the needed classes to get a well from a
deck.

In an effort to reduce boilerplate, the delegate decorator is
introduced. Delegated classes from sunbeam.py can wrap around the python
classes generated by boost and augment their interface, but leverage the
original C++-object as its storage. Methods defined on the immediate
python objects bubble up.
2016-12-05 09:55:13 +01:00
Pål Grønås Drange
fa7a3029d3 Merge pull request #6 from jokva/sunbeam.parse
Sunbeam.parse
2016-12-02 10:27:43 +01:00
Jørgen Kvalsvik
321ef1d194 Support for parsecontext config 2016-12-01 16:11:47 +01:00
Jørgen Kvalsvik
25a3007a1e Move C++ source to python/, trivial bindings 2016-12-01 16:11:47 +01:00
Pål Grønås Drange
a9b537f5e8 Merge pull request #5 from jokva/python-sunbeam-makefile
Python sunbeam makefile
2016-12-01 15:56:56 +01:00
Jørgen Kvalsvik
c156eea300 Module for python cmake files; test template
Adds the pycmake makefile dependency and provides a submodule for build
convenience. Adds the SPE3CASE1 test case for some simple test writing
and a test template file.

Sets up python library structure.
2016-12-01 15:52:09 +01:00
Jørgen Kvalsvik
ba06217321 Dummy C++ target - makefile improvements 2016-11-25 15:11:45 +01:00
Pål Grønås Drange
79a61ac3c7 Merge pull request #3 from pgdr/travis-build-status
added travis build status icon
2016-11-24 10:13:34 +01:00
Pål Grønås Drange
76ae686880 added travis build status icon 2016-11-24 10:12:43 +01:00
Pål Grønås Drange
848978c155 Merge pull request #2 from pgdr/init-travis-support
initial travis support
2016-11-24 10:05:42 +01:00
Pål Grønås Drange
c4c8eaf887 initial travis support 2016-11-24 10:04:50 +01:00
Pål Grønås Drange
0186739c13 Merge pull request #1 from pgdr/pycmake
Added FindPythonModule (pycmake) and init cmake
2016-11-23 16:25:24 +01:00
Pål Grønås Drange
769a0eef8a Added FindPythonModule (pycmake) and init cmake 2016-11-21 12:04:27 +01:00
Pål Grønås Drange
823b4e4faf Initial commit 2016-11-21 11:32:23 +01:00
1753 changed files with 747390 additions and 29245 deletions

20
.clang-format Normal file
View File

@@ -0,0 +1,20 @@
{
BasedOnStyle: WebKit,
AlignAfterOpenBracket: AlwaysBreak,
AlignConsecutiveAssignments: false,
AlignConsecutiveDeclarations: false,
AlignAfterOpenBracket: Align,
AllowShortBlocksOnASingleLine: false,
AllowShortFunctionsOnASingleLine: None,
AlwaysBreakAfterReturnType: TopLevelDefinitions,
AlwaysBreakTemplateDeclarations: Yes,
BinPackArguments: false,
BinPackParameters: false,
BreakBeforeBraces: Linux,
BreakConstructorInitializers: BeforeComma,
ColumnLimit: 120,
Cpp11BracedListStyle: true,
FixNamespaceComments: true,
MaxEmptyLinesToKeep: 5,
NamespaceIndentation: Inner,
}

4
.gitignore vendored
View File

@@ -69,3 +69,7 @@ install
# emacs directory setting:
.dir-locals.el
*.pyc
*.eggs
*.egg-info

0
.gitmodules vendored Normal file
View File

View File

@@ -7,6 +7,10 @@ set(OPM_MACROS_ROOT ${PROJECT_SOURCE_DIR})
option(ENABLE_ECL_INPUT "Enable eclipse input support?" ON)
option(ENABLE_ECL_OUTPUT "Enable eclipse output support?" ON)
option(ENABLE_MOCKSIM "Build the mock simulator for io testing" ON)
option(OPM_ENABLE_PYTHON "Enable python bindings?" OFF)
option(OPM_INSTALL_PYTHON "Enable python bindings?" OFF)
option(OPM_ENABLE_EMBEDDED_PYTHON "Enable python bindings?" OFF)
# Output implies input
if(ENABLE_ECL_OUTPUT)
@@ -18,6 +22,7 @@ if(NOT ENABLE_ECL_INPUT)
set(ENABLE_ECL_OUTPUT OFF)
endif()
# not the same location as most of the other projects; this hook overrides
macro (dir_hook)
endmacro (dir_hook)
@@ -36,12 +41,12 @@ set(OPM_PROJECT_EXTRA_CODE_INTREE "#ENABLE_ECL_INPUT is needed by opm-common-pre
include(OpmPackage) #Make macros availabe after find_package(opm-common)")
if(ENABLE_ECL_OUTPUT)
set(OPM_PROJECT_EXTRA_CODE_INSTALLED "${OPM_PROJECT_EXTRA_CODE_INSTALLED}
set(COMPARE_SUMMARY_COMMAND ${CMAKE_INSTALL_PREFIX}/bin${${name}_VER_DIR}/compareSummary)
set(COMPARE_ECL_COMMAND ${CMAKE_INSTALL_PREFIX}/bin${${name}_VER_DIR}/compareECL)")
set(COMPARE_ECL_COMMAND ${CMAKE_INSTALL_PREFIX}/bin${${name}_VER_DIR}/compareECL)
set(OPM_PACK_COMMAND ${CMAKE_INSTALL_PREFIX}/bin${${name}_VER_DIR}/opmpack)")
set(OPM_PROJECT_EXTRA_CODE_INTREE "${OPM_PROJECT_EXTRA_CODE_INTREE}
set(COMPARE_SUMMARY_COMMAND ${PROJECT_BINARY_DIR}/bin/compareSummary)
set(COMPARE_ECL_COMMAND ${PROJECT_BINARY_DIR}/bin/compareECL)")
set(COMPARE_ECL_COMMAND ${PROJECT_BINARY_DIR}/bin/compareECL)
set(OPM_PACK_COMMAND ${PROJECT_BINARY_DIR}/bin/opmpack)")
endif()
# project information is in dune.module. Read this file and set variables.
@@ -105,8 +110,13 @@ macro (sources_hook)
include(GenerateKeywords.cmake)
# Append generated sources
list(APPEND opm-common_SOURCES ${PROJECT_BINARY_DIR}/ParserKeywords.cpp)
list(INSERT opm-common_SOURCES 0 ${PROJECT_BINARY_DIR}/ParserInit.cpp)
foreach (name A B C D E F G H I J K L M N O P Q R S T U V W X Y Z)
list(INSERT opm-common_SOURCES 0 ${PROJECT_BINARY_DIR}/ParserKeywords/${name}.cpp)
endforeach()
endif()
set_source_files_properties(src/opm/parser/eclipse/Python/Python.cpp
PROPERTIES COMPILE_FLAGS -Wno-shadow)
endmacro (sources_hook)
macro (fortran_hook)
@@ -127,8 +137,221 @@ macro (install_hook)
PATTERN *.hpp)
endmacro (install_hook)
# If opm-common is configured to embed the python interpreter we must make sure
# that all downstream modules link libpython transitively. Due to the required
# integration with Python+cmake machinery provided by pybind11 this is done by
# manually adding to the opm-common_LIBRARIES variable here, and not in the
# 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})
endif()
endif()
# all setup common to the OPM library modules is done here
include (OpmLibMain)
if (ENABLE_MOCKSIM)
add_library(mocksim
msim/src/msim.cpp)
target_link_libraries(mocksim opmcommon)
target_include_directories(mocksim PUBLIC msim/include)
add_executable(msim examples/msim.cpp)
target_link_libraries(msim mocksim)
set(_libs mocksim opmcommon
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
foreach( test test_msim test_msim_ACTIONX )
opm_add_test(${test} SOURCES tests/msim/${test}.cpp
LIBRARIES ${_libs}
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/tests
CONDITION HAVE_ECL_INPUT AND Boost_UNIT_TEST_FRAMEWORK_FOUND)
endforeach()
endif()
# Build the compare utilities
if(ENABLE_ECL_INPUT)
add_executable(compareECL
test_util/EclFilesComparator.cpp
test_util/EclRegressionTest.cpp
test_util/compareECL.cpp
)
add_executable(convertECL
test_util/convertECL.cpp
)
add_executable(summary
test_util/summary.cpp
)
foreach(target compareECL convertECL summary)
target_link_libraries(${target} opmcommon)
install(TARGETS ${target} DESTINATION bin)
endforeach()
# Add the tests
set(_libs opmcommon
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
opm_add_test(test_EclFilesComparator
CONDITION
ENABLE_ECL_INPUT AND Boost_UNIT_TEST_FRAMEWORK_FOUND
SOURCES
tests/test_EclFilesComparator.cpp
test_util/EclFilesComparator.cpp
LIBRARIES
${_libs}
WORKING_DIRECTORY
${PROJECT_BINARY_DIR}/tests
)
opm_add_test(test_EclRegressionTest
CONDITION
ENABLE_ECL_INPUT AND Boost_UNIT_TEST_FRAMEWORK_FOUND
SOURCES
tests/test_EclRegressionTest.cpp
test_util/EclFilesComparator.cpp
test_util/EclRegressionTest.cpp
LIBRARIES
${_libs}
WORKING_DIRECTORY
${PROJECT_BINARY_DIR}/tests
)
foreach(test test_EclIO test_EGrid test_ERft test_ERst test_ESmry)
opm_add_test(${test} CONDITION ENABLE_ECL_INPUT AND Boost_UNIT_TEST_FRAMEWORK_FOUND
LIBRARIES ${_libs}
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/tests)
endforeach()
endif()
# Install build system files
install(DIRECTORY cmake DESTINATION share/opm)
# Install tab completion skeleton
install(FILES etc/opm_bash_completion.sh.in DESTINATION share/opm/etc)
if (OPM_ENABLE_PYTHON)
# -------------------------------------------------------------------------
# 1: Wrap C++ functionality in Python
set(PYTHON_PACKAGE_PATH "site-packages")
set(PYTHON_INSTALL_PREFIX "lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/${PYTHON_PACKAGE_PATH}" CACHE STRING "Subdirectory to install Python modules in")
make_directory(${PROJECT_BINARY_DIR}/python)
get_target_property(_opmcommon_include_dirs opmcommon INCLUDE_DIRECTORIES)
list(APPEND _opmcommon_include_dirs ${_ecl_include_dirs})
string(REPLACE ";" ":" _setup_include_dirs "${_opmcommon_include_dirs}")
if (CMAKE_PREFIX_PATH)
set(_opmcommon_lib_dirs ${PROJECT_BINARY_DIR}/lib ${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR})
else()
set(_opmcommon_lib_dirs ${PROJECT_BINARY_DIR}/lib)
endif()
string(REPLACE ";" ":" _setup_lib_dirs "${_opmcommon_lib_dirs}")
if (USE_RUNPATH)
set (_python_rpath_list)
if (CMAKE_PREFIX_PATH)
foreach(path ${CMAKE_PREFIX_PATH})
list(APPEND _python_rpath_list "${path}/${CMAKE_INSTALL_LIBDIR}")
endforeach()
endif()
if (BUILD_SHARED_LIBS)
list(APPEND _python_rpath_list "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
endif()
if (_python_rpath_list)
string(REPLACE ";" ":" _rpath "${_python_rpath_list}")
set( _rpath_arg "--rpath=${_rpath}")
else()
set(_rpath_arg "")
endif()
else()
set( _rpath_arg "")
endif()
execute_process(COMMAND ${PYTHON_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)
add_custom_command(OUTPUT python/python/opm/${python_lib_target}
DEPENDS ${PYTHON_CXX_DEPENDS}
DEPENDS copy_python
COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_BINARY_DIR}/python/setup.py
build
build_ext
--build-lib=${PROJECT_BINARY_DIR}/python/python/opm
--library-dirs=${_setup_lib_dirs}
${_rpath_arg}
--include-dirs=${_setup_include_dirs}
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/python
COMMENT "Building python bindings")
add_custom_target(opmcommon_python ALL DEPENDS python/python/opm/${python_lib_target})
add_dependencies(opmcommon_python opmcommon)
# The install target is based on manually copying the python file tree to the
# installation area with a small installation script 'install.py'. Would have
# preferred to use standard setup.py install, but the setup.py based solution
# refuses to install to a location which the current python executable can not
# load from, and the use of eggs in the setup.py based installation makes
# debugging quite difficult.
#
# Since the installation of Python code is nonstandard it is protected by an
# extra cmake switch, OPM_INSTALL_PYTHON. If you prefer you can still invoke
# 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/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
# python library opmcommon_python will in general not find it runtime while
# 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/python/opm test
)
set_target_properties(opmcommon PROPERTIES POSITION_INDEPENDENT_CODE ON)
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${PROJECT_BINARY_DIR}/python/python)
# -------------------------------------------------------------------------
# Let cmake configure some small shell scripts which can be used to simplify
# building, testing and installation of the Python extensions.
configure_file(python/setup-build.sh.in tmp/setup-build.sh)
file( COPY ${PROJECT_BINARY_DIR}/tmp/setup-build.sh
DESTINATION ${PROJECT_BINARY_DIR}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE )
configure_file(python/setup-test.sh.in tmp/setup-test.sh)
file( COPY ${PROJECT_BINARY_DIR}/tmp/setup-test.sh
DESTINATION ${PROJECT_BINARY_DIR}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE )
configure_file(python/setup-install.sh.in tmp/setup-install.sh)
file( COPY ${PROJECT_BINARY_DIR}/tmp/setup-install.sh
DESTINATION ${PROJECT_BINARY_DIR}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE )
configure_file(python/enable-python.sh.in enable-python.sh)
# -------------------------------------------------------------------------
# 2: Embed the Python interpreter for keywords like PYACTION and PYINPUT
if (OPM_ENABLE_EMBEDDED_PYTHON)
add_subdirectory(python/pybind11)
target_include_directories(opmcommon PRIVATE "python/pybind11/include;${PYTHON_INCLUDE_DIRS}")
target_link_libraries(opmcommon PUBLIC ${PYTHON_LIBRARY})
add_definitions(-DEMBEDDED_PYTHON)
endif()
endif()

View File

@@ -1,5 +1,5 @@
# This file sets up five lists:
# MAIN_SOURCE_FILES List of compilation units which will be included in
# MAIN_SOURCE_FILES List of compilation units which will be included in
# the library. If it isn't on this list, it won't be
# part of the library. Please try to keep it sorted to
# maintain sanity.
@@ -30,28 +30,38 @@ list (APPEND MAIN_SOURCE_FILES
src/opm/common/OpmLog/OpmLog.cpp
src/opm/common/OpmLog/StreamLog.cpp
src/opm/common/OpmLog/TimerLog.cpp
src/opm/common/utility/ActiveGridCells.cpp
src/opm/common/utility/FileSystem.cpp
src/opm/common/utility/numeric/MonotCubicInterpolator.cpp
src/opm/common/utility/parameters/Parameter.cpp
src/opm/common/utility/parameters/ParameterGroup.cpp
src/opm/common/utility/parameters/ParameterTools.cpp
src/opm/common/utility/numeric/calculateCellVol.cpp
src/opm/common/utility/TimeService.cpp
)
if(ENABLE_ECL_INPUT)
list(APPEND MAIN_SOURCE_FILES
src/opm/json/JsonObject.cpp
src/opm/parser/eclipse/Deck/Deck.cpp
src/opm/parser/eclipse/Deck/DeckItem.cpp
src/opm/parser/eclipse/Deck/DeckValue.cpp
src/opm/parser/eclipse/Deck/DeckKeyword.cpp
src/opm/parser/eclipse/Deck/DeckRecord.cpp
src/opm/parser/eclipse/Deck/DeckOutput.cpp
src/opm/parser/eclipse/Deck/Section.cpp
src/opm/parser/eclipse/Deck/DeckSection.cpp
src/opm/parser/eclipse/Deck/UDAValue.cpp
src/opm/parser/eclipse/Python/Python.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/checkDeck.cpp
src/opm/parser/eclipse/EclipseState/Eclipse3DProperties.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
src/opm/parser/eclipse/EclipseState/Grid/BoxManager.cpp
src/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp
@@ -60,106 +70,212 @@ if(ENABLE_ECL_INPUT)
src/opm/parser/eclipse/EclipseState/Grid/Fault.cpp
src/opm/parser/eclipse/EclipseState/Grid/FaultFace.cpp
src/opm/parser/eclipse/EclipseState/Grid/GridDims.cpp
src/opm/parser/eclipse/EclipseState/Grid/GridProperties.cpp
src/opm/parser/eclipse/EclipseState/Grid/GridProperty.cpp
src/opm/parser/eclipse/EclipseState/Grid/MULTREGTScanner.cpp
src/opm/parser/eclipse/EclipseState/Grid/NNC.cpp
src/opm/parser/eclipse/EclipseState/Grid/Operate.cpp
src/opm/parser/eclipse/EclipseState/Grid/PinchMode.cpp
src/opm/parser/eclipse/EclipseState/Grid/SatfuncPropertyInitializers.cpp
src/opm/parser/eclipse/EclipseState/Grid/setKeywordBox.cpp
src/opm/parser/eclipse/EclipseState/Grid/TransMult.cpp
src/opm/parser/eclipse/EclipseState/InitConfig/Equil.cpp
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/Schedule/Connection.cpp
src/opm/parser/eclipse/EclipseState/Schedule/WellConnections.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionAST.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionContext.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionResult.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/Actdims.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/Actions.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionX.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionParser.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionValue.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/ASTNode.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/Condition.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/PyAction.cpp
src/opm/parser/eclipse/EclipseState/Schedule/ArrayDimChecker.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Events.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Group.cpp
src/opm/parser/eclipse/EclipseState/Schedule/GroupTree.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Group/Group.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRate.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateConfig.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateModel.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Group/GConSale.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Group/GConSump.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Group/GTNode.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/injection.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MessageLimits.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MSW/icd.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MSW/Compsegs.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MSW/updatingConnectionsWithSegments.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MSW/SpiralICD.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MSW/Valve.cpp
src/opm/parser/eclipse/EclipseState/Schedule/OilVaporizationProperties.cpp
src/opm/parser/eclipse/EclipseState/Schedule/RFTConfig.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp
src/opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.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/Tuning.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well.cpp
src/opm/parser/eclipse/EclipseState/Schedule/WellEconProductionLimits.cpp
src/opm/parser/eclipse/EclipseState/Schedule/WellInjectionProperties.cpp
src/opm/parser/eclipse/EclipseState/Schedule/WellPolymerProperties.cpp
src/opm/parser/eclipse/EclipseState/Schedule/WellProductionProperties.cpp
src/opm/parser/eclipse/EclipseState/Schedule/WellTestConfig.cpp
src/opm/parser/eclipse/EclipseState/Schedule/WellTestState.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/Connection.cpp
src/opm/parser/eclipse/EclipseState/Schedule/eval_uda.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/WList.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WListManager.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellEconProductionLimits.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellFoamProperties.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellPolymerProperties.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellBrineProperties.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellTracerProperties.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellTestConfig.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellTestState.cpp
src/opm/parser/eclipse/EclipseState/SimulationConfig/BCConfig.cpp
src/opm/parser/eclipse/EclipseState/SimulationConfig/RockConfig.cpp
src/opm/parser/eclipse/EclipseState/SimulationConfig/SimulationConfig.cpp
src/opm/parser/eclipse/EclipseState/SimulationConfig/ThresholdPressure.cpp
src/opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.cpp
src/opm/parser/eclipse/EclipseState/Tables/ColumnSchema.cpp
src/opm/parser/eclipse/EclipseState/Tables/DenT.cpp
src/opm/parser/eclipse/EclipseState/Tables/JFunc.cpp
src/opm/parser/eclipse/EclipseState/Tables/PvtxTable.cpp
src/opm/parser/eclipse/EclipseState/Tables/SimpleTable.cpp
src/opm/parser/eclipse/EclipseState/Tables/PolyInjTables.cpp
src/opm/parser/eclipse/EclipseState/Tables/StandardCond.cpp
src/opm/parser/eclipse/EclipseState/Tables/TableColumn.cpp
src/opm/parser/eclipse/EclipseState/Tables/TableContainer.cpp
src/opm/parser/eclipse/EclipseState/Tables/TableIndex.cpp
src/opm/parser/eclipse/EclipseState/Tables/TableManager.cpp
src/opm/parser/eclipse/EclipseState/Tables/TableSchema.cpp
src/opm/parser/eclipse/EclipseState/Tables/Tables.cpp
src/opm/parser/eclipse/EclipseState/UDQConfig.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQExpression.cpp
src/opm/parser/eclipse/EclipseState/Tables/Rock2dTable.cpp
src/opm/parser/eclipse/EclipseState/Tables/Rock2dtrTable.cpp
src/opm/parser/eclipse/EclipseState/Tables/PvtwsaltTable.cpp
src/opm/parser/eclipse/EclipseState/Tables/BrineDensityTable.cpp
src/opm/parser/eclipse/EclipseState/Tables/SolventDensityTable.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQASTNode.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParams.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParser.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQSet.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQActive.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQAssign.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQDefine.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQEnums.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQConfig.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQContext.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunction.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunctionTable.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQInput.cpp
src/opm/parser/eclipse/EclipseState/Schedule/VFPInjTable.cpp
src/opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.cpp
src/opm/parser/eclipse/Parser/ErrorGuard.cpp
src/opm/parser/eclipse/Parser/ParseContext.cpp
src/opm/parser/eclipse/Parser/Parser.cpp
src/opm/parser/eclipse/Parser/ParserEnums.cpp
src/opm/parser/eclipse/Parser/ParserItem.cpp
src/opm/parser/eclipse/Parser/ParserKeyword.cpp
src/opm/parser/eclipse/Parser/ParserRecord.cpp
src/opm/parser/eclipse/RawDeck/RawKeyword.cpp
src/opm/parser/eclipse/RawDeck/RawRecord.cpp
src/opm/parser/eclipse/RawDeck/StarToken.cpp
src/opm/parser/eclipse/Parser/raw/RawKeyword.cpp
src/opm/parser/eclipse/Parser/raw/RawRecord.cpp
src/opm/parser/eclipse/Parser/raw/StarToken.cpp
src/opm/parser/eclipse/Units/Dimension.cpp
src/opm/parser/eclipse/Units/UnitSystem.cpp
src/opm/parser/eclipse/Utility/Functional.cpp
src/opm/parser/eclipse/Utility/Stringview.cpp
)
# This list is only used to register a CMake dependency between the the python
# extension and the corresponding C++ wrapper files. The cpp files actually
# listed here are repeated in the actual definition of the extension in the
# setup.py file.
list( APPEND PYTHON_CXX_SOURCE_FILES
python/cxx/connection.cpp
python/cxx/converters.cpp
python/cxx/deck.cpp
python/cxx/deck_keyword.cpp
python/cxx/eclipse_io.cpp
python/cxx/field_props.cpp
python/cxx/eclipse_config.cpp
python/cxx/eclipse_grid.cpp
python/cxx/eclipse_state.cpp
python/cxx/export.cpp
python/cxx/group.cpp
python/cxx/log.cpp
python/cxx/parsecontext.cpp
python/cxx/parser.cpp
python/cxx/schedule.cpp
python/cxx/summary_state.cpp
python/cxx/table_manager.cpp
python/cxx/unit_system.cpp
python/cxx/well.cpp
)
if (OPM_ENABLE_EMBEDDED_PYTHON)
set_source_files_properties(${PYTHON_CXX_SOURCE_FILES} PROPERTIES COMPILE_FLAGS -Wno-shadow)
set_source_files_properties(src/opm/parser/eclipse/Python/PythonInterp.cpp PROPERTIES COMPILE_FLAGS -Wno-shadow)
set_source_files_properties(src/opm/parser/eclipse/EclipseState/Schedule/Action/PyAction.cpp PROPERTIES COMPILE_FLAGS -Wno-shadow)
list( APPEND MAIN_SOURCE_FILES src/opm/parser/eclipse/Python/PythonInterp.cpp ${PYTHON_CXX_SOURCE_FILES})
endif()
list( APPEND PYTHON_CXX_DEPENDS ${PYTHON_CXX_SOURCE_FILES}
python/cxx/converters.hpp
python/cxx/export.hpp)
if(NOT cjson_FOUND)
list(APPEND MAIN_SOURCE_FILES external/cjson/cJSON.c)
endif()
endif()
if(ENABLE_ECL_OUTPUT)
list( APPEND MAIN_SOURCE_FILES
src/opm/test_util/summaryIntegrationTest.cpp
src/opm/test_util/summaryRegressionTest.cpp
src/opm/test_util/summaryComparator.cpp
src/opm/test_util/EclFilesComparator.cpp
src/opm/io/eclipse/EclFile.cpp
src/opm/io/eclipse/EclOutput.cpp
src/opm/io/eclipse/EclUtil.cpp
src/opm/io/eclipse/EGrid.cpp
src/opm/io/eclipse/ERft.cpp
src/opm/io/eclipse/ERst.cpp
src/opm/io/eclipse/ESmry.cpp
src/opm/io/eclipse/OutputStream.cpp
src/opm/io/eclipse/rst/connection.cpp
src/opm/io/eclipse/rst/group.cpp
src/opm/io/eclipse/rst/header.cpp
src/opm/io/eclipse/rst/segment.cpp
src/opm/io/eclipse/rst/state.cpp
src/opm/io/eclipse/rst/well.cpp
src/opm/output/eclipse/AggregateActionxData.cpp
src/opm/output/eclipse/AggregateConnectionData.cpp
src/opm/output/eclipse/AggregateGroupData.cpp
src/opm/output/eclipse/AggregateMSWData.cpp
src/opm/output/eclipse/AggregateUDQData.cpp
src/opm/output/eclipse/AggregateWellData.cpp
src/opm/output/eclipse/CreateActionxDims.cpp
src/opm/output/eclipse/CreateDoubHead.cpp
src/opm/output/eclipse/CreateInteHead.cpp
src/opm/output/eclipse/CreateLogiHead.cpp
src/opm/output/eclipse/WellDataSerializers.cpp
src/opm/output/eclipse/CreateUdqDims.cpp
src/opm/output/eclipse/DoubHEAD.cpp
src/opm/output/eclipse/EclipseGridInspector.cpp
src/opm/output/eclipse/EclipseIO.cpp
src/opm/output/eclipse/InteHEAD.cpp
src/opm/output/eclipse/LinearisedOutputTable.cpp
src/opm/output/eclipse/LoadRestart.cpp
src/opm/output/eclipse/LogiHEAD.cpp
src/opm/output/eclipse/RestartIO.cpp
src/opm/output/eclipse/Summary.cpp
src/opm/output/eclipse/SummaryState.cpp
src/opm/output/eclipse/Tables.cpp
src/opm/output/eclipse/RegionCache.cpp
src/opm/output/eclipse/RestartValue.cpp
src/opm/output/eclipse/WriteInit.cpp
src/opm/output/eclipse/WriteRFT.cpp
src/opm/output/data/Solution.cpp
)
endif()
list (APPEND TEST_SOURCE_FILES
tests/test_ActiveGridCells.cpp
tests/test_calculateCellVol.cpp
tests/test_cmp.cpp
tests/test_cubic.cpp
@@ -167,33 +283,35 @@ list (APPEND TEST_SOURCE_FILES
tests/test_nonuniformtablelinear.cpp
tests/test_OpmLog.cpp
tests/test_param.cpp
tests/test_RootFinders.cpp
tests/test_SimulationDataContainer.cpp
tests/test_sparsevector.cpp
tests/test_uniformtablelinear.cpp
)
if(ENABLE_ECL_INPUT)
list(APPEND TEST_SOURCE_FILES
tests/parser/ACTIONX.cpp
tests/parser/ADDREGTests.cpp
tests/parser/AquiferCTTests.cpp
tests/parser/AqudimsTests.cpp
tests/parser/AquanconTests.cpp
tests/parser/AquiferTests.cpp
tests/parser/BoxTests.cpp
tests/parser/ColumnSchemaTests.cpp
tests/parser/ConnectionTests.cpp
tests/parser/COMPSEGUnits.cpp
tests/parser/CopyRegTests.cpp
tests/parser/DeckValueTests.cpp
tests/parser/DeckTests.cpp
tests/parser/DynamicStateTests.cpp
tests/parser/DynamicVectorTests.cpp
tests/parser/Eclipse3DPropertiesTests.cpp
tests/parser/EclipseGridTests.cpp
tests/parser/EmbeddedPython.cpp
tests/parser/EqualRegTests.cpp
tests/parser/EventTests.cpp
tests/parser/FaceDirTests.cpp
tests/parser/FaultTests.cpp
tests/parser/FieldPropsTests.cpp
tests/parser/FoamTests.cpp
tests/parser/FunctionalTests.cpp
tests/parser/GeomodifierTests.cpp
tests/parser/GridPropertyTests.cpp
tests/parser/GroupTests.cpp
tests/parser/InitConfigTest.cpp
tests/parser/IOConfigTests.cpp
@@ -203,11 +321,17 @@ if(ENABLE_ECL_INPUT)
tests/parser/MULTREGTScannerTests.cpp
tests/parser/OrderedMapTests.cpp
tests/parser/ParseContextTests.cpp
tests/parser/PORVTests.cpp
tests/parser/ParseContext_EXIT1.cpp
tests/parser/ParseDATAWithDefault.cpp
tests/parser/PYACTION.cpp
tests/parser/RawKeywordTests.cpp
tests/parser/ResinsightTest.cpp
tests/parser/RestartConfigTests.cpp
tests/parser/RFTConfigTests.cpp
tests/parser/RockTableTests.cpp
tests/parser/RunspecTests.cpp
tests/parser/SatfuncPropertyInitializersTests.cpp
tests/parser/SaltTableTests.cpp
tests/parser/ScheduleRestartTests.cpp
tests/parser/ScheduleTests.cpp
tests/parser/SectionTests.cpp
tests/parser/SimpleTableTests.cpp
@@ -228,31 +352,37 @@ if(ENABLE_ECL_INPUT)
tests/parser/UnitTests.cpp
tests/parser/ValueTests.cpp
tests/parser/WellSolventTests.cpp
tests/parser/WellTracerTests.cpp
tests/parser/WellTests.cpp
tests/parser/WLIST.cpp
tests/parser/WTEST.cpp)
endif()
if(ENABLE_ECL_OUTPUT)
list (APPEND TEST_SOURCE_FILES
tests/test_AggregateActionxData.cpp
tests/test_AggregateWellData.cpp
tests/test_CharArrayNullTerm.cpp
tests/test_compareSummary.cpp
tests/test_EclFilesComparator.cpp
tests/test_AggregateGroupData.cpp
tests/test_AggregateMSWData.cpp
tests/test_AggregateConnectionData.cpp
tests/test_AggregateUDQData.cpp
tests/test_ArrayDimChecker.cpp
tests/test_EclipseIO.cpp
tests/test_DoubHEAD.cpp
tests/test_InteHEAD.cpp
tests/test_LinearisedOutputTable.cpp
tests/test_LogiHEAD.cpp
tests/test_OutputStream.cpp
tests/test_regionCache.cpp
tests/test_PaddedOutputString.cpp
tests/test_Restart.cpp
tests/test_RFT.cpp
tests/test_rst.cpp
tests/test_Solution.cpp
tests/test_Summary.cpp
tests/test_Tables.cpp
tests/test_Wells.cpp
tests/test_WindowedArray.cpp
tests/test_writenumwells.cpp
tests/test_serialize_ICON.cpp
tests/test_serialize_SCON.cpp
tests/test_restartwellinfo.cpp
)
endif()
@@ -261,8 +391,11 @@ list (APPEND TEST_DATA_FILES
)
if(ENABLE_ECL_OUTPUT)
list (APPEND TEST_DATA_FILES
tests/FIRST_SIM.DATA
tests/FIRST_SIM_THPRES.DATA
tests/expect-wdims.chldg.err.out
tests/expect-wdims.err.out
tests/BASE_SIM.DATA
tests/BASE_SIM_THPRES.DATA
tests/RESTART_SIM.DATA
tests/summary_deck.DATA
tests/group_group.DATA
tests/testblackoilstate3.DATA
@@ -270,22 +403,48 @@ if(ENABLE_ECL_OUTPUT)
tests/table_deck.DATA
tests/summary_deck_non_constant_porosity.DATA
tests/SUMMARY_EFF_FAC.DATA
tests/SPE1CASE1.DATA
tests/SPE1CASE1.SMSPEC
tests/SPE1CASE1A.SMSPEC
tests/SPE9_CP_PACKED.DATA
tests/SOFR_TEST.DATA
tests/UDQ_TEST_WCONPROD_IUAD-2.DATA
tests/UDQ_ACTIONX_TEST1.DATA
tests/include_example_pvt.txt
tests/include_example_summary.txt
tests/include_sgof.txt
tests/include_swof.txt
tests/include_grid_3x5x4.grdecl
tests/SPE1CASE2.DATA
tests/SPE1CASE2_RESTART.DATA
tests/SPE1CASE2.X0060
)
endif()
list (APPEND EXAMPLE_SOURCE_FILES
)
if(ENABLE_ECL_INPUT)
list (APPEND TEST_DATA_FILES
tests/ECLFILE.INIT
tests/ECLFILE.FINIT
tests/SPE1CASE1.EGRID
tests/SPE1CASE1.RFT
tests/SPE1_TESTCASE.UNRST
tests/SPE1_TESTCASE.FUNRST
tests/SPE1_TESTCASE.F0025
tests/SPE1_TESTCASE.X0025
tests/SPE1CASE1.UNSMRY
tests/SPE1CASE1A.UNSMRY
tests/SPE1CASE1_RST60.SMSPEC
tests/SPE1CASE1_RST60.UNSMRY
)
list (APPEND EXAMPLE_SOURCE_FILES
examples/opmi.cpp
examples/opmpack.cpp
examples/opmhash.cpp
tests/rst_load.cpp
)
endif()
if(ENABLE_ECL_OUTPUT)
list(APPEND EXAMPLE_SOURCE_FILES
examples/test_util/compareECL.cpp
examples/test_util/compareSummary.cpp
)
endif()
# programs listed here will not only be compiled, but also marked for
# installation
@@ -294,14 +453,10 @@ list (APPEND PROGRAM_SOURCE_FILES
if(ENABLE_ECL_INPUT)
list (APPEND PROGRAM_SOURCE_FILES
examples/opmi.cpp
examples/opmpack.cpp
examples/opmhash.cpp
)
endif()
if(ENABLE_ECL_OUTPUT)
list(APPEND PROGRAM_SOURCE_FILES
examples/test_util/compareECL.cpp
examples/test_util/compareSummary.cpp
)
endif()
list( APPEND PUBLIC_HEADER_FILES
opm/common/ErrorMacros.hpp
@@ -314,9 +469,12 @@ list( APPEND PUBLIC_HEADER_FILES
opm/common/OpmLog/LogUtil.hpp
opm/common/OpmLog/MessageFormatter.hpp
opm/common/OpmLog/MessageLimiter.hpp
opm/common/OpmLog/Location.hpp
opm/common/OpmLog/OpmLog.hpp
opm/common/OpmLog/StreamLog.hpp
opm/common/OpmLog/TimerLog.hpp
opm/common/utility/ActiveGridCells.hpp
opm/common/utility/FileSystem.hpp
opm/common/utility/numeric/cmp.hpp
opm/common/utility/platform_dependent/disable_warnings.h
opm/common/utility/platform_dependent/reenable_warnings.h
@@ -336,6 +494,7 @@ list( APPEND PUBLIC_HEADER_FILES
opm/common/utility/parameters/ParameterStrings.hpp
opm/common/utility/parameters/ParameterTools.hpp
opm/common/utility/numeric/calculateCellVol.hpp
opm/common/utility/TimeService.hpp
)
if(ENABLE_ECL_INPUT)
list(APPEND PUBLIC_HEADER_FILES
@@ -349,6 +508,7 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/Units/UnitSystem.hpp
opm/parser/eclipse/Units/Units.hpp
opm/parser/eclipse/Units/Dimension.hpp
opm/parser/eclipse/Parser/ErrorGuard.hpp
opm/parser/eclipse/Parser/ParserItem.hpp
opm/parser/eclipse/Parser/Parser.hpp
opm/parser/eclipse/Parser/ParserRecord.hpp
@@ -359,28 +519,32 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/Parser/ParserConst.hpp
opm/parser/eclipse/EclipseState/InitConfig/InitConfig.hpp
opm/parser/eclipse/EclipseState/InitConfig/Equil.hpp
opm/parser/eclipse/EclipseState/InitConfig/FoamConfig.hpp
opm/parser/eclipse/EclipseState/Util/Value.hpp
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/GridDims.hpp
opm/parser/eclipse/EclipseState/Grid/TransMult.hpp
opm/parser/eclipse/EclipseState/Grid/GridProperties.hpp
opm/parser/eclipse/EclipseState/Grid/PinchMode.hpp
opm/parser/eclipse/EclipseState/Grid/MULTREGTScanner.hpp
opm/parser/eclipse/EclipseState/Grid/FaultCollection.hpp
opm/parser/eclipse/EclipseState/Grid/SatfuncPropertyInitializers.hpp
opm/parser/eclipse/EclipseState/Grid/Fault.hpp
opm/parser/eclipse/EclipseState/Grid/Box.hpp
opm/parser/eclipse/EclipseState/Grid/GridProperty.hpp
opm/parser/eclipse/EclipseState/Grid/FieldPropsManager.hpp
opm/parser/eclipse/EclipseState/Grid/FaultFace.hpp
opm/parser/eclipse/EclipseState/Grid/NNC.hpp
opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp
opm/parser/eclipse/EclipseState/Grid/BoxManager.hpp
opm/parser/eclipse/EclipseState/Grid/FaceDir.hpp
opm/parser/eclipse/EclipseState/Grid/MinpvMode.hpp
opm/parser/eclipse/EclipseState/Eclipse3DProperties.hpp
opm/parser/eclipse/EclipseState/EndpointScaling.hpp
opm/parser/eclipse/EclipseState/Tables/DenT.hpp
opm/parser/eclipse/EclipseState/Tables/SimpleTable.hpp
opm/parser/eclipse/EclipseState/Tables/StandardCond.hpp
opm/parser/eclipse/EclipseState/Tables/PolyInjTable.hpp
opm/parser/eclipse/EclipseState/Tables/PdvdTable.hpp
opm/parser/eclipse/EclipseState/Tables/TlpmixpaTable.hpp
opm/parser/eclipse/EclipseState/Tables/PvdgTable.hpp
@@ -389,9 +553,16 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/EclipseState/Tables/Regdims.hpp
opm/parser/eclipse/EclipseState/Tables/Eqldims.hpp
opm/parser/eclipse/EclipseState/Tables/SpecrockTable.hpp
opm/parser/eclipse/EclipseState/Tables/PvtwsaltTable.hpp
opm/parser/eclipse/EclipseState/Tables/BrineDensityTable.hpp
opm/parser/eclipse/EclipseState/Tables/SolventDensityTable.hpp
opm/parser/eclipse/EclipseState/Tables/SaltvdTable.hpp
opm/parser/eclipse/EclipseState/Tables/PlydhflfTable.hpp
opm/parser/eclipse/EclipseState/Tables/PlymwinjTable.hpp
opm/parser/eclipse/EclipseState/Tables/PlyshlogTable.hpp
opm/parser/eclipse/EclipseState/Tables/RsvdTable.hpp
opm/parser/eclipse/EclipseState/Tables/SkprwatTable.hpp
opm/parser/eclipse/EclipseState/Tables/SkprpolyTable.hpp
opm/parser/eclipse/EclipseState/Tables/SpecheatTable.hpp
opm/parser/eclipse/EclipseState/Tables/SgcwmisTable.hpp
opm/parser/eclipse/EclipseState/Tables/Sof2Table.hpp
@@ -416,6 +587,8 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/EclipseState/Tables/TableContainer.hpp
opm/parser/eclipse/EclipseState/Tables/AqutabTable.hpp
opm/parser/eclipse/EclipseState/Tables/PlyadsTable.hpp
opm/parser/eclipse/EclipseState/Tables/FoamadsTable.hpp
opm/parser/eclipse/EclipseState/Tables/FoammobTable.hpp
opm/parser/eclipse/EclipseState/Tables/PbvdTable.hpp
opm/parser/eclipse/EclipseState/Tables/SorwmisTable.hpp
opm/parser/eclipse/EclipseState/Tables/PlymaxTable.hpp
@@ -429,6 +602,10 @@ 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/Rock2dTable.hpp
opm/parser/eclipse/EclipseState/Tables/Rock2dtrTable.hpp
opm/parser/eclipse/EclipseState/Tables/RockwnodTable.hpp
opm/parser/eclipse/EclipseState/Tables/OverburdTable.hpp
opm/parser/eclipse/EclipseState/Tables/ColumnSchema.hpp
opm/parser/eclipse/EclipseState/Tables/PmiscTable.hpp
opm/parser/eclipse/EclipseState/Tables/RtempvdTable.hpp
@@ -440,81 +617,146 @@ if(ENABLE_ECL_INPUT)
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/Schedule/Action/ActionAST.hpp
opm/parser/eclipse/EclipseState/Schedule/Action/ActionContext.hpp
opm/parser/eclipse/EclipseState/Schedule/Action/ActionResult.hpp
opm/parser/eclipse/EclipseState/Schedule/Action/ActionValue.hpp
opm/parser/eclipse/EclipseState/Schedule/Action/Actdims.hpp
opm/parser/eclipse/EclipseState/Schedule/Action/Actions.hpp
opm/parser/eclipse/EclipseState/Schedule/Action/ActionX.hpp
opm/parser/eclipse/EclipseState/Schedule/Action/Condition.hpp
opm/parser/eclipse/EclipseState/Schedule/Action/ASTNode.hpp
opm/parser/eclipse/EclipseState/Schedule/Action/PyAction.hpp
opm/parser/eclipse/EclipseState/Schedule/ArrayDimChecker.hpp
opm/parser/eclipse/EclipseState/Schedule/TimeMap.hpp
opm/parser/eclipse/EclipseState/Schedule/VFPInjTable.hpp
opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.hpp
opm/parser/eclipse/EclipseState/Schedule/Well.hpp
opm/parser/eclipse/EclipseState/Schedule/WellInjectionProperties.hpp
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/Well.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/WList.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
opm/parser/eclipse/EclipseState/Schedule/Well/WellBrineProperties.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/WellPolymerProperties.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/WellTracerProperties.hpp
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/Schedule.hpp
opm/parser/eclipse/EclipseState/Schedule/WellEconProductionLimits.hpp
opm/parser/eclipse/EclipseState/Schedule/WellPolymerProperties.hpp
opm/parser/eclipse/EclipseState/Schedule/ScheduleTypes.hpp
opm/parser/eclipse/EclipseState/Schedule/Tuning.hpp
opm/parser/eclipse/EclipseState/Schedule/Group.hpp
opm/parser/eclipse/EclipseState/Schedule/Group/GTNode.hpp
opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp
opm/parser/eclipse/EclipseState/Schedule/Group/GuideRate.hpp
opm/parser/eclipse/EclipseState/Schedule/Group/GConSale.hpp
opm/parser/eclipse/EclipseState/Schedule/Group/GConSump.hpp
opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateConfig.hpp
opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateModel.hpp
opm/parser/eclipse/EclipseState/Schedule/MessageLimits.hpp
opm/parser/eclipse/EclipseState/Schedule/Events.hpp
opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp
opm/parser/eclipse/EclipseState/Schedule/OilVaporizationProperties.hpp
opm/parser/eclipse/EclipseState/Schedule/GroupTree.hpp
opm/parser/eclipse/EclipseState/Schedule/Connection.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
opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.hpp
opm/parser/eclipse/EclipseState/Schedule/MSW/updatingConnectionsWithSegments.hpp
opm/parser/eclipse/EclipseState/Schedule/WellProductionProperties.hpp
opm/parser/eclipse/EclipseState/Schedule/WellTestConfig.hpp
opm/parser/eclipse/EclipseState/Schedule/WellTestState.hpp
opm/parser/eclipse/EclipseState/Schedule/WellConnections.hpp
opm/parser/eclipse/EclipseState/Schedule/MSW/SpiralICD.hpp
opm/parser/eclipse/EclipseState/SimulationConfig/ThresholdPressure.hpp
opm/parser/eclipse/EclipseState/SimulationConfig/BCConfig.hpp
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
opm/parser/eclipse/EclipseState/Schedule/UDQ.hpp
opm/parser/eclipse/EclipseState/UDQConfig.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQExpression.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQAssign.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQASTNode.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQDefine.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQContext.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQConfig.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQEnums.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParams.hpp
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/UDQFunction.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunctionTable.hpp
opm/parser/eclipse/Deck/DeckItem.hpp
opm/parser/eclipse/Deck/Deck.hpp
opm/parser/eclipse/Deck/Section.hpp
opm/parser/eclipse/Deck/DeckSection.hpp
opm/parser/eclipse/Deck/DeckOutput.hpp
opm/parser/eclipse/Deck/DeckValue.hpp
opm/parser/eclipse/Deck/DeckKeyword.hpp
opm/parser/eclipse/Deck/DeckRecord.hpp
opm/parser/eclipse/RawDeck/StarToken.hpp
opm/parser/eclipse/RawDeck/RawEnums.hpp
opm/parser/eclipse/RawDeck/RawRecord.hpp
opm/parser/eclipse/RawDeck/RawKeyword.hpp
opm/parser/eclipse/RawDeck/RawConsts.hpp)
opm/parser/eclipse/Deck/UDAValue.hpp
opm/parser/eclipse/Deck/value_status.hpp
opm/parser/eclipse/Python/Python.hpp)
endif()
if(ENABLE_ECL_OUTPUT)
list(APPEND PUBLIC_HEADER_FILES
opm/io/eclipse/EclFile.hpp
opm/io/eclipse/EclIOdata.hpp
opm/io/eclipse/EclOutput.hpp
opm/io/eclipse/EclUtil.hpp
opm/io/eclipse/EGrid.hpp
opm/io/eclipse/ERft.hpp
opm/io/eclipse/ERst.hpp
opm/io/eclipse/ESmry.hpp
opm/io/eclipse/PaddedOutputString.hpp
opm/io/eclipse/OutputStream.hpp
opm/io/eclipse/rst/connection.hpp
opm/io/eclipse/rst/group.hpp
opm/io/eclipse/rst/header.hpp
opm/io/eclipse/rst/segment.hpp
opm/io/eclipse/rst/state.hpp
opm/io/eclipse/rst/well.hpp
opm/output/data/Aquifer.hpp
opm/output/data/Cells.hpp
opm/output/data/Solution.hpp
opm/output/data/Wells.hpp
opm/output/eclipse/VectorItems/aquifer.hpp
opm/output/eclipse/VectorItems/connection.hpp
opm/output/eclipse/VectorItems/group.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/AggregateActionxData.hpp
opm/output/eclipse/AggregateGroupData.hpp
opm/output/eclipse/AggregateConnectionData.hpp
opm/output/eclipse/AggregateMSWData.hpp
opm/output/eclipse/AggregateUDQData.hpp
opm/output/eclipse/AggregateWellData.hpp
opm/output/eclipse/CharArrayNullTerm.hpp
opm/output/eclipse/DoubHEAD.hpp
opm/output/eclipse/EclipseGridInspector.hpp
opm/output/eclipse/EclipseIO.hpp
opm/output/eclipse/EclipseIOUtil.hpp
opm/output/eclipse/InteHEAD.hpp
opm/output/eclipse/LogiHEAD.hpp
opm/output/eclipse/LinearisedOutputTable.hpp
opm/output/eclipse/LogiHEAD.hpp
opm/output/eclipse/RegionCache.hpp
opm/output/eclipse/RestartIO.hpp
opm/output/eclipse/RestartValue.hpp
opm/output/eclipse/Summary.hpp
opm/output/eclipse/SummaryState.hpp
opm/output/eclipse/Tables.hpp
opm/output/eclipse/WindowedArray.hpp
opm/output/eclipse/WriteInit.hpp
opm/output/eclipse/WriteRFT.hpp
opm/output/eclipse/WriteRestartHelpers.hpp
opm/output/OutputWriter.hpp
opm/test_util/EclFilesComparator.hpp
opm/test_util/summaryComparator.hpp
opm/test_util/summaryIntegrationTest.hpp
opm/test_util/summaryRegressionTest.hpp
)
endif()

View File

@@ -1,14 +1,10 @@
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
${BASE_DIR}/tmp_gen/ParserKeywords.cpp
${BASE_DIR}/ParserKeywords.cpp)
${BASE_DIR}/tmp_gen/ParserInit.cpp
${BASE_DIR}/ParserInit.cpp)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
${BASE_DIR}/tmp_gen/inlinekw.cpp
${BASE_DIR}/inlinekw.cpp)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
${BASE_DIR}/tmp_gen/include/opm/parser/eclipse/Parser/ParserKeywords.hpp
${BASE_DIR}/include/opm/parser/eclipse/Parser/ParserKeywords.hpp)
${BASE_DIR}/tmp_gen/TestKeywords.cpp
${BASE_DIR}/TestKeywords.cpp)
file(GLOB HDRS ${BASE_DIR}/tmp_gen/include/opm/parser/eclipse/Parser/ParserKeywords/*.hpp)
@@ -18,4 +14,11 @@ foreach(HDR ${HDRS})
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
${HDR}
${BASE_DIR}/include/opm/parser/eclipse/Parser/ParserKeywords/${hdr})
endforeach()
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)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
${BASE_DIR}/tmp_gen/ParserKeywords/${name}.cpp
${BASE_DIR}/ParserKeywords/${name}.cpp)
endforeach()

View File

@@ -1,25 +1,20 @@
# Libs to link tests against
set(TEST_LIBS opmcommon ecl Boost::unit_test_framework)
set(TEST_LIBS opmcommon Boost::unit_test_framework)
set(EXTRA_TESTS)
if (Boost_UNIT_TEST_FRAMEWORK_FOUND)
# Generated source, needs to be here
opm_add_test(InlineKeywordTest
EXE_NAME inlinekw
SOURCES ${PROJECT_BINARY_DIR}/inlinekw.cpp
EXE_NAME TestKeywords
SOURCES ${PROJECT_BINARY_DIR}/TestKeywords.cpp
LIBRARIES ${TEST_LIBS})
list(APPEND EXTRA_TESTS inlinekw)
list(APPEND EXTRA_TESTS TestKeywords)
# Extra compile definitions and extra parameters
include(cmake/Modules/CheckCaseSensitiveFileSystem.cmake)
set(_testdir ${PROJECT_SOURCE_DIR}/tests/parser/data)
opm_add_test(LoaderTest
SOURCES tests/parser/KeywordLoaderTests.cpp
src/opm/parser/eclipse/Generator/KeywordLoader.cpp
LIBRARIES ${TEST_LIBS}
TEST_ARGS ${_testdir}/parser/keyword-generator/)
list(APPEND EXTRA_TESTS LoaderTest)
opm_add_test(ParserTests
SOURCES tests/parser/ParserTests.cpp
LIBRARIES ${TEST_LIBS}
@@ -49,14 +44,13 @@ list(APPEND EXTRA_TESTS EclipseStateTests)
foreach (test BoxTest
CheckDeckValidity
EclipseGridCreateFromDeck
EDITNNCTests
IncludeTest
IntegrationTests
IOConfigIntegrationTest
NNCTests
ParseKEYWORD
ParseDATAWithDefault
Polymer
ResinsightTest
ScheduleCreateFromDeck
TransMultIntegrationTests)
@@ -86,17 +80,33 @@ if(HAVE_OPM_TESTS)
${OPM_TESTS_ROOT}/spe3/SPE3CASE2.DATA
${OPM_TESTS_ROOT}/spe9/SPE9_CP.DATA
${OPM_TESTS_ROOT}/spe9/SPE9_CP_GROUP.DATA
${OPM_TESTS_ROOT}/spe9/SPE9_CP_SHORT.DATA
${OPM_TESTS_ROOT}/spe9/SPE9_CP_SHORT_RESTART.DATA
${OPM_TESTS_ROOT}/spe9/SPE9.DATA
${OPM_TESTS_ROOT}/spe10model1/SPE10_MODEL1.DATA
${OPM_TESTS_ROOT}/spe10model2/SPE10_MODEL2.DATA
${OPM_TESTS_ROOT}/msw_2d_h/2D_H__.DATA )
${OPM_TESTS_ROOT}/msw_2d_h/2D_H__.DATA
${OPM_TESTS_ROOT}/model2/0_BASE_MODEL2.DATA
${OPM_TESTS_ROOT}/model2/1_MULTREGT_MODEL2.DATA
${OPM_TESTS_ROOT}/model2/2_MULTXYZ_MODEL2.DATA
${OPM_TESTS_ROOT}/model2/3_MULTFLT_MODEL2.DATA
${OPM_TESTS_ROOT}/model2/4_MINPVV_MODEL2.DATA
${OPM_TESTS_ROOT}/model2/5_SWATINIT_MODEL2.DATA
${OPM_TESTS_ROOT}/model2/6_ENDSCALE_MODEL2.DATA
${OPM_TESTS_ROOT}/model2/7_HYSTERESIS_MODEL2.DATA
${OPM_TESTS_ROOT}/model2/8_MULTIPLY_TRANXYZ_MODEL2.DATA
${OPM_TESTS_ROOT}/model2/9_EDITNNC_MODEL2.DATA)
get_filename_component(test_name ${deck} NAME_WE)
opm_add_test(${test_name} NO_COMPILE
EXE_NAME parse_write
TEST_ARGS ${deck})
endforeach()
opm_add_test("SPE9_CP_GROUP2" NO_COMPILE EXE_NAME parse_write TEST_ARGS "${OPM_TESTS_ROOT}/spe9group/SPE9_CP_GROUP.DATA")
set_property(TEST NORNE_ATW2013
PROPERTY ENVIRONMENT "OPM_ERRORS_IGNORE=PARSE_RANDOM_SLASH")
opm_add_test("RST_LOAD_MSW" NO_COMPILE EXE_NAME rst_load TEST_ARGS "${OPM_TESTS_ROOT}/msw_3d_hfa/opm-simulation-reference/flow/3D_MSW.UNRST")
endif()
# JSON tests
@@ -105,3 +115,5 @@ opm_add_test(jsonTests
LIBRARIES ${TEST_LIBS}
TEST_ARGS ${PROJECT_SOURCE_DIR}/tests/json/example1.json)
list(APPEND EXTRA_TESTS jsonTests)
endif()

View File

@@ -1,5 +1,7 @@
set(genkw_SOURCES src/opm/json/JsonObject.cpp
src/opm/parser/eclipse/Parser/createDefaultKeywordList.cpp
src/opm/parser/eclipse/Deck/UDAValue.cpp
src/opm/parser/eclipse/Deck/DeckValue.cpp
src/opm/parser/eclipse/Deck/Deck.cpp
src/opm/parser/eclipse/Deck/DeckItem.cpp
src/opm/parser/eclipse/Deck/DeckKeyword.cpp
@@ -7,14 +9,15 @@ set(genkw_SOURCES src/opm/json/JsonObject.cpp
src/opm/parser/eclipse/Deck/DeckOutput.cpp
src/opm/parser/eclipse/Generator/KeywordGenerator.cpp
src/opm/parser/eclipse/Generator/KeywordLoader.cpp
src/opm/parser/eclipse/Parser/ErrorGuard.cpp
src/opm/parser/eclipse/Parser/ParseContext.cpp
src/opm/parser/eclipse/Parser/ParserEnums.cpp
src/opm/parser/eclipse/Parser/ParserItem.cpp
src/opm/parser/eclipse/Parser/ParserKeyword.cpp
src/opm/parser/eclipse/Parser/ParserRecord.cpp
src/opm/parser/eclipse/RawDeck/RawKeyword.cpp
src/opm/parser/eclipse/RawDeck/RawRecord.cpp
src/opm/parser/eclipse/RawDeck/StarToken.cpp
src/opm/parser/eclipse/Parser/raw/RawKeyword.cpp
src/opm/parser/eclipse/Parser/raw/RawRecord.cpp
src/opm/parser/eclipse/Parser/raw/StarToken.cpp
src/opm/parser/eclipse/Units/Dimension.cpp
src/opm/parser/eclipse/Units/UnitSystem.cpp
src/opm/parser/eclipse/Utility/Stringview.cpp
@@ -29,7 +32,7 @@ if(NOT cjson_FOUND)
endif()
add_executable(genkw ${genkw_SOURCES})
target_link_libraries(genkw ecl Boost::regex Boost::filesystem Boost::system)
target_link_libraries(genkw ${opm-common_LIBRARIES})
# Generate keyword list
include(src/opm/parser/eclipse/share/keywords/keyword_list.cmake)
@@ -37,18 +40,74 @@ string(REGEX REPLACE "([^;]+)" "${PROJECT_SOURCE_DIR}/src/opm/parser/eclipse/sha
configure_file(src/opm/parser/eclipse/keyword_list.argv.in keyword_list.argv)
# Generate keyword source
add_custom_command(
OUTPUT ${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords.cpp ${PROJECT_BINARY_DIR}/tmp_gen/inlinekw.cpp
COMMAND genkw keyword_list.argv
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords.cpp
add_custom_command( OUTPUT
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/A.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/B.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/C.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/D.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/E.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/F.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/G.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/H.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/I.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/J.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/K.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/L.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/M.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/N.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/O.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/P.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/Q.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/R.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/S.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/T.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/U.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/V.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/W.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/X.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/Y.cpp
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/Z.cpp
${PROJECT_BINARY_DIR}/tmp_gen/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/inlinekw.cpp
${PROJECT_BINARY_DIR}/tmp_gen/TestKeywords.cpp
DEPENDS genkw ${keyword_files} src/opm/parser/eclipse/share/keywords/keyword_list.cmake
)
# To avoid some rebuilds
add_custom_command(OUTPUT ParserKeywords.cpp inlinekw.cpp
DEPENDS ${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords.cpp
add_custom_command(OUTPUT
${PROJECT_BINARY_DIR}/ParserKeywords/A.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/B.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/C.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/D.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/E.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/F.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/G.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/H.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/I.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/J.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/K.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/L.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/M.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/N.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/O.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/P.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/Q.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/R.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/S.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/T.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/U.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/V.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/W.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/X.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/Y.cpp
${PROJECT_BINARY_DIR}/ParserKeywords/Z.cpp
${PROJECT_BINARY_DIR}/TestKeywords.cpp
${PROJECT_BINARY_DIR}/ParserInit.cpp
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

@@ -3,6 +3,24 @@
A short month-by-month synopsis of change highlights. Most bugfixes won't make
it in here, only the bigger features and interface changes.
# Important changes between release 2019.04 and 2019.10
* opm-common and the rest of OPM does not use libecl anymore and
supports reading and writing Eclipse files directly
* Improved Eclipse compatible restart, support for unified and non unified
files, and formatted and unformatted files
* Support for reading and checking various additional keywords was introduced (those
starting with A - M, R, T, V, W, Z).
* ACTIONX support implemented
* NUPCOL support implemented
* UDA, UDQ support implemented
* Implemented writing saturation function scaled end-point arrays (e.g., SWL, SGU,
SOWCR, KRORW, PCG) to INIT file
* Fixes concerning interaction of WELOPEN and WCON* with WECON and
WTEST
* Added support for FOAM keywords (FOAMMOB, FOAMROCK, WFOAM)
* Refactored and reimplemented Well representation in deck
# 2016.12
* ZCORN adjustments improved, considers cell-cell relations
* Slightly more robust compilation - won't crash if locales are broken

View File

@@ -78,7 +78,17 @@ function (configure_vars obj syntax filename verb)
# write a CMake statements that warns if the value has changed
if ("${syntax}" STREQUAL "CMAKE")
set (_db "\${") # to avoid parsing problems
file (APPEND "${filename}" "if (DEFINED ${_var} AND NOT \"${_db}${_var}}\" STREQUAL \"${${_var}}\")\n")
# special case: if we have a truth variable HAVE_ and this is
# either just defined (as is), or set to 1 explicitly, then both
# of these count as "true", so put in a check that also accepts
# both of these values.
if (("${_var}" MATCHES "^HAVE_.*") AND
(("${${_var}}" STREQUAL "") OR ("${${_var}}" STREQUAL "1")))
set (_cond "(\"${_db}${_var}}\" STREQUAL \"\") OR (\"${_db}${_var}}\" STREQUAL \"1\")")
else ()
set (_cond "\"${_db}${_var}}\" STREQUAL \"${${_var}}\"")
endif ()
file (APPEND "${filename}" "if (DEFINED ${_var} AND NOT (${_cond}))\n")
file (APPEND "${filename}" "\tmessage (WARNING \"Incompatible value \\\"${_db}${_var}}\\\" of variable \\\"${_var}\\\"\")\n")
file (APPEND "${filename}" "endif ()\n")
endif ()

View File

@@ -0,0 +1,46 @@
find_library(ALBERTA_LTDL_LIB
NAMES ltdl
PATH_SUFFIXES lib lib32 lib64
)
find_path(ALBERTA_INCLUDE_DIR
NAMES alberta/alberta.h
PATHS ${ALBERTA_ROOT}
PATH_SUFFIXES alberta include NO_DEFAULT_PATH
DOC "Include path of Alberta")
find_path(ALBERTA_INCLUDE_DIR
NAMES
alberta/alberta.h
PATHS /usr/local /opt
PATH_SUFFIXES alberta)
#look for libraries
find_library(ALBERTA_UTIL_LIB
NAMES alberta_util alberta_utilities
PATHS ${ALBERTA_ROOT}
PATH_SUFFIXES lib lib32 lib64
NO_DEFAULT_PATH)
find_library(ALBERTA_UTIL_LIB
NAMES alberta_util alberta_utilities
PATH_SUFFIXES lib lib32 lib64)
foreach(dim RANGE 1 9)
find_library(ALBERTA_${dim}D_LIB alberta_${dim}d
PATHS ${ALBERTA_ROOT}
PATH_SUFFIXES lib lib32 lib64
Cache FILEPATH DOC "Alberta lib for ${dim}D" NO_DEFAULT_PATH)
find_library(ALBERTA_${dim}D_LIB alberta_${dim}d PATH_SUFFIXES lib lib32 lib64)
if(ALBERTA_${dim}D_LIB)
set(ALBERTA_LIBRARIES ${ALBERTA_LIBRARIES} ${ALBERTA_${dim}D_LIB})
endif()
endforeach(dim RANGE 1 9)
if(ALBERTA_LIBRARIES AND ALBERTA_INCLUDE_DIR)
set(ALBERTA_INCLUDE_DIRS ${ALBERTA_INCLUDE_DIR})
set(ALBERTA_LIBRARIES ${ALBERTA_LIBRARIES} ${ALBERTA_UTIL_LIB} ${ALBERTA_LTDL_LIB})
set(ALBERTA_FOUND ON)
set(Alberta_FOUND ON)
set(HAVE_ALBERTA 1)
set(DUNE_ALBERTA_VERSION 0x300)
else()
set(ALBERTA_FOUND OFF)
set(Alberta_FOUND OFF)
endif()

View File

@@ -1,468 +0,0 @@
#
# Module that checks for supported C++11 (former C++0x) features.
#
# Sets the follwing variable:
#
# HAVE_FINAL True if the compiler supports the "final" quantifier
# HAVE_TYPE_TRAITS True if the <type_traits> header is available and implements sufficient functionality
# HAVE_SHARED_PTR True if std::shared_ptr is available
# HAVE_UNIQUE_PTR True if std::unique_ptr is available
# HAVE_NULLPTR True if nullptr is available
# HAVE_ARRAY True if header <array> and fill() are available
# HAVE_ATTRIBUTE_ALWAYS_INLINE True if attribute always inline is supported
# HAS_ATTRIBUTE_UNUSED True if attribute unused is supported
# HAS_ATTRIBUTE_DEPRECATED True if attribute deprecated is supported
# HAS_ATTRIBUTE_DEPRECATED_MSG True if attribute deprecated("msg") is supported
# HAVE_CONSTEXPR True if constexpr attribute is available
# HAVE_INTEGRAL_CONSTANT True if compiler supports integral_constant
# HAVE_STATIC_ASSERT True if static_assert is available
# HAVE_AUTO True if the compiler supports the auto keyword
# HAVE_VARIADIC_TEMPLATES True if variadic templates are supported
# HAVE_VARIADIC_CONSTRUCTOR_SFINAE True if variadic constructor sfinae is supported
# HAVE_RVALUE_REFERENCES True if rvalue references are supported
# HAVE_TUPLE True if std::tuple is available
# HAVE_TR1_TUPLE True if std::tr1::tuple is available
include(CheckCXXSourceCompiles)
include(CheckCXXSourceRuns)
# test for C++11 flags
include(TestCXXAcceptsFlag)
include(CheckIncludeFileCXX)
# macro to only add option once
include(AddOptions)
# Force CXX Standard cross platfrom for CMakeVersion >=3.1
set(CMAKE_CXX_EXTENSIONS OFF)
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 11)
if(NOT MSVC)
foreach(_flag "14" "11")
set(_FLAG "CXX_FLAG_CXX${_flag}")
string(TOUPPER ${_FLAG} _FLAG)
# try to use compiler flag -std=c++${_flag}
CHECK_CXX_ACCEPTS_FLAG("-std=c++${_flag}" ${_FLAG})
if(${_FLAG})
if(CMAKE_VERSION VERSION_LESS 3.1)
add_options (CXX ALL_BUILDS "-std=c++${_flag}")
endif()
set(CXX_STD0X_FLAGS "-std=c++${_flag}")
#Use vriables for CMake > 3.1 set the standard with no extensions
set(CMAKE_CXX_STANDARD ${_flag})
break()
endif()
endforeach()
endif(NOT MSVC)
endif()
if(CMAKE_VERSION VERSION_LESS 3.1)
# if we are building with an Apple toolchain in MacOS X,
# we cannot use the old GCC 4.2 fork, but must use the
# new runtime library
set (CXX_STDLIB_FLAGS)
string (TOUPPER "${CMAKE_CXX_COMPILER_ID}" _comp_id)
if (APPLE AND (_comp_id MATCHES "CLANG"))
CHECK_CXX_ACCEPTS_FLAG ("-stdlib=libc++" CXX_FLAG_STDLIB_LIBCXX)
if (CXX_FLAG_STDLIB_LIBCXX)
add_options (CXX ALL_BUILDS "-stdlib=libc++")
set (CXX_STDLIB_FLAGS "-stdlib=libc++")
endif (CXX_FLAG_STDLIB_LIBCXX)
endif (APPLE AND (_comp_id MATCHES "CLANG"))
# to format the command-line options pretty, we have an optional space
if (CXX_STD0X_FLAGS AND CXX_STDLIB_FLAGS)
set (CXX_SPACE " ")
else (CXX_STD0X_FLAGS AND CXX_STDLIB_FLAGS)
set (CXX_SPACE)
endif (CXX_STD0X_FLAGS AND CXX_STDLIB_FLAGS)
endif()
if(NOT CMAKE_VERSION VERSION_LESS 3.1)
# Workaround bug in cmake:
# cxx standard flags are not applied in CheckCXXSourceCompiles
if (CMAKE_CXX_STANDARD EQUAL 14)
add_options(CXX ALL_BUILDS ${CMAKE_CXX14_STANDARD_COMPILE_OPTION})
else()
add_options(CXX ALL_BUILDS ${CMAKE_CXX11_STANDARD_COMPILE_OPTION})
endif()
endif()
# perform tests
include(CheckCXXSourceCompiles)
# the "final" method specifier
CHECK_CXX_SOURCE_COMPILES("
struct Base {
virtual void foo() = 0;
};
struct Derived : public Base {
virtual void foo() final {};
};
int main()
{
return 0;
}
" HAVE_FINAL
)
# std::is_convertible, std::is_base_of
CHECK_CXX_SOURCE_COMPILES("
#include <type_traits>
class Base {};
class Derived : public Base {};
int main()
{
bool foo = std::is_convertible<int, double>::value;
bool bar = std::is_base_of<Base, Derived>::value;
bool foobar = std::is_integral<double>::value;
return 0;
}
" HAVE_TYPE_TRAITS
)
# nullptr
CHECK_CXX_SOURCE_COMPILES("
#include <memory>
int main(void)
{
std::shared_ptr<int> foo(new int(123));
return 0;
}
" HAVE_SHARED_PTR
)
# this is required by dune-common to avoid linker errors. "fun"!
if (HAVE_SHARED_PTR)
set(HAVE_MAKE_SHARED 1)
set(SHARED_PTR_HEADER "<memory>")
set(SHARED_PTR_NAMESPACE "std")
endif()
# nullptr
CHECK_CXX_SOURCE_COMPILES("
#include <memory>
int main(void)
{
std::unique_ptr<int> foo(new int(123));
return 0;
}
" HAVE_UNIQUE_PTR
)
# nullptr
CHECK_CXX_SOURCE_COMPILES("
int main(void)
{
char* ch = nullptr;
return 0;
}
" HAVE_NULLPTR
)
# constexpr
CHECK_CXX_SOURCE_COMPILES("
template <class T>
inline constexpr int foo(T bar) { return bar*2; }
int main(void)
{
constexpr int foobar = foo(100);
return 0;
}
" HAVE_CONSTEXPR
)
# array and fill
CHECK_CXX_SOURCE_COMPILES("
#include <array>
int main(void)
{
std::array<int,2> a;
a.fill(9);
return 0;
}
" HAVE_ARRAY
)
# Check whether if std::integral_constant< T, v > is supported and casts into T
CHECK_CXX_SOURCE_COMPILES("
#include <type_traits>
void f( int ){}
int main(void){
f( std::integral_constant< int, 42 >() );
}
" HAVE_INTEGRAL_CONSTANT
)
# Check whether if <tuple> is available
check_include_file_cxx("tuple" HAVE_TUPLE)
# Check whether if <tr1/tuple> is available
check_include_file_cxx("tr1/tuple" HAVE_TR1_TUPLE)
# __attribute__((always_inline))
CHECK_CXX_SOURCE_COMPILES("
void __attribute__((always_inline)) foo(void) {}
int main(void)
{
foo();
return 0;
};
" HAVE_ATTRIBUTE_ALWAYS_INLINE
)
# __attribute__((unused))
CHECK_CXX_SOURCE_COMPILES("
int main(void)
{
int __attribute__((unused)) foo;
return 0;
};
" HAS_ATTRIBUTE_UNUSED
)
# __attribute__((deprecated))
CHECK_CXX_SOURCE_COMPILES("
#define DEP __attribute__((deprecated))
class bar
{
bar() DEP;
};
class peng { } DEP;
template <class T>
class t_bar
{
t_bar() DEP;
};
template <class T>
class t_peng {
t_peng() {};
} DEP;
void foo() DEP;
void foo() {};
int main(void)
{
return 0;
};
" HAS_ATTRIBUTE_DEPRECATED
)
# __attribute__((deprecated("msg")))
CHECK_CXX_SOURCE_COMPILES("
#define DEP __attribute__((deprecated(\"message\")))
class bar {
bar() DEP;
};
class peng { } DEP;
template <class T>
class t_bar
{
t_bar() DEP;
};
template <class T>
class t_peng
{
t_peng() {};
} DEP;
void foo() DEP;
void foo() {};
int main(void)
{
return 0;
};
" HAS_ATTRIBUTE_DEPRECATED_MSG
)
# static assert
CHECK_CXX_SOURCE_COMPILES("
int main(void)
{
static_assert(true,\"MSG\");
return 0;
}
" HAVE_STATIC_ASSERT
)
# auto keyword
CHECK_CXX_SOURCE_COMPILES("
int main(void)
{
auto foo = 1.23;
return 0;
}
" HAVE_AUTO
)
# variadic template support
CHECK_CXX_SOURCE_COMPILES("
#include <cassert>
template<typename... T>
int addints(T... x);
int add_ints()
{
return 0;
}
template<typename T1, typename... T>
int add_ints(T1 t1, T... t)
{
return t1 + add_ints(t...);
}
int main(void)
{
assert( 5 == add_ints(9,3,-5,-2) );
return 0;
}
" HAVE_VARIADIC_TEMPLATES
)
# SFINAE on variadic template constructors within template classes
CHECK_CXX_SOURCE_COMPILES("
#include <functional>
template<typename... U>
struct A
{
template<typename... T,
typename = typename std::enable_if<(sizeof...(T) < 2)>::type
>
A(T... t)
: i(1)
{}
template<typename... T,
typename = typename std::enable_if<(sizeof...(T) >= 2)>::type,
typename = void
>
A(T... t)
: i(-1)
{}
A()
: i(1)
{}
int i;
};
int main(void)
{
return (A<int>().i + A<int>(2).i + A<int>(\"foo\",3.4).i + A<int>(8,'a',A<int>()).i == 0 ? 0 : 1);
}
" HAVE_VARIADIC_CONSTRUCTOR_SFINAE
)
# rvalue references
CHECK_CXX_SOURCE_COMPILES("
#include <cassert>
#include <utility>
int foo(int&& x) { return 1; }
int foo(const int& x) { return -1; }
template<typename T>
int forward(T&& x)
{
return foo(std::forward<T>(x));
}
int main(void)
{
int i = 0;
assert( forward(i) + forward(int(2)) == 0);
return 0;
}
" HAVE_RVALUE_REFERENCES
)
include(CheckIncludeFile)
include(CheckIncludeFileCXX)
# Search for some tr1 headers
foreach(_HEADER tuple tr1/tuple type_traits tr1/type_traits)
string(REPLACE "/" "_" _HEADER_VAR ${_HEADER})
string(TOUPPER ${_HEADER_VAR} _HEADER_VAR )
check_include_file_cxx(${_HEADER} "HAVE_${_HEADER_VAR}")
endforeach(_HEADER tuple tr1/tuple tr1/type_traits)
# make sure that the C++-11 features implemented by the compiler are a
# superset of those provided by GCC 4.4. This makes the test fail on
# all GCC compilers before 4.4.
set(CXX_FEATURES_MISSING "")
if (NOT HAVE_TYPE_TRAITS)
set(CXX_FEATURES_MISSING
"${CXX_FEATURES_MISSING} - Sufficiently conformant type traits (defined by the 'type_traits' header file)\n")
endif()
if (NOT HAVE_SHARED_PTR)
set(CXX_FEATURES_MISSING
"${CXX_FEATURES_MISSING} - Shared pointers (the std::shared_ptr class)\n")
endif()
if (NOT HAVE_UNIQUE_PTR)
set(CXX_FEATURES_MISSING
"${CXX_FEATURES_MISSING} - Unique pointers (the std::unique_ptr class)\n")
endif()
if (NOT HAVE_ARRAY)
set(CXX_FEATURES_MISSING
"${CXX_FEATURES_MISSING} - Statically sized arrays (the std::array class)\n")
endif()
if (NOT HAVE_STATIC_ASSERT)
set(CXX_FEATURES_MISSING
"${CXX_FEATURES_MISSING} - Static assertations (the static_assert() mechanism)\n")
endif()
if (NOT HAVE_AUTO)
set(CXX_FEATURES_MISSING
"${CXX_FEATURES_MISSING} - Automatically typed variables (the 'auto' keyword)\n")
endif()
if (NOT HAVE_VARIADIC_TEMPLATES)
set(CXX_FEATURES_MISSING
"${CXX_FEATURES_MISSING} - Variable number of template arguments\n")
endif()
if (NOT HAVE_VARIADIC_CONSTRUCTOR_SFINAE)
set(CXX_FEATURES_MISSING
"${CXX_FEATURES_MISSING} - Constructors with variable number of template arguments obeying the SFINAE (specialization failure is not an error) rule\n")
endif()
if (NOT HAVE_RVALUE_REFERENCES)
set(CXX_FEATURES_MISSING
"${CXX_FEATURES_MISSING} - References to rvalue objects\n")
endif()
if (NOT HAVE_TUPLE)
set(CXX_FEATURES_MISSING
"${CXX_FEATURES_MISSING} - Tuples (the std::tuple class)\n")
endif()
if(CXX_FEATURES_MISSING)
set (CXX11FEATURES_FOUND FALSE)
if (CXX11Features_FIND_REQUIRED)
message(FATAL_ERROR
"Your C++ compiler does not support the minimum set of C++-2011 features required. "
"Make sure to use a compiler which implements all C++-2011 features provided by GCC 4.4. "
"Your compiler does not seem to implement the following features:\n"
"${CXX_FEATURES_MISSING}")
endif()
else ()
set (CXX11FEATURES_FOUND TRUE)
endif()

View File

@@ -1,287 +0,0 @@
# - Find the Ensemble-based Reservoir Tool (ERT)
#
# Set the cache variable ERT_ROOT to the install location of the ERT
# libraries and header files.
#
# If found, it sets these variables:
#
# ERT_INCLUDE_DIRS Header file directories
# ERT_LIBRARIES Archives and shared objects
# ERT_CONFIG_VARS Definitions that goes in config.h
# ERT_LINKER_FLAGS Options that must be passed to linker
#
# It will also add to CMAKE_C_FLAGS and CMAKE_CXX_FLAGS if necessary to
# link with the ERT libraries.
# variables to pass on to other packages
if (FIND_QUIETLY)
set (ERT_QUIET "QUIET")
else (FIND_QUIETLY)
set (ERT_QUIET "")
endif (FIND_QUIETLY)
# if a directory has been specified by the user, then don't go look
# in the system directories as well
if (ERT_ROOT)
set (_no_default_path "NO_DEFAULT_PATH")
else (ERT_ROOT)
set (_no_default_path "")
endif (ERT_ROOT)
# ERT doesn't have any config-mode file, so we need to specify the root
# directory in its own variable
find_path (ERT_ECL_INCLUDE_DIR
NAMES "ert/ecl/ecl_util.h"
HINTS "${ERT_ROOT}"
PATHS "${PROJECT_SOURCE_DIR}/../libecl" "${PROJECT_SOURCE_DIR}/../ert"
PATH_SUFFIXES "libecl/include/" "include"
DOC "Path to ERT Eclipse library header files"
${_no_default_path}
)
find_path (ERT_ECL_WELL_INCLUDE_DIR
NAMES "ert/ecl_well/well_const.h"
HINTS "${ERT_ROOT}"
PATHS "${PROJECT_SOURCE_DIR}/../libecl" "${PROJECT_SOURCE_DIR}/../ert"
PATH_SUFFIXES "libecl_well/include/" "include"
DOC "Path to ERT Eclipse library header files"
${_no_default_path}
)
find_path (ERT_ECLXX_INCLUDE_DIR
NAMES "ert/ecl/EclKW.hpp"
HINTS "${ERT_ROOT}"
PATHS "${PROJECT_SOURCE_DIR}/../libecl" "${PROJECT_SOURCE_DIR}/../ert"
PATH_SUFFIXES "libeclxx/include/" "include"
DOC "Path to ERT Eclipse C++ library header files"
${_no_default_path}
)
find_path (ERT_UTIL_INCLUDE_DIR
NAMES "ert/util/stringlist.h"
HINTS "${ERT_ROOT}"
PATHS "${PROJECT_SOURCE_DIR}/../libecl" "${PROJECT_SOURCE_DIR}/../ert"
PATH_SUFFIXES "libert_util/include/" "include"
DOC "Path to ERT Eclipse library header files"
${_no_default_path}
)
find_path (ERT_UTILXX_INCLUDE_DIR
NAMES "ert/util/ert_unique_ptr.hpp"
HINTS "${ERT_ROOT}"
PATHS "${PROJECT_SOURCE_DIR}/../libecl" "${PROJECT_SOURCE_DIR}/../ert"
PATH_SUFFIXES "libert_utilxx/include/" "include"
DOC "Path to ERT Eclipse C++ library header files"
${_no_default_path}
)
find_path (ERT_GEN_INCLUDE_DIR
NAMES "ert/util/int_vector.h"
HINTS "${ERT_ROOT}"
PATHS "${PROJECT_SOURCE_DIR}/../libecl" "${PROJECT_SOURCE_DIR}/../ert"
PATH_SUFFIXES "libert_util/include"
"include" "build/libert_util/include" "build/libert_util/include"
DOC "Path to ERT generated library header files"
${_no_default_path}
)
# need all of these libraries
if (CMAKE_SIZEOF_VOID_P)
math (EXPR _BITS "8 * ${CMAKE_SIZEOF_VOID_P}")
endif (CMAKE_SIZEOF_VOID_P)
find_library (ERT_LIBRARY_ECL
NAMES "ecl"
HINTS "${ERT_ROOT}"
PATHS "${PROJECT_BINARY_DIR}/../libecl"
"${PROJECT_SOURCE_DIR}/../libecl/build"
"${PROJECT_BINARY_DIR}/../libecl-build"
"${PROJECT_BINARY_DIR}/../ert"
"${PROJECT_SOURCE_DIR}/../ert/build"
"${PROJECT_BINARY_DIR}/../ert-build"
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
DOC "Path to ERT Eclipse library archive/shared object files"
${_no_default_path}
)
find_library (ERT_LIBRARY_ECLXX
NAMES "eclxx"
HINTS "${ERT_ROOT}"
PATHS "${PROJECT_BINARY_DIR}/../libecl"
"${PROJECT_SOURCE_DIR}/../libecl/build"
"${PROJECT_BINARY_DIR}/../libecl-build"
"${PROJECT_BINARY_DIR}/../ert"
"${PROJECT_SOURCE_DIR}/../ert/build"
"${PROJECT_BINARY_DIR}/../ert-build"
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
DOC "Path to ERT Eclipse C++ library archive/shared object files"
${_no_default_path}
)
find_library (ERT_LIBRARY_ECL_WELL
NAMES "ecl_well"
HINTS "${ERT_ROOT}"
PATHS "${PROJECT_BINARY_DIR}/../libecl"
"${PROJECT_SOURCE_DIR}/../libecl/build"
"${PROJECT_BINARY_DIR}/../libecl-build"
"${PROJECT_BINARY_DIR}/../ert"
"${PROJECT_SOURCE_DIR}/../ert/build"
"${PROJECT_BINARY_DIR}/../ert-build"
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
DOC "Path to ERT Eclipse library archive/shared object files"
${_no_default_path}
)
find_library (ERT_LIBRARY_GEOMETRY
NAMES "ert_geometry"
HINTS "${ERT_ROOT}"
PATHS "${PROJECT_BINARY_DIR}/../libecl"
"${PROJECT_SOURCE_DIR}/../libecl/build"
"${PROJECT_BINARY_DIR}/../libecl-build"
"${PROJECT_BINARY_DIR}/../ert"
"${PROJECT_SOURCE_DIR}/../ert/build"
"${PROJECT_BINARY_DIR}/../ert-build"
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
DOC "Path to ERT Geometry library archive/shared object files"
${_no_default_path}
)
find_library (ERT_LIBRARY_UTIL
NAMES "ert_util"
HINTS "${ERT_ROOT}"
PATHS "${PROJECT_BINARY_DIR}/../libecl"
"${PROJECT_SOURCE_DIR}/../libecl/build"
"${PROJECT_BINARY_DIR}/../libecl-build"
"${PROJECT_BINARY_DIR}/../ert"
"${PROJECT_SOURCE_DIR}/../ert/build"
"${PROJECT_BINARY_DIR}/../ert-build"
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
DOC "Path to ERT Utilities library archive/shared object files"
${_no_default_path}
)
find_library (ERT_LIBRARY_UTILXX
NAMES "ert_utilxx"
HINTS "${ERT_ROOT}"
PATHS "${PROJECT_BINARY_DIR}/../libecl"
"${PROJECT_SOURCE_DIR}/../libecl/build"
"${PROJECT_BINARY_DIR}/../libecl-build"
"${PROJECT_BINARY_DIR}/../ert"
"${PROJECT_SOURCE_DIR}/../ert/build"
"${PROJECT_BINARY_DIR}/../ert-build"
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
DOC "Path to ERT Utilities library archive/shared object files"
${_no_default_path}
)
# the "library" found here is actually a list of several files
list (APPEND ERT_INCLUDE_DIR
${ERT_ECL_INCLUDE_DIR}
${ERT_ECL_WELL_INCLUDE_DIR}
${ERT_ECLXX_INCLUDE_DIR}
${ERT_UTIL_INCLUDE_DIR}
${ERT_UTILXX_INCLUDE_DIR}
${ERT_GEN_INCLUDE_DIR}
)
list (APPEND ERT_LIBRARY
${ERT_LIBRARY_ECL}
${ERT_LIBRARY_ECLXX}
${ERT_LIBRARY_ECL_WELL}
${ERT_LIBRARY_GEOMETRY}
${ERT_LIBRARY_UTIL}
${ERT_LIBRARY_UTILXX}
)
list (APPEND ERT_LIBRARIES ${ERT_LIBRARY})
list (APPEND ERT_INCLUDE_DIRS ${ERT_INCLUDE_DIR})
# if we didn't find any files, then don't proceed through the entire dependency list
include (FindPackageHandleStandardArgs)
if (ERT_INCLUDE_DIR MATCHES "-NOTFOUND" OR ERT_LIBRARIES MATCHES "-NOTFOUND")
find_package_handle_standard_args (ERT
DEFAULT_MSG
ERT_INCLUDE_DIR ERT_LIBRARY
)
# clear the cache so the find probe is attempted again if files becomes
# available (only upon a unsuccessful *compile* should we disable further
# probing)
set (HAVE_ERT)
unset (HAVE_ERT CACHE)
return ()
endif (ERT_INCLUDE_DIR MATCHES "-NOTFOUND" OR ERT_LIBRARIES MATCHES "-NOTFOUND")
# dependencies
# parallel programming
include (UseOpenMP)
find_openmp (ERT)
# compression library
find_package (ZLIB ${ERT_QUIET})
if (ZLIB_FOUND)
list (APPEND ERT_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS})
list (APPEND ERT_LIBRARIES ${ZLIB_LIBRARIES})
endif (ZLIB_FOUND)
# numerics
find_package (BLAS ${ERT_QUIET})
if (BLAS_FOUND)
list (APPEND ERT_INCLUDE_DIRS ${BLAS_INCLUDE_DIRS})
list (APPEND ERT_LIBRARIES ${BLAS_LIBRARIES})
list (APPEND ERT_LINKER_FLAGS ${BLAS_LINKER_FLAGS})
endif (BLAS_FOUND)
find_package (LAPACK ${ERT_QUIET})
if (LAPACK_FOUND)
list (APPEND ERT_INCLUDE_DIRS ${LAPACK_INCLUDE_DIRS})
list (APPEND ERT_LIBRARIES ${LAPACK_LIBRARIES})
list (APPEND ERT_LINKER_FLAGS ${LAPACK_LINKER_FLAGS})
endif (LAPACK_FOUND)
# math library (should exist on all unices; automatically linked on Windows)
if (UNIX)
find_library (MATH_LIBRARY
NAMES "m"
)
list (APPEND ERT_LIBRARIES ${MATH_LIBRARY})
endif (UNIX)
# if shared libraries are disabled on linux, explcitly linking to the
# pthreads library is required by ERT
find_package(Threads ${ERT_QUIET})
if (CMAKE_THREAD_LIBS_INIT)
list (APPEND ERT_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
endif()
# Platform specific library where dlopen with friends lives
list (APPEND ERT_LIBRARIES ${CMAKE_DL_LIBS})
# since OpenMP often implies pthreads, we need to tidy up
# (last instance of library must be left standing, thus reversing that
# list before removing duplicates)
include (Duplicates)
remove_dup_deps (ERT)
# see if we can compile a minimum example
# CMake logical test doesn't handle lists (sic)
if (NOT (ERT_INCLUDE_DIR MATCHES "-NOTFOUND" OR ERT_LIBRARIES MATCHES "-NOTFOUND"))
include (CMakePushCheckState)
include (CheckCSourceCompiles)
cmake_push_check_state ()
set (CMAKE_REQUIRED_INCLUDES ${ERT_INCLUDE_DIR})
set (CMAKE_REQUIRED_LIBRARIES ${ERT_LIBRARIES})
check_cxx_source_compiles (
"#include <ert/ecl/ecl_grid.h>
int main ( ) {
ecl_grid_type * grid = ecl_grid_alloc_rectangular( 10,10,10,1,1,1, NULL);
ecl_grid_free( grid );
return 0;
}" HAVE_ERT)
cmake_pop_check_state ()
else (NOT (ERT_INCLUDE_DIR MATCHES "-NOTFOUND" OR ERT_LIBRARIES MATCHES "-NOTFOUND"))
# clear the cache so the find probe is attempted again if files becomes
# available (only upon a unsuccessful *compile* should we disable further
# probing)
set (HAVE_ERT)
unset (HAVE_ERT CACHE)
endif (NOT (ERT_INCLUDE_DIR MATCHES "-NOTFOUND" OR ERT_LIBRARIES MATCHES "-NOTFOUND"))
# if the test program didn't compile, but was required to do so, bail
# out now and display an error; otherwise limp on
find_package_handle_standard_args (ERT
DEFAULT_MSG
ERT_INCLUDE_DIR ERT_LIBRARY HAVE_ERT
)

View File

@@ -1,53 +0,0 @@
# - Find the Python wrappers for Ensemble-based Reservoir Tool (ERT)
#
# Set the cache variable ERT_PYTHON_PATH to the install location of
# the root ert package.
find_package(PythonInterp)
if(PYTHONINTERP_FOUND)
# We try to find the ert Python distribution. This is done by running
# Python code which tries to 'import ert' and prints out the path to
# the module if the import succeeds.
#
# The normal Python import machinery is employed, so if you have
# installed ert python in a default location, or alternatively set the
# PYTHONPATH variable the ert 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 ert; print os.path.dirname(os.path.dirname(inspect.getfile(ert))); from ert.ecl import EclSum")
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( ERT_PYTHON_PATH ${stdout_output} CACHE PATH "Python path for ERT Python" )
break()
endif()
endforeach()
endif()
find_package_handle_standard_args("ERTPython" DEFAULT_MSG ERT_PYTHON_PATH)

View File

@@ -20,8 +20,7 @@ find_opm_package (
# TODO: we should probe for all the HAVE_* values listed below;
# however, we don't actually use them in our implementation, so
# we just include them to forward here in case anyone else does
"CXX11Features REQUIRED;
dune-grid REQUIRED;
"dune-grid REQUIRED;
ZLIB;
ZOLTAN;
METIS

View File

@@ -16,8 +16,7 @@ find_opm_package (
"dune-common"
# dependencies
"CXX11Features REQUIRED;
BLAS REQUIRED;
"BLAS REQUIRED;
LAPACK REQUIRED;
CxaDemangle;
MPI

View File

@@ -19,8 +19,7 @@ find_opm_package (
# TODO: we should probe for all the HAVE_* values listed below;
# however, we don't actually use them in our implementation, so
# we just include them to forward here in case anyone else does
"CXX11Features REQUIRED;
dune-common REQUIRED;
"dune-common REQUIRED;
dune-grid REQUIRED;
dune-alugrid;
ZLIB;

View File

@@ -19,8 +19,7 @@ find_opm_package (
# TODO: we should probe for all the HAVE_* values listed below;
# however, we don't actually use them in our implementation, so
# we just include them to forward here in case anyone else does
"CXX11Features REQUIRED;
dune-common REQUIRED
"dune-common REQUIRED
"
# header to search for
"dune/geometry/quadraturerules.hh"

View File

@@ -22,12 +22,12 @@ find_opm_package (
# TODO: we should probe for all the HAVE_* values listed below;
# however, we don't actually use them in our implementation, so
# we just include them to forward here in case anyone else does
"CXX11Features REQUIRED;
dune-common REQUIRED;
"dune-common REQUIRED;
dune-geometry REQUIRED;
dune-uggrid;
MPI;
UG
UG;
Alberta
"
# header to search for
"dune/grid/onedgrid.hh"
@@ -55,7 +55,8 @@ int main (void) {
HAVE_AMIRAMESH;
HAVE_ALBERTA;
HAVE_STDINT_H;
DUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS
DUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS;
DUNE_ALBERTA_VERSION
")
#debug_find_vars ("dune-grid")

View File

@@ -7,8 +7,7 @@ find_opm_package (
# dependencies
# TODO: we should probe for all the HAVE_* values listed below;
# however, we don't actually use them in our implementation, so
"CXX11Features REQUIRED;
dune-common REQUIRED
"dune-common REQUIRED
"
# header to search for
""

View File

@@ -0,0 +1,6 @@
# Installs bash tab completion for a product
macro(opm_add_bash_completion binary)
set(PRODUCT ${binary})
configure_file(${OPM_MACROS_ROOT}/etc/opm_bash_completion.sh.in ${binary}_bash_completion.sh @ONLY)
install(FILES ${PROJECT_BINARY_DIR}/${binary}_bash_completion.sh DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/bash_completion.d)
endmacro()

View File

@@ -0,0 +1,99 @@
# Check for various compiler extensions
# HAVE_ATTRIBUTE_ALWAYS_INLINE True if attribute always inline is supported
# HAS_ATTRIBUTE_UNUSED True if attribute unused is supported
# HAS_ATTRIBUTE_DEPRECATED True if attribute deprecated is supported
# HAS_ATTRIBUTE_DEPRECATED_MSG True if attribute deprecated("msg") is supported
include(CheckCXXSourceCompiles)
# __attribute__((always_inline))
CHECK_CXX_SOURCE_COMPILES("
void __attribute__((always_inline)) foo(void) {}
int main(void)
{
foo();
return 0;
};
" HAVE_ATTRIBUTE_ALWAYS_INLINE
)
# __attribute__((unused))
CHECK_CXX_SOURCE_COMPILES("
int main(void)
{
int __attribute__((unused)) foo;
return 0;
};
" HAS_ATTRIBUTE_UNUSED
)
# __attribute__((deprecated))
CHECK_CXX_SOURCE_COMPILES("
#define DEP __attribute__((deprecated))
class bar
{
bar() DEP;
};
class peng { } DEP;
template <class T>
class t_bar
{
t_bar() DEP;
};
template <class T>
class t_peng {
t_peng() {};
} DEP;
void foo() DEP;
void foo() {};
int main(void)
{
return 0;
};
" HAS_ATTRIBUTE_DEPRECATED
)
# __attribute__((deprecated("msg")))
CHECK_CXX_SOURCE_COMPILES("
#define DEP __attribute__((deprecated(\"message\")))
class bar {
bar() DEP;
};
class peng { } DEP;
template <class T>
class t_bar
{
t_bar() DEP;
};
template <class T>
class t_peng
{
t_peng() {};
} DEP;
void foo() DEP;
void foo() {};
int main(void)
{
return 0;
};
" HAS_ATTRIBUTE_DEPRECATED_MSG
)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
list(APPEND ${project}_LIBRARIES stdc++fs)
endif()
endif()

View File

@@ -47,7 +47,7 @@ macro (opm_defaults opm)
endif(NOT PRECOMPILE_HEADERS)
# Use of OpenMP is considered experimental
set (USE_OPENMP_DEFAULT OFF)
set (USE_OPENMP_DEFAULT ON)
# if we are on a system where CMake 2.6 is the default (Hi RHEL 6!),
# the configuration files for Boost will trip up the library paths

View File

@@ -66,10 +66,6 @@ set (_opm_proj_exemptions
dune-fem
)
# although a DUNE module, it is delivered in the OPM suite
set (opm-core_SUITE "opm")
set (ewoms_SUITE "opm")
# insert this boilerplate whenever we are going to find a new package
macro (find_and_append_package_to prefix name)
# special handling for Boost to avoid inadvertedly picking up system
@@ -156,25 +152,7 @@ macro (find_and_append_package_to prefix name)
if ( (NOT DEFINED ${name}_FOUND AND NOT DEFINED ${NAME}_FOUND )
OR _search_components GREATER -1)
string(REGEX MATCH "(dune|opm)-.*" _is_opm ${name})
if(NOT _is_opm)
string(REGEX MATCH "ewoms" _is_opm ${name})
endif()
if(${name} STREQUAL "ecl")
# Give us a chance to find ecl installed to CMAKE_INSTALL_PREFIX.
# We need to deactivate the package registry for this.
create_module_dir_var(ecl)
set(ARGN_NO_REQUIRED ${ARGN})
if(ARGN)
list(REMOVE_ITEM ARGN_NO_REQUIRED "REQUIRED")
endif()
find_package (${name} ${ARGN_NO_REQUIRED} NO_CMAKE_SYSTEM_PACKAGE_REGISTRY NO_CMAKE_PACKAGE_REGISTRY)
if(TARGET ecl)
# Need to grab from target to enable transitional depends
#get_target_property(ecl_INCLUDE_DIRS ecl INTERFACE_INCLUDE_DIRECTORIES)
set(ecl_LIBRARIES ecl)
set(HAVE_ERT 1)
endif()
elseif(_${name}_exempted LESS 0 AND NOT _is_opm)
if(_${name}_exempted LESS 0 AND NOT _is_opm)
find_package (${name} ${ARGN})
elseif(_${name}_exempted GREATER -1)
find_package (${name} ${ARGN})

View File

@@ -20,6 +20,7 @@
# - CMP0026 to allow access to the LOCATION target property
# - CMP0048 to indicate that we want to deal with the *VERSION*
# variables ourselves
# - CMP0064 to indicate that we want TEST if conditions to be evaluated
if (POLICY CMP0026)
cmake_policy(SET CMP0026 OLD)
endif()
@@ -28,6 +29,10 @@ if (POLICY CMP0048)
cmake_policy(SET CMP0048 OLD)
endif()
if(POLICY CMP0064)
cmake_policy(SET CMP0064 NEW)
endif()
# set the behavior of the policy 0054 to NEW. (i.e. do not implicitly
# expand variables in if statements)
if (POLICY CMP0054)
@@ -59,6 +64,19 @@ project (${${project}_NAME})
enable_language (C)
enable_language (CXX)
# 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)
# print system information to better pinpoint issues from log alone
include (UseSystemInfo)
system_info ()
@@ -256,9 +274,13 @@ macro (cond_disable_test name)
endif ((NOT DEFINED HAVE_${name}) OR (NOT HAVE_${name}))
endmacro (cond_disable_test name)
# use this target to run all tests
# use this target to run all tests, with parallel execution
cmake_host_system_information(RESULT TESTJOBS QUERY NUMBER_OF_PHYSICAL_CORES)
if(TESTJOBS EQUAL 0)
set(TESTJOBS 1)
endif()
add_custom_target (check
COMMAND ${CMAKE_CTEST_COMMAND}
COMMAND ${CMAKE_CTEST_COMMAND} -j${TESTJOBS}
DEPENDS test-suite
COMMENT "Checking if library is functional"
VERBATIM

View File

@@ -162,7 +162,7 @@ macro (find_package_deps module)
# (i.e. if an optional package requests a package to be required,
# the build will fail if it's not found)
string (REPLACE "REQUIRED" "${_${module}_required}" _args_req "${_${module}_args}")
if(_dep MATCHES "opm-" OR _dep MATCHES "ewoms")
if(_dep MATCHES "opm-")
set(deplist ${_dep})
string(STRIP "${_dep}" _dep)
string(REPLACE " " ";" deplist "${_dep}")

View File

@@ -1,8 +1,5 @@
# - Build satellites that are dependent of main library
option(ADD_DISABLED_CTESTS "Add the tests which are disabled due to failed preconditions to the ctest output (this makes ctest return an error if such a test is present)" ON)
mark_as_advanced(ADD_DISABLED_CTESTS)
#
# Enumerate all source code in a "satellite" directory such as tests/,
# compile each of them and optionally set them as a test for CTest to
@@ -11,144 +8,139 @@ mark_as_advanced(ADD_DISABLED_CTESTS)
# The following suffices must be defined for the opm prefix passed as
# parameter:
#
# _LINKER_FLAGS Necessary flags to link with this library
# _TARGET CMake target which creates the library
# _LIBRARIES Other dependencies that must also be linked
# _LINKER_FLAGS Necessary flags to link with this library
# _TARGET CMake target which creates the library
# _LIBRARIES Other dependencies that must also be linked
# Synopsis:
# opm_compile_satellites (opm satellite excl_all test_regexp)
# opm_compile_satellites (opm satellite excl_all test_regexp)
#
# Parameters:
# opm Prefix of the variable which contain information
# about the library these satellites depends on, e.g.
# pass "opm-core" if opm-core_TARGET is the name of
# the target the builds this library. Variables with
# suffixes _TARGET and _LIBRARIES must exist.
# opm Prefix of the variable which contain information
# about the library these satellites depends on, e.g.
# pass "opm-core" if opm-core_TARGET is the name of
# the target the builds this library. Variables with
# suffixes _TARGET and _LIBRARIES must exist.
#
# satellite Prefix of variable which contain the names of the
# files, e.g. pass "tests" if the files are in the
# variable tests_SOURCES. Variables with suffixes
# _DATAFILES, _SOURCES and _DIR should exist. This
# name is also used as name of the target that builds
# all these files.
# satellite Prefix of variable which contain the names of the
# files, e.g. pass "tests" if the files are in the
# variable tests_SOURCES. Variables with suffixes
# _DATAFILES, _SOURCES and _DIR should exist. This
# name is also used as name of the target that builds
# all these files.
#
# excl_all EXCLUDE_FROM_ALL if these targets should not be built by
# default, otherwise empty string.
# excl_all EXCLUDE_FROM_ALL if these targets should not be built by
# default, otherwise empty string.
#
# test_regexp Regular expression which picks the name of a test
# out of the filename, or blank if no test should be
# setup.
# test_regexp Regular expression which picks the name of a test
# out of the filename, or blank if no test should be
# setup.
#
# Example:
# opm_compile_satellites (opm-core test "" "^test_([^/]*)$")
# opm_compile_satellites (opm-core test "" "^test_([^/]*)$")
#
macro (opm_compile_satellites opm satellite excl_all test_regexp)
# if we are going to build the tests always, then make sure that
# the datafiles are present too
if (NOT (${excl_all} MATCHES "EXCLUDE_FROM_ALL"))
set (_incl_all "ALL")
set (_incl_all "ALL")
else (NOT (${excl_all} MATCHES "EXCLUDE_FROM_ALL"))
set (_incl_all "")
set (_incl_all "")
endif (NOT (${excl_all} MATCHES "EXCLUDE_FROM_ALL"))
# if a set of datafiles has been setup, pull those in
add_custom_target (${satellite} ${_incl_all})
if (${satellite}_DATAFILES)
add_dependencies (${satellite} ${${satellite}_DATAFILES})
add_dependencies (${satellite} ${${satellite}_DATAFILES})
endif (${satellite}_DATAFILES)
# compile each of these separately
foreach (_sat_FILE IN LISTS ${satellite}_SOURCES)
get_filename_component (_sat_NAME "${_sat_FILE}" NAME_WE)
add_executable (${_sat_NAME} ${excl_all} ${_sat_FILE})
add_dependencies (${satellite} ${_sat_NAME})
set_target_properties (${_sat_NAME} PROPERTIES
LINK_FLAGS "${${opm}_LINKER_FLAGS_STR}"
)
if(HAVE_DYNAMIC_BOOST_TEST AND NOT (${opm} STREQUAL "opm-parser" AND NOT BUILD_SHARED_LIBS))
set_target_properties (${_sat_NAME} PROPERTIES
COMPILE_DEFINITIONS BOOST_TEST_DYN_LINK
)
endif()
# are we building a test? luckily, the testing framework doesn't
# require anything else, so we don't have to figure out where it
# should go in the library list
if (NOT "${test_regexp}" STREQUAL "")
set (_test_lib "${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}")
else (NOT "${test_regexp}" STREQUAL "")
set (_test_lib "")
add_static_analysis_tests(_sat_FILE ${opm}_INCLUDE_DIRS)
endif (NOT "${test_regexp}" STREQUAL "")
target_link_libraries (${_sat_NAME} ${${opm}_TARGET} ${${opm}_LIBRARIES} ${_test_lib})
if (STRIP_DEBUGGING_SYMBOLS)
strip_debug_symbols (${_sat_NAME} _sat_DEBUG)
list (APPEND ${satellite}_DEBUG ${_sat_DEBUG})
if (NOT "${test_regexp}" STREQUAL "" AND NOT Boost_UNIT_TEST_FRAMEWORK_FOUND)
continue()
endif()
get_filename_component (_sat_NAME "${_sat_FILE}" NAME_WE)
add_executable (${_sat_NAME} ${excl_all} ${_sat_FILE})
add_dependencies (${satellite} ${_sat_NAME})
set_target_properties (${_sat_NAME} PROPERTIES
LINK_FLAGS "${${opm}_LINKER_FLAGS_STR}")
if(HAVE_DYNAMIC_BOOST_TEST)
set_target_properties (${_sat_NAME} PROPERTIES
COMPILE_DEFINITIONS BOOST_TEST_DYN_LINK)
endif()
# are we building a test? luckily, the testing framework doesn't
# require anything else, so we don't have to figure out where it
# should go in the library list
if (NOT "${test_regexp}" STREQUAL "")
set (_test_lib "${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}")
else (NOT "${test_regexp}" STREQUAL "")
set (_test_lib "")
add_static_analysis_tests(_sat_FILE ${opm}_INCLUDE_DIRS)
endif (NOT "${test_regexp}" STREQUAL "")
target_link_libraries (${_sat_NAME} ${${opm}_TARGET} ${${opm}_LIBRARIES} ${_test_lib})
if (STRIP_DEBUGGING_SYMBOLS)
strip_debug_symbols (${_sat_NAME} _sat_DEBUG)
list (APPEND ${satellite}_DEBUG ${_sat_DEBUG})
endif()
# variable with regular expression doubles as a flag for
# whether tests should be setup or not
set(_sat_FANCY)
if (NOT "${test_regexp}" STREQUAL "")
foreach (_regexp IN ITEMS ${test_regexp})
if ("${_sat_NAME}" MATCHES "${_regexp}")
string (REGEX REPLACE "${_regexp}" "\\1" _sat_FANCY "${_sat_NAME}")
elseif(NOT _sat_FANCY)
set(_sat_FANCY ${_sat_NAME})
endif()
endforeach (_regexp)
get_target_property (_sat_LOC ${_sat_NAME} LOCATION)
# Run tests through mpi-run. Ubuntu 14.04 provided mpi libs will crash
# in the MPI_Finalize() call otherwise.
if(MPI_FOUND)
set(_sat_LOC ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 1 ${_sat_LOC})
endif()
if (CMAKE_VERSION VERSION_LESS "2.8.4")
add_test (NAME ${_sat_FANCY}
COMMAND ${CMAKE_COMMAND} -E chdir "${PROJECT_BINARY_DIR}/${${satellite}_DIR}" ${_sat_LOC})
else (CMAKE_VERSION VERSION_LESS "2.8.4")
add_test (${_sat_FANCY} ${_sat_LOC})
# run the test in the directory where the data files are
set_tests_properties (${_sat_FANCY} PROPERTIES
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/${${satellite}_DIR})
endif (CMAKE_VERSION VERSION_LESS "2.8.4")
if(NOT TARGET test-suite)
add_custom_target(test-suite)
endif()
add_dependencies(test-suite "${_sat_NAME}")
endif(NOT "${test_regexp}" STREQUAL "")
# variable with regular expression doubles as a flag for
# whether tests should be setup or not
set(_sat_FANCY)
if (NOT "${test_regexp}" STREQUAL "")
foreach (_regexp IN ITEMS ${test_regexp})
if ("${_sat_NAME}" MATCHES "${_regexp}")
string (REGEX REPLACE "${_regexp}" "\\1" _sat_FANCY "${_sat_NAME}")
elseif(NOT _sat_FANCY)
set(_sat_FANCY ${_sat_NAME})
endif()
endforeach (_regexp)
get_target_property (_sat_LOC ${_sat_NAME} LOCATION)
# Run tests through mpi-run. Ubuntu 14.04 provided mpi libs will crash
# in the MPI_Finalize() call otherwise.
if(MPI_FOUND)
set(_sat_LOC ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 1 ${_sat_LOC})
endif()
if (CMAKE_VERSION VERSION_LESS "2.8.4")
add_test (
NAME ${_sat_FANCY}
COMMAND ${CMAKE_COMMAND} -E chdir "${PROJECT_BINARY_DIR}/${${satellite}_DIR}" ${_sat_LOC}
)
else (CMAKE_VERSION VERSION_LESS "2.8.4")
add_test (${_sat_FANCY} ${_sat_LOC})
# run the test in the directory where the data files are
set_tests_properties (${_sat_FANCY} PROPERTIES
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/${${satellite}_DIR}
)
endif (CMAKE_VERSION VERSION_LESS "2.8.4")
if(NOT TARGET test-suite)
add_custom_target(test-suite)
endif()
add_dependencies(test-suite "${_sat_NAME}")
endif(NOT "${test_regexp}" STREQUAL "")
# if this program on the list of files that should be distributed?
# we check by the name of the source file
list (FIND ${satellite}_SOURCES_DIST "${_sat_FILE}" _is_util)
if (NOT (_is_util EQUAL -1))
install (TARGETS ${_sat_NAME} RUNTIME
DESTINATION bin${${opm}_VER_DIR}/
)
endif (NOT (_is_util EQUAL -1))
# if this program on the list of files that should be distributed?
# we check by the name of the source file
list (FIND ${satellite}_SOURCES_DIST "${_sat_FILE}" _is_util)
if (NOT (_is_util EQUAL -1))
install (TARGETS ${_sat_NAME} RUNTIME
DESTINATION bin${${opm}_VER_DIR}/)
endif (NOT (_is_util EQUAL -1))
endforeach (_sat_FILE)
endmacro (opm_compile_satellites opm prefix)
# Synopsis:
# opm_data (satellite target dirname files)
# opm_data (satellite target dirname files)
#
# provides these output variables:
#
# ${satellite}_INPUT_FILES List of all files that are copied
# ${satellite}_DATAFILES Name of target which copies these files
# ${satellite}_INPUT_FILES List of all files that are copied
# ${satellite}_DATAFILES Name of target which copies these files
#
# Example:
#
# opm_data (tests datafiles "tests/")
# opm_data (tests datafiles "tests/")
#
macro (opm_data satellite target dirname)
# even if there are no datafiles, create the directory so the
# satellite programs have a homedir to run in
execute_process (
COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/${dirname}
)
execute_process (COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/${dirname})
# if ever huge test datafiles are necessary, then change this
# into "create_symlink" (on UNIX only, apparently)
@@ -158,26 +150,27 @@ macro (opm_data satellite target dirname)
# to a tests/ directory in the output tree (if different)
set (${satellite}_INPUT_FILES)
if (NOT PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
foreach (input_datafile IN LISTS ${satellite}_DATA)
file (RELATIVE_PATH rel_datafile "${PROJECT_SOURCE_DIR}" ${input_datafile})
set (output_datafile "${PROJECT_BINARY_DIR}/${rel_datafile}")
add_custom_command (
OUTPUT ${output_datafile}
COMMAND ${CMAKE_COMMAND}
ARGS -E ${make_avail} ${input_datafile} ${output_datafile}
DEPENDS ${input_datafile}
VERBATIM
)
list (APPEND ${satellite}_INPUT_FILES "${output_datafile}")
endforeach (input_datafile)
foreach (input_datafile IN LISTS ${satellite}_DATA)
if (IS_ABSOLUTE ${input_datafile})
file (RELATIVE_PATH rel_datafile "${PROJECT_SOURCE_DIR}" ${input_datafile})
else()
set(rel_datafile ${input_datafile})
endif()
set (output_datafile "${PROJECT_BINARY_DIR}/${rel_datafile}")
add_custom_command (OUTPUT ${output_datafile}
COMMAND ${CMAKE_COMMAND}
ARGS -E ${make_avail} ${input_datafile} ${output_datafile}
DEPENDS ${input_datafile}
VERBATIM)
list (APPEND ${satellite}_INPUT_FILES "${output_datafile}")
endforeach (input_datafile)
endif(NOT PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
# setup a target which does all the copying
set (${satellite}_DATAFILES "${target}")
add_custom_target (${${satellite}_DATAFILES}
DEPENDS ${${satellite}_INPUT_FILES}
COMMENT "Making \"${satellite}\" data available in output tree"
)
DEPENDS ${${satellite}_INPUT_FILES}
COMMENT "Making \"${satellite}\" data available in output tree")
if(NOT TARGET test-suite)
add_custom_target(test-suite)
endif()
@@ -192,6 +185,7 @@ endmacro (opm_data satellite target dirname files)
# Parameters:
# TestName Name of test
# ONLY_COMPILE Only build test but do not run it (optional)
# DEFAULT_ENABLE_IF Only enable by default if a given condition is true (optional)
# ALWAYS_ENABLE Force enabling test even if -DBUILD_TESTING=OFF was set (optional)
# EXE_NAME Name of test executable (optional, default: ./bin/${TestName})
# CONDITION Condition to enable test (optional, cmake code)
@@ -218,7 +212,7 @@ macro(opm_add_test TestName)
cmake_parse_arguments(CURTEST
"NO_COMPILE;ONLY_COMPILE;ALWAYS_ENABLE" # flags
"EXE_NAME;PROCESSORS;WORKING_DIRECTORY" # one value args
"CONDITION;TEST_DEPENDS;DRIVER;DRIVER_ARGS;DEPENDS;TEST_ARGS;SOURCES;LIBRARIES" # multi-value args
"CONDITION;DEFAULT_ENABLE_IF;TEST_DEPENDS;DRIVER;DRIVER_ARGS;DEPENDS;TEST_ARGS;SOURCES;LIBRARIES" # multi-value args
${ARGN})
set(BUILD_TESTING "${BUILD_TESTING}")
@@ -228,6 +222,13 @@ macro(opm_add_test TestName)
set(CURTEST_EXE_NAME ${TestName})
endif()
# Strip test_ prefix from name
if ("${TestName}" MATCHES "^test_([^/]*)$")
string (REGEX REPLACE "^test_([^/]*)$" "\\1" _FANCY "${TestName}")
else()
set(_FANCY ${TestName})
endif()
# try to auto-detect the name of the source file if SOURCES are not
# explicitly specified.
if (NOT CURTEST_SOURCES)
@@ -259,6 +260,11 @@ macro(opm_add_test TestName)
# case. They can still be build using 'make test-suite' and they can
# be build and run using 'make check'
set(CURTEST_EXCLUDE_FROM_ALL "")
if (NOT "AND OR ${CURTEST_DEFAULT_ENABLE_IF}" STREQUAL "AND OR ")
if (NOT ${CURTEST_DEFAULT_ENABLE_IF})
set(CURTEST_EXCLUDE_FROM_ALL "EXCLUDE_FROM_ALL")
endif()
endif()
if (NOT BUILD_TESTING AND NOT CURTEST_ALWAYS_ENABLE)
set(CURTEST_EXCLUDE_FROM_ALL "EXCLUDE_FROM_ALL")
endif()
@@ -296,6 +302,8 @@ macro(opm_add_test TestName)
# only compile the binary but do not run it as a test
add_executable("${CURTEST_EXE_NAME}" ${CURTEST_EXCLUDE_FROM_ALL} ${CURTEST_SOURCES})
target_link_libraries (${CURTEST_EXE_NAME} ${CURTEST_LIBRARIES})
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
add_static_analysis_tests(CURTEST_SOURCES dirs)
if(TARGET ${project}_prepare)
add_dependencies("${CURTEST_EXE_NAME}" ${project}_prepare)
@@ -309,7 +317,13 @@ macro(opm_add_test TestName)
# run-only case occurs if the binary is already compiled by an
# earlier test.)
add_executable("${CURTEST_EXE_NAME}" ${CURTEST_EXCLUDE_FROM_ALL} ${CURTEST_SOURCES})
if(HAVE_DYNAMIC_BOOST_TEST)
set_target_properties (${CURTEST_EXE_NAME} PROPERTIES
COMPILE_DEFINITIONS BOOST_TEST_DYN_LINK)
endif()
target_link_libraries (${CURTEST_EXE_NAME} ${CURTEST_LIBRARIES})
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
add_static_analysis_tests(CURTEST_SOURCES dirs)
if(CURTEST_DEPENDS)
add_dependencies("${CURTEST_EXE_NAME}" ${CURTEST_DEPENDS})
@@ -331,18 +345,18 @@ macro(opm_add_test TestName)
endif()
endif()
add_test(NAME ${TestName}
add_test(NAME ${_FANCY}
WORKING_DIRECTORY "${CURTEST_WORKING_DIRECTORY}"
COMMAND ${CURTEST_COMMAND})
# specify the dependencies between the tests
if (CURTEST_TEST_DEPENDS)
set_tests_properties(${TestName} PROPERTIES DEPENDS "${CURTEST_TEST_DEPENDS}")
set_tests_properties(${_FANCY} PROPERTIES DEPENDS "${CURTEST_TEST_DEPENDS}")
endif()
# tell ctest how many cores it should reserve to run the test
if (CURTEST_PROCESSORS)
set_tests_properties(${TestName} PROPERTIES PROCESSORS "${CURTEST_PROCESSORS}")
set_tests_properties(${_FANCY} PROPERTIES PROCESSORS "${CURTEST_PROCESSORS}")
endif()
endif()
@@ -352,15 +366,6 @@ macro(opm_add_test TestName)
endif()
add_dependencies(test-suite "${CURTEST_EXE_NAME}")
endif()
else() # test is skipped
# the following causes the test to appear as 'skipped' in the
# CDash dashboard. it this is removed, the test is just silently
# ignored.
if (NOT CURTEST_ONLY_COMPILE AND ADD_DISABLED_CTESTS)
add_test(${TestName} skip_test_dummy)
endif()
endif()
endmacro()

View File

@@ -9,12 +9,7 @@ macro(create_module_dir_var module)
get_filename_component(_parent_dir_name ${_parent_full_dir} NAME)
#Try if <module-name>/<build-dir> is used
get_filename_component(_modules_dir ${_parent_full_dir} DIRECTORY)
if ("${module}" STREQUAL "ecl")
#use clone directory libecl
set(_clone_dir "libecl")
else()
set(_clone_dir "${module}")
endif()
set(_clone_dir "${module}")
if(IS_DIRECTORY ${_modules_dir}/${_clone_dir}/${_leaf_dir_name})
set(${module}_DIR ${_modules_dir}/${_clone_dir}/${_leaf_dir_name})
else()
@@ -23,7 +18,8 @@ macro(create_module_dir_var module)
AND IS_DIRECTORY ${_parent_full_dir}/${_module_leaf})
# We are using build directories named <prefix><module-name><postfix>
set(${module}_DIR ${_parent_full_dir}/${_module_leaf})
elseif(IS_DIRECTORY ${_parent_full_dir}/${_clone_dir})
elseif(IS_DIRECTORY ${_parent_full_dir}/${_clone_dir} AND
EXISTS ${_parent_full_dir}/${_clone_dir}/CMakeCache.txt)
# All modules are in a common build dir
set(${module}_DIR "${_parent_full_dir}/${_clone_dir}")
endif()

View File

@@ -21,10 +21,28 @@ if (CXX_COMPAT_GCC)
# disabled due to widespread bugs in the linker plugin
option (WHOLE_PROG_OPTIM "Whole program optimization (lto)" OFF)
if (WHOLE_PROG_OPTIM)
check_cxx_accepts_flag ("-flto" HAVE_LINK_OPTS)
if (HAVE_LINK_OPTS)
list (APPEND _opt_flags "-flto")
endif (HAVE_LINK_OPTS)
check_cxx_accepts_flag ("-flto" HAVE_LINK_OPTS)
check_cxx_accepts_flag ("-fuse-linker-plugin" HAVE_LINK_PLUGIN)
if (HAVE_LINK_OPTS)
list (APPEND _opt_flags "-flto")
endif (HAVE_LINK_OPTS)
if (HAVE_LINK_PLUGIN)
list (APPEND _opt_flags "-fuse-linker-plugin")
endif (HAVE_LINK_PLUGIN)
if(HAVE_LINK_OPTS AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
string(REPLACE "." ";" VERSION_LIST "${CMAKE_C_COMPILER_VERSION}")
list(GET VERSION_LIST 0 VER_MAJOR)
find_program(LTO_AR_COMMAND NAMES ${CMAKE_C_COMPILER}-ar gcc-ar-${VER_MAJOR} gcc-ar)
find_program(LTO_RANLIB_COMMAND NAMES ${CMAKE_C_COMPILER}-ranlib gcc-ranlib-${VER_MAJOR} gcc-ranlib)
if(LTO_AR_COMMAND)
set(CMAKE_AR ${LTO_AR_COMMAND})
message(STATUS "Using LTO-enabled ar: ${CMAKE_AR}")
endif()
if(LTO_RANLIB_COMMAND)
set(CMAKE_RANLIB ${LTO_RANLIB_COMMAND})
message(STATUS "Using LTO-enabled ranlib: ${CMAKE_RANLIB}")
endif()
endif()
endif (WHOLE_PROG_OPTIM)
# native instruction set tuning

View File

@@ -34,16 +34,29 @@ function(add_static_analysis_tests sources includes)
list(APPEND IPATHS -I ${dep})
endforeach()
foreach(src ${${sources}})
file(RELATIVE_PATH name ${PROJECT_SOURCE_DIR} ${src})
if(src MATCHES "TARGET_OBJECTS:")
string(REGEX REPLACE "\\$<TARGET_OBJECTS:(.*)>" "\\1" TGT ${src})
get_target_property(src ${TGT} SOURCES)
endif()
if(IS_ABSOLUTE ${src})
file(RELATIVE_PATH name ${PROJECT_SOURCE_DIR} ${src})
else()
set(name ${src})
set(src ${PROJECT_SOURCE_DIR}/${src})
endif()
if(CPPCHECK_FOUND)
add_test(NAME cppcheck+${name}
COMMAND bin/cppcheck-test.sh ${CPPCHECK_PROGRAM} ${src} ${IPATHS}
CONFIGURATIONS analyze cppcheck)
if(NOT TEST cppcheck+${name})
add_test(NAME cppcheck+${name}
COMMAND bin/cppcheck-test.sh ${CPPCHECK_PROGRAM} ${src} ${IPATHS}
CONFIGURATIONS analyze cppcheck)
endif()
endif()
if(CLANGCHECK_FOUND AND CMAKE_EXPORT_COMPILE_COMMANDS)
add_test(NAME clang-check+${name}
COMMAND bin/clang-check-test.sh ${CLANGCHECK_PROGRAM} ${src}
CONFIGURATIONS analyze clang-check)
if(NOT TEST clang-check+${name})
add_test(NAME clang-check+${name}
COMMAND bin/clang-check-test.sh ${CLANGCHECK_PROGRAM} ${src}
CONFIGURATIONS analyze clang-check)
endif()
endif()
endforeach()
endif()

View File

@@ -6,7 +6,7 @@ is_compiler_gcc_compatible ()
if (CXX_COMPAT_GCC)
# default warnings flags, if not set by user
set_default_option (CXX _warn_flag "-Wall" "(^|\ )-W")
set_default_option (CXX _warn_flag "-Wall -Wextra -Wshadow" "(^|\ )-W")
if (_warn_flag)
message (STATUS "All warnings enabled: ${_warn_flag}")
add_options (ALL_LANGUAGES ALL_BUILDS "${_warn_flag}")

View File

@@ -31,30 +31,15 @@ if(NOT check_target)
endif()
# Build threads
include(ProcessorCount)
set(build_threads $ENV{CHECK_THREADS})
if(NOT build_threads)
if(UNIX)
if(APPLE)
execute_process(COMMAND sysctl hw.ncpu
OUTPUT_VARIABLE build_threads)
string(REPLACE " " ";" build_threads_list ${build_threads)
list(GET build_threads_list 1 build_threads)
else()
find_program(NPROC_COMMAND nproc)
if(NPROC_COMMAND)
execute_process(COMMAND ${NPROC_COMMAND}
OUTPUT_VARIABLE build_threads)
string(REGEX REPLACE "(\r?\n)+$" "" build_threads "${build_threads}")
endif()
endif()
ProcessorCount(build_threads)
if(build_threads EQUAL 0)
set(build_threads 1)
endif()
endif()
# If for some reason we could not find the info - e.g. centos5 where nproc is missing
if(NOT build_threads)
set(build_threads 1)
endif()
# Record current HEAD
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
OUTPUT_VARIABLE current_branch

View File

@@ -29,11 +29,34 @@ if(NOT @opm-project_NAME@_FOUND)
set (@opm-project_NAME@_LIBRARY_DIRS "@opm-project_LIBRARY_DIRS@" "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@")
set (@opm-project_NAME@_LINKER_FLAGS "@opm-project_LINKER_FLAGS@")
set (@opm-project_NAME@_CONFIG_VARS "@opm-project_CONFIG_VARS@")
set (HAVE_@opm-project_NAME_UC@ 1)
# libraries come from the build tree where this file was generated
set (@opm-project_NAME@_LIBRARY "@opm-project_LIBRARY@")
set (@opm-project_NAME@_LIBRARIES ${@opm-project_NAME@_LIBRARY} "@opm-project_LIBRARIES@")
# The purpose of this string replacement operation is to enable use of the
# generated opm-project-config.cmake file also in the situation where 'make
# install' has been invoked with the DESTDIR option:
#
# opm-common/build> cmake .. -DCMAKE_INSTALL_PREFIX=/real/prefix
# opm-common/budil> make install DESTDIR=/tmp/prefix
#
# downstream/build> cmake .. -DDEST_PREFIX=/tmp/prefix -DCMAKE_PREFIX_PATH=/tmp/prefix
# downstream/build> make install
#
# That way the downstream dependency can still use find_package( opm-common )
# even though the opm-common-config.cmake file is not internally consistent
# with it's own location in the filesystem.
if(DEST_PREFIX)
set(DEST_PREFIX "${DEST_PREFIX}${@opm-project_NAME@_PREFIX}")
string(REPLACE ${@opm-project_NAME@_PREFIX} ${DEST_PREFIX} @opm-project_NAME@_INCLUDE_DIRS "${@opm-project_NAME@_INCLUDE_DIRS}")
string(REPLACE ${@opm-project_NAME@_PREFIX} ${DEST_PREFIX} @opm-project_NAME@_LIBRARY_DIRS "${@opm-project_NAME@_LIBRARY_DIRS}")
string(REPLACE ${@opm-project_NAME@_PREFIX} ${DEST_PREFIX} @opm-project_NAME@_LIBRARY "${@opm-project_NAME@_LIBRARY}")
endif()
set (HAVE_@opm-project_NAME_UC@ 1)
mark_as_advanced (@opm-project_NAME@_LIBRARY)
# not all projects have targets; conditionally add this part
@@ -46,12 +69,6 @@ if(NOT @opm-project_NAME@_FOUND)
endif()
endif (NOT "@opm-project_TARGET@" STREQUAL "")
# ensure that we build with support for C++11 to preserve ABI
string (REPLACE "@CXX_STD0X_FLAGS@" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string (REPLACE "@CXX_STDLIB_FLAGS@" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string (STRIP "${CMAKE_CXX_FLAGS}" CMAKE_CXX_FLAGS)
set (CMAKE_CXX_FLAGS "@CXX_STD0X_FLAGS@@CXX_SPACE@@CXX_STDLIB_FLAGS@ ${CMAKE_CXX_FLAGS}")
# same as above, but for C99
string (REPLACE "@C_STD99_FLAGS@" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
string (STRIP "${CMAKE_C_FLAGS}" CMAKE_C_FLAGS)
@@ -71,12 +88,17 @@ if(NOT @opm-project_NAME@_FOUND)
# this is the contents of config.h as far as our probes can tell:
# extra code from variable OPM_PROJECT_EXTRA_CODE
@OPM_PROJECT_EXTRA_CODE@
# end extra code
# This call is at the bottom as we need to include
# the OpmPackage Macros.
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" @PREREQ_LOCATION@)
include(@opm-project_NAME@-prereqs)
# The settings in this block do not mix well with the DEST_PREFIX
# setting.
if (NOT DEST_PREFIX)
# This is required to include OpmPackage
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" @PREREQ_LOCATION@)
# extra code from variable OPM_PROJECT_EXTRA_CODE
@OPM_PROJECT_EXTRA_CODE@
# end extra code
include(@opm-project_NAME@-prereqs)
endif()
endif()

2
debian/changelog vendored
View File

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

26
debian/control vendored
View File

@@ -2,11 +2,12 @@ Source: opm-common
Priority: extra
Maintainer: Arne Morten Kvarving <arne.morten.kvarving@sintef.no>
Build-Depends: build-essential, debhelper (>= 9),
pkg-config, cmake, git, libtool, doxygen,
pkg-config, cmake, git, libtool, doxygen, graphviz,
texlive-latex-extra, texlive-latex-recommended,
ghostscript, libboost-system-dev, libboost-test-dev,
libecl-dev, libboost-regex-dev, libboost-filesystem-dev,
zlib1g-dev
zlib1g-dev, libpython3-dev, python3-numpy, python3-distutils,
python3-setuptools, python3-setuptools-scm, python3-pytest-runner,
python3-decorator
Standards-Version: 3.9.2
Section: libs
Homepage: http://opm-project.org
@@ -23,6 +24,16 @@ Provides: libopm-common
Description: OPM common library
The OPM common library contains generic code shared across all OPM modules.
Package: libopm-common1-bin
Section: libs
Pre-Depends: ${misc:Pre-Depends}
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends}, ${misc:Depends}
Provides: libopm-common-bin
Description: OPM common binaries
The OPM common binaries.
Package: libopm-common1-dev
Section: libdevel
Architecture: any
@@ -42,3 +53,12 @@ Provides: libopm-common-doc
Description: OPM common library -- documentation
The OPM common library contains the shared buildsystem
and helpers shared across all OPM modules.
Package: python3-opm-common
Section: libs
Pre-Depends: ${misc:Pre-Depends}, multiarch-support
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends}, ${misc:Depends}, libopm-common1, python3-numpy, python3-decorator
Description: OPM common python bindings
Python package for opm-common

1
debian/libopm-common1-bin.install vendored Normal file
View File

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

1
debian/python3-opm-common.install vendored Normal file
View File

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

4
debian/rules vendored
View File

@@ -10,7 +10,7 @@
#export DH_VERBOSE=1
%:
dh $@
dh $@ --parallel
override_dh_auto_clean:
dh_auto_clean --buildsystem=cmake
@@ -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
dh_auto_configure --buildsystem=cmake -- -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSTRIP_DEBUGGING_SYMBOLS=ON -DBUILD_SHARED_LIBS=1 -DCMAKE_INSTALL_DOCDIR=share/doc/libopm-common1 -DWHOLE_PROG_OPTIM=ON -DUSE_RUNPATH=OFF -DWITH_NATIVE=OFF -DOPM_ENABLE_PYTHON=1 -DOPM_INSTALL_PYTHON=1 -DPYTHON_EXECUTABLE=/usr/bin/python3
override_dh_auto_install:
dh_auto_install -- install-html

View File

@@ -184,8 +184,8 @@ the WCONHIST keyword has the the following items specification:
{"name" : "ORAT" , "value_type" : "DOUBLE", "default" : 0.0, "dimension" : "LiquidSurfaceVolume/Time"},
{"name" : "WRAT" , "value_type" : "DOUBLE" , "default" : 0.0, "dimension" : "LiquidSurfaceVolume/Time"},
{"name" : "GRAT" , "value_type" : "DOUBLE" , "default" : 0.0, "dimension" : "GasSurfaceVolume/Time"},
{"name" : "VFPTable" , "value_type" : "INT" , "default" : 0.0 , "comment":"The default is a state variable"},
{"name" : "Lift" , "value_type" : "DOUBLE" , "default" : 0.0 , "comment":"The default is a state variable"},
{"name" : "VFP_TABLE" , "value_type" : "INT" , "default" : 0.0 , "comment":"The default is a state variable"},
{"name" : "LIFT" , "value_type" : "DOUBLE" , "default" : 0.0 , "comment":"The default is a state variable"},
{"name" : "THP" , "value_type" : "DOUBLE" , "default" : 0.0 , "dimension" : "Pressure"},
{"name" : "BHP" , "value_type" : "DOUBLE" , "default" : 0.0 ,"dimension" : "Pressure"},
{"name" : "NGLRAT" , "value_type" : "DOUBLE" , "default" : 0.0 ,"dimension" : "LiquidSurfaceVolume/Time"}]}

View File

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

View File

@@ -0,0 +1,60 @@
# this snippet enables parameter completion via the tabulator key
# for bash for opm products.
# this is a bash readline completer for the case where a binary is
# already known to be an eWoms simulator.
_ewoms_parameter_completor()
{
if test "$COMP_WORDS" == ""; then
return 0
fi
cmd="${COMP_WORDS[0]}"
cur="${COMP_WORDS[COMP_CWORD]}"
fullcmd="$(which "$cmd" 2> /dev/null)"
ALL_OPTS=$("$fullcmd" --help 2> /dev/null | grep '^ *--' | sed 's/ *\(--[a-zA-Z0-9\-]*\)=.*/\1=/')
ALL_OPTS=$(echo "$ALL_OPTS" | sed 's/^ *--help.*/--help/')
COMPREPLY=( $(compgen -A file -W "$ALL_OPTS" -- "${cur}") )
}
# this is a bash readline default completer which attempts to find out
# if a given binary is an eWoms simulation. this needs to be set as a
# default completer because the name of eWoms binaries cannot be known
# a-priori.
_ewoms_generic_parameter_completor()
{
if test "$COMP_WORDS" == ""; then
return 0
fi
COMPREPLY=()
local cmd cur ALL_OPTS
cmd="${COMP_WORDS[0]}"
cur="${COMP_WORDS[COMP_CWORD]}"
fullcmd="$(which "$cmd" 2> /dev/null)"
if test -z "$fullcmd" || \
! test -x "$fullcmd" || \
(! test -f "$fullcmd" && ! test -h "$fullcmd" ) || \
! test -r "$fullcmd" || \
! grep -q "Ewoms[a-zA-Z0-9]*Simulator[a-zA-Z0-0]" "$fullcmd"
then
if test -n "$DEFAULT_COMPLETION_LOADER"; then
"$DEFAULT_COMPLETION_LOADER" $@
elif type -t _completion_loader 2>&1 > /dev/null; then
# the default DEFAULT_COMPLETION_LOADER variable has not
# been set and the _completion_loader function exists, so
# we use _completion_loader as the default completer.
_completion_loader $@
else
return 1
fi
return $?
fi
_ewoms_parameter_completor $@
return 0
}
complete -o nospace -F _ewoms_parameter_completor @PRODUCT@

53
examples/msim.cpp Normal file
View File

@@ -0,0 +1,53 @@
/*
Copyright 2013 Statoil ASA.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#include <opm/output/eclipse/EclipseIO.hpp>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
#include <opm/msim/msim.hpp>
int main(int /* argc */, char** argv) {
std::string deck_file = argv[1];
Opm::Parser parser;
Opm::ParseContext parse_context;
Opm::ErrorGuard error_guard;
Opm::Deck deck = parser.parseFile(deck_file, parse_context, error_guard);
Opm::EclipseState state(deck);
Opm::Schedule schedule(deck, state, parse_context, error_guard);
Opm::SummaryConfig summary_config(deck, schedule, state.getTableManager(), parse_context, error_guard);
if (error_guard) {
error_guard.dump();
error_guard.terminate();
}
Opm::msim msim(state);
Opm::EclipseIO io(state, state.getInputGrid(), schedule, summary_config);
msim.run(schedule, io, false);
}

159
examples/opmhash.cpp Normal file
View File

@@ -0,0 +1,159 @@
/*
Copyright 2019 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/>.
*/
#include <getopt.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
struct keyword {
keyword(const std::string& name_arg, const std::string& filename_arg,
std::size_t line_number_arg, std::size_t content_hash_arg) :
name(name_arg),
filename(filename_arg),
line_number(line_number_arg),
content_hash(content_hash_arg)
{}
std::string name;
std::string filename;
std::size_t line_number;
std::size_t content_hash;
};
std::vector<keyword> load_deck(const char * deck_file) {
Opm::ParseContext parseContext;
Opm::ErrorGuard errors;
Opm::Parser parser;
std::vector<keyword> keywords;
/* Use the same default ParseContext as flow. */
parseContext.update(Opm::ParseContext::PARSE_RANDOM_SLASH, Opm::InputError::IGNORE);
parseContext.update(Opm::ParseContext::PARSE_MISSING_DIMS_KEYWORD, Opm::InputError::WARN);
parseContext.update(Opm::ParseContext::SUMMARY_UNKNOWN_WELL, Opm::InputError::WARN);
parseContext.update(Opm::ParseContext::SUMMARY_UNKNOWN_GROUP, Opm::InputError::WARN);
auto deck = parser.parseFile(deck_file, parseContext, errors);
for (const auto& kw : deck) {
std::stringstream ss;
const auto& location = kw.location();
ss << kw;
keywords.emplace_back(kw.name(), location.filename, location.lineno, std::hash<std::string>{}(ss.str()));
}
return keywords;
}
std::size_t deck_hash(const std::vector<keyword>& keywords) {
std::stringstream ss;
for (const auto& kw : keywords)
ss << kw.content_hash;
return std::hash<std::string>{}(ss.str());
}
void print_keywords(const std::vector<keyword>& keywords, bool location_info) {
for (const auto& kw : keywords) {
if (location_info)
std::cout << std::setw(8) << std::left << kw.name << " : " << kw.filename << ":" << kw.line_number << " " << kw.content_hash << std::endl;
else
std::cout << std::setw(8) << std::left << kw.name << " : " << kw.content_hash << std::endl;
}
std::cout << std::endl;
std::cout << std::setw(8) << std::left << "Total" << " : " << deck_hash(keywords) << std::endl;
}
void print_help_and_exit() {
const char * help_text = R"(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:
RUNSPEC : 13167205945009276792
TITLE : 16047371705964514902
DIMENS : 1264233216877515756
NONNC : 10052807539267647959
OIL : 6013609912232720008
WATER : 14106203893673265964
Total : 7362809723723482303
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.
Options:
-l : Add filename and linenumber information to each keyword.
-s : Short form - only print the hash of the complete deck.
)";
std::cerr << help_text << std::endl;
exit(1);
}
int main(int argc, char** argv) {
int arg_offset = 1;
bool location_info = false;
bool short_form = false;
while (true) {
int c;
c = getopt(argc, argv, "ls");
if (c == -1)
break;
switch(c) {
case 'l':
location_info = true;
break;
case 's':
short_form = true;
break;
}
}
arg_offset = optind;
if (arg_offset >= argc)
print_help_and_exit();
auto keywords = load_deck(argv[arg_offset]);
if (short_form)
std::cout << deck_hash(keywords) << std::endl;
else
print_keywords(keywords, location_info);
}

View File

@@ -18,32 +18,70 @@
*/
#include <iostream>
#include <iomanip>
#include <chrono>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/common/OpmLog/OpmLog.hpp>
#include <opm/common/OpmLog/StreamLog.hpp>
#include <opm/common/OpmLog/LogUtil.hpp>
void initLogging() {
std::shared_ptr<Opm::StreamLog> cout_log = std::make_shared<Opm::StreamLog>(std::cout, Opm::Log::DefaultMessageTypes);
Opm::OpmLog::addBackend( "COUT" , cout_log);
}
inline void loadDeck( const char * deck_file) {
Opm::ParseContext parseContext;
Opm::ErrorGuard errors;
Opm::Parser parser;
std::cout << "Loading deck: " << deck_file << " ..... "; std::cout.flush();
auto deck = parser.parseFile(deck_file, parseContext);
std::cout << "parse complete - creating EclipseState .... "; std::cout.flush();
Opm::EclipseState state( deck, parseContext );
Opm::Schedule schedule( deck, state.getInputGrid(), state.get3DProperties(), state.runspec().phases(), parseContext);
Opm::SummaryConfig summary( deck, schedule, state.getTableManager( ), parseContext );
std::cout << "complete." << std::endl;
std::chrono::system_clock::time_point start;
start = std::chrono::system_clock::now();
auto deck = parser.parseFile(deck_file, parseContext, errors);
auto deck_time = std::chrono::system_clock::now() - start;
std::cout << "parse complete - creating EclipseState .... "; std::cout.flush();
start = std::chrono::system_clock::now();
Opm::EclipseState state( deck );
auto state_time = std::chrono::system_clock::now() - start;
std::cout << "creating Schedule .... "; std::cout.flush();
start = std::chrono::system_clock::now();
Opm::Schedule schedule( deck, state);
auto schedule_time = std::chrono::system_clock::now() - start;
std::cout << "creating SummaryConfig .... "; std::cout.flush();
start = std::chrono::system_clock::now();
Opm::SummaryConfig summary( deck, schedule, state.getTableManager( ), parseContext, errors );
auto summary_time = std::chrono::system_clock::now() - start;
std::cout << "complete." << std::endl << std::endl;
std::cout << "Time: " << std::endl;
std::cout << " deck.....: " << std::chrono::duration<double>(deck_time).count() << " seconds" << std::endl;
std::cout << " state....: " << std::chrono::duration<double>(state_time).count() << " seconds" << std::endl;
std::cout << " schedule.: " << std::chrono::duration<double>(schedule_time).count() << " seconds" << std::endl;
std::cout << " summary..: " << std::chrono::duration<double>(summary_time).count() << " seconds" << std::endl;
}
int main(int argc, char** argv) {
initLogging();
for (int iarg = 1; iarg < argc; iarg++)
loadDeck( argv[iarg] );
}

167
examples/opmpack.cpp Normal file
View File

@@ -0,0 +1,167 @@
/*
Copyright 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/>.
*/
#include <fstream>
#include <iostream>
#include <getopt.h>
#include <opm/common/utility/FileSystem.hpp>
#include <opm/parser/eclipse/Parser/ParserKeywords/G.hpp>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
#include <opm/parser/eclipse/Parser/InputErrorAction.hpp>
#include <opm/parser/eclipse/Deck/Deck.hpp>
namespace fs = Opm::filesystem;
Opm::Deck pack_deck( const char * deck_file, std::ostream& os) {
Opm::ParseContext parseContext(Opm::InputError::WARN);
Opm::ErrorGuard errors;
Opm::Parser parser;
auto deck = parser.parseFile(deck_file, parseContext, errors);
os << deck;
return deck;
}
void print_help_and_exit() {
const char * help_text = R"(
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.
By passing the option -o you can redirect the output to a file
or a directory.
Print on stdout:
opmpack /path/to/case/CASE.DATA
Print MY_CASE.DATA in /tmp:
opmpack -o /tmp /path/to/MY_CASE.DATA
Print NEW_CASE in cwd:
opmpack -o NEW_CASE.DATA path/to/MY_CASE.DATA
As an alternative to the -o option you can use -c; that is equivalent to -o -
but restart and import files referred to in the deck are also copied. The -o and
-c options are mutually exclusive. )";
std::cerr << help_text << std::endl;
exit(1);
}
void copy_file(const fs::path& source_dir, fs::path fname, const fs::path& target_dir) {
if (fname.is_absolute()) {
// change when moving to gcc8+
// fname = fs::relative(fname, source_dir);
auto prefix_len = fs::canonical(source_dir).string().size();
fname = fs::canonical(fname);
fname = fs::path( fname.string().substr(prefix_len + 1) );
}
auto source_file = source_dir / fname;
auto target_file = target_dir / fname;
if (!fs::is_directory(target_file.parent_path()))
fs::create_directories(target_file.parent_path());
fs::copy_file(source_file, target_file, fs::copy_options::overwrite_existing);
std::cerr << "Copying file " << source_file.string() << " -> " << target_file.string() << std::endl;
}
int main(int argc, char** argv) {
int arg_offset = 1;
bool stdout_output = true;
bool copy_binary = false;
const char * coutput_arg;
while (true) {
int c;
c = getopt(argc, argv, "c:o:");
if (c == -1)
break;
switch(c) {
case 'o':
stdout_output = false;
coutput_arg = optarg;
break;
case 'c':
stdout_output = false;
copy_binary = true;
coutput_arg = optarg;
break;
}
}
arg_offset = optind;
if (arg_offset >= argc)
print_help_and_exit();
if (stdout_output)
pack_deck(argv[arg_offset], std::cout);
else {
std::ofstream os;
fs::path input_arg(argv[arg_offset]);
fs::path output_arg(coutput_arg);
fs::path output_dir(coutput_arg);
if (fs::is_directory(output_arg)) {
fs::path output_path = output_arg / input_arg.filename();
os.open(output_path.string());
} else {
os.open(output_arg.string());
output_dir = output_arg.parent_path();
}
const auto& deck = pack_deck(argv[arg_offset], os);
if (copy_binary) {
Opm::InitConfig init_config(deck);
if (init_config.restartRequested()) {
Opm::IOConfig io_config(deck);
fs::path restart_file(io_config.getRestartFileName( init_config.getRestartRootName(), init_config.getRestartStep(), false ));
copy_file(input_arg.parent_path(), restart_file, output_dir);
}
for (std::size_t import_index = 0; import_index < deck.count("IMPORT"); import_index++) {
const auto& import_keyword = deck.getKeyword("IMPORT", import_index);
const auto& fname = import_keyword.getRecord(0).getItem("FILE").get<std::string>(0);
copy_file(input_arg.parent_path(), fname, output_dir);
}
using GDFILE = Opm::ParserKeywords::GDFILE;
if (deck.hasKeyword<GDFILE>()) {
const auto& gdfile_keyword = deck.getKeyword<GDFILE>();
const auto& fname = gdfile_keyword.getRecord(0).getItem<GDFILE::filename>().get<std::string>(0);
copy_file(input_arg.parent_path(), fname, output_dir);
}
}
}
}

View File

@@ -1,277 +0,0 @@
/*
Copyright 2016 Statoil ASA.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#include <opm/test_util/EclFilesComparator.hpp>
#include <opm/common/ErrorMacros.hpp>
#include <ert/util/util.h>
#include <ert/util/stringlist.h>
#include <ert/ecl/ecl_endian_flip.h>
#include <ert/ecl/ecl_file.h>
#include <iostream>
#include <string>
#include <getopt.h>
static void printHelp() {
std::cout << "\ncompareECL compares ECLIPSE files (restart (.RST), unified restart (.UNRST), initial (.INIT) or .RFT) and gridsizes (from .EGRID or .GRID file) from two simulations.\n"
<< "The program takes four arguments:\n\n"
<< "1. Case number 1 (full path without extension)\n"
<< "2. Case number 2 (full path without extension)\n"
<< "3. Absolute tolerance\n"
<< "4. Relative tolerance (between 0 and 1)\n\n"
<< "In addition, the program takes these options (which must be given before the arguments):\n\n"
<< "-h Print help and exit.\n"
<< "-i Execute integration test (regression test is default).\n"
<< " The integration test compares SGAS, SWAT and PRESSURE in unified restart files, so this option can not be used in combination with -t.\n"
<< "-I Same as -i, but throws an exception when the number of keywords in the two cases differ. Can not be used in combination with -t.\n"
<< "-k Specify specific keyword to compare (capitalized), for example -k PRESSURE.\n"
<< "-l Only do comparison for the last occurrence. This option is only for the regression test, and can therefore not be used in combination with -i or -I.\n"
<< "-n Do not throw on errors.\n"
<< "-p Print keywords in both cases and exit. Can not be used in combination with -P.\n"
<< "-P Print common and uncommon keywords in both cases and exit. Can not be used in combination with -p.\n"
<< "-t Specify ECLIPSE filetype to compare (unified restart is default). Can not be used in combination with -i or -I. Different possible arguments are:\n"
<< " -t UNRST \t Compare two unified restart files (.UNRST). This the default value, so it is the same as not passing option -t.\n"
<< " -t INIT \t Compare two initial files (.INIT).\n"
<< " -t RFT \t Compare two RFT files (.RFT).\n"
<< " -t RST \t Compare two cases consisting of restart files (.Xnnnn).\n"
<< " -t RST1 \t Compare two cases where the first case consists of restart files (.Xnnnn), and the second case consists of a unified restart file (.UNRST).\n"
<< " -t RST2 \t Compare two cases where the first case consists of a unified restart file (.UNRST), and the second case consists of restart files (.Xnnnn).\n"
<< " Note that when dealing with restart files (.Xnnnn), the program concatenates all of them into one unified restart file, which is used for comparison and stored in the same directory as the restart files.\n"
<< " This will overwrite any existing unified restart file in that directory.\n\n"
<< "Example usage of the program: \n\n"
<< "compareECL -k PRESSURE <path to first casefile> <path to second casefile> 1e-3 1e-5\n"
<< "compareECL -t INIT -k PORO <path to first casefile> <path to second casefile> 1e-3 1e-5\n"
<< "compareECL -i <path to first casefile> <path to second casefile> 0.01 1e-6\n\n"
<< "Exceptions are thrown (and hence program exits) when deviations are larger than the specified "
<< "tolerances, or when the number of cells does not match -- 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.\n\n";
}
void splitBasename(const std::string& basename, std::string& path, std::string& filename) {
const size_t lastSlashIndex = basename.find_last_of("/\\");
path = basename.substr(0,lastSlashIndex);
filename = basename.substr(lastSlashIndex+1);
}
// Inspired by the ecl_pack application in the ERT library
void concatenateRestart(const std::string& basename) {
std::string inputPath, inputBase;
splitBasename(basename, inputPath, inputBase);
stringlist_type* inputFiles = stringlist_alloc_new();
const int numFiles = ecl_util_select_filelist(inputPath.c_str(), inputBase.c_str(), ECL_RESTART_FILE, false, inputFiles);
const char* target_file_name = ecl_util_alloc_filename(inputPath.c_str(), inputBase.c_str(), ECL_UNIFIED_RESTART_FILE, false, -1);
fortio_type* target = fortio_open_writer(target_file_name, false, ECL_ENDIAN_FLIP);
int dummy;
ecl_kw_type* seqnum_kw = ecl_kw_alloc_new("SEQNUM", 1, ECL_INT, &dummy);
int reportStep = 0;
for (int i = 0; i < numFiles; ++i) {
ecl_util_get_file_type(stringlist_iget(inputFiles, i), nullptr, &reportStep);
ecl_file_type* src_file = ecl_file_open(stringlist_iget(inputFiles, i), 0);
ecl_kw_iset_int(seqnum_kw, 0, reportStep);
ecl_kw_fwrite(seqnum_kw, target);
ecl_file_fwrite_fortio(src_file, target, 0);
ecl_file_close(src_file);
}
fortio_fclose(target);
stringlist_free(inputFiles);
}
//------------------------------------------------//
int main(int argc, char** argv) {
// Restart is default
ecl_file_enum file_type = ECL_UNIFIED_RESTART_FILE;
// RegressionTest is default
bool integrationTest = false;
bool checkNumKeywords = false;
bool onlyLastOccurrence = false;
bool printKeywords = false;
bool printKeywordsDifference = false;
bool specificKeyword = false;
bool specificFileType = false;
bool throwOnError = true;
bool volumecheck = true;
char* keyword = nullptr;
char* fileTypeCstr = nullptr;
int c = 0;
while ((c = getopt(argc, argv, "hiIk:lnpPt:V")) != -1) {
switch (c) {
case 'h':
printHelp();
return 0;
case 'i':
integrationTest = true;
break;
case 'I':
integrationTest = true;
checkNumKeywords = true;
break;
case 'n':
throwOnError = false;
break;
case 'k':
specificKeyword = true;
keyword = optarg;
break;
case 'l':
onlyLastOccurrence = true;
break;
case 'p':
printKeywords = true;
break;
case 'P':
printKeywordsDifference = true;
break;
case 't':
specificFileType = true;
fileTypeCstr = optarg;
break;
case 'V':
volumecheck = false;
break;
case '?':
if (optopt == 'k') {
std::cerr << "Option k requires a keyword as argument, see manual (-h) for more information." << std::endl;
return EXIT_FAILURE;
}
else if (optopt == 't') {
std::cerr << "Option t requires an ECLIPSE filetype as argument, see manual (-h) for more information." << std::endl;
return EXIT_FAILURE;
}
else {
std::cerr << "Unknown option." << std::endl;
return EXIT_FAILURE;
}
default:
return EXIT_FAILURE;
}
}
int argOffset = optind;
if ((printKeywords && printKeywordsDifference) ||
(integrationTest && specificFileType) ||
(integrationTest && onlyLastOccurrence)) {
std::cerr << "Error: Options given which can not be combined. "
<< "Please see the manual (-h) for more information." << std::endl;
return EXIT_FAILURE;
}
if (argc != argOffset + 4) {
std::cerr << "Error: The number of options and arguments given is not correct. "
<< "Please run compareECL -h to see manual." << std::endl;
return EXIT_FAILURE;
}
std::string basename1 = argv[argOffset];
std::string basename2 = argv[argOffset + 1];
double absTolerance = strtod(argv[argOffset + 2], nullptr);
double relTolerance = strtod(argv[argOffset + 3], nullptr);
if (specificFileType) {
std::string fileTypeString(fileTypeCstr);
for (auto& ch: fileTypeString) ch = toupper(ch);
if (fileTypeString== "UNRST") {} //Do nothing
else if (fileTypeString == "RST") {
concatenateRestart(basename1);
concatenateRestart(basename2);
}
else if (fileTypeString == "RST1") {
concatenateRestart(basename1);
}
else if (fileTypeString == "RST2") {
concatenateRestart(basename2);
}
else if (fileTypeString == "INIT") {
file_type = ECL_INIT_FILE;
}
else if (fileTypeString == "RFT") {
file_type = ECL_RFT_FILE;
}
else {
std::cerr << "Unknown ECLIPSE filetype specified with option -t. Please run compareECL -h to see manual." << std::endl;
return EXIT_FAILURE;
}
}
std::cout << "Comparing '" << basename1 << "' to '" << basename2 << "'." << std::endl;
try {
if (integrationTest) {
IntegrationTest comparator(basename1, basename2, absTolerance, relTolerance);
if (printKeywords) {
comparator.printKeywords();
return 0;
}
if (printKeywordsDifference) {
comparator.printKeywordsDifference();
return 0;
}
if (checkNumKeywords) {
comparator.equalNumKeywords();
}
if (specificKeyword) {
if (comparator.elementInWhitelist(keyword)) {
comparator.resultsForKeyword(keyword);
}
else {
std::cerr << "Keyword " << keyword << " is not supported for the integration test. Use SGAS, SWAT or PRESSURE." << std::endl;
return EXIT_FAILURE;
}
}
else {
comparator.results();
}
}
else {
RegressionTest comparator(file_type, basename1, basename2, absTolerance, relTolerance);
comparator.throwOnErrors(throwOnError);
if (printKeywords) {
comparator.printKeywords();
return 0;
}
if (printKeywordsDifference) {
comparator.printKeywordsDifference();
return 0;
}
if (onlyLastOccurrence) {
comparator.setOnlyLastOccurrence(true);
}
if (specificKeyword) {
comparator.gridCompare(volumecheck);
comparator.resultsForKeyword(keyword);
}
else {
comparator.gridCompare(volumecheck);
comparator.results();
}
if (comparator.getNoErrors() > 0)
OPM_THROW(std::runtime_error, comparator.getNoErrors() << " errors encountered in comparisons.");
}
}
catch (const std::exception& e) {
std::cerr << "Program threw an exception: " << e.what() << std::endl;
return EXIT_FAILURE;
}
return 0;
}

View File

@@ -1,223 +0,0 @@
/*
Copyright 2016 Statoil ASA.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify it under the terms
of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#include <opm/test_util/summaryRegressionTest.hpp>
#include <opm/test_util/summaryIntegrationTest.hpp>
#include <string>
#include <algorithm>
#include <stdexcept>
#include <getopt.h>
void printHelp(){
std::cout << "\n\nThe program can handle both unified and non-unified summary files."<< std::endl;
std::cout <<"In the case of non-unified summary files all the files must be located in the same directory. Only the basename (full path without extension) is needed as input." << std::endl << std::endl;
std::cout << "\nThe program takes four arguments" << std::endl;
std::cout << "1) <path to file1>/<base_name>, basename without extension" << std::endl;
std::cout << "2) <path to file2>/<base_name>, basename without extension" << std::endl;
std::cout << "3) absolute tolerance" << std::endl;
std::cout << "4) relative tolerance (between 0 and 1)" << std::endl;
std::cout << "The program will only throw an exception when both the absolute and relative tolerance are exceeded." << std::endl;
std::cout << "The program is capable of performing both a regression test and an integration test, \nhowever only one type of test at a time. ";
std::cout << "By default the program will run a regression test."<< std::endl;
std::cout << "\nThe program have command line options:" << std::endl;
std::cout << "-h \t\tPrint help message." << std::endl << std::endl;
std::cout << "For the regression test: " << std::endl;
std::cout << "-r \t\tChoosing regression test (this is default)."<< std::endl;
std::cout << "-k keyword \tSpecify a specific keyword to compare, for example - k WOPR:PRODU1."<< std::endl;
std::cout << "-p \t\tWill print the keywords of the files." << std::endl;
std::cout << "-R \t\tWill allow comparison between a restarted simulation and a normal simulation. The files must end at the same time." << std::endl << std::endl;
std::cout << "For the integration test:"<< std::endl;
std::cout << "-i \t\tChoosing integration test." << std::endl;
std::cout << "-d \t\tThe program will not throw an exception when the volume error ratio exceeds the limit." << std::endl;
std::cout << "-g \t\tWill print the vector with the greatest error ratio." << std::endl;
std::cout << "-k keyword \tSpecify a specific keyword to compare, for example - k WOPR:PRODU1."<< std::endl;
std::cout << "-K \t\tWill not allow different amount of keywords in the two files. Throws an exception if the amount are different." << std::endl;
std::cout << "-m mainVar \tWill calculate the error ratio for one main variable. Valid input is WOPR, WWPR, WGPR or WBHP." << std::endl;
std::cout << "-n \tDo not throw on errors." << std::endl;
std::cout << "-p \t\tWill print the keywords of the files." << std::endl;
std::cout << "-P keyword \tWill print the summary vectors of a specified kewyord, for example -P WOPR:B-3H." << std::endl;
std::cout << "-s int \t\tSets the number of spikes that are allowed for each keyword, for example: -s 5." << std::endl;
std::cout << "-v \t\tFor the rate keywords WOPR, WGPR, WWPR and WBHP. Calculates the error volume of \n\t\tthe two summary files. This is printed to screen." << std::endl;
std::cout << "-V keyword \tWill calculate the error rate for a specific keyword." << std::endl << std::endl;
std::cout << "Suggested combination of command line options:"<< std::endl;
std::cout << " -i -g -m mainVariable, will print the vector which have the greatest error ratio of the main variable of interest.\n"<< std::endl;
}
//---------------------------------------------------
int main (int argc, char ** argv){
//------------------------------------------------
//Defines some constants
bool specificKeyword = false;
bool allowSpikes = false;
bool findVolumeError = false;
bool integrationTest = false;
bool regressionTest = true;
bool allowDifferentAmountOfKeywords = true;
bool printKeywords = false;
bool printSpecificKeyword = false;
bool findVectorWithGreatestErrorRatio = false;
bool oneOfTheMainVariables = false;
bool throwExceptionForTooGreatErrorRatio = true;
bool isRestartFile = false;
bool throwOnError = true;
const char* keyword = nullptr;
const char* mainVariable = nullptr;
int c = 0;
int limit = -1;
//------------------------------------------------
//------------------------------------------------
//For setting the options selected
while ((c = getopt(argc, argv, "dghik:Km:npP:rRs:vV:")) != -1) {
switch (c) {
case 'd':
throwExceptionForTooGreatErrorRatio = false;
break;
case 'g':
findVectorWithGreatestErrorRatio = true;
throwExceptionForTooGreatErrorRatio = false;
break;
case 'h':
printHelp();
return 0;
case 'i':
integrationTest = true;
regressionTest = false;
break;
case 'k':
specificKeyword = true;
keyword = optarg;
break;
case 'K':
allowDifferentAmountOfKeywords = false;
break;
case 'm':
oneOfTheMainVariables = true;
mainVariable = optarg;
break;
case 'n':
throwOnError = false;
break;
case 'p':
printKeywords = true;
break;
case 'P':
specificKeyword = true;
printSpecificKeyword = true;
keyword = optarg;
break;
case 'r':
integrationTest = false;
regressionTest = true;
break;
case 'R':
isRestartFile = true;
break;
case 's':
allowSpikes = true;
limit = atof(optarg);
break;
case 'v':
findVolumeError = true;
break;
case 'V':
findVolumeError = true;
specificKeyword = true;
keyword = optarg;
break;
case '?':
if (optopt == 'k' || optopt == 'm' || optopt == 'P'
|| optopt == 's' || optopt == 'V') {
std::cout << "Option -"<<optopt<<" requires an keyword." << std::endl;
return EXIT_FAILURE;
}
else {
std::cout << "Unknown option." << std::endl;
return EXIT_FAILURE;
}
default:
return EXIT_FAILURE;
}
}
//------------------------------------------------
int argOffset = optind;
if (argc != argOffset + 4) {
printHelp();
return EXIT_FAILURE;
}
const char * basename1 = argv[argOffset];
const char * basename2 = argv[argOffset+1];
double absoluteTolerance = strtod(argv[argOffset+2], nullptr);
double relativeTolerance = strtod(argv[argOffset+3], nullptr);
std::cout << "Comparing '" << basename1 << "' to '" << basename2 << "'." << std::endl;
try {
if(regressionTest){
RegressionTest compare(basename1,basename2, absoluteTolerance, relativeTolerance);
compare.throwOnErrors(throwOnError);
if(printKeywords){compare.setPrintKeywords(true);}
if(isRestartFile){compare.setIsRestartFile(true);}
if(specificKeyword){
compare.getRegressionTest(keyword);
}
else{
if(printKeywords){compare.setPrintKeywords(true);}
compare.getRegressionTest();
}
}
if(integrationTest){
IntegrationTest compare(basename1,basename2, absoluteTolerance, relativeTolerance);
compare.throwOnErrors(throwOnError);
if(findVectorWithGreatestErrorRatio){compare.setFindVectorWithGreatestErrorRatio(true);}
if(allowSpikes){compare.setAllowSpikes(true);}
if(oneOfTheMainVariables){
compare.setOneOfTheMainVariables(true);
std::string str(mainVariable);
std::transform(str.begin(), str.end(),str.begin(), ::toupper);
if(str == "WOPR" ||str=="WWPR" ||str=="WGPR" || str == "WBHP"){
compare.setMainVariable(str);
}else{
throw std::invalid_argument("The input is not a main variable. -m option requires a valid main variable.");
}
}
if(findVolumeError){compare.setFindVolumeError(true);}
if(limit != -1){compare.setSpikeLimit(limit);}
if(!allowDifferentAmountOfKeywords){compare.setAllowDifferentAmountOfKeywords(false);}
if(printKeywords){compare.setPrintKeywords(true);}
if(!throwExceptionForTooGreatErrorRatio){compare.setThrowExceptionForTooGreatErrorRatio(false);}
if(specificKeyword){
if(printSpecificKeyword){compare.setPrintSpecificKeyword(true);}
compare.getIntegrationTest(keyword);
return 0;
}
compare.getIntegrationTest();
}
}
catch(const std::exception& e) {
std::cerr << "Program threw an exception: " << e.what() << std::endl;
return EXIT_FAILURE;
}
return 0;
}

View File

@@ -1,4 +1,2 @@
This directory contains the cJSON package downloaded unchanged from:
http://sourceforge.net/projects/cjson/. The cJSON package is plain C,
the JsonObject class provides a minimal C++ wrapping of this.
This directory contains the the 1.7.10 version of the cJSON package from https://github.com/DaveGamble/cJSON

3177
external/cjson/cJSON.c vendored

File diff suppressed because it is too large Load Diff

290
external/cjson/cJSON.h vendored
View File

@@ -1,16 +1,16 @@
/*
Copyright (c) 2009 Dave Gamble
Copyright (c) 2009-2017 Dave Gamble and cJSON contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -23,118 +23,260 @@
#ifndef cJSON__h
#define cJSON__h
#include <stdlib.h>
#ifdef __cplusplus
extern "C"
{
#endif
#if !defined(__WINDOWS__) && (defined(WIN32) || defined(WIN64) || defined(_MSC_VER) || defined(_WIN32))
#define __WINDOWS__
#endif
#ifdef __WINDOWS__
/* When compiling for windows, we specify a specific calling convention to avoid issues where we are being called from a project with a different default calling convention. For windows you have 3 define options:
CJSON_HIDE_SYMBOLS - Define this in the case where you don't want to ever dllexport symbols
CJSON_EXPORT_SYMBOLS - Define this on library build when you want to dllexport symbols (default)
CJSON_IMPORT_SYMBOLS - Define this if you want to dllimport symbol
For *nix builds that support visibility attribute, you can define similar behavior by
setting default visibility to hidden by adding
-fvisibility=hidden (for gcc)
or
-xldscope=hidden (for sun cc)
to CFLAGS
then using the CJSON_API_VISIBILITY flag to "export" the same symbols the way CJSON_EXPORT_SYMBOLS does
*/
#define CJSON_CDECL __cdecl
#define CJSON_STDCALL __stdcall
/* export symbols by default, this is necessary for copy pasting the C and header file */
#if !defined(CJSON_HIDE_SYMBOLS) && !defined(CJSON_IMPORT_SYMBOLS) && !defined(CJSON_EXPORT_SYMBOLS)
#define CJSON_EXPORT_SYMBOLS
#endif
#if defined(CJSON_HIDE_SYMBOLS)
#define CJSON_PUBLIC(type) type CJSON_STDCALL
#elif defined(CJSON_EXPORT_SYMBOLS)
#define CJSON_PUBLIC(type) __declspec(dllexport) type CJSON_STDCALL
#elif defined(CJSON_IMPORT_SYMBOLS)
#define CJSON_PUBLIC(type) __declspec(dllimport) type CJSON_STDCALL
#endif
#else /* !__WINDOWS__ */
#define CJSON_CDECL
#define CJSON_STDCALL
#if (defined(__GNUC__) || defined(__SUNPRO_CC) || defined (__SUNPRO_C)) && defined(CJSON_API_VISIBILITY)
#define CJSON_PUBLIC(type) __attribute__((visibility("default"))) type
#else
#define CJSON_PUBLIC(type) type
#endif
#endif
/* project version */
#define CJSON_VERSION_MAJOR 1
#define CJSON_VERSION_MINOR 7
#define CJSON_VERSION_PATCH 10
#include <stddef.h>
/* cJSON Types: */
#define cJSON_False 0
#define cJSON_True 1
#define cJSON_NULL 2
#define cJSON_Number 3
#define cJSON_String 4
#define cJSON_Array 5
#define cJSON_Object 6
#define cJSON_Invalid (0)
#define cJSON_False (1 << 0)
#define cJSON_True (1 << 1)
#define cJSON_NULL (1 << 2)
#define cJSON_Number (1 << 3)
#define cJSON_String (1 << 4)
#define cJSON_Array (1 << 5)
#define cJSON_Object (1 << 6)
#define cJSON_Raw (1 << 7) /* raw json */
#define cJSON_IsReference 256
#define cJSON_StringIsConst 512
/* The cJSON structure: */
typedef struct cJSON {
struct cJSON *next,*prev; /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */
struct cJSON *child; /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */
typedef struct cJSON
{
/* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */
struct cJSON *next;
struct cJSON *prev;
/* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */
struct cJSON *child;
int type; /* The type of the item, as above. */
/* The type of the item, as above. */
int type;
char *valuestring; /* The item's string, if type==cJSON_String */
int valueint; /* The item's number, if type==cJSON_Number */
double valuedouble; /* The item's number, if type==cJSON_Number */
/* The item's string, if type==cJSON_String and type == cJSON_Raw */
char *valuestring;
/* writing to valueint is DEPRECATED, use cJSON_SetNumberValue instead */
int valueint;
/* The item's number, if type==cJSON_Number */
double valuedouble;
char *string; /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */
/* The item's name string, if this item is the child of, or is in the list of subitems of an object. */
char *string;
} cJSON;
typedef struct cJSON_Hooks {
void *(*malloc_fn)(size_t sz);
void (*free_fn)(void *ptr);
typedef struct cJSON_Hooks
{
/* malloc/free are CDECL on Windows regardless of the default calling convention of the compiler, so ensure the hooks allow passing those functions directly. */
void *(CJSON_CDECL *malloc_fn)(size_t sz);
void (CJSON_CDECL *free_fn)(void *ptr);
} cJSON_Hooks;
typedef int cJSON_bool;
/* Limits how deeply nested arrays/objects can be before cJSON rejects to parse them.
* This is to prevent stack overflows. */
#ifndef CJSON_NESTING_LIMIT
#define CJSON_NESTING_LIMIT 1000
#endif
/* returns the version of cJSON as a string */
CJSON_PUBLIC(const char*) cJSON_Version(void);
/* Supply malloc, realloc and free functions to cJSON */
extern void cJSON_InitHooks(cJSON_Hooks* hooks);
CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks* hooks);
/* Memory Management: the caller is always responsible to free the results from all variants of cJSON_Parse (with cJSON_Delete) and cJSON_Print (with stdlib free, cJSON_Hooks.free_fn, or cJSON_free as appropriate). The exception is cJSON_PrintPreallocated, where the caller has full responsibility of the buffer. */
/* Supply a block of JSON, and this returns a cJSON object you can interrogate. */
CJSON_PUBLIC(cJSON *) cJSON_Parse(const char *value);
/* ParseWithOpts allows you to require (and check) that the JSON is null terminated, and to retrieve the pointer to the final byte parsed. */
/* If you supply a ptr in return_parse_end and parsing fails, then return_parse_end will contain a pointer to the error so will match cJSON_GetErrorPtr(). */
CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, const char **return_parse_end, cJSON_bool require_null_terminated);
/* Supply a block of JSON, and this returns a cJSON object you can interrogate. Call cJSON_Delete when finished. */
extern cJSON *cJSON_Parse(const char *value);
/* Render a cJSON entity to text for transfer/storage. Free the char* when finished. */
extern char *cJSON_Print(cJSON *item);
/* Render a cJSON entity to text for transfer/storage without any formatting. Free the char* when finished. */
extern char *cJSON_PrintUnformatted(cJSON *item);
/* Render a cJSON entity to text for transfer/storage. */
CJSON_PUBLIC(char *) cJSON_Print(const cJSON *item);
/* Render a cJSON entity to text for transfer/storage without any formatting. */
CJSON_PUBLIC(char *) cJSON_PrintUnformatted(const cJSON *item);
/* Render a cJSON entity to text using a buffered strategy. prebuffer is a guess at the final size. guessing well reduces reallocation. fmt=0 gives unformatted, =1 gives formatted */
CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON_bool fmt);
/* Render a cJSON entity to text using a buffer already allocated in memory with given length. Returns 1 on success and 0 on failure. */
/* NOTE: cJSON is not always 100% accurate in estimating how much memory it will use, so to be safe allocate 5 bytes more than you actually need */
CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buffer, const int length, const cJSON_bool format);
/* Delete a cJSON entity and all subentities. */
extern void cJSON_Delete(cJSON *c);
CJSON_PUBLIC(void) cJSON_Delete(cJSON *c);
/* Returns the number of items in an array (or object). */
extern int cJSON_GetArraySize(cJSON *array);
/* Retrieve item number "item" from array "array". Returns NULL if unsuccessful. */
extern cJSON *cJSON_GetArrayItem(cJSON *array,int item);
CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array);
/* Retrieve item number "index" from array "array". Returns NULL if unsuccessful. */
CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int index);
/* Get item "string" from object. Case insensitive. */
extern cJSON *cJSON_GetObjectItem(cJSON *object,const char *string);
CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, const char * const string);
CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive(const cJSON * const object, const char * const string);
CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON *object, const char *string);
/* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */
extern const char *cJSON_GetErrorPtr(void);
CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void);
/* Check if the item is a string and return its valuestring */
CJSON_PUBLIC(char *) cJSON_GetStringValue(cJSON *item);
/* These functions check the type of an item */
CJSON_PUBLIC(cJSON_bool) cJSON_IsInvalid(const cJSON * const item);
CJSON_PUBLIC(cJSON_bool) cJSON_IsFalse(const cJSON * const item);
CJSON_PUBLIC(cJSON_bool) cJSON_IsTrue(const cJSON * const item);
CJSON_PUBLIC(cJSON_bool) cJSON_IsBool(const cJSON * const item);
CJSON_PUBLIC(cJSON_bool) cJSON_IsNull(const cJSON * const item);
CJSON_PUBLIC(cJSON_bool) cJSON_IsNumber(const cJSON * const item);
CJSON_PUBLIC(cJSON_bool) cJSON_IsString(const cJSON * const item);
CJSON_PUBLIC(cJSON_bool) cJSON_IsArray(const cJSON * const item);
CJSON_PUBLIC(cJSON_bool) cJSON_IsObject(const cJSON * const item);
CJSON_PUBLIC(cJSON_bool) cJSON_IsRaw(const cJSON * const item);
/* These calls create a cJSON item of the appropriate type. */
extern cJSON *cJSON_CreateNull(void);
extern cJSON *cJSON_CreateTrue(void);
extern cJSON *cJSON_CreateFalse(void);
extern cJSON *cJSON_CreateBool(int b);
extern cJSON *cJSON_CreateNumber(double num);
extern cJSON *cJSON_CreateString(const char *string);
extern cJSON *cJSON_CreateArray(void);
extern cJSON *cJSON_CreateObject(void);
CJSON_PUBLIC(cJSON *) cJSON_CreateNull(void);
CJSON_PUBLIC(cJSON *) cJSON_CreateTrue(void);
CJSON_PUBLIC(cJSON *) cJSON_CreateFalse(void);
CJSON_PUBLIC(cJSON *) cJSON_CreateBool(cJSON_bool boolean);
CJSON_PUBLIC(cJSON *) cJSON_CreateNumber(double num);
CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string);
/* raw json */
CJSON_PUBLIC(cJSON *) cJSON_CreateRaw(const char *raw);
CJSON_PUBLIC(cJSON *) cJSON_CreateArray(void);
CJSON_PUBLIC(cJSON *) cJSON_CreateObject(void);
/* Create a string where valuestring references a string so
* it will not be freed by cJSON_Delete */
CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string);
/* Create an object/arrray that only references it's elements so
* they will not be freed by cJSON_Delete */
CJSON_PUBLIC(cJSON *) cJSON_CreateObjectReference(const cJSON *child);
CJSON_PUBLIC(cJSON *) cJSON_CreateArrayReference(const cJSON *child);
/* These utilities create an Array of count items. */
extern cJSON *cJSON_CreateIntArray(int *numbers,int count);
extern cJSON *cJSON_CreateFloatArray(float *numbers,int count);
extern cJSON *cJSON_CreateDoubleArray(double *numbers,int count);
extern cJSON *cJSON_CreateStringArray(const char **strings,int count);
CJSON_PUBLIC(cJSON *) cJSON_CreateIntArray(const int *numbers, int count);
CJSON_PUBLIC(cJSON *) cJSON_CreateFloatArray(const float *numbers, int count);
CJSON_PUBLIC(cJSON *) cJSON_CreateDoubleArray(const double *numbers, int count);
CJSON_PUBLIC(cJSON *) cJSON_CreateStringArray(const char **strings, int count);
/* Append item to the specified array/object. */
extern void cJSON_AddItemToArray(cJSON *array, cJSON *item);
extern void cJSON_AddItemToObject(cJSON *object,const char *string,cJSON *item);
CJSON_PUBLIC(void) cJSON_AddItemToArray(cJSON *array, cJSON *item);
CJSON_PUBLIC(void) cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item);
/* Use this when string is definitely const (i.e. a literal, or as good as), and will definitely survive the cJSON object.
* WARNING: When this function was used, make sure to always check that (item->type & cJSON_StringIsConst) is zero before
* writing to `item->string` */
CJSON_PUBLIC(void) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item);
/* Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON. */
extern void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item);
extern void cJSON_AddItemReferenceToObject(cJSON *object,const char *string,cJSON *item);
CJSON_PUBLIC(void) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item);
CJSON_PUBLIC(void) cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item);
/* Remove/Detatch items from Arrays/Objects. */
extern cJSON *cJSON_DetachItemFromArray(cJSON *array,int which);
extern void cJSON_DeleteItemFromArray(cJSON *array,int which);
extern cJSON *cJSON_DetachItemFromObject(cJSON *object,const char *string);
extern void cJSON_DeleteItemFromObject(cJSON *object,const char *string);
CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON *parent, cJSON * const item);
CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON *array, int which);
CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON *array, int which);
CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON *object, const char *string);
CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON *object, const char *string);
CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string);
CJSON_PUBLIC(void) cJSON_DeleteItemFromObjectCaseSensitive(cJSON *object, const char *string);
/* Update array items. */
extern void cJSON_ReplaceItemInArray(cJSON *array,int which,cJSON *newitem);
extern void cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem);
CJSON_PUBLIC(void) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem); /* Shifts pre-existing items to the right. */
CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, cJSON * const item, cJSON * replacement);
CJSON_PUBLIC(void) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem);
CJSON_PUBLIC(void) cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem);
CJSON_PUBLIC(void) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object,const char *string,cJSON *newitem);
/* Duplicate a cJSON item */
extern cJSON *cJSON_Duplicate(cJSON *item,int recurse);
CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON *item, cJSON_bool recurse);
/* Duplicate will create a new, identical cJSON item to the one you pass, in new memory that will
need to be released. With recurse!=0, it will duplicate any children connected to the item.
The item->next and ->prev pointers are always zero on return from Duplicate. */
/* Recursively compare two cJSON items for equality. If either a or b is NULL or invalid, they will be considered unequal.
* case_sensitive determines if object keys are treated case sensitive (1) or case insensitive (0) */
CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * const b, const cJSON_bool case_sensitive);
/* ParseWithOpts allows you to require (and check) that the JSON is null terminated, and to retrieve the pointer to the final byte parsed. */
extern cJSON *cJSON_ParseWithOpts(const char *value,const char **return_parse_end,int require_null_terminated);
/* Macros for creating things quickly. */
#define cJSON_AddNullToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateNull())
#define cJSON_AddTrueToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateTrue())
#define cJSON_AddFalseToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateFalse())
#define cJSON_AddBoolToObject(object,name,b) cJSON_AddItemToObject(object, name, cJSON_CreateBool(b))
#define cJSON_AddNumberToObject(object,name,n) cJSON_AddItemToObject(object, name, cJSON_CreateNumber(n))
#define cJSON_AddStringToObject(object,name,s) cJSON_AddItemToObject(object, name, cJSON_CreateString(s))
CJSON_PUBLIC(void) cJSON_Minify(char *json);
/* Helper functions for creating and adding items to an object at the same time.
* They return the added item or NULL on failure. */
CJSON_PUBLIC(cJSON*) cJSON_AddNullToObject(cJSON * const object, const char * const name);
CJSON_PUBLIC(cJSON*) cJSON_AddTrueToObject(cJSON * const object, const char * const name);
CJSON_PUBLIC(cJSON*) cJSON_AddFalseToObject(cJSON * const object, const char * const name);
CJSON_PUBLIC(cJSON*) cJSON_AddBoolToObject(cJSON * const object, const char * const name, const cJSON_bool boolean);
CJSON_PUBLIC(cJSON*) cJSON_AddNumberToObject(cJSON * const object, const char * const name, const double number);
CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string);
CJSON_PUBLIC(cJSON*) cJSON_AddRawToObject(cJSON * const object, const char * const name, const char * const raw);
CJSON_PUBLIC(cJSON*) cJSON_AddObjectToObject(cJSON * const object, const char * const name);
CJSON_PUBLIC(cJSON*) cJSON_AddArrayToObject(cJSON * const object, const char * const name);
/* When assigning an integer value, it needs to be propagated to valuedouble too. */
#define cJSON_SetIntValue(object,val) ((object)?(object)->valueint=(object)->valuedouble=(val):(val))
#define cJSON_SetIntValue(object, number) ((object) ? (object)->valueint = (object)->valuedouble = (number) : (number))
/* helper for the cJSON_SetNumberValue macro */
CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON *object, double number);
#define cJSON_SetNumberValue(object, number) ((object != NULL) ? cJSON_SetNumberHelper(object, (double)number) : (number))
/* Macro for iterating over an array or object */
#define cJSON_ArrayForEach(element, array) for(element = (array != NULL) ? (array)->child : NULL; element != NULL; element = element->next)
/* malloc/free objects using the malloc/free functions that have been set with cJSON_InitHooks */
CJSON_PUBLIC(void *) cJSON_malloc(size_t size);
CJSON_PUBLIC(void) cJSON_free(void *object);
#ifdef __cplusplus
}

View File

@@ -2,6 +2,10 @@
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"
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
# Depends on: 'upstreams', upstreamRev',
# 'downstreams', 'downstreamRev',
@@ -79,10 +83,26 @@ function printHeader {
# $2 = 0 to build and install module, 1 to build and test module
# $3 = Source root of module to build
function build_module {
cmake $3 -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=$2 -DCMAKE_TOOLCHAIN_FILE=${configurations[$configuration]} $1
CMAKE_PARAMS="$1"
DO_TEST_FLAG="$2"
MOD_SRC_DIR="$3"
cmake "$MOD_SRC_DIR" -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=$DO_TEST_FLAG -DCMAKE_TOOLCHAIN_FILE=${configurations[$configuration]} $CMAKE_PARAMS
test $? -eq 0 || exit 1
if test $2 -eq 1
if test $DO_TEST_FLAG -eq 1
then
pushd "$CWD"
cd "$MOD_SRC_DIR"
if test -x "./jenkins/pre-build.sh"; then
echo "Running pre-build script"
if ! "./jenkins/pre-build.sh"; then
exit 1
fi
else
echo "No pre-build script detected"
fi
popd
if [ ! -z $BUILDTHREADS ]
then
cmake --build . -- -j$BUILDTHREADS
@@ -90,11 +110,12 @@ function build_module {
cmake --build .
fi
test $? -eq 0 || exit 2
TESTTHREADS=${TESTTHREADS:-1}
if test -z "$CTEST_CONFIGURATION"
then
ctest -T Test --no-compress-output
ctest -T Test --no-compress-output -j$TESTTHREADS
else
ctest -C $CTEST_CONFIGURATION --timeout 5000 -T Test --no-compress-output
ctest -j$TESTTHREADS -C $CTEST_CONFIGURATION --timeout 5000 -T Test --no-compress-output
fi
# Convert to junit format
@@ -112,6 +133,7 @@ function build_module {
else
cmake --build . --target install
fi
test $? -eq 0 || exit 3
fi
}
@@ -124,12 +146,7 @@ function clone_module {
mkdir -p $WORKSPACE/deps/$1
cd $WORKSPACE/deps/$1
git init .
if [ "$1" == "libecl" ]
then
git remote add origin https://github.com/Statoil/$1
else
git remote add origin https://github.com/OPM/$1
fi
git remote add origin https://github.com/OPM/$1
git fetch --depth 1 origin $2:branch_to_build
git checkout branch_to_build
git log HEAD -1 | cat
@@ -163,7 +180,7 @@ function build_upstreams {
do
echo "Building upstream $upstream=${upstreamRev[$upstream]} configuration=$configuration"
# Build upstream and execute installation
clone_and_build_module $upstream "-DCMAKE_PREFIX_PATH=$WORKSPACE/$configuration/install -DCMAKE_INSTALL_PREFIX=$WORKSPACE/$configuration/install" ${upstreamRev[$upstream]} $WORKSPACE/$configuration
clone_and_build_module $upstream "-DCMAKE_PREFIX_PATH=$WORKSPACE/$configuration/install -DCMAKE_INSTALL_PREFIX=$WORKSPACE/$configuration/install ${EXTRA_MODULE_FLAGS[$upstream]}" ${upstreamRev[$upstream]} $WORKSPACE/$configuration
test $? -eq 0 || exit 1
done
test $? -eq 0 || exit 1
@@ -178,7 +195,7 @@ function build_downstreams {
do
echo "Building downstream $downstream=${downstreamRev[$downstream]} configuration=$configuration"
# Build downstream and execute installation
clone_and_build_module $downstream "-DCMAKE_PREFIX_PATH=$WORKSPACE/$configuration/install -DCMAKE_INSTALL_PREFIX=$WORKSPACE/$configuration/install -DOPM_TESTS_ROOT=$OPM_TESTS_ROOT" ${downstreamRev[$downstream]} $WORKSPACE/$configuration 1
clone_and_build_module $downstream "-DCMAKE_PREFIX_PATH=$WORKSPACE/$configuration/install -DCMAKE_INSTALL_PREFIX=$WORKSPACE/$configuration/install -DOPM_TESTS_ROOT=$OPM_TESTS_ROOT ${EXTRA_MODULE_FLAGS[$downstream]}" ${downstreamRev[$downstream]} $WORKSPACE/$configuration 1
test $? -eq 0 || exit 1
# Installation for downstream
@@ -215,7 +232,7 @@ function build_module_full {
mkdir -p $configuration/build-$1
cd $configuration/build-$1
echo "Building main module $1=$sha1 configuration=$configuration"
build_module "-DCMAKE_INSTALL_PREFIX=$WORKSPACE/$configuration/install -DOPM_TESTS_ROOT=$OPM_TESTS_ROOT" 1 $WORKSPACE
build_module "-DCMAKE_INSTALL_PREFIX=$WORKSPACE/$configuration/install -DOPM_TESTS_ROOT=$OPM_TESTS_ROOT ${EXTRA_MODULE_FLAGS[$1]}" 1 $WORKSPACE
test $? -eq 0 || exit 1
cmake --build . --target install
test $? -eq 0 || exit 1

View File

@@ -6,17 +6,15 @@ source `dirname $0`/build-opm-module.sh
mkdir deps
ln -sf $WORKSPACE deps/opm-common
# No upstreams
declare -a upstreams
upstreams=(libecl)
declare -A upstreamRev
upstreamRev[libecl]=master
# Downstreams and revisions
declare -a downstreams
downstreams=(opm-material
opm-grid
ewoms
opm-models
opm-simulators
opm-upscaling
)
@@ -24,7 +22,7 @@ downstreams=(opm-material
declare -A downstreamRev
downstreamRev[opm-material]=master
downstreamRev[opm-grid]=master
downstreamRev[ewoms]=master
downstreamRev[opm-models]=master
downstreamRev[opm-simulators]=master
downstreamRev[opm-upscaling]=master

View File

@@ -16,9 +16,14 @@ then
cp $OPM_TESTS_ROOT_PREDEFINED $WORKSPACE/deps/opm-tests -R
fi
else
# Specified in trigger, download it
source $WORKSPACE/deps/opm-common/jenkins/build-opm-module.sh
clone_module opm-tests $OPM_TESTS_REVISION
# We need a full repo checkout
cp $OPM_TESTS_ROOT_PREDEFINED $WORKSPACE/deps/opm-tests -R
pushd $WORKSPACE/deps/opm-tests
# Then we fetch the PR branch
git remote add PR https://github.com/OPM/opm-tests
git fetch --depth 1 PR $OPM_TESTS_REVISION:branch_to_build
git checkout branch_to_build
popd
fi
else
if ! test -d $WORKSPACE/deps/opm-tests

View File

@@ -9,7 +9,7 @@ upstreams=(libecl
opm-common
opm-material
opm-grid
ewoms
opm-models
opm-simulators
opm-upscaling
)
@@ -19,7 +19,7 @@ upstreamRev[libecl]=master
upstreamRev[opm-common]=master
upstreamRev[opm-material]=master
upstreamRev[opm-grid]=master
upstreamRev[ewoms]=master
upstreamRev[opm-models]=master
upstreamRev[opm-simulators]=master
upstreamRev[opm-upscaling]=master
@@ -45,6 +45,11 @@ done
export REASON
export BRANCH_NAME
$WORKSPACE/deps/opm-simulators/tests/update_reference_data.sh $OPM_TESTS_ROOT
if test $? -eq 5
then
echo "No tests failed - no data to update. Exiting"
exit 0
fi
# Finally open the pull request
cd $OPM_TESTS_ROOT
@@ -81,6 +86,10 @@ then
PRNUMBER=${rev//[!0-9]/}
DATA_PR=`curl -X GET https://api.github.com/repos/OPM/opm-tests/pulls?head=jenkins4opm:$BRANCH_NAME | grep '"number":' | awk -F ':' '{print $2}' | sed -e 's/,//' -e 's/ //'`
git push -u jenkins4opm $BRANCH_NAME -f
fi
if [ -n "$DATA_PR" ]
then
curl -d "{ \"body\": \"Existing PR https://github.com/OPM/opm-tests/pull/$DATA_PR was updated\" }" -X POST https://api.github.com/repos/OPM/$MAIN_REPO/issues/$PRNUMBER/comments?access_token=$GH_TOKEN
else
git-open-pull -u jenkins4opm --base-account OPM --base-repo opm-tests -r /tmp/cmsg $BRANCH_NAME

View File

@@ -0,0 +1,51 @@
#ifndef ISIM_MAIN_HPP
#define ISIM_MAIN_HPP
#include <functional>
#include <string>
#include <map>
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/output/data/Solution.hpp>
#include <opm/output/data/Wells.hpp>
namespace Opm {
class EclipseIO;
class ParseContext;
class Parser;
class SummaryState;
class msim {
public:
using well_rate_function = double(const EclipseState&, const Schedule&, const SummaryState& st, const data::Solution&, size_t report_step, double seconds_elapsed);
using solution_function = void(const EclipseState&, const Schedule&, data::Solution&, size_t report_step, double seconds_elapsed);
msim(const EclipseState& state);
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, const SummaryState& st, data::Solution& sol, data::Wells& well_data, size_t report_step) const;
private:
void run_step(const Schedule& schedule, SummaryState& st, data::Solution& sol, data::Wells& well_data, size_t report_step, EclipseIO& io) const;
void run_step(const Schedule& schedule, SummaryState& st, data::Solution& sol, data::Wells& well_data, size_t report_step, double dt, EclipseIO& io) const;
void output(SummaryState& st, size_t report_step, bool substep, double seconds_elapsed, const data::Solution& sol, const data::Wells& well_data, EclipseIO& io) const;
void simulate(const Schedule& schedule, const SummaryState& st, data::Solution& sol, data::Wells& well_data, size_t report_step, double seconds_elapsed, double time_step) const;
EclipseState state;
std::map<std::string, std::map<data::Rates::opt, std::function<well_rate_function>>> well_rates;
std::map<std::string, std::function<solution_function>> solutions;
};
}
#endif

161
msim/src/msim.cpp Normal file
View File

@@ -0,0 +1,161 @@
/*
Copyright 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/>.
*/
#include <iostream>
#include <opm/output/eclipse/EclipseIO.hpp>
#include <opm/output/eclipse/RestartValue.hpp>
#include <opm/output/eclipse/Summary.hpp>
#include <opm/output/data/Solution.hpp>
#include <opm/output/data/Wells.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Action/ActionContext.hpp>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
#include <opm/msim/msim.hpp>
namespace Opm {
msim::msim(const EclipseState& state_arg) :
state(state_arg)
{}
void msim::run(Schedule& schedule, EclipseIO& io, bool report_only) {
const double week = 7 * 86400;
data::Solution sol;
data::Wells well_data;
SummaryState st(std::chrono::system_clock::from_time_t(schedule.getStartTime()));
io.writeInitial();
for (size_t report_step = 1; report_step < schedule.size(); report_step++) {
if (report_only)
run_step(schedule, st, sol, well_data, report_step, io);
else {
double time_step = std::min(week, 0.5*schedule.stepLength(report_step - 1));
run_step(schedule, st, sol, well_data, report_step, time_step, io);
}
post_step(schedule, st, sol, well_data, report_step);
}
}
void msim::post_step(Schedule& schedule, const SummaryState& st, data::Solution& /* sol */, data::Wells& /* well_data */, size_t report_step) const {
const auto& actions = schedule.actions(report_step);
if (actions.empty())
return;
Action::Context context( st );
auto sim_time = schedule.simTime(report_step);
for (const auto& action : actions.pending(sim_time)) {
auto result = action->eval(sim_time, context);
if (result)
schedule.applyAction(report_step, *action, result);
}
}
void msim::run_step(const Schedule& schedule, SummaryState& st, data::Solution& sol, data::Wells& well_data, size_t report_step, EclipseIO& io) const {
this->run_step(schedule, st, sol, well_data, report_step, schedule.stepLength(report_step - 1), io);
}
void msim::run_step(const Schedule& schedule, SummaryState& st, data::Solution& sol, data::Wells& well_data, size_t report_step, double dt, EclipseIO& io) const {
double start_time = schedule.seconds(report_step - 1);
double end_time = schedule.seconds(report_step);
double seconds_elapsed = start_time;
while (seconds_elapsed < end_time) {
double time_step = dt;
if ((seconds_elapsed + time_step) > end_time)
time_step = end_time - seconds_elapsed;
this->simulate(schedule, st, sol, well_data, report_step, seconds_elapsed, time_step);
seconds_elapsed += time_step;
io.summary().eval(st,
report_step,
seconds_elapsed,
this->state,
schedule,
well_data,
{});
this->output(st,
report_step,
(seconds_elapsed < end_time),
seconds_elapsed,
sol,
well_data,
io);
}
}
void msim::output(SummaryState& st, size_t report_step, bool /* substep */, double seconds_elapsed, const data::Solution& sol, const data::Wells& well_data, EclipseIO& io) const {
RestartValue value(sol, well_data);
io.writeTimeStep(st,
report_step,
false,
seconds_elapsed,
value);
}
void msim::simulate(const Schedule& schedule, const SummaryState& st, data::Solution& sol, data::Wells& well_data, size_t report_step, double seconds_elapsed, double time_step) const {
for (const auto& sol_pair : this->solutions) {
auto func = sol_pair.second;
func(this->state, schedule, sol, report_step, seconds_elapsed + time_step);
}
for (const auto& well_pair : this->well_rates) {
const std::string& well_name = well_pair.first;
data::Well& well = well_data[well_name];
for (const auto& rate_pair : well_pair.second) {
auto rate = rate_pair.first;
auto func = rate_pair.second;
well.rates.set(rate, func(this->state, schedule, st, sol, report_step, seconds_elapsed + time_step));
}
// This is complete bogus; a temporary fix to pass an assert() in the
// the restart output.
well.connections.resize(100);
}
}
void msim::well_rate(const std::string& well, data::Rates::opt rate, std::function<well_rate_function> func) {
this->well_rates[well][rate] = func;
}
void msim::solution(const std::string& field, std::function<solution_function> func) {
this->solutions[field] = func;
}
}

View File

@@ -9,23 +9,11 @@ set (opm-common_CONFIG_VAR
set (opm-common_DEPS
# compile with C99 support if available
"C99"
# compile with C++0x/11 support if available
"CXX11Features REQUIRED"
)
)
list(APPEND opm-common_DEPS
# various runtime library enhancements
"Boost 1.44.0 COMPONENTS system unit_test_framework REQUIRED"
)
if(ENABLE_ECL_INPUT)
list(APPEND opm-common_DEPS
"ecl REQUIRED"
# various runtime library enhancements
"Boost 1.44.0
COMPONENTS system filesystem unit_test_framework regex REQUIRED")
else()
list(APPEND opm-common_DEPS
# various runtime library enhancements
"Boost 1.44.0
COMPONENTS system unit_test_framework REQUIRED")
endif()
# We need a defined target for libecl when linking.
# The definition of the target is done implicitly below when
# libecl is searched for.
find_package_deps(opm-common)

View File

@@ -0,0 +1,44 @@
/*
Copyright 2015 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 LOCATION_HPP
#define LOCATION_HPP
namespace Opm {
class Location {
public:
std::string filename = "<memory string>";
std::size_t lineno = 0;
Location() = default;
Location(std::string fname, std::size_t lno) :
filename(std::move(fname)),
lineno(lno)
{}
bool operator==(const Location& data) const {
return filename == data.filename &&
lineno == data.lineno;
}
};
}
#endif

View File

@@ -23,7 +23,10 @@
#include <cstdint>
#include <string>
#include <opm/common/OpmLog/Location.hpp>
namespace Opm {
namespace Log {
namespace MessageType {
const int64_t Debug = 1; /* Excessive information */
@@ -56,8 +59,8 @@ namespace Log {
bool isPower2(int64_t x);
std::string fileMessage(const std::string& path, int line , const std::string& msg);
std::string fileMessage(int64_t messageType , const std::string& path, int line , const std::string& msg);
std::string fileMessage(const Location& location, const std::string& msg);
std::string fileMessage(int64_t messageType , const Location& location , const std::string& msg);
std::string prefixMessage(int64_t messageType , const std::string& msg);
std::string colorCodeMessage(int64_t messageType , const std::string& msg);

View File

@@ -0,0 +1,79 @@
/*
Copyright 2019 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 ACTIVEGRIDCELLS_HPP
#define ACTIVEGRIDCELLS_HPP
#include <opm/parser/eclipse/EclipseState/Grid/GridDims.hpp>
#include <array>
namespace Opm
{
/**
* \brief Simple class capturing active cells of a grid
*
*/
class ActiveGridCells
: public GridDims
{
public:
/// \brief Constructs mapping of active cells.
/// \param xyz The cartesian dimensions of the grid
/// \param globalCell Pointer to first entry of contiguous
/// array mapping local index to cartesian one.
/// \param nc The number of cells of a grid.
ActiveGridCells(std::array<int, 3> xyz,
const int* globalCell, std::size_t nc);
/// \brief Constructs mapping of active cells.
/// \param nx Number of cells in x
/// \param ny Number of cells in y
/// \param nz Number of cells in z
/// \param globalCell Pointer to first entry of contiguous
/// array mapping local index to cartesian one.
/// \param nc The number of cells of a grid.
ActiveGridCells(std::size_t nx, std::size_t ny, std::size_t nz,
const int* globalCell, std::size_t nc);
bool cellActive(std::size_t i, std::size_t j, std::size_t k) const;
bool cellActive(std::size_t cartesianIndex) const;
std::vector<int> actNum() const;
/// \brief Get the local index of a cell
/// \param cartesianIndex The cartesian index of the cell
/// \return The local index or -1 if the cell is inactive
int localCell(std::size_t cartesianIndex) const;
/// \brief Get the local index of a cell
/// \param i The index in the i direction
/// \param j The index in the j direction
/// \param k The index in the k direction
/// \return The local index or -1 if the cell is inactive
int localCell(std::size_t i, std::size_t j, std::size_t k) const;
protected:
/// \brief Maps the cartesian index to a compressed local index.
///
/// nonactive cells are marked with -1.
std::vector<int> localCell_;
};
} // end namespace Opm
#endif // ACTIVEGRIDCELLS_HPP

View File

@@ -0,0 +1,47 @@
/*
Copyright 2019 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_FILESYSTEM_HPP
#define OPM_FILESYSTEM_HPP
#if __cplusplus < 201703L || \
(defined(__GNUC__) && __GNUC__ < 8)
#include <experimental/filesystem>
#else
#include <filesystem>
#endif
#include <string>
namespace Opm
{
#if __cplusplus < 201703L || \
(defined(__GNUC__) && __GNUC__ < 8)
namespace filesystem = std::experimental::filesystem;
#else
namespace filesystem = std::filesystem;
#endif
// A poor man's filesystem::unique_path
std::string unique_path(const std::string& input);
} // end namespace Opm
#endif // OPM_FILESYSTEM_HPP

View File

@@ -0,0 +1,84 @@
/*
Copyright 2019 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_TIMESERVICE_HEADER_INCLUDED
#define OPM_TIMESERVICE_HEADER_INCLUDED
#include <chrono>
#include <ctime>
namespace Opm {
class TimeStampUTC
{
public:
struct YMD {
int year{0};
int month{0};
int day{0};
bool operator==(const YMD& data) const
{
return year == data.year &&
month == data.month &&
day == data.day;
}
};
TimeStampUTC() = default;
explicit TimeStampUTC(const std::time_t tp);
explicit TimeStampUTC(const YMD& ymd);
TimeStampUTC(const YMD& ymd,
int hour,
int minutes,
int seconds,
int usec);
TimeStampUTC& operator=(const std::time_t tp);
bool operator==(const TimeStampUTC& data) const;
TimeStampUTC& hour(const int h);
TimeStampUTC& minutes(const int m);
TimeStampUTC& seconds(const int s);
TimeStampUTC& microseconds(const int us);
const YMD& ymd() const { return ymd_; }
int year() const { return this->ymd_.year; }
int month() const { return this->ymd_.month; }
int day() const { return this->ymd_.day; }
int hour() const { return this->hour_; }
int minutes() const { return this->minutes_; }
int seconds() const { return this->seconds_; }
int microseconds() const { return this->usec_; }
private:
YMD ymd_{};
int hour_{0};
int minutes_{0};
int seconds_{0};
int usec_{0};
};
TimeStampUTC operator+(const TimeStampUTC& lhs, std::chrono::duration<double> delta);
std::time_t asTimeT(const TimeStampUTC& tp);
} // namespace Opm
#endif // OPM_TIMESERVICE_HEADER_INCLUDED

View File

@@ -1,21 +1,6 @@
//===========================================================================
//
// File: RootFinders.hpp
//
// Created: Thu May 6 19:59:42 2010
//
// Author(s): Atgeirr F Rasmussen <atgeirr@sintef.no>
// Jostein R Natvig <jostein.r.natvig@sintef.no>
//
// $Date$
//
// $Revision$
//
//===========================================================================
/*
Copyright 2010 SINTEF ICT, Applied Mathematics.
Copyright 2010 Statoil ASA.
Copyright 2010, 2019 SINTEF Digital
Copyright 2010, 2019 Equinor ASA
This file is part of the Open Porous Media project (OPM).
@@ -295,6 +280,126 @@ namespace Opm
template <class ErrorPolicy = ThrowOnError>
class RegulaFalsiBisection
{
public:
inline static std::string name()
{
return "RegulaFalsiBisection";
}
/// Implements a modified regula falsi method as described in
/// "Improved algorithms of Illinois-type for the numerical
/// solution of nonlinear equations"
/// by J. A. Ford. Current variant is the 'Pegasus' method.
/// Combines this method with the bisection method, inspired by
/// http://phillipmfeldman.org/Python/roots/find_roots.html
template <class Functor>
inline static double solve(const Functor& f,
const double a,
const double b,
const int max_iter,
const double tolerance,
int& iterations_used)
{
using namespace std;
const double sqrt_half = std::sqrt(0.5);
const double macheps = numeric_limits<double>::epsilon();
const double eps = tolerance + macheps * max(max(fabs(a), fabs(b)), 1.0);
double x0 = a;
double x1 = b;
double f0 = f(x0);
const double epsF = tolerance + macheps * max(fabs(f0), 1.0);
if (fabs(f0) < epsF) {
return x0;
}
double f1 = f(x1);
if (fabs(f1) < epsF) {
return x1;
}
if (f0 * f1 > 0.0) {
return ErrorPolicy::handleBracketingFailure(a, b, f0, f1);
}
iterations_used = 0;
// In every iteraton, x1 is the last point computed,
// and x0 is the last point computed that makes it a bracket.
double width = fabs(x1 - x0);
double contraction = 1.0;
while (width >= 1e-9 * eps) {
// If we are contracting sufficiently to at least halve
// the interval width in two iterations we use regula
// falsi. Otherwise, we take a bisection step to avoid
// slow convergence.
const double xnew = (contraction < sqrt_half)
? regulaFalsiStep(x0, x1, f0, f1)
: bisectionStep(x0, x1, f0, f1);
const double fnew = f(xnew);
++iterations_used;
if (iterations_used > max_iter) {
return ErrorPolicy::handleTooManyIterations(x0, x1, max_iter);
}
if (fabs(fnew) < epsF) {
return xnew;
}
// Now we must check which point we must replace.
if ((fnew > 0.0) == (f0 > 0.0)) {
// We must replace x0.
x0 = x1;
f0 = f1;
} else {
// We must replace x1, this is the case where
// the modification to regula falsi kicks in,
// by modifying f0.
// 1. The classic Illinois method
// const double gamma = 0.5;
// @afr: The next two methods do not work??!!?
// 2. The method called 'Method 3' in the paper.
// const double phi0 = f1/f0;
// const double phi1 = fnew/f1;
// const double gamma = 1.0 - phi1/(1.0 - phi0);
// 3. The method called 'Method 4' in the paper.
// const double phi0 = f1/f0;
// const double phi1 = fnew/f1;
// const double gamma = 1.0 - phi0 - phi1;
// cout << "phi0 = " << phi0 <<" phi1 = " << phi1 <<
// " gamma = " << gamma << endl;
// 4. The 'Pegasus' method
const double gamma = f1 / (f1 + fnew);
// 5. Straight unmodified Regula Falsi
// const double gamma = 1.0;
f0 *= gamma;
}
x1 = xnew;
f1 = fnew;
const double widthnew = fabs(x1 - x0);
contraction = widthnew/width;
width = widthnew;
}
return 0.5 * (x0 + x1);
}
private:
inline static double regulaFalsiStep(const double a, const double b, const double fa, const double fb)
{
assert(fa * fb < 0.0);
return (b * fa - a * fb) / (fa - fb);
}
inline static double bisectionStep(const double a, const double b, const double fa, const double fb)
{
static_cast<void>(fa);
static_cast<void>(fb);
assert(fa * fb < 0.0);
return 0.5*(a + b);
}
};
/// Attempts to find an interval bracketing a zero by successive
/// enlargement of search interval.
template <class Functor>

View File

@@ -16,9 +16,10 @@
*/
#include <vector>
#include <array>
#include <math.h>
double calculateCellVol(const std::vector<double>& X, const std::vector<double>& Y, const std::vector<double>& Z);
double calculateCellVol(const std::array<double,8>& X, const std::array<double,8>& Y, const std::array<double,8>& Z);

View File

@@ -69,13 +69,11 @@
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wunneeded-internal-declaration"
#pragma GCC diagnostic ignored "-Wunused-private-field"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#pragma GCC diagnostic ignored "-Wcast-align"
#pragma GCC diagnostic ignored "-Wcast-qual"
#pragma GCC diagnostic ignored "-Wignored-attributes"
#pragma GCC diagnostic ignored "-Wmisleading-indentation"
#endif // COMPATIBLE_COMPILER
#endif // SILENCE_EXTERNAL_WARNINGS

65
opm/io/eclipse/EGrid.hpp Normal file
View File

@@ -0,0 +1,65 @@
/*
Copyright 2019 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_EGRID_HPP
#define OPM_IO_EGRID_HPP
#include <opm/io/eclipse/EclFile.hpp>
#include <array>
#include <iostream>
#include <string>
#include <fstream>
#include <vector>
#include <ctime>
#include <map>
namespace Opm { namespace EclIO {
class EGrid : public EclFile
{
public:
explicit EGrid(const std::string& filename);
int global_index(int i, int j, int k) const;
int active_index(int i, int j, int k) const;
const std::array<int, 3>& dimension() const { return nijk; }
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;
int activeCells() const { return nactive; }
int totalNumberOfCells() const { return nijk[0] * nijk[1] * nijk[2]; }
private:
std::array<int, 3> nijk;
int nactive;
std::vector<int> act_index;
std::vector<int> glob_index;
std::vector<float> coord_array;
std::vector<float> zcorn_array;
};
}} // namespace Opm::EclIO
#endif // OPM_IO_EGRID_HPP

84
opm/io/eclipse/ERft.hpp Normal file
View File

@@ -0,0 +1,84 @@
/*
Copyright 2019 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_ERFT_HPP
#define OPM_IO_ERFT_HPP
#include <opm/io/eclipse/EclFile.hpp>
#include <ctime>
#include <map>
#include <set>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
namespace Opm { namespace EclIO {
class ERft : public EclFile
{
public:
explicit ERft(const std::string &filename);
using RftDate = std::tuple<int,int,int>;
template <typename T>
const std::vector<T>& getRft(const std::string& name, const std::string& wellName,
const RftDate& date) const;
template <typename T>
const std::vector<T>& getRft(const std::string& name, const std::string& wellName,
int year, int month, int day) const;
std::vector<std::string> listOfWells() const;
std::vector<RftDate> listOfdates() const;
using RftReportList = std::vector<std::pair<std::string, RftDate>>;
const RftReportList& listOfRftReports() const { return rftReportList; }
bool hasRft(const std::string& wellName, const RftDate& date) const;
bool hasRft(const std::string& wellName, int year, int month, int day) const;
std::vector<EclEntry> listOfRftArrays(const std::string& wellName,
const RftDate& date) const;
std::vector<EclEntry> listOfRftArrays(const std::string& wellName,
int year, int month, int day) const;
bool hasArray(const std::string& arrayName, const std::string& wellName,
const RftDate& date) const;
private:
std::map<int, std::pair<int,int>> arrIndexRange;
int numReports;
std::vector<float> timeList;
std::set<std::string> wellList;
std::set<RftDate> dateList;
RftReportList rftReportList;
std::map<std::pair<std::string,RftDate>,int> reportIndex; // mapping report index to wellName and date (tupe)
int getReportIndex(const std::string& wellName, const RftDate& date) const;
int getArrayIndex(const std::string& name, const std::string& wellName,
const RftDate& date) const;
};
}} // namespace Opm::EclIO
#endif // OPM_IO_ERFT_HPP

80
opm/io/eclipse/ERst.hpp Normal file
View File

@@ -0,0 +1,80 @@
/*
Copyright 2019 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_ERST_HPP
#define OPM_IO_ERST_HPP
#include <opm/io/eclipse/EclFile.hpp>
#include <ios>
#include <map>
#include <string>
#include <unordered_map>
#include <vector>
namespace Opm { namespace EclIO { namespace OutputStream {
class Restart;
}}}
namespace Opm { namespace EclIO {
class ERst : public EclFile
{
public:
explicit ERst(const std::string& filename);
bool hasReportStepNumber(int number) const;
void loadReportStepNumber(int number);
template <typename T>
const std::vector<T>& getRst(const std::string& name, int reportStepNumber, int occurrence);
template <typename T>
const std::vector<T>& getRst(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;
const std::vector<int>& listOfReportStepNumbers() const { return seqnum; }
std::vector<EclEntry> listOfRstArrays(int reportStepNumber);
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;
std::map<int, std::pair<int,int>> arrIndexRange; // mapping report step number to array indeces (start and end)
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;
std::streampos
restartStepWritePosition(const int seqnumValue) const;
};
}} // namespace Opm::EclIO
#endif // OPM_IO_ERST_HPP

70
opm/io/eclipse/ESmry.hpp Normal file
View File

@@ -0,0 +1,70 @@
/*
Copyright 2019 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_ESMRY_HPP
#define OPM_IO_ESMRY_HPP
#include <string>
#include <vector>
#include <opm/common/utility/FileSystem.hpp>
namespace Opm { namespace EclIO {
class ESmry
{
public:
// input is smspec (or fsmspec file)
explicit ESmry(const std::string& filename, bool loadBaseRunData=false);
int numberOfVectors() const { return nVect; }
bool hasKey(const std::string& key) const;
const std::vector<float>& get(const std::string& name) const;
std::vector<float> get_at_rstep(const std::string& name) const;
const std::vector<std::string>& keywordList() const { return keyword; }
int timestepIdxAtReportstepStart(const int reportStep) const;
private:
int nVect, nI, nJ, nK;
void ijk_from_global_index(int glob, int &i, int &j, int &k) const;
std::vector<std::vector<float>> param;
std::vector<std::string> keyword;
std::vector<int> seqIndex;
std::vector<float> seqTime;
std::vector<std::string> checkForMultipleResultFiles(const Opm::filesystem::path& rootN, bool formatted) const;
void getRstString(const std::vector<std::string>& restartArray,
Opm::filesystem::path& pathRst,
Opm::filesystem::path& rootN) const;
void updatePathAndRootName(Opm::filesystem::path& dir, Opm::filesystem::path& rootN) const;
std::string makeKeyString(const std::string& keyword, const std::string& wgname, int num) const;
};
}} // namespace Opm::EclIO
#endif // OPM_IO_ESMRY_HPP

117
opm/io/eclipse/EclFile.hpp Normal file
View File

@@ -0,0 +1,117 @@
/*
Copyright 2019 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_ECLFILE_HPP
#define OPM_IO_ECLFILE_HPP
#include <opm/common/ErrorMacros.hpp>
#include <opm/io/eclipse/EclIOdata.hpp>
#include <ios>
#include <string>
#include <stdexcept>
#include <tuple>
#include <unordered_map>
#include <vector>
namespace Opm { namespace EclIO {
class EclFile
{
public:
explicit EclFile(const std::string& filename, bool preload = false);
bool formattedInput() { return formatted; }
void loadData(); // load all data
void loadData(const std::string& arrName); // load all arrays with array name equal to arrName
void loadData(int arrIndex); // load data based on array indices in vector arrIndex
void loadData(const std::vector<int>& arrIndex); // load data based on array indices in vector arrIndex
void clearData()
{
inte_array.clear();
real_array.clear();
doub_array.clear();
logi_array.clear();
char_array.clear();
}
using EclEntry = std::tuple<std::string, eclArrType, int>;
std::vector<EclEntry> getList() const;
template <typename T>
const std::vector<T>& get(int arrIndex);
template <typename T>
const std::vector<T>& get(const std::string& name);
bool hasKey(const std::string &name) const;
const std::vector<std::string>& arrayNames() const { return array_name; }
std::size_t size() const;
protected:
bool formatted;
std::string inputFilename;
std::unordered_map<int, std::vector<int>> inte_array;
std::unordered_map<int, std::vector<bool>> logi_array;
std::unordered_map<int, std::vector<double>> doub_array;
std::unordered_map<int, std::vector<float>> real_array;
std::unordered_map<int, std::vector<std::string>> char_array;
std::vector<std::string> array_name;
std::vector<eclArrType> array_type;
std::vector<int> array_size;
std::vector<unsigned long int> ifStreamPos;
std::map<std::string, int> array_index;
template<class T>
const std::vector<T>& getImpl(int arrIndex, eclArrType type,
const std::unordered_map<int, std::vector<T>>& array,
const std::string& typeStr)
{
if (array_type[arrIndex] != type) {
std::string message = "Array with index " + std::to_string(arrIndex) + " is not of type " + typeStr;
OPM_THROW(std::runtime_error, message);
}
if (!arrayLoaded[arrIndex]) {
loadData(arrIndex);
}
return array.at(arrIndex);
}
std::streampos
seekPosition(const std::vector<std::string>::size_type arrIndex) const;
private:
std::vector<bool> arrayLoaded;
void loadBinaryArray(std::fstream& fileH, std::size_t arrIndex);
void loadFormattedArray(const std::string& fileStr, std::size_t arrIndex, long int fromPos);
};
}} // namespace Opm::EclIO
#endif // OPM_IO_ECLFILE_HPP

View File

@@ -0,0 +1,69 @@
/*
Copyright 2019 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_ECLIODATA_HPP
#define OPM_IO_ECLIODATA_HPP
#include <tuple>
namespace Opm { namespace EclIO {
// type MESS have no assisiated data
enum eclArrType {
INTE, REAL, DOUB, CHAR, LOGI, MESS
};
// named constants related to binary file format
const unsigned int true_value = 0xffffffff;
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
// named constants related to formatted file file format
const int MaxNumBlockInte = 1000; // maximum number of Inte values in block => hard line shift
const int MaxNumBlockReal = 1000; // maximum number of Real values in block => hard line shift
const int MaxNumBlockDoub = 1000; // maximum number of Doub values in block => hard line shift
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 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
#endif // OPM_IO_ECLIODATA_HPP

View File

@@ -0,0 +1,116 @@
/*
Copyright 2019 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_IO_ECLOUTPUT_HPP
#define OPM_IO_ECLOUTPUT_HPP
#include <fstream>
#include <ios>
#include <string>
#include <typeinfo>
#include <vector>
#include <opm/io/eclipse/EclIOdata.hpp>
#include <opm/io/eclipse/PaddedOutputString.hpp>
namespace Opm { namespace EclIO { namespace OutputStream {
class Restart;
class SummarySpecification;
}}}
namespace Opm { namespace EclIO {
class EclOutput
{
public:
EclOutput(const std::string& filename,
const bool formatted,
const std::ios_base::openmode mode = std::ios::out);
template<typename T>
void write(const std::string& name,
const std::vector<T>& data)
{
eclArrType arrType = MESS;
if (typeid(T) == typeid(int))
arrType = INTE;
else if (typeid(T) == typeid(float))
arrType = REAL;
else if (typeid(T) == typeid(double))
arrType = DOUB;
else if (typeid(T) == typeid(bool))
arrType = LOGI;
else if (typeid(T) == typeid(char))
arrType = MESS;
if (isFormatted)
{
writeFormattedHeader(name, data.size(), arrType);
if (arrType != MESS)
writeFormattedArray(data);
}
else
{
writeBinaryHeader(name, data.size(), arrType);
if (arrType != MESS)
writeBinaryArray(data);
}
}
void message(const std::string& msg);
void flushStream();
friend class OutputStream::Restart;
friend class OutputStream::SummarySpecification;
private:
void writeBinaryHeader(const std::string& arrName, int size, eclArrType arrType);
template <typename T>
void writeBinaryArray(const std::vector<T>& data);
void writeBinaryCharArray(const std::vector<std::string>& data);
void writeBinaryCharArray(const std::vector<PaddedOutputString<8>>& data);
void writeFormattedHeader(const std::string& arrName, int size, eclArrType arrType);
template <typename T>
void writeFormattedArray(const std::vector<T>& data);
void writeFormattedCharArray(const std::vector<std::string>& data);
void writeFormattedCharArray(const std::vector<PaddedOutputString<8>>& data);
std::string make_real_string(float value) const;
std::string make_doub_string(double value) const;
bool isFormatted;
std::ofstream ofileH;
};
template<>
void EclOutput::write<std::string>(const std::string& name,
const std::vector<std::string>& data);
template <>
void EclOutput::write<PaddedOutputString<8>>
(const std::string& name,
const std::vector<PaddedOutputString<8>>& data);
}} // namespace Opm::EclIO
#endif // OPM_IO_ECLOUTPUT_HPP

View File

@@ -0,0 +1,40 @@
/*
Copyright 2019 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_ECLUTIL_HPP
#define OPM_IO_ECLUTIL_HPP
#include <opm/io/eclipse/EclIOdata.hpp>
#include <string>
#include <tuple>
namespace Opm { namespace EclIO {
int flipEndianInt(int num);
float flipEndianFloat(float num);
double flipEndianDouble(double num);
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);
}} // namespace Opm::EclIO
#endif // OPM_IO_ECLUTIL_HPP

View File

@@ -0,0 +1,455 @@
/*
Copyright (c) 2019 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_OUTPUTSTREAM_HPP_INCLUDED
#define OPM_IO_OUTPUTSTREAM_HPP_INCLUDED
#include <opm/io/eclipse/PaddedOutputString.hpp>
#include <array>
#include <chrono>
#include <ios>
#include <memory>
#include <string>
#include <vector>
namespace Opm { namespace EclIO {
class EclOutput;
}} // namespace Opm::EclIO
namespace Opm { namespace EclIO { namespace OutputStream {
struct Formatted { bool set; };
struct Unified { bool set; };
/// Abstract representation of an ECLIPSE-style result set.
struct ResultSet
{
/// Output directory. Commonly "." or location of run's .DATA file.
std::string outputDir;
/// Base name of simulation run.
std::string baseName;
};
/// File manager for "init" output streams.
class Init
{
public:
/// Constructor.
///
/// Opens file stream for writing.
///
/// \param[in] rset Output directory and base name of output stream.
///
/// \param[in] fmt Whether or not to create formatted output files.
explicit Init(const ResultSet& rset,
const Formatted& fmt);
~Init();
Init(const Init& rhs) = delete;
Init(Init&& rhs);
Init& operator=(const Init& rhs) = delete;
Init& operator=(Init&& rhs);
/// Write integer data to underlying output stream.
///
/// \param[in] kw Name of output vector (keyword).
///
/// \param[in] data Output values.
void write(const std::string& kw,
const std::vector<int>& data);
/// Write boolean data to underlying output stream.
///
/// \param[in] kw Name of output vector (keyword).
///
/// \param[in] data Output values.
void write(const std::string& kw,
const std::vector<bool>& data);
/// Write single precision floating point data to underlying
/// output stream.
///
/// \param[in] kw Name of output vector (keyword).
///
/// \param[in] data Output values.
void write(const std::string& kw,
const std::vector<float>& data);
/// Write double precision floating point data to underlying
/// output stream.
///
/// \param[in] kw Name of output vector (keyword).
///
/// \param[in] data Output values.
void write(const std::string& kw,
const std::vector<double>& data);
private:
/// Init file output stream.
std::unique_ptr<EclOutput> stream_;
/// Open output stream.
///
/// Writes to \c stream_.
///
/// \param[in] fname Filename of new output stream.
///
/// \param[in] formatted Whether or not to create a
/// formatted output file.
void open(const std::string& fname,
const bool formatted);
/// Access writable output stream.
EclOutput& stream();
/// Implementation function for public \c write overload set.
template <typename T>
void writeImpl(const std::string& kw,
const std::vector<T>& data);
};
/// File manager for restart output streams.
class Restart
{
public:
/// Constructor.
///
/// Opens file stream pertaining to restart of particular report
/// step and also outputs a SEQNUM record in the case of a unified
/// output stream.
///
/// Must be called before accessing the stream object through the
/// stream() member function.
///
/// \param[in] rset Output directory and base name of output stream.
///
/// \param[in] seqnum Sequence number of new report. One-based
/// report step ID.
///
/// \param[in] fmt Whether or not to create formatted output files.
///
/// \param[in] unif Whether or not to create unified output files.
explicit Restart(const ResultSet& rset,
const int seqnum,
const Formatted& fmt,
const Unified& unif);
~Restart();
Restart(const Restart& rhs) = delete;
Restart(Restart&& rhs);
Restart& operator=(const Restart& rhs) = delete;
Restart& operator=(Restart&& rhs);
/// Generate a message string (keyword type 'MESS') in underlying
/// output stream.
///
/// \param[in] msg Message string (e.g., "STARTSOL").
void message(const std::string& msg);
/// Write integer data to underlying output stream.
///
/// \param[in] kw Name of output vector (keyword).
///
/// \param[in] data Output values.
void write(const std::string& kw,
const std::vector<int>& data);
/// Write boolean data to underlying output stream.
///
/// \param[in] kw Name of output vector (keyword).
///
/// \param[in] data Output values.
void write(const std::string& kw,
const std::vector<bool>& data);
/// Write single precision floating point data to underlying
/// output stream.
///
/// \param[in] kw Name of output vector (keyword).
///
/// \param[in] data Output values.
void write(const std::string& kw,
const std::vector<float>& data);
/// Write double precision floating point data to underlying
/// output stream.
///
/// \param[in] kw Name of output vector (keyword).
///
/// \param[in] data Output values.
void write(const std::string& kw,
const std::vector<double>& data);
/// Write unpadded string data to underlying output stream.
///
/// \param[in] kw Name of output vector (keyword).
///
/// \param[in] data Output values.
void write(const std::string& kw,
const std::vector<std::string>& data);
/// Write padded character data (8 characters per string)
/// to underlying output stream.
///
/// \param[in] kw Name of output vector (keyword).
///
/// \param[in] data Output values.
void write(const std::string& kw,
const std::vector<PaddedOutputString<8>>& data);
private:
/// Restart output stream.
std::unique_ptr<EclOutput> stream_;
/// Open unified output file and place stream's output indicator
/// in appropriate location.
///
/// Writes to \c stream_.
///
/// \param[in] fname Filename of output stream.
///
/// \param[in] formatted Whether or not to create a
/// formatted output file.
///
/// \param[in] seqnum Sequence number of new report. One-based
/// report step ID.
void openUnified(const std::string& fname,
const bool formatted,
const int seqnum);
/// Open new output stream.
///
/// Handles the case of separate output files or unified output file
/// that does not already exist. Writes to \c stream_.
///
/// \param[in] fname Filename of new output stream.
///
/// \param[in] formatted Whether or not to create a
/// formatted output file.
void openNew(const std::string& fname,
const bool formatted);
/// Open existing output file and place stream's output indicator
/// in appropriate location.
///
/// Writes to \c stream_.
///
/// \param[in] fname Filename of output stream.
///
/// \param[in] writePos Position at which to place stream's output
/// indicator. Use \code streampos{ streamoff{-1} } \endcode to
/// place output indicator at end of file (i.e, simple append).
void openExisting(const std::string& fname,
const bool formatted,
const std::streampos writePos);
/// Access writable output stream.
///
/// Must not be called prior to \c prepareStep.
EclOutput& stream();
/// Implementation function for public \c write overload set.
template <typename T>
void writeImpl(const std::string& kw,
const std::vector<T>& data);
};
/// File manager for RFT output streams
class RFT
{
public:
struct OpenExisting { bool set; };
/// Constructor.
///
/// Opens file stream for writing.
///
/// \param[in] rset Output directory and base name of output stream.
///
/// \param[in] fmt Whether or not to create formatted output files.
///
/// \param[in] existing Whether or not to open an existing output file.
explicit RFT(const ResultSet& rset,
const Formatted& fmt,
const OpenExisting& existing);
~RFT();
RFT(const RFT& rhs) = delete;
RFT(RFT&& rhs);
RFT& operator=(const RFT& rhs) = delete;
RFT& operator=(RFT&& rhs);
/// Write integer data to underlying output stream.
///
/// \param[in] kw Name of output vector (keyword).
///
/// \param[in] data Output values.
void write(const std::string& kw,
const std::vector<int>& data);
/// Write single precision floating point data to underlying
/// output stream.
///
/// \param[in] kw Name of output vector (keyword).
///
/// \param[in] data Output values.
void write(const std::string& kw,
const std::vector<float>& data);
/// Write padded character data (8 characters per string)
/// to underlying output stream.
///
/// \param[in] kw Name of output vector (keyword).
///
/// \param[in] data Output values.
void write(const std::string& kw,
const std::vector<PaddedOutputString<8>>& data);
private:
/// Init file output stream.
std::unique_ptr<EclOutput> stream_;
/// Open output stream.
///
/// Writes to \c stream_.
///
/// \param[in] fname Filename of new output stream.
///
/// \param[in] formatted Whether or not to create a
/// formatted output file.
///
/// \param[in] existing Whether or not to open an
/// existing output file (mode ios_base::app).
void open(const std::string& fname,
const bool formatted,
const bool existing);
/// Access writable output stream.
EclOutput& stream();
/// Implementation function for public \c write overload set.
template <typename T>
void writeImpl(const std::string& kw,
const std::vector<T>& data);
};
class SummarySpecification
{
public:
using StartTime = std::chrono::system_clock::time_point;
enum class UnitConvention
{
Metric = 1,
Field = 2,
Lab = 3,
Pvt_M = 4,
};
struct RestartSpecification
{
std::string root;
int step;
};
class Parameters
{
public:
void add(const std::string& keyword,
const std::string& wgname,
const int num,
const std::string& unit);
friend class SummarySpecification;
private:
std::vector<PaddedOutputString<8>> keywords{};
std::vector<PaddedOutputString<8>> wgnames{};
std::vector<int> nums{};
std::vector<PaddedOutputString<8>> units{};
};
explicit SummarySpecification(const ResultSet& rset,
const Formatted& fmt,
const UnitConvention uconv,
const std::array<int,3>& cartDims,
const RestartSpecification& restart,
const StartTime start);
~SummarySpecification();
SummarySpecification(const SummarySpecification& rhs) = delete;
SummarySpecification(SummarySpecification&& rhs);
SummarySpecification& operator=(const SummarySpecification& rhs) = delete;
SummarySpecification& operator=(SummarySpecification&& rhs);
void write(const Parameters& params);
private:
int unit_;
int restartStep_;
std::array<int,3> cartDims_;
StartTime startDate_;
std::vector<PaddedOutputString<8>> restart_;
/// Summary specification (SMSPEC) file output stream.
std::unique_ptr<EclOutput> stream_;
void rewindStream();
void flushStream();
EclOutput& stream();
};
std::unique_ptr<EclOutput>
createSummaryFile(const ResultSet& rset,
const int seqnum,
const Formatted& fmt,
const Unified& unif);
/// Derive filename corresponding to output stream of particular result
/// set, with user-specified file extension.
///
/// Low-level string concatenation routine that does not know specific
/// relations between base names and file extensions. Handles details
/// of base name ending in a period (full stop) or having a name that
/// might otherwise appear to contain a file extension (e.g., CASE.01).
///
/// \param[in] rsetDescriptor Output directory and base name of result set.
///
/// \param[in] ext Filename extension.
///
/// \return outputDir/baseName.ext
std::string outputFileName(const ResultSet& rsetDescriptor,
const std::string& ext);
}}} // namespace Opm::EclIO::OutputStream
#endif // OPM_IO_OUTPUTSTREAM_HPP_INCLUDED

View File

@@ -17,8 +17,8 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_CHARARRAY_HEADER_HPP
#define OPM_CHARARRAY_HEADER_HPP
#ifndef OPM_PADDEDOUTPUTSTRING_HEADER_HPP
#define OPM_PADDEDOUTPUTSTRING_HEADER_HPP
#include <algorithm>
#include <array>
@@ -26,7 +26,7 @@
#include <cstddef>
#include <string>
namespace Opm { namespace RestartIO { namespace Helpers {
namespace Opm { namespace EclIO {
/// Null-terminated, left adjusted, space padded array of N characters.
///
@@ -36,30 +36,30 @@ namespace Opm { namespace RestartIO { namespace Helpers {
///
/// \tparam N Number of characters.
template <std::size_t N>
class CharArrayNullTerm
class PaddedOutputString
{
public:
CharArrayNullTerm()
PaddedOutputString()
{
this->clear();
}
explicit CharArrayNullTerm(const std::string& s)
: CharArrayNullTerm()
explicit PaddedOutputString(const std::string& s)
: PaddedOutputString()
{
this->copy_in(s.c_str(), s.size());
}
~CharArrayNullTerm() = default;
~PaddedOutputString() = default;
CharArrayNullTerm(const CharArrayNullTerm& rhs) = default;
CharArrayNullTerm(CharArrayNullTerm&& rhs) = default;
PaddedOutputString(const PaddedOutputString& rhs) = default;
PaddedOutputString(PaddedOutputString&& rhs) = default;
CharArrayNullTerm& operator=(const CharArrayNullTerm& rhs) = default;
CharArrayNullTerm& operator=(CharArrayNullTerm&& rhs) = default;
PaddedOutputString& operator=(const PaddedOutputString& rhs) = default;
PaddedOutputString& operator=(PaddedOutputString&& rhs) = default;
/// Assign from \code std::string \endcode.
CharArrayNullTerm& operator=(const std::string& s)
PaddedOutputString& operator=(const std::string& s)
{
this->clear();
this->copy_in(s.data(), s.size());
@@ -99,5 +99,5 @@ namespace Opm { namespace RestartIO { namespace Helpers {
}
};
}}} // Opm::RestartIO::Helpers
#endif // CHARARRAY_HEADER
}} // Opm::EclIO
#endif // OPM_PADDEDOUTPUTSTRING_HEADER_HPP

View File

@@ -0,0 +1,66 @@
/*
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 RST_CONNECTION
#define RST_CONNECTION
#include <array>
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Connection.hpp>
namespace Opm {
class UnitSystem;
namespace RestartIO {
class Header;
struct RstConnection {
RstConnection(const ::Opm::UnitSystem& unit_system, const int* icon, const float* scon, const double *xcon);
int insert_index;
std::array<int,3> ijk;
Connection::State state;
int drain_sat_table;
int imb_sat_table;
int completion;
Connection::Direction dir;
int segment;
float tran;
float depth;
float diameter;
float kh;
float segdist_end;
float segdist_start;
double oil_rate;
double water_rate;
double gas_rate;
double pressure;
double resv_rate;
};
}
}
#endif

View File

@@ -0,0 +1,84 @@
/*
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 RST_GROUP
#define RST_GROUP
#include <array>
#include <vector>
#include <string>
namespace Opm {
class UnitSystem;
namespace RestartIO {
struct RstHeader;
struct RstGroup {
RstGroup(const UnitSystem& unit_system,
const std::string* zwel,
const int * igrp,
const float * sgrp,
const double * xgrp);
std::string name;
float oil_rate_limit;
float water_rate_limit;
float gas_rate_limit;
float liquid_rate_limit;
float water_surface_limit;
float water_reservoir_limit;
float water_reinject_limit;
float water_voidage_limit;
float gas_surface_limit;
float gas_reservoir_limit;
float gas_reinject_limit;
float gas_voidage_limit;
double oil_production_rate;
double water_production_rate;
double gas_production_rate;
double liquid_production_rate;
double water_injection_rate;
double gas_injection_rate;
double wct;
double gor;
double oil_production_total;
double water_production_total;
double gas_production_total;
double voidage_production_total;
double water_injection_total;
double gas_injection_total;
double oil_production_potential;
double water_production_potential;
double history_total_oil_production;
double history_total_water_production;
double history_total_water_injection;
double history_total_gas_production;
double history_total_gas_injection;
};
}
}
#endif

View File

@@ -0,0 +1,127 @@
/*
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 RST_HEADER
#define RST_HEADER
#include <vector>
#include <ctime>
#include <cstddef>
namespace Opm {
namespace RestartIO {
struct RstHeader {
RstHeader(const std::vector<int>& intehead, const std::vector<bool>& logihead, const std::vector<double>& doubhead);
int nx;
int ny;
int nz;
int nactive;
int num_wells;
int ncwmax;
int max_wells_in_group;
int max_groups_in_field;
int max_wells_in_field;
int year;
int month;
int mday;
int hour;
int minute;
int microsecond;
int phase_sum;
int niwelz;
int nswelz;
int nxwelz;
int nzwelz;
int niconz;
int nsconz;
int nxconz;
int nigrpz;
int nsgrpz;
int nxgrpz;
int nzgrpz;
int ncamax;
int niaaqz;
int nsaaqz;
int nxaaqz;
int nicaqz;
int nscaqz;
int nacaqz;
int tstep;
int report_step;
int newtmx;
int newtmn;
int litmax;
int litmin;
int mxwsit;
int mxwpit;
int version;
int iprog;
int nsegwl;
int nswlmx;
int nsegmx;
int nlbrmx;
int nisegz;
int nrsegz;
int nilbrz;
int ntfip ;
int nmfipr;
int nrfreg;
int ntfreg;
int nplmix;
int ngroup;
bool e300_radial;
bool e100_radial;
bool enable_hysteris;
bool enable_msw;
bool is_live_oil;
bool is_wet_gas;
bool const_comp_oil;
bool dir_relperm;
bool reversible_relperm;
bool endscale;
bool dir_eps;
bool reversible_eps;
bool alt_eps;
double next_timestep1;
double next_timestep2;
double max_timestep;
double guide_rate_a;
double guide_rate_b;
double guide_rate_c;
double guide_rate_d;
double guide_rate_e;
double guide_rate_f;
double udq_range;
double udq_undefined;
double udq_eps;
std::pair<std::time_t, std::size_t> restart_info() const;
};
}
}
#endif

View File

@@ -0,0 +1,78 @@
/*
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 RST_SEGMENT
#define RST_SEGMENT
#include <vector>
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/icd.hpp>
namespace Opm {
class UnitSystem;
namespace RestartIO {
struct RstSegment {
RstSegment(const ::Opm::UnitSystem& unit_system, const int* iseg, const double * rseg);
int segment;
int outlet_segment;
int branch;
Segment::SegmentType segment_type;
int icd_scaling_mode;
ICDStatus icd_status;
double dist_outlet;
double outlet_dz;
double diameter;
double roughness;
double area;
double volume;
double dist_bhp_ref;
double bhp_ref_dz;
double total_flow;
double water_flow_fraction;
double gas_flow_fraction;
double pressure;
double valve_length;
double valve_area;
double valve_flow_coeff;
double valve_max_area;
double base_strength;
double fluid_density;
double fluid_viscosity;
double critical_water_fraction;
double transition_region_width;
double max_emulsion_ratio;
double max_valid_flow_rate;
double icd_length;
double valve_area_fraction;
std::vector<int> inflow_segments;
};
}
}
#endif

View File

@@ -0,0 +1,90 @@
/*
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 RST_STATE
#define RST_STATE
#include <vector>
#include <string>
#include <opm/io/eclipse/ERst.hpp>
#include <opm/io/eclipse/rst/header.hpp>
#include <opm/io/eclipse/rst/group.hpp>
#include <opm/io/eclipse/rst/well.hpp>
namespace Opm {
class UnitSystem;
namespace RestartIO {
struct RstState {
RstState(const ::Opm::UnitSystem& unit_system,
const std::vector<int>& intehead,
const std::vector<bool>& logihead,
const std::vector<double>& doubhead,
const std::vector<std::string>& zgrp,
const std::vector<int>& igrp,
const std::vector<float>& sgrp,
const std::vector<double>& xgrp,
const std::vector<std::string>& zwel,
const std::vector<int>& iwel,
const std::vector<float>& swel,
const std::vector<double>& xwel,
const std::vector<int>& icon,
const std::vector<float>& scon,
const std::vector<double>& xcon);
RstState(const ::Opm::UnitSystem& unit_system,
const std::vector<int>& intehead,
const std::vector<bool>& logihead,
const std::vector<double>& doubhead,
const std::vector<std::string>& zgrp,
const std::vector<int>& igrp,
const std::vector<float>& sgrp,
const std::vector<double>& xgrp,
const std::vector<std::string>& zwel,
const std::vector<int>& iwel,
const std::vector<float>& swel,
const std::vector<double>& xwel,
const std::vector<int>& icon,
const std::vector<float>& scon,
const std::vector<double>& xcon,
const std::vector<int>& iseg,
const std::vector<double>& rseg);
static RstState load(EclIO::ERst& rst_file, int report_step);
const RstWell& get_well(const std::string& wname) const;
std::vector<RstWell> wells;
std::vector<RstGroup> groups;
RstHeader header;
private:
void add_groups(const ::Opm::UnitSystem& unit_system,
const std::vector<std::string>& zgrp,
const std::vector<int>& igrp,
const std::vector<float>& sgrp,
const std::vector<double>& xgrp);
};
}
}
#endif

124
opm/io/eclipse/rst/well.hpp Normal file
View File

@@ -0,0 +1,124 @@
/*
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 RST_WELL
#define RST_WELL
#include <array>
#include <vector>
#include <string>
#include <unordered_map>
#include <opm/io/eclipse/rst/connection.hpp>
#include <opm/io/eclipse/rst/segment.hpp>
namespace Opm {
class UnitSystem;
namespace RestartIO {
struct RstHeader;
struct RstWell {
RstWell(const ::Opm::UnitSystem& unit_system,
const RstHeader& header,
const std::string& group_arg,
const std::string* zwel,
const int * iwel,
const float * swel,
const double * xwel,
const int * icon,
const float * scon,
const double * xcon);
RstWell(const ::Opm::UnitSystem& unit_system,
const RstHeader& header,
const std::string& group_arg,
const std::string* zwel,
const int * iwel,
const float * swel,
const double * xwel,
const int * icon,
const float * scon,
const double * xcon,
const std::vector<int>& iseg,
const std::vector<double>& rseg);
std::string name;
std::string group;
std::array<int, 2> ij;
std::pair<int,int> k1k2;
int wtype;
int active_control;
int vfp_table;
int pred_requested_control;
bool allow_xflow;
int hist_requested_control;
int msw_index;
int completion_ordering;
float orat_target;
float wrat_target;
float grat_target;
float lrat_target;
float resv_target;
float thp_target;
float bhp_target_float;
float hist_lrat_target;
float hist_grat_target;
float hist_bhp_target;
float datum_depth;
double oil_rate;
double water_rate;
double gas_rate;
double liquid_rate;
double void_rate;
double flow_bhp;
double wct;
double gor;
double oil_total;
double water_total;
double gas_total;
double void_total;
double water_inj_total;
double gas_inj_total;
double gas_fvf;
double bhp_target_double;
double hist_oil_total;
double hist_wat_total;
double hist_gas_total;
double hist_water_inj_total;
double hist_gas_inj_total;
double water_void_rate;
double gas_void_rate;
const RstSegment segment(int segment_number) const;
std::vector<RstConnection> connections;
std::vector<RstSegment> segments;
};
}
}
#endif

View File

@@ -22,7 +22,7 @@
#include <string>
#include <boost/filesystem/path.hpp>
#include <opm/common/utility/FileSystem.hpp>
struct cJSON;
@@ -30,7 +30,7 @@ namespace Json {
class JsonObject {
public:
explicit JsonObject(const boost::filesystem::path& jsonFile );
explicit JsonObject(const Opm::filesystem::path& jsonFile );
explicit JsonObject(const std::string& inline_json);
explicit JsonObject(const char * inline_json);
explicit JsonObject(cJSON * root);

View File

@@ -0,0 +1,59 @@
/*
Copyright 2019 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_OUTPUT_AQUIFER_HPP
#define OPM_OUTPUT_AQUIFER_HPP
#include <map>
#include <memory>
#include <vector>
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
namespace Opm { namespace data {
/**
* Small struct that keeps track of data for output to restart/summary
* files.
*/
enum class AquiferType
{
Fetkovich, CarterTracey,
};
struct FetkovichData {
double initVolume;
double prodIndex;
double timeConstant;
};
struct AquiferData {
int aquiferID; //< One-based ID, range 1..NANAQ
double pressure; //< Aquifer pressure
double volume; //< Produced liquid volume
double initPressure; //< Aquifer's initial pressure
double datumDepth; //< Aquifer's pressure reference depth
AquiferType type;
std::shared_ptr<FetkovichData> aquFet;
};
}} // Opm::data
#endif // OPM_OUTPUT_AQUIFER_HPP

View File

@@ -69,6 +69,13 @@ namespace data {
UnitSystem::measure dim; //< Dimension of the data to write
std::vector<double> data; //< The actual data itself
TargetType target;
bool operator==(const CellData& cell2) const
{
return dim == cell2.dim &&
data == cell2.data &&
target == cell2.target;
}
};
}

View File

@@ -20,14 +20,18 @@
#ifndef OPM_OUTPUT_WELLS_HPP
#define OPM_OUTPUT_WELLS_HPP
#include <algorithm>
#include <cstddef>
#include <initializer_list>
#include <map>
#include <algorithm>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <unordered_map>
#include <vector>
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
namespace Opm {
namespace data {
@@ -56,6 +60,12 @@ namespace Opm {
reservoir_water = (1 << 8),
reservoir_oil = (1 << 9),
reservoir_gas = (1 << 10),
productivity_index_water = (1 << 11),
productivity_index_oil = (1 << 12),
productivity_index_gas = (1 << 13),
well_potential_water = (1 << 14),
well_potential_oil = (1 << 15),
well_potential_gas = (1 << 16),
};
using enum_size = std::underlying_type< opt >::type;
@@ -74,14 +84,16 @@ namespace Opm {
/// chaining.
inline Rates& set( opt m, double value );
/// true if any option is set; false otherwise
inline bool any() const noexcept;
/// Returns true if any of the rates oil, gas, water is nonzero
inline bool flowing() const;
template <class MessageBufferType>
void write(MessageBufferType& buffer) const;
template <class MessageBufferType>
void read(MessageBufferType& buffer);
bool operator==(const Rates& rat2) const;
private:
double& get_ref( opt );
const double& get_ref( opt ) const;
@@ -99,11 +111,17 @@ namespace Opm {
double reservoir_water = 0.0;
double reservoir_oil = 0.0;
double reservoir_gas = 0.0;
double productivity_index_water = 0.0;
double productivity_index_oil = 0.0;
double productivity_index_gas = 0.0;
double well_potential_water = 0.0;
double well_potential_oil = 0.0;
double well_potential_gas = 0.0;
};
struct Connection {
using global_index = size_t;
static const constexpr int restart_size = 2;
static const constexpr int restart_size = 6;
global_index index;
Rates rates;
@@ -114,12 +132,68 @@ namespace Opm {
double cell_saturation_gas;
double effective_Kh;
bool operator==(const Connection& conn2) const
{
return index == conn2.index &&
rates == conn2.rates &&
pressure == conn2.pressure &&
reservoir_rate == conn2.reservoir_rate &&
cell_pressure == conn2.cell_pressure &&
cell_saturation_water == conn2.cell_saturation_water &&
cell_saturation_gas == conn2.cell_saturation_gas &&
effective_Kh == conn2.effective_Kh;
}
template <class MessageBufferType>
void write(MessageBufferType& buffer) const;
template <class MessageBufferType>
void read(MessageBufferType& buffer);
};
struct Segment {
Rates rates;
double pressure;
std::size_t segNumber;
bool operator==(const Segment& seg2) const
{
return rates == seg2.rates &&
pressure == seg2.pressure &&
segNumber == seg2.segNumber;
}
template <class MessageBufferType>
void write(MessageBufferType& buffer) const;
template <class MessageBufferType>
void read(MessageBufferType& buffer);
};
struct CurrentControl {
bool isProducer{true};
::Opm::Well::ProducerCMode prod {
::Opm::Well::ProducerCMode::CMODE_UNDEFINED
};
::Opm::Well::InjectorCMode inj {
::Opm::Well::InjectorCMode::CMODE_UNDEFINED
};
bool operator==(const CurrentControl& rhs) const
{
return (this->isProducer == rhs.isProducer)
&& ((this->isProducer && (this->prod == rhs.prod)) ||
(!this->isProducer && (this->inj == rhs.inj)));
}
template <class MessageBufferType>
void write(MessageBufferType& buffer) const;
template <class MessageBufferType>
void read(MessageBufferType& buffer);
};
struct Well {
Rates rates;
double bhp;
@@ -127,12 +201,26 @@ namespace Opm {
double temperature;
int control;
std::vector< Connection > connections;
std::unordered_map<std::size_t, Segment> segments;
CurrentControl current_control;
inline bool flowing() const noexcept;
template <class MessageBufferType>
void write(MessageBufferType& buffer) const;
template <class MessageBufferType>
void read(MessageBufferType& buffer);
bool operator==(const Well& well2) const
{
return rates == well2.rates &&
bhp == well2.bhp &&
thp == well2.thp &&
temperature == well2.temperature &&
control == well2.control &&
connections == well2.connections &&
segments == well2.segments &&
current_control == well2.current_control;
}
};
@@ -187,10 +275,9 @@ namespace Opm {
this->emplace(name, well);
}
}
};
using Wells = WellRates;
using Wells = WellRates;
/* IMPLEMENTATIONS */
@@ -226,6 +313,28 @@ namespace Opm {
return *this;
}
inline bool Rates::operator==(const Rates& rate) const
{
return mask == rate.mask &&
wat == rate.wat &&
oil == rate.oil &&
gas == rate.gas &&
polymer == rate.polymer &&
solvent == rate.solvent &&
energy == rate.energy &&
dissolved_gas == rate.dissolved_gas &&
vaporized_oil == rate.vaporized_oil &&
reservoir_water == rate.reservoir_water &&
reservoir_oil == rate.reservoir_oil &&
reservoir_gas == rate.reservoir_gas &&
productivity_index_water == rate.productivity_index_water &&
productivity_index_gas == rate.productivity_index_gas &&
productivity_index_oil == rate.productivity_index_oil &&
well_potential_water == rate.well_potential_water &&
well_potential_oil == rate.well_potential_oil &&
well_potential_gas == rate.well_potential_gas;
}
/*
* To avoid error-prone and repetitve work when extending rates with new
@@ -249,6 +358,12 @@ namespace Opm {
case opt::reservoir_water: return this->reservoir_water;
case opt::reservoir_oil: return this->reservoir_oil;
case opt::reservoir_gas: return this->reservoir_gas;
case opt::productivity_index_water: return this->productivity_index_water;
case opt::productivity_index_oil: return this->productivity_index_oil;
case opt::productivity_index_gas: return this->productivity_index_gas;
case opt::well_potential_water: return this->well_potential_water;
case opt::well_potential_oil: return this->well_potential_oil;
case opt::well_potential_gas: return this->well_potential_gas;
}
throw std::invalid_argument(
@@ -264,12 +379,15 @@ namespace Opm {
);
}
inline bool Rates::any() const noexcept {
return static_cast< enum_size >( this->mask ) != 0;
bool inline Rates::flowing() const {
return ((this->wat != 0) ||
(this->oil != 0) ||
(this->gas != 0));
}
inline bool Well::flowing() const noexcept {
return this->rates.any();
return this->rates.flowing();
}
template <class MessageBufferType>
@@ -286,6 +404,12 @@ namespace Opm {
buffer.write(this->reservoir_water);
buffer.write(this->reservoir_oil);
buffer.write(this->reservoir_gas);
buffer.write(this->productivity_index_water);
buffer.write(this->productivity_index_oil);
buffer.write(this->productivity_index_gas);
buffer.write(this->well_potential_water);
buffer.write(this->well_potential_oil);
buffer.write(this->well_potential_gas);
}
template <class MessageBufferType>
@@ -300,6 +424,25 @@ namespace Opm {
buffer.write(this->effective_Kh);
}
template <class MessageBufferType>
void Segment::write(MessageBufferType& buffer) const {
buffer.write(this->segNumber);
this->rates.write(buffer);
buffer.write(this->pressure);
}
template <class MessageBufferType>
void CurrentControl::write(MessageBufferType& buffer) const
{
buffer.write(this->isProducer);
if (this->isProducer) {
buffer.write(this->prod);
}
else {
buffer.write(this->inj);
}
}
template <class MessageBufferType>
void Well::write(MessageBufferType& buffer) const {
this->rates.write(buffer);
@@ -311,6 +454,18 @@ namespace Opm {
buffer.write(size);
for (const Connection& comp : this->connections)
comp.write(buffer);
{
const auto nSeg =
static_cast<unsigned int>(this->segments.size());
buffer.write(nSeg);
for (const auto& seg : this->segments) {
seg.second.write(buffer);
}
}
this->current_control.write(buffer);
}
template <class MessageBufferType>
@@ -327,6 +482,12 @@ namespace Opm {
buffer.read(this->reservoir_water);
buffer.read(this->reservoir_oil);
buffer.read(this->reservoir_gas);
buffer.read(this->productivity_index_water);
buffer.read(this->productivity_index_oil);
buffer.read(this->productivity_index_gas);
buffer.read(this->well_potential_water);
buffer.read(this->well_potential_oil);
buffer.read(this->well_potential_gas);
}
template <class MessageBufferType>
@@ -341,6 +502,25 @@ namespace Opm {
buffer.read(this->effective_Kh);
}
template <class MessageBufferType>
void Segment::read(MessageBufferType& buffer) {
buffer.read(this->segNumber);
this->rates.read(buffer);
buffer.read(this->pressure);
}
template <class MessageBufferType>
void CurrentControl::read(MessageBufferType& buffer)
{
buffer.read(this->isProducer);
if (this->isProducer) {
buffer.read(this->prod);
}
else {
buffer.read(this->inj);
}
}
template <class MessageBufferType>
void Well::read(MessageBufferType& buffer) {
this->rates.read(buffer);
@@ -348,6 +528,8 @@ namespace Opm {
buffer.read(this->thp);
buffer.read(this->temperature);
buffer.read(this->control);
// Connection information
unsigned int size = 0.0; //this->connections.size();
buffer.read(size);
this->connections.resize(size);
@@ -356,9 +538,27 @@ namespace Opm {
auto& comp = this->connections[ i ];
comp.read(buffer);
}
// Segment information (if applicable)
const auto nSeg = [&buffer]() -> unsigned int
{
auto n = 0u;
buffer.read(n);
return n;
}();
for (auto segID = 0*nSeg; segID < nSeg; ++segID) {
auto seg = Segment{};
seg.read(buffer);
const auto segNumber = seg.segNumber;
this->segments.emplace(segNumber, std::move(seg));
}
this->current_control.read(buffer);
}
}
}
}} // Opm::data
#endif //OPM_OUTPUT_WELLS_HPP

View File

@@ -0,0 +1,122 @@
/*
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_Actionx_DATA_HPP
#define OPM_AGGREGATE_Actionx_DATA_HPP
#include <opm/output/eclipse/WindowedArray.hpp>
#include <opm/io/eclipse/PaddedOutputString.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQInput.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQDefine.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQActive.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQAssign.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQEnums.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParams.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunctionTable.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <cstddef>
#include <string>
#include <vector>
#include <map>
namespace Opm {
class Schedule;
class UDQInput;
class UDQActive;
} // Opm
namespace Opm { namespace RestartIO { namespace Helpers {
class AggregateActionxData
{
public:
explicit AggregateActionxData(const std::vector<int>& actDims);
void captureDeclaredActionxData( const Opm::Schedule& sched,
const Opm::SummaryState& st,
const std::vector<int>& actDims,
const std::size_t simStep);
const std::vector<int>& getIACT() const
{
return this->iACT_.data();
}
const std::vector<float>& getSACT() const
{
return this->sACT_.data();
}
const std::vector<EclIO::PaddedOutputString<8>>& getZACT() const
{
return this->zACT_.data();
}
const std::vector<EclIO::PaddedOutputString<8>>& getZLACT() const
{
return this->zLACT_.data();
}
const std::vector<EclIO::PaddedOutputString<8>>& getZACN() const
{
return this->zACN_.data();
}
const std::vector<int>& getIACN() const
{
return this->iACN_.data();
}
const std::vector<double>& getSACN() const
{
return this->sACN_.data();
}
private:
/// Aggregate 'IACT' array (Integer) for all ACTIONX data (9 integers pr UDQ)
WindowedArray<int> iACT_;
/// Aggregate 'SACT' array (Integer) for all ACTIONX data (5 integers pr ACTIONX - currently all zero - meaning unknown)
WindowedArray<float> sACT_;
/// Aggregate 'ZACT' array (Character) for all ACTIONX data. (4 * 8 chars pr ACIONX keyword - name of Action)
WindowedArray<EclIO::PaddedOutputString<8>> zACT_;
/// Aggregate 'ZLACT' array (Character) for all Actionx data. (max 16 * 8 characters pr line (default 80 chars pr line)
WindowedArray<EclIO::PaddedOutputString<8>> zLACT_;
/// Aggregate 'ZACN' array (Character) for all Actionx data (length equal to max no of conditions pr Actionx * the number of Actiox kwords)
WindowedArray<EclIO::PaddedOutputString<8>> zACN_;
/// Aggregate 'IACN' array (Integer) for all Actionx data (length 26* the max number of conditoins pr Actionx * the number of Actionx kwords)
WindowedArray<int> iACN_;
/// Aggregate 'SACN' array (Integer) for all Actionx data (16 * max number of Actionx conditions)
WindowedArray<double> sACN_;
};
}}} // Opm::RestartIO::Helpers
#endif //OPM_AGGREGATE_WELL_DATA_HPP

View File

@@ -0,0 +1,75 @@
/*
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_AGGREGATE_CONNECTION_DATA_HPP
#define OPM_AGGREGATE_CONNECTION_DATA_HPP
#include <opm/output/eclipse/WindowedArray.hpp>
#include <cstddef>
#include <string>
#include <vector>
namespace Opm {
class EclipseGrid;
class Schedule;
class UnitSystem;
} // Opm
namespace Opm { namespace data {
class WellRates;
}}
namespace Opm { namespace RestartIO { namespace Helpers {
class AggregateConnectionData
{
public:
explicit AggregateConnectionData(const std::vector<int>& inteHead);
void captureDeclaredConnData(const Opm::Schedule& sched,
const Opm::EclipseGrid& grid,
const Opm::UnitSystem& units,
const Opm::data::WellRates& xw,
const std::size_t sim_step);
const std::vector<int>& getIConn() const
{
return this->iConn_.data();
}
const std::vector<float>& getSConn() const
{
return this->sConn_.data();
}
const std::vector<double>& getXConn() const
{
return this->xConn_.data();
}
private:
WindowedMatrix<int> iConn_;
WindowedMatrix<float> sConn_;
WindowedMatrix<double> xConn_;
};
}}} // Opm::RestartIO::Helpers
#endif // OPM_AGGREGATE_CONNECTION_DATA_HPP

View File

@@ -0,0 +1,169 @@
/*
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_GROUP_DATA_HPP
#define OPM_AGGREGATE_GROUP_DATA_HPP
#include <opm/output/eclipse/WindowedArray.hpp>
#include <opm/io/eclipse/PaddedOutputString.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp>
#include <cstddef>
#include <string>
#include <vector>
#include <map>
namespace Opm {
class Schedule;
class SummaryState;
//class Group;
class UnitSystem;
} // Opm
namespace Opm { namespace RestartIO { namespace Helpers {
class AggregateGroupData
{
public:
explicit AggregateGroupData(const std::vector<int>& inteHead);
void captureDeclaredGroupData(const Opm::Schedule& sched,
const Opm::UnitSystem& units,
const std::size_t simStep,
const Opm::SummaryState& sumState,
const std::vector<int>& inteHead);
const std::vector<int>& getIGroup() const
{
return this->iGroup_.data();
}
const std::vector<float>& getSGroup() const
{
return this->sGroup_.data();
}
const std::vector<double>& getXGroup() const
{
return this->xGroup_.data();
}
const std::vector<EclIO::PaddedOutputString<8>>& getZGroup() const
{
return this->zGroup_.data();
}
const std::vector<std::string> restart_group_keys = {"GOPP", "GWPP", "GOPR", "GWPR", "GGPR",
"GVPR", "GWIR", "GGIR", "GWCT", "GGOR",
"GOPT", "GWPT", "GGPT", "GVPT", "GWIT",
"GGIT",
"GOPTH", "GWPTH", "GGPTH",
"GWITH", "GGITH"};
const std::vector<std::string> restart_field_keys = {"FOPP", "FWPP", "FOPR", "FWPR", "FGPR",
"FVPR", "FWIR", "FGIR", "FWCT", "FGOR",
"FOPT", "FWPT", "FGPT", "FVPT", "FWIT",
"FGIT",
"FOPTH", "FWPTH", "FGPTH",
"FWITH", "FGITH"};
const std::map<std::string, size_t> groupKeyToIndex = {
{"GOPR", 0},
{"GWPR", 1},
{"GGPR", 2},
{"GVPR", 3},
{"GWIR", 5},
{"GGIR", 6},
{"GWCT", 8},
{"GGOR", 9},
{"GOPT", 10},
{"GWPT", 11},
{"GGPT", 12},
{"GVPT", 13},
{"GWIT", 15},
{"GGIT", 16},
{"GOPP", 22},
{"GWPP", 23},
{"GOPTH", 135},
{"GWPTH", 139},
{"GWITH", 140},
{"GGPTH", 143},
{"GGITH", 144},
};
using inj_cmode_enum = Opm::Group::InjectionCMode;
const std::map<inj_cmode_enum, int> cmodeToNum = {
{inj_cmode_enum::NONE, 0},
{inj_cmode_enum::RATE, 1},
{inj_cmode_enum::RESV, 2},
{inj_cmode_enum::REIN, 3},
{inj_cmode_enum::VREP, 4},
{inj_cmode_enum::FLD, 0},
{inj_cmode_enum::SALE, 0},
};
const std::map<std::string, size_t> fieldKeyToIndex = {
{"FOPR", 0},
{"FWPR", 1},
{"FGPR", 2},
{"FVPR", 3},
{"FWIR", 5},
{"FGIR", 6},
{"FWCT", 8},
{"FGOR", 9},
{"FOPT", 10},
{"FWPT", 11},
{"FGPT", 12},
{"FVPT", 13},
{"FWIT", 15},
{"FGIT", 16},
{"FOPP", 22},
{"FWPP", 23},
{"FOPTH", 135},
{"FWPTH", 139},
{"FWITH", 140},
{"FGPTH", 143},
{"FGITH", 144},
};
private:
/// Aggregate 'IWEL' array (Integer) for all wells.
WindowedArray<int> iGroup_;
/// Aggregate 'SWEL' array (Real) for all wells.
WindowedArray<float> sGroup_;
/// Aggregate 'XWEL' array (Double Precision) for all wells.
WindowedArray<double> xGroup_;
/// Aggregate 'ZWEL' array (Character) for all wells.
WindowedArray<EclIO::PaddedOutputString<8>> zGroup_;
/// Maximum number of wells in a group.
int nWGMax_;
/// Maximum number of groups
int nGMaxz_;
};
}}} // Opm::RestartIO::Helpers
#endif // OPM_AGGREGATE_WELL_DATA_HPP

View File

@@ -0,0 +1,115 @@
/*
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_MSW_DATA_HPP
#define OPM_AGGREGATE_MSW_DATA_HPP
#include <opm/output/data/Wells.hpp>
#include <opm/output/eclipse/WindowedArray.hpp>
#include <string>
#include <vector>
namespace Opm {
class Phases;
class Schedule;
class EclipseGrid;
class UnitSystem;
class SummaryState;
} // Opm
namespace Opm { namespace RestartIO { namespace Helpers {
struct BranchSegmentPar {
int outletS;
int noSegInBranch;
int firstSeg;
int lastSeg;
int branch;
};
struct SegmentSetSourceSinkTerms {
std::vector<double> qosc;
std::vector<double> qwsc;
std::vector<double> qgsc;
};
struct SegmentSetFlowRates {
std::vector<double> sofr;
std::vector<double> swfr;
std::vector<double> sgfr;
};
class AggregateMSWData
{
public:
explicit AggregateMSWData(const std::vector<int>& inteHead);
void captureDeclaredMSWData(const Opm::Schedule& sched,
const std::size_t rptStep,
const Opm::UnitSystem& units,
const std::vector<int>& inteHead,
const Opm::EclipseGrid& grid,
const Opm::SummaryState& smry,
const Opm::data::WellRates& wr
);
/// Retrieve Integer Multisegment well data Array.
const std::vector<int>& getISeg() const
{
return this->iSeg_.data();
}
/// Retrieve Double precision segment data Array.
const std::vector<double>& getRSeg() const
{
return this->rSeg_.data();
}
/// Retrieve Integer multisegment well data Array for lateral branches (ILBS)
const std::vector<int>& getILBs() const
{
return this->iLBS_.data();
}
/// Retrieve Integer multisegment well data Array for lateral branches (ILBR)
const std::vector<int>& getILBr() const
{
return this->iLBR_.data();
}
private:
/// Aggregate 'ISEG' array (Integer) for all multisegment wells
WindowedArray<int> iSeg_;
/// Aggregate 'RSEG' array (Double) for all multisegment wells
WindowedArray<double> rSeg_;
/// Aggregate 'ILBS' array (Integer) for all multisegment wells
WindowedArray<int> iLBS_;
/// Aggregate 'ILBR' array (Integer) for all multisegment wells
WindowedArray<int> iLBR_;
};
}}} // Opm::RestartIO::Helpers
#endif // OPM_AGGREGATE_WELL_DATA_HPP

View File

@@ -0,0 +1,142 @@
/*
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_UDQ_DATA_HPP
#define OPM_AGGREGATE_UDQ_DATA_HPP
#include <opm/output/eclipse/WindowedArray.hpp>
#include <opm/io/eclipse/PaddedOutputString.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQInput.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQDefine.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQActive.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQAssign.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQEnums.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParams.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunctionTable.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <cstddef>
#include <string>
#include <vector>
#include <map>
namespace Opm {
class Schedule;
class UDQInput;
class UDQActive;
} // Opm
namespace Opm { namespace RestartIO { namespace Helpers {
class igphData {
public:
const std::vector<int> ig_phase(const Opm::Schedule& sched, const std::size_t simStep, const std::vector<int>& inteHead);
};
class AggregateUDQData
{
public:
explicit AggregateUDQData(const std::vector<int>& udqDims);
void captureDeclaredUDQData(const Opm::Schedule& sched,
const std::size_t simStep,
const Opm::SummaryState& st,
const std::vector<int>& inteHead);
const std::vector<int>& getIUDQ() const
{
return this->iUDQ_.data();
}
const std::vector<int>& getIUAD() const
{
return this->iUAD_.data();
}
const std::vector<EclIO::PaddedOutputString<8>>& getZUDN() const
{
return this->zUDN_.data();
}
const std::vector<EclIO::PaddedOutputString<8>>& getZUDL() const
{
return this->zUDL_.data();
}
const std::vector<int>& getIGPH() const
{
return this->iGPH_.data();
}
const std::vector<int>& getIUAP() const
{
return this->iUAP_.data();
}
const std::vector<double>& getDUDW() const
{
return this->dUDW_.data();
}
const std::vector<double>& getDUDG() const
{
return this->dUDG_.data();
}
const std::vector<double>& getDUDF() const
{
return this->dUDF_.data();
}
private:
/// Aggregate 'IUDQ' array (Integer) for all UDQ data (3 integers pr UDQ)
WindowedArray<int> iUDQ_;
/// Aggregate 'IUAD' array (Integer) for all UDQ data (5 integers pr UDQ that is used for various well and group controls)
WindowedArray<int> iUAD_;
/// Aggregate 'ZUDN' array (Character) for all UDQ data. (2 * 8 chars pr UDQ -> UNIT keyword)
WindowedArray<EclIO::PaddedOutputString<8>> zUDN_;
/// Aggregate 'ZUDL' array (Character) for all UDQ data. (16 * 8 chars pr UDQ DEFINE "Data for operation - Msth Expression)
WindowedArray<EclIO::PaddedOutputString<8>> zUDL_;
/// Aggregate 'IGPH' array (Integer) for all UDQ data (3 - zeroes - as of current understanding)
WindowedArray<int> iGPH_;
/// Aggregate 'IUAP' array (ICharArrayNullTermnteger) for all UDQ data (1 integer pr UDQ constraint used)
WindowedArray<int> iUAP_;
/// Aggregate 'DUDW' array (Double Precision) for all UDQ data. (Dimension = max no wells * noOfUDQ's)
WindowedArray<double> dUDW_;
/// Aggregate 'DUDG' array (Double Precision) for all UDQ data. (Dimension = (max no groups + 1) * noOfUDQ's)
WindowedArray<double> dUDG_;
/// Aggregate 'DUDF' array (Double Precision) for all UDQ data. (Dimension = Number of FU - UDQ's, with value equal to the actual constraint)
WindowedArray<double> dUDF_;
};
}}} // Opm::RestartIO::Helpers
#endif //OPM_AGGREGATE_WELL_DATA_HPP

View File

@@ -20,9 +20,11 @@
#ifndef OPM_AGGREGATE_WELL_DATA_HPP
#define OPM_AGGREGATE_WELL_DATA_HPP
#include <opm/output/eclipse/CharArrayNullTerm.hpp>
#include <opm/output/eclipse/WindowedArray.hpp>
#include <opm/io/eclipse/PaddedOutputString.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Action/ActionResult.hpp>
#include <cstddef>
#include <string>
#include <vector>
@@ -38,15 +40,22 @@ namespace Opm { namespace data {
}} // Opm::data
namespace Opm { namespace RestartIO { namespace Helpers {
struct ActionResStatus {
std::vector<Opm::Action::Result> result;
std::vector<std::string> name;
};
class AggregateWellData
{
public:
explicit AggregateWellData(const std::vector<int>& inteHead);
void captureDeclaredWellData(const Opm::Schedule& sched,
const Opm::UnitSystem& units,
const std::size_t sim_step);
void captureDeclaredWellData(const Schedule& sched,
const UnitSystem& units,
const std::size_t sim_step,
const ::Opm::SummaryState& smry,
const std::vector<int>& inteHead);
void captureDynamicWellData(const Opm::Schedule& sched,
const std::size_t sim_step,
@@ -72,11 +81,13 @@ namespace Opm { namespace RestartIO { namespace Helpers {
}
/// Retrieve Character Well Data Array.
const std::vector<CharArrayNullTerm<8>>& getZWell() const
const std::vector<EclIO::PaddedOutputString<8>>& getZWell() const
{
return this->zWell_.data();
}
private:
/// Aggregate 'IWEL' array (Integer) for all wells.
WindowedArray<int> iWell_;
@@ -88,7 +99,7 @@ namespace Opm { namespace RestartIO { namespace Helpers {
WindowedArray<double> xWell_;
/// Aggregate 'ZWEL' array (Character) for all wells.
WindowedArray<CharArrayNullTerm<8>> zWell_;
WindowedArray<EclIO::PaddedOutputString<8>> zWell_;
/// Maximum number of groups in model.
int nWGMax_;

View File

@@ -25,8 +25,9 @@
#include <vector>
namespace Opm {
class Tuning;
struct Tuning;
class Schedule;
class UDQParams;
}
namespace Opm { namespace RestartIO {
@@ -39,6 +40,17 @@ namespace Opm { namespace RestartIO {
std::chrono::duration<double, std::chrono::seconds::period> elapsed;
};
struct guideRate {
double A;
double B;
double C;
double D;
double E;
double F;
double delay;
double damping_fact;
};
DoubHEAD();
~DoubHEAD() = default;
@@ -49,13 +61,17 @@ namespace Opm { namespace RestartIO {
DoubHEAD& operator=(DoubHEAD&& rhs) = default;
DoubHEAD& tuningParameters(const Tuning& tuning,
const std::size_t lookup_step,
const double cnvT);
DoubHEAD& timeStamp(const TimeStamp& ts);
DoubHEAD& nextStep(const double nextTimeStep);
DoubHEAD& drsdt(const Schedule& sched,
const std::size_t lookup_step);
const std::size_t lookup_step,
const double cnvT);
DoubHEAD& udq_param(const UDQParams& udqPar);
DoubHEAD& guide_rate_param(const guideRate& guide_rp);
const std::vector<double>& data() const
{

View File

@@ -23,10 +23,9 @@
#define OPM_ECLIPSE_WRITER_HPP
#include <map>
#include <memory>
#include <string>
#include <vector>
#include <array>
#include <memory>
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/NNC.hpp>
@@ -36,11 +35,16 @@
#include <opm/output/data/Wells.hpp>
#include <opm/output/eclipse/RestartValue.hpp>
namespace Opm { namespace out {
class Summary;
}} // namespace Opm::out
namespace Opm {
class EclipseState;
class SummaryConfig;
class Schedule;
class SummaryConfig;
class SummaryState;
/*!
* \brief A class to write the reservoir state and the well state of a
@@ -170,14 +174,12 @@ public:
* hardcoded static map misc_units in Summary.cpp.
*/
void writeTimeStep( int report_step,
void writeTimeStep( const SummaryState& st,
int report_step,
bool isSubstep,
double seconds_elapsed,
RestartValue value,
const std::map<std::string, double>& single_summary_values,
const std::map<std::string, std::vector<double>>& region_summary_values,
const std::map<std::pair<std::string, int>, double>& block_summary_values,
bool write_double = false);
const bool write_double = false);
/*
@@ -218,8 +220,8 @@ public:
missing, if the bool is false missing keywords will be ignored
(there will *not* be an empty vector in the return value).
*/
RestartValue loadRestart(const std::vector<RestartKey>& solution_keys, const std::vector<RestartKey>& extra_keys = {}) const;
RestartValue loadRestart(SummaryState& summary_state, const std::vector<RestartKey>& solution_keys, const std::vector<RestartKey>& extra_keys = {}) const;
const out::Summary& summary();
EclipseIO( const EclipseIO& ) = delete;
~EclipseIO();

View File

@@ -25,20 +25,22 @@
#include <memory>
#include <vector>
namespace Opm { namespace RestartIO {
namespace Opm {
class UnitSystem;
namespace RestartIO {
class InteHEAD
{
public:
enum class UnitSystem {
Metric, Field, Lab, PVT_M
};
struct WellTableDim {
int numWells;
int maxPerf;
int maxWellInGroup;
int maxGroupInField;
int maxWellsInField;
};
struct WellSegDims {
@@ -85,7 +87,31 @@ namespace Opm { namespace RestartIO {
int mxwsit;
int mxwpit;
};
struct Group {
int ngroups;
};
struct UdqParam {
int udqParam_1;
int no_wudqs;
int no_gudqs;
int no_fudqs;
int no_iuads;
int no_iuaps;
};
struct ActionParam {
int no_actions;
int max_no_sched_lines_per_action;
int max_no_conditions_per_action;
int max_no_characters_per_line;
};
struct GuideRateNominatedPhase {
int nominated_phase;
};
InteHEAD();
~InteHEAD() = default;
@@ -106,12 +132,19 @@ namespace Opm { namespace RestartIO {
InteHEAD& params_NWELZ(const int niwelz, const int nswelz, const int nxwelz, const int nzwelz);
InteHEAD& params_NCON(const int niconz, const int nsconz, const int nxconz);
InteHEAD& params_GRPZ(const std::array<int, 4>& grpz);
InteHEAD& params_NGCTRL(const int gct);
InteHEAD& params_NAAQZ(const int ncamax, const int niaaqz, const int nsaaqz, const int nxaaqz, const int nicaqz, const int nscaqz, const int nacaqz);
InteHEAD& stepParam(const int tstep, const int report_step);
InteHEAD& tuningParam(const TuningPar& tunpar);
InteHEAD& variousParam(const int version, const int iprog);
InteHEAD& wellSegDimensions(const WellSegDims& wsdim);
InteHEAD& regionDimensions(const RegDims& rdim);
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);
const std::vector<int>& data() const
{

View File

@@ -1,4 +1,5 @@
/*
Copyright 2019 Equinor.
Copyright 2017 Statoil ASA.
This file is part of the Open Porous Media project (OPM).
@@ -35,6 +36,8 @@ namespace Opm {
public:
/// Constructor.
///
/// Padded table entries set to +1.0e+20.
///
/// \param[in] numTables Number of tables managed by internal
/// buffer. Typically corresponds to maximum value of a region
/// ID vector such as SATNUM, IMBNUM, or PVTNUM.
@@ -57,6 +60,33 @@ namespace Opm {
const std::size_t numRows,
const std::size_t numCols);
/// Constructor.
///
/// \param[in] numTables Number of tables managed by internal
/// buffer. Typically corresponds to maximum value of a region
/// ID vector such as SATNUM, IMBNUM, or PVTNUM.
///
/// \param[in] numPrimary Number of primary look-up keys for the
/// tabular data managed by the internal buffer. Mostly relevant
/// (i.e., greater than one) for miscible oil ("PVTO") or
/// miscible gas ("PVTG") tables and typically corresponds to the
/// number of Rs/Rv entries from the TABDIMS keyword.
///
/// \param[in] numRows Number of rows in each sub-table
/// corresponding to a single primary look-up key. Typically the
/// number of nodes (e.g., NSSFUN or NPPVT) of the corresponding
/// input keyword.
///
/// \param[in] numCols Number of columns in each sub-table (and main
/// table). Typically 5.
///
/// \param[in] fillValue Data element value for padded table entries.
LinearisedOutputTable(const std::size_t numTables,
const std::size_t numPrimary,
const std::size_t numRows,
const std::size_t numCols,
const double fillValue);
/// Retrieve iterator to start of \c numRows (contiguous) column
/// elements of a particular sub-table of a particular main table.
///

View File

@@ -1,4 +1,5 @@
/*
Copyright 2019 Equinor ASA.
Copyright 2016, 2017 Statoil ASA.
This file is part of the Open Porous Media Project (OPM).
@@ -27,6 +28,49 @@ namespace Opm { namespace RestartIO {
class LogiHEAD
{
public:
/// Key characteristics of simulation run's PVT model.
struct PVTModel
{
/// Whether or not simulation run uses a live oil model (with
/// dissolved gas).
bool isLiveOil { false };
/// Whether or not simulation run uses a wet gas model (with
/// vaporised oil).
bool isWetGas { false };
/// Whether or not simulation run uses a constant
/// compressibility oil model (keyword PVCDO).
bool constComprOil { false };
};
/// Key characteristics of simulation model's saturation functions.
struct SatfuncFlags
{
/// Whether or not simulation run uses directionally dependent
/// relative permeability.
bool useDirectionalRelPerm { false };
/// Whether or not simulation run uses reversible relative
/// permeability functions.
bool useReversibleRelPerm { true };
/// Whether or not simulation run uses end-point scaling.
bool useEndScale { false };
/// Whether or not simulation run uses directionally dependent
/// end-point scaling.
bool useDirectionalEPS { false };
/// Whether or not simulation run uses reversible end-point
/// scaling.
bool useReversibleEPS { true };
/// Whether or not simulation run activates the alternative
/// (three-point) end-point scaling feature.
bool useAlternateEPS { false };
};
LogiHEAD();
~LogiHEAD() = default;
@@ -38,7 +82,24 @@ namespace Opm { namespace RestartIO {
LogiHEAD& variousParam(const bool e300_radial,
const bool e100_radial,
const int nswlmx);
const int nswlmx,
const bool enableHyster
);
/// Assign PVT model characteristics.
///
/// \param[in] pvt Current run's PVT model characteristics.
///
/// \return \code *this \endcode.
LogiHEAD& pvtModel(const PVTModel& pvt);
/// Assign saturation function characteristics.
///
/// \param[in] satfunc Current run's saturation function
/// characteristics.
///
/// \return \code *this \endcode.
LogiHEAD& saturationFunction(const SatfuncFlags& satfunc);
const std::vector<bool>& data() const
{

View File

@@ -23,7 +23,6 @@
#include <vector>
namespace Opm {
class Eclipse3DProperties;
class Schedule;
class EclipseGrid;
@@ -31,7 +30,7 @@ namespace out {
class RegionCache {
public:
RegionCache() = default;
RegionCache(const Eclipse3DProperties& properties, const EclipseGrid& grid, const Schedule& schedule);
RegionCache(const std::vector<int>& fipnum, const EclipseGrid& grid, const Schedule& schedule);
const std::vector<std::pair<std::string,size_t>>& connections( int region_id ) const;
private:

View File

@@ -1,4 +1,5 @@
/*
Copyright (c) 2018 Equinor ASA
Copyright (c) 2016 Statoil ASA
Copyright (c) 2013-2015 Andreas Lauser
Copyright (c) 2013 SINTEF ICT, Applied Mathematics.
@@ -23,35 +24,30 @@
#ifndef RESTART_IO_HPP
#define RESTART_IO_HPP
#include <vector>
#include <map>
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
#include <opm/parser/eclipse/EclipseState/Runspec.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp>
#include <opm/output/data/Cells.hpp>
#include <opm/output/data/Solution.hpp>
#include <opm/output/data/Wells.hpp>
#include <opm/output/eclipse/RestartValue.hpp>
#include <ert/ecl/EclKW.hpp>
#include <ert/ecl/ecl_rsthead.h>
#include <ert/ecl/ecl_rst_file.h>
#include <ert/util/util.h>
#include <opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp>
#include <string>
#include <utility>
#include <vector>
namespace Opm {
class EclipseGrid;
class EclipseState;
class Phases;
class Schedule;
class EclipseGrid;
class EclipseState;
class Schedule;
namespace RestartIO {
} // namespace Opm
namespace Opm { namespace EclIO { namespace OutputStream {
class Restart;
}}}
/*
The two loose functions RestartIO::save() and RestartIO::load() can
The two free functions RestartIO::save() and RestartIO::load() can
be used to save and load reservoir and well state from restart
files. Observe that these functions 'just do it', i.e. the checking
of which report step to load from, if output is enabled at all and
@@ -68,28 +64,31 @@ namespace RestartIO {
load("CASE.X0010" , 99 , ...)
save("CASE.X0010" , 99 , ...)
will read and write to the file "CASE.X0010" - completely ignoring
will read from and write to the file "CASE.X0010" - completely ignoring
the report step argument '99'.
*/
namespace Opm { namespace RestartIO {
void save(const std::string& filename,
int report_step,
double seconds_elapsed,
RestartValue value,
const EclipseState& es,
const EclipseGrid& grid,
const Schedule& schedule,
bool write_double = false);
void save(EclIO::OutputStream::Restart& rstFile,
int report_step,
double seconds_elapsed,
RestartValue value,
const EclipseState& es,
const EclipseGrid& grid,
const Schedule& schedule,
const SummaryState& sumState,
bool write_double = false);
RestartValue load( const std::string& filename,
int report_step,
const std::vector<RestartKey>& solution_keys,
const EclipseState& es,
const EclipseGrid& grid,
const Schedule& schedule,
const std::vector<RestartKey>& extra_keys = {});
RestartValue load(const std::string& filename,
int report_step,
SummaryState& summary_state,
const std::vector<RestartKey>& solution_keys,
const EclipseState& es,
const EclipseGrid& grid,
const Schedule& schedule,
const std::vector<RestartKey>& extra_keys = {});
}
}
#endif
}} // namespace Opm::RestartIO
#endif // RESTART_IO_HPP

View File

@@ -18,23 +18,27 @@
#ifndef RESTART_VALUE_HPP
#define RESTART_VALUE_HPP
#include <string>
#include <map>
#include <string>
#include <utility>
#include <vector>
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
#include <opm/output/data/Aquifer.hpp>
#include <opm/output/data/Solution.hpp>
#include <opm/output/data/Wells.hpp>
namespace Opm {
class RestartKey {
public:
std::string key;
UnitSystem::measure dim;
bool required;
bool required = false;
RestartKey() = default;
RestartKey( const std::string& _key, UnitSystem::measure _dim)
: key(_key),
@@ -49,31 +53,46 @@ namespace Opm {
required(_required)
{}
bool operator==(const RestartKey& key2) const
{
return key == key2.key &&
dim == key2.dim &&
required == key2.required;
}
};
/*
A simple class used to communicate values between the simulator and the
RestartIO function.
A simple class used to communicate values between the simulator and
the RestartIO functions.
*/
class RestartValue {
public:
using ExtraVector = std::vector<std::pair<RestartKey, std::vector<double>>>;
data::Solution solution;
data::Wells wells;
ExtraVector extra;
std::vector<data::AquiferData> aquifer;
RestartValue(data::Solution sol, data::Wells wells_arg);
RestartValue() {}
bool hasExtra(const std::string& key) const;
void addExtra(const std::string& key, UnitSystem::measure dimension, std::vector<double> data);
void addExtra(const std::string& key, std::vector<double> data);
const std::vector<double>& getExtra(const std::string& key) const;
void convertFromSI(const UnitSystem& units);
void convertToSI(const UnitSystem& units);
bool operator==(const RestartValue& val2) const
{
return solution == val2.solution &&
wells == val2.wells &&
extra == val2.extra;
}
};
}
#endif
#endif // RESTART_VALUE_HPP

View File

@@ -20,62 +20,59 @@
#ifndef OPM_OUTPUT_SUMMARY_HPP
#define OPM_OUTPUT_SUMMARY_HPP
#include <map>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <ert/ecl/ecl_sum.h>
#include <ert/ecl/Smspec.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
#include <opm/output/eclipse/SummaryState.hpp>
#include <opm/output/data/Wells.hpp>
#include <opm/output/eclipse/RegionCache.hpp>
namespace Opm {
class EclipseGrid;
class EclipseState;
class Schedule;
class SummaryConfig;
class EclipseGrid;
class Schedule;
class SummaryState;
} // namespace Opm
namespace out {
namespace Opm { namespace data {
class WellRates;
}} // namespace Opm::data
namespace Opm { namespace out {
class Summary {
public:
Summary( const EclipseState&, const SummaryConfig&, const EclipseGrid&, const Schedule& );
Summary( const EclipseState&, const SummaryConfig&, const EclipseGrid&, const Schedule&, const std::string& );
Summary( const EclipseState&, const SummaryConfig&, const EclipseGrid&, const Schedule&, const char* basename );
public:
using GlobalProcessParameters = std::map<std::string, double>;
using RegionParameters = std::map<std::string, std::vector<double>>;
using BlockValues = std::map<std::pair<std::string, int>, double>;
void add_timestep(int report_step,
double secs_elapsed,
const EclipseState& es,
const Schedule& schedule,
const data::Wells&,
const std::map<std::string, double>& single_values,
const std::map<std::string, std::vector<double>>& region_values = {},
const std::map<std::pair<std::string, int>, double>& block_values = {});
Summary(const EclipseState& es,
const SummaryConfig& sumcfg,
const EclipseGrid& grid,
const Schedule& sched,
const std::string& basename = "");
void write();
~Summary();
~Summary();
void add_timestep(const SummaryState& st, const int report_step);
const SummaryState& get_restart_vectors() const;
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 GlobalProcessParameters& single_values,
const RegionParameters& region_values = {},
const BlockValues& block_values = {}) const;
private:
class keyword_handlers;
void write() const;
const EclipseGrid& grid;
out::RegionCache regionCache;
ERT::ert_unique_ptr< ecl_sum_type, ecl_sum_free > ecl_sum;
std::unique_ptr< keyword_handlers > handlers;
double prev_time_elapsed = 0;
SummaryState prev_state;
private:
class SummaryImplementation;
std::unique_ptr<SummaryImplementation> pImpl_;
};
}
}
}} // namespace Opm::out
#endif //OPM_OUTPUT_SUMMARY_HPP

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