Compare commits

...

2560 Commits

Author SHA1 Message Date
Bård Skaflestad
fbfeba9b2e Raise OPM Version to 2020.10-rc3 2020-10-29 23:38:57 +01:00
Bård Skaflestad
3448c9c4ec Merge pull request #2061 from OPM/backport-of-pr-2038
[cmake] Use scotch include dir for parmetis bindings of scotch.
2020-10-28 13:57:42 +01:00
Markus Blatt
4bb23ecf5a [cmake] Use scotch include dir for parmetis bindings of scotch.
The parmetis.h distributed via the parmetis binding of scotch
with Ubuntu 18.04 (libscotchparmetis-dev) includes the header
scotch.h located in /usr/include/scotch/. Therefore our check
of the include file failed. With this commit we check the
parmetis.h header another time with the scotch include path added.
Now parmetis is found on my Ubuntu.
2020-10-28 13:48:57 +01:00
Bård Skaflestad
2ba39f875c Merge pull request #2057 from OPM/summary-bugfixes
Summary bugfixes
2020-10-27 14:30:29 +01:00
Bård Skaflestad
705930a5ca Don't Treat WPIL as Completion Keyword
WPIL is the productivity index of liquid (water + oil).
2020-10-27 10:12:13 +01:00
Joakim Hove
465a3447c7 Summary function glir should sum over all argument wells 2020-10-27 10:11:20 +01:00
Bård Skaflestad
a1080f8361 Bump version to 2020.10-rc1 2020-10-19 10:29:03 +02:00
Joakim Hove
6e82f3cb7a Merge pull request #2021 from joakim-hove/no-wells-message
No wells message
2020-10-14 14:23:24 +02:00
Joakim Hove
7f8578ea96 Merge pull request #2020 from joakim-hove/fmwia
Fmwia
2020-10-14 14:22:38 +02:00
Joakim Hove
21d44c09e0 Merge pull request #2019 from joakim-hove/vfpprod-dimension
Dimension string does not accept space
2020-10-14 12:15:49 +02:00
Joakim Hove
e3959c5fa1 Implement number of abondoned injectors: FMWIA 2020-10-14 08:43:03 +02:00
Joakim Hove
2d036144cc Raise OpmInputError for unbalanced quotes 2020-10-14 08:40:10 +02:00
Joakim Hove
2ebc15e8d4 Fix message format for invalid wellname pattern 2020-10-14 08:15:07 +02:00
Joakim Hove
dd34f2d831 Maintain whether a well has ever injected 2020-10-14 00:39:48 +02:00
Joakim Hove
e1698f7be8 Rename test well RFT -> RFTP 2020-10-14 00:12:50 +02:00
Joakim Hove
47c4f5c2e0 Dimension string does not accept space 2020-10-13 22:19:49 +02:00
Joakim Hove
d0416d963d Merge pull request #2017 from joakim-hove/rst-commits
Rst commits
2020-10-13 15:12:21 +02:00
Joakim Hove
53fe0f2d11 Add guide rate delay and damping to rst header class 2020-10-13 13:11:04 +02:00
Joakim Hove
ead5a19209 Extract update of guide rate model into separate function 2020-10-13 09:52:33 +02:00
Joakim Hove
94c697ccd0 Load boolean flag to indicate whether group control is active 2020-10-13 09:52:33 +02:00
Joakim Hove
60c406397b Merge pull request #2015 from bska/record-new-connstructure
Record Event if WellConnections Change
2020-10-12 18:24:54 +02:00
Bård Skaflestad
6f20858d73 Record Event if WellConnections Change
This is different from COMPLETION_CHANGE which is unconditionally
recorded when processing COMPDAT.  This event is recorded only when
the Well's internal WellConnections structure actually changes and
informs clients that they may need to rerun any dynamic WELPI
scaling.  Such scaling will not be automatically forwarded onto the
new WellConnections structure.

This is arguably a hack.
2020-10-12 15:10:28 +02:00
Bård Skaflestad
5852270035 Merge pull request #2014 from bska/fix-oob-indexing
Ensure *HEAD Arrays Have Sufficient Size
2020-10-12 14:52:38 +02:00
Bård Skaflestad
810a93ba87 Ensure *HEAD Arrays Have Sufficient Size
The regression test program depends on this.
2020-10-12 13:49:53 +02:00
Bård Skaflestad
b0b8523b2a Merge pull request #2013 from joakim-hove/schedule-msg
Schedule msg
2020-10-12 11:47:47 +02:00
Bård Skaflestad
6708273616 Merge pull request #2007 from joakim-hove/rst-cmp
Use restart object in regression testing
2020-10-12 11:47:09 +02:00
Joakim Hove
206243c78d Compare string and integere members from well using RestartIO data 2020-10-12 10:11:07 +02:00
Joakim Hove
8f90bf9387 Refactor the log messages emitted while creating the Schedule object
A maximum of N dates keywords are printed to stdout, afterwards logging will
only go to PRT file
2020-10-12 09:59:04 +02:00
Joakim Hove
db052055b2 Merge pull request #2011 from joakim-hove/grid-msg
Grid msg
2020-10-10 10:30:36 +02:00
Joakim Hove
32ac90cb5e Add messages about grid creation 2020-10-10 08:30:48 +02:00
Joakim Hove
36e03cf6b9 Use ParserKeyword::prohibits for COORD / GDFILE / ZCORN 2020-10-10 08:30:48 +02:00
Joakim Hove
fa65ce92d8 Allow loading of RstState for restart files without wells 2020-10-09 15:32:45 +02:00
Bård Skaflestad
79ad189d65 Merge pull request #2008 from joakim-hove/schedule-error-msg
Schedule error msg
2020-10-09 12:30:01 +02:00
Joakim Hove
d3a44ca543 Add proper error message for ill formed dates keyword 2020-10-09 11:40:15 +02:00
Joakim Hove
b273ef389a Make sure strings are joined - remove "," 2020-10-09 11:23:41 +02:00
Joakim Hove
c6068f4e17 Merge pull request #2006 from joakim-hove/keyword-interaction
Keyword interaction
2020-10-08 17:48:28 +02:00
Joakim Hove
a8b510334e Merge pull request #2002 from bska/welpi
Add Support Infrastructure for WELPI Feature
2020-10-08 17:48:03 +02:00
Bård Skaflestad
70ef0858f7 Store WELPI Scaling Eligibility as Per-Connection Flag
Greatly simplifies logic in container class (WellConnection).

Suggested by: [at]joakim-hove
2020-10-08 11:19:04 +02:00
Bård Skaflestad
f384269133 Represent Assigned PI as an optional<>
Suggested by: [at]joakim-hove
2020-10-08 11:19:04 +02:00
Bård Skaflestad
a077847f69 Create Fully Non-Defaulted Serialization Test Objects
Suggested by [at]akva2.
2020-10-08 11:19:03 +02:00
Bård Skaflestad
fa7d8bc28c Add Support Infrastructure for WELPI Feature
This commit adds logic implementing the static parts of the WELPI
keyword.  We internalize the keyword data, record appropriate events
and provide hooks for dynamically adjusting the per-connection
transmissibility factor (Connection::CF()) when those events occur.
We implement support at three levels

  - WellConnections:
    Add new public member functions prepareWellPIScaling and
    applyWellPIScaling which, respectively, creates bookkeeping
    data to track those connections which are subject to CF scaling
    and actually applies that CF scaling.

  - Well:
    Add new data member 'productivity_index' which holds the 'WELPI'
    data value from the input keyword (converted to SI) and new
    member functions updateWellProductivityIndex and
    applyWellProdIndexScaling.  The first follows the 'update*'
    protocol (return 'true' if state change) and assigns new values
    to 'productivity_index' while the second uses the stored PI
    value and a dynamically calculated effective PI value to rescale
    the pertinent connections' CF value.

  - Schedule:
    Add new member function handleWELPI which internalizes the WELPI
    keyword and its data and records WELPI events for subsequent
    playback in the simulator layer.

Also add a set of unit tests to exercise the new features at all
levels.
2020-10-08 11:19:03 +02:00
Bård Skaflestad
de5e3d90cd Miscellaneous Cleanup Changes
In particular, include standard library headers as needed, fix
function declarations (operator<<() for Well::WellProductionProperties),
and make a few helper functions 'static' to avoid warnings of the
form "no previous declaration for".

For the Schedule's keyword handlers, also switch to storing member
function pointers directly instead of std::function objects.  This
saves space and does not incur function pointer conversions.  Use
std::invoke to call those handlers to avoid having to spell out the
'->*' operator.
2020-10-08 11:19:03 +02:00
Bård Skaflestad
36e3a25782 Use Explicit Powers of Two for Events Enumerators
Suggested by [at]joakim-hove
2020-10-08 11:19:03 +02:00
Bård Skaflestad
cc22c3bcf3 Remove Duplicated Logic in filterConnections
The Schedule::filterConnections() member function contained three
copies of the same loop, possibly as a result of earlier conflict
resolution.  Remove two of those loops.
2020-10-08 11:19:03 +02:00
Joakim Hove
732f19d2a2 Merge pull request #2003 from joakim-hove/rst-group2
Establish group <-> group relationship when loading from restartfile
2020-10-08 10:59:15 +02:00
Joakim Hove
7b19d9a20a Add prohibits relation DX <-> DXV and DY <-> DYV 2020-10-08 08:45:23 +02:00
Joakim Hove
bb7941b754 Add keyword requires relationship between TRACERKM and PARTTRAC 2020-10-08 08:40:36 +02:00
Joakim Hove
0dcb31cae5 Use Group constructor when loading from restart file 2020-10-08 08:15:32 +02:00
Joakim Hove
fa24394f69 Establish group <-> group relationship when loading from restartfile 2020-10-08 08:13:17 +02:00
Joakim Hove
cc4f8faa4c Merge pull request #2005 from bska/wellconnections-empty
Add Convenience Predicate WellConnections::empty
2020-10-08 08:05:15 +02:00
Bård Skaflestad
a5a18fea9e Add Convenience Predicate WellConnections::empty
Replace expressions comparing size() to 0 with calls to empty().
2020-10-07 22:29:18 +02:00
Bård Skaflestad
e2da49d028 Merge pull request #2004 from joakim-hove/rst-wellopen
Rst wellopen
2020-10-07 21:37:44 +02:00
Joakim Hove
f02ecb472f Store Value::Shut == -1000 for shut wells in IWEL 2020-10-07 18:38:46 +02:00
Joakim Hove
956dce6be6 rebase fixup 2020-10-07 18:30:38 +02:00
Joakim Hove
00d5421153 Load well status from IWEL when loading restart file 2020-10-07 18:28:11 +02:00
Joakim Hove
a33fd2483f Updates to well control mode reported in IWEL
With this commit the IWEL[ActWCtrl] is assigned a value independently of the
wells OPEN / SHUT status.

With this PR the index enum value Status is used instead of the previously used
item11. Also numerical constants are introduced for eclipse status values for
Shut, Stop, Open and Auto.
2020-10-07 18:28:11 +02:00
Joakim Hove
23faea7b81 Merge pull request #1996 from wito/required-keywords
Required and Prohibited Keywords
2020-10-07 09:06:42 +02:00
Joakim Hove
efbfbaa90c Merge pull request #1999 from joakim-hove/rst-cmode
Rst cmode
2020-10-07 09:05:58 +02:00
Atgeirr Flø Rasmussen
de5e91c80c Merge pull request #2001 from atgeirr/silence-warnings
Fix struct/class warning.
2020-10-06 19:32:35 +02:00
Atgeirr Flø Rasmussen
a56eb48b85 Fix struct/class warning. 2020-10-06 15:54:11 +02:00
Joakim Hove
20e253a27a Merge pull request #1997 from joakim-hove/group-constructor
Add Group constructor based on RstGroup
2020-10-06 14:52:31 +02:00
Bård Skaflestad
7823045b02 Merge pull request #1995 from bska/prepare-dynamic-ctf
Summary/Restart: Get CTF From Simulator
2020-10-06 14:32:07 +02:00
Joakim Hove
1ec834dd71 Add Group constructor based on RstGroup 2020-10-06 13:16:33 +02:00
Williham Williham Totland
90d980a4f6 Adds manipulation of the ParseContext to tests. 2020-10-06 09:58:46 +02:00
Bård Skaflestad
b1abbe831a Merge pull request #2000 from akva2/janitoring
fixed: anonymize globals to avoid shadowing warnings
2020-10-06 08:54:51 +02:00
Arne Morten Kvarving
62c067f462 fixed: anonymize globals to avoid shadowing warnings 2020-10-06 08:23:11 +02:00
Bård Skaflestad
d65b83c28b Rename Top-Level Loop Function
Suggested by [at]joakim-hove
2020-10-05 23:34:01 +02:00
Bård Skaflestad
4956e880a4 Summary/Restart: Get CTF From Simulator
This commit switches to getting the output files' connection
transmissibility factor from Opm::data::Connection instead of
Opm::Connection.  This is in preparation for implementing the WELPI
feature, in which the CTFs are occasionally adjusted based on the
dynamic simulation state.
2020-10-05 23:34:01 +02:00
Bård Skaflestad
e92d6138f8 Refactor Connection Loop Function
In particular, split out the connection loop from the well loop, and
don't make a copy of the wells when we already have a Schedule
object and a "sim_step".
2020-10-05 23:34:01 +02:00
Bård Skaflestad
33d09936c3 Merge pull request #1719 from GitPaean/aquifer_keywords
adding aquifer summary keywords
2020-10-05 22:49:32 +02:00
Kai Bao
5c33c39495 addressing reviewing comments for OPM/opm-common#1719
using std::any_of instead of std::find_if
2020-10-05 20:55:06 +02:00
Joakim Hove
be898b5534 Merge pull request #1989 from wito/tablemanager-exceptions
Implements OpmInputError in TableManager
2020-10-05 17:02:42 +02:00
Joakim Hove
f9a52791a4 Load Water and gas Injection cmode from restart file 2020-10-05 15:23:09 +02:00
Joakim Hove
96fdb150b1 Use named index WInjCMode and GInjCMode 2020-10-05 15:23:02 +02:00
Joakim Hove
001b399d42 Change order of is_field() test 2020-10-05 15:13:37 +02:00
Joakim Hove
acfd917aab Add production control mode for restart group 2020-10-05 15:06:04 +02:00
Joakim Hove
08f41d4fa2 Add named index ProdCMode for IGRP 2020-10-05 15:06:01 +02:00
Williham Williham Totland
91e863e674 Resolves issue where test data was missing for Eclipse300. 2020-10-05 13:52:09 +02:00
Williham Williham Totland
7aba0cd976 Implements required and prohibited keywords. 2020-10-05 13:34:35 +02:00
Bård Skaflestad
fcdc57d92b Merge pull request #1994 from joakim-hove/rst-alq
Small Changes in restart <-> Schedule interaction
2020-10-05 13:07:15 +02:00
Williham Williham Totland
bd3242fe05 Adds getters/setters for required and prohibited keywords. 2020-10-05 11:37:18 +02:00
Williham Williham Totland
f610ce28a2 Adds test data. 2020-10-05 11:20:56 +02:00
Williham Williham Totland
c43600337b Throws exception with nesting, and generalises tests to account for same. 2020-10-05 11:06:19 +02:00
Joakim Hove
b9b55bb9b0 Early return in productionGroup() 2020-10-05 10:44:38 +02:00
Joakim Hove
ce463e6020 Extract functions for production and injection when creating IGRP 2020-10-05 10:44:33 +02:00
Joakim Hove
296538c724 Minor rewrite for checking group type 2020-10-05 09:31:02 +02:00
Williham Williham Totland
d0c5fa042c Adjusts the defaultMessage format string. 2020-10-05 09:26:25 +02:00
Williham Williham Totland
7a8347f1ab Unifies interface of OpmInputError::OpmInputError() 2020-10-05 08:26:51 +02:00
Kai Bao
aa639869be adding the development to test ANALYTICAL_AQUIFERS 2020-10-05 07:37:13 +02:00
Williham Williham Totland
690fa8259c Resolves an issue where the keyword information would not be reflected in the error message. 2020-10-05 07:28:07 +02:00
Williham Williham Totland
fca1764d7a Resolves #1975. 2020-10-05 07:28:07 +02:00
Joakim Hove
0f21752a7e Add test for unsupported keyword in FieldProps operations 2020-10-05 07:28:07 +02:00
Williham Williham Totland
3af6fac35d Adds a standard-format exception message to OpmInputError. 2020-10-05 07:28:07 +02:00
Williham Williham Totland
65f45b60a8 Extends OpmInputError to support multiple KeywordLocations. 2020-10-05 07:28:07 +02:00
Williham Williham Totland
0f8dec9ac3 Changes TableManager to throw OpmInputError where context permits. 2020-10-05 07:28:07 +02:00
Kai Bao
31e5c494a8 adding aquifer keywords to the summary_ALL test in SummaryConfigTests 2020-10-05 00:28:11 +02:00
Kai Bao
995316e97c handling unknown aquifer in SUMMARY section 2020-10-05 00:27:28 +02:00
Joakim Hove
47715ae7ae Move function in source file 2020-10-04 16:01:37 +02:00
Joakim Hove
f8d988d1dd Rename variable gseqIndex -> insert_index 2020-10-04 16:01:22 +02:00
Joakim Hove
aa54bc67de Load group->parent_group when loading from restart file 2020-10-04 16:00:50 +02:00
Joakim Hove
5b3a76172b Store parent_group index when loading restart group 2020-10-04 16:00:15 +02:00
Joakim Hove
c2522fd5ce Create symbol for IGRP parent group index 2020-10-04 15:59:53 +02:00
Joakim Hove
007ef0e94f Load well alq value when loading from restart file 2020-10-04 15:33:20 +02:00
Joakim Hove
528548ebce Set predictionMode for Injection and Production objects 2020-10-04 15:33:18 +02:00
Joakim Hove
00cb2c195d Merge pull request #1993 from alfbr/remove-supported
Remove confusing message
2020-10-04 09:34:03 +02:00
Alf Birger Rustad
2dee1070ef Remove confusing message 2020-10-03 17:17:13 +02:00
Kai Bao
e86e8796ec adding a small test for aquifer keywords 2020-10-02 22:32:23 +02:00
Kai Bao
2c0456da8a fixing the keyword generation for ALL related to Aquifer keywords 2020-10-02 22:27:47 +02:00
Joakim Hove
b9b6033854 Merge pull request #1987 from joakim-hove/arrraydimchecker-fixup
Fix bug in ArradDimChecker message
2020-10-02 18:20:54 +02:00
Joakim Hove
26bc6cb2ea Merge pull request #1980 from joakim-hove/time-keyword-info-logging
Time keyword info logging
2020-10-02 18:20:12 +02:00
Joakim Hove
574547a824 Merge pull request #1985 from joakim-hove/create-grid-info
Create grid info
2020-10-02 18:19:45 +02:00
Bård Skaflestad
99b2920e5e Merge pull request #1990 from bska/fix-oob-alq-indexing
ALQ Rate: Don't Index Into Empty Vector
2020-10-02 17:41:49 +02:00
Bård Skaflestad
447efffdfa ALQ Rate: Don't Index Into Empty Vector
The list of "schedule" wells is empty in at least one case-when
we're configuring the SMSPEC nodes.  Don't blindly assume that there
is always a non-empty sequence of wells.
2020-10-02 16:30:08 +02:00
Tor Harald Sandve
8210bcde34 Merge pull request #1968 from hakonhagland/wglir
Add support for WGLIR.
2020-10-02 14:48:18 +02:00
Kai Bao
6093a80dff fixing the compilation due to interface change 2020-10-02 14:09:01 +02:00
Kai Bao
fd773423b0 adding the following aquifer summary keywords
AAQR, AAQT, AAQP
2020-10-02 13:18:51 +02:00
Joakim Hove
1529509efb Improve error message: WELLDIMS item 4 can be wells/groups 2020-10-02 12:18:52 +02:00
Joakim Hove
1206570da5 Edit msg 2020-10-02 10:30:37 +02:00
Williham Williham Totland
4c016660d8 Logs simulation time advance information (level: info). 2020-10-02 10:30:37 +02:00
Joakim Hove
b3050cfbf5 Fix bug in ArradDimChecker message 2020-10-02 10:03:45 +02:00
Joakim Hove
0ab50fbc95 Merge pull request #1977 from wito/test-warning-noise-fix
Test Compilation Warning Noise Fix
2020-10-02 07:56:14 +02:00
Markus Blatt
2f96b9404f Merge pull request #1986 from joakim-hove/remove-template-args
Remove leftover template<...>
2020-10-01 21:07:58 +02:00
Joakim Hove
c0336d5eb7 Remove leftover template<...> 2020-10-01 16:59:50 +02:00
Joakim Hove
963ab6515a Add info message for grid creation 2020-10-01 15:30:19 +02:00
Joakim Hove
54088db22f Update warning for MULTREGT in EDIT section 2020-10-01 15:30:19 +02:00
Joakim Hove
3d0ff98865 Add log message for Fault construction 2020-10-01 15:30:19 +02:00
Joakim Hove
5fe9b6476e Use this-> 2020-10-01 15:30:19 +02:00
Joakim Hove
ad993fb82c Add log info message for tracer loading 2020-10-01 15:30:19 +02:00
Joakim Hove
27687ecc9e Initialize tracer configuration in initialization list 2020-10-01 15:30:19 +02:00
Joakim Hove
2d2d25fbec Add log message for Aquifer creation / initialization 2020-10-01 15:30:19 +02:00
Joakim Hove
ac39fa099b Use fmt::format for message 2020-10-01 15:30:19 +02:00
Joakim Hove
96ce078dfd Merge pull request #1983 from joakim-hove/private-fmt
Mkae sure fmtlib is not a dependency in the public api
2020-10-01 15:24:15 +02:00
Joakim Hove
fbf88e8ce1 Merge pull request #1984 from joakim-hove/remove-value
Remove homemade optional - use std::optional
2020-10-01 15:23:55 +02:00
Joakim Hove
6dc84b67df Remove homemade optional - use std::optional 2020-10-01 13:53:58 +02:00
Joakim Hove
0475ccdb77 Merge pull request #1978 from joakim-hove/schedule-skriprest-refactor
Changes in schedule iterate section for restarts
2020-10-01 07:47:50 +02:00
Joakim Hove
5f45f20be6 Merge pull request #1982 from blattms/fix-some-valgrind-warnings
Fix some warnings when running with valgrinds MPI wrapper.
2020-09-30 19:43:30 +02:00
Markus Blatt
d99aa0d497 Fix some warnings when running with valgrinds MPI wrapper.
It warns whenever uninitialized data is sent.
2020-09-30 18:26:48 +02:00
Joakim Hove
8c351440e8 Mkae sure fmtlib is not a dependency in the public api 2020-09-30 18:17:57 +02:00
Joakim Hove
26f91f0ce0 Merge pull request #1981 from akva2/janitoring
Some janitoring
2020-09-30 14:45:11 +02:00
Arne Morten Kvarving
f2d80014ab anonymize unused parameter 2020-09-30 10:09:15 +02:00
Arne Morten Kvarving
27dc014244 remove unused variables 2020-09-30 10:09:08 +02:00
Joakim Hove
42f1278db3 Changes in restart TimeMap and Schedule::iterateSection
This commit changes two aspects of restarts where well and group information is
assembled from the restart file:

 o We require the restart date to be present in the Schedule file as a DATES
   keyword.

 o SKIPREST behavior is implemented unconditionally for restarts with restart
   files, even if the SKIPREST keyword is not present.
2020-09-29 23:00:16 +02:00
Joakim Hove
1ae7026a4b Merge pull request #1946 from joakim-hove/parsecontext-opm-error
Parsecontext opm error
2020-09-29 22:15:04 +02:00
Håkon Hægland
7db5d2fd5c Added WGLIR to SummaryConfigTests.cpp 2020-09-29 15:52:28 +02:00
Joakim Hove
8e247ca6e8 Use new ParseCOntext signature 2020-09-29 15:37:14 +02:00
Joakim Hove
2a812ab7ce Use OpmInputError 2020-09-29 15:37:14 +02:00
Joakim Hove
a44b174b6b Remove info messages from Schedule 2020-09-29 15:37:14 +02:00
Alf Birger Rustad
a86cfd21d8 Shortened reading line to make more space for path 2020-09-29 15:37:14 +02:00
Joakim Hove
0512ab88b4 ParseContext will throw OpmInputError 2020-09-29 15:37:14 +02:00
Håkon Hægland
ce4f2a157b Fixed typo in operator==() 2020-09-29 15:33:59 +02:00
Håkon Hægland
56ab32035a Added support for ALQ in the serialization.
Added support for ALQ in operator==() and Rates::read().
2020-09-29 15:33:59 +02:00
Håkon Hægland
7a4c5cd1c1 Changed "rate" to "gas_surface_rate" 2020-09-29 15:33:59 +02:00
Håkon Hægland
124097abdc Added FGLIR and GGLIR. 2020-09-29 15:33:59 +02:00
Håkon Hægland
ae6ea4699e Added WGLIR to SummaryConfig.cpp 2020-09-29 15:33:59 +02:00
Håkon Hægland
10a9a5707c Add support for WGLIR.
Add support for summary output of WGLIR (lift gas injection rate).
2020-09-29 15:33:59 +02:00
Williham Williham Totland
6d2f8cca5c Adds type information to integer literals. 2020-09-29 13:54:21 +02:00
Joakim Hove
e01400fa18 Add KeywordLocation argument to ParseContext::handleError() 2020-09-29 09:56:07 +02:00
Joakim Hove
94b4c509b1 Add KeywordLocation argument to UDQ parser 2020-09-29 09:56:07 +02:00
Joakim Hove
e8423d3b25 Merge pull request #1969 from wito/keyword-handler-try-catch
Exception Catch and Release
2020-09-29 09:54:41 +02:00
Joakim Hove
751e25ff97 Merge pull request #1963 from joakim-hove/tran-calc-condense
Tran calc condense
2020-09-29 09:34:28 +02:00
Joakim Hove
a8e3ecef7d Merge pull request #1974 from totto82/fixRocktab
Set number of columns in ROCKTAB to three
2020-09-29 06:57:48 +02:00
Bård Skaflestad
d55d05e552 Merge pull request #1884 from goncalvesmachadoc/outputProdEnergy
Add WEPT and WEPR to Summary
2020-09-28 21:52:53 +02:00
Joakim Hove
8848fde48e Collapse multi record operations on TRAN in one operation
The main content of this commit is that for keywords with multiple TRAN
modifications like

  MULTIPLY
     TRANX 1.50 1 10 1 10 1 1 /
     TRANX 2.50 1 10 1 10 2 2 /
  /

The different operations are collapes to one entry in tran calculator.

This commit also explicitly throws a std::logic_error() exception if TRAN
manipulations are attempted with the OPERATE keyword or one of the region
keywords ADDREG, MULTIREG, EQUALREG or OPERATER.
2020-09-28 21:44:21 +02:00
Tor Harald Sandve
fc7ccd1603 Set number of columns in ROCKTAB to three
Throw if unsuppored directional and stress option is used
2020-09-28 20:54:19 +02:00
Joakim Hove
de61bdefff Merge pull request #1972 from asnyv/rtemp
UNTESTED: Added size: 1 to RTEMP and RTEMPA
2020-09-28 18:32:31 +02:00
Joakim Hove
8e8ba14397 Merge pull request #1973 from bska/uconv-static-tables-size-check
Unit Conversion Tables: Add Size Consistency Checking
2020-09-28 18:14:28 +02:00
Joakim Hove
f331add35b Merge pull request #1966 from joakim-hove/tran-calc-init
Tran calc init
2020-09-28 16:55:07 +02:00
Joakim Hove
5fbf725ea8 Merge pull request #1970 from blattms/make-tran-mod-tests-run
Make transmissibility modifier tests run
2020-09-28 16:54:08 +02:00
Williham Williham Totland
f5a3ab2cee Removes (stated) support for named arguments in OpmInputError::format due to UTR test failure. 2020-09-28 16:04:35 +02:00
Cintia Goncalves Machado
76a04c8e48 rebasing 2020-09-28 15:59:20 +02:00
Bård Skaflestad
b7418b419e Unit Conversion Tables: Add Size Consistency Checking
This commit adds a minimum amount of compile-time size checking for
the various arrays that go into defining the conversion factors and
unit strings.  Using static_assert() we guarantee that the arrays at
least have the expected size lest the translation unit fail to
compile.
2020-09-28 15:37:28 +02:00
Asgeir Nyvoll
74c3bf82fb Added size: 1 to RTEMP and RTEMPA 2020-09-28 14:27:22 +02:00
Bård Skaflestad
8d89d277cd Warn about network nodes without networks. 2020-09-28 14:05:40 +02:00
Joakim Hove
4b8b35e0f0 only warn about unknown summary nodes. 2020-09-28 14:04:39 +02:00
Williham Williham Totland
f76a71cbee Simplifies logging of error using formatException(). 2020-09-28 13:30:15 +02:00
Cintia Goncalves Machado
e23e229fda addCumToSummaryState 2020-09-28 13:21:19 +02:00
Cintia Goncalves Machado
4e3f5cd0ca addWTICHEA 2020-09-28 13:21:19 +02:00
Cintia Goncalves Machado
5032d28a0f addWTPCHEA 2020-09-28 13:21:19 +02:00
Cintia Goncalves Machado
af1043612a addWEIs 2020-09-28 13:21:19 +02:00
Cintia Goncalves Machado
72efad2a8f finalizeSummary 2020-09-28 13:21:19 +02:00
Cintia Goncalves Machado
dd4de4130a addEnergyRatetoUnitSystem 2020-09-28 13:21:19 +02:00
Cintia Goncalves Machado
4a721cffbb addWEPTandWEPRtoSummary 2020-09-28 13:21:18 +02:00
Williham Williham Totland
805300dd49 Adds some documentation to OpmInputError.hpp. 2020-09-28 13:16:45 +02:00
Williham Williham Totland
9a66acbb5d Extends OpmInputError to be initialisable from an existing exception. 2020-09-28 13:16:45 +02:00
Williham Williham Totland
742c90cabc Extends Opm::OpmInputError::OpmInputError() to accept additional format arguments. 2020-09-28 13:16:45 +02:00
Williham Williham Totland
7cb15bd64d Adds missing test_OpmInputError_format.cpp 2020-09-28 13:16:44 +02:00
Williham Williham Totland
2900da4489 Allow Opm::OpmInputError::format() to accept additional arguments.
This removes the need to call `fmt::format()` multiple times on a string, thus eliminating error-prone multi-level escapes when formatting strings.
2020-09-28 13:16:44 +02:00
Williham Williham Totland
05c3d997ac Catches and logs exceptions in Opm::Schedule::handleNormalKeyword() 2020-09-28 13:16:44 +02:00
Joakim Hove
3036441c8c Merge pull request #1967 from joakim-hove/throw-opm-error
Throw opm error
2020-09-28 12:50:36 +02:00
Joakim Hove
a4038b3d9e Wrap SummaryConfig construction in try catch 2020-09-28 11:29:27 +02:00
Joakim Hove
5b6e9f7c92 Wrap Schedule construction in try catch 2020-09-28 09:22:56 +02:00
Joakim Hove
1168e616cd Wrap EclipseState construction in try catch 2020-09-27 23:24:30 +02:00
Joakim Hove
c1ea966548 Add static function OpmInputError::format() 2020-09-27 22:14:53 +02:00
Joakim Hove
8c2ed38cf4 Parse differentiates between OpmInputError and std::exception 2020-09-27 22:00:37 +02:00
Joakim Hove
8e55f3138b Add multi record test 2020-09-27 10:16:32 +02:00
Joakim Hove
d57d9ea18f Utility function for operation dependent SI conversion 2020-09-27 10:16:32 +02:00
Joakim Hove
6de1067c45 Make sure to initialize FieldProps::keyword_info for assignment 2020-09-27 10:16:32 +02:00
Joakim Hove
b95fbc4919 Rewrite test to iterate over cartesian coordinates 2020-09-27 10:16:32 +02:00
Joakim Hove
42c711210e Remove stale struct FieldPropsManager::Meminfo 2020-09-27 10:16:32 +02:00
Joakim Hove
6ee4e5ce9a Merge pull request #1962 from wito/schedule-keyword-cleanup
Various Code Consistency Changes in Schedule.
2020-09-27 10:16:10 +02:00
Joakim Hove
66a9138006 Merge pull request #1965 from joakim-hove/rsm-cmp-eps
Increase the epsilon used for comparing summary and rsm files
2020-09-25 23:28:38 +02:00
Joakim Hove
ac4157a66c Increase the epsilon used for comparing summary and rsm files 2020-09-25 22:08:05 +02:00
Bård Skaflestad
83cfe4b50c Merge pull request #1964 from wito/iterator-reference-fix
Range Variable Correction
2020-09-25 18:22:44 +02:00
Williham Williham Totland
6a8f3e16c0 Corrects range variable to a reference. 2020-09-25 16:20:22 +02:00
Williham Williham Totland
2e8e613722 Makes use of braces consistent within if-else sections. 2020-09-25 15:10:23 +02:00
Williham Williham Totland
e8595a6076 Various whitespace fixes. 2020-09-25 15:07:20 +02:00
Williham Williham Totland
24296bf7ee Extracts variables that depend only on record to the outer loop. 2020-09-25 15:06:08 +02:00
Williham Williham Totland
e0344b828d Consts variables. 2020-09-25 15:06:08 +02:00
Williham Williham Totland
29bfdd00bf Extracts access that depend only on record to the outer loop. 2020-09-25 15:06:08 +02:00
Williham Williham Totland
cd93de5e12 Extracts variables that only depend on record to outer loop. 2020-09-25 15:06:08 +02:00
Williham Williham Totland
ad03a50536 Improves consistency of well_names phrase. 2020-09-25 15:06:08 +02:00
Williham Williham Totland
c19221eab8 Removes temporary variable name. 2020-09-25 15:06:08 +02:00
Williham Williham Totland
fab78873f2 Removes extraneous scope block. 2020-09-25 15:06:08 +02:00
Williham Williham Totland
461d8815a0 Normalises all occurences of size_t to std::size_t 2020-09-25 15:06:08 +02:00
Williham Williham Totland
1de3a84a53 Documents use of the keyword handler dispatcher. 2020-09-25 15:06:08 +02:00
Williham Williham Totland
56e8750d9e Removes extraneous scope blocks. 2020-09-25 15:06:08 +02:00
Williham Williham Totland
51a8d35788 Normalises if and for clause whitespace. 2020-09-25 15:06:08 +02:00
Williham Williham Totland
d5cd8cf78e Removes extraneous scope blocks. 2020-09-25 15:06:08 +02:00
Williham Williham Totland
6d6b10a9fa Normalises indentation and whitespace. 2020-09-25 15:06:08 +02:00
Williham Williham Totland
c17824cead Removes using namespace shortcuts. 2020-09-25 15:06:08 +02:00
Williham Williham Totland
0d962fc585 Removes some unnecessary includes. 2020-09-25 15:06:08 +02:00
Atgeirr Flø Rasmussen
fbe723a874 Merge pull request #1952 from joakim-hove/cir-negative
Cir negative
2020-09-25 14:06:22 +02:00
Joakim Hove
ab68722eca Merge pull request #1960 from wito/schedule-keyword-handlers
Moves keyword handlers from Schedule.cpp to KeywordHandlers.cpp
2020-09-25 13:45:05 +02:00
Joakim Hove
629b561f75 Merge pull request #1957 from totto82/salinity
Add keyword SALINITY with unit molality
2020-09-25 12:28:19 +02:00
Williham Williham Totland
86eb1bf94e Renames handleEXIT to applyEXIT. 2020-09-25 10:12:55 +02:00
Williham Williham Totland
5c49832cd1 Extracts keyword handlers into KeywordHandlers.cpp 2020-09-25 10:02:52 +02:00
Joakim Hove
003537ea77 Merge pull request #1959 from akva2/janitoring
add missing initializer to quell warning
2020-09-25 09:52:52 +02:00
Tor Harald Sandve
dfdb844d69 add SALINITY. Unit is molality [mol/kg] for all unit systems 2020-09-25 09:39:11 +02:00
Arne Morten Kvarving
617440485f remove unused variable 2020-09-25 09:21:09 +02:00
Arne Morten Kvarving
99a6fc30a1 throw to avoid no return value warning 2020-09-25 09:20:57 +02:00
Arne Morten Kvarving
50de318947 add missing initializer to quell warning 2020-09-25 09:18:46 +02:00
Joakim Hove
b6f192b7f2 Merge pull request #1958 from joakim-hove/smry-cmp-verbose
Add error message when comparing summary and rsm files
2020-09-25 08:50:32 +02:00
Joakim Hove
2985072083 Add error message when comparing summary and rsm files 2020-09-24 16:45:59 +02:00
Bård Skaflestad
3db68b0731 Merge pull request #1955 from jalvestad/rstfile-imp-v3t
Handle WSEGITER keyword data and WELSEGS keyword item 6 for Eclipse compatible restart file
2020-09-24 14:49:34 +02:00
Jostein Alvestad
1b488037e1 added / changed comments to well.hpp to clarify their meaning 2020-09-24 14:37:10 +02:00
Joakim Hove
b9f95089b9 Merge pull request #1949 from joakim-hove/error-prepare
Error prepare
2020-09-24 07:33:22 +02:00
Joakim Hove
c7d8d17bf0 Merge pull request #1938 from bska/support-nonmonotone-bo
Support Non-Monotonic Saturated Oil FVF in PVTO
2020-09-24 07:19:45 +02:00
Bård Skaflestad
1dd1b71095 PVTO: Switch to Using {fmt} Backend for Formatting
This commit switches the custom diagnostic message formatting based
on std::ostringstream to using a formatter implemented in terms of
the fmt::format function.  This removes the custom indentation from
earlier.  Note that we output at most four records to the console,
including a message limit notification if applicable, and that this
limit is currently not adjustable by the user.  We do on the other
hand output all flipped records to the .PRT file.

New Example Diagnostic Output:

  * To the Console

    Warning: Non-Monotonic Oil Formation Volume Factor Detected in Keyword PVTO, PVTNUM=1
    In /path/to/PVTO.INCL line 6
    Record  9: FVF 1.234 at RS 123.456 is not greater than FVF 2.345 at RS 121.212
    Record 10: FVF 1.233 at RS 123.457 is not greater than FVF 1.234 at RS 123.456
    Record 11: FVF 1.233 at RS 123.460 is not greater than FVF 1.233 at RS 123.457
    Report limit reached, see PRT-file for additional records.

  * In the PRT File (Unlimited Records)

    Warning: Non-Monotonic Oil Formation Volume Factor Detected in Keyword PVTO, PVTNUM=1
    In /path/to/PVTO.INCL line 6
    Record  9: FVF 1.234 at RS 123.456 is not greater than FVF 2.345 at RS 121.212
    Record 10: FVF 1.233 at RS 123.457 is not greater than FVF 1.234 at RS 123.456
    Record 11: FVF 1.233 at RS 123.460 is not greater than FVF 1.233 at RS 123.457
    Record 12: FVF 1.233 at RS 123.461 is not greater than FVF 1.233 at RS 123.460
    Record 13: FVF 1.233 at RS 123.470 is not greater than FVF 1.233 at RS 123.461

The length of each 'Record' line is 78 characters as of this change
(assuming METRIC conventions, FIELD conventions not tested).  The
length of the 'In ...' line depends on the number of characters in
the full filepath.
2020-09-24 00:43:03 +02:00
Bård Skaflestad
db07a19c68 PVTO: Relax Requirement that Saturated FVF be Strictly Increasing
Such cases do happen in real field models and we should diagnose the
existence of non-increasing BO as a function of RS, but we should
not terminate the simulation run.
2020-09-24 00:43:02 +02:00
Bård Skaflestad
1311afb261 PVTO: Add Means of Identifying Non-Monotonic Saturated FVFs
This commit introduces a way of diagnosing an uncommon but possible
issue in the PVTO table.  If the formation volume factor (BO) in the
saturated table (record 1 of each subtable) does not increase
monotonically as a function of the dissolved gas/oil ratio (RS),
then there is a risk that the simulation run will have convergence
problems.

We add a special purpose member function

    PvtoTable::nonMonotonicSaturatedFVF

which checks for this condition and returns a vector records for
which the condition is true.  The new member function

    TableManager::checkPVTOMonotonicity

then collates these records into a formatted string which is printed
to the console and the .PRT file.

Example Diagnostic Output:

    Warning: Non-Monotonic Oil Formation Volume Factor Detected
      * PVTO [PVTNUM = 1]
        Record  9: FVF 1.23 at RS 123 is not greater than FVF 2.34 at RS 120
        Record 10: FVF 1.22 at RS 125 is not greater than FVF 1.23 at RS 123
        Record 11: FVF 1.21 at RS 125 is not greater than FVF 1.22 at RS 125
2020-09-24 00:43:02 +02:00
Bård Skaflestad
b5b1588a17 PVTXTable: Fix Documentation
In particular, refer to "pvtnum" instead of "satnum".  While here,
also include a number of headers that are needed for idempotency.
2020-09-24 00:43:02 +02:00
Joakim Hove
4114302055 Merge pull request #1954 from akva2/mark_libfmt_system
changed: mark libfmt headers as system to avoid warnings
2020-09-23 23:06:45 +02:00
Joakim Hove
2e20dc5d43 Merge pull request #1923 from totto82/co2storage
Add CO2STOR keyword in Runspec section
2020-09-23 14:36:18 +02:00
Joakim Hove
7d226bf600 Merge pull request #1926 from joakim-hove/udq-in-actionx
Udq in actionx
2020-09-23 14:35:01 +02:00
Arne Morten Kvarving
70d13b7427 changed: mark libfmt headers as system to avoid warnings 2020-09-23 14:05:50 +02:00
Joakim Hove
341d14519b Allow negative injection rates for completions 2020-09-23 13:17:55 +02:00
Arne Morten Kvarving
ef412cd759 added: put a GPMaint instance in Group's serializeObject()
now the serialization is tested.
2020-09-23 13:04:10 +02:00
Jostein Alvestad
dc97e71350 various updates of unit tests 2020-09-23 13:03:21 +02:00
Jostein Alvestad
2efa272f6e removed comments 2020-09-23 13:03:19 +02:00
Jostein Alvestad
e8803220ca added changes to account for WSEGITER parameters to the Ecl-rst-file 2020-09-23 13:03:18 +02:00
Jostein Alvestad
772cc7b265 initial changes to add WSEGITER keyw-data to restart file 2020-09-23 13:03:16 +02:00
Jostein Alvestad
9a2410ddb2 corrections to IWEL for pressure loss model and multiphase model 2020-09-23 13:03:14 +02:00
Joakim Hove
6eb9eb8414 Merge pull request #1950 from joakim-hove/deckoutput-dont-split
Special case output of UDQ and ACTIONX keywords - no split
2020-09-23 12:29:42 +02:00
Joakim Hove
9887cc01af Merge pull request #1882 from bska/add-guiderate-restart
Unconditionally Output Guiderates to Restart File
2020-09-23 12:00:27 +02:00
Joakim Hove
aefa3cd9d2 Support defining new UDQ keywords inside ACTIONX block 2020-09-23 11:30:09 +02:00
Joakim Hove
59b59ce3ee Add location member to Welldims class 2020-09-23 11:06:03 +02:00
Bård Skaflestad
7875aedd7f Required Vectors: Simplify Well/Group Loop Bodies
Pass along the set of category-specific "extra" vectors to
'makeEntities' to avoid repeating the "extra" calls at each of the
well, group, and field levels.
2020-09-22 22:23:05 +02:00
Bård Skaflestad
e57c98d475 Output Guiderate Values to Restart File
This commit ensures that we also always output guiderate values to
the restart file.  Always calculating these summary quantities we
leverage the restart output support added in commit 317d1ba14 (i.e.,
in PR #1792).
2020-09-22 22:23:05 +02:00
Markus Blatt
d60a91c3dd Merge pull request #1932 from blattms/tran-calculator-2
Adds a calculator for modifying transmissibilities.
2020-09-22 19:56:12 +02:00
Joakim Hove
b184b0e9e5 Merge pull request #1942 from joakim-hove/opm-error
Opm error
2020-09-22 18:01:14 +02:00
Tor Harald Sandve
f3e209b740 Add CO2STOR keyword in Runspec section 2020-09-22 14:53:35 +02:00
Joakim Hove
0bbcee1cc8 Merge pull request #1944 from bska/nodepress-summary-output-2
Add Support for 'GPR' (Network Node Pressure) Summary Keyword
2020-09-22 14:44:14 +02:00
Joakim Hove
d300e54700 Special case output of UDQ and ACTIONX keywords - no split 2020-09-22 14:22:06 +02:00
Joakim Hove
719af02142 Add custom exception OpmInputError 2020-09-22 13:48:26 +02:00
Joakim Hove
f604f94e89 Document format placeholders in KeywordLocation 2020-09-22 12:38:09 +02:00
Bård Skaflestad
2d3432a9e0 Summary: Add Support for 'GPR' (Network Node Pressure) Keyword
This commit adds an evaluation function for the GPR summary vector.
We assume that the actual value is calculated elsewhere and passed
in unchanged from the caller of Summary::eval().  We therefore need
only convert the value to output units and hook this procedure up to
the table of known output functions.

Add a simple unit test for demonstration.
2020-09-22 10:08:44 +02:00
Bård Skaflestad
d46628e8a1 Summary Config: Recognize Subset of Node-Level Keywords
This commit adds support for recognizing a small subset of the
summary quantities that are reported at the node level of an
extended network--especially the 'GPR' keyword.

Briefly, we add a new 'Node' config category and a processor for
this category which knows about the distinction between nodes and
groups.  It uses member function ExtNetwork::node_names() to produce
configuration nodes whose named entity is the node rather than a
group.  Deriving this list of node names across all timesteps is
potentially expensive, so perform this operation at most once and
pass the result into the processor from the SummaryConfig
constructor.

Add a simple unit test for demonstration purposes.
2020-09-22 10:08:44 +02:00
Bård Skaflestad
4aab3ca7d0 Parse Context: Add Context for Missing Network Node
Will be used in SummaryConfig for reporting the case of node-level
summary output being requested for unknown/missing network nodes.
2020-09-22 10:08:44 +02:00
Joakim Hove
11d5128cbf Use KeywordLocation instead of passing keyword and filename separately 2020-09-22 09:55:45 +02:00
Joakim Hove
fe2f5ee185 Keep track of maximum size of RawRecord 2020-09-22 09:55:45 +02:00
Joakim Hove
0530b9b1a3 Merge pull request #1943 from wito/schedule-keyword-functions
Schedule Keyword Handler Dispatch
2020-09-22 09:32:47 +02:00
Markus Blatt
57dde8051d Merge pull request #1945 from blattms/fix-fmtlib
Also remove fmtlib from opm-common-prereqs.cmake
2020-09-22 07:53:25 +02:00
Williham Williham Totland
7a7920f3e7 Implements a new dispatcher for keywords in Schedule. 2020-09-21 19:22:11 +02:00
Markus Blatt
396bfbbcd2 Also remove fmtlib from opm-common-prereqs.cmake
Otherwise the user still needs to have an installed version on the system
in addition.
2020-09-21 15:46:01 +02:00
Joakim Hove
ee4ac770af Merge pull request #1941 from joakim-hove/rm-sim-container
Remove unused class SimulationDataContainer
2020-09-21 11:15:36 +02:00
Atgeirr Flø Rasmussen
045f527c5d Merge pull request #1940 from bska/nodepress-summary-output
Prepare for Outputting Network Node Pressure to Summary File
2020-09-21 09:21:59 +02:00
Joakim Hove
79ae4c7935 Remove unused class SimulationDataContainer 2020-09-21 08:18:51 +02:00
Bård Skaflestad
dbfd013cf4 Add Means of Retrieving Node Names from Extended Network
This commit adds a new member function

    ExtNetwork::node_names() const

which collects the names (std::string) of all nodes in a network.
The immediate use case is creating summary config nodes for network
level quantities specified without explicit lists of nodes, e.g.,

    GPR
    /

Add a simple unit test for demonstration.
2020-09-20 17:46:01 +02:00
Bård Skaflestad
6ea0e73512 Prepare for Creating Network-Level Summary Output
This commit adds a level of indirection to the existing group-level
data (active controls and guiderates), and adds a new 'NodeData'
level to the 'data::' protocol for transporting values from the
simulator to the output layer.

Update all call sites and users accordingly.
2020-09-20 17:46:01 +02:00
Markus Blatt
9343165bee Move factored out stuff to FieldProps namespace.
- FieldData
- ScalarOperation
- TranCalculator
- keywords
2020-09-18 16:20:33 +02:00
Joakim Hove
ac40c65f64 Merge pull request #1933 from joakim-hove/throw-same
Rethrow the same exception
2020-09-18 15:28:05 +02:00
Joakim Hove
b8c4a2ed83 Merge pull request #1937 from joakim-hove/embed-fmtlib
Embed fmtlib
2020-09-18 15:26:44 +02:00
Joakim Hove
b09db0325d Use fmtlib for string formatting in opmhash 2020-09-18 11:23:43 +02:00
Joakim Hove
4e5aed45d7 Embed fmtlib source code 2020-09-18 11:23:30 +02:00
Joakim Hove
3004e14e9a Remove use fmtlib package from build system 2020-09-18 11:19:41 +02:00
Joakim Hove
f9d43e738a Merge pull request #1936 from akva2/fix_packaging_libfmt
fix packaging files for libfmt
2020-09-18 10:14:05 +02:00
Arne Morten Kvarving
86d166756a fix packaging files for libfmt 2020-09-18 08:21:13 +02:00
Joakim Hove
f51533907f Merge pull request #1935 from bska/final-runsum-only
Don't Write RSM File for Substeps
2020-09-18 07:22:17 +02:00
Bård Skaflestad
50e4f9439b Don't Write RSM File for Substeps
If the last report step happens to be split into multiple substeps
(e.g., convergence problems or TUNING settings &c), then we will
write the RSM file for each substep which will slow down the
process.  This commit explicitly ensures that we don't output the
RSM file unless it is the last substep of the final report step.
2020-09-18 01:43:20 +02:00
Markus Blatt
951bd69522 Allow access to field data assoicated with TranCalculator.
We need this in opm-simulators where we need to query the
FieldProperties associated with the TranCalculator (e.g. TRANX0). Previously,
this were listed by FieldPropertiesManager::keys() but calling
get_int_field_data with the keyword would raise an exception resulting
in a deadlock.

This commit allows passing true as an additional argument to prevent
this (it gets passed to all functions called). This allows for running
with edited transmissibilities in parallel.
2020-09-17 22:20:36 +02:00
Markus Blatt
98f0b36b21 indclude algoritm header in FieldData.hpp
needed for std::find_first_of.
2020-09-17 20:23:58 +02:00
Joakim Hove
629da97d61 Rethrow the same exception 2020-09-17 18:54:31 +02:00
Markus Blatt
d3d91c2a08 Added ADD modifier for TranCalculator. 2020-09-17 16:40:10 +02:00
Markus Blatt
e6893caa89 Added support for MINVALUE to calculator. 2020-09-17 16:33:31 +02:00
Markus Blatt
7bdf49f15e Fixes MAXVALUE modifyer for transmissibility. 2020-09-17 16:26:06 +02:00
Markus Blatt
5ea65651ac Fix test for MAXVALUE. 2020-09-17 16:02:25 +02:00
Joakim Hove
403fd09e69 Merge pull request #1930 from joakim-hove/fmtlib
Add build dependency on fmtlib
2020-09-17 15:40:39 +02:00
Joakim Hove
9e7c808524 Add libfmt dependencies to package specifications 2020-09-17 15:31:16 +02:00
Joakim Hove
bafdbc35cc Add dependency to header only fmtlib 2020-09-17 14:57:40 +02:00
Markus Blatt
6a81e4bb63 Complete checks for TransCalculator. 2020-09-17 12:54:15 +02:00
Markus Blatt
d83790164d make tran_active non-throwing. 2020-09-17 12:54:15 +02:00
Markus Blatt
3a6cd37db1 Make apply_tran and deserialize_tran accessible as free functions.
In the simulator we are using different datastructures to hold them.
Hence we need to be able to apply and deserialize there.
2020-09-17 12:29:37 +02:00
Markus Blatt
e9be39d666 Add access for int and double FieldData.
This is needed for communication in the simulator. Previously,
that just used the data (std::vector), but the TranCaclulator
also needs the value_status to correctly. Hence this needs
to be communicated, too.
2020-09-17 11:46:17 +02:00
Markus Blatt
967f63479d Move FieldData to its own header for usage from simulator.
We need to refactor to make FieldData accessible from the simulator
for running in parallel with the TranCalculator.
2020-09-17 11:46:17 +02:00
Markus Blatt
1bb4c937a2 Move TranCalculator to its own header.
We need to refactor to make FieldData accessible from the simulator
for running in parallel with the TranCalculator.
2020-09-17 11:46:17 +02:00
Markus Blatt
16b946b199 Move keywords to their own header file.
We need to refactor to make FieldData accessible from the simulator
for running in parallel with the TranCalculator.
2020-09-17 11:46:17 +02:00
Joakim Hove
519e65d32c Add documentation 2020-09-17 11:46:17 +02:00
Joakim Hove
8499c9d1cd Add tran_active() query function 2020-09-17 11:46:17 +02:00
Joakim Hove
4bd9b7212f Add serialization of FieldProps TRAN calculators 2020-09-17 11:46:17 +02:00
Joakim Hove
ecee4a7d36 Adds a calculator for modifying field properties in the edit section.
Previously modifications were applied directly to the field
properties. Unfortunately, for unset TRANX this resulted in
modifying 1.0 even if the simulator is calculating
transmissibilities itself. This was one of the reasons
why we got wrong results (others are in the simulator code).

Now these operations recorded in a calculator which can later be
applied to compressed arrays using apply_tran.
2020-09-17 11:40:56 +02:00
Bård Skaflestad
0935aae02c Merge pull request #1929 from bska/capture-raw-sfunc-vals
Saturation Functions: Add Means of Retrieving Select Function Values
2020-09-17 11:02:22 +02:00
Bård Skaflestad
df1f03e4a8 SatFunc: Add Means of Retrieving Select Function Values
This commit introduces a new helper structure, RawFunctionValues,
which collects unscaled saturation function values that are needed
for vertical scaling of saturation functions using keywords such as

    KRO, KRORG, KRGR, PCW

and their hysteretic and directional counterparts.  We also
introduce a new helper function, getRawFunctionValues, which
extracts those values from the function tables in TableManager.

Add a set of unit tests to exercise the new feature.
2020-09-17 08:33:42 +02:00
Bård Skaflestad
07780a793f Field Props Test: Fix Minor Compiler Warnings
In particular, fix a few instances of "signed vs. unsigned"
comparisons, one "no previous declaration for", and include the
<algorithm> header for std::find().
2020-09-17 08:16:37 +02:00
Bård Skaflestad
7a2350bc3c Merge pull request #1922 from joakim-hove/dynamicstate-update-equal
Dynamicstate update equal
2020-09-17 08:03:29 +02:00
Bård Skaflestad
fb93e08ef0 Merge pull request #1928 from hakonhagland/liftopt_4
Add get method for LIFTOPT item 4.
2020-09-17 08:00:51 +02:00
Bård Skaflestad
60f6c26456 Merge pull request #1924 from joakim-hove/keyword-location
Keyword location
2020-09-16 23:35:09 +02:00
Bård Skaflestad
9765ba9d3f Merge pull request #1927 from joakim-hove/add-timestep
Unconditionally add "TIMESTEP" to SummaryState
2020-09-16 23:24:38 +02:00
Håkon Hægland
672eb6e689 Add get method for LIFTOPT item 4. 2020-09-16 21:20:58 +02:00
Joakim Hove
c334245d08 Unconditionally add "TIMESTEP" to SummaryState 2020-09-16 19:33:04 +02:00
Joakim Hove
0d85293fcc Merge pull request #1925 from akva2/fix_nupcol_serialization
fixed: serialization nupcol in Runspec
2020-09-16 17:12:03 +02:00
Joakim Hove
b61f87ddaa Add message function to KeywordLocation 2020-09-16 15:14:44 +02:00
Arne Morten Kvarving
08df29c991 fixed: serialization nupcol in Runspec
also add it to comparison operator
2020-09-16 14:59:26 +02:00
Joakim Hove
d283f1858f Add keyword member to KeyworLocation 2020-09-16 14:24:06 +02:00
Joakim Hove
bef5a4c27b Renamed class Location -> KeywordLocation 2020-09-16 14:06:54 +02:00
Joakim Hove
a023d4b437 DynamicState::find will return std::optional<std::size_t> 2020-09-16 11:59:03 +02:00
Joakim Hove
e03a97b539 DynamicState::update_equal() will return index of next value 2020-09-16 09:55:09 +02:00
Atgeirr Flø Rasmussen
891fda8e79 Merge pull request #1921 from akva2/implement_node_serialize_object
fixed: implement Node::serializeObject
2020-09-16 09:42:10 +02:00
Joakim Hove
ae8dc1a770 Merge pull request #1920 from totto82/scaleAlq
scaling of the Alq values
2020-09-16 09:27:59 +02:00
Arne Morten Kvarving
37fcfe4379 fixed: implement Node::serializeObject 2020-09-16 08:57:06 +02:00
Tor Harald Sandve
ca2dfc6136 scaling of the Alq values 2020-09-16 07:56:05 +02:00
Bård Skaflestad
867fed3288 Merge pull request #1880 from bska/fix-gr-calc
Refactor Damping Factor Implementation
2020-09-15 15:11:36 +02:00
Bård Skaflestad
245a3aa09e GuideRate: Add Test Case for Revised get() Implementation 2020-09-15 10:15:11 +02:00
Bård Skaflestad
8a87914740 Don't Repeatedly Calculate Same Guiderate Value
Doing so works reduces the impact of the damping factor.
2020-09-15 10:15:10 +02:00
Bård Skaflestad
7649df53a2 GuideRate: Revise Damping Factor Implementation
This commit centralises the way we incorporate damping factors (item
10 of the GUIDERAT keyword) into the calculation of group/well guide
rates.  In particular, we create a structure that manages both the
current and the previous (damped) guiderate values and ensures that
the new guiderate value is

    GR_p = f*GR_p' + (1 - f)*GR_p^{n-1}

with GR_p' denoting the "raw" guiderate value calculated directly
from potential rates at the current timelevel (n).  GR_p^{n-1} is
the damped-and previously used-guiderate value from timelevel n-1.
Finally 'f' denotes the damping factor.  This is the same approach
used previously, but with some small changes to exclude zero-valued
guiderates.

We furthermore remove one of the early returns in GuideRate::get().
There is no need to return the nominated phase's guiderate value if
the model phase rate is very low and doing so produces incorrect
water guiderates for the OPL5 well in the MOD4_GRP test case.
2020-09-15 10:15:10 +02:00
Bård Skaflestad
3080b9c7f6 RateVector: Forward 'eval' Calls to GuideRateModel::Target Overload
Avoids having to repeat the implementation for wells and groups.
2020-09-15 10:15:08 +02:00
Bård Skaflestad
a4d07b5c57 Merge pull request #1918 from joakim-hove/internalize-summary-region
Make sure R__xxx keywords are recognized in Summary writer
2020-09-15 09:08:32 +02:00
Joakim Hove
03f9a73f43 Make sure R__xxx keywords are recognized in Summary writer 2020-09-14 23:05:03 +02:00
Bård Skaflestad
98ec42f472 Merge pull request #1874 from totto82/fixwsaltunit
Fix unit for salt concentration in WSALT
2020-09-14 15:40:48 +02:00
Bård Skaflestad
764149182d Merge pull request #1917 from akva2/janitoring
Some janitoring
2020-09-14 13:26:09 +02:00
Arne Morten Kvarving
518c219838 remove unused variable 2020-09-14 12:23:31 +02:00
Arne Morten Kvarving
80b98934c3 add missing initializers 2020-09-14 12:13:04 +02:00
Arne Morten Kvarving
2c2f848c54 remove unused function 2020-09-14 12:05:34 +02:00
Joakim Hove
5557debd9c Merge pull request #1916 from joakim-hove/summary-config-keywords
Add method SummaryConfig::keywords( pattern )
2020-09-14 10:55:27 +02:00
Joakim Hove
791726398e Fix warning 2020-09-14 09:17:53 +02:00
Joakim Hove
db64c858d1 Add method SummaryConfig::keywords( pattern ) 2020-09-14 09:17:53 +02:00
Tor Harald Sandve
02031a00e6 add salinity to unitSystem 2020-09-14 08:22:21 +02:00
Tor Harald Sandve
32a47bf79a Fix unit for salt concentration in WSALT 2020-09-14 08:22:21 +02:00
Joakim Hove
20a6a522dc Merge pull request #1891 from joakim-hove/summary-region
Add basic support for xxx_REG summary keywords
2020-09-10 09:23:33 +02:00
Joakim Hove
c3f94834c3 Add wildcard matching of keywords in SummaryConfig 2020-09-10 08:23:42 +02:00
Joakim Hove
dad067835c RegionCache object can manage multiple fip regions 2020-09-10 08:23:42 +02:00
Joakim Hove
d5a21427b4 Add fip_region to summary context argument 2020-09-10 08:23:42 +02:00
Joakim Hove
3587c0c6b7 Add fip_region member to SummaryNode 2020-09-10 08:23:42 +02:00
Joakim Hove
5976efa953 Add fip regioin name to summaryconfig node 2020-09-10 08:23:42 +02:00
Bård Skaflestad
53ce21cf9e Merge pull request #1911 from joakim-hove/udq-assign
Udq assign
2020-09-09 23:29:09 +02:00
Bård Skaflestad
d4ae7e706d Merge pull request #1905 from joakim-hove/fp-global2
Enable some support for global keywords
2020-09-09 23:26:51 +02:00
Joakim Hove
03d387c12d Enable global storage for keywords 2020-09-09 21:41:08 +02:00
Joakim Hove
5a060910a3 Differentiate better between UDQ ASSIGN and UDQ DEFINE
A quite typical situation is that a UDQ keyword is first initialized with UDQ
ASSIGN statement, and then subsequently a formula for updates every timestep is
entered with UDQ DEFINE:

  UDQ
     ASSIGN FU_VAR1 0 /
     DEFINE FU_VAR1 FU_VAR1 + 1 /
  /

Then the assign statement should be run once, and the define formula should be
evaluated for every subsequent timestep.
2020-09-09 21:39:29 +02:00
Bård Skaflestad
49460edf39 Merge pull request #1914 from joakim-hove/add-timestep
Add TIMESTEP as context variable in summary eval
2020-09-09 21:19:31 +02:00
Joakim Hove
fc1e245ea4 Add TIMESTEP as context variable in summary eval 2020-09-09 19:42:42 +02:00
Bård Skaflestad
5553b36c7d Merge pull request #1912 from joakim-hove/fmwpa
Add functionality for FMWPA - number of abondoned wells
2020-09-09 18:26:43 +02:00
Joakim Hove
a4d8379687 Support abondoned well keyword FMWPA in Summary 2020-09-09 17:10:53 +02:00
Joakim Hove
943e3a656d Request FMWPA output in test deck 2020-09-09 16:44:57 +02:00
Joakim Hove
8c2d74f348 Change to msim: set rates explicitly to zero for closed wells 2020-09-09 16:44:57 +02:00
Bård Skaflestad
eb5787fd54 Merge pull request #1913 from joakim-hove/first-production
First production
2020-09-09 16:15:58 +02:00
Joakim Hove
2f3ba50ca6 Add boolean flag to indicate whether a well has been an open producer 2020-09-09 15:07:55 +02:00
Joakim Hove
660d5ae3a7 Fix error message 2020-09-09 15:06:51 +02:00
Joakim Hove
c82be02ef8 Merge pull request #1910 from joakim-hove/udq-misc
Udq misc
2020-09-08 11:05:21 +02:00
Joakim Hove
fa70d457f3 Merge pull request #1909 from atgeirr/remove-unused-function
The distribute_toplayer() is unused.
2020-09-08 10:58:56 +02:00
Joakim Hove
4a9ec1403e UDQ: get from an unknown summary variable throws std::out_of_range 2020-09-08 08:23:45 +02:00
Joakim Hove
aeb55ec72e Pass global process parameters as mutable value 2020-09-08 08:23:45 +02:00
Joakim Hove
8d11a04033 Add report_step argument to UDQConfig::eval() 2020-09-08 08:23:45 +02:00
Atgeirr Flø Rasmussen
859182f7f0 The distribute_toplayer() is unused.
Note that there is still a member function of the same name.
2020-09-07 15:51:35 +02:00
Bård Skaflestad
b22304b7ba Merge pull request #1906 from joakim-hove/correct-default
Fieldprops: Correct default
2020-09-06 18:30:46 +02:00
Bård Skaflestad
05dde86f55 Merge pull request #1908 from joakim-hove/udq-fixup
Udq fixup
2020-09-06 18:22:12 +02:00
Joakim Hove
7969dfd721 Fix bug with init/create of FIP keywords 2020-09-05 13:54:17 +02:00
Joakim Hove
42fcb4507f FieldProps::get_global<T> will fill with correct default value 2020-09-05 11:52:22 +02:00
Joakim Hove
0a9babfa9a Move get_global functionality down to FieldProps 2020-09-05 11:52:01 +02:00
Joakim Hove
109a87e4ee Update user_defined regexp to allow '?U_?' 2020-09-05 11:46:41 +02:00
Joakim Hove
1bb96ffed2 Set up default stdout logging for msim simulator 2020-09-05 11:33:03 +02:00
Joakim Hove
c7308381d0 Merge pull request #1907 from joakim-hove/remove-designated
Remove use of designated initializer
2020-09-05 11:32:47 +02:00
Joakim Hove
4d29b2921a Remove use of designated initializer 2020-09-05 10:41:52 +02:00
Joakim Hove
1989eac79d Merge pull request #1900 from joakim-hove/fp-global
Reorganize field properties metadata
2020-09-05 08:46:49 +02:00
Joakim Hove
a765cd26ea Reorganised metadata for field properties 2020-09-04 14:31:40 +02:00
Bård Skaflestad
1b7fab4bd1 Merge pull request #1904 from joakim-hove/box-global-list
Box global list
2020-09-03 23:51:08 +02:00
Joakim Hove
ae049a927f Add accessor method for *all* cells in a Box 2020-09-03 21:12:29 +02:00
Joakim Hove
a5bb313394 Remove unused index member from Box class 2020-09-03 16:49:29 +02:00
Bård Skaflestad
da1c2d3c8b Merge pull request #1903 from joakim-hove/change-default
Changed default value of WSEGITER::MAX_WELL_ITERATIONS
2020-09-03 14:14:23 +02:00
Joakim Hove
c54a57d593 Changed default value of WSEGITER::MAX_WELL_ITERATIONS 2020-09-03 13:11:18 +02:00
Atgeirr Flø Rasmussen
1cdebaef30 Merge pull request #1902 from atgeirr/fix-missing-include
Add missing <string> include.
2020-09-03 11:29:22 +02:00
Atgeirr Flø Rasmussen
873ad61e23 Add missing <string> include. 2020-09-03 10:41:20 +02:00
Bård Skaflestad
f8f5987aff Merge pull request #1901 from akva2/missing_boost_include
fixed: add missing include for boost version
2020-09-03 10:02:07 +02:00
Arne Morten Kvarving
40c2c00d58 fixed: add missing include for boost version 2020-09-03 09:20:49 +02:00
Bård Skaflestad
ae91ede665 Merge pull request #1871 from bska/add-guiderate-summary
Add Guiderate Summary Output
2020-09-03 09:20:36 +02:00
Bård Skaflestad
084aa69641 Add Guiderate Summary Output
This commit adds support for outputting the guiderate summary
vectors

    [GW][OGWV]PGR, [GW][GW]IGR

under the assumption that the values are fully calculated at another
level and that we therefore only need to extract the numerical
values and convert the rate units to output conventions.  We assume
that such values are communicated to the summary output layer by
means of a 'GuideRateValue' object.

The assumption of values already being calculated leads to a small
change in the 'need_wells()' function.  We're now able to exclude
guiderate values at the group level from those vectors that require
setting up a well vector.  This is a (tiny) performance improvement.
2020-09-03 01:04:15 +02:00
Bård Skaflestad
746bb15681 Merge pull request #1887 from joakim-hove/udq-undefined
Udq undefined
2020-09-03 00:50:26 +02:00
Joakim Hove
11e70ca779 Handle undefined UDQ expressions 2020-09-02 23:03:03 +02:00
Bård Skaflestad
a74855f74b Merge pull request #1899 from joakim-hove/serialize-empty-string
Handle empty strings in serializer
2020-09-02 09:37:53 +02:00
Joakim Hove
e99e2c5e82 Handle empty strings in serializer 2020-09-02 07:49:04 +02:00
Bård Skaflestad
015d8ff923 Merge pull request #1898 from akva2/janitoring
Some janitoring
2020-09-01 18:02:01 +02:00
Arne Morten Kvarving
efedbffe63 let compiler deal with copy-ellusion 2020-09-01 15:28:12 +02:00
Arne Morten Kvarving
39db643dd3 quell warning with boost >= 1.71
header was relocated
2020-09-01 15:25:44 +02:00
Arne Morten Kvarving
44f29eb4f7 add explicit copy-constructors
implicitly generated copy constructors are deprecated in C++11,
if the class already has an assignment operator.

quells warnings with modern gcc/clang.
2020-09-01 15:25:44 +02:00
Arne Morten Kvarving
acad356e2d remove unused variable 2020-09-01 15:25:44 +02:00
Joakim Hove
076bc3107b Merge pull request #1896 from joakim-hove/add-udq-state
Add UDQState argument to output writer
2020-09-01 15:07:14 +02:00
Joakim Hove
8b23b572cd Merge pull request #1895 from joakim-hove/serializer
Serializer class
2020-09-01 14:15:52 +02:00
Joakim Hove
3b0e795e0b Add UDQState argument to output writer 2020-09-01 13:18:59 +02:00
Joakim Hove
4b3304730c Serializer class: SummaryState & UDQState 2020-09-01 13:15:42 +02:00
Joakim Hove
432f666768 Merge pull request #1897 from joakim-hove/add-wsegiter
Add wsegiter
2020-09-01 13:11:20 +02:00
Joakim Hove
53f78a02fe Internalize WSEGITER settings in Tuning implementation 2020-08-31 18:24:09 +02:00
Joakim Hove
71ba9ae6fd Remove DynamicState<..> access to Tuning class 2020-08-31 17:25:40 +02:00
Joakim Hove
24b66d8bb4 Merge pull request #1889 from joakim-hove/udq-state
Udq state
2020-08-31 07:35:14 +02:00
Bård Skaflestad
bb8c1f192f Merge pull request #1894 from GitPaean/code_compatibility
rewriting a for loop for intel compilers
2020-08-28 12:29:48 +02:00
Kai Bao
1927e305ed rewriting a for loop for intel compilers 2020-08-28 11:37:04 +02:00
Joakim Hove
0161f50255 Add UDQState 2020-08-27 17:25:51 +02:00
Joakim Hove
8b2363b940 Merge pull request #1885 from joakim-hove/udq-uadd
Correctly parse and handle UADD / UMUL / UMIN / UMAX set operations
2020-08-27 17:11:25 +02:00
Joakim Hove
7894a21749 Merge pull request #1892 from joakim-hove/fp-fipxxx
Allow FIPxxx keywords in FieldProps manager
2020-08-27 17:11:05 +02:00
Joakim Hove
8b718ef0e1 Merge pull request #1890 from joakim-hove/extract-udq-eval
Remove call to udq::eval() from Summary::eval()
2020-08-27 17:09:28 +02:00
Joakim Hove
168aa5602d Make sure DEFINE statements are evaluated in input order 2020-08-27 15:24:32 +02:00
Joakim Hove
718e00ca1f Correctly parse and handle UADD / UMUL / UMIN / UMAX set operations 2020-08-27 15:24:32 +02:00
Joakim Hove
1cf069c837 Merge pull request #1886 from joakim-hove/udq-tokens
Fix UDQ parsing for mix of '*' and *
2020-08-27 15:22:25 +02:00
Joakim Hove
76e8805d92 Merge pull request #1893 from joakim-hove/remove-require-fipnum
Remove function SummaryConfig::requireFIPNUM
2020-08-27 13:56:36 +02:00
Joakim Hove
dee69e78c3 Remove function SummaryConfig::requireFIPNUM 2020-08-27 11:55:17 +02:00
Joakim Hove
e00516842c Allow FIPxxx keywords in FieldProps manager 2020-08-26 08:52:12 +02:00
Joakim Hove
b9ca9c3d47 Remove call to udq::eval() from Summary::eval() 2020-08-25 16:27:46 +02:00
Bård Skaflestad
98c9ce7abd Merge pull request #1888 from joakim-hove/udq-scalar-optional
Use std::optional<double> in UDQScalar
2020-08-24 09:35:13 +02:00
Joakim Hove
9ccc9a72e4 Use std::optional<double> in UDQScalar 2020-08-24 06:59:11 +02:00
Joakim Hove
6c2563c5a5 Fix tokenizer bug with mix of '*' and *
The token '*' should be interpreted as all wells/groups for a variable like WOPR
or GGPR, whereas the naked * is a multiplication sign. This commit fixes a bug
where the all wells/groups token '*' would be incorrectly interpreted as a
multiplication sign.
2020-08-23 08:31:15 +02:00
Joakim Hove
f608487772 Merge pull request #1883 from bska/use-wmctl-rstval
Restart Wells: Use IWEL WMCTL Values as Switch Cases
2020-08-20 15:30:57 +02:00
Bård Skaflestad
af362fa4cf Restart Wells: Use IWEL WMCTL Values as Switch Cases
These are (marginally) easier to understand than their raw integer
values.  While here, also insert the missing 'GRUP' case for
producers.
2020-08-20 13:43:12 +02:00
Bård Skaflestad
a92c8ca6e0 Merge pull request #1870 from jalvestad/group-udq-actx_ph2
Corrections and improvements to Eclipse compatible restart file output
2020-08-19 12:30:01 +02:00
Bård Skaflestad
501db1003d Merge pull request #1876 from joakim-hove/rptrst-solution
Correctly handle RPTRST in SOLUTION section
2020-08-18 11:08:31 +02:00
Jostein Alvestad
b624facaf2 minor corrections of comments 2020-08-18 11:07:57 +02:00
Jostein Alvestad
156c934993 minor comment corrections 2020-08-18 11:07:54 +02:00
Jostein Alvestad
c525546489 correct some logical tests determining IGRP 2020-08-18 11:07:52 +02:00
Joakim Hove
106c0881ee Correctly handle RPTRST in SOLUTION section 2020-08-18 10:48:50 +02:00
Joakim Hove
effe70876f Merge pull request #1879 from berland/weconcmf
Add support for parsing E300 kw WECONCMF
2020-08-18 00:10:34 +02:00
Bård Skaflestad
8e1f8099b2 Merge pull request #1878 from berland/wcutback-fix
Add GLR_LIMIT to WCUTBACK

Fixes #1878
2020-08-17 12:56:45 +02:00
Håvard Berland
b1b04d3dec Add GLR_LIMIT to WCUTBACK, solving bug #1877
Also add dimensions to all relevant fields.
2020-08-17 11:41:19 +02:00
Håvard Berland
ab047eca6a Add support for parsing E300 kw WECONCMF 2020-08-17 11:05:09 +02:00
Joakim Hove
c84b95ed85 Merge pull request #1875 from joakim-hove/tlmixpar
Implement TLMIXPAR as dedicated vector of struct - not table
2020-08-14 12:56:39 +02:00
Joakim Hove
d358d94f58 Merge pull request #1806 from goncalvesmachadoc/salt
finalizeSaltTables
2020-08-14 12:55:49 +02:00
Cintia Goncalves Machado
f8c53e0f9b Merge pull request #2 from joakim-hove/salt
Salt
2020-08-14 09:51:33 +02:00
Joakim Hove
748c3975fb Fix salt table tests 2020-08-13 18:44:04 +02:00
Joakim Hove
66ddbd7842 Remove trailing whitespace 2020-08-13 18:44:04 +02:00
Joakim Hove
1b851f03cb Implement TLMIXPAR as dedicated vector of struct - not table 2020-08-12 14:47:21 +02:00
Markus Blatt
c438c58af3 Merge pull request #1873 from blattms/require-compiled-source
Require test source code to compile and fix test for dune-geometry (>2.7)
2020-08-11 10:34:09 +02:00
Markus Blatt
7c30586fde Only compile code if non-empty code was submitted for DUNE/OPM.
Also make the search fail if the compilation fails.
2020-08-11 00:53:45 +02:00
Markus Blatt
d5388ba653 Fix compile check for dune-geometry from DUNE>2.7
Dune::Geometry::makeQuadrilateral() is deprecated since 2.6 and has recently
been removed. We are using now using Dune::GeometryTypes::quadrilateral
2020-08-11 00:25:23 +02:00
Joakim Hove
a0e20e8d3e Merge pull request #1647 from joakim-hove/json
Add build and write functionality to JsonObject
2020-08-10 15:40:56 +02:00
Joakim Hove
747fd8f897 Add build and write functionality to Json object 2020-08-10 09:41:51 +02:00
Joakim Hove
3b352a5d3b Merge pull request #1866 from joakim-hove/use-std-stringview
Use std stringview
2020-08-05 13:10:28 +02:00
Joakim Hove
3e1411bf87 Replace opm implementation of string_view with std::string_view 2020-08-04 11:40:41 +02:00
Joakim Hove
ffe86d361b Merge pull request #1868 from bska/transport-guiderate-values
Output: Transport Guiderate Values to Output Layer
2020-07-31 08:08:40 +02:00
Bård Skaflestad
f55d0fa57c Output: Transport Guiderate Values to Output Layer
This commit introduces datamembers of type

    Opm::data::GuideRateValue

to the Opm::data::Well and Opm::data::GroupData structures.
Collectively, these datamembers enable transporting guiderate values
calculated elsewhere--e.g., in the opm-simulators module--to the
output layer for final processing and output to the summary and/or
the restart files.

We support outputting both production and injection guiderate values
at the group level.  Guiderate values at the well level are
interpreted as production or injection according to the well type.
2020-07-19 19:07:23 +02:00
Joakim Hove
bdd74b33b2 Merge pull request #1867 from joakim-hove/enable-python
Update PYTHONPATH in enable-python.sh
2020-07-15 13:06:32 +02:00
Joakim Hove
52d69dfd0d Update PYTHONPATH in enable-python.sh 2020-07-15 10:16:21 +02:00
Joakim Hove
349e964586 Merge pull request #1865 from bska/add-copyright
GuideRateValue: Insert Copyright Notice
2020-07-10 18:55:39 +02:00
Bård Skaflestad
32fa286f8e GuideRateValue: Insert Copyright Notice
Missed in commit 4f7d41ee1.

Pointy Hat: [at]bska.
2020-07-10 17:52:38 +02:00
Joakim Hove
52801f1e57 Merge pull request #1859 from bska/add-guiderate-value
Output: Add Container for Transporting Guiderate Values
2020-07-10 13:24:02 +02:00
Bård Skaflestad
4f7d41ee10 Output: Add Container for Transporting Guiderate Values
This commit introduces a container

    Opm::data::GuideRateValue

that packages a 'std::array' and 'std::bitset' into that array.
This container is intended as the main vehicle for transporting
per-phase guiderate values (Oil, Gas, Water, and Resvoir Voidage
Volume supported initially) calculated by the simulator to the
output layer.  We support the serialization operations read and
write in order to plug into the collective communications layer used
in the simulator.

Add unit tests to exercise the new container.
2020-07-09 16:44:15 +02:00
Bård Skaflestad
dc3dd89e09 Merge pull request #1864 from joakim-hove/actionx-wlist
Actionx wlist
2020-07-09 15:57:54 +02:00
Joakim Hove
f500adba24 ACTIONX will handle WLIST well arguments 2020-07-09 15:16:33 +02:00
Joakim Hove
f4f993586a Add method WListManager::wells() which can do WLIST wildcards 2020-07-09 15:12:54 +02:00
Joakim Hove
17c61e1853 Add missing compile guards 2020-07-09 15:12:54 +02:00
Bård Skaflestad
3eab28f9b0 Merge pull request #1863 from joakim-hove/WLIST-updates
Update WLIST to handle WLIST and well pattern arguments
2020-07-09 14:58:31 +02:00
Joakim Hove
d096a5fda6 Update WLIST to handle WLIST and well pattern arguments 2020-07-08 08:12:28 +02:00
Bård Skaflestad
643ff6e777 Merge pull request #1857 from joakim-hove/accept-long-keywords
Fix handling of too long 8 characters keywords like GUIDERATE
2020-07-05 19:58:44 +02:00
Bård Skaflestad
1c92fb3fea Merge pull request #1860 from joakim-hove/add-groupvalues-member
Add data::GroupValues member to RestartValue
2020-07-05 19:26:41 +02:00
Joakim Hove
305b2a166a Add data::GroupValues member to RestartValue 2020-07-03 16:40:42 +02:00
Joakim Hove
1019187a4e Merge pull request #1858 from joakim-hove/igrp-fix-refactor
Igrp fix refactor
2020-07-03 09:08:46 +02:00
Joakim Hove
0321c003eb Merge pull request #1853 from bska/prepare-guiderate-smry
Make Structure for Per-Group Summary Data from Simulator
2020-07-02 21:37:33 +02:00
Joakim Hove
4e223eae4a Fix handling of too long 8 characters keywords like GUIDERATE 2020-07-02 14:23:45 +02:00
Joakim Hove
012c1a2b40 Use named constants to look up in INTEHEAD 2020-07-02 11:40:30 +02:00
Bård Skaflestad
68b4f38464 Make Structure for Per-Group Summary Data from Simulator
This commit adds a level of indirection to the current per-group
summary quantities that is directly assigned by the simulator.  In
particular, introduce a new structure named

    GroupData

that contains a 'GroupConstraints' object and make the per-group
values into 'map<string, GroupData>' rather than the current
'map<string, GroupConstraints>'.  This is in preparation of adding
support for reporting group-level production/injection guiderates
(Gx[IP]GR) to the summary file.

Update tests and APIs accordingly.
2020-07-02 10:57:46 +02:00
Joakim Hove
c7b93797b6 Merge pull request #1852 from joakim-hove/python-wellnames
Add python wrapper for Schedule::wellNames( const std::string& )
2020-07-02 09:50:57 +02:00
Joakim Hove
34bc004171 Merge pull request #1854 from bska/remove-unused-variable
UDQDefine: Suppress 'Unused Variable' Warning
2020-07-02 00:55:22 +02:00
Bård Skaflestad
adf90e3410 UDQDefine: Suppress 'Unused Variable' Warning
Assign 'stod' result to a 'std::ignore' object to maintain the
'token_size' side effect without creating an otherwise unused value
of type 'double'.  While here, also put the 'next_token' helper into
an anonymous namespace to avoid generating warnings of the form

    no previous declaration for ...
2020-07-01 22:49:49 +02:00
Joakim Hove
d6a3cdb986 Merge pull request #1832 from CeetronSolutions/python-pypi-cleanup
Python pypi package work
2020-07-01 13:34:26 +02:00
Joakim Hove
ab821b90a5 Add python wrapper for Schedule::wellNames( const std::string& ) 2020-07-01 11:01:12 +02:00
Joakim Hove
29a946eb9a Merge pull request #1846 from joakim-hove/udq-sign-bug
Udq sign bug
2020-07-01 10:47:04 +02:00
Gaute Lindkvist
f7b080b7b6 Fix remaining double use of python/python and opm/opm folders in Python package generation 2020-07-01 03:25:11 -04:00
Bård Skaflestad
0ad97351c6 Merge pull request #1849 from totto82/addBrineOutput
add brine output
2020-06-30 17:08:07 +02:00
Gaute Lindkvist
c24d7f7798 Remove static python flags from generate-pypi script 2020-06-30 10:55:23 -04:00
Tor Harald Sandve
42e55ec342 Add brine output 2020-06-30 16:19:16 +02:00
Joakim Hove
9fd29db2de Add case with literal in scientific form 2020-06-30 13:04:49 +02:00
Joakim Hove
f09b534e1d Hack around UDQ parser which does not accept leading '-' 2020-06-30 13:01:00 +02:00
Joakim Hove
fc4511d365 Fix UDQParsing code to handle numerical values on scientific form 2020-06-30 12:51:59 +02:00
Bård Skaflestad
89cbb9ae24 Merge pull request #1847 from joakim-hove/use-sumstate-group-function
Use SummaryState::has_group_var() / SummaryState::get_group_var()
2020-06-30 11:46:05 +02:00
Joakim Hove
962b6f8150 Use SummaryState::get_group_var() / SummaryState::has_group_var() II 2020-06-30 11:26:08 +02:00
Joakim Hove
c663805694 Refactored UDQ token split code 2020-06-30 10:35:23 +02:00
Joakim Hove
d30b63508d Quote item in error message 2020-06-30 09:48:23 +02:00
Joakim Hove
8ad0c99c1d Make sure UDQ quote_split does not append empty string 2020-06-30 09:37:42 +02:00
Joakim Hove
7fce7a2c9c Bug in UDQ tokenizer 2020-06-30 08:40:06 +02:00
Bård Skaflestad
0c35431a2f Merge pull request #1844 from joakim-hove/use-sumstate-group-function
Use SumState::has_group_var() / SumState::get_group_var()
2020-06-29 21:09:34 +02:00
Bård Skaflestad
64ae1a8dea Merge pull request #1834 from totto82/addPolymerOutput
Add output for polymer production
2020-06-29 17:06:53 +02:00
Joakim Hove
3e828e8578 Use SummaryState::has_group_var() / SummaryState::get_group_var() 2020-06-29 16:18:37 +02:00
Joakim Hove
eb48fb709a Add SummaryState::get_xxx() overloads with a default argument 2020-06-29 14:14:49 +02:00
Tor Harald Sandve
8c14eac213 add polymer density to the unit system 2020-06-29 13:53:42 +02:00
Bård Skaflestad
a067352ce0 Merge pull request #1843 from joakim-hove/restart-recover-udq
Recover UDQ values from restart file
2020-06-25 16:41:20 +02:00
Joakim Hove
1704a35a92 Recover UDQ values from restart file 2020-06-25 16:18:59 +02:00
Gaute Lindkvist
3acc26558b Use file COPY instead of configure for straight copy in CMakeLists.txt 2020-06-25 09:52:43 -04:00
Gaute Lindkvist
a624d6c690 Remove static python flags from generate-pypi script 2020-06-25 09:26:38 -04:00
Gaute Lindkvist
27fdb0654d Revert "Support building Python module statically"
This reverts commit d3b4f41acf.
2020-06-25 09:26:12 -04:00
Joakim Hove
efc2e7aa92 Merge pull request #1841 from joakim-hove/use-restart-groups
Use Schedule::restart_groups()
2020-06-25 14:19:31 +02:00
Joakim Hove
e65880aafb Use Schedule::restart_groups() 2020-06-25 14:18:19 +02:00
Tor Harald Sandve
13f07fdfef Polymer output
Change polymer production output from volume -> mass
Polymer injection rates are read from the simulator and not computed based on the water rate and the polymer injection concentration given in the schedule
2020-06-25 10:57:11 +02:00
Bård Skaflestad
2876751fe2 Merge pull request #1839 from joakim-hove/eval-udq
Eval udq
2020-06-24 14:15:27 +02:00
Bård Skaflestad
1a0b3b418c Merge pull request #1836 from joakim-hove/restartview
Restartview
2020-06-24 14:13:17 +02:00
Bård Skaflestad
c07aec9c68 Merge pull request #1838 from joakim-hove/schedule-restart-group
Schedule restart group
2020-06-24 13:56:32 +02:00
Joakim Hove
cbe9bf2470 RestartView::hasKeyword: fix when <T> is not present at all 2020-06-24 12:59:43 +02:00
Joakim Hove
f6d160db32 Add convenience method Schedule::restart_groups() 2020-06-24 12:53:09 +02:00
Bård Skaflestad
feaadb4f6f Merge pull request #1837 from joakim-hove/udq-named-constant
Udq named constant
2020-06-24 10:58:09 +02:00
Joakim Hove
633bbb6007 Introduce named constant for UDQ default value in restart files 2020-06-24 01:08:36 +02:00
Joakim Hove
c06708ebd0 Add std::string specialization in RestartView 2020-06-24 01:06:15 +02:00
Joakim Hove
ae5c6fe53e Made eval_udq into method UDQConfig::eval() 2020-06-24 01:05:59 +02:00
Joakim Hove
9ed3f223ea Merge pull request #1840 from joakim-hove/udq-whitespace
Remove trailing whitespace
2020-06-24 01:05:21 +02:00
Joakim Hove
ad023d224b Remove trailing whitespace 2020-06-23 15:55:05 +02:00
Tor Harald Sandve
27e6e0735f Add output for polymer production 2020-06-23 09:57:36 +02:00
Atgeirr Flø Rasmussen
e719812e9b Merge pull request #1833 from bska/disable-debug-output
Group Data: Conditionally Enable Debug Output
2020-06-22 22:17:36 +02:00
Bård Skaflestad
8e9e0b0977 Group Data: Conditionally Enable Debug Output
This commit switches the group control debug output to std::cout
into a conditional mode that is controlled by a file-wide PP symbol

    ENABLE_GCNTL_DEBUG_OUTPUT

that we set to zero here.  This allows the developers to turn on
additional debug output when needed without confusing those who are
not actively working on the feature.
2020-06-22 17:35:42 +02:00
Gaute Lindkvist
474d4a90dc Add more metadata to setup.py for pypi page 2020-06-19 14:56:12 +02:00
Atgeirr Flø Rasmussen
3cda13c7a2 Merge pull request #1831 from akva2/fix_missing_config_h_include
fixed: include config.h for HAVE_OPENMP
2020-06-19 14:55:49 +02:00
Gaute Lindkvist
29bb9f05be Add simple pypi howto 2020-06-19 13:38:55 +02:00
Cintia Goncalves Machado
784abc7069 deleteSolidPhasefromPhases 2020-06-19 13:31:33 +02:00
Joakim Hove
ae28999d5b Merge pull request #1829 from akva2/janitoring
Some janitoring
2020-06-19 13:09:12 +02:00
Arne Morten Kvarving
4bc00663ea fixed: include config.h for HAVE_OPENMP 2020-06-19 12:55:04 +02:00
Arne Morten Kvarving
970d6339dd fixed: forward struct as struct 2020-06-19 11:52:12 +02:00
Arne Morten Kvarving
d7bdb448f5 add some trivial checks to avoid unused variable warnings 2020-06-19 09:43:48 +02:00
Arne Morten Kvarving
841124a47d mark variable maybe_unused to avoid compiler warnings
unused without openmp
2020-06-19 09:43:34 +02:00
Atgeirr Flø Rasmussen
146e5930e2 Merge pull request #1828 from joakim-hove/remove-unused
Remove unused variable
2020-06-19 06:54:51 +02:00
Joakim Hove
216a220ee8 Remove unused variable 2020-06-18 22:34:24 +02:00
Arne Morten Kvarving
29010dd7e3 Merge pull request #1823 from joakim-hove/action-state
Add class Action::State to keep track of ACTIONX count
2020-06-18 19:15:17 +02:00
Joakim Hove
dd1591f1a2 Use Action::State object to keep track of actions being run 2020-06-18 16:45:39 +02:00
Joakim Hove
f54245f1ca Add class Action::State to keep track of ACTIONX count 2020-06-18 16:45:39 +02:00
Joakim Hove
7d856b4933 Add id member to ActionX objects 2020-06-18 16:45:39 +02:00
Gaute Lindkvist
16505b421a Rename package to lowercase 'opm' instead of 'Opm' 2020-06-18 10:32:05 -04:00
Gaute Lindkvist
5515422d02 Add docker files and scripts for creating cross-distro PyPI packages 2020-06-18 10:32:05 -04:00
Bård Skaflestad
2123884655 Merge pull request #1408 from jalvestad/extend_udq_actx_rst
Changes to extend and improve the ECL-compatible restart
2020-06-18 16:29:52 +02:00
Cintia Goncalves Machado
6ab09afb0c fixPermFactTest 2020-06-18 16:23:41 +02:00
Bård Skaflestad
35100cc8bb Merge pull request #1827 from akva2/janitoring
anonymize to quell unused parameter warning
2020-06-18 09:50:08 +02:00
Arne Morten Kvarving
8d3680c7b5 anonymize to quell unused parameter warning 2020-06-18 08:27:48 +02:00
Joakim Hove
986f0acad7 Merge pull request #1826 from akva2/add_missing_initializer
fixed: add missing initializer
2020-06-17 15:44:22 +02:00
Joakim Hove
0edc9acc48 Merge pull request #1825 from joakim-hove/gpmaint-serialize-fix
Fix: bug in serializer function for GPMaint class
2020-06-17 15:29:43 +02:00
Arne Morten Kvarving
643b8b179d fixed: add missing initializer 2020-06-17 14:32:42 +02:00
Joakim Hove
3478263de9 Fix: bug in serializer function for GPMaint class 2020-06-17 12:45:23 +02:00
Gaute Lindkvist
cbd23e71ef Add generation of a setup-package.sh script for creating PyPI-packages 2020-06-16 13:08:33 +02:00
Gaute Lindkvist
9ed75f030b Rename python/python folder to python/opm
This makes bdist_wheel find and add the library binary files.
2020-06-16 13:08:33 +02:00
Gaute Lindkvist
e3bb9a3151 README.md file skeleton for Python package 2020-06-16 13:08:33 +02:00
Gaute Lindkvist
85f8c7b37d Add more metadata to Python setup.py 2020-06-16 13:08:33 +02:00
Gaute Lindkvist
6db3ccf36f Add link flags to Python setup.py 2020-06-16 13:08:33 +02:00
Gaute Lindkvist
f67bce1dd8 Add link directories to Python setup.py 2020-06-16 12:52:34 +02:00
Markus Blatt
8c6cd2f10f Merge pull request #1810 from blattms/support-pinch-nogap
Support querying GAP/NOGAP mode for Pinch form EclipseGrid.
2020-06-15 17:27:15 +02:00
Jostein Alvestad
0679d2b233 corrections to SGRP - index error > 0. 2020-06-15 09:55:46 +02:00
Jostein Alvestad
7d3df69416 Corrected an errors and a misprint 2020-06-15 09:55:44 +02:00
Jostein Alvestad
1751120b79 corrected logic error in AggregateWellData.cpp 2020-06-15 09:55:42 +02:00
Jostein Alvestad
c846716044 add variable to hold min value of nonzero uda 2020-06-15 09:55:40 +02:00
Jostein Alvestad
fea794ee17 further corrections of unit tests and code clean up 2020-06-15 09:55:38 +02:00
Jostein Alvestad
862b7b7591 clean up code - correct unit tests 2020-06-15 09:55:36 +02:00
Jostein Alvestad
ec976db684 correction for lift quantity well-data
corrections to IUAD and IUAP

various improvements of E100 compatible restart file

add debug output

additonal debug print

corrected loop placement for active prod/inj wells

remove debug print and clean up code
2020-06-15 09:55:34 +02:00
Joakim Hove
985cb279ff Allow negative rates when evaluating UDA values
corrections to iwel[10] open/shut flag

further corrections SWEL for handling udq-restarts correctly

further changes to get correct SWEL in ECL-Restart file

added comment to clarify change

correction to group sequence and group controls for EclRST-file

changes to correct IGRP[NWGMAX+5]

corrected compile errors/warnings

further minor code corrections

initial changes to include group current Prod/inj Constraint in summary file

further changes to currentsStatusGroupControl to Summary output

further corrections and additions of Field current controls

further corrections for IGRP

minor corrections to code style

corrections for tests

changes to correct test_AggregateWellData

a few more initial changes for next version of igrp/sgrp

changes to igrp & sgrp according to tests

changes to handle special conditions at report step 0

corrections due to changes in Summary.cpp

changes to improve code quality and robustness

Add default value to igrp[nwgmax+5]

corrections and code improvements base on testing

corrections to handling of GCONINJE

further corrections for IGRP

even further corrections IGRP

changes to correct SGRP

correction to IGRP defaults

corrections to SWEL and IGRP

further corrections for IGRP

removed some comments
2020-06-15 09:55:27 +02:00
Bård Skaflestad
88414fd1fc Merge pull request #1822 from joakim-hove/use-hours
Use 'HOURS' as time unit in LAB unit summary files
2020-06-13 12:27:01 +02:00
Joakim Hove
1dc3a67cf1 Use 'HOURS' as time unit in LAB unit summary files 2020-06-13 07:46:47 +02:00
Joakim Hove
84aa2f77f3 Merge pull request #1820 from joakim-hove/udq-nan-values
UDQSet will check for nan values
2020-06-12 13:49:24 +02:00
Joakim Hove
0841e4f398 Merge pull request #1797 from joakim-hove/GPMAINT
Add code to internalize GPMAINT keyword in Group objects
2020-06-12 12:19:20 +02:00
Joakim Hove
10b2b2ac48 Add caching of well and group names in SummaryState 2020-06-12 12:07:04 +02:00
Joakim Hove
082820380d Ensure that all values in UDQSet are finite 2020-06-12 09:12:55 +02:00
Joakim Hove
213c6fb6ad Add function SummaryState::update_udq() to add variables from UDQSet 2020-06-12 09:12:55 +02:00
Joakim Hove
90d1d992e5 Ensure that evaluated UDQSet have the correct name 2020-06-12 09:12:55 +02:00
Joakim Hove
172c0b1aa6 Make sure invalid UDQ values are deleted from SummaryState 2020-06-12 09:12:55 +02:00
Joakim Hove
669918547a Add del() method to SummaryState 2020-06-12 09:12:55 +02:00
Joakim Hove
b07bd377cd Merge pull request #1819 from joakim-hove/aicd
Aicd
2020-06-12 09:12:18 +02:00
Atgeirr Flø Rasmussen
e08a3666e3 Merge pull request #1818 from atgeirr/fix-nupcol-runspec
Handle NUPCOL in RUNSPEC correctly
2020-06-11 20:50:30 +02:00
Bård Skaflestad
be57558804 Merge pull request #1630 from bska/new-rst-tags
New Solution Vector Tag for Restart File Output
2020-06-11 17:09:42 +02:00
Bård Skaflestad
a4a04ebf51 Restart Tag System: Introduce Tag for OPM Extended Vectors
This is intended to supersede the RESTART_AUXILIARY tag.  There is
no practical difference between vectors that are needed for restart
and vectors that are not needed for restart.  They all go into the
SOLUTION section of a restart file.

Vectors tagged as RESTART_OPM_EXTENDED will not be output unless the
user does requests OPM-extended restart files.
2020-06-11 14:31:53 +02:00
Bård Skaflestad
4fcd85526a Solution Output: Refactor Stages Out to Helper Functions
Mostly to reduce the level of complexity of the 'writeSolution'
function.  While here, also ensure that we never write solution data
outside the STARTSOL/ENDSOL demarcations.  Even if we emit vectors
that are not known to ECLIPSE, we should not write them outside of
the SOLUTION section.
2020-06-11 14:31:53 +02:00
Joakim Hove
224911bd10 Add implementation for autonomous ICD: AutoICD 2020-06-11 11:38:29 +02:00
Joakim Hove
73a244ceda Templated internalizing of WSEGSICD keyword 2020-06-11 11:38:29 +02:00
Joakim Hove
4c100d0bd5 Update json scheme to ensure that WSEGSICD is subset of WSEGAICD 2020-06-11 11:38:29 +02:00
Joakim Hove
0f032d6fca Merge pull request #1801 from joakim-hove/icd-variant
Use std::variant<> to hold ICD alternatives
2020-06-11 11:31:58 +02:00
Joakim Hove
6090470045 Add code to internalize GPMAINT keyword in Group objects 2020-06-11 09:40:55 +02:00
Atgeirr Flø Rasmussen
0c6d1c31d7 Implement and use Runspec::nupcol(). 2020-06-11 07:44:49 +02:00
Bård Skaflestad
9396d44379 Merge pull request #1770 from bska/add-tolcrit
Add Support for TOLCRIT to Sat-Func Field Properties
2020-06-10 19:19:07 +02:00
Joakim Hove
dae980ddd5 Hide away templated convert function 2020-06-10 16:36:33 +02:00
Bård Skaflestad
f61882ce69 Critical Saturation: Refactor Helper Functions
In particular, add two new helper functions

    crit_sat_increasing_KR
    crit_sat_decreasing_KR

which identify the critical saturations under the assumption of a
relative permeability curve that increases viz decreases as a
function of the specified phase saturation.  Those helpers in turn
call a wrapper around std::lower_bound() and std::distance() to
affect the actual table scan.

Reimplement the 'critical_*()' helper functions in terms of
crit_sat_*_KR() to remove duplicated logic.
2020-06-10 14:33:01 +02:00
Bård Skaflestad
abec96a387 Sat-Func Initializers: Add TOLCRIT Support
This commit makes the 'critical_*()' helper functions aware of the
TOLCRIT feature.  We now consider a phase to be immobile at a one
saturation value if its relative permeability at that saturation is
less than or equal to TOLCRIT.  TOLCRIT mirrors E100's default value
of 1.0e-6 unless otherwise specified in the PROPS section.

All table scanners are implemented in terms of the expression

    std::lower_bound(begin, end, tolcrit, predicate)

which ultimately returns the first position in [begin, end) for
which

    predicate(*iter, tolcrit)

is false.  Using predicate = std::greater<>{} thus determines the
first position in the sequence for which the elements is less than
or equal to 'tolcrit'.  Similarly, a predicate equivalent to '<='
returns the first position for which the elements is strictly
greater than 'tolcrit'.

Add a set of unit tests to demonstrate and exercise the new feature.
2020-06-10 14:33:01 +02:00
Bård Skaflestad
bcdc8bb119 Table Output: Revise TOLCRIT Interpretation
This commit switches the previous interpretation of notionally zero
relative permeability in Flow's .INIT-file output.  We now treat all
relative permeability values less than *or equal to* TOLCRIT as
zero.

This change is for increased ECLIPSE compatibility.
2020-06-10 14:33:01 +02:00
Bård Skaflestad
83429bf908 Sat-Func Initializers: Pass TOLCRIT to Table-Scanning Layer
This is a pure API change.  The TOLCRIT value is not yet used as
part of determining the critical saturations.

While here, also add a unit test for getRawTableEndPoints() and
update the existing sat-func property unit tests to explicitly pass
TOLCRIT = 0 in preparation of adding actual TOLCRIT support.
2020-06-10 14:33:01 +02:00
Bård Skaflestad
83af852efe Capture SatFunc Controls In FieldProps
This is in preparation of threading the TOLCRIT value-defaulted or
not-through to the end-point scanning code.
2020-06-10 14:33:01 +02:00
Bård Skaflestad
f0f3764b89 Sat-Func Initializers: Expose RawTableEndPoints to Caller
This commit requires that the callers of satfunc::init() calculate
the raw table end-points.  That, in turn, enables callers to cache
those end-point values to avoid repeated calculations.

Add a new member, m_rtep, to FieldProps to act as such a cache to
take advantage of the new ability.
2020-06-10 14:33:01 +02:00
Gaute Lindkvist
d3b4f41acf Support building Python module statically 2020-06-10 14:30:38 +02:00
Gaute Lindkvist
a2d52dcc0b Add versioning to python/setup.py 2020-06-10 14:30:38 +02:00
Gaute Lindkvist
2f6d4a8f84 Improve string comparison in install.py to remove warning 2020-06-10 14:08:38 +02:00
Atgeirr Flø Rasmussen
80f6a5d1ed Add failing test for NUPCOL in RUNSPEC. 2020-06-10 13:17:04 +02:00
Bård Skaflestad
6a742a20fd Merge pull request #1705 from GitPaean/segment_keywords_regreesion_test
attempting to adding segment summary keywords for regression test
2020-06-10 12:40:41 +02:00
Joakim Hove
8320b89d90 Merge pull request #1817 from akva2/disable_warnings_flag
add a cmake flag to disable warnings
2020-06-10 11:13:06 +02:00
Kai Bao
405e3e1add attempting to adding segment summary keywords for regression test 2020-06-10 10:39:45 +02:00
Joakim Hove
afd5c3153a Use value based semantics for Segment -> valve 2020-06-10 06:35:03 +02:00
Joakim Hove
b1250c2f7a Use std::variant<> to hold ICD alternatives 2020-06-10 06:35:03 +02:00
Arne Morten Kvarving
64cbbdde65 add a cmake flag to disable warnings 2020-06-09 15:11:44 +02:00
Joakim Hove
b73f4aa5dc Merge pull request #1811 from joakim-hove/rst-segment-connection-refactor
Reshuffle segments and connections after restart
2020-06-09 07:08:37 +02:00
Joakim Hove
9faa824258 Merge pull request #1814 from OPM/fix/include-required-header
[parser] include required header
2020-06-09 07:04:56 +02:00
Joakim Hove
630a4a85ec Merge pull request #1816 from bska/empty-default-udq-ustr
SMSPEC: Emit Empty Unit String if UDQ Unit Undefined
2020-06-09 07:04:00 +02:00
Bård Skaflestad
adcb9c54b8 SMSPEC: Emit Empty Unit String if UDQ Unit Undefined
This is guided by ECLIPSE.
2020-06-08 23:19:26 +02:00
Bård Skaflestad
e129f74304 Merge pull request #1815 from tskille/issue_with_esmry
fixing invalid write in src/opm/io/eclipse/ESmry.cpp
2020-06-08 22:17:35 +02:00
Torbjørn Skille
947d3fec99 fixing invalid write in src/opm/io/eclipse/ESmry.cpp 2020-06-08 20:33:10 +02:00
Bernd Flemisch
27e310d436 [parser] include required header 2020-06-08 15:23:52 +02:00
Atgeirr Flø Rasmussen
229a619a85 Merge pull request #1812 from akva2/move_timestamp
changed: move build timestamp to separate header
2020-06-08 12:52:19 +02:00
Arne Morten Kvarving
1d3843cef1 changed: move build timestamp to separate header
to avoid rebuilds for things only needing project versions
2020-06-08 10:06:03 +02:00
Joakim Hove
7a88808ccb Add Segment::updateValve() overload which does not take length arg 2020-06-07 09:09:26 +02:00
Joakim Hove
31b6baa676 Reshuffle segments and connections after restart 2020-06-07 09:09:15 +02:00
Joakim Hove
0daac0b9e3 Merge pull request #1804 from joakim-hove/segment-perf-length
Segment perf length
2020-06-05 11:05:24 +02:00
Joakim Hove
5b51c57a5e Update SpiralICD scaling factor during initialization 2020-06-05 08:00:53 +02:00
Joakim Hove
bf3f8e1b08 Merge pull request #1809 from joakim-hove/refactor-compsegs
Refactor COMPSEGS handling
2020-06-04 22:58:01 +02:00
Markus Blatt
23dd41ba38 Support querying GAP/NOGAP mode for Pinch form EclipseGrid.
While we currently only support GAP and do not need this,
we will need it eventually to support NOGAP in the simulator.
2020-06-04 20:19:51 +02:00
Joakim Hove
6b468787c8 Refactor COMPSEGS handling
When handling the COMPSEGS keyword the connections are updated with segment
number and the segments are updated with total perforated length. The new
Compsegs::processCOMPSEGS() function will create new updated copies of both
WellSegments and WellConnections.
2020-06-04 16:57:40 +02:00
Joakim Hove
5b0045d4a5 Merge pull request #1808 from joakim-hove/sicd-refactor-step0
Sicd refactor step0
2020-06-04 15:58:08 +02:00
Joakim Hove
6e60ebfc74 Merge pull request #1807 from akva2/fix_invalid_deref
fixed: reorder logging and update call
2020-06-04 14:50:53 +02:00
Arne Morten Kvarving
c620d392d2 fixed: reorder logging and update call
the update call can invalidate the reference since the underlying
smart pointer is replaced, and when there are no remaining references,
it is deleted.
2020-06-04 13:16:18 +02:00
Cintia Goncalves Machado
628afd7abe finalizeSaltTables 2020-06-04 11:43:59 +02:00
Joakim Hove
1b2fc9a7fa Add new function to calculate total perforated length for segment 2020-06-03 08:28:53 +02:00
Joakim Hove
dcec08767d Add member perf_length to Segment class 2020-06-03 08:28:53 +02:00
Joakim Hove
7b33ab4519 Merge pull request #1805 from hakonhagland/glift_setters
Added some getters for LIFTOPT.
2020-06-02 11:00:54 +02:00
Håkon Hægland
f7d2631a57 Added const keyword to getters.
The access method should be marked as const so to make the compiler
aware that they should not modify the state of the object.
2020-06-02 09:20:54 +02:00
Håkon Hægland
c6d49a4b44 Added some getters for LIFTOPT.
Added getters for gaslift_increment() and min_eco_gradient() in
the Opm::GasLiftOpt class.
2020-06-02 07:21:01 +02:00
Bård Skaflestad
475dde4bb1 Merge pull request #1803 from joakim-hove/all-shut-message
All shut message
2020-06-01 23:37:17 +02:00
Joakim Hove
998b555662 Move message "All connections shut -> shut well" 2020-06-01 20:02:06 +02:00
Joakim Hove
80bd81c892 Remove commented out code 2020-06-01 08:59:38 +02:00
Bård Skaflestad
f7b2bb4a07 Merge pull request #1802 from atgeirr/clang-is-not-gcc
Ensure clang uses the normal standard headers.
2020-05-29 16:26:20 +02:00
Atgeirr Flø Rasmussen
937747323d Ensure clang uses the normal standard headers.
Clang defines __GNUC__ to 4, as that represents its level of
support for the GNU C dialect. The gcc compiler does not provide
a macro indicating the compiler separately from the dialect supported.
We must therefore use the __clang__ macro to avoid false positives.
2020-05-29 14:31:37 +02:00
Atgeirr Flø Rasmussen
1a1bb29a13 Merge pull request #1800 from atgeirr/bump-version
Bump version number
2020-05-29 13:34:28 +02:00
Joakim Hove
ccf3f150f2 Merge pull request #1798 from joakim-hove/aicd
Rename SpiralICD -> SICD
2020-05-29 07:24:38 +02:00
Joakim Hove
4fbfe3b8ec Merge pull request #1799 from joakim-hove/halvor_opm_restart
Halvor opm restart
2020-05-28 17:41:59 +02:00
Atgeirr Flø Rasmussen
f783282f49 Bump version number 2020-05-28 16:50:26 +02:00
Joakim Hove
4e7ac10320 Explicitly mark const overload in Python binding 2020-05-28 16:21:14 +02:00
hnil
7db2cc0c2e add new function to make input and output definitions uniform for example for forward runs 2020-05-28 16:08:34 +02:00
hnil
2c04ada035 added unification of inputoutput 2020-05-28 16:08:34 +02:00
hnil
e3d39a8b64 changes to be able to set request for restart. Also change the parallel restart to read uniform output 2020-05-28 16:08:34 +02:00
Markus Blatt
0352258f22 Merge pull request #1796 from blattms/require-disabled-packages
Send error for required but disabled packages.
2020-05-28 11:48:01 +02:00
Joakim Hove
7df0577a58 Rename SpiralICD -> SICD 2020-05-28 11:03:24 +02:00
Bård Skaflestad
49e2099436 Merge pull request #1795 from bska/thp-restart-support
Add Restart I/O Support for Well's THP
2020-05-20 15:07:56 +02:00
Markus Blatt
9452796c57 Send error for required but disabled packages.
When using CMAKE_DISABLE_FIND_PACKAGE_<name>=ON for a required package
CMake did not issue an errors since we never trigger the find_package
call. With this commit we now check whether such package is required
and send an error.
2020-05-20 14:55:52 +02:00
Bård Skaflestad
c71ffd1415 Add Restart I/O Support for Well's THP
This commit adds support for saving and restoring a well's THP
quantitiy.  We put the THP into the summary facility's list of
"required restart quantities" and pick up the value converted to
output units from the SummaryState.

On restart we restore the THP value to internal (SI) units and
transport the value to the simulator in data::Well::thp.  While
here, also add the THP value to the RstWell object although
currently not strictly needed in that context.
2020-05-19 22:20:55 +02:00
Bård Skaflestad
88f8313568 Merge pull request #1793 from OPM/fix/add-missing-includes
add some missing includes
2020-05-19 21:35:57 +02:00
Bård Skaflestad
7194463033 Merge pull request #1794 from OPM/fix/designated-initializer
avoid designated initializer error
2020-05-19 21:34:44 +02:00
Bernd Flemisch
283da4d2b6 [test] avoid designated initializer error 2020-05-19 13:03:45 +02:00
Bernd Flemisch
54f08156ad add some missing includes 2020-05-19 12:59:22 +02:00
Bård Skaflestad
0d9eda9b76 Merge pull request #1792 from bska/restart-guiderate-locations
Restart: Prepare to Output Well/Group Guide Rates
2020-05-18 23:43:11 +02:00
Bård Skaflestad
317d1ba14e Restart: Prepare to Output Well/Group Guide Rates
This commit identifies vector items in XWEL and XGRP that hold guide
rate values at the well and group levels, and adds functionality to
output those values to the restart file.  We do not identify such
value at the FIELD level.  As with other summary-like quantities, we
expect to pick up the fully converted values from a SummaryState
object.

Calculating and storing the guide rate quantities in SummaryState is
the subject of future work.
2020-05-18 21:56:57 +02:00
Joakim Hove
598f0e9056 Merge pull request #1791 from joakim-hove/group-index-offset
Fix group number used in IUAP restart array
2020-05-18 17:37:52 +02:00
Bård Skaflestad
6f45df5e93 Merge pull request #1790 from joakim-hove/network-vfp0
When defining branch properties: vfp == 0 should delete branch
2020-05-16 00:46:58 +02:00
Joakim Hove
0aa5fd9f09 Fix group number used in IUAP restart array 2020-05-15 16:26:57 +02:00
Bård Skaflestad
5560f43a8c Merge pull request #1782 from hnil/abs_convergence
changed rootfinders to return also when absolute tolerance is less th…
2020-05-15 15:19:33 +02:00
Joakim Hove
66acfb5249 When defining branch properties: vfp == 0 should delete branch 2020-05-15 14:21:44 +02:00
Joakim Hove
d1babffa8b Merge pull request #1789 from joakim-hove/udqactive-gconprod
Make sure the UDQ usage in GCONPROD is recorded
2020-05-15 13:17:02 +02:00
hnil
47df32ef1a fixed the tolerance also in RegulaFalsiBisection 2020-05-15 08:55:38 +02:00
Joakim Hove
fd5a42801f Make sure the UDQ usage in GCONPROD is recorded 2020-05-15 08:27:52 +02:00
Atgeirr Flø Rasmussen
7cff27c801 Merge pull request #1788 from atgeirr/fix-missing-openmp
Let make_lodsmry also work without OpenMP.
2020-05-14 19:11:51 +02:00
Atgeirr Flø Rasmussen
28f3df5259 Let make_lodsmry also work without OpenMP. 2020-05-14 16:58:51 +02:00
Bård Skaflestad
162e0b53cd Merge pull request #1787 from atgeirr/add-missing-include
Add missing <array> include.
2020-05-14 15:43:45 +02:00
Atgeirr Flø Rasmussen
1593df2a32 Add missing <array> include. 2020-05-14 13:45:46 +02:00
Bård Skaflestad
3a8ea856bc Merge pull request #1785 from tskille/lod_esmry
Lod esmry
2020-05-14 10:55:19 +02:00
Torbjørn Skille
c430eeb374 Adding support for LODSMRY file
> implemented for unified and multiple, and for formatted and binary summary files
 > avaliable/used only when loadBaserun is false (default)
2020-05-14 07:39:23 +02:00
Torbjørn Skille
9766e0ebb3 using file handling functions from stdio.h for lod in ESmry
> improved read efficiency compared with fstream routines

Also fixed bug with lod for formatted unified summary when number of vectors larger than max block size
2020-05-11 21:39:57 +02:00
Bård Skaflestad
0756cd93ad Merge pull request #1783 from joakim-hove/fp-operate-maxlim
Fp operate maxlim
2020-05-11 21:21:55 +02:00
Bård Skaflestad
355fb2aabb Merge pull request #1784 from joakim-hove/guderate-def-init
Initialize group production guide_rate to Target::NONE
2020-05-11 19:04:40 +02:00
Joakim Hove
ebdffa2abb Ensure correct SI conversion for the scalar data in OPERATE keyword 2020-05-11 15:45:01 +02:00
Joakim Hove
ce368bb850 Initialize groups GuideRate target to NONE 2020-05-11 12:53:37 +02:00
Joakim Hove
9065bf2390 Remove dummy/unit dimension for NTG 2020-05-11 12:15:09 +02:00
hnil
ded8ef1a66 changed rootfinders to return also when absolute tolerance is less than prescribed, not only when function value is less than tolerance. 2020-05-10 22:32:01 +02:00
Joakim Hove
55620ac254 Merge pull request #1781 from joakim-hove/gtnode-bug
Bug: pointer -> to stack variable - fix with parent *name*
2020-05-08 09:20:52 +02:00
Joakim Hove
64fb589ec6 Use string based parent *name* in GTNode instead of pointer 2020-05-07 20:08:39 +02:00
Joakim Hove
310bd82b8b Merge pull request #1778 from joakim-hove/gas-lift-opt
Internalize keywords for Gas Lift Optimization
2020-05-07 20:07:58 +02:00
Joakim Hove
e05e6f83ea Merge pull request #1772 from atgeirr/fix-starttime-actionx
Fix start-time of ACTIONX actions.
2020-05-07 18:38:26 +02:00
Joakim Hove
18cd60cd86 Merge pull request #1780 from berland/solvdirs-size
Add size to SOLVDIRS json
2020-05-07 16:33:23 +02:00
Joakim Hove
7fe89422e2 Internalize keywords for gas lift optimization 2020-05-07 16:29:42 +02:00
Håvard Berland
8346941b92 Add size to SOLVDIRS json 2020-05-07 15:35:49 +02:00
Joakim Hove
b311cef875 Merge pull request #1776 from joakim-hove/zwel-fix
Make sure the action name is only added to ZWEL when it is true
2020-05-07 11:04:18 +02:00
Bård Skaflestad
3065218e6d Merge pull request #1779 from joakim-hove/fixup-network
Fix: integrate ExtNetwork instance in Schedule serialization
2020-05-07 09:56:00 +02:00
Joakim Hove
ea14bf2298 Fix: integrate ExtNetwork instance in Schedule serialization 2020-05-06 21:10:52 +02:00
Joakim Hove
3c879dd5dc ActionResult will not access wells if overall false 2020-05-06 12:48:38 +02:00
Joakim Hove
dc9ba1dc56 Minor white space cleanup 2020-05-05 19:13:32 +02:00
Joakim Hove
c073ad2d8b Make sure Action result is checked before wells are considered 2020-05-05 19:03:22 +02:00
Joakim Hove
352cc5797b Make sure the action name is only added to ZWEL when it is true 2020-05-05 18:00:29 +02:00
Bård Skaflestad
26cdff10fc Merge pull request #1775 from totto82/fixSolvent
Allow for mixing of SOF2 from familiy 2 and family 1 for 3p + solvent
2020-05-05 15:14:44 +02:00
Tor Harald Sandve
c73c83d317 Allow for mixing of SOF2 from familiy 2 and family 1 for 3p solvent models 2020-05-05 11:52:30 +02:00
Atgeirr Flø Rasmussen
5e985cfaf3 Fix start-time of ACTIONX actions. 2020-05-05 10:09:09 +02:00
Joakim Hove
94ab966c1b Merge pull request #1774 from atgeirr/fix-actionx-testcase
Remove group list in test file
2020-05-05 09:11:44 +02:00
Atgeirr Flø Rasmussen
3cb39f8bd4 We do not handle lists of groups.
Addressed by removing such a list (replace with the single
group matching pattern) in a test case.
2020-05-05 08:28:10 +02:00
Joakim Hove
f8e7c4eee0 Merge pull request #1773 from joakim-hove/group-level-report
Group level report
2020-05-04 21:46:53 +02:00
Williham Williham Totland
5e981cc74b Corrects all_nodes implementation. 2020-05-04 18:29:48 +02:00
Williham Williham Totland
54ced2e368 Implements Group Level report. 2020-05-04 18:29:48 +02:00
Williham Williham Totland
8af0d505cf Implements GTNode::level and GTNode::all_nodes. 2020-05-04 18:29:08 +02:00
Joakim Hove
c22a7e5b46 Merge pull request #1765 from wito/group-hierarchy-report
Implementing Group Hierarchy Report
2020-05-04 18:27:33 +02:00
Joakim Hove
44af497f8a Merge pull request #1771 from joakim-hove/welspecs-report-refactor
Use proper Connection::perf_range() when creating WELSPECS MSW report
2020-05-04 12:19:23 +02:00
Joakim Hove
c8e81f32fb Merge pull request #1763 from joakim-hove/weltarg-uda
Weltarg uda
2020-05-04 11:54:19 +02:00
Joakim Hove
afc7f5d2f2 Use proper Connection::perf_range() when creating WELSPECS MSW report 2020-05-04 10:46:32 +02:00
Joakim Hove
9b370dcad1 Merge pull request #1739 from wito/welspecs-report-refactor
Add Unit System awareness to WELSPECS reports
2020-05-04 10:46:20 +02:00
Joakim Hove
35dc429aa4 Sort IUAD output vectr on UDQ input index 2020-05-04 10:23:16 +02:00
Joakim Hove
5c2a8b9fc4 Update UDQActive when UDA is used in WELTARG 2020-05-04 10:23:00 +02:00
Joakim Hove
9a4c8f754e Change type of new value argument in WELTARG to UDA 2020-05-04 08:29:34 +02:00
Håvard Berland
f6318ee271 WELTARG keyword can have UDA-data in E100 2020-05-04 08:29:34 +02:00
Joakim Hove
ef77be1508 Refactor ScheduleTests to use fixture function 2020-05-04 08:29:34 +02:00
Joakim Hove
4fa0c93ff7 Merge pull request #1759 from joakim-hove/rename-segdist
Connection - Segment interaction implemented with optional pair
2020-05-01 08:52:03 +02:00
Bård Skaflestad
021d946a96 Merge pull request #1769 from joakim-hove/is-udq-regexp
Update regexp to allow for digits in UDQ name
2020-04-30 16:32:17 +02:00
Joakim Hove
8b70e42e0f Connection - Segment interaction implemented with optional pair 2020-04-30 14:54:21 +02:00
Joakim Hove
94defc8a08 Merge pull request #1768 from atgeirr/add-missing-include
Add missing include statement.
2020-04-30 12:28:19 +02:00
Joakim Hove
29dd594d48 Update regexp to allow for digits in UDQ name 2020-04-30 12:10:34 +02:00
Joakim Hove
b8ab03b22b Merge pull request #1767 from joakim-hove/remove-unused-include
Remove #include which is not needed
2020-04-30 12:03:39 +02:00
Atgeirr Flø Rasmussen
b9cdaafed3 Add missing include statement. 2020-04-30 11:55:32 +02:00
Williham Williham Totland
87ca9077ea Implements group hierarchy data subreport. 2020-04-30 10:27:12 +02:00
Joakim Hove
57cfeeb854 Remove #include which is not needed 2020-04-30 10:23:44 +02:00
Joakim Hove
e4c6cc3de0 Merge pull request #1764 from akva2/fix_focal_packaging
changed: remove multiarch-support predepends
2020-04-30 10:21:15 +02:00
Williham Williham Totland
4663e49e23 Group hierarchy report interface. 2020-04-30 09:33:06 +02:00
Arne Morten Kvarving
58269dd675 changed: remove multiarch-support predepends
no longer required in ubuntu bionic, and breaks ubuntu focal,
and in any case it is support by both platforms.
2020-04-30 09:12:50 +02:00
Bård Skaflestad
fc69eb7b72 Merge pull request #1746 from joakim-hove/network
Network
2020-04-29 17:00:54 +02:00
Joakim Hove
c7008d329a Add class ExtNetwork for extended networks 2020-04-29 15:45:18 +02:00
Bård Skaflestad
27b348b013 Merge pull request #1749 from bska/fix-krgr
Fix Default Value Initializers for Field Properties KR*R
2020-04-29 14:32:58 +02:00
Bård Skaflestad
79bb8386d3 Sat-Func Initializers: Add End-Point Unit Tests
Exercises the initializers for SW{L,CR,U}, SO{W,G}CR, SG{L,CR,U}, as
well as the function values KRW, KRWR, KRG, KRGR, KRO, KRORW, KRORG
and capillary pressure function values PCW and PCG.

Example data from region one (1) of

    opm-tests/model1/include/sattab_basemod1.sattab

Example phrased both as family I (S*OF) and as family II (S*FN, SOF3).
2020-04-29 13:33:51 +02:00
Bård Skaflestad
146be0aa21 SOGCR: Pull SGOF Handling Into Initializer
This is in any case needed to calculate correct KRGR default values
in runs using family I saturation function keywords (S*OF) and also
removes the need to apply the special 'subtract_swl' operation in
this case.  Overall this is a simplification of the code since we
now have all saturation end-points available when initializing
saturation function field properties.
2020-04-29 13:33:51 +02:00
Bård Skaflestad
137ef7a17b Sat-Func Initializers: Use RawTableEndPoints for KRGR
This commit reimplements the findKrgr helper function in terms of
the RawTableEndPoints aggregate.  In particular, this commit aims to
underscore the fact that KRGR is the relative permeability of gas at
the displacing saturation

    1 - Socr - Swco

This fact is hopefully more apparent in this revised than the
existing implementation since we now rely explicitly on evaluating
the 'KrgColumn' at an index derived from looking up that saturation
value in the pertinent saturation column.
2020-04-29 13:33:51 +02:00
Bård Skaflestad
c8048021d1 Sat-Func Initializers: Use RawTableEndPoints for KRWR
This commit reimplements the findKrwr helper function in terms of
the RawTableEndPoints aggregate.  In particular, this commit aims to
underscore the fact that KRWR is the relative permeability of water
at the displacing saturation

    1 - Socr - Sgco

This fact is hopefully more apparent in this revised than the
existing implementation since we now rely explicitly on evaluating
the 'KrwColumn' at an index derived from looking up that saturation
value in the pertinent saturation column.
2020-04-29 13:33:51 +02:00
Bård Skaflestad
58764a6ec6 Sat-Func Initializers: Use RawTableEndPoints for KRORW
This commit reimplements the findKrorw helper function in terms of
the RawTableEndPoints aggregate.  In particular, this commit aims to
underscore the fact that KRORW is the relative permeability of oil
in the Oil/Water system at the displacing saturation

    1 - Swcr - Sgco

This fact is hopefully more apparent in this revised than the
existing implementation since we now rely explicitly on evaluating
the 'KrowColumn' at an index derived from looking up that saturation
value in the pertinent saturation column.
2020-04-29 13:33:51 +02:00
Bård Skaflestad
b17b4c1375 Sat-Func Initializers: Use RawTableEndPoints for KRORG
This commit reimplements the findKrorg helper function in terms of
the RawTableEndPoints aggregate.  In particular, this commit aims to
underscore the fact that KRORG is the relative permeability of oil
in the Oil/Gas system at the displacing saturation

    1 - Sgcr - Swco

This fact is hopefully more apparent in this revised than the
existing implementation since we now rely explicitly on evaluating
the 'KrogColumn' at an index derived from looking up that saturation
value in the pertinent saturation column.
2020-04-29 13:33:51 +02:00
Bård Skaflestad
3817524f52 Sat-Func Initializers: Adjust Whitespace and Fix a Variable Name
The name 'max_krw' reflects the actual value better than the
existing name 'krwr'.
2020-04-29 13:33:51 +02:00
Bård Skaflestad
f6cfadd62f Sat-Func Initializers: Use Precalculated Endpoints Where Possible 2020-04-29 13:33:51 +02:00
Bård Skaflestad
af34e083c2 Sat-Func Initializers: Include <algorithm> and <iterator>
Needed to bring in declarations of std::distance, std::reverse, and
std::upper_bound.
2020-04-29 13:33:51 +02:00
Bård Skaflestad
2984cca164 Sat-Func Properties: Provide All Raw Endpoints to All Initializers
This is in preparation of fixing the initializers for the KR*R
properties.  The default values here generally depend on critical
and connate saturations of other phases extracted from the raw input
table values.  This commit therefore creates an aggregate structure

    RawTableEndPoints

that collects the connate gas and water saturations, the full set of
critical saturations, and the maximum gas and water saturations from
all input tables (meaning for all regions and drainage/imbibition
regime designators).  Each *Endpoint() function furthermore gets a
new parameter of this type to preserve a uniform signature.

Note that we currently calculate the complete set of these endpoints
for each call to satfunc::init(), but may choose to expose this
structure to the caller at a later time in order to reduce the
overhead of these repeated calculations.
2020-04-29 13:33:51 +02:00
Bård Skaflestad
6615030fab Sat-Func Region Apply: Remove 'ACTNUM' Pointer
We always call these functions on all active cells so there's no
need to have checks for ACTNUM-like cell subsets.
2020-04-29 13:33:51 +02:00
Bård Skaflestad
a4fc7ab05d Sat-func Region Apply: Split Region ID Check out to Helper
Mostly to reduce cognitive load when reading the *Apply() functions'
implementations.
2020-04-29 13:33:51 +02:00
Bård Skaflestad
8f64405ace Reduce Saturation Function Initialization API
The individual property initialization functions aren't used
directly anymore.  Put them in an anonymous namespace in the
implementation file so that no client can take their address.  This
is in preparation of adding TOLCRIT support.
2020-04-29 13:33:51 +02:00
Markus Blatt
eeb63d8694 Merge pull request #1758 from blattms/mark-openmp-as-prereq
Mark OpenMP as prerequisite for opm-common
2020-04-29 12:57:02 +02:00
Williham Williham Totland
cb8ddfd8aa Minor style consistency tweaks. 2020-04-29 11:30:30 +02:00
Joakim Hove
8201728973 Merge pull request #1760 from joakim-hove/python-package-path
Python files should go in $PREFIX/dist-packages on debian
2020-04-29 10:49:20 +02:00
Williham Williham Totland
77a0ee13ac Implements perf range. 2020-04-29 10:15:23 +02:00
Joakim Hove
512c2e4c1e Python files should go in $PREFIX/dist-packages on debian 2020-04-29 10:03:08 +02:00
Williham Williham Totland
a4111fa672 Projects the unit system from the callsite. 2020-04-29 08:40:17 +02:00
Williham Williham Totland
78c19a3aba Minor style tweaks. 2020-04-29 08:33:26 +02:00
Williham Williham Totland
fbe9d0dec2 Refactors number formatting. 2020-04-29 08:33:26 +02:00
Williham Williham Totland
305b4b21a7 Implements unit conversion for connection factor. 2020-04-29 08:33:26 +02:00
Williham Williham Totland
5e5aadb4ea Adds unit conversions. 2020-04-29 08:33:26 +02:00
Williham Williham Totland
84ff359b64 Minor formatting tweaks. 2020-04-29 08:33:24 +02:00
Williham Williham Totland
40a8651d68 Adds units to table definitions. 2020-04-29 08:32:31 +02:00
Williham Williham Totland
e365ca3f7d Projects the context into header printing. 2020-04-29 08:32:31 +02:00
Williham Williham Totland
a62fdad192 Reworks projection of the unit system. 2020-04-29 08:32:31 +02:00
Joakim Hove
6be2217935 Merge pull request #1757 from joakim-hove/remove-unused-function
Remove unused function from Group output data
2020-04-28 17:18:54 +02:00
Joakim Hove
9956492730 Remove unused function from Group output data 2020-04-28 16:17:43 +02:00
Joakim Hove
ad536b718b Merge pull request #1754 from blattms/find-zoltan-only-with-mpi
[CMake] Find Zoltan only if MPI is available.
2020-04-28 14:50:08 +02:00
Markus Blatt
a87e6f281d Quietly searcg for OpenMP in opm-common-prereqs.cmake 2020-04-28 12:58:39 +02:00
Markus Blatt
bb185a23ce Mark OpenMP as prerequisite for opm-common
to automatically trigger find_package(OpenMP) in downstream
modules (e.g. Dumux)
2020-04-28 11:35:16 +02:00
Joakim Hove
f7bbf92e3a Merge pull request #1752 from joakim-hove/remove-keywords
Suggestion: Remove unsupported E300 keywords
2020-04-27 19:21:15 +02:00
Bård Skaflestad
a89d053cae Merge pull request #1743 from bska/grppot-eff-fac-aware
Summary Output: Make Group Potentials Aware of Efficiency Factors
2020-04-27 16:55:08 +02:00
Joakim Hove
1758439c03 Merge pull request #1753 from blattms/fix-openmp-for-newer-cmake-master
Use OpenMP::OpenMP_CXX taget when linking libopmcommon
2020-04-27 16:08:35 +02:00
Markus Blatt
b6dd398c32 Find Zoltan only if MPI is available.
Otherwise we experience compilation errors if OPM is configured with
deactivated MPI and activated and found dune-alugrid (cpmpile error
that mpi.h is not found). This commit fixes this for me.
2020-04-27 16:00:49 +02:00
Markus Blatt
0ebe62a1d5 Use OpenMP::OpenMP_CXX target when linking libopmcommon
This should allow downstream to automatically use the correct
compile and linke flags for CMake > 3.9. For older versions
we fall back to the old approach.

Closes #1751
2020-04-27 12:54:18 +02:00
Bård Skaflestad
96a2350bf3 Summary Output: Make Group Potentials Aware of Efficiency Factors
As with all rate-like quantities, the *EFAC values affect the group
tree level above the level where the factor is applied
2020-04-27 10:56:48 +02:00
Joakim Hove
41803f5291 Remove unsupported E300 keywords 2020-04-27 10:33:45 +02:00
Joakim Hove
7468499855 Merge pull request #1750 from OPMUSER/master
Update to Water Vaporization Keywords to be Consistent
2020-04-27 09:40:25 +02:00
Bård Skaflestad
0eeb3243fb Merge pull request #1737 from joakim-hove/rsm-fixup
Small fixes to RSM output
2020-04-27 08:53:38 +02:00
OPMUSER
8a0e0c823c Add PVTGW, PVTGWO and RWGSALT
Will also add to Missing Features.
2020-04-27 13:45:35 +08:00
Joakim Hove
fa70f4dce1 Use ESmry::loadData() to preload all summary vectors 2020-04-27 07:04:45 +02:00
Joakim Hove
a92894f4d4 Small fixes to RSM output
- MAI -> MAY
- Update text header with simulation time and flow version
- Make sure the YEARS column is always the first column on page 1
2020-04-27 07:04:45 +02:00
OPMUSER
800d98c038 Update keyword_list.cmake with PERMFACT
Update keyword_list.cmake with PERMFACT
2020-04-27 12:51:55 +08:00
OPMUSER
297f90a88a Rename PERMRED to PERMFACT
As per TNO rename PERMRED to PERMFACT to match documentation.
2020-04-27 12:32:17 +08:00
Bård Skaflestad
67b2d5c185 Merge pull request #1748 from tskille/esmry_improvements
improved efficiency when opening summary files.
2020-04-26 23:03:02 +02:00
Torbjørn Skille
43f1739dfa improved efficiency when opening summary files.
> loading only arrays that is used (DIMENS, RESTART, KEYWORDS, NUMS and UNITS)
 > smspec file now only loading arrays once (twice before)
2020-04-26 18:24:01 +02:00
Bård Skaflestad
a78aa78248 Merge pull request #1747 from akva2/fix_int_abs
fixed: do not use integer abs
2020-04-26 13:39:00 +02:00
Arne Morten Kvarving
751a1c28fa fixed: do not use integer abs 2020-04-26 12:32:27 +02:00
Bård Skaflestad
380f85ed7e Merge pull request #1732 from joakim-hove/welspecs-report-refactor
Welspecs report refactor
2020-04-26 00:09:26 +02:00
Joakim Hove
7a2539b1f2 Merge pull request #1742 from joakim-hove/pr-keywords
Add keyword PRVD
2020-04-25 21:39:36 +02:00
Joakim Hove
c6b367e51e Merge pull request #1745 from bska/wellgraph-handle-dashed-names
Wellgraph: Quote Names to Transparently Handle Dashes
2020-04-25 21:20:14 +02:00
Bård Skaflestad
24ab7e5ff4 Wellgraph: Quote Names to Transparently Handle Dashes
This way, the dot(1) program won't generate errors like

    Badly delimited number 1_ splits into two tokens

when presented with a well name like 'INJE-1_N'.
2020-04-25 16:21:30 +02:00
Bård Skaflestad
775bce0b2f Merge pull request #1744 from atgeirr/add-wellgraph
Add 'wellgraph' utility program.
2020-04-25 14:24:50 +02:00
Atgeirr Flø Rasmussen
3d9a12efcb Add 'wellgraph' utility program. 2020-04-25 12:37:21 +02:00
Joakim Hove
7d2262e022 Merge pull request #1738 from joakim-hove/summary-YEARS
Summary years
2020-04-24 16:34:31 +02:00
Joakim Hove
e0df1cd470 Add keyword PRVD 2020-04-24 14:51:46 +02:00
Joakim Hove
162fcfc73b Merge pull request #1740 from OPMUSER/master
Create HMMULTSG
2020-04-24 14:47:21 +02:00
Joakim Hove
6264bab6b0 Summary compare ESmry and ERsm - looser tolerance 2020-04-24 14:42:42 +02:00
OPMUSER
2189a7efcd Update keyword_list.cmake 2020-04-24 18:53:39 +08:00
OPMUSER
8dff4ecef1 Create HMMULTSG
Create HMMULTSG definition
2020-04-24 17:45:26 +08:00
Joakim Hove
5781350bd4 Unconditionally add YEARS to summary output 2020-04-24 10:19:53 +02:00
Joakim Hove
4f0fa5c21a Introduce time unit ecl_years == 365.25 days 2020-04-24 10:19:53 +02:00
Williham Williham Totland
06f32f3d37 Projects unit type into columns. 2020-04-24 09:49:18 +02:00
Joakim Hove
b6c1e8a27e Refactor WELSPECS reports 2020-04-24 07:34:22 +02:00
Joakim Hove
1e77c1510d Merge pull request #1733 from joakim-hove/branches
Add method WellSegments::branches()
2020-04-23 22:28:51 +02:00
Bård Skaflestad
e57d11fe38 Merge pull request #1735 from joakim-hove/branch-segments-fixup
Segment sorting - check if already in order
2020-04-23 10:22:36 +02:00
Joakim Hove
f3d2b95896 Segment sorting - check if already in order 2020-04-23 06:44:53 +02:00
Bård Skaflestad
cd8b32acac Merge pull request #1734 from joakim-hove/connections-empty
Update connections should hanlde empty list
2020-04-22 20:02:10 +02:00
Joakim Hove
b26b4c2c77 Update connections should hanlde empty list 2020-04-22 17:33:30 +02:00
Joakim Hove
e7f750da83 Add method WellSegments::branches() 2020-04-22 17:03:03 +02:00
Joakim Hove
60e9a9c6b9 Merge pull request #1731 from joakim-hove/segment-depth-change
Add method WellSegments::segmentDepthChange()
2020-04-22 14:53:23 +02:00
Joakim Hove
48969b8b77 Add method WellSegments::branchSegments() 2020-04-22 12:07:26 +02:00
Joakim Hove
dd0041f8ee Add method WellSegments::segmentDepthChange() 2020-04-22 10:21:51 +02:00
Joakim Hove
c4690fd3c0 Merge pull request #1730 from joakim-hove/segment-connection-block-depth
Changes in WELSPECS reports implementation
2020-04-22 09:53:53 +02:00
Joakim Hove
d0828c4016 Changes in WELSPECS reports implementation
- The table datastructures are created dynamically
- Pass a context variable to all fetcher functions
- Add function to look up grid cell depth
2020-04-22 09:16:06 +02:00
Joakim Hove
f0eaa8ea99 Merge pull request #1728 from joakim-hove/report-check-time
Report check time
2020-04-22 08:21:35 +02:00
Joakim Hove
b082a4d02f Send WELSPECS report to OpmLog::info() 2020-04-21 14:43:07 +02:00
Joakim Hove
22de4aaeee Write footnotes under the WELSPECS report tables 2020-04-21 14:42:26 +02:00
Williham Williham Totland
3db07ce4d3 Implement WELSPECS reports for MSW wells 2020-04-21 14:34:23 +02:00
Bård Skaflestad
f902ceb6d7 Merge pull request #1729 from joakim-hove/changed-wells
Add function Schedule::changed_wells() to use in WELSPECS reporting
2020-04-21 14:13:54 +02:00
Joakim Hove
d37aa1116d Add function Schedule::changed_wells() to use in WELSPECS reporting 2020-04-21 13:18:49 +02:00
Joakim Hove
0f5fddc470 Merge pull request #1722 from joakim-hove/raw-string-quote
Raw string quote
2020-04-21 13:02:49 +02:00
Joakim Hove
ca508663b2 Add comparison of connections to Well::operator== 2020-04-21 11:28:36 +02:00
Joakim Hove
9a6d4d43a8 Split Well::operator==() 2020-04-21 11:28:36 +02:00
Joakim Hove
f32f971bc5 Merge pull request #1727 from akva2/fix_test_suite
fixed: it's test_suite, not tests_suite
2020-04-21 11:17:12 +02:00
Joakim Hove
7f0700431a Merge pull request #1726 from akva2/set_visibility
changed: explicitly set visibility on PyRunModule
2020-04-21 10:31:40 +02:00
Joakim Hove
3c60cb3765 Merge pull request #1723 from joakim-hove/welspecs-connection-DFACTOR
Add unsupported D-FACTOR to Welspecs Connection report
2020-04-21 09:33:27 +02:00
Joakim Hove
8debd0b044 Merge pull request #1725 from akva2/mark_pybind11_system
changed: mark pybind11 headers as system headers
2020-04-21 09:24:58 +02:00
Arne Morten Kvarving
0656b4bf17 fixed: it's test_suite, not tests_suite 2020-04-21 09:24:41 +02:00
Arne Morten Kvarving
23dccd9c54 changed: explicitly set visibility on PyRunModule
to avoid warnings for the pybind11 members with hidden visibility
2020-04-21 09:19:54 +02:00
Arne Morten Kvarving
c22a4ff980 changed: mark pybind11 headers as system headers
to quell some (shadowing) warnings
2020-04-21 09:00:30 +02:00
Joakim Hove
6f23f05c03 Add unsupported D-FACTOR to Welspecs Connection report 2020-04-21 08:29:39 +02:00
Joakim Hove
3077f7aff8 Introduce class RawString
The RawString class is introduced as a string which can hold the literals '*',
'/' and '''. The RawString class is used to hold the content of UDQ and ACTIONX
keywords.
2020-04-21 06:51:25 +02:00
Bård Skaflestad
89503cd4d9 Merge pull request #1676 from tskille/esmry_test_lod
Effective LOD for ESmry
2020-04-20 20:59:51 +02:00
Joakim Hove
635f3ccb4a Merge pull request #1721 from akva2/fix_deck_deserialize
fixed: initialize iterators after deserialization
2020-04-20 15:03:43 +02:00
Arne Morten Kvarving
78a6854214 fixed: initialize iterators after deserialization 2020-04-20 13:19:55 +02:00
Joakim Hove
082ab35a0e Merge pull request #1716 from joakim-hove/embedded-python-cmake
Set flag for embedded Python in the opm-common-config.cmake file
2020-04-20 11:16:03 +02:00
Bård Skaflestad
4da5a81233 Merge pull request #1718 from joakim-hove/welspecs-items
Internalize Gas inflow equation flag in Well - for reporting
2020-04-19 23:45:51 +02:00
Torbjørn Skille
54087e3bd8 Effective LOD for ESmry 2020-04-19 20:59:38 +02:00
Joakim Hove
0f22f897ed Add message about missing data 2020-04-19 08:58:31 +02:00
Joakim Hove
9194dd408e Add message about missing well D factor 2020-04-19 08:54:05 +02:00
Joakim Hove
84ad5ef502 Internalize Gas inflow equation flag in Well - for reporting 2020-04-19 08:37:48 +02:00
Joakim Hove
12b0537936 Merge pull request #1717 from berland/OPTIONS3
Add json file for OPTIONS3, E300.
2020-04-18 07:08:39 +02:00
Bård Skaflestad
2d4175ed0f Merge pull request #1695 from GitPaean/msw_summary_keywords
adding the summary output keywords for MSW
2020-04-17 20:53:31 +02:00
Atgeirr Flø Rasmussen
4b1609b20a Merge pull request #1712 from joakim-hove/group-control2
Separate flags for available_for_group_control for injectors and producers
2020-04-17 16:40:23 +02:00
Håvard Berland
f46a4c9a02 Update keyword_list.cmake with OPTIONS3 2020-04-17 16:28:20 +02:00
Håvard Berland
29e7ef4504 Add json file for OPTIONS3, E300. 2020-04-17 16:05:52 +02:00
Joakim Hove
7a2394ae12 Set flag for embedded Python in the opm-common-config.cmake file 2020-04-17 14:14:26 +02:00
Joakim Hove
819b624809 Changes in available for group control implementation
1. Add separate available_group_control flags for injection and production.
2. Add separate available_group_control flags for each injection phase.
2020-04-17 13:30:26 +02:00
Joakim Hove
dd30fb7bd8 Extracte Schedule construction to separate function in test 2020-04-17 13:03:26 +02:00
Joakim Hove
fbfd95d2f2 Merge pull request #1711 from joakim-hove/welspecs-unknown
Welspecs unknown
2020-04-17 11:43:34 +02:00
Joakim Hove
a18539c63c Merge pull request #1620 from joakim-hove/run-pyaction
Run pyaction
2020-04-17 11:40:15 +02:00
Joakim Hove
53fddda62b Merge pull request #1715 from joakim-hove/keywords
Add some missing keywords
2020-04-17 11:37:51 +02:00
Joakim Hove
78577e94cc Add some missing keywords 2020-04-17 08:57:17 +02:00
Kai Bao
e09b0a2de4 addressing reviewing comments from OPM/opm-common#1695 2020-04-17 01:06:22 +02:00
Kai Bao
8e4d4827a2 adding the test for new segment summary keywords 2020-04-17 00:38:21 +02:00
Kai Bao
34ca02c253 adding summary keywords for MSW
SPRD, SPRDH, SPRDF, SPRDA
2020-04-17 00:38:21 +02:00
Joakim Hove
3dbb922cc7 Fill on some of the unknown elements in WELSPECS report 2020-04-16 17:54:09 +02:00
Joakim Hove
315382bad8 Run PYACTION keywords
The PYACTION keyword is implemented with a Python module with a run() function
in an external module.
2020-04-16 14:13:54 +02:00
Williham Williham Totland
ead07d2f3f Passes line_number to columnwise data fetch function. 2020-04-16 09:39:46 +02:00
Joakim Hove
685ab301d2 Merge pull request #1691 from joakim-hove/UDQ-UNITS
Default construct UDQ keywords with value 0 when defined with UNIT
2020-04-16 09:27:28 +02:00
Joakim Hove
44c5a6c84c Merge pull request #1709 from joakim-hove/region-fip-keyword
Minor fixup to REGION fip summary keyword regexp
2020-04-16 09:27:01 +02:00
Joakim Hove
b899a1da64 Merge pull request #1703 from joakim-hove/well-store-dens-calc
Check WELSPECS values
2020-04-16 09:26:48 +02:00
Joakim Hove
637b1109aa Minor fixup to REGION fip summary keyword regexp 2020-04-16 07:05:51 +02:00
Joakim Hove
d79b817a58 Merge pull request #1707 from GitPaean/small_adjustment_aquifer_keywords
small adjustments for a few AQU keywords
2020-04-16 06:33:35 +02:00
Joakim Hove
2b0fcc974c Merge pull request #1686 from joakim-hove/cache-cell-volume
Cache cell volume
2020-04-16 06:32:05 +02:00
Joakim Hove
92e923b567 Merge pull request #1706 from joakim-hove/test-clean-srcdir
Rework testing of Schedule exit status
2020-04-15 21:56:55 +02:00
Kai Bao
585e18d85f small adjustments for a few AQU keywords
AQUCT, AQUFET, AQUFETP
2020-04-15 21:24:43 +02:00
Joakim Hove
43e2fced7d Simplified testing of exit status 2020-04-15 21:04:26 +02:00
Markus Blatt
8e3ba156a6 Merge pull request #1675 from blattms/refactor-policy-settings
Fix policy warnings
2020-04-15 21:01:35 +02:00
Joakim Hove
133ff18ee3 Make sure all generated files are in $work_dir 2020-04-15 20:50:51 +02:00
Joakim Hove
abaee17857 Add HAVE_OPENMP has opm_common_CONFIG_VAR 2020-04-15 20:33:22 +02:00
Joakim Hove
0cfc291039 Add function to calculate volume for all active cells - omp 2020-04-15 20:33:22 +02:00
Atgeirr Flø Rasmussen
0cdd6ba3d8 Merge pull request #1692 from joakim-hove/action-exit
Action exit
2020-04-15 17:11:15 +02:00
Markus Blatt
8816549f2f Try to set CMP0048 to NEW as we do not use VERSION 2020-04-15 14:17:53 +02:00
Markus Blatt
eb22f6cfd9 [CMake] Set PATH instead of LOCATION. 2020-04-15 14:17:53 +02:00
Markus Blatt
6707263385 DUNE does not need special treatment.
No need to set *_ROOT for it, which triggers a CMP0074 warning
as the policy settings do not survive find_package calls.
2020-04-15 14:17:53 +02:00
Markus Blatt
636ce45596 Set policy CMP0074 to NEW.
We have been using  <PackageName>_ROOT like it is intended now.
2020-04-15 14:17:53 +02:00
Markus Blatt
742d8943ca Move policy settings to OpmInit and into a macro OpmSetPolicies().
OpmInit.cmake is one of the first includes and most importantly before
the opm-*-prereqs.cmake files are include. The macro is needed to make
the policies set in all CMakefiles. OpmSetPolicies should be called in
the toplevel CMakeLists.txt file.

This fixes a lot of warnings experienced in downstream modules that
got triggered by the opm-*-prereqs.cmake files. At some calls the
policies were at other not.

On the other hand new warnings about soon to be deprecated policies
CMP0026 and CMP0048 appear at least for cmake version 3.13.4.
But that should be fixed in another PR.
2020-04-15 14:17:53 +02:00
Joakim Hove
593ee3174c Merge pull request #1704 from blattms/remove-old-boost-locale-hack
Revert hack for old boost versions (commit 59863939)
2020-04-15 13:39:58 +02:00
Markus Blatt
4882e2d782 Revert hack for old boost versions (commit 59863939)
We do not support boost in that version anymore and do not use its
locales anyway.

Closes #1667
2020-04-15 12:51:13 +02:00
Joakim Hove
4d9be76910 Check WELSPECS value for FIP_REGION and DENSITY_CALCULATION 2020-04-15 11:54:15 +02:00
Joakim Hove
3072f0dabe Add pvt_table as member for Well 2020-04-15 11:26:57 +02:00
Joakim Hove
e417ca6688 Merge pull request #1694 from joakim-hove/pyaction-api
Add api for PyAction::run()
2020-04-14 19:06:19 +02:00
Joakim Hove
12bbf19425 Merge pull request #1700 from akva2/janitoring
Some more janitoring
2020-04-14 16:34:38 +02:00
Joakim Hove
1c84c4c3f3 Add new keyword EXIT
The keyword EXIT is a opm only keyword which can be used to terminate the whole
simulation as part of the ACTIONX keyword.
2020-04-14 16:32:52 +02:00
Arne Morten Kvarving
b8a66cb0fa Merge pull request #1699 from akva2/clang_with_std++fs
changed: add option for using clang with libstdc++
2020-04-14 16:12:43 +02:00
Arne Morten Kvarving
f23257cbf5 initialize variables to avoid (faulty) compiler warnings 2020-04-14 14:10:37 +02:00
Arne Morten Kvarving
784389d228 remove unused variables 2020-04-14 14:10:33 +02:00
Atgeirr Flø Rasmussen
f494f6d5ce Merge pull request #1696 from joakim-hove/explicit-schedule
Add explicit to one argument Schedule constructor
2020-04-14 13:23:26 +02:00
Joakim Hove
6c34c0304f Merge pull request #1698 from atgeirr/fix-dxdydztops-performance
Address performance issue for DX/DY/DZ/TOPS grids.
2020-04-14 13:03:03 +02:00
Joakim Hove
f9b5946b25 Merge pull request #1697 from akva2/janitoring
fixed: avoid shadowing warnings
2020-04-14 13:02:07 +02:00
Arne Morten Kvarving
2f2cbea424 changed: add option for using clang with libstdc++
when using clang, whether or not we should link to stdc++fs
cannot easily be detected. it depends on the c++ lib used
(libstdc++ vs libc++), as well as the versions of these.

to avoid messing up in general, this adds an option for forcing
linking to stdc++fs, even when using clang. it defaults to false
to not break existing build setups where it works. is required
for building on jenkins
2020-04-14 11:44:32 +02:00
Arne Morten Kvarving
33e3d36ef5 fixed: avoid shadowing warnings 2020-04-14 11:28:10 +02:00
Atgeirr Flø Rasmussen
11f555c156 Address performance issue for DX/DY/DZ/TOPS grids.
The sumIdir() and sumJdir() methods were called inside loop
nests over i and j. Since the methods themselves were linear in
nx and ny, respectively, this was a quadratic algorithm. Performance
only becomes an issue for large (> 10k) values of NX or NY, which
was thought not to ever happen. This assumption was wrong.
2020-04-14 11:28:07 +02:00
Joakim Hove
84eaef0372 Add explicit to one argument Schedule constructor 2020-04-14 11:27:26 +02:00
Joakim Hove
e980713572 Merge pull request #1693 from joakim-hove/unused
Unused
2020-04-13 08:29:12 +02:00
Joakim Hove
466e21e37e Add api for PyAction::run() 2020-04-13 08:01:09 +02:00
Joakim Hove
648a8d1413 Remove unused arguments 2020-04-13 07:54:10 +02:00
Joakim Hove
0c91724927 Changes in Schedule default construction - add Python argument 2020-04-13 07:52:47 +02:00
Joakim Hove
750e7b8b24 Default construct UDQ keywords with value 0 when defined with UNIT 2020-04-12 08:38:59 +02:00
Bård Skaflestad
8202c2007e Merge pull request #1690 from joakim-hove/write-report-ss
Write report to stringstream and not stdout
2020-04-11 23:31:24 +02:00
Joakim Hove
161d337dd3 Write report to stringstream and not stdout 2020-04-11 22:03:31 +02:00
Joakim Hove
56745f57ac Merge pull request #1689 from joakim-hove/schedule-python-constructor
Schedule: add std::shared_ptr<Python> arg to "default" constructor
2020-04-11 08:00:59 +02:00
Williham Williham Totland
9a69c49ca9 Start to create WELSPECS reports 2020-04-11 07:52:32 +02:00
Joakim Hove
f0d0fb1a83 Merge pull request #1688 from tskille/summary
Updates of ESmry
2020-04-10 19:37:32 +02:00
Joakim Hove
3af0d4e623 Add Schedule(Python ) constructor 2020-04-10 12:07:00 +02:00
Torbjørn Skille
e5583b738f Updates of ESmry
- new overload function for keywordList, list keys based on pattern (string argument)
 - summary program wild card elements (keys including * or ?)
 - python bindings to new member function
2020-04-10 10:10:58 +02:00
Joakim Hove
acda777b9d Merge pull request #1685 from joakim-hove/rsm-regression-test
Rsm regression test
2020-04-09 10:58:41 +02:00
Joakim Hove
efeafcc47c Merge pull request #1687 from joakim-hove/grid-cleanup
Grid cleanup
2020-04-08 22:30:44 +02:00
Joakim Hove
1efca16420 EclipseGrid: - use member getNXYZ() instead of passing dims 2020-04-08 21:44:26 +02:00
Joakim Hove
650ffb12b8 EclipseGrid: ensure that all ACTNUM manipulations use resetACTNUM 2020-04-08 21:38:41 +02:00
Tor Harald Sandve
19693c7d3d Merge pull request #1632 from totto82/scale_guiderates_with_rates
Scale guiderates with rates
2020-04-08 12:29:20 +02:00
Bård Skaflestad
afd0ed21ba Merge pull request #1682 from joakim-hove/timestamp-ymd
Add three argument (year, month, day) constructor TimeStampUTC
2020-04-07 12:07:02 +02:00
Joakim Hove
cee75dcaac Add basic regression testing of RSM file 2020-04-05 17:32:07 +02:00
Joakim Hove
fb345f94af Merge pull request #1684 from joakim-hove/rms-output-fixup
Rms output fixup
2020-04-05 15:57:13 +02:00
Joakim Hove
6296255ebc Add space part for the time/date column in the multiplier row 2020-04-05 12:38:12 +02:00
Joakim Hove
07d19b57d7 Add right padding of columns to column 130 2020-04-05 12:38:12 +02:00
Joakim Hove
db8c9652e4 Add cmp() function to compare ERsm and ESmry instances 2020-04-05 12:37:41 +02:00
Joakim Hove
f260c05d9d Add class ERsm for loading RSM files 2020-04-05 12:37:41 +02:00
Joakim Hove
2b81afc6fa Add space part for the time/date column in the multiplier row 2020-04-05 12:37:41 +02:00
Joakim Hove
1df8be064f Add right padding of columns to column 130 2020-04-05 12:37:41 +02:00
Joakim Hove
b4f5848e3e Add three argument (year, month, day) constructor TimeStampUTC 2020-04-05 10:58:53 +02:00
Joakim Hove
eb89331403 Merge pull request #1674 from joakim-hove/runsum-dates
Runsum dates
2020-04-05 10:58:39 +02:00
Bård Skaflestad
ac35c7c936 Merge pull request #1681 from joakim-hove/move-util
Moved string utilities to opm/common
2020-04-04 21:57:16 +02:00
Joakim Hove
075d018cf3 Moved string utilities to opm/common 2020-04-04 17:10:13 +02:00
Joakim Hove
ab2e5cc310 Add three argument (year, month, day) constructor TimeStampUTC 2020-04-04 16:20:13 +02:00
Joakim Hove
b09814bc2e Respect DATE keyword in RUNSUM output 2020-04-03 16:05:43 +02:00
Bård Skaflestad
efb34b6533 Merge pull request #1673 from joakim-hove/summary-date
Summary date
2020-04-03 12:48:13 +02:00
Joakim Hove
8f81df09c4 Merge pull request #1679 from wito/to-string-fix
[FIX] Resolves a build error on macOS/AppleClang 11.0.3
2020-04-03 12:37:27 +02:00
Williham Williham Totland
1925fc3712 Resolves a build error on macOS/AppleClang 11.0.3 2020-04-03 11:33:36 +02:00
Joakim Hove
92efbb4713 Merge pull request #1678 from akva2/add_test_configuration
added: support for specifying configuration for test
2020-04-03 11:29:26 +02:00
Joakim Hove
b72f3b9d4b Merge pull request #1677 from wito/dynamic-state-new-data
Allow interrogating DynamicState for changes in data
2020-04-03 11:16:33 +02:00
Joakim Hove
c9ae00707b Remove unused variable usec 2020-04-03 10:36:54 +02:00
Arne Morten Kvarving
2a9254e76d added: support for specifying configuration for test 2020-04-03 10:15:29 +02:00
Joakim Hove
934def46d2 Add DAY, MONTH and YEAR and summary keys 2020-04-03 10:09:48 +02:00
Joakim Hove
90940ed7b5 Add DATE as meta keyword to SummaryConfig 2020-04-03 10:09:48 +02:00
Bård Skaflestad
9764207bfd Merge pull request #1657 from joakim-hove/rst-msw-omega
Rst msw M2
2020-04-03 09:48:46 +02:00
Joakim Hove
142061dbc0 Update Well testing in Schedule::cmp 2020-04-03 08:55:44 +02:00
Joakim Hove
4e0c0911f1 Improve error message 2020-04-03 08:55:44 +02:00
Joakim Hove
31fb7e6072 Add operator<< for injection and production cmode 2020-04-03 08:55:44 +02:00
Joakim Hove
51866155c0 Add operator<< for well status 2020-04-03 08:55:44 +02:00
Williham Williham Totland
433a3a9e9b Adds DynamicState<T>::is_new_data(size_t). 2020-04-03 07:57:51 +02:00
Joakim Hove
d78cc40bf1 Set well VFP table when loading from restart file 2020-04-03 07:36:54 +02:00
Joakim Hove
907bdaf33e Improve error message 2020-04-03 07:36:54 +02:00
Bård Skaflestad
2ade5c67f3 Merge pull request #1669 from joakim-hove/summary-time
Use std::chrono instead of std::vector<int> to store start date
2020-04-02 22:20:11 +02:00
Tor Harald Sandve
f5b7d6cb98 scale guiderates with current rate 2020-04-02 20:36:29 +02:00
Markus Blatt
c7e70da2c5 Do not call project another time in OpmLibMain
Each project should and does this in their own top level
CMakeLists.cmake at the very beginning anyway.
2020-04-02 19:44:32 +02:00
Joakim Hove
3b70c9edce Add method dates to ESmry class 2020-04-02 19:23:02 +02:00
Tor Harald Sandve
5d61975622 rename Potetials struct in guideRate to RateVector 2020-04-02 16:34:07 +02:00
Joakim Hove
33ad7a2620 Use std::chrono instead of std::vector<int> to store start date 2020-04-02 15:38:20 +02:00
Joakim Hove
2df7183f1b Implement asLocalTimeT helper function 2020-04-02 15:31:13 +02:00
Joakim Hove
fd221bb949 Merge pull request #1670 from joakim-hove/esmry-rm-seqtime
Esmry rm seqtime
2020-04-02 13:59:05 +02:00
Joakim Hove
e3c491ad38 Merge pull request #1671 from wito/smpec-unit-fix
[FIX] Wrong unit names given for field units with certain values of UnitSystem::measure
2020-04-02 13:51:02 +02:00
Williham Williham Totland
c255116133 Adds static assertions to ensure at compile time that all unit names are provided. 2020-04-02 10:23:46 +02:00
Williham Williham Totland
4919d850a9 Resolves an issue with units resulting from silent string concatenation. 2020-04-02 10:19:28 +02:00
Joakim Hove
33ecf4215d ESmry: use templated function rstep_vector() 2020-04-02 09:35:59 +02:00
Joakim Hove
f8e793a21a ESmry: remove unused member seqTime 2020-04-02 09:32:12 +02:00
Bård Skaflestad
dc0b91609e Merge pull request #1656 from joakim-hove/rst-well-shut
Rst well shut
2020-04-01 23:11:04 +02:00
Bård Skaflestad
d918f052e2 Merge pull request #1668 from bska/pot-rate-smry-alias
Summary: Recognise Aliases for Potential Phase Injection Rates
2020-04-01 22:39:26 +02:00
Bård Skaflestad
dfb4b5ef3a Summary: Recognise Aliases for Potential Phase Injection Rates
This commit adds the aliases 'WGIP' and 'WWIP' for the existing
summary vector names 'WGPI' (potential gas injection rate at well
level), and 'WWPI' (potental water injection rate at well level),
respectively.

Some datasets in 'opm-tests' use these alias names.
2020-04-01 21:38:33 +02:00
Joakim Hove
d3817e2fc2 Merge pull request #1665 from wito/rptconfig-rptsched
Handle RPTSCHED keywords in a time-sensitive manner
2020-04-01 14:00:41 +02:00
Joakim Hove
07e6be97e9 msim: Add temporary well to msim testcase - and verify SHUT status 2020-04-01 13:29:17 +02:00
Joakim Hove
f115ed43f5 msim: Ensure that only open wells get an assigned rate 2020-04-01 13:18:00 +02:00
Joakim Hove
8483251aec msim: Pass correct substep flag 2020-04-01 13:18:00 +02:00
Joakim Hove
7cd004bf71 msim: ensure data::wells instance is not reused 2020-04-01 13:18:00 +02:00
Joakim Hove
e51edcf1c8 Add comment about multiple calls to setCurrentControl() 2020-04-01 13:18:00 +02:00
Williham Williham Totland
f3fbfc41ad Completes RPTConfig to pass tests. 2020-04-01 13:02:29 +02:00
Williham Williham Totland
9f7664fe13 Makes the new interface compile against tests. 2020-04-01 13:02:29 +02:00
Bård Skaflestad
03657799ce Merge pull request #1659 from joakim-hove/rst-well-shut2
Rst well shut2
2020-04-01 12:32:54 +02:00
Joakim Hove
61fa2d899e Merge pull request #1664 from akva2/janitoring
quell shadowing warnings
2020-04-01 11:05:25 +02:00
Arne Morten Kvarving
21db859ece quell shadowing warnings 2020-04-01 10:39:14 +02:00
Williham Williham Totland
ea269c7cc7 Implement writing of RSM file 2020-04-01 10:30:10 +02:00
Joakim Hove
f441d385f3 Fix initialization in test 2020-04-01 10:28:05 +02:00
Joakim Hove
278402b63e Check well status before checking active control 2020-04-01 10:28:05 +02:00
Joakim Hove
fe6714c14d Enable THP production control if THP target is set in restart file 2020-04-01 10:28:05 +02:00
Joakim Hove
07e590a0ed Check that will is OPEN before checking active control 2020-04-01 10:21:58 +02:00
Joakim Hove
efff382517 Add test for ReportConfig 2020-04-01 10:17:05 +02:00
Joakim Hove
7c0ddd0b9d Merge pull request #1654 from joakim-hove/skiprest-exceptions
Skiprest exceptions
2020-04-01 09:38:54 +02:00
Joakim Hove
07843654b1 SKIPREST: Make sure e.g. VFP tables are loaded even under SKIPREST 2020-04-01 08:23:15 +02:00
Joakim Hove
7aaf68fbc4 Add testdeck for the situation with SKIPREST and e.g VFP 2020-04-01 08:02:32 +02:00
Bård Skaflestad
420446f318 Merge pull request #1663 from joakim-hove/cmake-fix
Embed build timestamp also in UseVersion.cmake
2020-03-31 23:57:17 +02:00
Atgeirr Flø Rasmussen
3111505ed6 Merge pull request #1661 from joakim-hove/connections-wellpi
WPIMULT: directly multiply the connection transmissibility factor
2020-03-31 18:59:46 +02:00
Joakim Hove
320f9b5510 Emed build timestamp also in UseVersion.cmake 2020-03-31 17:23:25 +02:00
Joakim Hove
a8ad5cd9f2 Merge pull request #1662 from joakim-hove/fix-non-python
Fix codepath for non-python
2020-03-31 17:18:02 +02:00
Joakim Hove
5ac2b3f531 Fix codepath for non-python 2020-03-31 16:56:44 +02:00
Joakim Hove
6fb2989708 WPIMULT: directly multiply the connection transmissibility factor 2020-03-31 16:53:28 +02:00
Joakim Hove
14bd2f7d48 Merge pull request #1660 from joakim-hove/python-shared-ptr
Use std::shared_ptr<Python> for Python argument in Schedule
2020-03-31 16:50:43 +02:00
Joakim Hove
5444eade2f Use std::shared_ptr<Python> for Python argument in Schedule 2020-03-31 10:26:55 +02:00
Joakim Hove
cebef15dc4 Merge pull request #1653 from joakim-hove/compile-timestamp
Generate BUILD_TIMESTAMP macro with build system
2020-03-31 07:56:14 +02:00
Joakim Hove
cc60a65f14 Merge pull request #1364 from bska/no-dyndata-seqnum-0
Don't Output Dynamic Data to Restart File for SEQNUM=0
2020-03-31 07:55:11 +02:00
Joakim Hove
fe1ef0a65f Generate BUILD_TIMESTAMP macro with build system 2020-03-30 15:11:48 +02:00
Bård Skaflestad
5c787ef97e Don't Needlessly Copy Complete Well Objects
We're able to implement the top-level restart file well writing code
without calling Schedule::getWells() and should therefore do so.

While here, also restore formatting in LoadRestart.cpp.
2020-03-30 14:39:04 +02:00
Bård Skaflestad
43ef003452 Header: Make 'ih' Not Const to Activate NRVO 2020-03-30 14:39:04 +02:00
Bård Skaflestad
bc28de3372 Don't Output Dynamic Data to Restart File for SEQNUM=0
This commit introduces a special case for the restart file writing
code.  In particular we no longer write dynamic data vectors (e.g.,
*WEL, *GRP, *CON) to the restart file if we're being asked to output
the initial condition (i.e., report step/sequence number 0).

Add the report step as a new explicit parameter to createInteHEAD()
instead of inferring this value from the "sim_step" and output
dynamic sizes as zero for report_step=0.  While here, also correct
an omission from earlier commit 7986e99e.  We must ensure that the
maximum number of wells in the field (intehead[163]) is at least as
large as the current number of active wells (intehead[16]).

Update "intehead" test to account for report_step being passed
directly as an argument to InteHEAD::stepParam().
2020-03-30 14:39:04 +02:00
Bård Skaflestad
269537b101 Merge pull request #1658 from akva2/bad_janitoring
fix faulty fix in 811d2e2a64
2020-03-30 14:37:02 +02:00
Arne Morten Kvarving
7e26c6a5e9 fix faulty fix in 811d2e2a64
sched uses python, so we have to reorder the members instead
2020-03-30 14:20:08 +02:00
Joakim Hove
fa8afbcc6d Merge pull request #1655 from akva2/janitoring
Quell warnings
2020-03-30 13:52:38 +02:00
Arne Morten Kvarving
ebc92fb92e fixed: proper initializer list order 2020-03-30 12:38:47 +02:00
Arne Morten Kvarving
811d2e2a64 quell unused parameter warning when built without python support 2020-03-30 12:33:34 +02:00
Arne Morten Kvarving
83d1627dbb quell signed/unsigned comparison warning 2020-03-30 12:33:20 +02:00
Joakim Hove
0025144079 Merge pull request #1559 from joakim-hove/rst-msw
Initialize MSW wells from restart file
2020-03-28 09:47:46 +01:00
Joakim Hove
f320fe3d57 Only compare historical modes in history mode 2020-03-28 08:58:14 +01:00
Joakim Hove
f59fec133d Check NSCONZ before reading CFKind value from SCON 2020-03-28 08:58:14 +01:00
Joakim Hove
bbc87beed5 Improve error message for connection comparison 2020-03-28 08:58:14 +01:00
Joakim Hove
7bc5272290 Connections / segments: retain start and end from restart 2020-03-28 08:58:14 +01:00
Joakim Hove
d827fd6da5 Update debug message 2020-03-28 08:58:14 +01:00
Joakim Hove
ad5b410940 Sort segments 2020-03-28 08:58:14 +01:00
Joakim Hove
aa6128c4be Check for invalid value when loading segment information 2020-03-28 08:58:14 +01:00
Joakim Hove
22396d1b21 Do not alter sort value when attaching segment from restart file 2020-03-28 08:58:14 +01:00
Joakim Hove
f613c15727 Connections: keep order from restart file 2020-03-28 08:58:14 +01:00
Joakim Hove
eb8f162663 Enable rst testing with MSW data 2020-03-28 08:58:14 +01:00
Joakim Hove
97173e51a3 Update binary testdata 2020-03-28 08:58:14 +01:00
Joakim Hove
fba1858925 Merge pull request #1652 from bska/resv-totinj
Restart: Save/Restore Cumulative Injected Reservoir Volume
2020-03-28 08:57:37 +01:00
Bård Skaflestad
1113c25eb1 Restart: Save/Restore Cumulative Injected Reservoir Volume
This commit adds support for persisting the *VIT cumulative summary
vector at the well, group, and field levels in the simulation
restart files.  Connection level currently not supported.
2020-03-27 14:59:29 +01:00
Joakim Hove
467f7879a6 Merge pull request #1636 from joakim-hove/add-python-arg
Add python arg
2020-03-27 13:43:44 +01:00
Joakim Hove
50fb51d56e Add Python arg to Schedule constructor 2020-03-27 12:43:18 +01:00
Joakim Hove
9d3ec9be61 Merge pull request #1646 from joakim-hove/python-fixup2
Make sure PythonInterpreter can be safely disabled
2020-03-27 12:42:18 +01:00
Joakim Hove
687887939d Make sure PythonInterpreter can be safely disabled 2020-03-27 12:11:40 +01:00
Joakim Hove
562136772a Merge pull request #1638 from joakim-hove/remove-stale-boost-include
Remove stale boost includes
2020-03-27 10:49:52 +01:00
Joakim Hove
7fc75ce61c Merge pull request #1650 from atgeirr/fix-embedded-python-test
Use braces to force correct parsing.
2020-03-27 10:49:34 +01:00
Joakim Hove
413a45ec21 Merge pull request #1648 from berland/jq
Reformat all json keyword files through jq
2020-03-27 10:48:59 +01:00
Atgeirr Flø Rasmussen
4c5b03b83e Use braces to force correct parsing.
Without this, clang thinks it is a declaration, not a function call.
2020-03-27 10:11:12 +01:00
Williham Williham Totland
3e29350e94 Integrate SummaryNode in ESmry (#1642) 2020-03-27 08:07:52 +01:00
Håvard Berland
54b714f361 Reformat all json keyword files through jq
Ensures similar pretty-printing everywhere.

Includes a bugfix for 000_Eclipse100/O/OVERBURD which had
a } too much
2020-03-26 23:16:17 +01:00
Joakim Hove
3e2160af28 Merge pull request #1608 from joakim-hove/connections-sort-item
Connections sort item
2020-03-26 17:52:54 +01:00
Joakim Hove
c41f375e00 Merge pull request #1645 from akva2/janitoring
quell compiler warnings
2020-03-26 17:33:25 +01:00
Joakim Hove
6d8154823a Merge pull request #1643 from joakim-hove/python-fixup
Temporarily protect against deref when python is disabled
2020-03-26 16:20:04 +01:00
Arne Morten Kvarving
c07a839f15 quell compiler warnings 2020-03-26 16:07:49 +01:00
Joakim Hove
cce2bc0686 Temporarily protect against deref when python is disabled 2020-03-26 15:38:18 +01:00
Joakim Hove
eca0589fe1 Merge pull request #1641 from joakim-hove/python-enable-enum
Enable fine grained control of Python ON | OFF
2020-03-26 14:21:24 +01:00
Joakim Hove
6ffb5883d4 Merge pull request #1639 from wito/add-aquifer-category
Add Aquifer Category
2020-03-26 12:39:11 +01:00
Joakim Hove
cda315ce41 Merge pull request #1640 from atgeirr/fix-field-unavailable
Make the FIELD group unavailable for higher level control.
2020-03-26 12:37:44 +01:00
Atgeirr Flø Rasmussen
fce6eeca1b Make the FIELD group unavailable for higher level control. 2020-03-26 12:07:06 +01:00
Joakim Hove
a8f0ebb183 Enable fine grained control of Python ON | OFF 2020-03-26 12:00:59 +01:00
Williham Williham Totland
4e08ff7f6d Adds ::Aquifer to Opm::EclIO::SummaryNode::Category. 2020-03-26 11:36:13 +01:00
Bård Skaflestad
5a701a2ee8 Merge pull request #1609 from wito/new-summarynode
New SummaryNode implementation
2020-03-26 11:34:21 +01:00
Joakim Hove
52855cce1e Merge pull request #1637 from bska/restore-all-injlimits
Simulation Restart: Restore All Available Injection Control Modes
2020-03-26 09:14:21 +01:00
Williham Williham Totland
06d317d119 Review Actions: Un-consts SummaryNode members and un-statics some data vectors. 2020-03-26 08:20:50 +01:00
Bård Skaflestad
c2bd04edcb Simulation Restart: Restore All Possible Injection Control Modes
In particular, declare that the well supports RATE, RESV, and THP
limits/targets if such values are available in the SWEL array.
2020-03-25 18:54:28 +01:00
Joakim Hove
39eb327551 Remove stale boost includes 2020-03-25 18:18:25 +01:00
Joakim Hove
9ad8465609 Replace connection segIndex and compSeqIndex with sort_value member 2020-03-25 18:02:40 +01:00
Joakim Hove
91841a99e1 Merge pull request #1606 from joakim-hove/wellconnections-output
Changes in WellConnection ordering
2020-03-25 18:01:51 +01:00
Joakim Hove
c7d3603184 Changes in WellConnection ordering
1. If the well is MSW the connections in the WellConnection class is sorted in
   output order in the ::order() method, and retained that way.

2. Add method WellConnection::output() which return a vector of connection
   pointers sorted in output order.
2020-03-25 10:54:21 +01:00
Joakim Hove
03efd5e589 Merge pull request #1635 from joakim-hove/internalize_tracers
Internalize tracers
2020-03-25 10:17:29 +01:00
Bård Skaflestad
9f0985850c Merge pull request #1614 from joakim-hove/wellrates-get-connection-rates
Get connection rates from well rates object
2020-03-25 08:09:10 +01:00
Joakim Hove
9411af4dfc Implement TracerConfig in EclipseState
Co-authored-by: Arne Morten Kvarving <arne.morten.kvarving@sintef.no>
2020-03-25 07:53:08 +01:00
Joakim Hove
5c2a5898c0 Fetch connection rates using global_index 2020-03-25 07:43:10 +01:00
Joakim Hove
8b2e503602 Update incorrect test 2020-03-25 07:43:10 +01:00
Bård Skaflestad
c68be43301 Merge pull request #1629 from joakim-hove/load-restart
Load restart XCON data
2020-03-24 12:21:59 +01:00
Joakim Hove
d40ebe647a Merge pull request #1634 from joakim-hove/pyaction-fixup
Pyaction fixup
2020-03-24 10:58:05 +01:00
Joakim Hove
179b6ba9ff Use global index when assembling connection rates from XCON keyword 2020-03-24 10:55:49 +01:00
Joakim Hove
9498217e0a Merge pull request #1623 from joakim-hove/find-connection
Find connection
2020-03-24 10:06:34 +01:00
Joakim Hove
00faf6099a Merge pull request #1628 from joakim-hove/init-global-index
Initialize global index when creating connections from rst file
2020-03-24 10:05:10 +01:00
Joakim Hove
fad5346ec1 Merge pull request #1633 from atgeirr/fix-type-mismatch
Fix type mismatch error for EclEntry.
2020-03-24 09:27:52 +01:00
Joakim Hove
611b21beab Add serialization active member 2020-03-24 08:40:13 +01:00
Joakim Hove
9ce64d5aae Add copy constructor and assignment operator to PyAction 2020-03-24 08:07:21 +01:00
Atgeirr Flø Rasmussen
2d52268bf8 Fix type mismatch error for EclEntry. 2020-03-24 08:05:34 +01:00
Joakim Hove
a0ebb2091f Add method Actions::pending_python() to get active Python functions 2020-03-24 07:23:31 +01:00
Joakim Hove
4c25ce69c1 Add mutable bool active member to PyAction 2020-03-24 07:23:31 +01:00
Joakim Hove
4b687e3368 Fix bug in CMakeLists.txt - mock simulator tests were not built 2020-03-24 07:23:31 +01:00
Joakim Hove
1ac240a425 Merge pull request #1625 from tskille/replace_long_int_eclio
replacing long int and unsigned long int
2020-03-23 19:57:10 +01:00
Bård Skaflestad
d52180389b Merge pull request #1631 from atgeirr/add-missing-include
Add missing header inclusion.
2020-03-23 19:04:36 +01:00
Atgeirr Flø Rasmussen
4a88b87958 Merge pull request #1626 from totto82/fixGuideRat
fix bug in guiderate model
2020-03-23 17:51:10 +01:00
Atgeirr Flø Rasmussen
0b0fab781b Add missing header inclusion. 2020-03-23 17:49:43 +01:00
Torbjørn Skille
9d24f0dc34 replacing long int and unsigned long int
- long int -> int64_t
  - unsigned long int -> uint64_t

All EclIO classes and associated tests has been updated.
2020-03-23 17:12:56 +01:00
Bård Skaflestad
6cf4b7efc7 Merge pull request #1624 from atgeirr/fix-narrowing
Compile-error fix: do not narrow double->bool in init list.
2020-03-23 16:30:17 +01:00
Joakim Hove
1192830c60 Initialize global index when creating connections from rst file 2020-03-23 16:08:49 +01:00
Tor Harald Sandve
41ae6b0bc4 fix bug in guideratemodel 2020-03-23 15:30:51 +01:00
Arne Morten Kvarving
0a8a25d5df Merge pull request #1622 from joakim-hove/include-hpp
Include hpp files and not cpp files
2020-03-23 14:50:33 +01:00
Atgeirr Flø Rasmussen
2805f862db Compile-error fix: do not narrow double->bool in init list. 2020-03-23 14:34:27 +01:00
Joakim Hove
02a5501c0b Add method out::Well::find_connection(std::size_t global_index) 2020-03-23 13:43:50 +01:00
Joakim Hove
a61c48521a Include hpp files and not cpp files 2020-03-23 13:28:47 +01:00
Joakim Hove
f88d382172 Merge pull request #1615 from joakim-hove/connection-testing
Connection testing
2020-03-23 13:00:06 +01:00
Arne Morten Kvarving
0a9a0285dc Merge pull request #1621 from akva2/move_ser_object
move data serialization objects close to the class code
2020-03-23 12:40:30 +01:00
Arne Morten Kvarving
e9e69ca44f Merge pull request #1607 from tskille/latest_pybind_eclio
Python bindings for EclIO classes
2020-03-23 12:05:55 +01:00
Arne Morten Kvarving
e3bd1e6723 add static method to return a test object for serialization
this allows killing the constructors taking member values
2020-03-23 10:58:15 +01:00
Torbjørn Skille
c33372b8b4 Adding python bindings for C++ class EclOutput 2020-03-23 10:57:49 +01:00
Torbjørn Skille
1a39c07981 Adding python bindings for C++ class ERft 2020-03-23 10:57:49 +01:00
Torbjørn Skille
d258ce5a57 Updates of C++ class ERft to be used with python bindings
-> Support for extracting data based on report index
  -> adding extra float (time) to RftReportList
2020-03-23 10:57:49 +01:00
Torbjørn Skille
b992ff0e1c Adding python bindings for C++ class EGrid 2020-03-23 10:57:49 +01:00
Torbjørn Skille
f97dfda92e Adding python bindings for C++ class ESmry 2020-03-23 10:57:49 +01:00
Torbjørn Skille
931fa96a59 Updates of C++ class ESmry to be used with python bindings
-> adding member function ESmry::get_startdat(), start of simulation from keyword STARTDAT in SMSPEC file
  -> adding member function ESmry::numberOfTimeSteps(), number of timesteps in run
2020-03-23 10:57:49 +01:00
Torbjørn Skille
c1caf4738e Adding python bindings for C++ class ERst
-> one additional C++ member function ERst::numberOfReportSteps()
2020-03-23 10:57:44 +01:00
Bård Skaflestad
c3c6c93f65 Merge pull request #1619 from joakim-hove/use-reference
Use reference
2020-03-23 10:49:36 +01:00
Joakim Hove
d1527da245 Use reference when accessing Schedule actions 2020-03-23 08:52:02 +01:00
Joakim Hove
8a420d30e6 Remove trailing whitespace 2020-03-23 08:52:02 +01:00
Bård Skaflestad
3bc8f832d8 Merge pull request #1618 from bska/add-missing-header
Parser.cpp: Include Missing Header
2020-03-22 18:02:47 +01:00
Bård Skaflestad
e7324ccd95 Parser.cpp: Include Missing Header
The implementation uses std::stack and therefore needs a declaration
of this type in scope.  This apparently built by accident earlier.
While here, also include a few other headers to make Parser.[hc]pp
more self-contained.
2020-03-22 17:06:38 +01:00
Bård Skaflestad
01d6ad95e0 Merge pull request #1617 from bska/summary-wmctl
Support Outputting Active Well Control to Summary File
2020-03-21 14:30:25 +01:00
Bård Skaflestad
f2e848bb5d Restart File: Reimplement Active Well Control Output Code
Switch to using the same backend that is also used for outputting
the equivalent value to the 'WMCTL' summary vector.
2020-03-20 22:07:32 +01:00
Bård Skaflestad
2f8ad86afd Summary Output: Implement 'WMCTL' Keyword
This outputs a numeric code, an integer value, for all configured
wells at all times and enables more visual inspection of how the
wells' active controls change over time--either in response to
explicit target modes in the input or as a result of limits becoming
active.

Note that due to the fall-back option of selecting the input value
if no dynamic value is available, we must ensure that the test code
does not specify well types (producer/injector) that conflict with
the keywords used in the backing data set.  Update the relevant
tests accordingly.
2020-03-20 22:07:32 +01:00
Bård Skaflestad
45b501cb83 Summary Config: Recognize 'WMCTL' Keyword
This would previously be interpreted as a completion keyword due to
matching the pattern 'W*L'.
2020-03-20 22:07:32 +01:00
Bård Skaflestad
8d2cc14ad0 Active Well Control Output: Place Duplicate Implementation in Well
Will become shared backend for output to restart and summary files.
Add unit tests to exercise the new functions.
2020-03-20 22:07:04 +01:00
Joakim Hove
4e2dae298f Merge pull request #1593 from joakim-hove/internalize-pyaction
Internalize pyaction
2020-03-20 18:38:29 +01:00
Joakim Hove
81b70de140 Add serializer support for PyAction 2020-03-20 17:15:53 +01:00
Joakim Hove
d2af97b1b2 Internalize PYACTION keywords while parsing Schedule 2020-03-20 16:59:50 +01:00
Joakim Hove
9632eae663 Add PyAction container to Actions class 2020-03-20 16:59:50 +01:00
Joakim Hove
c7f6b22bdf Add static method bool Python::enabled() 2020-03-20 16:59:50 +01:00
Joakim Hove
d06a5a78e0 Moved PyAction class into Action:: namespace 2020-03-20 16:59:50 +01:00
Joakim Hove
7852203d39 PYACTION: The actual python code is in an external file
With this commit the PYACTION keyword is changed, instead of embedding the
Python code directly in the .DATA file the keyword now points to an external
file which is loaded verbatim into the PyAction keyword.

In addition the PYACTION keyword has now got a name and a string indicating how
many times it should run.
2020-03-20 16:59:50 +01:00
Joakim Hove
db72ff80ed Use template Deck::count() in opmpack IMPORT handler 2020-03-20 16:59:50 +01:00
Joakim Hove
6e5cd6c371 Add templated method Deck::count() 2020-03-20 16:59:50 +01:00
Williham Williham Totland
2c74b0961d Removes various minor edits. 2020-03-20 15:34:14 +01:00
Williham Williham Totland
ab71b43f10 Fixes minor formatting glitch in the SummaryNode copyright statement. 2020-03-20 14:48:32 +01:00
Williham Williham Totland
fb4f026c97 Uses correct name in reference to enum value. 2020-03-20 14:27:08 +01:00
Williham Williham Totland
f884c90745 Refactors out duplicated code. 2020-03-20 14:21:18 +01:00
Williham Williham Totland
06eeae89e6 Reworks mode vectors for Opm::EclIO::SummaryNode. 2020-03-20 14:12:06 +01:00
Williham Williham Totland
eba0f3dcde Relocates new test in CMakeLists_files.cmake. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
89fe3c3d15 Reworks Evaluator::Factory for Opm::EclIO::SummaryNode. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
327fe79c90 Adds Opm::EclIO::SummaryNode::is_user_defined(). 2020-03-20 14:08:03 +01:00
Williham Williham Totland
62983db22f Removes use of default: 2020-03-20 14:08:03 +01:00
Williham Williham Totland
99375eb5be Reworks requiredRestartVectors for Opm::EclIO::SummaryNode. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
35afdd5131 Reworks ::requiredSegmentVectors() for Opm::EclIO::SummaryNode. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
21e9c1b952 Implements the change to SummaryNode in ::Evaluator. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
a6a144a5be Review action: Removes default: cases. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
318ca70a0b Uses the correct names for enum values. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
fda69e9d57 Review action: Reverts a number of changes at the request of @bska. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
0174a16386 Reworks EfficiencyFactor::setFactors for Opm::EclIO::SummaryNode. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
6970158f7f Makes the return value of Opm::Group::flow_group/::control_group optional. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
701175c776 Makes fallthrough explicit. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
bb114b6a55 Renames enum access name. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
855b23aa1b Minor formatting tweak. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
e500fbbbca Reworks ::find_wells for Opm::EclIO::SummaryNode. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
b12397c68e Minor formatting tweak. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
cb0f27c719 Reworks ::updateValue for Opm::EclIO::SummaryNode. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
b940d81aed Rewrites ::need_wells() for Opm::EclIO::SummaryNode. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
001877df2b Simplifies namespace declaration. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
84c57ff37b Review Action: Renames Opm::EclIO::SummaryNode::name => wgname 2020-03-20 14:08:03 +01:00
Williham Williham Totland
4bb453dd14 Adds a test for Opm::EclIO::SummaryNode::unique_key() 2020-03-20 14:08:03 +01:00
Williham Williham Totland
d9e1d397d6 Fixes order of accumulation for key parts. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
c3de96b1f4 Makes fallthrough explicit. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
dbf17af4a7 Minor formatting tweaks. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
861c098912 Implements Opm::EclIO::SummaryNode::unique_key(). 2020-03-20 14:08:03 +01:00
Williham Williham Totland
0265b7fb46 Renames variables for clarity. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
90a2eeb7fc Reworks to unified initialisation. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
e317b9663a Removes extraneous type. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
e5e0a49e89 Adds conversion operator SummaryConfigNode => SummaryNode. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
3af0bbf3cb Removes extraneous names. 2020-03-20 14:08:03 +01:00
Williham Williham Totland
402f28f749 Adds Opm::EclIO::SummaryNode::Type::Mode. 2020-03-20 14:08:03 +01:00
Arne Morten Kvarving
c57af82c52 Merge pull request #1616 from akva2/fix_dynmap
fixed: make a two-param map template for splitDynMap
2020-03-20 14:06:50 +01:00
Arne Morten Kvarving
f0a25e4cf3 fixed: make a two-param map template for splitDynMap
gcc is more forgiving with default template parameters than clang.
2020-03-20 12:42:30 +01:00
Joakim Hove
49bd6e9bd7 Use 'real' connections when creating test data 2020-03-20 11:13:05 +01:00
Joakim Hove
c97ff53a51 White space/reformatting in test code 2020-03-20 11:01:08 +01:00
Joakim Hove
438e4b68bf Merge pull request #1612 from joakim-hove/connection-global-index
Add global_index to Connections
2020-03-20 09:08:49 +01:00
Joakim Hove
f87369713b Add global_index to Connections 2020-03-19 22:14:06 +01:00
Joakim Hove
25e31a95ca Merge pull request #1611 from joakim-hove/aggregate-connections-rename
Minor refactoring for improved readability
2020-03-19 22:05:07 +01:00
Joakim Hove
7a6208a66a Minor refactoring for improved readability 2020-03-19 16:53:57 +01:00
Bård Skaflestad
4b85366d7e Merge pull request #1592 from jalvestad/opm_data_Groups
Changes in opm-common for current Production/Injection Group Control parameters
2020-03-19 16:53:07 +01:00
Torbjørn Skille
059f2fba57 Update of python bindings for EclFile
-> two extra overloads for getting (array name + array name, occurrence)
   -> extra member function count(std::string), count occurrences of arrays with a specific name.
2020-03-19 15:57:39 +01:00
Arne Morten Kvarving
ae858182eb Merge pull request #1605 from akva2/serialize_internal_schedule
Internal serialization in Schedule
2020-03-19 12:53:00 +01:00
Arne Morten Kvarving
524b180102 update UDQConfig serialization
to avoid the need for OPM defined types in underlying
serializer
2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
63cbf052d6 update TransMult serialization
to avoid the need for OPM defined types in underlying
serializer
2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
66a4d1119d add serialization template to VFPProdTable 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
4d7d3b0e7c add serialization template to VFPInjTable 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
e4e853065c remove accessors in Group added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
5304b0ce2b add serialization template to Group 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
21e5d975e8 add serialization template to GroupProductionProperties 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
a87ec3ad46 add serialization template to GroupInjectionProperties 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
12889a675d remove accessors in IOrderSet added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
d25220ba4e add serialization template to IOrderSet 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
6100e1f572 remove accessors in Well added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
91bd6edd87 add serialization template to Well 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
0a4bb79b4a changed: use shared_ptr to mutable references
const refs are incompatible with serialization
2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
0a45fd4da6 add serialization template to WellType 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
2a3b3e3e73 remove accessors in WellSegments added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
815526a4a8 add serialization template to WellSegments 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
7c298d0891 remove accessors in Segment added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
117682d211 add serialization template to Segment 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
a6f546a87a add serialization template to Valve 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
335eb8c5e1 add serialization template to SpiralICD 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
dcbde5ea53 add serialization template to WellInjectionProperties 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
b045048e73 remove accessors in WellProductionProperties added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
9fb608fd0d add serialization template to WellProductionProperties 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
6079e1d261 remove accessors in WellConnections added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
39034dabe4 add serialization template to WellConnections 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
b9e745f3e5 add serialization template to Connection 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
689420f85a remove accessors in WellTracerProperties added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
f271d75063 add serialization template to WellTracerProperties 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
a6053d7817 add serialization template to WellBrineProperties 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
9c1c9f9e29 add serialization template to WellPolymerProperties 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
4d0672d31a add serialization template to WellFoamProperties 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
7e817e7d26 add serialization template to WellEconProductionLimits 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
a4274c4b1a add serialization template to WellGuideRate 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
dc6f4291d8 refactor DynamicState split methods for reuse
friend class Schedule so it can call them.
2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
ea45dcb01a remove accessors in Deck added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
461e24209d add serialization template to Deck 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
6519429291 remove accessors in Actions added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
91d62c63a1 add serialization template to Actions 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
f8cb4a80ff remove accessors in ActionAST added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
9cd1403b33 add serialization template to ActionAST 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
8ad0111ded remove accessors in ActionX added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
e0a02e893a add serialization template to ActionX 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
3ea3fb4f8f add serialization template to Action::Condition 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
aa33b4c7c1 add serialization template to Action::Quantity 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
9e37416447 remove accessors in DeckKeyword added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
ae55a7f4d1 add serialization template to DeckKeyword 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
902fd38eb2 add serialization template to Location 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
c88e586993 remove accessors in DeckRecord added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
afa466771b add serialization template to DeckRecord 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
5abfb155fb remove accessors in ASTNode added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
dc142f9f43 add serialization template to ASTNode 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
c1f5635210 remove accessors in DeckItem added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
40b230473c add serialization template to DeckItem 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
ac5d8817bc use serializer for global_whistctl_mode 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
422509d201 remove accessors in GConSump added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
f61da6684d add serialization template to GConSump 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
21ba0ad213 remove accessors in GConSale added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
bfc44df84f add serialization template to GConSale 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
0f31e76ae7 remove accessors in UnitSystem added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
977e1ce1d4 add serialization template to UnitSystem 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
1573687264 refactor: put copy-pasted switch in separate member function for reuse 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
9dc0761550 remove accessors in GuideRateConfig added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
a7c9ca900c add serialization template to GuideRateConfig 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
79263a74c4 remove accessors in GuideRateModel added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
f9aa3ee3d4 add serialization template to GuideRateModel 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
25a90bae6e add serialization template to UDAValue 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
27bfe63146 remove accessors in Dimension added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
82ade7e7e1 add serialization template to Dimension 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
78c15009e0 remove accessors in WListManager added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
eb05ba503d add serialization template to WListManager 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
2fd1170cd1 remove accessors in WellTestConfig added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
dadd5b59d6 add serialization template to WellTestConfig 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
64b21c2f96 use serializer.isSerializing() for clarity 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
4b7801ba84 remove accessors in MessageLimits added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
48eee807f7 add serialization template to MessageLimits 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
a89a669d20 add serialization template to Tuning 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
26006cc317 remove accessors in Events added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
abc73b341e add serialization template to Events 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
86b003dfad remove accessors in DynamicVector added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
1b1120646f add serialization template to DynamicVector 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
9b7c057c22 remove accessors in OilVaporizationProperties added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
9bb8350586 add serialization template to OilVaporizationProperties 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
aa9810f1ca use serializer for nupcol 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
19df064ce3 remove accessors in RFTConfig added for external serialization 2020-03-19 09:33:57 +01:00
Arne Morten Kvarving
276a65f232 add serialization template to RFTConfig 2020-03-19 09:26:03 +01:00
Arne Morten Kvarving
d626e16623 remove accessors in RestartConfig added for external serialization 2020-03-19 09:26:03 +01:00
Arne Morten Kvarving
ad32950271 add serialization template to RestartConfig 2020-03-19 09:26:03 +01:00
Arne Morten Kvarving
0a5c8a883d add bool parameter for non-complex type in DynamicState serialization 2020-03-19 09:26:03 +01:00
Arne Morten Kvarving
d076a18b85 add serialization template to TimeMap 2020-03-19 09:26:03 +01:00
Arne Morten Kvarving
1a745ddaa0 add serialization template to TimeStampUTC 2020-03-19 09:26:03 +01:00
Joakim Hove
b021e42f94 Merge pull request #1603 from joakim-hove/remove-num-removed
Remove num removed
2020-03-19 09:20:32 +01:00
Bård Skaflestad
f615f9270b Merge pull request #1599 from GitPaean/adding_some_connection_summary_keywords
adding a few connection summary keywords
2020-03-18 15:59:19 +01:00
Joakim Hove
b0e0b71964 Remove numRemoved member from WellConnections 2020-03-18 15:46:34 +01:00
Joakim Hove
447b625362 Merge pull request #1602 from joakim-hove/wellconnections-ordering
Move Connection::Order member from Well to WellConnections
2020-03-18 15:37:46 +01:00
Joakim Hove
acd73b76ea Remove unused method WellConnections::inputSize() 2020-03-18 15:36:17 +01:00
Torbjørn Skille
7699810f61 EclFile new member function count(std::string) which return number of arrays with a specific name 2020-03-18 14:56:49 +01:00
Joakim Hove
96d2cd59b3 Move Connection::Order member from Well to WellConnections 2020-03-18 14:28:53 +01:00
Jostein Alvestad
a4d3ec33f1 correction to buffer.write in opm/data/Groups 2020-03-18 14:13:05 +01:00
Kai Bao
1369a3509a adding a few connection summary keywords
COFR CWFR CGFR CWCT CGOR
2020-03-18 13:19:33 +01:00
Jostein Alvestad
51e3fac6b0 added tests/UDQ_ACTIONX_TEST1_U.DATA 2020-03-18 13:18:42 +01:00
Joakim Hove
4a2ccf3170 Merge pull request #1598 from joakim-hove/top-segment
Add method WellSegments::topSegment()
2020-03-17 14:59:11 +01:00
Arne Morten Kvarving
3f4ff89b01 Merge pull request #1597 from akva2/serialize_internal_eclstate_part5
Internal serialization in EclipseState - part 5
2020-03-17 13:59:03 +01:00
Joakim Hove
d27f537097 Add method WellSegments::topSegment() 2020-03-17 12:41:34 +01:00
Joakim Hove
11be4ef2a4 Merge pull request #1596 from joakim-hove/use-update-ref-depth
Use Well::updateRefDepth() in Well::updateSegments()
2020-03-17 12:31:47 +01:00
Arne Morten Kvarving
7b446b4d89 add serialization template to TableManager 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
08b7486597 add serialization template to Aqudims 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
641631d991 remove accessors in TableSchema added for external serialization 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
83f78c5918 add serialization template to TableSchema 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
6b18822c47 add serialization template to TableContainer 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
3575f88ee8 remove accessors in TableColumn added for external serialization 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
afd12dc1bd add serialization template to TableColumn 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
86ea1b8400 add serialization template to StandardCond 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
c5694f5d80 add serialization template to SolventDensityTable 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
6bbf72bba8 remove setter in SkpropolyTable added for external serialization 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
a80c5ffad3 add serialization template to SkprpolyTable 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
b0cd4e1c30 remove accessors in SimpleTable added for external serialization 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
a9fbd6b5b7 add serialization template to SimpleTable 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
17995453f4 remove accessors in RocktabTable added for external serialization 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
dd4336e72c add serialization template to RocktabTable 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
1f7d85d488 remove accessors in Rock2dtrTable added for external serialization 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
d7b6b282ca add serialization template to Rock2dtrTable 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
5090547a63 remove accessors in Rock2dTable added for external serialization 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
f36ebaec48 add serialization template to Rock2dTable 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
0b53169aff add serialization template to Regdims 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
199fc65bce remove accessors in PvtxTable added for external serialization 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
2dd91531ff add serialization template to PvtxTable 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
3a181e1f08 add serialization template to PvtwsaltTable 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
2340a2a1ea add serialization template to PolyInjTable 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
8aee2cedbc add serialization template to PlyshlogTable 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
bf1cbf1fed add serialization template to JFunc 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
5f67172a9c add serialization template to FlatTable 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
86090e0325 add serialization template to Eqldims 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
ae6b05777b add serialization template to DenT 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
248f8881f4 remove accessors in ColumnSchema added for external serialization 2020-03-17 12:05:48 +01:00
Arne Morten Kvarving
8c2ab633a2 add serialization template to ColumnSchema 2020-03-17 12:05:16 +01:00
Arne Morten Kvarving
09ddcfa0eb add serialization template to BrineDensityTable 2020-03-17 12:05:16 +01:00
Arne Morten Kvarving
eb91ba370b add serialization template to AquiferConfig 2020-03-17 12:05:16 +01:00
Arne Morten Kvarving
5d9605bc17 add serialization template to Aquifetp 2020-03-17 12:05:16 +01:00
Arne Morten Kvarving
e47723dbdc add serialization template to AquiferCT 2020-03-17 12:05:16 +01:00
Arne Morten Kvarving
2e5573e814 add serialization template to Aquancon 2020-03-17 12:05:16 +01:00
Joakim Hove
86b85aca01 Use Well::updateRefDepth() in Well::updateSegments() 2020-03-17 11:30:22 +01:00
Arne Morten Kvarving
ab50b48b42 Merge pull request #1579 from akva2/serialize_internal_eclstate_part4
Internal serialization in EclipseState - part 4
2020-03-17 10:38:40 +01:00
Joakim Hove
c0e328fd65 Merge pull request #1587 from tskille/eclio_huge_arrays
Adding support for larger EclFile arrays
2020-03-17 09:12:00 +01:00
Joakim Hove
0e8c5faba9 Merge pull request #1594 from joakim-hove/wellsegments-iter
Add begin() and end() iterators to WellSegments class
2020-03-17 09:10:54 +01:00
Arne Morten Kvarving
0a8c62ba3f remove accessors in UDQConfig added for external serialization 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
c04dff98bf add serialization template to UDQConfig 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
8bf05d9ba7 add serialization template for UDQIndex 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
6c19c2e8bb remove accessors in UDQDefine added for external serialization 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
76da13ba12 add serialization template to UDQDefine 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
657b265f0a remove accessors in UDQAssign added for external serialization 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
921daec3e7 add serialization template to UDQAssign 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
bf59ac6d33 remove accessors in UDQActive added for external serialization 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
9e291c34be add serialization template to UDQActive 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
d59fd93563 remove accessors in UDQASTNode added for external serialization 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
7f1d0c40f9 add serialization template to UDQASTNode 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
6a7560beaa add serialization template to DynamicState 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
69f20d9125 add serialization template to Runspec 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
e895fc05a6 add serialization template to SatFuncControls 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
eb1e71b625 add serialization template to Actdims 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
4275feee3c add serialization template to EclHysterConfig 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
ca205a1f5d add serialization template to UDQParams 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
0a69ecf663 add serialization template to WellSegmentDims 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
93b2127a8b add serialization template to Welldims 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
44219ac24e remove accessor in EndpointScaling added for external serialization 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
c230e4d7b7 add serialization template to EndpointScaling 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
badb934039 add serialization template to Tabdims 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
84820fc147 remove accessor in Phases added for external serialization 2020-03-17 08:28:18 +01:00
Arne Morten Kvarving
afa9f61219 add serialization template to Phases 2020-03-17 08:28:18 +01:00
Torbjørn Skille
e3ae38feb9 Adding support for large arrays using X231 format extension
- EclIO classes have been updated to support arrays with size beyond numeric limits for integers
- Output of arrays having 2^31 or more elements is facilitated by using a pair of headers
- The first header is of type X231, second should have the actual type
- The large array format extension is documented in the Eclipse File format manual
2020-03-16 18:58:25 +01:00
Joakim Hove
37a37d2f12 Add begin() and end() iterators to WellSegments class 2020-03-16 17:28:08 +01:00
Joakim Hove
969bfe976c Merge pull request #1584 from joakim-hove/msw-rst-test
Msw rst test
2020-03-16 16:10:25 +01:00
Jostein Alvestad
82ea605cb8 removed default initialization for template group_control 2020-03-16 15:29:08 +01:00
Jostein Alvestad
6479391903 additional changes to add tests 2020-03-16 14:28:37 +01:00
Arne Morten Kvarving
704717950d Merge pull request #1578 from akva2/serialize_internal_eclstate_part3
Internal serialization in EclipseState - part 3
2020-03-16 14:21:36 +01:00
Jostein Alvestad
e77a2c7816 Added SummaryConfig.hpp 2020-03-16 14:04:04 +01:00
Jostein Alvestad
68ac742f17 further changes for opm-data Groups 2020-03-16 13:51:05 +01:00
Jostein Alvestad
a18439bbcc intital changes for adding opm/output/data/Groups 2020-03-16 13:35:25 +01:00
Joakim Hove
db015638f8 Merge pull request #1590 from joakim-hove/python-include-fix
Fix incorrect #include
2020-03-16 13:02:03 +01:00
Arne Morten Kvarving
4ea63cdba7 add serialization template to EclipseConfig 2020-03-16 12:59:20 +01:00
Arne Morten Kvarving
ff8cfcd7d1 remove accessors in IOConfig added for external serialization 2020-03-16 12:59:20 +01:00
Arne Morten Kvarving
58b7f8cd45 add serialization template to IOConfig 2020-03-16 12:59:20 +01:00
Arne Morten Kvarving
62a49dceb1 add serialization template to InitConfig 2020-03-16 12:59:20 +01:00
Arne Morten Kvarving
3362831db4 remove accessor in FoamConfig added for external serialization 2020-03-16 12:59:20 +01:00
Arne Morten Kvarving
044b82459f add serialization template to FoamConfig 2020-03-16 12:59:20 +01:00
Arne Morten Kvarving
d569225cc8 add serialization template to FoamData 2020-03-16 12:59:20 +01:00
Arne Morten Kvarving
70b8fe0899 remove accessor in Equil added for external serialization 2020-03-16 12:59:20 +01:00
Arne Morten Kvarving
44e9dc1a7c add serialization template to Equil 2020-03-16 12:59:20 +01:00
Arne Morten Kvarving
18a263f3bc add serialization template to EquilRecord 2020-03-16 12:59:20 +01:00
Arne Morten Kvarving
eed3811f45 Merge pull request #1573 from akva2/serialize_internal_eclstate_part2
Internal serialization in EclipseState - part 2
2020-03-16 12:58:26 +01:00
Joakim Hove
7b1a165d4b Merge pull request #1589 from joakim-hove/set-code-end
Remove #if 0 code block
2020-03-16 11:52:51 +01:00
Arne Morten Kvarving
3b92d5dc26 remove accessor in FaultCollection added for external serialization 2020-03-16 11:43:30 +01:00
Arne Morten Kvarving
8e00b911e2 add serialization template to FaultCollection 2020-03-16 11:43:30 +01:00
Arne Morten Kvarving
3957b528f6 remove accessor in Fault added for external serialization 2020-03-16 11:43:30 +01:00
Arne Morten Kvarving
8806d4e14c add serialization template to Fault 2020-03-16 11:43:29 +01:00
Arne Morten Kvarving
c822ae8a88 remove accessor in FaultFace added for external serialization 2020-03-16 11:43:29 +01:00
Arne Morten Kvarving
a8ce3ebdcc add serialization template to FaultFace 2020-03-16 11:43:29 +01:00
Arne Morten Kvarving
55c9822c1c add serialization template to OrderedMap 2020-03-16 11:43:29 +01:00
Arne Morten Kvarving
f74aa2db07 remove accessors in TransMult added for external serialization 2020-03-16 11:43:29 +01:00
Arne Morten Kvarving
cf9b9cf64c add serialization template to TransMult 2020-03-16 11:43:29 +01:00
Arne Morten Kvarving
ed0ed133a2 remove accessors in MULTREGTScanner added for external serialization
and make the serialization-friendly getSearchMap() private
2020-03-16 11:43:29 +01:00
Arne Morten Kvarving
e4465fc31c add serialization template to MULTREGTScanner 2020-03-16 11:43:29 +01:00
Arne Morten Kvarving
037620d83f Merge pull request #1568 from akva2/serialize_internal_eclstate_part1
Internal serialization in EclipseState - part 1
2020-03-16 11:42:51 +01:00
Joakim Hove
928a9be5db Fix incorrect #include 2020-03-16 11:41:09 +01:00
Arne Morten Kvarving
9e804f36e5 add serialization template to SimulationConfig 2020-03-16 10:50:17 +01:00
Arne Morten Kvarving
8569274c01 add serialization template to RockConfig 2020-03-16 10:50:17 +01:00
Arne Morten Kvarving
561518317b add serialization templates to BCConfig 2020-03-16 10:50:17 +01:00
Arne Morten Kvarving
10e3e5c998 remove accessors added to ThresholdPressure for external serialization 2020-03-16 10:50:17 +01:00
Arne Morten Kvarving
31a53f2ec5 add serialization template to ThresholdPressure 2020-03-16 10:50:17 +01:00
Arne Morten Kvarving
2419bb8d6a add serialization template to GridDims 2020-03-16 10:50:17 +01:00
Arne Morten Kvarving
7767a8b2b5 add serialization template to NNC and EDITNNC 2020-03-16 10:50:17 +01:00
Arne Morten Kvarving
62caad82a3 Merge pull request #1565 from akva2/serializer_schedule
Add serialization template to Schedule
2020-03-16 10:48:31 +01:00
Arne Morten Kvarving
e41919c6f5 remove accessors added for external serialization support 2020-03-16 10:47:11 +01:00
Arne Morten Kvarving
26b2a3a554 add serialization template to Schedule 2020-03-16 10:47:11 +01:00
Joakim Hove
b274561f07 Remove #if 0 code block 2020-03-16 09:54:22 +01:00
Joakim Hove
89479c5c75 Merge pull request #1588 from joakim-hove/remove-dead-code
Remove #if 0 code block
2020-03-16 09:46:09 +01:00
Joakim Hove
544621e646 Remove #if 0 code block 2020-03-16 09:06:35 +01:00
Joakim Hove
d79aadece0 Add msw based restart testing (currently disabled) 2020-03-14 09:15:51 +01:00
Joakim Hove
3c4a6a41f2 Add testdata for MSW based restart testing 2020-03-14 09:15:31 +01:00
Joakim Hove
47abe3cde9 Merge pull request #1583 from joakim-hove/rst-msw-initII
Rst msw init ii
2020-03-13 18:54:06 +01:00
Joakim Hove
d3ef0fd795 Merge pull request #1582 from wito/rename-summarynode
Rename SummaryNode to SummaryConfigNode
2020-03-13 16:53:38 +01:00
Joakim Hove
9967b38b16 Check defaulted value when initializing drainage_radius from SWEL 2020-03-13 16:05:16 +01:00
Joakim Hove
bed8d5fd04 Recognize +/- 1e20 as defaulted value in SWEL 2020-03-13 16:04:47 +01:00
Joakim Hove
ce68078963 Include connection insert index in Schedule::cmp 2020-03-13 16:03:49 +01:00
Joakim Hove
7e88f4b4c2 Merge pull request #1576 from joakim-hove/rst-msw-init
Rst msw init
2020-03-13 15:45:18 +01:00
Williham Williham Totland
4101d51ce5 Alphabetises includes. 2020-03-13 15:40:41 +01:00
Williham Williham Totland
ec2cd2f9eb Audits forward declarations. 2020-03-13 15:40:41 +01:00
Williham Williham Totland
fb7d4315c9 Renames Opm::SummaryNode to Opm::SummaryConfigNode. 2020-03-13 15:40:41 +01:00
Arne Morten Kvarving
939648e833 Merge pull request #1567 from akva2/serialize_summarynode
add serialization template to SummaryNode
2020-03-13 15:32:48 +01:00
Joakim Hove
0457a33f3c Merge pull request #1580 from wito/forward-declaration-fix
Minifix: Fixes forward declaration compiler warnings
2020-03-13 15:30:53 +01:00
Joakim Hove
23eda37c0a Make sure property Connection::r0 is initialized 2020-03-13 15:06:23 +01:00
Joakim Hove
f7b2e70282 Merge pull request #1577 from wito/summary-units
Adding support for inspecting units to Opm::EclIO::ESmry
2020-03-13 13:52:15 +01:00
Williham Williham Totland
5736111cf5 Resolves an issue where two structrs were forward declared as classes. 2020-03-13 13:49:03 +01:00
Williham Williham Totland
dddd45cec8 Simplifies name. 2020-03-13 12:35:17 +01:00
Williham Williham Totland
604c8a1169 Makes a number of variables const. 2020-03-13 12:34:47 +01:00
Joakim Hove
fb54272d6f Schedule::cmp - compare TimeMap 2020-03-13 12:18:08 +01:00
Joakim Hove
4d01b85e99 Add operator<< support for TimeMap 2020-03-13 12:17:41 +01:00
Joakim Hove
d53826ed28 Add small static function inverse_peaceman 2020-03-13 12:16:51 +01:00
Williham Williham Totland
916516db60 Rename variable for clarity. 2020-03-13 12:13:40 +01:00
Williham Williham Totland
1c29886ec0 Audits includes. 2020-03-13 12:05:40 +01:00
Joakim Hove
47ff1fc297 Merge pull request #1575 from joakim-hove/rst-testing
Add integration test for restart based Schedule init
2020-03-13 12:03:35 +01:00
Williham Williham Totland
7297a9736a Implements Opm::EclIO::ESmry::get_unit. 2020-03-13 11:55:43 +01:00
Joakim Hove
4433731079 Merge pull request #1566 from wito/rsm-testing
Adding support for the RUNSUM keyword in Opm::SummaryConfig
2020-03-13 11:16:30 +01:00
Williham Williham Totland
af61d58606 Removes trailing whitespace. 2020-03-13 10:39:53 +01:00
Williham Williham Totland
46abd74eba Adds stub for Opm::EclIO::ESmry::get_unit 2020-03-13 10:36:49 +01:00
Joakim Hove
6e7f8e4009 Add integration test for restart based Schedule init 2020-03-13 10:22:43 +01:00
Joakim Hove
acc8a5bc36 Merge pull request #1571 from joakim-hove/rst-schedule-III
Initialize Schedule from restart file
2020-03-13 10:20:03 +01:00
Williham Williham Totland
67f3d31254 Makes RPTONLY a processing instruction. 2020-03-13 10:02:48 +01:00
Williham Williham Totland
d5c4487808 Implements support for RUNSUM-related keywords NARROW and SEPARATE 2020-03-13 09:15:46 +01:00
Joakim Hove
edf01bdcda Initialize Schedule from restart file 2020-03-13 09:09:25 +01:00
Joakim Hove
952965ee07 Merge pull request #1570 from joakim-hove/schedule-cmp
Add context aware Schedule::cmp() function
2020-03-13 09:02:45 +01:00
Joakim Hove
191c50173a Add context aware Schedule::cmp() function 2020-03-13 08:03:36 +01:00
Williham Williham Totland
0910e55be7 Changes Opm::SummaryConfig::createRunSummary to be backed by a field. 2020-03-13 07:45:52 +01:00
Joakim Hove
e9bbab8b0d Merge pull request #1569 from joakim-hove/rst-schedule-parts
Rst schedule parts
2020-03-12 21:05:33 +01:00
Joakim Hove
a28f146d71 Add Well constructor based on restart well 2020-03-12 20:09:09 +01:00
Joakim Hove
e1dbd72689 Remove const and use std::move() when updating internal shared ptr 2020-03-12 18:11:25 +01:00
Joakim Hove
23bdbe51f2 Add wtype, drainage_radius and efficiency_factor members to rst::well 2020-03-12 18:11:25 +01:00
Joakim Hove
bf00fec1f9 Add Connection constructor based on RestartIO::connection 2020-03-12 18:11:25 +01:00
Joakim Hove
03be91a951 Add members cf_kind, cf, skin_factor and r0 to rst::connection 2020-03-12 18:11:25 +01:00
Joakim Hove
ee5f311a04 RestartIO::state - use internal UnitSystem member 2020-03-12 17:47:41 +01:00
Joakim Hove
034656b9fb Remove test application rst_load 2020-03-12 17:41:08 +01:00
Joakim Hove
0fa1be6f54 Add accessor to in productionControls 2020-03-12 17:40:15 +01:00
Joakim Hove
c7695a7ac1 Moved declarations 2020-03-12 17:34:54 +01:00
Williham Totland
a270964846 Adds tests for swallowing RUNSUM keyword. 2020-03-12 14:59:31 +01:00
Williham Totland
eb921fefa9 Corrects variable name used in test. 2020-03-12 14:25:34 +01:00
Williham Totland
700a6720c4 Returns keyword sets to function-local static const. 2020-03-12 14:07:57 +01:00
Williham Totland
4c06edcb22 Unifies keyword_set searching. 2020-03-12 13:39:35 +01:00
Williham Totland
7da9d975d4 Rewrites .count() > 0 to more idiomatic .find() != .end(). 2020-03-12 13:24:42 +01:00
Joakim Hove
8342d78fa0 Merge pull request #1556 from joakim-hove/connection-segment-attach-bug
Fixed: do not update insert_index when linking segment -> connection
2020-03-12 12:56:04 +01:00
Joakim Hove
fcfed6e125 Merge pull request #1563 from atgeirr/add-has-method-guiderate
Add GuideRate::has() method.
2020-03-12 12:55:44 +01:00
Williham Totland
7b70c109ff Replaces "fall-through" comments with attributes.
In order to in future support compiling with -Wimplicit-fallthrough, the human-only comments indicating the switch case fallthroughs have been replaced with compiler-friendly [[fallthrough]] attributes.

For reference: https://en.cppreference.com/w/cpp/language/attributes/fallthrough
2020-03-12 12:36:50 +01:00
Williham Totland
6f83c4198c Review Action: Renames SummaryConfig::doRunSummary to SummaryConfig::createRunSummary 2020-03-12 12:23:09 +01:00
Williham Totland
36e91f5cff Implements SummaryConfig::doRunSummary() 2020-03-12 12:14:00 +01:00
Arne Morten Kvarving
f25f7e77f5 add serialization template to SummaryNode 2020-03-12 12:11:01 +01:00
Williham Totland
7f6518af5f Extracts udq_blacklist as searchable unordered set. 2020-03-12 11:37:08 +01:00
Williham Totland
c5af3afebd Corrects test after discussion. 2020-03-12 11:35:38 +01:00
Williham Totland
97e55c565d Extracts static const specialkw as static { const special_keywords }. 2020-03-12 11:10:38 +01:00
Joakim Hove
d5855edc55 Fixed: do not update insert_index when linking segment -> connection 2020-03-12 11:01:56 +01:00
Joakim Hove
82028ca20d Merge pull request #1564 from akva2/less_shared_ptr
changed: store Regdims and Eqldims as regular members, not shared ptrs
2020-03-12 11:00:46 +01:00
Williham Totland
fcc2e32d66 Renames runsum to doRunSummary, adds accessor. 2020-03-12 10:52:10 +01:00
Joakim Hove
60194fca04 Add test to ESmry for units 2020-03-12 09:41:43 +01:00
Joakim Hove
af3f1b83e2 Remove trailing whitespace 2020-03-12 09:41:43 +01:00
Joakim Hove
7a9c0171d1 Add test to check whether RSM output has been requested 2020-03-12 09:28:48 +01:00
Arne Morten Kvarving
c8c8ef006d changed: store Regdims and Eqldims as regular members, not shared ptrs 2020-03-12 08:53:36 +01:00
Bård Skaflestad
0ec72754dd Merge pull request #1555 from joakim-hove/connection-def-segment-zero
The numerical value 0 is used to signify no connection <-> segment
2020-03-11 14:14:17 -05:00
Bård Skaflestad
dce9a2222f Merge pull request #1562 from joakim-hove/segment-reorder-refactor
Segment reorder refactor
2020-03-11 13:43:34 -05:00
Bård Skaflestad
7732e42658 Merge pull request #1552 from akva2/eclstate_serialize
add serialization template to EclipseState
2020-03-11 12:12:49 -05:00
Joakim Hove
d79350f20a Merge pull request #1560 from joakim-hove/rawkeyword-cleanup
Remove unused file
2020-03-11 16:30:07 +01:00
Joakim Hove
96f22730ca Minor reformatting 2020-03-11 16:14:21 +01:00
Joakim Hove
af02d6620d Align code 2020-03-11 15:46:00 +01:00
Joakim Hove
472984233f Use Segment instance for outlet segment 2020-03-11 15:42:49 +01:00
Atgeirr Flø Rasmussen
ce930d0158 Add virtual destructor for EclipseState class. 2020-03-11 15:19:47 +01:00
Atgeirr Flø Rasmussen
be2337e2c1 Add GuideRate::has(). 2020-03-11 15:19:47 +01:00
Joakim Hove
9b1d045631 Add segmentOrder() overload to avoid dummy argument 2020-03-11 14:49:17 +01:00
Joakim Hove
83ace5c03e Remove unused file 2020-03-11 14:33:12 +01:00
Bård Skaflestad
683723aa56 Merge pull request #1558 from joakim-hove/segment-use-named-index
Use enum values to look up indices when assembling segment info
2020-03-11 08:08:41 -05:00
Joakim Hove
222e0e7699 Use named constants in ISEG init 2020-03-11 13:39:42 +01:00
Joakim Hove
61894b5c3a Use enum values to look up indices when assembling segment info 2020-03-11 11:45:08 +01:00
Joakim Hove
3cc78f2487 The numerical value 0 is used to signify no connection <-> segment 2020-03-11 08:11:22 +01:00
Bård Skaflestad
64206e1d9a Merge pull request #1549 from akva2/serializer_summaryconfig
add serialization template to SummaryConfig
2020-03-10 20:20:08 -05:00
Arne Morten Kvarving
35eb136986 Merge pull request #1554 from dr-robertk/PR/cmake-check-include-file
[bugfix][cmake] Fix FindParMETIS check
2020-03-10 15:36:05 +01:00
Robert Kloefkorn
8de70f9128 [bugfix][cmake] Fix FindParMETIS check by adding missing
include(CheckIncludeFile).
2020-03-10 15:33:29 +01:00
Bård Skaflestad
cb7e40345f Merge pull request #1550 from akva2/followup_stonetype
changed: relocate and rename StoneType enum
2020-03-10 07:57:26 -05:00
Arne Morten Kvarving
1da29f8bd8 add serialization template to EclipseState 2020-03-10 13:47:11 +01:00
Arne Morten Kvarving
6a2c036582 add serialization template to SummaryConfig
remove accessors that was only required for the external serialization
support
2020-03-10 13:09:08 +01:00
Arne Morten Kvarving
c2108265b3 Merge pull request #1548 from akva2/simplify_oilvap_equality
simplify the OilVaporization equality operator
2020-03-10 12:31:10 +01:00
Joakim Hove
e3600cfc19 Merge pull request #1551 from joakim-hove/opmpack-fix2
Fix opmpack copy_file option in the case of empty directories
2020-03-10 12:22:30 +01:00
Arne Morten Kvarving
9b22cab024 changed: relocate and rename StoneType enum
unfortunate naming, unfortunate location
2020-03-10 11:09:49 +01:00
Joakim Hove
02fd4ab340 Fix opmpack copy_file option in the case of empty directories 2020-03-10 11:03:45 +01:00
Arne Morten Kvarving
d945dee95b simplify the OilVaporization equality operator
in particular the UNDEF -> false condition causes issues
in user code.
2020-03-10 09:55:46 +01:00
Joakim Hove
b8a30805d3 Merge pull request #1547 from joakim-hove/update-binary-testdata
Update embedded testdata with more items in restart file
2020-03-09 19:13:00 +01:00
Joakim Hove
cab6e21df6 Update embedded testdata with more items in restart file 2020-03-09 17:55:50 +01:00
Joakim Hove
ed0018ac98 Merge pull request #1546 from joakim-hove/rst-small
Rst small
2020-03-09 16:56:30 +01:00
Joakim Hove
b9b7cdc801 Merge pull request #1544 from joakim-hove/restart-items
Restart items
2020-03-09 16:55:57 +01:00
Joakim Hove
2edb1f4621 Add Well::DrainageRadius and Well::EfficiencyFactor to restart file 2020-03-09 16:52:03 +01:00
Joakim Hove
34984de671 Merge pull request #1519 from joakim-hove/add-welltype-class
Add WellTypes class
2020-03-09 16:40:22 +01:00
Joakim Hove
d1e4b28ad2 Merge pull request #1545 from joakim-hove/jenkins-enable-simulator-python
jenkins: Enable building of Python extension in opm-simulators
2020-03-09 15:32:55 +01:00
Joakim Hove
46cba99cfb Completion number has correct offset in file 2020-03-09 15:14:28 +01:00
Joakim Hove
b46b50ed5f Add explicit to one argument constructor 2020-03-09 15:14:23 +01:00
Joakim Hove
094270d994 Loading restart: check defaulted rates against value 1e+20 2020-03-09 15:06:08 +01:00
Joakim Hove
915dc982e8 Add throw protection when trying to create Valve from restart file 2020-03-09 14:59:35 +01:00
Joakim Hove
39c96ac9de Add UnitSystem member to restart state 2020-03-09 14:59:30 +01:00
Joakim Hove
d056e8e97d jenkins: Enable building of Python extension in opm-simulators 2020-03-09 14:31:10 +01:00
Joakim Hove
0bb822b9b5 Use WellType when reading and writing restart file 2020-03-09 13:30:18 +01:00
Joakim Hove
327625b713 Use the WellType class in Well and Schedule 2020-03-09 13:30:18 +01:00
Joakim Hove
6e8b4a6c12 Add WellType class for ecl interop 2020-03-09 13:29:11 +01:00
Joakim Hove
51a593de39 Merge pull request #1532 from joakim-hove/uda-value-dim-constructor
Uda value dim constructor
2020-03-09 13:28:22 +01:00
Joakim Hove
2eceab522d Merge pull request #1541 from joakim-hove/rst-tuning
Rst tuning
2020-03-09 13:27:02 +01:00
Joakim Hove
ff3949a6ce Output Connection::SkinFactor to restart file 2020-03-09 12:18:41 +01:00
Arne Morten Kvarving
8f7eefcf2a Merge pull request #1543 from akva2/internalize_stonetype
internalize STONE|STONE1|STONE2
2020-03-09 11:21:32 +01:00
Arne Morten Kvarving
825eb34e8a internalize STONE|STONE1|STONE2 2020-03-09 09:54:10 +01:00
Joakim Hove
86768666ae Merge pull request #1542 from wito/extended-network-model-API
Separates Opm::Group::parent() for the extended network model
2020-03-06 17:05:34 +01:00
Joakim Hove
43ae6e6a0e Initialize Tuning object when loading from restart file 2020-03-06 15:52:28 +01:00
Joakim Hove
75b8c12090 Publish indices required to look up Tuning parameters from DOUBHEAD 2020-03-06 15:52:28 +01:00
Joakim Hove
884e5e820a Add missing #include<.../Units.hpp> 2020-03-06 15:52:28 +01:00
Williham Totland
13e838d171 Separates Opm::Group::parent() for the extended network model
In order to support the extended network model going forwards, the method Opm::Group::parent() is split in the API into two new methods, Opm::Group::control_group() and Opm::Group::flow_group(). These methods give the names of the parent node in the group control hierarchy and network structure, respectively.

While for the standard network model these two values will be the same (and the same as ::parent()), code that presently calls ::parent() should be revisited with an eye to the question of which parent group is desired.
2020-03-06 14:38:38 +01:00
Arne Morten Kvarving
9116f6410c Merge pull request #1539 from akva2/serialize_plyshlog_rocktab
Prepare serialization for PlyshlogTable and RocktabTable
2020-03-06 13:55:26 +01:00
Arne Morten Kvarving
f0f87bb4b5 Merge pull request #1540 from akva2/internalize_stone1ex
internalize STONE1EX
2020-03-06 13:52:43 +01:00
Arne Morten Kvarving
f9c3368fc2 internalize STONE1EX 2020-03-06 12:08:13 +01:00
Arne Morten Kvarving
0cb8eecaa6 changed: use regular shared ptrs in table container
ptrs to const is problematic for serialization support
2020-03-06 09:59:09 +01:00
Arne Morten Kvarving
7fe4c3b23d prepare RocktabTable for serialization 2020-03-06 09:59:09 +01:00
Arne Morten Kvarving
9b0203b517 prepare PlyshlogTable for serialization 2020-03-06 09:59:09 +01:00
Arne Morten Kvarving
e4433dfc2d Merge pull request #1537 from akva2/internaliz_shrate
Internalize SHRATE
2020-03-06 09:58:42 +01:00
Joakim Hove
74e53f2a22 Merge pull request #1538 from joakim-hove/rename-order-connections
Rename function WellConnections::orderConnections()
2020-03-05 20:14:09 +01:00
Joakim Hove
0b26ece3c4 Rename function WellConnections::orderConnections() 2020-03-05 16:00:56 +01:00
Arne Morten Kvarving
33ebaa8753 internalize SHRATE 2020-03-05 14:34:01 +01:00
Arne Morten Kvarving
ef1e6d5fd8 Revert "added: PolymerConfig class"
This reverts commit a984ca5beb.
2020-03-05 14:17:51 +01:00
Arne Morten Kvarving
0fe106176e Merge pull request #1536 from akva2/internalize_plyvmh
internalize PLYVMH
2020-03-05 14:15:11 +01:00
Arne Morten Kvarving
93615f53c5 internalize PLYVMH 2020-03-05 13:13:33 +01:00
Arne Morten Kvarving
d47a064c1c Merge pull request #1534 from akva2/internalize_plmixpar
internalize PLMIXPAR
2020-03-05 13:10:24 +01:00
Joakim Hove
8501a7ead4 Construct UDA values in WellInjectionProperties with correct unit 2020-03-05 13:08:00 +01:00
Joakim Hove
17ec37ae4e WellProductionProperties - init with correct UDA dimensions 2020-03-05 13:08:00 +01:00
Joakim Hove
ac79a7a1b1 Add UnitSystem::getDimension( measure ) method 2020-03-05 13:08:00 +01:00
Joakim Hove
4b0ee9d0bb Remove method Dimension::newComposite() 2020-03-05 13:08:00 +01:00
Joakim Hove
874c734628 Remove name property from UnitSystem dimension 2020-03-05 13:08:00 +01:00
Joakim Hove
f8c250be34 UDAValue: change from ::reset() to ::operator=() 2020-03-05 13:08:00 +01:00
Joakim Hove
37d31aeac0 Remove UDAValue copy and modify constructor 2020-03-05 13:08:00 +01:00
Joakim Hove
157d3e4279 Add UDAValue constructor which takes dimension 2020-03-05 13:08:00 +01:00
Joakim Hove
3c0c94ff71 Remove stale comment 2020-03-05 13:08:00 +01:00
Arne Morten Kvarving
b53bd27a08 Merge pull request #1535 from akva2/add_polymerconfig
added: PolymerConfig class
2020-03-05 13:02:57 +01:00
Arne Morten Kvarving
a984ca5beb added: PolymerConfig class 2020-03-05 11:54:22 +01:00
Arne Morten Kvarving
c52efaecd3 Merge pull request #1533 from akva2/foamconfig_fix
fixed: update FoamConfig defaults
2020-03-05 11:16:18 +01:00
Arne Morten Kvarving
a1708080c1 internalize PLMIXPAR 2020-03-05 11:07:18 +01:00
Arne Morten Kvarving
c8ff9503a2 fixed: update FoamConfig defaults
Foam cases should run without FOAMOPTS available. That means
we need to default the mobility model to a valid value.

This also adds enum value 'FUNC' and handles setting the default model
if only transport phase is unspecified.
2020-03-05 09:13:03 +01:00
Joakim Hove
c75421a73e Merge pull request #1531 from atgeirr/fix-missing-include
Add missing <string> include.
2020-03-04 14:22:26 +01:00
Atgeirr Flø Rasmussen
1cbb1ddaf7 Merge pull request #1530 from akva2/foam_config_change
changed: don't enforce foam model limits in parser
2020-03-04 14:18:32 +01:00
Atgeirr Flø Rasmussen
92eb721e85 Add missing <string> include. 2020-03-04 13:51:49 +01:00
Arne Morten Kvarving
26bd5fd4a0 changed: don't enforce foam model limits in parser 2020-03-04 10:53:20 +01:00
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
a710e9b8b8 Add S keywords up to SURFST 2019-10-11 15:55:29 +02:00
1907 changed files with 199989 additions and 32871 deletions

View File

@@ -9,9 +9,9 @@ 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)
set(ENABLE_ECL_INPUT ON)
@@ -53,6 +53,7 @@ endif()
# we cannot generate dune.module since it is read by dunecontrol before
# the build starts, so it makes sense to keep the data there then.
include (OpmInit)
OpmSetPolicies()
# Look for the opm-tests repository; if found the variable
# HAVE_OPM_TESTS will be set to true.
@@ -72,7 +73,10 @@ macro (config_hook)
if(NOT cjson_FOUND)
list(APPEND EXTRA_INCLUDES ${PROJECT_SOURCE_DIR}/external/cjson)
endif()
# For this project
add_definitions(-DFMT_HEADER_ONLY)
list(APPEND EXTRA_INCLUDES SYSTEM ${PROJECT_SOURCE_DIR}/external/fmtlib/include)
include_directories(${EXTRA_INCLUDES} ${PROJECT_BINARY_DIR}/include)
# For downstreams
@@ -110,7 +114,10 @@ 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)
@@ -134,6 +141,21 @@ 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)
@@ -145,14 +167,17 @@ if (ENABLE_MOCKSIM)
add_executable(msim examples/msim.cpp)
target_link_libraries(msim mocksim)
set(_libs mocksim opmcommon
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
if (Boost_UNIT_TEST_FRAMEWORK_FOUND)
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)
endforeach()
foreach( test test_msim test_msim_ACTIONX test_msim_EXIT)
opm_add_test(${test} SOURCES tests/msim/${test}.cpp
LIBRARIES ${_libs}
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/tests
CONDITION ${HAVE_ECL_INPUT})
endforeach()
endif()
endif()
# Build the compare utilities
@@ -167,7 +192,11 @@ if(ENABLE_ECL_INPUT)
test_util/convertECL.cpp
)
foreach(target compareECL convertECL)
add_executable(summary
test_util/summary.cpp
)
foreach(target compareECL convertECL summary)
target_link_libraries(${target} opmcommon)
install(TARGETS ${target} DESTINATION bin)
endforeach()
@@ -178,7 +207,7 @@ if(ENABLE_ECL_INPUT)
opm_add_test(test_EclFilesComparator
CONDITION
ENABLE_ECL_INPUT
ENABLE_ECL_INPUT AND Boost_UNIT_TEST_FRAMEWORK_FOUND
SOURCES
tests/test_EclFilesComparator.cpp
test_util/EclFilesComparator.cpp
@@ -190,7 +219,7 @@ if(ENABLE_ECL_INPUT)
opm_add_test(test_EclRegressionTest
CONDITION
ENABLE_ECL_INPUT
ENABLE_ECL_INPUT AND Boost_UNIT_TEST_FRAMEWORK_FOUND
SOURCES
tests/test_EclRegressionTest.cpp
test_util/EclFilesComparator.cpp
@@ -202,7 +231,7 @@ if(ENABLE_ECL_INPUT)
)
foreach(test test_EclIO test_EGrid test_ERft test_ERst test_ESmry)
opm_add_test(${test} CONDITION ENABLE_ECL_INPUT
opm_add_test(${test} CONDITION ENABLE_ECL_INPUT AND Boost_UNIT_TEST_FRAMEWORK_FOUND
LIBRARIES ${_libs}
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/tests)
endforeach()
@@ -217,87 +246,131 @@ install(FILES etc/opm_bash_completion.sh.in DESTINATION share/opm/etc)
if (OPM_ENABLE_PYTHON)
# -------------------------------------------------------------------------
# 1: Wrap C++ functionality in Python
find_package(PythonInterp REQUIRED)
include(FindPythonInterp)
make_directory(${CMAKE_BINARY_DIR}/python)
set(PYTHON_PACKAGE_PATH "site-packages")
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")
get_target_property(_ecl_include_dirs ecl INTERFACE_INCLUDE_DIRECTORIES)
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}")
get_target_property(_ecl_lib ecl LOCATION)
get_filename_component(_ecl_lib_dir ${_ecl_lib} DIRECTORY)
set(_opmcommon_lib_dirs ${_ecl_lib_dir} ${CMAKE_BINARY_DIR}/lib ${CMAKE_PREFIX_PATH}/lib)
get_target_property(_opmcommon_lib_dirs opmcommon LINK_DIRECTORIES)
if (CMAKE_PREFIX_PATH)
list(APPEND _opmcommon_lib_dirs ${PROJECT_BINARY_DIR}/lib ${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR})
else()
list(APPEND _opmcommon_lib_dirs ${PROJECT_BINARY_DIR}/lib)
endif()
string(REPLACE ";" ":" _setup_lib_dirs "${_opmcommon_lib_dirs}")
add_custom_command(OUTPUT python/python/opm/libopmcommon_python.so
DEPENDS
python/cxx/connection.cpp
python/cxx/converters.hpp
python/cxx/deck.cpp
python/cxx/deck_keyword.cpp
python/cxx/eclipse_3d_properties.cpp
python/cxx/eclipse_config.cpp
python/cxx/eclipse_grid.cpp
python/cxx/eclipse_state.cpp
python/cxx/group.cpp
python/cxx/log.cpp
python/cxx/parsecontext.cpp
python/cxx/parser.cpp
python/cxx/schedule.cpp
python/cxx/export.cpp
python/cxx/export.hpp
python/cxx/common_state.cpp
python/cxx/common_state.hpp
python/cxx/table_manager.cpp
python/cxx/well.cpp
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/python/ ${CMAKE_BINARY_DIR}/python
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_BINARY_DIR}/python/setup.py
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()
set(opm-common_PYTHON_PACKAGE_VERSION ${OPM_PYTHON_PACKAGE_VERSION_TAG})
# Generate versioned setup.py
configure_file (${PROJECT_SOURCE_DIR}/python/setup.py.in ${PROJECT_BINARY_DIR}/python/setup.py)
file(COPY ${PROJECT_SOURCE_DIR}/python/README.md DESTINATION ${PROJECT_BINARY_DIR}/python)
execute_process(COMMAND ${PYTHON_EXECUTABLE} target_name.py
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/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=${CMAKE_BINARY_DIR}/python/python/opm
--build-lib=${PROJECT_BINARY_DIR}/python
--library-dirs=${_setup_lib_dirs}
${_rpath_arg}
--include-dirs=${_setup_include_dirs}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/python
COMMENT "Building python bindings")
add_custom_target(opmcommon_python ALL DEPENDS python/python/opm/libopmcommon_python.so)
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/python
COMMENT "Building python bindings at python/opm/${python_lib_target}")
add_custom_target(opmcommon_python ALL DEPENDS python/opm/${python_lib_target})
add_dependencies(opmcommon_python opmcommon)
install( CODE "execute_process(COMMAND mkdir -p ${CMAKE_INSTALL_PREFIX}/${PYTHON_INSTALL_PREFIX} )" )
install( CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} python/setup.py build_ext --dry-run install --prefix=${CMAKE_INSTALL_PREFIX} )" )
# 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/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 ${CMAKE_BINARY_DIR}/python
COMMAND ${PYTHON_EXECUTABLE} setup.py build_ext --dry-run --build-lib ${CMAKE_BINARY_DIR}/python/python/opm test
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/python
COMMAND ${CMAKE_COMMAND} -E env LD_LIBRARY_PATH=${PROJECT_BINARY_DIR}/lib ${PYTHON_EXECUTABLE} setup.py build_ext --dry-run --build-lib ${PROJECT_BINARY_DIR}/python test
)
set_target_properties(opmcommon PROPERTIES POSITION_INDEPENDENT_CODE ON)
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${CMAKE_BINARY_DIR}/python/python)
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${PROJECT_BINARY_DIR}/python)
# -------------------------------------------------------------------------
# Let cmake configure some small shell scripts which can be used to simplify
# building and testing of the Python extensions.
# 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-package.sh.in tmp/setup-package.sh)
file( COPY ${PROJECT_BINARY_DIR}/tmp/setup-package.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_include_directories(opmcommon SYSTEM PRIVATE "python/pybind11/include;${PYTHON_INCLUDE_DIRS}")
target_link_libraries(opmcommon PUBLIC ${PYTHON_LIBRARY})
add_definitions(-DEMBEDDED_PYTHON)

View File

@@ -21,7 +21,6 @@
# the library needs it.
list (APPEND MAIN_SOURCE_FILES
src/opm/common/data/SimulationDataContainer.cpp
src/opm/common/OpmLog/CounterLog.cpp
src/opm/common/OpmLog/EclipsePRTLog.cpp
src/opm/common/OpmLog/LogBackend.cpp
@@ -30,14 +29,19 @@ 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/OpmInputError.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/io/eclipse/SummaryNode.cpp
src/opm/json/JsonObject.cpp
src/opm/parser/eclipse/Deck/Deck.cpp
src/opm/parser/eclipse/Deck/DeckItem.cpp
@@ -45,18 +49,21 @@ if(ENABLE_ECL_INPUT)
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/Schedule/Action/PyAction.cpp
src/opm/parser/eclipse/EclipseState/AquiferConfig.cpp
src/opm/parser/eclipse/EclipseState/AquiferCT.cpp
src/opm/parser/eclipse/EclipseState/Aquifetp.cpp
src/opm/parser/eclipse/EclipseState/Aquancon.cpp
src/opm/parser/eclipse/EclipseState/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
@@ -65,10 +72,9 @@ 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
@@ -79,6 +85,7 @@ if(ENABLE_ECL_INPUT)
src/opm/parser/eclipse/EclipseState/IOConfig/IOConfig.cpp
src/opm/parser/eclipse/EclipseState/IOConfig/RestartConfig.cpp
src/opm/parser/eclipse/EclipseState/Runspec.cpp
src/opm/parser/eclipse/EclipseState/TracerConfig.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionAST.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionContext.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionResult.cpp
@@ -89,28 +96,41 @@ if(ENABLE_ECL_INPUT)
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/State.cpp
src/opm/parser/eclipse/EclipseState/Schedule/ArrayDimChecker.cpp
src/opm/parser/eclipse/EclipseState/Schedule/eval_uda.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Events.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Group/Group2.cpp
src/opm/parser/eclipse/EclipseState/Schedule/GasLiftOpt.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Group/GPMaint.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/KeywordHandlers.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/AICD.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MSW/SICD.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MSW/Valve.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Network/Branch.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Network/ExtNetwork.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Network/Node.cpp
src/opm/parser/eclipse/EclipseState/Schedule/OilVaporizationProperties.cpp
src/opm/parser/eclipse/EclipseState/Schedule/RFTConfig.cpp
src/opm/parser/eclipse/EclipseState/Schedule/RPTConfig.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Schedule.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/Connection.cpp
src/opm/parser/eclipse/EclipseState/Schedule/eval_uda.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/Well2.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/injection.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
@@ -118,26 +138,36 @@ if(ENABLE_ECL_INPUT)
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/TLMixpar.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/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/RwgsaltTable.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
@@ -146,11 +176,13 @@ if(ENABLE_ECL_INPUT)
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/UDQToken.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/UDQ/UDQState.cpp
src/opm/parser/eclipse/EclipseState/Schedule/VFPInjTable.cpp
src/opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.cpp
src/opm/parser/eclipse/Parser/ErrorGuard.cpp
@@ -166,34 +198,48 @@ if(ENABLE_ECL_INPUT)
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
)
if (OPM_ENABLE_EMBEDDED_PYTHON)
list( APPEND PYTHON_SOURCE_FILES
src/opm/parser/eclipse/Python/PythonInterp.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_3d_properties.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/export.cpp
python/cxx/common_state.cpp
python/cxx/summary_state.cpp
python/cxx/table_manager.cpp
python/cxx/unit_system.cpp
python/cxx/well.cpp
python/cxx/log.cpp
)
set_source_files_properties(${PYTHON_SOURCE_FILES} PROPERTIES COMPILE_FLAGS -Wno-shadow)
list( APPEND MAIN_SOURCE_FILES ${PYTHON_SOURCE_FILES})
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
src/opm/parser/eclipse/Python/PyRunModule.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)
@@ -207,13 +253,24 @@ if(ENABLE_ECL_OUTPUT)
src/opm/io/eclipse/EGrid.cpp
src/opm/io/eclipse/ERft.cpp
src/opm/io/eclipse/ERst.cpp
src/opm/io/eclipse/ERsm.cpp
src/opm/io/eclipse/ESmry.cpp
src/opm/io/eclipse/ESmry_write_rsm.cpp
src/opm/io/eclipse/OutputStream.cpp
src/opm/io/eclipse/SummaryNode.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
@@ -232,30 +289,34 @@ if(ENABLE_ECL_OUTPUT)
src/opm/output/eclipse/RestartValue.cpp
src/opm/output/eclipse/WriteInit.cpp
src/opm/output/eclipse/WriteRFT.cpp
src/opm/output/eclipse/WriteRPT.cpp
src/opm/output/eclipse/report/WELSPECS.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
tests/test_messagelimiter.cpp
tests/test_nonuniformtablelinear.cpp
tests/test_OpmInputError_format.cpp
tests/test_OpmLog.cpp
tests/test_param.cpp
tests/test_SimulationDataContainer.cpp
tests/test_RootFinders.cpp
tests/test_sparsevector.cpp
tests/test_uniformtablelinear.cpp
)
if(ENABLE_ECL_INPUT)
list(APPEND TEST_SOURCE_FILES
tests/rst_test.cpp
tests/test_ERsm.cpp
tests/test_GuideRate.cpp
tests/parser/ACTIONX.cpp
tests/parser/ADDREGTests.cpp
tests/parser/AquiferCTTests.cpp
tests/parser/AquifetpTests.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
@@ -265,17 +326,16 @@ if(ENABLE_ECL_INPUT)
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
@@ -283,18 +343,21 @@ if(ENABLE_ECL_INPUT)
tests/parser/MultiRegTests.cpp
tests/parser/MultisegmentWellTests.cpp
tests/parser/MULTREGTScannerTests.cpp
tests/parser/NetworkTests.cpp
tests/parser/OrderedMapTests.cpp
tests/parser/ParseContextTests.cpp
tests/parser/ParseContext_EXIT1.cpp
tests/parser/ParseDATAWithDefault.cpp
tests/parser/PYACTION.cpp
tests/parser/PORVTests.cpp
tests/parser/RawKeywordTests.cpp
tests/parser/test_ReportConfig.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
@@ -309,11 +372,11 @@ if(ENABLE_ECL_INPUT)
tests/parser/TableSchemaTests.cpp
tests/parser/ThresholdPressureTest.cpp
tests/parser/TimeMapTest.cpp
tests/parser/TracerTests.cpp
tests/parser/TransMultTests.cpp
tests/parser/TuningTests.cpp
tests/parser/UDQTests.cpp
tests/parser/UnitTests.cpp
tests/parser/ValueTests.cpp
tests/parser/WellSolventTests.cpp
tests/parser/WellTracerTests.cpp
tests/parser/WellTests.cpp
@@ -322,12 +385,14 @@ if(ENABLE_ECL_INPUT)
endif()
if(ENABLE_ECL_OUTPUT)
list (APPEND TEST_SOURCE_FILES
tests/test_AggregateActionxData.cpp
tests/test_AggregateWellData.cpp
tests/test_AggregateGroupData.cpp
tests/test_AggregateMSWData.cpp
tests/test_AggregateConnectionData.cpp
tests/test_AggregateUDQData.cpp
tests/test_ArrayDimChecker.cpp
tests/test_data_GuideRateValue.cpp
tests/test_EclipseIO.cpp
tests/test_DoubHEAD.cpp
tests/test_InteHEAD.cpp
@@ -338,8 +403,11 @@ if(ENABLE_ECL_OUTPUT)
tests/test_PaddedOutputString.cpp
tests/test_Restart.cpp
tests/test_RFT.cpp
tests/test_rst.cpp
tests/test_Solution.cpp
tests/test_Serializer.cpp
tests/test_Summary.cpp
tests/test_Summary_Group.cpp
tests/test_Tables.cpp
tests/test_Wells.cpp
tests/test_WindowedArray.cpp
@@ -352,10 +420,9 @@ list (APPEND TEST_DATA_FILES
)
if(ENABLE_ECL_OUTPUT)
list (APPEND TEST_DATA_FILES
tests/expect-wdims.chldg.err.out
tests/expect-wdims.err.out
tests/FIRST_SIM.DATA
tests/FIRST_SIM_THPRES.DATA
tests/BASE_SIM.DATA
tests/BASE_SIM_THPRES.DATA
tests/RESTART_SIM.DATA
tests/summary_deck.DATA
tests/group_group.DATA
tests/testblackoilstate3.DATA
@@ -368,7 +435,31 @@ if(ENABLE_ECL_OUTPUT)
tests/SPE1CASE1A.SMSPEC
tests/SPE9_CP_PACKED.DATA
tests/SOFR_TEST.DATA
tests/UDQ_BASE.DATA
tests/UDQ_RESTART.DATA
tests/UDQ_TEST_WCONPROD_IUAD-2.DATA
tests/UDQ_ACTIONX_TEST1.DATA
tests/UDQ_ACTIONX_TEST1_U.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
tests/PYACTION.DATA
tests/0A4_GRCTRL_LRAT_LRAT_GGR_BASE_MODEL2_MSW_ALL.DATA
tests/act1.py
tests/MSW.DATA
tests/EXIT_TEST.DATA
tests/action_syntax_error.py
tests/action_missing_run.py
tests/EMBEDDED_PYTHON.DATA
tests/wclose.py
tests/msim/MSIM_PYACTION.DATA
tests/msim/action1.py
tests/msim/action2.py
)
endif()
@@ -388,11 +479,15 @@ if(ENABLE_ECL_INPUT)
tests/SPE1CASE1A.UNSMRY
tests/SPE1CASE1_RST60.SMSPEC
tests/SPE1CASE1_RST60.UNSMRY
tests/MODEL2_RESTART.DATA
tests/restart/MODEL2.UNRST
)
list (APPEND EXAMPLE_SOURCE_FILES
examples/opmi.cpp
examples/opmpack.cpp
examples/opmhash.cpp
examples/wellgraph.cpp
examples/make_lodsmry.cpp
)
endif()
@@ -405,13 +500,13 @@ if(ENABLE_ECL_INPUT)
examples/opmi.cpp
examples/opmpack.cpp
examples/opmhash.cpp
examples/make_lodsmry.cpp
)
endif()
list( APPEND PUBLIC_HEADER_FILES
opm/common/ErrorMacros.hpp
opm/common/Exceptions.hpp
opm/common/data/SimulationDataContainer.hpp
opm/common/OpmLog/CounterLog.hpp
opm/common/OpmLog/EclipsePRTLog.hpp
opm/common/OpmLog/LogBackend.hpp
@@ -419,9 +514,14 @@ list( APPEND PUBLIC_HEADER_FILES
opm/common/OpmLog/LogUtil.hpp
opm/common/OpmLog/MessageFormatter.hpp
opm/common/OpmLog/MessageLimiter.hpp
opm/common/OpmLog/KeywordLocation.hpp
opm/common/OpmLog/OpmLog.hpp
opm/common/OpmLog/StreamLog.hpp
opm/common/OpmLog/TimerLog.hpp
opm/common/utility/Serializer.hpp
opm/common/utility/ActiveGridCells.hpp
opm/common/utility/FileSystem.hpp
opm/common/utility/OpmInputError.hpp
opm/common/utility/numeric/cmp.hpp
opm/common/utility/platform_dependent/disable_warnings.h
opm/common/utility/platform_dependent/reenable_warnings.h
@@ -441,14 +541,15 @@ 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/String.hpp
opm/common/utility/TimeService.hpp
)
if(ENABLE_ECL_INPUT)
list(APPEND PUBLIC_HEADER_FILES
opm/io/eclipse/SummaryNode.hpp
opm/json/JsonObject.hpp
opm/parser/eclipse/Utility/Stringview.hpp
opm/parser/eclipse/Utility/Functional.hpp
opm/parser/eclipse/Utility/Typetools.hpp
opm/parser/eclipse/Utility/String.hpp
opm/parser/eclipse/Generator/KeywordGenerator.hpp
opm/parser/eclipse/Generator/KeywordLoader.hpp
opm/parser/eclipse/Units/UnitSystem.hpp
@@ -466,30 +567,33 @@ if(ENABLE_ECL_INPUT)
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/FieldData.hpp
opm/parser/eclipse/EclipseState/Grid/Keywords.hpp
opm/parser/eclipse/EclipseState/Grid/GridDims.hpp
opm/parser/eclipse/EclipseState/Grid/TranCalculator.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/TracerConfig.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
@@ -499,6 +603,13 @@ 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/PermfactTable.hpp
opm/parser/eclipse/EclipseState/Tables/RwgsaltTable.hpp
opm/parser/eclipse/EclipseState/Tables/SaltvdTable.hpp
opm/parser/eclipse/EclipseState/Tables/SaltpvdTable.hpp
opm/parser/eclipse/EclipseState/Tables/SolventDensityTable.hpp
opm/parser/eclipse/EclipseState/Tables/PlydhflfTable.hpp
opm/parser/eclipse/EclipseState/Tables/PlymwinjTable.hpp
opm/parser/eclipse/EclipseState/Tables/PlyshlogTable.hpp
@@ -508,6 +619,7 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/EclipseState/Tables/SpecheatTable.hpp
opm/parser/eclipse/EclipseState/Tables/SgcwmisTable.hpp
opm/parser/eclipse/EclipseState/Tables/Sof2Table.hpp
opm/parser/eclipse/EclipseState/Tables/TLMixpar.hpp
opm/parser/eclipse/EclipseState/Tables/TableManager.hpp
opm/parser/eclipse/EclipseState/Tables/SwfnTable.hpp
opm/parser/eclipse/EclipseState/Tables/EnptvdTable.hpp
@@ -517,6 +629,8 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/EclipseState/Tables/JFunc.hpp
opm/parser/eclipse/EclipseState/Tables/TableIndex.hpp
opm/parser/eclipse/EclipseState/Tables/PvtgTable.hpp
opm/parser/eclipse/EclipseState/Tables/PvtgwTable.hpp
opm/parser/eclipse/EclipseState/Tables/PvtgwoTable.hpp
opm/parser/eclipse/EclipseState/Tables/Tabdims.hpp
opm/parser/eclipse/EclipseState/Tables/TableSchema.hpp
opm/parser/eclipse/EclipseState/Tables/RocktabTable.hpp
@@ -556,30 +670,41 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/EclipseState/Tables/ImkrvdTable.hpp
opm/parser/eclipse/EclipseState/Tables/Sof3Table.hpp
opm/parser/eclipse/EclipseState/Tables/SgofTable.hpp
opm/parser/eclipse/EclipseState/Tables/TracerVdTable.hpp
opm/parser/eclipse/EclipseState/EclipseState.hpp
opm/parser/eclipse/EclipseState/EclipseConfig.hpp
opm/parser/eclipse/EclipseState/Aquancon.hpp
opm/parser/eclipse/EclipseState/AquiferConfig.hpp
opm/parser/eclipse/EclipseState/AquiferCT.hpp
opm/parser/eclipse/EclipseState/Aquifetp.hpp
opm/parser/eclipse/EclipseState/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/Action/State.hpp
opm/parser/eclipse/EclipseState/Schedule/ArrayDimChecker.hpp
opm/parser/eclipse/EclipseState/Schedule/GasLiftOpt.hpp
opm/parser/eclipse/EclipseState/Schedule/Network/Branch.hpp
opm/parser/eclipse/EclipseState/Schedule/Network/ExtNetwork.hpp
opm/parser/eclipse/EclipseState/Schedule/Network/Node.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/Connection.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/ProductionControls.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/InjectionControls.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/Well2.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
@@ -590,29 +715,42 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/EclipseState/Schedule/DynamicVector.hpp
opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp
opm/parser/eclipse/EclipseState/Schedule/RFTConfig.hpp
opm/parser/eclipse/EclipseState/Schedule/RPTConfig.hpp
opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp
opm/parser/eclipse/EclipseState/Schedule/ScheduleTypes.hpp
opm/parser/eclipse/EclipseState/Schedule/Tuning.hpp
opm/parser/eclipse/EclipseState/Schedule/Group/GPMaint.hpp
opm/parser/eclipse/EclipseState/Schedule/Group/GTNode.hpp
opm/parser/eclipse/EclipseState/Schedule/Group/Group2.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/OilVaporizationProperties.hpp
opm/parser/eclipse/EclipseState/Schedule/DynamicState.hpp
opm/parser/eclipse/EclipseState/Schedule/MSW/icd.hpp
opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.hpp
opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.hpp
opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.hpp
opm/parser/eclipse/EclipseState/Schedule/MSW/updatingConnectionsWithSegments.hpp
opm/parser/eclipse/EclipseState/Schedule/MSW/AICD.hpp
opm/parser/eclipse/EclipseState/Schedule/MSW/SICD.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/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/UDQState.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
@@ -623,12 +761,13 @@ if(ENABLE_ECL_INPUT)
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/Deck/UDAValue.hpp
opm/parser/eclipse/Deck/value_status.hpp
opm/parser/eclipse/Python/Python.hpp)
endif()
if(ENABLE_ECL_OUTPUT)
@@ -640,12 +779,24 @@ if(ENABLE_ECL_OUTPUT)
opm/io/eclipse/EGrid.hpp
opm/io/eclipse/ERft.hpp
opm/io/eclipse/ERst.hpp
opm/io/eclipse/ERsm.hpp
opm/io/eclipse/ESmry.hpp
opm/io/eclipse/PaddedOutputString.hpp
opm/io/eclipse/OutputStream.hpp
opm/io/eclipse/SummaryNode.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/GuideRateValue.hpp
opm/output/data/Groups.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
@@ -653,6 +804,7 @@ if(ENABLE_ECL_OUTPUT)
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
@@ -673,7 +825,14 @@ if(ENABLE_ECL_OUTPUT)
opm/output/eclipse/WindowedArray.hpp
opm/output/eclipse/WriteInit.hpp
opm/output/eclipse/WriteRFT.hpp
opm/output/eclipse/WriteRPT.hpp
opm/output/eclipse/WriteRestartHelpers.hpp
opm/output/OutputWriter.hpp
)
endif()
if(ENABLE_ECL_INPUT OR ENABLE_ECL_OUTPUT)
list(APPEND TEST_SOURCE_FILES
tests/test_SummaryNode.cpp
)
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}
@@ -66,6 +61,16 @@ foreach (test BoxTest
list(APPEND EXTRA_TESTS ${test})
endforeach ()
opm_add_test( rst_spe1
SOURCES tests/rst_test.cpp
LIBRARIES ${TEST_LIBS}
TEST_ARGS tests/SPE1CASE2.DATA tests/SPE1CASE2_RESTART.DATA )
opm_add_test( rst_msw
SOURCES tests/rst_test.cpp
LIBRARIES ${TEST_LIBS}
TEST_ARGS tests/MSW.DATA tests/MSW_RESTART.DATA )
# opm-tests dependent tests
if(HAVE_OPM_TESTS)
opm_add_test(parse_write ONLY_COMPILE
@@ -90,7 +95,18 @@ if(HAVE_OPM_TESTS)
${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
@@ -107,3 +123,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

@@ -20,7 +20,7 @@ set(genkw_SOURCES src/opm/json/JsonObject.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
src/opm/common/utility/OpmInputError.cpp
src/opm/common/OpmLog/OpmLog.cpp
src/opm/common/OpmLog/Logger.cpp
src/opm/common/OpmLog/StreamLog.cpp
@@ -32,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)
@@ -40,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

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

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

View File

@@ -16,6 +16,9 @@ if(ZOLTAN_ROOT)
set(ZOLTAN_NO_DEFAULT_PATH "NO_DEFAULT_PATH")
endif()
# We only need zoltan with MPI. Otherwise usage of alugrid is broken.
find_package(MPI)
# Make sure we have checked for the underlying partitioners.
find_package(PTScotch)
#find_package(ParMETIS)
@@ -39,20 +42,23 @@ find_library(ZOLTAN_LIBRARIES
${ZOLTAN_NO_DEFAULT_PATH})
set (ZOLTAN_FOUND FALSE)
if (ZOLTAN_INCLUDE_DIRS OR ZOLTAN_LIBRARIES)
set(ZOLTAN_FOUND TRUE)
set (ZOLTAN_CONFIG_VAR HAVE_ZOLTAN)
# print a message to indicate status of this package
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args(ZOLTAN
DEFAULT_MSG
ZOLTAN_LIBRARIES
ZOLTAN_INCLUDE_DIRS
MPI_FOUND
)
if (ZOLTAN_FOUND)
set(HAVE_ZOLTAN 1)
set(ZOLTAN_LIBRARIES ${ZOLTAN_LIBRARIES} ${PARMETIS_LIBRARIES} ${PTSCOTCH_LIBRARIES})
set(ZOLTAN_INCLUDE_DIRS ${ZOLTAN_INCLUDE_DIRS} ${PARMETIS_INCLUDE_DIRS}
${PTSCOTCH_INCLUDE_DIRS})
endif()
set (ZOLTAN_CONFIG_VAR HAVE_ZOLTAN)
# print a message to indicate status of this package
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args(ZOLTAN
DEFAULT_MSG
ZOLTAN_LIBRARIES
ZOLTAN_INCLUDE_DIRS
)

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"
@@ -34,8 +33,7 @@ find_opm_package (
# test program
"#include <dune/geometry/quadraturerules.hh>
int main (void) {
Dune::GeometryType gt;
gt.makeQuadrilateral();
Dune::GeometryType gt = Dune::GeometryTypes::quadrilateral;
Dune::QuadratureRules<double, 2>::rule(gt, 2).size();
return 0;
}

View File

@@ -22,8 +22,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-geometry REQUIRED;
dune-uggrid;
MPI;

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,104 @@
# 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()
option(OPM_CLANG_WITH_STDC++FS "Using libstdc++ with clang and we want to link to stdc++fs" OFF)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND OPM_CLANG_WITH_STDC++FS)
list(APPEND ${project}_LIBRARIES stdc++fs)
endif()

View File

@@ -5,6 +5,8 @@ is_compiler_gcc_compatible ()
include(TestCXXAcceptsFlag)
macro (opm_defaults opm)
message("Processing opm_defaults ${opm}")
# if we are installing a development version (default when checking out of
# VCS), then remember which directories were used when configuring. package
# distribution should disable this option.

View File

@@ -54,17 +54,6 @@ foreach (name IN LISTS _opm_proj_vars)
endif (NOT DEFINED ${CMAKE_PROJECT_NAME}_${name})
endforeach (name)
# these dependencies needs special treatment
set (_opm_proj_exemptions
dune-common
dune-istl
dune-grid
dune-geometry
dune-uggrid
dune-alugrid
dune-localfunctions
dune-fem
)
# insert this boilerplate whenever we are going to find a new package
macro (find_and_append_package_to prefix name)
@@ -115,25 +104,15 @@ macro (find_and_append_package_to prefix name)
endif (EXISTS ${${NAME}_ROOT}/${name}-config.cmake OR EXISTS ${${NAME}_ROOT}/${name}Config.cmake)
endif (NOT DEFINED ${name}_DIR AND (DEFINED ${name}_ROOT OR DEFINED ${NAME}_ROOT))
# these libraries need special handling which is not provided in
# the -config.cmake file, but which must be provided by this project,
# something which is done in our find module
list (FIND _opm_proj_exemptions "${name}" _${name}_exempted)
if ((NOT (_${name}_exempted EQUAL -1)) AND (DEFINED ${name}_DIR))
set (${name}_ROOT "${${name}_DIR}")
# store this for later, in case we reconfigure
set (${name}_ROOT "${${name}_ROOT}" CACHE LOCATION "Path to ${name}")
# clear this to not use config mode
unset (${name}_DIR)
# variables that are given on the command-line is also put in the cache
# removing the local copy only "unshadows" this one
unset (${name}_DIR CACHE)
endif ((NOT (_${name}_exempted EQUAL -1)) AND (DEFINED ${name}_DIR))
# if we're told not to look for the package, pretend it was never found
if (CMAKE_DISABLE_FIND_PACKAGE_${name})
set (${name}_FOUND FALSE)
set (${NAME}_FOUND FALSE)
# If required send an error
cmake_parse_arguments(FIND "REQUIRED" "" "" ${ARGN} )
set (${name}_FOUND FALSE)
set (${NAME}_FOUND FALSE)
if (FIND_REQUIRED)
message(SEND_ERROR "package ${name} but disable with CMAKE_DISABLE_FIND_PACKAGE_${name}")
endif ()
else ()
# List of components might differ for every module. Therefore we will
# need to research for a library multiple times. _search_components
@@ -151,25 +130,8 @@ macro (find_and_append_package_to prefix name)
# and the likes which is only done via opm_find_package
if ( (NOT DEFINED ${name}_FOUND AND NOT DEFINED ${NAME}_FOUND )
OR _search_components GREATER -1)
string(REGEX MATCH "(dune|opm)-.*" _is_opm ${name})
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)
find_package (${name} ${ARGN})
elseif(_${name}_exempted GREATER -1)
string(REGEX MATCH "(opm)-.*" _is_opm ${name})
if(NOT _is_opm)
find_package (${name} ${ARGN})
else()
if(${name}_DIR)

View File

@@ -12,6 +12,59 @@
# This module should be the first to be included in the project,
# because most of the others (OpmXxx.cmake) use these variables.
# for CMake >= 3.0, we need to change a few policies:
#
# - 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
# - CMP0074 to indicate that <PackageName>_ROOT can be used to find package
# config files
macro(OpmSetPolicies)
if (POLICY CMP0026)
# Needed as we query LOCATION in OpmCompile.cmake and OpmSatellites.cmake
cmake_policy(SET CMP0026 OLD)
endif()
if (POLICY CMP0048)
# We do not set version. Hence NEW should work and this can be removed later
cmake_policy(SET CMP0048 NEW)
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)
cmake_policy(SET CMP0054 NEW)
endif()
# set the behavior of policy 0074 to new as we always used <PackageName>_ROOT as the
# root of the installation
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
# include special
if (CMAKE_VERSION VERSION_LESS "2.8.3")
message (STATUS "Enabling compatibility modules for CMake 2.8.3")
list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.3")
endif (CMAKE_VERSION VERSION_LESS "2.8.3")
if (CMAKE_VERSION VERSION_LESS "2.8.5")
message (STATUS "Enabling compatibility modules for CMake 2.8.5")
list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.5")
endif (CMAKE_VERSION VERSION_LESS "2.8.5")
if (CMAKE_VERSION VERSION_LESS "2.8.7")
message (STATUS "Enabling compatibility modules for CMake 2.8.7")
list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.7")
endif (CMAKE_VERSION VERSION_LESS "2.8.7")
endmacro()
# helper macro to retrieve a single field of a dune.module file
macro(OpmGetDuneModuleDirective field variable contents)
string (REGEX MATCH ".*${field}:[ ]*([^\n]+).*" ${variable} "${contents}")

View File

@@ -40,7 +40,7 @@ macro (opm_install opm)
set (_sys_dbg_def OFF)
endif (CMAKE_INSTALL_PREFIX STREQUAL "/usr")
option (SYSTEM_DEBUG "Put .debug files in GDB debug file directory" ${_sys_dbg_def})
set (DEBUG_FILE_DIRECTORY /usr/lib/debug CACHE LOCATION "GDB debug file directory")
set (DEBUG_FILE_DIRECTORY /usr/lib/debug CACHE PATH "GDB debug file directory")
mark_as_advanced (DEBUG_FILE_DIRECTORY)
if (SYSTEM_DEBUG AND NOT APPLE)
set (_dbg_prefix "${DEBUG_FILE_DIRECTORY}/")

View File

@@ -15,54 +15,23 @@
# tests_hook Do special processing before tests are compiled
# files_hook Do special processing before final targets are added
# for CMake >= 3.0, we need to change a few policies:
#
# - 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()
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)
cmake_policy(SET CMP0054 NEW)
endif()
# include special
if (CMAKE_VERSION VERSION_LESS "2.8.3")
message (STATUS "Enabling compatibility modules for CMake 2.8.3")
list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.3")
endif (CMAKE_VERSION VERSION_LESS "2.8.3")
if (CMAKE_VERSION VERSION_LESS "2.8.5")
message (STATUS "Enabling compatibility modules for CMake 2.8.5")
list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.5")
endif (CMAKE_VERSION VERSION_LESS "2.8.5")
if (CMAKE_VERSION VERSION_LESS "2.8.7")
message (STATUS "Enabling compatibility modules for CMake 2.8.7")
list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.7")
endif (CMAKE_VERSION VERSION_LESS "2.8.7")
# don't write default flags into the cache, preserve that for user set values
include (AddOptions)
no_default_options ()
# C++ project
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)
@@ -93,7 +62,10 @@ include (UseOptimization)
# turn on all warnings; this must be done before adding any
# dependencies, in case they alter the list of warnings
include (UseWarnings)
option(OPM_DISABLE_WARNINGS "Disable warning flags" OFF)
if(NOT OPM_DISABLE_WARNINGS)
include (UseWarnings)
endif()
# parallel programming
include (UseOpenMP)

View File

@@ -115,26 +115,34 @@ macro (find_opm_package module deps header lib defs prog conf)
# without config.h
config_cmd_line (${module}_CMD_CONFIG ${module}_CONFIG_VARS)
# check that we can compile a small test-program
include (CMakePushCheckState)
cmake_push_check_state ()
include (CheckCXXSourceCompiles)
# only add these if they are actually found; otherwise it won't
# compile and the variable won't be set
append_found (${module}_INCLUDE_DIRS CMAKE_REQUIRED_INCLUDES)
append_found (${module}_LIBRARIES CMAKE_REQUIRED_LIBRARIES)
# since we don't have any config.h yet
list (APPEND CMAKE_REQUIRED_DEFINITIONS ${${module}_DEFINITIONS})
list (APPEND CMAKE_REQUIRED_DEFINITIONS ${${module}_CMD_CONFIG})
check_cxx_source_compiles ("${prog}" HAVE_${MODULE})
cmake_pop_check_state ()
if(prog)
# check that we can compile a small test-program
include (CMakePushCheckState)
cmake_push_check_state ()
include (CheckCXXSourceCompiles)
# only add these if they are actually found; otherwise it won't
# compile and the variable won't be set
append_found (${module}_INCLUDE_DIRS CMAKE_REQUIRED_INCLUDES)
append_found (${module}_LIBRARIES CMAKE_REQUIRED_LIBRARIES)
# since we don't have any config.h yet
list (APPEND CMAKE_REQUIRED_DEFINITIONS ${${module}_DEFINITIONS})
list (APPEND CMAKE_REQUIRED_DEFINITIONS ${${module}_CMD_CONFIG})
check_cxx_source_compiles ("${prog}" HAVE_${MODULE})
cmake_pop_check_state ()
else(prog)
if(${module}_FOUND)
# No test code provided, mark compilation as successful
# if module was founf
set(HAVE_${MODULE} 1)
endif(${module}_FOUND)
endif(prog)
# write status message in the same manner as everyone else
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (
${module}
DEFAULT_MSG
${module}_INCLUDE_DIRS ${module}_LIBRARIES ${module}_FOUND ${module}_ALL_PREREQS
${module}_INCLUDE_DIRS ${module}_LIBRARIES ${module}_FOUND ${module}_ALL_PREREQS HAVE_${MODULE}
)
# some genius that coded the FindPackageHandleStandardArgs figured out

View File

@@ -56,6 +56,9 @@ macro (opm_compile_satellites opm satellite excl_all test_regexp)
# compile each of these separately
foreach (_sat_FILE IN LISTS ${satellite}_SOURCES)
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})
@@ -195,6 +198,7 @@ endmacro (opm_data satellite target dirname files)
# TEST_DEPENDS Other tests which must be run before running this test (optional, default: None)
# LIBRARIES Libraries to link test against (optional)
# WORKING_DIRECTORY Working directory for test (optional, default: ${PROJECT_BINARY_DIR})
# CONFIGURATION Configuration to add test to
#
# Example:
#
@@ -208,7 +212,7 @@ include(CMakeParseArguments)
macro(opm_add_test TestName)
cmake_parse_arguments(CURTEST
"NO_COMPILE;ONLY_COMPILE;ALWAYS_ENABLE" # flags
"EXE_NAME;PROCESSORS;WORKING_DIRECTORY" # one value args
"EXE_NAME;PROCESSORS;WORKING_DIRECTORY;CONFIGURATION" # one value args
"CONDITION;DEFAULT_ENABLE_IF;TEST_DEPENDS;DRIVER;DRIVER_ARGS;DEPENDS;TEST_ARGS;SOURCES;LIBRARIES" # multi-value args
${ARGN})
@@ -344,7 +348,8 @@ macro(opm_add_test TestName)
add_test(NAME ${_FANCY}
WORKING_DIRECTORY "${CURTEST_WORKING_DIRECTORY}"
COMMAND ${CURTEST_COMMAND})
COMMAND ${CURTEST_COMMAND}
CONFIGURATIONS ${CURTEST_CONFIGURATION})
# specify the dependencies between the tests
if (CURTEST_TEST_DEPENDS)

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

@@ -42,7 +42,13 @@ macro (find_openmp opm)
# enabling OpenMP is supposedly enough to make the compiler link with
# the appropriate libraries
find_package (OpenMP ${${opm}_QUIET})
list (APPEND ${opm}_LIBRARIES ${OpenMP_LIBRARIES})
if(OpenMP_CXX_FOUND)
list (APPEND ${opm}_LIBRARIES OpenMP::OpenMP_CXX)
else()
list (APPEND ${opm}_LIBRARIES ${OpenMP_LIBRARIES})
endif()
if (OPENMP_FOUND)
add_options (C ALL_BUILDS "${OpenMP_C_FLAGS}")
add_options (CXX ALL_BUILDS "${OpenMP_CXX_FLAGS}")

View File

@@ -14,6 +14,7 @@
# makes changes to any of the unit tests.
message("-- Writing version information to local header project-version.h")
string (TIMESTAMP build_timestamp "%Y-%m-%d at %H:%M:%S hrs")
string (TOUPPER "${CMAKE_BUILD_TYPE}" cmake_build_type_upper_)
if (cmake_build_type_upper_ MATCHES DEBUG)
@@ -25,6 +26,14 @@ if (cmake_build_type_upper_ MATCHES DEBUG)
"#define PROJECT_VERSION \"${${project}_LABEL} (debug)\"\n"
"#endif // OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
)
# Write header file with build timestamp
file (WRITE "${PROJECT_BINARY_DIR}/project-timestamp.h"
"#ifndef OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
"#define OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
"#define BUILD_TIMESTAMP \"${build_timestamp}\"\n"
"#endif // OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
)
else ()
if (NOT GIT_FOUND)
find_package (Git)
@@ -43,6 +52,13 @@ else ()
"#define PROJECT_VERSION \"${${project}_LABEL} (unknown git version)\"\n"
"#endif // OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
)
# Write header file with build timestamp
file (WRITE "${PROJECT_BINARY_DIR}/project-timestamp.h"
"#ifndef OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
"#define OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
"#define BUILD_TIMESTAMP \"${build_timestamp}\"\n"
"#endif // OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
)
else ()
add_custom_target (update-version ALL
COMMAND ${CMAKE_COMMAND}

View File

@@ -47,6 +47,8 @@ if (sha1)
endif ()
endif ()
string (TIMESTAMP build_timestamp "%Y-%m-%d at %H:%M:%S hrs")
# write the content to a temporary file in a C compatible format
file (WRITE "${PROJECT_BINARY_DIR}/project-version.tmp"
"#ifndef OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
@@ -63,3 +65,11 @@ file (WRITE "${PROJECT_BINARY_DIR}/project-version.tmp"
execute_process (COMMAND
${CMAKE_COMMAND} -E copy_if_different "${PROJECT_BINARY_DIR}/project-version.tmp" "${PROJECT_BINARY_DIR}/project-version.h"
)
# Write header file with build timestamp
file (WRITE "${PROJECT_BINARY_DIR}/project-timestamp.h"
"#ifndef OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
"#define OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
"#define BUILD_TIMESTAMP \"${build_timestamp}\"\n"
"#endif // OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
)

View File

@@ -30,6 +30,11 @@ if(NOT @opm-project_NAME@_FOUND)
set (@opm-project_NAME@_LINKER_FLAGS "@opm-project_LINKER_FLAGS@")
set (@opm-project_NAME@_CONFIG_VARS "@opm-project_CONFIG_VARS@")
# The flag whether embedded Python is supported or not is passed to downstream modules,
# it is only used to enable/disable regression testing with Python enabled input. The
# actual code is self contained - and can be used downstream without awareness of this.
set (@opm-project_NAME@_EMBEDDED_PYTHON @OPM_ENABLE_EMBEDDED_PYTHON@)
# 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@")
@@ -69,12 +74,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)

28
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
@@ -15,7 +16,7 @@ Vcs-Browser: https://github.com/OPM/opm-common
Package: libopm-common1
Section: libs
Pre-Depends: ${misc:Pre-Depends}, multiarch-support
Pre-Depends: ${misc:Pre-Depends}
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -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}
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: 2019.10-pre
Label: 2019.10-pre
Version: 2020.10-rc3
Label: 2020.10-rc3
Maintainer: opm@opm-project.org
MaintainerName: OPM community
Url: http://opm-project.org

109
examples/make_lodsmry.cpp Normal file
View File

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

View File

@@ -23,9 +23,11 @@
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
#include <opm/parser/eclipse/Python/Python.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
#include <opm/common/OpmLog/OpmLog.hpp>
#include <opm/msim/msim.hpp>
@@ -35,11 +37,14 @@ int main(int /* argc */, char** argv) {
Opm::Parser parser;
Opm::ParseContext parse_context;
Opm::ErrorGuard error_guard;
auto python = std::make_shared<Opm::Python>();
Opm::OpmLog::setupSimpleDefaultLogging();
Opm::Deck deck = parser.parseFile(deck_file, parse_context, error_guard);
Opm::EclipseState state(deck, parse_context, error_guard);
Opm::Schedule schedule(deck, state.getInputGrid(), state.get3DProperties(), state.runspec(), parse_context, error_guard);
Opm::SummaryConfig summary_config(deck, schedule, state.getTableManager(), parse_context, error_guard);
Opm::EclipseState state(deck);
Opm::Schedule schedule(deck, state, parse_context, error_guard, python);
Opm::SummaryConfig summary_config(deck, schedule, state.getTableManager(), state.aquifer(),
parse_context, error_guard);
if (error_guard) {
error_guard.dump();

View File

@@ -18,10 +18,10 @@
*/
#include <getopt.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <fmt/format.h>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
@@ -64,9 +64,10 @@ std::vector<keyword> load_deck(const char * deck_file) {
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(), kw.getFileName(), kw.getLineNumber(), std::hash<std::string>{}(ss.str()));
keywords.emplace_back(kw.name(), location.filename, location.lineno, std::hash<std::string>{}(ss.str()));
}
return keywords;
}
@@ -84,12 +85,11 @@ std::size_t deck_hash(const std::vector<keyword>& keywords) {
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;
fmt::print("{:8s} : {}:{} {} \n", kw.name, kw.filename, kw.line_number, kw.content_hash);
else
std::cout << std::setw(8) << std::left << kw.name << " : " << kw.content_hash << std::endl;
fmt::print("{:8s} : {} \n", kw.name, kw.content_hash);
}
std::cout << std::endl;
std::cout << std::setw(8) << std::left << "Total" << " : " << deck_hash(keywords) << std::endl;
fmt::print("\n{:8s} : {}\n", "Total", deck_hash(keywords));
}

View File

@@ -18,6 +18,8 @@
*/
#include <iostream>
#include <iomanip>
#include <chrono>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
@@ -27,6 +29,7 @@
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/Python/Python.hpp>
#include <opm/common/OpmLog/OpmLog.hpp>
#include <opm/common/OpmLog/StreamLog.hpp>
@@ -42,14 +45,41 @@ inline void loadDeck( const char * deck_file) {
Opm::ParseContext parseContext;
Opm::ErrorGuard errors;
Opm::Parser parser;
auto python = std::make_shared<Opm::Python>();
std::cout << "Loading deck: " << deck_file << " ..... "; std::cout.flush();
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();
Opm::EclipseState state( deck, parseContext, errors );
Opm::Schedule schedule( deck, state.getInputGrid(), state.get3DProperties(), state.runspec(), parseContext, errors);
Opm::SummaryConfig summary( deck, schedule, state.getTableManager( ), parseContext, errors );
std::cout << "complete." << std::endl;
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, python);
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( ), state.aquifer(),
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;
}

View File

@@ -17,18 +17,23 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#include <fstream>
#include <iostream>
#include <getopt.h>
#include <boost/filesystem.hpp>
#include <opm/common/utility/FileSystem.hpp>
#include <opm/parser/eclipse/Parser/ParserKeywords/I.hpp>
#include <opm/parser/eclipse/Parser/ParserKeywords/P.hpp>
#include <opm/parser/eclipse/Parser/ParserKeywords/G.hpp>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
#include <opm/parser/eclipse/Parser/InputErrorAction.hpp>
#include <opm/parser/eclipse/Deck/Deck.hpp>
namespace fs = Opm::filesystem;
inline void pack_deck( const char * deck_file, std::ostream& os) {
Opm::Deck pack_deck( const char * deck_file, std::ostream& os) {
Opm::ParseContext parseContext(Opm::InputError::WARN);
Opm::ErrorGuard errors;
Opm::Parser parser;
@@ -36,6 +41,7 @@ inline void pack_deck( const char * deck_file, std::ostream& os) {
auto deck = parser.parseFile(deck_file, parseContext, errors);
os << deck;
return deck;
}
@@ -62,21 +68,46 @@ 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;
{
const auto& parent_path = target_file.parent_path();
if (!parent_path.empty() && !fs::is_directory(parent_path))
fs::create_directories(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, "o:");
c = getopt(argc, argv, "c:o:");
if (c == -1)
break;
@@ -85,6 +116,11 @@ int main(int argc, char** argv) {
stdout_output = false;
coutput_arg = optarg;
break;
case 'c':
stdout_output = false;
copy_binary = true;
coutput_arg = optarg;
break;
}
}
arg_offset = optind;
@@ -95,16 +131,51 @@ int main(int argc, char** argv) {
pack_deck(argv[arg_offset], std::cout);
else {
std::ofstream os;
using path = boost::filesystem::path;
path input_arg(argv[arg_offset]);
path output_arg(coutput_arg);
if (boost::filesystem::is_directory(output_arg)) {
path output_path = output_arg / input_arg.filename();
os.open(output_path.string());
} else
os.open(output_arg.string());
fs::path input_arg(argv[arg_offset]);
fs::path output_arg(coutput_arg);
fs::path output_dir(coutput_arg);
pack_deck(argv[arg_offset], os);
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);
}
using IMPORT = Opm::ParserKeywords::IMPORT;
for (std::size_t import_index = 0; import_index < deck.count<IMPORT>(); import_index++) {
const auto& import_keyword = deck.getKeyword<IMPORT>(import_index);
const auto& fname = import_keyword.getRecord(0).getItem<IMPORT::FILE>().get<std::string>(0);
copy_file(input_arg.parent_path(), fname, output_dir);
}
using PYACTION = Opm::ParserKeywords::PYACTION;
for (std::size_t pyaction_index = 0; pyaction_index < deck.count<PYACTION>(); pyaction_index++) {
const auto& pyaction_keyword = deck.getKeyword<PYACTION>(pyaction_index);
const auto& fname = pyaction_keyword.getRecord(1).getItem<PYACTION::FILENAME>().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);
}
}
}
}

135
examples/wellgraph.cpp Normal file
View File

@@ -0,0 +1,135 @@
/*
Copyright 2013, 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/>.
*/
#include <fstream>
#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/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/Python/Python.hpp>
#include <opm/common/OpmLog/OpmLog.hpp>
#include <opm/common/OpmLog/StreamLog.hpp>
#include <opm/common/OpmLog/LogUtil.hpp>
#include <opm/common/utility/FileSystem.hpp>
inline void createDot(const Opm::Schedule& schedule, const std::string& casename)
{
std::cout << "Writing " << casename << ".gv .... "; std::cout.flush();
std::ofstream os(casename + ".gv");
os << "// This file was written by the 'wellgraph' utility from OPM.\n";
os << "// Find the source code at github.com/OPM.\n";
os << "// Convert output to PDF with 'dot -Tpdf " << casename << ".gv > " << casename << ".pdf'\n";
os << "strict digraph \"" << casename << "\"\n{\n";
const auto groupnames = schedule.groupNames();
const std::size_t last = schedule.getTimeMap().last();
// Group -> Group relations.
for (const auto& gn : groupnames) {
const auto& g = schedule.getGroup(gn, last);
const auto& children = g.groups();
if (!children.empty()) {
os << " \"" << gn << "\" -> {";
for (const auto& child : children) {
os << " \"" << child << '"';
}
os << " }\n";
}
}
// Group -> Well relations.
os << " node [shape=box]\n";
for (const auto& gn : groupnames) {
const auto& g = schedule.getGroup(gn, last);
const auto& children = g.wells();
if (!children.empty()) {
os << " \"" << gn << "\" -> {";
for (const auto& child : children) {
os << " \"" << child << '"';
}
os << " }\n";
}
}
// Color wells by injector or producer.
for (const auto& w : schedule.getWellsatEnd()) {
os << " \"" << w.name() << '"';
if (w.isProducer() && w.isInjector()) {
os << " [color=purple]\n";
} else if (w.isProducer()) {
os << " [color=red]\n";
} else {
os << " [color=blue]\n";
}
}
os << "}\n";
std::cout << "complete." << std::endl;
}
inline Opm::Schedule loadSchedule(const std::string& deck_file)
{
Opm::ParseContext parseContext({{Opm::ParseContext::PARSE_RANDOM_SLASH, Opm::InputError::IGNORE},
{Opm::ParseContext::PARSE_MISSING_DIMS_KEYWORD, Opm::InputError::WARN},
{Opm::ParseContext::SUMMARY_UNKNOWN_WELL, Opm::InputError::WARN},
{Opm::ParseContext::SUMMARY_UNKNOWN_GROUP, Opm::InputError::WARN}});
Opm::ErrorGuard errors;
Opm::Parser parser;
auto python = std::make_shared<Opm::Python>();
std::cout << "Loading and parsing deck: " << deck_file << " ..... "; std::cout.flush();
auto deck = parser.parseFile(deck_file, parseContext, errors);
std::cout << "complete.\n";
std::cout << "Creating EclipseState .... "; std::cout.flush();
Opm::EclipseState state( deck );
std::cout << "complete.\n";
std::cout << "Creating Schedule .... "; std::cout.flush();
Opm::Schedule schedule( deck, state, python);
std::cout << "complete." << std::endl;
return schedule;
}
int main(int argc, char** argv)
{
std::ostringstream os;
std::shared_ptr<Opm::StreamLog> string_log = std::make_shared<Opm::StreamLog>(os, Opm::Log::DefaultMessageTypes);
Opm::OpmLog::addBackend( "STRING" , string_log);
try {
for (int iarg = 1; iarg < argc; iarg++) {
const std::string filename = argv[iarg];
const auto sched = loadSchedule(filename);
const auto casename = Opm::filesystem::path(filename).stem();
createDot(sched, casename);
}
} catch (const std::exception& e) {
std::cout << "\n\n***** Caught an exception: " << e.what() << std::endl;
std::cout << "\n\n***** Printing log: "<< std::endl;
std::cout << os.str();
std::cout << "\n\n***** Exiting due to errors." << std::endl;
}
}

27
external/fmtlib/LICENSE.rst vendored Normal file
View File

@@ -0,0 +1,27 @@
Copyright (c) 2012 - present, Victor Zverovich
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 AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--- Optional exception to the license ---
As an exception, if, as a result of your compiling your source code, portions
of this Software are embedded into a machine-executable object form of such
source code, you may redistribute such embedded portions in such object form
without including the above copyright and permission notices.

12
external/fmtlib/README.opm vendored Normal file
View File

@@ -0,0 +1,12 @@
The include/ directory is a copy of the include directory from version 7.0.3 of
the fmtlib distribution. The fmtlib can be found at https://github.com/fmtlib/fmt
The fmtlib code embedded here should be compiled in header only mode, to ensure
that the symbol FMT_HEADER_ONLY must be defined before the the fmt/format.h
header is included:
#define FMT_HEADER_ONLY
#include <fmt/format.h>
....
auto msg = fmt::format("Hello {}", "world");

1123
external/fmtlib/include/fmt/chrono.h vendored Normal file

File diff suppressed because it is too large Load Diff

566
external/fmtlib/include/fmt/color.h vendored Normal file
View File

@@ -0,0 +1,566 @@
// Formatting library for C++ - color support
//
// Copyright (c) 2018 - present, Victor Zverovich and fmt contributors
// All rights reserved.
//
// For the license information refer to format.h.
#ifndef FMT_COLOR_H_
#define FMT_COLOR_H_
#include "format.h"
FMT_BEGIN_NAMESPACE
enum class color : uint32_t {
alice_blue = 0xF0F8FF, // rgb(240,248,255)
antique_white = 0xFAEBD7, // rgb(250,235,215)
aqua = 0x00FFFF, // rgb(0,255,255)
aquamarine = 0x7FFFD4, // rgb(127,255,212)
azure = 0xF0FFFF, // rgb(240,255,255)
beige = 0xF5F5DC, // rgb(245,245,220)
bisque = 0xFFE4C4, // rgb(255,228,196)
black = 0x000000, // rgb(0,0,0)
blanched_almond = 0xFFEBCD, // rgb(255,235,205)
blue = 0x0000FF, // rgb(0,0,255)
blue_violet = 0x8A2BE2, // rgb(138,43,226)
brown = 0xA52A2A, // rgb(165,42,42)
burly_wood = 0xDEB887, // rgb(222,184,135)
cadet_blue = 0x5F9EA0, // rgb(95,158,160)
chartreuse = 0x7FFF00, // rgb(127,255,0)
chocolate = 0xD2691E, // rgb(210,105,30)
coral = 0xFF7F50, // rgb(255,127,80)
cornflower_blue = 0x6495ED, // rgb(100,149,237)
cornsilk = 0xFFF8DC, // rgb(255,248,220)
crimson = 0xDC143C, // rgb(220,20,60)
cyan = 0x00FFFF, // rgb(0,255,255)
dark_blue = 0x00008B, // rgb(0,0,139)
dark_cyan = 0x008B8B, // rgb(0,139,139)
dark_golden_rod = 0xB8860B, // rgb(184,134,11)
dark_gray = 0xA9A9A9, // rgb(169,169,169)
dark_green = 0x006400, // rgb(0,100,0)
dark_khaki = 0xBDB76B, // rgb(189,183,107)
dark_magenta = 0x8B008B, // rgb(139,0,139)
dark_olive_green = 0x556B2F, // rgb(85,107,47)
dark_orange = 0xFF8C00, // rgb(255,140,0)
dark_orchid = 0x9932CC, // rgb(153,50,204)
dark_red = 0x8B0000, // rgb(139,0,0)
dark_salmon = 0xE9967A, // rgb(233,150,122)
dark_sea_green = 0x8FBC8F, // rgb(143,188,143)
dark_slate_blue = 0x483D8B, // rgb(72,61,139)
dark_slate_gray = 0x2F4F4F, // rgb(47,79,79)
dark_turquoise = 0x00CED1, // rgb(0,206,209)
dark_violet = 0x9400D3, // rgb(148,0,211)
deep_pink = 0xFF1493, // rgb(255,20,147)
deep_sky_blue = 0x00BFFF, // rgb(0,191,255)
dim_gray = 0x696969, // rgb(105,105,105)
dodger_blue = 0x1E90FF, // rgb(30,144,255)
fire_brick = 0xB22222, // rgb(178,34,34)
floral_white = 0xFFFAF0, // rgb(255,250,240)
forest_green = 0x228B22, // rgb(34,139,34)
fuchsia = 0xFF00FF, // rgb(255,0,255)
gainsboro = 0xDCDCDC, // rgb(220,220,220)
ghost_white = 0xF8F8FF, // rgb(248,248,255)
gold = 0xFFD700, // rgb(255,215,0)
golden_rod = 0xDAA520, // rgb(218,165,32)
gray = 0x808080, // rgb(128,128,128)
green = 0x008000, // rgb(0,128,0)
green_yellow = 0xADFF2F, // rgb(173,255,47)
honey_dew = 0xF0FFF0, // rgb(240,255,240)
hot_pink = 0xFF69B4, // rgb(255,105,180)
indian_red = 0xCD5C5C, // rgb(205,92,92)
indigo = 0x4B0082, // rgb(75,0,130)
ivory = 0xFFFFF0, // rgb(255,255,240)
khaki = 0xF0E68C, // rgb(240,230,140)
lavender = 0xE6E6FA, // rgb(230,230,250)
lavender_blush = 0xFFF0F5, // rgb(255,240,245)
lawn_green = 0x7CFC00, // rgb(124,252,0)
lemon_chiffon = 0xFFFACD, // rgb(255,250,205)
light_blue = 0xADD8E6, // rgb(173,216,230)
light_coral = 0xF08080, // rgb(240,128,128)
light_cyan = 0xE0FFFF, // rgb(224,255,255)
light_golden_rod_yellow = 0xFAFAD2, // rgb(250,250,210)
light_gray = 0xD3D3D3, // rgb(211,211,211)
light_green = 0x90EE90, // rgb(144,238,144)
light_pink = 0xFFB6C1, // rgb(255,182,193)
light_salmon = 0xFFA07A, // rgb(255,160,122)
light_sea_green = 0x20B2AA, // rgb(32,178,170)
light_sky_blue = 0x87CEFA, // rgb(135,206,250)
light_slate_gray = 0x778899, // rgb(119,136,153)
light_steel_blue = 0xB0C4DE, // rgb(176,196,222)
light_yellow = 0xFFFFE0, // rgb(255,255,224)
lime = 0x00FF00, // rgb(0,255,0)
lime_green = 0x32CD32, // rgb(50,205,50)
linen = 0xFAF0E6, // rgb(250,240,230)
magenta = 0xFF00FF, // rgb(255,0,255)
maroon = 0x800000, // rgb(128,0,0)
medium_aquamarine = 0x66CDAA, // rgb(102,205,170)
medium_blue = 0x0000CD, // rgb(0,0,205)
medium_orchid = 0xBA55D3, // rgb(186,85,211)
medium_purple = 0x9370DB, // rgb(147,112,219)
medium_sea_green = 0x3CB371, // rgb(60,179,113)
medium_slate_blue = 0x7B68EE, // rgb(123,104,238)
medium_spring_green = 0x00FA9A, // rgb(0,250,154)
medium_turquoise = 0x48D1CC, // rgb(72,209,204)
medium_violet_red = 0xC71585, // rgb(199,21,133)
midnight_blue = 0x191970, // rgb(25,25,112)
mint_cream = 0xF5FFFA, // rgb(245,255,250)
misty_rose = 0xFFE4E1, // rgb(255,228,225)
moccasin = 0xFFE4B5, // rgb(255,228,181)
navajo_white = 0xFFDEAD, // rgb(255,222,173)
navy = 0x000080, // rgb(0,0,128)
old_lace = 0xFDF5E6, // rgb(253,245,230)
olive = 0x808000, // rgb(128,128,0)
olive_drab = 0x6B8E23, // rgb(107,142,35)
orange = 0xFFA500, // rgb(255,165,0)
orange_red = 0xFF4500, // rgb(255,69,0)
orchid = 0xDA70D6, // rgb(218,112,214)
pale_golden_rod = 0xEEE8AA, // rgb(238,232,170)
pale_green = 0x98FB98, // rgb(152,251,152)
pale_turquoise = 0xAFEEEE, // rgb(175,238,238)
pale_violet_red = 0xDB7093, // rgb(219,112,147)
papaya_whip = 0xFFEFD5, // rgb(255,239,213)
peach_puff = 0xFFDAB9, // rgb(255,218,185)
peru = 0xCD853F, // rgb(205,133,63)
pink = 0xFFC0CB, // rgb(255,192,203)
plum = 0xDDA0DD, // rgb(221,160,221)
powder_blue = 0xB0E0E6, // rgb(176,224,230)
purple = 0x800080, // rgb(128,0,128)
rebecca_purple = 0x663399, // rgb(102,51,153)
red = 0xFF0000, // rgb(255,0,0)
rosy_brown = 0xBC8F8F, // rgb(188,143,143)
royal_blue = 0x4169E1, // rgb(65,105,225)
saddle_brown = 0x8B4513, // rgb(139,69,19)
salmon = 0xFA8072, // rgb(250,128,114)
sandy_brown = 0xF4A460, // rgb(244,164,96)
sea_green = 0x2E8B57, // rgb(46,139,87)
sea_shell = 0xFFF5EE, // rgb(255,245,238)
sienna = 0xA0522D, // rgb(160,82,45)
silver = 0xC0C0C0, // rgb(192,192,192)
sky_blue = 0x87CEEB, // rgb(135,206,235)
slate_blue = 0x6A5ACD, // rgb(106,90,205)
slate_gray = 0x708090, // rgb(112,128,144)
snow = 0xFFFAFA, // rgb(255,250,250)
spring_green = 0x00FF7F, // rgb(0,255,127)
steel_blue = 0x4682B4, // rgb(70,130,180)
tan = 0xD2B48C, // rgb(210,180,140)
teal = 0x008080, // rgb(0,128,128)
thistle = 0xD8BFD8, // rgb(216,191,216)
tomato = 0xFF6347, // rgb(255,99,71)
turquoise = 0x40E0D0, // rgb(64,224,208)
violet = 0xEE82EE, // rgb(238,130,238)
wheat = 0xF5DEB3, // rgb(245,222,179)
white = 0xFFFFFF, // rgb(255,255,255)
white_smoke = 0xF5F5F5, // rgb(245,245,245)
yellow = 0xFFFF00, // rgb(255,255,0)
yellow_green = 0x9ACD32 // rgb(154,205,50)
}; // enum class color
enum class terminal_color : uint8_t {
black = 30,
red,
green,
yellow,
blue,
magenta,
cyan,
white,
bright_black = 90,
bright_red,
bright_green,
bright_yellow,
bright_blue,
bright_magenta,
bright_cyan,
bright_white
};
enum class emphasis : uint8_t {
bold = 1,
italic = 1 << 1,
underline = 1 << 2,
strikethrough = 1 << 3
};
// rgb is a struct for red, green and blue colors.
// Using the name "rgb" makes some editors show the color in a tooltip.
struct rgb {
FMT_CONSTEXPR rgb() : r(0), g(0), b(0) {}
FMT_CONSTEXPR rgb(uint8_t r_, uint8_t g_, uint8_t b_) : r(r_), g(g_), b(b_) {}
FMT_CONSTEXPR rgb(uint32_t hex)
: r((hex >> 16) & 0xFF), g((hex >> 8) & 0xFF), b(hex & 0xFF) {}
FMT_CONSTEXPR rgb(color hex)
: r((uint32_t(hex) >> 16) & 0xFF),
g((uint32_t(hex) >> 8) & 0xFF),
b(uint32_t(hex) & 0xFF) {}
uint8_t r;
uint8_t g;
uint8_t b;
};
namespace detail {
// color is a struct of either a rgb color or a terminal color.
struct color_type {
FMT_CONSTEXPR color_type() FMT_NOEXCEPT : is_rgb(), value{} {}
FMT_CONSTEXPR color_type(color rgb_color) FMT_NOEXCEPT : is_rgb(true),
value{} {
value.rgb_color = static_cast<uint32_t>(rgb_color);
}
FMT_CONSTEXPR color_type(rgb rgb_color) FMT_NOEXCEPT : is_rgb(true), value{} {
value.rgb_color = (static_cast<uint32_t>(rgb_color.r) << 16) |
(static_cast<uint32_t>(rgb_color.g) << 8) | rgb_color.b;
}
FMT_CONSTEXPR color_type(terminal_color term_color) FMT_NOEXCEPT : is_rgb(),
value{} {
value.term_color = static_cast<uint8_t>(term_color);
}
bool is_rgb;
union color_union {
uint8_t term_color;
uint32_t rgb_color;
} value;
};
} // namespace detail
// Experimental text formatting support.
class text_style {
public:
FMT_CONSTEXPR text_style(emphasis em = emphasis()) FMT_NOEXCEPT
: set_foreground_color(),
set_background_color(),
ems(em) {}
FMT_CONSTEXPR text_style& operator|=(const text_style& rhs) {
if (!set_foreground_color) {
set_foreground_color = rhs.set_foreground_color;
foreground_color = rhs.foreground_color;
} else if (rhs.set_foreground_color) {
if (!foreground_color.is_rgb || !rhs.foreground_color.is_rgb)
FMT_THROW(format_error("can't OR a terminal color"));
foreground_color.value.rgb_color |= rhs.foreground_color.value.rgb_color;
}
if (!set_background_color) {
set_background_color = rhs.set_background_color;
background_color = rhs.background_color;
} else if (rhs.set_background_color) {
if (!background_color.is_rgb || !rhs.background_color.is_rgb)
FMT_THROW(format_error("can't OR a terminal color"));
background_color.value.rgb_color |= rhs.background_color.value.rgb_color;
}
ems = static_cast<emphasis>(static_cast<uint8_t>(ems) |
static_cast<uint8_t>(rhs.ems));
return *this;
}
friend FMT_CONSTEXPR text_style operator|(text_style lhs,
const text_style& rhs) {
return lhs |= rhs;
}
FMT_CONSTEXPR text_style& operator&=(const text_style& rhs) {
if (!set_foreground_color) {
set_foreground_color = rhs.set_foreground_color;
foreground_color = rhs.foreground_color;
} else if (rhs.set_foreground_color) {
if (!foreground_color.is_rgb || !rhs.foreground_color.is_rgb)
FMT_THROW(format_error("can't AND a terminal color"));
foreground_color.value.rgb_color &= rhs.foreground_color.value.rgb_color;
}
if (!set_background_color) {
set_background_color = rhs.set_background_color;
background_color = rhs.background_color;
} else if (rhs.set_background_color) {
if (!background_color.is_rgb || !rhs.background_color.is_rgb)
FMT_THROW(format_error("can't AND a terminal color"));
background_color.value.rgb_color &= rhs.background_color.value.rgb_color;
}
ems = static_cast<emphasis>(static_cast<uint8_t>(ems) &
static_cast<uint8_t>(rhs.ems));
return *this;
}
friend FMT_CONSTEXPR text_style operator&(text_style lhs,
const text_style& rhs) {
return lhs &= rhs;
}
FMT_CONSTEXPR bool has_foreground() const FMT_NOEXCEPT {
return set_foreground_color;
}
FMT_CONSTEXPR bool has_background() const FMT_NOEXCEPT {
return set_background_color;
}
FMT_CONSTEXPR bool has_emphasis() const FMT_NOEXCEPT {
return static_cast<uint8_t>(ems) != 0;
}
FMT_CONSTEXPR detail::color_type get_foreground() const FMT_NOEXCEPT {
FMT_ASSERT(has_foreground(), "no foreground specified for this style");
return foreground_color;
}
FMT_CONSTEXPR detail::color_type get_background() const FMT_NOEXCEPT {
FMT_ASSERT(has_background(), "no background specified for this style");
return background_color;
}
FMT_CONSTEXPR emphasis get_emphasis() const FMT_NOEXCEPT {
FMT_ASSERT(has_emphasis(), "no emphasis specified for this style");
return ems;
}
private:
FMT_CONSTEXPR text_style(bool is_foreground,
detail::color_type text_color) FMT_NOEXCEPT
: set_foreground_color(),
set_background_color(),
ems() {
if (is_foreground) {
foreground_color = text_color;
set_foreground_color = true;
} else {
background_color = text_color;
set_background_color = true;
}
}
friend FMT_CONSTEXPR_DECL text_style fg(detail::color_type foreground)
FMT_NOEXCEPT;
friend FMT_CONSTEXPR_DECL text_style bg(detail::color_type background)
FMT_NOEXCEPT;
detail::color_type foreground_color;
detail::color_type background_color;
bool set_foreground_color;
bool set_background_color;
emphasis ems;
};
FMT_CONSTEXPR text_style fg(detail::color_type foreground) FMT_NOEXCEPT {
return text_style(/*is_foreground=*/true, foreground);
}
FMT_CONSTEXPR text_style bg(detail::color_type background) FMT_NOEXCEPT {
return text_style(/*is_foreground=*/false, background);
}
FMT_CONSTEXPR text_style operator|(emphasis lhs, emphasis rhs) FMT_NOEXCEPT {
return text_style(lhs) | rhs;
}
namespace detail {
template <typename Char> struct ansi_color_escape {
FMT_CONSTEXPR ansi_color_escape(detail::color_type text_color,
const char* esc) FMT_NOEXCEPT {
// If we have a terminal color, we need to output another escape code
// sequence.
if (!text_color.is_rgb) {
bool is_background = esc == detail::data::background_color;
uint32_t value = text_color.value.term_color;
// Background ASCII codes are the same as the foreground ones but with
// 10 more.
if (is_background) value += 10u;
size_t index = 0;
buffer[index++] = static_cast<Char>('\x1b');
buffer[index++] = static_cast<Char>('[');
if (value >= 100u) {
buffer[index++] = static_cast<Char>('1');
value %= 100u;
}
buffer[index++] = static_cast<Char>('0' + value / 10u);
buffer[index++] = static_cast<Char>('0' + value % 10u);
buffer[index++] = static_cast<Char>('m');
buffer[index++] = static_cast<Char>('\0');
return;
}
for (int i = 0; i < 7; i++) {
buffer[i] = static_cast<Char>(esc[i]);
}
rgb color(text_color.value.rgb_color);
to_esc(color.r, buffer + 7, ';');
to_esc(color.g, buffer + 11, ';');
to_esc(color.b, buffer + 15, 'm');
buffer[19] = static_cast<Char>(0);
}
FMT_CONSTEXPR ansi_color_escape(emphasis em) FMT_NOEXCEPT {
uint8_t em_codes[4] = {};
uint8_t em_bits = static_cast<uint8_t>(em);
if (em_bits & static_cast<uint8_t>(emphasis::bold)) em_codes[0] = 1;
if (em_bits & static_cast<uint8_t>(emphasis::italic)) em_codes[1] = 3;
if (em_bits & static_cast<uint8_t>(emphasis::underline)) em_codes[2] = 4;
if (em_bits & static_cast<uint8_t>(emphasis::strikethrough))
em_codes[3] = 9;
size_t index = 0;
for (int i = 0; i < 4; ++i) {
if (!em_codes[i]) continue;
buffer[index++] = static_cast<Char>('\x1b');
buffer[index++] = static_cast<Char>('[');
buffer[index++] = static_cast<Char>('0' + em_codes[i]);
buffer[index++] = static_cast<Char>('m');
}
buffer[index++] = static_cast<Char>(0);
}
FMT_CONSTEXPR operator const Char*() const FMT_NOEXCEPT { return buffer; }
FMT_CONSTEXPR const Char* begin() const FMT_NOEXCEPT { return buffer; }
FMT_CONSTEXPR const Char* end() const FMT_NOEXCEPT {
return buffer + std::char_traits<Char>::length(buffer);
}
private:
Char buffer[7u + 3u * 4u + 1u];
static FMT_CONSTEXPR void to_esc(uint8_t c, Char* out,
char delimiter) FMT_NOEXCEPT {
out[0] = static_cast<Char>('0' + c / 100);
out[1] = static_cast<Char>('0' + c / 10 % 10);
out[2] = static_cast<Char>('0' + c % 10);
out[3] = static_cast<Char>(delimiter);
}
};
template <typename Char>
FMT_CONSTEXPR ansi_color_escape<Char> make_foreground_color(
detail::color_type foreground) FMT_NOEXCEPT {
return ansi_color_escape<Char>(foreground, detail::data::foreground_color);
}
template <typename Char>
FMT_CONSTEXPR ansi_color_escape<Char> make_background_color(
detail::color_type background) FMT_NOEXCEPT {
return ansi_color_escape<Char>(background, detail::data::background_color);
}
template <typename Char>
FMT_CONSTEXPR ansi_color_escape<Char> make_emphasis(emphasis em) FMT_NOEXCEPT {
return ansi_color_escape<Char>(em);
}
template <typename Char>
inline void fputs(const Char* chars, FILE* stream) FMT_NOEXCEPT {
std::fputs(chars, stream);
}
template <>
inline void fputs<wchar_t>(const wchar_t* chars, FILE* stream) FMT_NOEXCEPT {
std::fputws(chars, stream);
}
template <typename Char> inline void reset_color(FILE* stream) FMT_NOEXCEPT {
fputs(detail::data::reset_color, stream);
}
template <> inline void reset_color<wchar_t>(FILE* stream) FMT_NOEXCEPT {
fputs(detail::data::wreset_color, stream);
}
template <typename Char>
inline void reset_color(basic_memory_buffer<Char>& buffer) FMT_NOEXCEPT {
const char* begin = data::reset_color;
const char* end = begin + sizeof(data::reset_color) - 1;
buffer.append(begin, end);
}
template <typename Char>
void vformat_to(basic_memory_buffer<Char>& buf, const text_style& ts,
basic_string_view<Char> format_str,
basic_format_args<buffer_context<Char>> args) {
bool has_style = false;
if (ts.has_emphasis()) {
has_style = true;
auto emphasis = detail::make_emphasis<Char>(ts.get_emphasis());
buf.append(emphasis.begin(), emphasis.end());
}
if (ts.has_foreground()) {
has_style = true;
auto foreground = detail::make_foreground_color<Char>(ts.get_foreground());
buf.append(foreground.begin(), foreground.end());
}
if (ts.has_background()) {
has_style = true;
auto background = detail::make_background_color<Char>(ts.get_background());
buf.append(background.begin(), background.end());
}
detail::vformat_to(buf, format_str, args);
if (has_style) detail::reset_color<Char>(buf);
}
} // namespace detail
template <typename S, typename Char = char_t<S>>
void vprint(std::FILE* f, const text_style& ts, const S& format,
basic_format_args<buffer_context<Char>> args) {
basic_memory_buffer<Char> buf;
detail::vformat_to(buf, ts, to_string_view(format), args);
buf.push_back(Char(0));
detail::fputs(buf.data(), f);
}
/**
Formats a string and prints it to the specified file stream using ANSI
escape sequences to specify text formatting.
Example:
fmt::print(fmt::emphasis::bold | fg(fmt::color::red),
"Elapsed time: {0:.2f} seconds", 1.23);
*/
template <typename S, typename... Args,
FMT_ENABLE_IF(detail::is_string<S>::value)>
void print(std::FILE* f, const text_style& ts, const S& format_str,
const Args&... args) {
detail::check_format_string<Args...>(format_str);
using context = buffer_context<char_t<S>>;
format_arg_store<context, Args...> as{args...};
vprint(f, ts, format_str, basic_format_args<context>(as));
}
/**
Formats a string and prints it to stdout using ANSI escape sequences to
specify text formatting.
Example:
fmt::print(fmt::emphasis::bold | fg(fmt::color::red),
"Elapsed time: {0:.2f} seconds", 1.23);
*/
template <typename S, typename... Args,
FMT_ENABLE_IF(detail::is_string<S>::value)>
void print(const text_style& ts, const S& format_str, const Args&... args) {
return print(stdout, ts, format_str, args...);
}
template <typename S, typename Char = char_t<S>>
inline std::basic_string<Char> vformat(
const text_style& ts, const S& format_str,
basic_format_args<buffer_context<type_identity_t<Char>>> args) {
basic_memory_buffer<Char> buf;
detail::vformat_to(buf, ts, to_string_view(format_str), args);
return fmt::to_string(buf);
}
/**
\rst
Formats arguments and returns the result as a string using ANSI
escape sequences to specify text formatting.
**Example**::
#include <fmt/color.h>
std::string message = fmt::format(fmt::emphasis::bold | fg(fmt::color::red),
"The answer is {}", 42);
\endrst
*/
template <typename S, typename... Args, typename Char = char_t<S>>
inline std::basic_string<Char> format(const text_style& ts, const S& format_str,
const Args&... args) {
return vformat(ts, to_string_view(format_str),
detail::make_args_checked<Args...>(format_str, args...));
}
FMT_END_NAMESPACE
#endif // FMT_COLOR_H_

665
external/fmtlib/include/fmt/compile.h vendored Normal file
View File

@@ -0,0 +1,665 @@
// Formatting library for C++ - experimental format string compilation
//
// Copyright (c) 2012 - present, Victor Zverovich and fmt contributors
// All rights reserved.
//
// For the license information refer to format.h.
#ifndef FMT_COMPILE_H_
#define FMT_COMPILE_H_
#include <vector>
#include "format.h"
FMT_BEGIN_NAMESPACE
namespace detail {
// A compile-time string which is compiled into fast formatting code.
class compiled_string {};
template <typename S>
struct is_compiled_string : std::is_base_of<compiled_string, S> {};
/**
\rst
Converts a string literal *s* into a format string that will be parsed at
compile time and converted into efficient formatting code. Requires C++17
``constexpr if`` compiler support.
**Example**::
// Converts 42 into std::string using the most efficient method and no
// runtime format string processing.
std::string s = fmt::format(FMT_COMPILE("{}"), 42);
\endrst
*/
#define FMT_COMPILE(s) FMT_STRING_IMPL(s, fmt::detail::compiled_string)
template <typename T, typename... Tail>
const T& first(const T& value, const Tail&...) {
return value;
}
// Part of a compiled format string. It can be either literal text or a
// replacement field.
template <typename Char> struct format_part {
enum class kind { arg_index, arg_name, text, replacement };
struct replacement {
arg_ref<Char> arg_id;
dynamic_format_specs<Char> specs;
};
kind part_kind;
union value {
int arg_index;
basic_string_view<Char> str;
replacement repl;
FMT_CONSTEXPR value(int index = 0) : arg_index(index) {}
FMT_CONSTEXPR value(basic_string_view<Char> s) : str(s) {}
FMT_CONSTEXPR value(replacement r) : repl(r) {}
} val;
// Position past the end of the argument id.
const Char* arg_id_end = nullptr;
FMT_CONSTEXPR format_part(kind k = kind::arg_index, value v = {})
: part_kind(k), val(v) {}
static FMT_CONSTEXPR format_part make_arg_index(int index) {
return format_part(kind::arg_index, index);
}
static FMT_CONSTEXPR format_part make_arg_name(basic_string_view<Char> name) {
return format_part(kind::arg_name, name);
}
static FMT_CONSTEXPR format_part make_text(basic_string_view<Char> text) {
return format_part(kind::text, text);
}
static FMT_CONSTEXPR format_part make_replacement(replacement repl) {
return format_part(kind::replacement, repl);
}
};
template <typename Char> struct part_counter {
unsigned num_parts = 0;
FMT_CONSTEXPR void on_text(const Char* begin, const Char* end) {
if (begin != end) ++num_parts;
}
FMT_CONSTEXPR int on_arg_id() { return ++num_parts, 0; }
FMT_CONSTEXPR int on_arg_id(int) { return ++num_parts, 0; }
FMT_CONSTEXPR int on_arg_id(basic_string_view<Char>) {
return ++num_parts, 0;
}
FMT_CONSTEXPR void on_replacement_field(int, const Char*) {}
FMT_CONSTEXPR const Char* on_format_specs(int, const Char* begin,
const Char* end) {
// Find the matching brace.
unsigned brace_counter = 0;
for (; begin != end; ++begin) {
if (*begin == '{') {
++brace_counter;
} else if (*begin == '}') {
if (brace_counter == 0u) break;
--brace_counter;
}
}
return begin;
}
FMT_CONSTEXPR void on_error(const char*) {}
};
// Counts the number of parts in a format string.
template <typename Char>
FMT_CONSTEXPR unsigned count_parts(basic_string_view<Char> format_str) {
part_counter<Char> counter;
parse_format_string<true>(format_str, counter);
return counter.num_parts;
}
template <typename Char, typename PartHandler>
class format_string_compiler : public error_handler {
private:
using part = format_part<Char>;
PartHandler handler_;
part part_;
basic_string_view<Char> format_str_;
basic_format_parse_context<Char> parse_context_;
public:
FMT_CONSTEXPR format_string_compiler(basic_string_view<Char> format_str,
PartHandler handler)
: handler_(handler),
format_str_(format_str),
parse_context_(format_str) {}
FMT_CONSTEXPR void on_text(const Char* begin, const Char* end) {
if (begin != end)
handler_(part::make_text({begin, to_unsigned(end - begin)}));
}
FMT_CONSTEXPR int on_arg_id() {
part_ = part::make_arg_index(parse_context_.next_arg_id());
return 0;
}
FMT_CONSTEXPR int on_arg_id(int id) {
parse_context_.check_arg_id(id);
part_ = part::make_arg_index(id);
return 0;
}
FMT_CONSTEXPR int on_arg_id(basic_string_view<Char> id) {
part_ = part::make_arg_name(id);
return 0;
}
FMT_CONSTEXPR void on_replacement_field(int, const Char* ptr) {
part_.arg_id_end = ptr;
handler_(part_);
}
FMT_CONSTEXPR const Char* on_format_specs(int, const Char* begin,
const Char* end) {
auto repl = typename part::replacement();
dynamic_specs_handler<basic_format_parse_context<Char>> handler(
repl.specs, parse_context_);
auto it = parse_format_specs(begin, end, handler);
if (*it != '}') on_error("missing '}' in format string");
repl.arg_id = part_.part_kind == part::kind::arg_index
? arg_ref<Char>(part_.val.arg_index)
: arg_ref<Char>(part_.val.str);
auto part = part::make_replacement(repl);
part.arg_id_end = begin;
handler_(part);
return it;
}
};
// Compiles a format string and invokes handler(part) for each parsed part.
template <bool IS_CONSTEXPR, typename Char, typename PartHandler>
FMT_CONSTEXPR void compile_format_string(basic_string_view<Char> format_str,
PartHandler handler) {
parse_format_string<IS_CONSTEXPR>(
format_str,
format_string_compiler<Char, PartHandler>(format_str, handler));
}
template <typename OutputIt, typename Context, typename Id>
void format_arg(
basic_format_parse_context<typename Context::char_type>& parse_ctx,
Context& ctx, Id arg_id) {
ctx.advance_to(visit_format_arg(
arg_formatter<OutputIt, typename Context::char_type>(ctx, &parse_ctx),
ctx.arg(arg_id)));
}
// vformat_to is defined in a subnamespace to prevent ADL.
namespace cf {
template <typename Context, typename OutputIt, typename CompiledFormat>
auto vformat_to(OutputIt out, CompiledFormat& cf,
basic_format_args<Context> args) -> typename Context::iterator {
using char_type = typename Context::char_type;
basic_format_parse_context<char_type> parse_ctx(
to_string_view(cf.format_str_));
Context ctx(out, args);
const auto& parts = cf.parts();
for (auto part_it = std::begin(parts); part_it != std::end(parts);
++part_it) {
const auto& part = *part_it;
const auto& value = part.val;
using format_part_t = format_part<char_type>;
switch (part.part_kind) {
case format_part_t::kind::text: {
const auto text = value.str;
auto output = ctx.out();
auto&& it = reserve(output, text.size());
it = std::copy_n(text.begin(), text.size(), it);
ctx.advance_to(output);
break;
}
case format_part_t::kind::arg_index:
advance_to(parse_ctx, part.arg_id_end);
detail::format_arg<OutputIt>(parse_ctx, ctx, value.arg_index);
break;
case format_part_t::kind::arg_name:
advance_to(parse_ctx, part.arg_id_end);
detail::format_arg<OutputIt>(parse_ctx, ctx, value.str);
break;
case format_part_t::kind::replacement: {
const auto& arg_id_value = value.repl.arg_id.val;
const auto arg = value.repl.arg_id.kind == arg_id_kind::index
? ctx.arg(arg_id_value.index)
: ctx.arg(arg_id_value.name);
auto specs = value.repl.specs;
handle_dynamic_spec<width_checker>(specs.width, specs.width_ref, ctx);
handle_dynamic_spec<precision_checker>(specs.precision,
specs.precision_ref, ctx);
error_handler h;
numeric_specs_checker<error_handler> checker(h, arg.type());
if (specs.align == align::numeric) checker.require_numeric_argument();
if (specs.sign != sign::none) checker.check_sign();
if (specs.alt) checker.require_numeric_argument();
if (specs.precision >= 0) checker.check_precision();
advance_to(parse_ctx, part.arg_id_end);
ctx.advance_to(
visit_format_arg(arg_formatter<OutputIt, typename Context::char_type>(
ctx, nullptr, &specs),
arg));
break;
}
}
}
return ctx.out();
}
} // namespace cf
struct basic_compiled_format {};
template <typename S, typename = void>
struct compiled_format_base : basic_compiled_format {
using char_type = char_t<S>;
using parts_container = std::vector<detail::format_part<char_type>>;
parts_container compiled_parts;
explicit compiled_format_base(basic_string_view<char_type> format_str) {
compile_format_string<false>(format_str,
[this](const format_part<char_type>& part) {
compiled_parts.push_back(part);
});
}
const parts_container& parts() const { return compiled_parts; }
};
template <typename Char, unsigned N> struct format_part_array {
format_part<Char> data[N] = {};
FMT_CONSTEXPR format_part_array() = default;
};
template <typename Char, unsigned N>
FMT_CONSTEXPR format_part_array<Char, N> compile_to_parts(
basic_string_view<Char> format_str) {
format_part_array<Char, N> parts;
unsigned counter = 0;
// This is not a lambda for compatibility with older compilers.
struct {
format_part<Char>* parts;
unsigned* counter;
FMT_CONSTEXPR void operator()(const format_part<Char>& part) {
parts[(*counter)++] = part;
}
} collector{parts.data, &counter};
compile_format_string<true>(format_str, collector);
if (counter < N) {
parts.data[counter] =
format_part<Char>::make_text(basic_string_view<Char>());
}
return parts;
}
template <typename T> constexpr const T& constexpr_max(const T& a, const T& b) {
return (a < b) ? b : a;
}
template <typename S>
struct compiled_format_base<S, enable_if_t<is_compile_string<S>::value>>
: basic_compiled_format {
using char_type = char_t<S>;
FMT_CONSTEXPR explicit compiled_format_base(basic_string_view<char_type>) {}
// Workaround for old compilers. Format string compilation will not be
// performed there anyway.
#if FMT_USE_CONSTEXPR
static FMT_CONSTEXPR_DECL const unsigned num_format_parts =
constexpr_max(count_parts(to_string_view(S())), 1u);
#else
static const unsigned num_format_parts = 1;
#endif
using parts_container = format_part<char_type>[num_format_parts];
const parts_container& parts() const {
static FMT_CONSTEXPR_DECL const auto compiled_parts =
compile_to_parts<char_type, num_format_parts>(
detail::to_string_view(S()));
return compiled_parts.data;
}
};
template <typename S, typename... Args>
class compiled_format : private compiled_format_base<S> {
public:
using typename compiled_format_base<S>::char_type;
private:
basic_string_view<char_type> format_str_;
template <typename Context, typename OutputIt, typename CompiledFormat>
friend auto cf::vformat_to(OutputIt out, CompiledFormat& cf,
basic_format_args<Context> args) ->
typename Context::iterator;
public:
compiled_format() = delete;
explicit constexpr compiled_format(basic_string_view<char_type> format_str)
: compiled_format_base<S>(format_str), format_str_(format_str) {}
};
#ifdef __cpp_if_constexpr
template <typename... Args> struct type_list {};
// Returns a reference to the argument at index N from [first, rest...].
template <int N, typename T, typename... Args>
constexpr const auto& get(const T& first, const Args&... rest) {
static_assert(N < 1 + sizeof...(Args), "index is out of bounds");
if constexpr (N == 0)
return first;
else
return get<N - 1>(rest...);
}
template <int N, typename> struct get_type_impl;
template <int N, typename... Args> struct get_type_impl<N, type_list<Args...>> {
using type = remove_cvref_t<decltype(get<N>(std::declval<Args>()...))>;
};
template <int N, typename T>
using get_type = typename get_type_impl<N, T>::type;
template <typename T> struct is_compiled_format : std::false_type {};
template <typename Char> struct text {
basic_string_view<Char> data;
using char_type = Char;
template <typename OutputIt, typename... Args>
OutputIt format(OutputIt out, const Args&...) const {
return write<Char>(out, data);
}
};
template <typename Char>
struct is_compiled_format<text<Char>> : std::true_type {};
template <typename Char>
constexpr text<Char> make_text(basic_string_view<Char> s, size_t pos,
size_t size) {
return {{&s[pos], size}};
}
// A replacement field that refers to argument N.
template <typename Char, typename T, int N> struct field {
using char_type = Char;
template <typename OutputIt, typename... Args>
OutputIt format(OutputIt out, const Args&... args) const {
// This ensures that the argument type is convertile to `const T&`.
const T& arg = get<N>(args...);
return write<Char>(out, arg);
}
};
template <typename Char, typename T, int N>
struct is_compiled_format<field<Char, T, N>> : std::true_type {};
// A replacement field that refers to argument N and has format specifiers.
template <typename Char, typename T, int N> struct spec_field {
using char_type = Char;
mutable formatter<T, Char> fmt;
template <typename OutputIt, typename... Args>
OutputIt format(OutputIt out, const Args&... args) const {
// This ensures that the argument type is convertile to `const T&`.
const T& arg = get<N>(args...);
basic_format_context<OutputIt, Char> ctx(out, {});
return fmt.format(arg, ctx);
}
};
template <typename Char, typename T, int N>
struct is_compiled_format<spec_field<Char, T, N>> : std::true_type {};
template <typename L, typename R> struct concat {
L lhs;
R rhs;
using char_type = typename L::char_type;
template <typename OutputIt, typename... Args>
OutputIt format(OutputIt out, const Args&... args) const {
out = lhs.format(out, args...);
return rhs.format(out, args...);
}
};
template <typename L, typename R>
struct is_compiled_format<concat<L, R>> : std::true_type {};
template <typename L, typename R>
constexpr concat<L, R> make_concat(L lhs, R rhs) {
return {lhs, rhs};
}
struct unknown_format {};
template <typename Char>
constexpr size_t parse_text(basic_string_view<Char> str, size_t pos) {
for (size_t size = str.size(); pos != size; ++pos) {
if (str[pos] == '{' || str[pos] == '}') break;
}
return pos;
}
template <typename Args, size_t POS, int ID, typename S>
constexpr auto compile_format_string(S format_str);
template <typename Args, size_t POS, int ID, typename T, typename S>
constexpr auto parse_tail(T head, S format_str) {
if constexpr (POS !=
basic_string_view<typename S::char_type>(format_str).size()) {
constexpr auto tail = compile_format_string<Args, POS, ID>(format_str);
if constexpr (std::is_same<remove_cvref_t<decltype(tail)>,
unknown_format>())
return tail;
else
return make_concat(head, tail);
} else {
return head;
}
}
template <typename T, typename Char> struct parse_specs_result {
formatter<T, Char> fmt;
size_t end;
};
template <typename T, typename Char>
constexpr parse_specs_result<T, Char> parse_specs(basic_string_view<Char> str,
size_t pos) {
str.remove_prefix(pos);
auto ctx = basic_format_parse_context<Char>(str);
auto f = formatter<T, Char>();
auto end = f.parse(ctx);
return {f, pos + (end - str.data()) + 1};
}
// Compiles a non-empty format string and returns the compiled representation
// or unknown_format() on unrecognized input.
template <typename Args, size_t POS, int ID, typename S>
constexpr auto compile_format_string(S format_str) {
using char_type = typename S::char_type;
constexpr basic_string_view<char_type> str = format_str;
if constexpr (str[POS] == '{') {
if (POS + 1 == str.size())
throw format_error("unmatched '{' in format string");
if constexpr (str[POS + 1] == '{') {
return parse_tail<Args, POS + 2, ID>(make_text(str, POS, 1), format_str);
} else if constexpr (str[POS + 1] == '}') {
using type = get_type<ID, Args>;
return parse_tail<Args, POS + 2, ID + 1>(field<char_type, type, ID>(),
format_str);
} else if constexpr (str[POS + 1] == ':') {
using type = get_type<ID, Args>;
constexpr auto result = parse_specs<type>(str, POS + 2);
return parse_tail<Args, result.end, ID + 1>(
spec_field<char_type, type, ID>{result.fmt}, format_str);
} else {
return unknown_format();
}
} else if constexpr (str[POS] == '}') {
if (POS + 1 == str.size())
throw format_error("unmatched '}' in format string");
return parse_tail<Args, POS + 2, ID>(make_text(str, POS, 1), format_str);
} else {
constexpr auto end = parse_text(str, POS + 1);
return parse_tail<Args, end, ID>(make_text(str, POS, end - POS),
format_str);
}
}
template <typename... Args, typename S,
FMT_ENABLE_IF(is_compile_string<S>::value ||
detail::is_compiled_string<S>::value)>
constexpr auto compile(S format_str) {
constexpr basic_string_view<typename S::char_type> str = format_str;
if constexpr (str.size() == 0) {
return detail::make_text(str, 0, 0);
} else {
constexpr auto result =
detail::compile_format_string<detail::type_list<Args...>, 0, 0>(
format_str);
if constexpr (std::is_same<remove_cvref_t<decltype(result)>,
detail::unknown_format>()) {
return detail::compiled_format<S, Args...>(to_string_view(format_str));
} else {
return result;
}
}
}
#else
template <typename... Args, typename S,
FMT_ENABLE_IF(is_compile_string<S>::value)>
constexpr auto compile(S format_str) -> detail::compiled_format<S, Args...> {
return detail::compiled_format<S, Args...>(to_string_view(format_str));
}
#endif // __cpp_if_constexpr
// Compiles the format string which must be a string literal.
template <typename... Args, typename Char, size_t N>
auto compile(const Char (&format_str)[N])
-> detail::compiled_format<const Char*, Args...> {
return detail::compiled_format<const Char*, Args...>(
basic_string_view<Char>(format_str, N - 1));
}
} // namespace detail
// DEPRECATED! use FMT_COMPILE instead.
template <typename... Args>
FMT_DEPRECATED auto compile(const Args&... args)
-> decltype(detail::compile(args...)) {
return detail::compile(args...);
}
#if FMT_USE_CONSTEXPR
# ifdef __cpp_if_constexpr
template <typename CompiledFormat, typename... Args,
typename Char = typename CompiledFormat::char_type,
FMT_ENABLE_IF(detail::is_compiled_format<CompiledFormat>::value)>
FMT_INLINE std::basic_string<Char> format(const CompiledFormat& cf,
const Args&... args) {
basic_memory_buffer<Char> buffer;
detail::buffer<Char>& base = buffer;
cf.format(std::back_inserter(base), args...);
return to_string(buffer);
}
template <typename OutputIt, typename CompiledFormat, typename... Args,
FMT_ENABLE_IF(detail::is_compiled_format<CompiledFormat>::value)>
OutputIt format_to(OutputIt out, const CompiledFormat& cf,
const Args&... args) {
return cf.format(out, args...);
}
# endif // __cpp_if_constexpr
#endif // FMT_USE_CONSTEXPR
template <typename CompiledFormat, typename... Args,
typename Char = typename CompiledFormat::char_type,
FMT_ENABLE_IF(std::is_base_of<detail::basic_compiled_format,
CompiledFormat>::value)>
std::basic_string<Char> format(const CompiledFormat& cf, const Args&... args) {
basic_memory_buffer<Char> buffer;
using context = buffer_context<Char>;
detail::buffer<Char>& base = buffer;
detail::cf::vformat_to<context>(std::back_inserter(base), cf,
make_format_args<context>(args...));
return to_string(buffer);
}
template <typename S, typename... Args,
FMT_ENABLE_IF(detail::is_compiled_string<S>::value)>
FMT_INLINE std::basic_string<typename S::char_type> format(const S&,
Args&&... args) {
constexpr basic_string_view<typename S::char_type> str = S();
if (str.size() == 2 && str[0] == '{' && str[1] == '}')
return fmt::to_string(detail::first(args...));
constexpr auto compiled = detail::compile<Args...>(S());
return format(compiled, std::forward<Args>(args)...);
}
template <typename OutputIt, typename CompiledFormat, typename... Args,
FMT_ENABLE_IF(std::is_base_of<detail::basic_compiled_format,
CompiledFormat>::value)>
OutputIt format_to(OutputIt out, const CompiledFormat& cf,
const Args&... args) {
using char_type = typename CompiledFormat::char_type;
using context = format_context_t<OutputIt, char_type>;
return detail::cf::vformat_to<context>(out, cf,
make_format_args<context>(args...));
}
template <typename OutputIt, typename S, typename... Args,
FMT_ENABLE_IF(detail::is_compiled_string<S>::value)>
OutputIt format_to(OutputIt out, const S&, const Args&... args) {
constexpr auto compiled = detail::compile<Args...>(S());
return format_to(out, compiled, args...);
}
template <
typename OutputIt, typename CompiledFormat, typename... Args,
FMT_ENABLE_IF(detail::is_output_iterator<OutputIt>::value&& std::is_base_of<
detail::basic_compiled_format, CompiledFormat>::value)>
format_to_n_result<OutputIt> format_to_n(OutputIt out, size_t n,
const CompiledFormat& cf,
const Args&... args) {
auto it =
format_to(detail::truncating_iterator<OutputIt>(out, n), cf, args...);
return {it.base(), it.count()};
}
template <typename CompiledFormat, typename... Args>
size_t formatted_size(const CompiledFormat& cf, const Args&... args) {
return format_to(detail::counting_iterator(), cf, args...).count();
}
FMT_END_NAMESPACE
#endif // FMT_COMPILE_H_

1882
external/fmtlib/include/fmt/core.h vendored Normal file

File diff suppressed because it is too large Load Diff

1453
external/fmtlib/include/fmt/format-inl.h vendored Normal file

File diff suppressed because it is too large Load Diff

3729
external/fmtlib/include/fmt/format.h vendored Normal file

File diff suppressed because it is too large Load Diff

78
external/fmtlib/include/fmt/locale.h vendored Normal file
View File

@@ -0,0 +1,78 @@
// Formatting library for C++ - std::locale support
//
// Copyright (c) 2012 - present, Victor Zverovich
// All rights reserved.
//
// For the license information refer to format.h.
#ifndef FMT_LOCALE_H_
#define FMT_LOCALE_H_
#include <locale>
#include "format.h"
FMT_BEGIN_NAMESPACE
namespace detail {
template <typename Char>
typename buffer_context<Char>::iterator vformat_to(
const std::locale& loc, buffer<Char>& buf,
basic_string_view<Char> format_str,
basic_format_args<buffer_context<type_identity_t<Char>>> args) {
using af = arg_formatter<typename buffer_context<Char>::iterator, Char>;
return vformat_to<af>(std::back_inserter(buf), to_string_view(format_str),
args, detail::locale_ref(loc));
}
template <typename Char>
std::basic_string<Char> vformat(
const std::locale& loc, basic_string_view<Char> format_str,
basic_format_args<buffer_context<type_identity_t<Char>>> args) {
basic_memory_buffer<Char> buffer;
detail::vformat_to(loc, buffer, format_str, args);
return fmt::to_string(buffer);
}
} // namespace detail
template <typename S, typename Char = char_t<S>>
inline std::basic_string<Char> vformat(
const std::locale& loc, const S& format_str,
basic_format_args<buffer_context<type_identity_t<Char>>> args) {
return detail::vformat(loc, to_string_view(format_str), args);
}
template <typename S, typename... Args, typename Char = char_t<S>>
inline std::basic_string<Char> format(const std::locale& loc,
const S& format_str, Args&&... args) {
return detail::vformat(
loc, to_string_view(format_str),
detail::make_args_checked<Args...>(format_str, args...));
}
template <typename S, typename OutputIt, typename... Args,
typename Char = enable_if_t<
detail::is_output_iterator<OutputIt>::value, char_t<S>>>
inline OutputIt vformat_to(
OutputIt out, const std::locale& loc, const S& format_str,
format_args_t<type_identity_t<OutputIt>, Char> args) {
using af = detail::arg_formatter<OutputIt, Char>;
return vformat_to<af>(out, to_string_view(format_str), args,
detail::locale_ref(loc));
}
template <typename OutputIt, typename S, typename... Args,
FMT_ENABLE_IF(detail::is_output_iterator<OutputIt>::value&&
detail::is_string<S>::value)>
inline OutputIt format_to(OutputIt out, const std::locale& loc,
const S& format_str, Args&&... args) {
detail::check_format_string<Args...>(format_str);
using context = format_context_t<OutputIt, char_t<S>>;
format_arg_store<context, Args...> as{args...};
return vformat_to(out, loc, to_string_view(format_str),
basic_format_args<context>(as));
}
FMT_END_NAMESPACE
#endif // FMT_LOCALE_H_

450
external/fmtlib/include/fmt/os.h vendored Normal file
View File

@@ -0,0 +1,450 @@
// Formatting library for C++ - optional OS-specific functionality
//
// Copyright (c) 2012 - present, Victor Zverovich
// All rights reserved.
//
// For the license information refer to format.h.
#ifndef FMT_OS_H_
#define FMT_OS_H_
#if defined(__MINGW32__) || defined(__CYGWIN__)
// Workaround MinGW bug https://sourceforge.net/p/mingw/bugs/2024/.
# undef __STRICT_ANSI__
#endif
#include <cerrno>
#include <clocale> // for locale_t
#include <cstddef>
#include <cstdio>
#include <cstdlib> // for strtod_l
#if defined __APPLE__ || defined(__FreeBSD__)
# include <xlocale.h> // for LC_NUMERIC_MASK on OS X
#endif
#include "format.h"
// UWP doesn't provide _pipe.
#if FMT_HAS_INCLUDE("winapifamily.h")
# include <winapifamily.h>
#endif
#if FMT_HAS_INCLUDE("fcntl.h") && \
(!defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP))
# include <fcntl.h> // for O_RDONLY
# define FMT_USE_FCNTL 1
#else
# define FMT_USE_FCNTL 0
#endif
#ifndef FMT_POSIX
# if defined(_WIN32) && !defined(__MINGW32__)
// Fix warnings about deprecated symbols.
# define FMT_POSIX(call) _##call
# else
# define FMT_POSIX(call) call
# endif
#endif
// Calls to system functions are wrapped in FMT_SYSTEM for testability.
#ifdef FMT_SYSTEM
# define FMT_POSIX_CALL(call) FMT_SYSTEM(call)
#else
# define FMT_SYSTEM(call) ::call
# ifdef _WIN32
// Fix warnings about deprecated symbols.
# define FMT_POSIX_CALL(call) ::_##call
# else
# define FMT_POSIX_CALL(call) ::call
# endif
#endif
// Retries the expression while it evaluates to error_result and errno
// equals to EINTR.
#ifndef _WIN32
# define FMT_RETRY_VAL(result, expression, error_result) \
do { \
(result) = (expression); \
} while ((result) == (error_result) && errno == EINTR)
#else
# define FMT_RETRY_VAL(result, expression, error_result) result = (expression)
#endif
#define FMT_RETRY(result, expression) FMT_RETRY_VAL(result, expression, -1)
FMT_BEGIN_NAMESPACE
/**
\rst
A reference to a null-terminated string. It can be constructed from a C
string or ``std::string``.
You can use one of the following type aliases for common character types:
+---------------+-----------------------------+
| Type | Definition |
+===============+=============================+
| cstring_view | basic_cstring_view<char> |
+---------------+-----------------------------+
| wcstring_view | basic_cstring_view<wchar_t> |
+---------------+-----------------------------+
This class is most useful as a parameter type to allow passing
different types of strings to a function, for example::
template <typename... Args>
std::string format(cstring_view format_str, const Args & ... args);
format("{}", 42);
format(std::string("{}"), 42);
\endrst
*/
template <typename Char> class basic_cstring_view {
private:
const Char* data_;
public:
/** Constructs a string reference object from a C string. */
basic_cstring_view(const Char* s) : data_(s) {}
/**
\rst
Constructs a string reference from an ``std::string`` object.
\endrst
*/
basic_cstring_view(const std::basic_string<Char>& s) : data_(s.c_str()) {}
/** Returns the pointer to a C string. */
const Char* c_str() const { return data_; }
};
using cstring_view = basic_cstring_view<char>;
using wcstring_view = basic_cstring_view<wchar_t>;
// An error code.
class error_code {
private:
int value_;
public:
explicit error_code(int value = 0) FMT_NOEXCEPT : value_(value) {}
int get() const FMT_NOEXCEPT { return value_; }
};
#ifdef _WIN32
namespace detail {
// A converter from UTF-16 to UTF-8.
// It is only provided for Windows since other systems support UTF-8 natively.
class utf16_to_utf8 {
private:
memory_buffer buffer_;
public:
utf16_to_utf8() {}
FMT_API explicit utf16_to_utf8(wstring_view s);
operator string_view() const { return string_view(&buffer_[0], size()); }
size_t size() const { return buffer_.size() - 1; }
const char* c_str() const { return &buffer_[0]; }
std::string str() const { return std::string(&buffer_[0], size()); }
// Performs conversion returning a system error code instead of
// throwing exception on conversion error. This method may still throw
// in case of memory allocation error.
FMT_API int convert(wstring_view s);
};
FMT_API void format_windows_error(buffer<char>& out, int error_code,
string_view message) FMT_NOEXCEPT;
} // namespace detail
/** A Windows error. */
class windows_error : public system_error {
private:
FMT_API void init(int error_code, string_view format_str, format_args args);
public:
/**
\rst
Constructs a :class:`fmt::windows_error` object with the description
of the form
.. parsed-literal::
*<message>*: *<system-message>*
where *<message>* is the formatted message and *<system-message>* is the
system message corresponding to the error code.
*error_code* is a Windows error code as given by ``GetLastError``.
If *error_code* is not a valid error code such as -1, the system message
will look like "error -1".
**Example**::
// This throws a windows_error with the description
// cannot open file 'madeup': The system cannot find the file specified.
// or similar (system message may vary).
const char *filename = "madeup";
LPOFSTRUCT of = LPOFSTRUCT();
HFILE file = OpenFile(filename, &of, OF_READ);
if (file == HFILE_ERROR) {
throw fmt::windows_error(GetLastError(),
"cannot open file '{}'", filename);
}
\endrst
*/
template <typename... Args>
windows_error(int error_code, string_view message, const Args&... args) {
init(error_code, message, make_format_args(args...));
}
};
// Reports a Windows error without throwing an exception.
// Can be used to report errors from destructors.
FMT_API void report_windows_error(int error_code,
string_view message) FMT_NOEXCEPT;
#endif // _WIN32
// A buffered file.
class buffered_file {
private:
FILE* file_;
friend class file;
explicit buffered_file(FILE* f) : file_(f) {}
public:
buffered_file(const buffered_file&) = delete;
void operator=(const buffered_file&) = delete;
// Constructs a buffered_file object which doesn't represent any file.
buffered_file() FMT_NOEXCEPT : file_(nullptr) {}
// Destroys the object closing the file it represents if any.
FMT_API ~buffered_file() FMT_NOEXCEPT;
public:
buffered_file(buffered_file&& other) FMT_NOEXCEPT : file_(other.file_) {
other.file_ = nullptr;
}
buffered_file& operator=(buffered_file&& other) {
close();
file_ = other.file_;
other.file_ = nullptr;
return *this;
}
// Opens a file.
FMT_API buffered_file(cstring_view filename, cstring_view mode);
// Closes the file.
FMT_API void close();
// Returns the pointer to a FILE object representing this file.
FILE* get() const FMT_NOEXCEPT { return file_; }
// We place parentheses around fileno to workaround a bug in some versions
// of MinGW that define fileno as a macro.
FMT_API int(fileno)() const;
void vprint(string_view format_str, format_args args) {
fmt::vprint(file_, format_str, args);
}
template <typename... Args>
inline void print(string_view format_str, const Args&... args) {
vprint(format_str, make_format_args(args...));
}
};
#if FMT_USE_FCNTL
// A file. Closed file is represented by a file object with descriptor -1.
// Methods that are not declared with FMT_NOEXCEPT may throw
// fmt::system_error in case of failure. Note that some errors such as
// closing the file multiple times will cause a crash on Windows rather
// than an exception. You can get standard behavior by overriding the
// invalid parameter handler with _set_invalid_parameter_handler.
class file {
private:
int fd_; // File descriptor.
// Constructs a file object with a given descriptor.
explicit file(int fd) : fd_(fd) {}
public:
// Possible values for the oflag argument to the constructor.
enum {
RDONLY = FMT_POSIX(O_RDONLY), // Open for reading only.
WRONLY = FMT_POSIX(O_WRONLY), // Open for writing only.
RDWR = FMT_POSIX(O_RDWR), // Open for reading and writing.
CREATE = FMT_POSIX(O_CREAT) // Create if the file doesn't exist.
};
// Constructs a file object which doesn't represent any file.
file() FMT_NOEXCEPT : fd_(-1) {}
// Opens a file and constructs a file object representing this file.
FMT_API file(cstring_view path, int oflag);
public:
file(const file&) = delete;
void operator=(const file&) = delete;
file(file&& other) FMT_NOEXCEPT : fd_(other.fd_) { other.fd_ = -1; }
file& operator=(file&& other) FMT_NOEXCEPT {
close();
fd_ = other.fd_;
other.fd_ = -1;
return *this;
}
// Destroys the object closing the file it represents if any.
FMT_API ~file() FMT_NOEXCEPT;
// Returns the file descriptor.
int descriptor() const FMT_NOEXCEPT { return fd_; }
// Closes the file.
FMT_API void close();
// Returns the file size. The size has signed type for consistency with
// stat::st_size.
FMT_API long long size() const;
// Attempts to read count bytes from the file into the specified buffer.
FMT_API size_t read(void* buffer, size_t count);
// Attempts to write count bytes from the specified buffer to the file.
FMT_API size_t write(const void* buffer, size_t count);
// Duplicates a file descriptor with the dup function and returns
// the duplicate as a file object.
FMT_API static file dup(int fd);
// Makes fd be the copy of this file descriptor, closing fd first if
// necessary.
FMT_API void dup2(int fd);
// Makes fd be the copy of this file descriptor, closing fd first if
// necessary.
FMT_API void dup2(int fd, error_code& ec) FMT_NOEXCEPT;
// Creates a pipe setting up read_end and write_end file objects for reading
// and writing respectively.
FMT_API static void pipe(file& read_end, file& write_end);
// Creates a buffered_file object associated with this file and detaches
// this file object from the file.
FMT_API buffered_file fdopen(const char* mode);
};
// Returns the memory page size.
long getpagesize();
class direct_buffered_file;
template <typename S, typename... Args>
void print(direct_buffered_file& f, const S& format_str,
const Args&... args);
// A buffered file with a direct buffer access and no synchronization.
class direct_buffered_file {
private:
file file_;
enum { buffer_size = 4096 };
char buffer_[buffer_size];
int pos_;
void flush() {
if (pos_ == 0) return;
file_.write(buffer_, pos_);
pos_ = 0;
}
int free_capacity() const { return buffer_size - pos_; }
public:
direct_buffered_file(cstring_view path, int oflag)
: file_(path, oflag), pos_(0) {}
~direct_buffered_file() {
flush();
}
void close() {
flush();
file_.close();
}
template <typename S, typename... Args>
friend void print(direct_buffered_file& f, const S& format_str,
const Args&... args) {
// We could avoid double buffering.
auto buf = fmt::memory_buffer();
fmt::format_to(std::back_inserter(buf), format_str, args...);
auto remaining_pos = 0;
auto remaining_size = buf.size();
while (remaining_size > detail::to_unsigned(f.free_capacity())) {
auto size = f.free_capacity();
memcpy(f.buffer_ + f.pos_, buf.data() + remaining_pos, size);
f.pos_ += size;
f.flush();
remaining_pos += size;
remaining_size -= size;
}
memcpy(f.buffer_ + f.pos_, buf.data() + remaining_pos, remaining_size);
f.pos_ += static_cast<int>(remaining_size);
}
};
#endif // FMT_USE_FCNTL
#ifdef FMT_LOCALE
// A "C" numeric locale.
class locale {
private:
# ifdef _WIN32
using locale_t = _locale_t;
static void freelocale(locale_t loc) { _free_locale(loc); }
static double strtod_l(const char* nptr, char** endptr, _locale_t loc) {
return _strtod_l(nptr, endptr, loc);
}
# endif
locale_t locale_;
public:
using type = locale_t;
locale(const locale&) = delete;
void operator=(const locale&) = delete;
locale() {
# ifndef _WIN32
locale_ = FMT_SYSTEM(newlocale(LC_NUMERIC_MASK, "C", nullptr));
# else
locale_ = _create_locale(LC_NUMERIC, "C");
# endif
if (!locale_) FMT_THROW(system_error(errno, "cannot create locale"));
}
~locale() { freelocale(locale_); }
type get() const { return locale_; }
// Converts string to floating-point number and advances str past the end
// of the parsed input.
double strtod(const char*& str) const {
char* end = nullptr;
double result = strtod_l(str, &end, locale_);
str = end;
return result;
}
};
using Locale FMT_DEPRECATED_ALIAS = locale;
#endif // FMT_LOCALE
FMT_END_NAMESPACE
#endif // FMT_OS_H_

167
external/fmtlib/include/fmt/ostream.h vendored Normal file
View File

@@ -0,0 +1,167 @@
// Formatting library for C++ - std::ostream support
//
// Copyright (c) 2012 - present, Victor Zverovich
// All rights reserved.
//
// For the license information refer to format.h.
#ifndef FMT_OSTREAM_H_
#define FMT_OSTREAM_H_
#include <ostream>
#include "format.h"
FMT_BEGIN_NAMESPACE
template <typename Char> class basic_printf_parse_context;
template <typename OutputIt, typename Char> class basic_printf_context;
namespace detail {
template <class Char> class formatbuf : public std::basic_streambuf<Char> {
private:
using int_type = typename std::basic_streambuf<Char>::int_type;
using traits_type = typename std::basic_streambuf<Char>::traits_type;
buffer<Char>& buffer_;
public:
formatbuf(buffer<Char>& buf) : buffer_(buf) {}
protected:
// The put-area is actually always empty. This makes the implementation
// simpler and has the advantage that the streambuf and the buffer are always
// in sync and sputc never writes into uninitialized memory. The obvious
// disadvantage is that each call to sputc always results in a (virtual) call
// to overflow. There is no disadvantage here for sputn since this always
// results in a call to xsputn.
int_type overflow(int_type ch = traits_type::eof()) FMT_OVERRIDE {
if (!traits_type::eq_int_type(ch, traits_type::eof()))
buffer_.push_back(static_cast<Char>(ch));
return ch;
}
std::streamsize xsputn(const Char* s, std::streamsize count) FMT_OVERRIDE {
buffer_.append(s, s + count);
return count;
}
};
template <typename Char> struct test_stream : std::basic_ostream<Char> {
private:
// Hide all operator<< from std::basic_ostream<Char>.
void_t<> operator<<(null<>);
void_t<> operator<<(const Char*);
template <typename T, FMT_ENABLE_IF(std::is_convertible<T, int>::value &&
!std::is_enum<T>::value)>
void_t<> operator<<(T);
};
// Checks if T has a user-defined operator<< (e.g. not a member of
// std::ostream).
template <typename T, typename Char> class is_streamable {
private:
template <typename U>
static bool_constant<!std::is_same<decltype(std::declval<test_stream<Char>&>()
<< std::declval<U>()),
void_t<>>::value>
test(int);
template <typename> static std::false_type test(...);
using result = decltype(test<T>(0));
public:
static const bool value = result::value;
};
// Write the content of buf to os.
template <typename Char>
void write_buffer(std::basic_ostream<Char>& os, buffer<Char>& buf) {
const Char* buf_data = buf.data();
using unsigned_streamsize = std::make_unsigned<std::streamsize>::type;
unsigned_streamsize size = buf.size();
unsigned_streamsize max_size = to_unsigned(max_value<std::streamsize>());
do {
unsigned_streamsize n = size <= max_size ? size : max_size;
os.write(buf_data, static_cast<std::streamsize>(n));
buf_data += n;
size -= n;
} while (size != 0);
}
template <typename Char, typename T>
void format_value(buffer<Char>& buf, const T& value,
locale_ref loc = locale_ref()) {
formatbuf<Char> format_buf(buf);
std::basic_ostream<Char> output(&format_buf);
#if !defined(FMT_STATIC_THOUSANDS_SEPARATOR)
if (loc) output.imbue(loc.get<std::locale>());
#endif
output << value;
output.exceptions(std::ios_base::failbit | std::ios_base::badbit);
buf.resize(buf.size());
}
// Formats an object of type T that has an overloaded ostream operator<<.
template <typename T, typename Char>
struct fallback_formatter<T, Char, enable_if_t<is_streamable<T, Char>::value>>
: private formatter<basic_string_view<Char>, Char> {
FMT_CONSTEXPR auto parse(basic_format_parse_context<Char>& ctx)
-> decltype(ctx.begin()) {
return formatter<basic_string_view<Char>, Char>::parse(ctx);
}
template <typename ParseCtx,
FMT_ENABLE_IF(std::is_same<
ParseCtx, basic_printf_parse_context<Char>>::value)>
auto parse(ParseCtx& ctx) -> decltype(ctx.begin()) {
return ctx.begin();
}
template <typename OutputIt>
auto format(const T& value, basic_format_context<OutputIt, Char>& ctx)
-> OutputIt {
basic_memory_buffer<Char> buffer;
format_value(buffer, value, ctx.locale());
basic_string_view<Char> str(buffer.data(), buffer.size());
return formatter<basic_string_view<Char>, Char>::format(str, ctx);
}
template <typename OutputIt>
auto format(const T& value, basic_printf_context<OutputIt, Char>& ctx)
-> OutputIt {
basic_memory_buffer<Char> buffer;
format_value(buffer, value, ctx.locale());
return std::copy(buffer.begin(), buffer.end(), ctx.out());
}
};
} // namespace detail
template <typename Char>
void vprint(std::basic_ostream<Char>& os, basic_string_view<Char> format_str,
basic_format_args<buffer_context<type_identity_t<Char>>> args) {
basic_memory_buffer<Char> buffer;
detail::vformat_to(buffer, format_str, args);
detail::write_buffer(os, buffer);
}
/**
\rst
Prints formatted data to the stream *os*.
**Example**::
fmt::print(cerr, "Don't {}!", "panic");
\endrst
*/
template <typename S, typename... Args,
typename Char = enable_if_t<detail::is_string<S>::value, char_t<S>>>
void print(std::basic_ostream<Char>& os, const S& format_str, Args&&... args) {
vprint(os, to_string_view(format_str),
detail::make_args_checked<Args...>(format_str, args...));
}
FMT_END_NAMESPACE
#endif // FMT_OSTREAM_H_

2
external/fmtlib/include/fmt/posix.h vendored Normal file
View File

@@ -0,0 +1,2 @@
#include "os.h"
#warning "fmt/posix.h is deprecated; use fmt/os.h instead"

751
external/fmtlib/include/fmt/printf.h vendored Normal file
View File

@@ -0,0 +1,751 @@
// Formatting library for C++ - legacy printf implementation
//
// Copyright (c) 2012 - 2016, Victor Zverovich
// All rights reserved.
//
// For the license information refer to format.h.
#ifndef FMT_PRINTF_H_
#define FMT_PRINTF_H_
#include <algorithm> // std::max
#include <limits> // std::numeric_limits
#include "ostream.h"
FMT_BEGIN_NAMESPACE
namespace detail {
// Checks if a value fits in int - used to avoid warnings about comparing
// signed and unsigned integers.
template <bool IsSigned> struct int_checker {
template <typename T> static bool fits_in_int(T value) {
unsigned max = max_value<int>();
return value <= max;
}
static bool fits_in_int(bool) { return true; }
};
template <> struct int_checker<true> {
template <typename T> static bool fits_in_int(T value) {
return value >= (std::numeric_limits<int>::min)() &&
value <= max_value<int>();
}
static bool fits_in_int(int) { return true; }
};
class printf_precision_handler {
public:
template <typename T, FMT_ENABLE_IF(std::is_integral<T>::value)>
int operator()(T value) {
if (!int_checker<std::numeric_limits<T>::is_signed>::fits_in_int(value))
FMT_THROW(format_error("number is too big"));
return (std::max)(static_cast<int>(value), 0);
}
template <typename T, FMT_ENABLE_IF(!std::is_integral<T>::value)>
int operator()(T) {
FMT_THROW(format_error("precision is not integer"));
return 0;
}
};
// An argument visitor that returns true iff arg is a zero integer.
class is_zero_int {
public:
template <typename T, FMT_ENABLE_IF(std::is_integral<T>::value)>
bool operator()(T value) {
return value == 0;
}
template <typename T, FMT_ENABLE_IF(!std::is_integral<T>::value)>
bool operator()(T) {
return false;
}
};
template <typename T> struct make_unsigned_or_bool : std::make_unsigned<T> {};
template <> struct make_unsigned_or_bool<bool> { using type = bool; };
template <typename T, typename Context> class arg_converter {
private:
using char_type = typename Context::char_type;
basic_format_arg<Context>& arg_;
char_type type_;
public:
arg_converter(basic_format_arg<Context>& arg, char_type type)
: arg_(arg), type_(type) {}
void operator()(bool value) {
if (type_ != 's') operator()<bool>(value);
}
template <typename U, FMT_ENABLE_IF(std::is_integral<U>::value)>
void operator()(U value) {
bool is_signed = type_ == 'd' || type_ == 'i';
using target_type = conditional_t<std::is_same<T, void>::value, U, T>;
if (const_check(sizeof(target_type) <= sizeof(int))) {
// Extra casts are used to silence warnings.
if (is_signed) {
arg_ = detail::make_arg<Context>(
static_cast<int>(static_cast<target_type>(value)));
} else {
using unsigned_type = typename make_unsigned_or_bool<target_type>::type;
arg_ = detail::make_arg<Context>(
static_cast<unsigned>(static_cast<unsigned_type>(value)));
}
} else {
if (is_signed) {
// glibc's printf doesn't sign extend arguments of smaller types:
// std::printf("%lld", -42); // prints "4294967254"
// but we don't have to do the same because it's a UB.
arg_ = detail::make_arg<Context>(static_cast<long long>(value));
} else {
arg_ = detail::make_arg<Context>(
static_cast<typename make_unsigned_or_bool<U>::type>(value));
}
}
}
template <typename U, FMT_ENABLE_IF(!std::is_integral<U>::value)>
void operator()(U) {} // No conversion needed for non-integral types.
};
// Converts an integer argument to T for printf, if T is an integral type.
// If T is void, the argument is converted to corresponding signed or unsigned
// type depending on the type specifier: 'd' and 'i' - signed, other -
// unsigned).
template <typename T, typename Context, typename Char>
void convert_arg(basic_format_arg<Context>& arg, Char type) {
visit_format_arg(arg_converter<T, Context>(arg, type), arg);
}
// Converts an integer argument to char for printf.
template <typename Context> class char_converter {
private:
basic_format_arg<Context>& arg_;
public:
explicit char_converter(basic_format_arg<Context>& arg) : arg_(arg) {}
template <typename T, FMT_ENABLE_IF(std::is_integral<T>::value)>
void operator()(T value) {
arg_ = detail::make_arg<Context>(
static_cast<typename Context::char_type>(value));
}
template <typename T, FMT_ENABLE_IF(!std::is_integral<T>::value)>
void operator()(T) {} // No conversion needed for non-integral types.
};
// An argument visitor that return a pointer to a C string if argument is a
// string or null otherwise.
template <typename Char> struct get_cstring {
template <typename T> const Char* operator()(T) { return nullptr; }
const Char* operator()(const Char* s) { return s; }
};
// Checks if an argument is a valid printf width specifier and sets
// left alignment if it is negative.
template <typename Char> class printf_width_handler {
private:
using format_specs = basic_format_specs<Char>;
format_specs& specs_;
public:
explicit printf_width_handler(format_specs& specs) : specs_(specs) {}
template <typename T, FMT_ENABLE_IF(std::is_integral<T>::value)>
unsigned operator()(T value) {
auto width = static_cast<uint32_or_64_or_128_t<T>>(value);
if (detail::is_negative(value)) {
specs_.align = align::left;
width = 0 - width;
}
unsigned int_max = max_value<int>();
if (width > int_max) FMT_THROW(format_error("number is too big"));
return static_cast<unsigned>(width);
}
template <typename T, FMT_ENABLE_IF(!std::is_integral<T>::value)>
unsigned operator()(T) {
FMT_THROW(format_error("width is not integer"));
return 0;
}
};
template <typename Char, typename Context>
void vprintf(buffer<Char>& buf, basic_string_view<Char> format,
basic_format_args<Context> args) {
Context(std::back_inserter(buf), format, args).format();
}
} // namespace detail
// For printing into memory_buffer.
template <typename Char, typename Context>
FMT_DEPRECATED void printf(detail::buffer<Char>& buf,
basic_string_view<Char> format,
basic_format_args<Context> args) {
return detail::vprintf(buf, format, args);
}
using detail::vprintf;
template <typename Char>
class basic_printf_parse_context : public basic_format_parse_context<Char> {
using basic_format_parse_context<Char>::basic_format_parse_context;
};
template <typename OutputIt, typename Char> class basic_printf_context;
/**
\rst
The ``printf`` argument formatter.
\endrst
*/
template <typename OutputIt, typename Char>
class printf_arg_formatter : public detail::arg_formatter_base<OutputIt, Char> {
public:
using iterator = OutputIt;
private:
using char_type = Char;
using base = detail::arg_formatter_base<OutputIt, Char>;
using context_type = basic_printf_context<OutputIt, Char>;
context_type& context_;
void write_null_pointer(char) {
this->specs()->type = 0;
this->write("(nil)");
}
void write_null_pointer(wchar_t) {
this->specs()->type = 0;
this->write(L"(nil)");
}
public:
using format_specs = typename base::format_specs;
/**
\rst
Constructs an argument formatter object.
*buffer* is a reference to the output buffer and *specs* contains format
specifier information for standard argument types.
\endrst
*/
printf_arg_formatter(iterator iter, format_specs& specs, context_type& ctx)
: base(iter, &specs, detail::locale_ref()), context_(ctx) {}
template <typename T, FMT_ENABLE_IF(fmt::detail::is_integral<T>::value)>
iterator operator()(T value) {
// MSVC2013 fails to compile separate overloads for bool and char_type so
// use std::is_same instead.
if (std::is_same<T, bool>::value) {
format_specs& fmt_specs = *this->specs();
if (fmt_specs.type != 's') return base::operator()(value ? 1 : 0);
fmt_specs.type = 0;
this->write(value != 0);
} else if (std::is_same<T, char_type>::value) {
format_specs& fmt_specs = *this->specs();
if (fmt_specs.type && fmt_specs.type != 'c')
return (*this)(static_cast<int>(value));
fmt_specs.sign = sign::none;
fmt_specs.alt = false;
fmt_specs.fill[0] = ' '; // Ignore '0' flag for char types.
// align::numeric needs to be overwritten here since the '0' flag is
// ignored for non-numeric types
if (fmt_specs.align == align::none || fmt_specs.align == align::numeric)
fmt_specs.align = align::right;
return base::operator()(value);
} else {
return base::operator()(value);
}
return this->out();
}
template <typename T, FMT_ENABLE_IF(std::is_floating_point<T>::value)>
iterator operator()(T value) {
return base::operator()(value);
}
/** Formats a null-terminated C string. */
iterator operator()(const char* value) {
if (value)
base::operator()(value);
else if (this->specs()->type == 'p')
write_null_pointer(char_type());
else
this->write("(null)");
return this->out();
}
/** Formats a null-terminated wide C string. */
iterator operator()(const wchar_t* value) {
if (value)
base::operator()(value);
else if (this->specs()->type == 'p')
write_null_pointer(char_type());
else
this->write(L"(null)");
return this->out();
}
iterator operator()(basic_string_view<char_type> value) {
return base::operator()(value);
}
iterator operator()(monostate value) { return base::operator()(value); }
/** Formats a pointer. */
iterator operator()(const void* value) {
if (value) return base::operator()(value);
this->specs()->type = 0;
write_null_pointer(char_type());
return this->out();
}
/** Formats an argument of a custom (user-defined) type. */
iterator operator()(typename basic_format_arg<context_type>::handle handle) {
handle.format(context_.parse_context(), context_);
return this->out();
}
};
template <typename T> struct printf_formatter {
printf_formatter() = delete;
template <typename ParseContext>
auto parse(ParseContext& ctx) -> decltype(ctx.begin()) {
return ctx.begin();
}
template <typename FormatContext>
auto format(const T& value, FormatContext& ctx) -> decltype(ctx.out()) {
detail::format_value(detail::get_container(ctx.out()), value);
return ctx.out();
}
};
/**
This template formats data and writes the output through an output iterator.
*/
template <typename OutputIt, typename Char> class basic_printf_context {
public:
/** The character type for the output. */
using char_type = Char;
using iterator = OutputIt;
using format_arg = basic_format_arg<basic_printf_context>;
using parse_context_type = basic_printf_parse_context<Char>;
template <typename T> using formatter_type = printf_formatter<T>;
private:
using format_specs = basic_format_specs<char_type>;
OutputIt out_;
basic_format_args<basic_printf_context> args_;
parse_context_type parse_ctx_;
static void parse_flags(format_specs& specs, const Char*& it,
const Char* end);
// Returns the argument with specified index or, if arg_index is -1, the next
// argument.
format_arg get_arg(int arg_index = -1);
// Parses argument index, flags and width and returns the argument index.
int parse_header(const Char*& it, const Char* end, format_specs& specs);
public:
/**
\rst
Constructs a ``printf_context`` object. References to the arguments are
stored in the context object so make sure they have appropriate lifetimes.
\endrst
*/
basic_printf_context(OutputIt out, basic_string_view<char_type> format_str,
basic_format_args<basic_printf_context> args)
: out_(out), args_(args), parse_ctx_(format_str) {}
OutputIt out() { return out_; }
void advance_to(OutputIt it) { out_ = it; }
detail::locale_ref locale() { return {}; }
format_arg arg(int id) const { return args_.get(id); }
parse_context_type& parse_context() { return parse_ctx_; }
FMT_CONSTEXPR void on_error(const char* message) {
parse_ctx_.on_error(message);
}
/** Formats stored arguments and writes the output to the range. */
template <typename ArgFormatter = printf_arg_formatter<OutputIt, Char>>
OutputIt format();
};
template <typename OutputIt, typename Char>
void basic_printf_context<OutputIt, Char>::parse_flags(format_specs& specs,
const Char*& it,
const Char* end) {
for (; it != end; ++it) {
switch (*it) {
case '-':
specs.align = align::left;
break;
case '+':
specs.sign = sign::plus;
break;
case '0':
specs.fill[0] = '0';
break;
case ' ':
if (specs.sign != sign::plus) {
specs.sign = sign::space;
}
break;
case '#':
specs.alt = true;
break;
default:
return;
}
}
}
template <typename OutputIt, typename Char>
typename basic_printf_context<OutputIt, Char>::format_arg
basic_printf_context<OutputIt, Char>::get_arg(int arg_index) {
if (arg_index < 0)
arg_index = parse_ctx_.next_arg_id();
else
parse_ctx_.check_arg_id(--arg_index);
return detail::get_arg(*this, arg_index);
}
template <typename OutputIt, typename Char>
int basic_printf_context<OutputIt, Char>::parse_header(const Char*& it,
const Char* end,
format_specs& specs) {
int arg_index = -1;
char_type c = *it;
if (c >= '0' && c <= '9') {
// Parse an argument index (if followed by '$') or a width possibly
// preceded with '0' flag(s).
detail::error_handler eh;
int value = parse_nonnegative_int(it, end, eh);
if (it != end && *it == '$') { // value is an argument index
++it;
arg_index = value;
} else {
if (c == '0') specs.fill[0] = '0';
if (value != 0) {
// Nonzero value means that we parsed width and don't need to
// parse it or flags again, so return now.
specs.width = value;
return arg_index;
}
}
}
parse_flags(specs, it, end);
// Parse width.
if (it != end) {
if (*it >= '0' && *it <= '9') {
detail::error_handler eh;
specs.width = parse_nonnegative_int(it, end, eh);
} else if (*it == '*') {
++it;
specs.width = static_cast<int>(visit_format_arg(
detail::printf_width_handler<char_type>(specs), get_arg()));
}
}
return arg_index;
}
template <typename OutputIt, typename Char>
template <typename ArgFormatter>
OutputIt basic_printf_context<OutputIt, Char>::format() {
auto out = this->out();
const Char* start = parse_ctx_.begin();
const Char* end = parse_ctx_.end();
auto it = start;
while (it != end) {
char_type c = *it++;
if (c != '%') continue;
if (it != end && *it == c) {
out = std::copy(start, it, out);
start = ++it;
continue;
}
out = std::copy(start, it - 1, out);
format_specs specs;
specs.align = align::right;
// Parse argument index, flags and width.
int arg_index = parse_header(it, end, specs);
if (arg_index == 0) on_error("argument not found");
// Parse precision.
if (it != end && *it == '.') {
++it;
c = it != end ? *it : 0;
if ('0' <= c && c <= '9') {
detail::error_handler eh;
specs.precision = parse_nonnegative_int(it, end, eh);
} else if (c == '*') {
++it;
specs.precision = static_cast<int>(
visit_format_arg(detail::printf_precision_handler(), get_arg()));
} else {
specs.precision = 0;
}
}
format_arg arg = get_arg(arg_index);
// For d, i, o, u, x, and X conversion specifiers, if a precision is
// specified, the '0' flag is ignored
if (specs.precision >= 0 && arg.is_integral())
specs.fill[0] =
' '; // Ignore '0' flag for non-numeric types or if '-' present.
if (specs.precision >= 0 && arg.type() == detail::type::cstring_type) {
auto str = visit_format_arg(detail::get_cstring<Char>(), arg);
auto str_end = str + specs.precision;
auto nul = std::find(str, str_end, Char());
arg = detail::make_arg<basic_printf_context>(basic_string_view<Char>(
str,
detail::to_unsigned(nul != str_end ? nul - str : specs.precision)));
}
if (specs.alt && visit_format_arg(detail::is_zero_int(), arg))
specs.alt = false;
if (specs.fill[0] == '0') {
if (arg.is_arithmetic() && specs.align != align::left)
specs.align = align::numeric;
else
specs.fill[0] = ' '; // Ignore '0' flag for non-numeric types or if '-'
// flag is also present.
}
// Parse length and convert the argument to the required type.
c = it != end ? *it++ : 0;
char_type t = it != end ? *it : 0;
using detail::convert_arg;
switch (c) {
case 'h':
if (t == 'h') {
++it;
t = it != end ? *it : 0;
convert_arg<signed char>(arg, t);
} else {
convert_arg<short>(arg, t);
}
break;
case 'l':
if (t == 'l') {
++it;
t = it != end ? *it : 0;
convert_arg<long long>(arg, t);
} else {
convert_arg<long>(arg, t);
}
break;
case 'j':
convert_arg<intmax_t>(arg, t);
break;
case 'z':
convert_arg<size_t>(arg, t);
break;
case 't':
convert_arg<std::ptrdiff_t>(arg, t);
break;
case 'L':
// printf produces garbage when 'L' is omitted for long double, no
// need to do the same.
break;
default:
--it;
convert_arg<void>(arg, c);
}
// Parse type.
if (it == end) FMT_THROW(format_error("invalid format string"));
specs.type = static_cast<char>(*it++);
if (arg.is_integral()) {
// Normalize type.
switch (specs.type) {
case 'i':
case 'u':
specs.type = 'd';
break;
case 'c':
visit_format_arg(detail::char_converter<basic_printf_context>(arg),
arg);
break;
}
}
start = it;
// Format argument.
out = visit_format_arg(ArgFormatter(out, specs, *this), arg);
}
return std::copy(start, it, out);
}
template <typename Char>
using basic_printf_context_t =
basic_printf_context<std::back_insert_iterator<detail::buffer<Char>>, Char>;
using printf_context = basic_printf_context_t<char>;
using wprintf_context = basic_printf_context_t<wchar_t>;
using printf_args = basic_format_args<printf_context>;
using wprintf_args = basic_format_args<wprintf_context>;
/**
\rst
Constructs an `~fmt::format_arg_store` object that contains references to
arguments and can be implicitly converted to `~fmt::printf_args`.
\endrst
*/
template <typename... Args>
inline format_arg_store<printf_context, Args...> make_printf_args(
const Args&... args) {
return {args...};
}
/**
\rst
Constructs an `~fmt::format_arg_store` object that contains references to
arguments and can be implicitly converted to `~fmt::wprintf_args`.
\endrst
*/
template <typename... Args>
inline format_arg_store<wprintf_context, Args...> make_wprintf_args(
const Args&... args) {
return {args...};
}
template <typename S, typename Char = char_t<S>>
inline std::basic_string<Char> vsprintf(
const S& format,
basic_format_args<basic_printf_context_t<type_identity_t<Char>>> args) {
basic_memory_buffer<Char> buffer;
vprintf(buffer, to_string_view(format), args);
return to_string(buffer);
}
/**
\rst
Formats arguments and returns the result as a string.
**Example**::
std::string message = fmt::sprintf("The answer is %d", 42);
\endrst
*/
template <typename S, typename... Args,
typename Char = enable_if_t<detail::is_string<S>::value, char_t<S>>>
inline std::basic_string<Char> sprintf(const S& format, const Args&... args) {
using context = basic_printf_context_t<Char>;
return vsprintf(to_string_view(format), make_format_args<context>(args...));
}
template <typename S, typename Char = char_t<S>>
inline int vfprintf(
std::FILE* f, const S& format,
basic_format_args<basic_printf_context_t<type_identity_t<Char>>> args) {
basic_memory_buffer<Char> buffer;
vprintf(buffer, to_string_view(format), args);
size_t size = buffer.size();
return std::fwrite(buffer.data(), sizeof(Char), size, f) < size
? -1
: static_cast<int>(size);
}
/**
\rst
Prints formatted data to the file *f*.
**Example**::
fmt::fprintf(stderr, "Don't %s!", "panic");
\endrst
*/
template <typename S, typename... Args,
typename Char = enable_if_t<detail::is_string<S>::value, char_t<S>>>
inline int fprintf(std::FILE* f, const S& format, const Args&... args) {
using context = basic_printf_context_t<Char>;
return vfprintf(f, to_string_view(format),
make_format_args<context>(args...));
}
template <typename S, typename Char = char_t<S>>
inline int vprintf(
const S& format,
basic_format_args<basic_printf_context_t<type_identity_t<Char>>> args) {
return vfprintf(stdout, to_string_view(format), args);
}
/**
\rst
Prints formatted data to ``stdout``.
**Example**::
fmt::printf("Elapsed time: %.2f seconds", 1.23);
\endrst
*/
template <typename S, typename... Args,
FMT_ENABLE_IF(detail::is_string<S>::value)>
inline int printf(const S& format_str, const Args&... args) {
using context = basic_printf_context_t<char_t<S>>;
return vprintf(to_string_view(format_str),
make_format_args<context>(args...));
}
template <typename S, typename Char = char_t<S>>
inline int vfprintf(
std::basic_ostream<Char>& os, const S& format,
basic_format_args<basic_printf_context_t<type_identity_t<Char>>> args) {
basic_memory_buffer<Char> buffer;
vprintf(buffer, to_string_view(format), args);
detail::write_buffer(os, buffer);
return static_cast<int>(buffer.size());
}
/** Formats arguments and writes the output to the range. */
template <typename ArgFormatter, typename Char,
typename Context =
basic_printf_context<typename ArgFormatter::iterator, Char>>
typename ArgFormatter::iterator vprintf(
detail::buffer<Char>& out, basic_string_view<Char> format_str,
basic_format_args<type_identity_t<Context>> args) {
typename ArgFormatter::iterator iter(out);
Context(iter, format_str, args).template format<ArgFormatter>();
return iter;
}
/**
\rst
Prints formatted data to the stream *os*.
**Example**::
fmt::fprintf(cerr, "Don't %s!", "panic");
\endrst
*/
template <typename S, typename... Args, typename Char = char_t<S>>
inline int fprintf(std::basic_ostream<Char>& os, const S& format_str,
const Args&... args) {
using context = basic_printf_context_t<Char>;
return vfprintf(os, to_string_view(format_str),
make_format_args<context>(args...));
}
FMT_END_NAMESPACE
#endif // FMT_PRINTF_H_

386
external/fmtlib/include/fmt/ranges.h vendored Normal file
View File

@@ -0,0 +1,386 @@
// Formatting library for C++ - experimental range support
//
// Copyright (c) 2012 - present, Victor Zverovich
// All rights reserved.
//
// For the license information refer to format.h.
//
// Copyright (c) 2018 - present, Remotion (Igor Schulz)
// All Rights Reserved
// {fmt} support for ranges, containers and types tuple interface.
#ifndef FMT_RANGES_H_
#define FMT_RANGES_H_
#include <initializer_list>
#include <type_traits>
#include "format.h"
// output only up to N items from the range.
#ifndef FMT_RANGE_OUTPUT_LENGTH_LIMIT
# define FMT_RANGE_OUTPUT_LENGTH_LIMIT 256
#endif
FMT_BEGIN_NAMESPACE
template <typename Char> struct formatting_base {
template <typename ParseContext>
FMT_CONSTEXPR auto parse(ParseContext& ctx) -> decltype(ctx.begin()) {
return ctx.begin();
}
};
template <typename Char, typename Enable = void>
struct formatting_range : formatting_base<Char> {
static FMT_CONSTEXPR_DECL const size_t range_length_limit =
FMT_RANGE_OUTPUT_LENGTH_LIMIT; // output only up to N items from the
// range.
Char prefix;
Char delimiter;
Char postfix;
formatting_range() : prefix('{'), delimiter(','), postfix('}') {}
static FMT_CONSTEXPR_DECL const bool add_delimiter_spaces = true;
static FMT_CONSTEXPR_DECL const bool add_prepostfix_space = false;
};
template <typename Char, typename Enable = void>
struct formatting_tuple : formatting_base<Char> {
Char prefix;
Char delimiter;
Char postfix;
formatting_tuple() : prefix('('), delimiter(','), postfix(')') {}
static FMT_CONSTEXPR_DECL const bool add_delimiter_spaces = true;
static FMT_CONSTEXPR_DECL const bool add_prepostfix_space = false;
};
namespace detail {
template <typename RangeT, typename OutputIterator>
OutputIterator copy(const RangeT& range, OutputIterator out) {
for (auto it = range.begin(), end = range.end(); it != end; ++it)
*out++ = *it;
return out;
}
template <typename OutputIterator>
OutputIterator copy(const char* str, OutputIterator out) {
while (*str) *out++ = *str++;
return out;
}
template <typename OutputIterator>
OutputIterator copy(char ch, OutputIterator out) {
*out++ = ch;
return out;
}
/// Return true value if T has std::string interface, like std::string_view.
template <typename T> class is_like_std_string {
template <typename U>
static auto check(U* p)
-> decltype((void)p->find('a'), p->length(), (void)p->data(), int());
template <typename> static void check(...);
public:
static FMT_CONSTEXPR_DECL const bool value =
is_string<T>::value || !std::is_void<decltype(check<T>(nullptr))>::value;
};
template <typename Char>
struct is_like_std_string<fmt::basic_string_view<Char>> : std::true_type {};
template <typename... Ts> struct conditional_helper {};
template <typename T, typename _ = void> struct is_range_ : std::false_type {};
#if !FMT_MSC_VER || FMT_MSC_VER > 1800
template <typename T>
struct is_range_<
T, conditional_t<false,
conditional_helper<decltype(std::declval<T>().begin()),
decltype(std::declval<T>().end())>,
void>> : std::true_type {};
#endif
/// tuple_size and tuple_element check.
template <typename T> class is_tuple_like_ {
template <typename U>
static auto check(U* p) -> decltype(std::tuple_size<U>::value, int());
template <typename> static void check(...);
public:
static FMT_CONSTEXPR_DECL const bool value =
!std::is_void<decltype(check<T>(nullptr))>::value;
};
// Check for integer_sequence
#if defined(__cpp_lib_integer_sequence) || FMT_MSC_VER >= 1900
template <typename T, T... N>
using integer_sequence = std::integer_sequence<T, N...>;
template <size_t... N> using index_sequence = std::index_sequence<N...>;
template <size_t N> using make_index_sequence = std::make_index_sequence<N>;
#else
template <typename T, T... N> struct integer_sequence {
using value_type = T;
static FMT_CONSTEXPR size_t size() { return sizeof...(N); }
};
template <size_t... N> using index_sequence = integer_sequence<size_t, N...>;
template <typename T, size_t N, T... Ns>
struct make_integer_sequence : make_integer_sequence<T, N - 1, N - 1, Ns...> {};
template <typename T, T... Ns>
struct make_integer_sequence<T, 0, Ns...> : integer_sequence<T, Ns...> {};
template <size_t N>
using make_index_sequence = make_integer_sequence<size_t, N>;
#endif
template <class Tuple, class F, size_t... Is>
void for_each(index_sequence<Is...>, Tuple&& tup, F&& f) FMT_NOEXCEPT {
using std::get;
// using free function get<I>(T) now.
const int _[] = {0, ((void)f(get<Is>(tup)), 0)...};
(void)_; // blocks warnings
}
template <class T>
FMT_CONSTEXPR make_index_sequence<std::tuple_size<T>::value> get_indexes(
T const&) {
return {};
}
template <class Tuple, class F> void for_each(Tuple&& tup, F&& f) {
const auto indexes = get_indexes(tup);
for_each(indexes, std::forward<Tuple>(tup), std::forward<F>(f));
}
template <typename Arg, FMT_ENABLE_IF(!is_like_std_string<
typename std::decay<Arg>::type>::value)>
FMT_CONSTEXPR const char* format_str_quoted(bool add_space, const Arg&) {
return add_space ? " {}" : "{}";
}
template <typename Arg, FMT_ENABLE_IF(is_like_std_string<
typename std::decay<Arg>::type>::value)>
FMT_CONSTEXPR const char* format_str_quoted(bool add_space, const Arg&) {
return add_space ? " \"{}\"" : "\"{}\"";
}
FMT_CONSTEXPR const char* format_str_quoted(bool add_space, const char*) {
return add_space ? " \"{}\"" : "\"{}\"";
}
FMT_CONSTEXPR const wchar_t* format_str_quoted(bool add_space, const wchar_t*) {
return add_space ? L" \"{}\"" : L"\"{}\"";
}
FMT_CONSTEXPR const char* format_str_quoted(bool add_space, const char) {
return add_space ? " '{}'" : "'{}'";
}
FMT_CONSTEXPR const wchar_t* format_str_quoted(bool add_space, const wchar_t) {
return add_space ? L" '{}'" : L"'{}'";
}
} // namespace detail
template <typename T> struct is_tuple_like {
static FMT_CONSTEXPR_DECL const bool value =
detail::is_tuple_like_<T>::value && !detail::is_range_<T>::value;
};
template <typename TupleT, typename Char>
struct formatter<TupleT, Char, enable_if_t<fmt::is_tuple_like<TupleT>::value>> {
private:
// C++11 generic lambda for format()
template <typename FormatContext> struct format_each {
template <typename T> void operator()(const T& v) {
if (i > 0) {
if (formatting.add_prepostfix_space) {
*out++ = ' ';
}
out = detail::copy(formatting.delimiter, out);
}
out = format_to(out,
detail::format_str_quoted(
(formatting.add_delimiter_spaces && i > 0), v),
v);
++i;
}
formatting_tuple<Char>& formatting;
size_t& i;
typename std::add_lvalue_reference<decltype(
std::declval<FormatContext>().out())>::type out;
};
public:
formatting_tuple<Char> formatting;
template <typename ParseContext>
FMT_CONSTEXPR auto parse(ParseContext& ctx) -> decltype(ctx.begin()) {
return formatting.parse(ctx);
}
template <typename FormatContext = format_context>
auto format(const TupleT& values, FormatContext& ctx) -> decltype(ctx.out()) {
auto out = ctx.out();
size_t i = 0;
detail::copy(formatting.prefix, out);
detail::for_each(values, format_each<FormatContext>{formatting, i, out});
if (formatting.add_prepostfix_space) {
*out++ = ' ';
}
detail::copy(formatting.postfix, out);
return ctx.out();
}
};
template <typename T, typename Char> struct is_range {
static FMT_CONSTEXPR_DECL const bool value =
detail::is_range_<T>::value && !detail::is_like_std_string<T>::value &&
!std::is_convertible<T, std::basic_string<Char>>::value &&
!std::is_constructible<detail::std_string_view<Char>, T>::value;
};
template <typename RangeT, typename Char>
struct formatter<RangeT, Char,
enable_if_t<fmt::is_range<RangeT, Char>::value>> {
formatting_range<Char> formatting;
template <typename ParseContext>
FMT_CONSTEXPR auto parse(ParseContext& ctx) -> decltype(ctx.begin()) {
return formatting.parse(ctx);
}
template <typename FormatContext>
typename FormatContext::iterator format(const RangeT& values,
FormatContext& ctx) {
auto out = detail::copy(formatting.prefix, ctx.out());
size_t i = 0;
auto it = values.begin();
auto end = values.end();
for (; it != end; ++it) {
if (i > 0) {
if (formatting.add_prepostfix_space) *out++ = ' ';
out = detail::copy(formatting.delimiter, out);
}
out = format_to(out,
detail::format_str_quoted(
(formatting.add_delimiter_spaces && i > 0), *it),
*it);
if (++i > formatting.range_length_limit) {
out = format_to(out, " ... <other elements>");
break;
}
}
if (formatting.add_prepostfix_space) *out++ = ' ';
return detail::copy(formatting.postfix, out);
}
};
template <typename Char, typename... T> struct tuple_arg_join : detail::view {
const std::tuple<T...>& tuple;
basic_string_view<Char> sep;
tuple_arg_join(const std::tuple<T...>& t, basic_string_view<Char> s)
: tuple{t}, sep{s} {}
};
template <typename Char, typename... T>
struct formatter<tuple_arg_join<Char, T...>, Char> {
template <typename ParseContext>
FMT_CONSTEXPR auto parse(ParseContext& ctx) -> decltype(ctx.begin()) {
return ctx.begin();
}
template <typename FormatContext>
typename FormatContext::iterator format(
const tuple_arg_join<Char, T...>& value, FormatContext& ctx) {
return format(value, ctx, detail::make_index_sequence<sizeof...(T)>{});
}
private:
template <typename FormatContext, size_t... N>
typename FormatContext::iterator format(
const tuple_arg_join<Char, T...>& value, FormatContext& ctx,
detail::index_sequence<N...>) {
return format_args(value, ctx, std::get<N>(value.tuple)...);
}
template <typename FormatContext>
typename FormatContext::iterator format_args(
const tuple_arg_join<Char, T...>&, FormatContext& ctx) {
// NOTE: for compilers that support C++17, this empty function instantiation
// can be replaced with a constexpr branch in the variadic overload.
return ctx.out();
}
template <typename FormatContext, typename Arg, typename... Args>
typename FormatContext::iterator format_args(
const tuple_arg_join<Char, T...>& value, FormatContext& ctx,
const Arg& arg, const Args&... args) {
using base = formatter<typename std::decay<Arg>::type, Char>;
auto out = ctx.out();
out = base{}.format(arg, ctx);
if (sizeof...(Args) > 0) {
out = std::copy(value.sep.begin(), value.sep.end(), out);
ctx.advance_to(out);
return format_args(value, ctx, args...);
}
return out;
}
};
/**
\rst
Returns an object that formats `tuple` with elements separated by `sep`.
**Example**::
std::tuple<int, char> t = {1, 'a'};
fmt::print("{}", fmt::join(t, ", "));
// Output: "1, a"
\endrst
*/
template <typename... T>
FMT_CONSTEXPR tuple_arg_join<char, T...> join(const std::tuple<T...>& tuple,
string_view sep) {
return {tuple, sep};
}
template <typename... T>
FMT_CONSTEXPR tuple_arg_join<wchar_t, T...> join(const std::tuple<T...>& tuple,
wstring_view sep) {
return {tuple, sep};
}
/**
\rst
Returns an object that formats `initializer_list` with elements separated by
`sep`.
**Example**::
fmt::print("{}", fmt::join({1, 2, 3}, ", "));
// Output: "1, 2, 3"
\endrst
*/
template <typename T>
arg_join<const T*, const T*, char> join(std::initializer_list<T> list,
string_view sep) {
return join(std::begin(list), std::end(list), sep);
}
template <typename T>
arg_join<const T*, const T*, wchar_t> join(std::initializer_list<T> list,
wstring_view sep) {
return join(std::begin(list), std::end(list), sep);
}
FMT_END_NAMESPACE
#endif // FMT_RANGES_H_

View File

@@ -3,9 +3,8 @@
declare -A configurations
declare -A EXTRA_MODULE_FLAGS
EXTRA_MODULE_FLAGS[opm-simulators]="-DBUILD_EBOS_EXTENSIONS=ON -DBUILD_EBOS_DEBUG_EXTENSIONS=ON"
EXTRA_MODULE_FLAGS[opm-common]="-DOPM_ENABLE_PYTHON=ON -DOPM_ENABLE_EMBEDDED_PYTHON=ON"
EXTRA_MODULE_FLAGS[libecl]="-DCMAKE_POSITION_INDEPENDENT_CODE=1"
EXTRA_MODULE_FLAGS[opm-simulators]="-DBUILD_EBOS_EXTENSIONS=ON -DBUILD_EBOS_DEBUG_EXTENSIONS=ON -DBUILD_FLOW_VARIANTS=ON -DOPM_ENABLE_PYTHON=ON"
EXTRA_MODULE_FLAGS[opm-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',
@@ -13,7 +12,6 @@ EXTRA_MODULE_FLAGS[libecl]="-DCMAKE_POSITION_INDEPENDENT_CODE=1"
# 'ghprbCommentBody',
# 'CONFIGURATIONS', 'TOOLCHAINS'
function parseRevisions {
# Set default for libecl to be last known good commit.
for upstream in ${upstreams[*]}
do
if grep -qi "$upstream=" <<< $ghprbCommentBody
@@ -148,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/equinor/$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

View File

@@ -6,11 +6,9 @@ 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

View File

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

@@ -14,6 +14,8 @@
#include <opm/output/data/Solution.hpp>
#include <opm/output/data/Wells.hpp>
#include <opm/output/data/Groups.hpp>
#include <opm/parser/eclipse/Deck/UDAValue.hpp>
namespace Opm {
@@ -21,7 +23,14 @@ namespace Opm {
class EclipseIO;
class ParseContext;
class Parser;
class Python;
class SummaryState;
class UDQState;
namespace Action {
class State;
}
class msim {
public:
@@ -30,16 +39,18 @@ public:
msim(const EclipseState& state);
Opm::UDAValue uda_val();
void well_rate(const std::string& well, data::Rates::opt rate, std::function<well_rate_function> func);
void solution(const std::string& field, std::function<solution_function> func);
void run(Schedule& schedule, EclipseIO& io, bool report_only);
void post_step(Schedule& schedule, const SummaryState& st, data::Solution& sol, data::Wells& well_data, size_t report_step) const;
void post_step(Schedule& schedule, Action::State& action_state, SummaryState& st, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& group_nwrk_data, size_t report_step);
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;
void run_step(const Schedule& schedule, Action::State& action_state, SummaryState& st, UDQState& udq_state, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& group_nwrk_data, size_t report_step, EclipseIO& io) const;
void run_step(const Schedule& schedule, Action::State& action_state, SummaryState& st, UDQState& udq_state, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& group_nwrk_data, size_t report_step, double dt, EclipseIO& io) const;
void output(Action::State& action_state, SummaryState& st, const UDQState& udq_state, size_t report_step, bool substep, double seconds_elapsed, const data::Solution& sol, const data::Wells& well_data, const data::GroupAndNetworkValues& group_data, EclipseIO& io) const;
void simulate(const Schedule& schedule, const SummaryState& st, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& group_nwrk_data, size_t report_step, double seconds_elapsed, double time_step) const;
EclipseState state;
std::map<std::string, std::map<data::Rates::opt, std::function<well_rate_function>>> well_rates;

View File

@@ -24,9 +24,14 @@
#include <opm/output/eclipse/Summary.hpp>
#include <opm/output/data/Solution.hpp>
#include <opm/output/data/Wells.hpp>
#include <opm/output/data/Groups.hpp>
#include <opm/parser/eclipse/Python/Python.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Action/ActionContext.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Action/State.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQConfig.hpp>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
@@ -41,45 +46,59 @@ msim::msim(const EclipseState& 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()));
UDQState udq_state(schedule.getUDQConfig(0).params().undefinedValue());
Action::State action_state;
Python python;
io.writeInitial();
for (size_t report_step = 1; report_step < schedule.size(); report_step++) {
data::Wells well_data;
data::GroupAndNetworkValues group_nwrk_data;
if (report_only)
run_step(schedule, st, sol, well_data, report_step, io);
run_step(schedule, action_state, st, udq_state, sol, well_data, group_nwrk_data, report_step, io);
else {
double time_step = std::min(week, 0.5*schedule.stepLength(report_step - 1));
run_step(schedule, st, sol, well_data, report_step, time_step, io);
run_step(schedule, action_state, st, udq_state, sol, well_data, group_nwrk_data, report_step, time_step, io);
}
post_step(schedule, st, sol, well_data, report_step);
post_step(schedule, action_state, st, sol, well_data, group_nwrk_data, report_step);
const auto& exit_status = schedule.exitStatus();
if (exit_status.has_value())
return;
}
}
UDAValue msim::uda_val() {
return UDAValue();
}
void msim::post_step(Schedule& schedule, const SummaryState& st, data::Solution& /* sol */, data::Wells& /* well_data */, size_t report_step) const {
void msim::post_step(Schedule& schedule, Action::State& action_state, SummaryState& st, data::Solution& /* sol */, data::Wells& /* well_data */, data::GroupAndNetworkValues& /* grp_nwrk_data */, size_t report_step) {
const auto& actions = schedule.actions(report_step);
if (actions.empty())
return;
Action::Context context( st );
Action::Context context( st , schedule.getWListManager(report_step));
auto sim_time = schedule.simTime(report_step);
for (const auto& action : actions.pending(sim_time)) {
auto result = action->eval(sim_time, context);
for (const auto& action : actions.pending(action_state, sim_time)) {
auto result = action->eval(context);
if (result)
schedule.applyAction(report_step, *action, result);
}
for (const auto& pyaction : actions.pending_python())
pyaction->run(this->state, schedule, report_step, st);
}
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, Action::State& action_state, SummaryState& st, UDQState& udq_state, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& grp_nwrk_data, size_t report_step, EclipseIO& io) const {
this->run_step(schedule, action_state, st, udq_state, sol, well_data, grp_nwrk_data, report_step, schedule.stepLength(report_step - 1), io);
}
void msim::run_step(const Schedule& schedule, SummaryState& st, data::Solution& sol, data::Wells& well_data, size_t report_step, double dt, EclipseIO& io) const {
void msim::run_step(const Schedule& schedule, Action::State& action_state, SummaryState& st, UDQState& udq_state, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& group_nwrk_data, size_t report_step, double dt, EclipseIO& io) const {
double start_time = schedule.seconds(report_step - 1);
double end_time = schedule.seconds(report_step);
double seconds_elapsed = start_time;
@@ -89,7 +108,7 @@ void msim::run_step(const Schedule& schedule, SummaryState& st, data::Solution&
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);
this->simulate(schedule, st, sol, well_data, group_nwrk_data, report_step, seconds_elapsed, time_step);
seconds_elapsed += time_step;
@@ -99,31 +118,39 @@ void msim::run_step(const Schedule& schedule, SummaryState& st, data::Solution&
this->state,
schedule,
well_data,
group_nwrk_data,
{});
this->output(st,
schedule.getUDQConfig( report_step ).eval(report_step, st, udq_state);
this->output(action_state,
st,
udq_state,
report_step,
(seconds_elapsed < end_time),
seconds_elapsed,
sol,
well_data,
group_nwrk_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,
void msim::output(Action::State& action_state, SummaryState& st, const UDQState& udq_state, size_t report_step, bool substep, double seconds_elapsed, const data::Solution& sol, const data::Wells& well_data, const data::GroupAndNetworkValues& group_nwrk_data, EclipseIO& io) const {
RestartValue value(sol, well_data, group_nwrk_data);
io.writeTimeStep(action_state,
st,
udq_state,
report_step,
false,
substep,
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 {
void msim::simulate(const Schedule& schedule, const SummaryState& st, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& /* group_nwrk_data */, size_t report_step, double seconds_elapsed, double time_step) const {
for (const auto& sol_pair : this->solutions) {
auto func = sol_pair.second;
func(this->state, schedule, sol, report_step, seconds_elapsed + time_step);
@@ -131,12 +158,18 @@ void msim::simulate(const Schedule& schedule, const SummaryState& st, data::Solu
for (const auto& well_pair : this->well_rates) {
const std::string& well_name = well_pair.first;
const auto& sched_well = schedule.getWell(well_name, report_step);
bool well_open = (sched_well.getStatus() == Well::Status::OPEN);
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));
if (well_open)
well.rates.set(rate, func(this->state, schedule, st, sol, report_step, seconds_elapsed + time_step));
else
well.rates.set(rate, 0.0);
}
// This is complete bogus; a temporary fix to pass an assert() in the

View File

@@ -3,29 +3,19 @@
# defines that must be present in config.h for our headers
set (opm-common_CONFIG_VAR
"HAS_ATTRIBUTE_UNUSED")
HAVE_OPENMP
)
# dependencies
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"
"OpenMP QUIET"
)
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,84 @@
/*
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 KEYWORD_LOCATION_HPP
#define KEYWORD_LOCATION_HPP
#include <string>
namespace Opm {
class KeywordLocation {
public:
/*
Observe that many error messages whcih should print out the name of the
problem keyword along with the location {} placeholders can be used. The
convention is:
{keyword} -> keyword
{file} -> filename
{line} -> lineno
This convention must be adhered to at the call site *creating the output
string*.
*/
std::string keyword;
std::string filename = "<memory string>";
std::size_t lineno = 0;
KeywordLocation() = default;
KeywordLocation(std::string kw, std::string fname, std::size_t lno) :
keyword(std::move(kw)),
filename(std::move(fname)),
lineno(lno)
{}
std::string message() const {
return this->keyword + " in " + this->filename + " at line " + std::to_string(this->lineno);
}
static KeywordLocation serializeObject()
{
KeywordLocation result;
result.keyword = "KW";
result.filename = "test";
result.lineno = 1;
return result;
}
bool operator==(const KeywordLocation& data) const {
return keyword == data.keyword &&
filename == data.filename &&
lineno == data.lineno;
}
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(keyword);
serializer(filename);
serializer(lineno);
}
};
}
#endif

View File

@@ -23,7 +23,10 @@
#include <cstdint>
#include <string>
#include <opm/common/OpmLog/KeywordLocation.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 KeywordLocation& location, const std::string& msg);
std::string fileMessage(int64_t messageType , const KeywordLocation& 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

@@ -1,191 +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/>.
*/
#ifndef SIMULATION_DATA_CONTAINER_HPP
#define SIMULATION_DATA_CONTAINER_HPP
#include <cstddef>
#include <string>
#include <map>
#include <vector>
namespace Opm {
/// The SimulationDataContainer is a simple container to manage
/// simulation data. The container is instantiated with information
/// of how many cells, faces and phases are present in the
/// reservoirmodel. You can then add data to the container by using the
///
/// registerCellData()
/// registerFaceData()
///
/// functions. The container owns and manages the data, but
/// mutable references are returned with the getCellData() and
/// getFaceData() methods, and the content will typically be
/// modified by external scope.
class SimulationDataContainer
{
public:
/// Main constructor setting the sizes for the contained data
/// types.
/// \param num_cells number of elements in cell data vectors
/// \param num_faces number of elements in face data vectors
/// \param num_phases number of phases, the number of components
/// in any data vector must equal 1 or this
/// number (this behaviour and argument is deprecated).
SimulationDataContainer(size_t num_cells, size_t num_faces, size_t num_phases);
/// Copy constructor.
/// Must be defined explicitly because class contains non-value objects
/// (the reference pointers pressure_ref_ etc.) that should not simply
/// be copied.
SimulationDataContainer(const SimulationDataContainer&);
/// Copy assignment operator.
/// Must be defined explicitly because class contains non-value objects
/// (the reference pointers pressure_ref_ etc.) that should not simply
/// be copied.
SimulationDataContainer& operator=(const SimulationDataContainer&);
/// Efficient O(1) swap.
void swap(SimulationDataContainer& other);
size_t numPhases() const;
size_t numFaces() const;
size_t numCells() const;
bool hasCellData( const std::string& name ) const;
/// Will register a data vector of size numCells() *
/// components.
void registerCellData( const std::string& name , size_t components , double initialValue = 0.0 );
std::vector<double>& getCellData( const std::string& name );
const std::vector<double>& getCellData( const std::string& name ) const;
bool hasFaceData( const std::string& name ) const;
void registerFaceData( const std::string& name , size_t components , double initialValue = 0.0 );
std::vector<double>& getFaceData( const std::string& name );
const std::vector<double>& getFaceData( const std::string& name ) const;
/// Will return the number of components of the celldata with
/// name @name:
///
/// numCellDataComponents( "PRESSURE" ) -> 1
/// numCellDataComponents( "SATURATION" ) -> 3
///
/// for a three phase model.
size_t numCellDataComponents( const std::string& name ) const;
bool equal(const SimulationDataContainer& other) const;
/// Will set the values of component nr @component in the
/// field @key. All the cells in @cells will be set to the
/// values in @values.
void setCellDataComponent( const std::string& key , size_t component , const std::vector<int>& cells , const std::vector<double>& values);
// Direct explicit field access for certain default fields.
// These methods are all deprecated, and will eventually be moved to
// concrete subclasses.
std::vector<double>& pressure ();
std::vector<double>& temperature ();
std::vector<double>& saturation ();
std::vector<double>& facepressure();
std::vector<double>& faceflux ();
const std::vector<double>& pressure () const;
const std::vector<double>& temperature () const;
const std::vector<double>& saturation () const;
const std::vector<double>& facepressure() const;
const std::vector<double>& faceflux () const;
const std::map<std::string, std::vector<double>>& cellData() const;
std::map<std::string, std::vector<double>>& cellData();
private:
void addDefaultFields();
void setReferencePointers();
size_t m_num_cells;
size_t m_num_faces;
size_t m_num_phases;
std::map< std::string , std::vector<double> > m_cell_data;
std::map< std::string , std::vector<double> > m_face_data;
std::vector<double>* pressure_ref_;
std::vector<double>* temperature_ref_;
std::vector<double>* saturation_ref_;
std::vector<double>* facepressure_ref_;
std::vector<double>* faceflux_ref_;
};
// Inline implementations of the direct accessors required to guarantee
// performance.
inline std::vector<double>& SimulationDataContainer::pressure( ) {
return *pressure_ref_;
}
inline std::vector<double>& SimulationDataContainer::temperature() {
return *temperature_ref_;
}
inline std::vector<double>& SimulationDataContainer::saturation() {
return *saturation_ref_;
}
inline std::vector<double>& SimulationDataContainer::facepressure() {
return *facepressure_ref_;
}
inline std::vector<double>& SimulationDataContainer::faceflux() {
return *faceflux_ref_;
}
inline const std::vector<double>& SimulationDataContainer::pressure( ) const {
return *pressure_ref_;
}
inline const std::vector<double>& SimulationDataContainer::temperature() const {
return *temperature_ref_;
}
inline const std::vector<double>& SimulationDataContainer::saturation() const {
return *saturation_ref_;
}
inline const std::vector<double>& SimulationDataContainer::facepressure() const {
return *facepressure_ref_;
}
inline const std::vector<double>& SimulationDataContainer::faceflux() const {
return *faceflux_ref_;
}
}
#endif

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 && !defined(__clang__))
#include <experimental/filesystem>
#else
#include <filesystem>
#endif
#include <string>
namespace Opm
{
#if __cplusplus < 201703L || \
(defined(__GNUC__) && __GNUC__ < 8 && !defined(__clang__))
namespace filesystem = std::experimental::filesystem;
#else
namespace filesystem = std::filesystem;
#endif
// A poor man's filesystem::unique_path
std::string unique_path(const std::string& input);
} // end namespace Opm
#endif // OPM_FILESYSTEM_HPP

View File

@@ -0,0 +1,121 @@
/*
Copyright 2020 Equinor ASA.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_ERROR_HPP
#define OPM_ERROR_HPP
#include <stdexcept>
#include <string>
#include <vector>
#include <opm/common/OpmLog/KeywordLocation.hpp>
namespace Opm {
/*
The OpmInputError is a custom exception class which can be used to signal
errors in input handling. The importance of the OpmInputError exception is
*not* the tecnical functionality it provides, but rather the convention
surrounding it, when and how it should be used.
The OpmInputError should be used in situations which are "close to user
input", the root cause can either be incorrect user input or a bug/limitation
in opm. OpmInputError should only be used in situations where we have a good
understanding of the underlying issue, and can provide a good error message.
The local error handling should be complete when the OpmInputError is
instantiated, it should not be caught and rethrown in order to e.g. add
additional context or log messages. In order to avoid inadvertendly catching
this exception in a catch all block.
*/
class OpmInputError : public std::exception {
public:
/*
The message string will be used as format string in the fmt::format()
function as, and optional {} markers can be used to inject keyword,
filename and linenumber into the final what() message. The placeholders
must use named arguments
{keyword} -> loc.keyword
{file} -> loc.filename
{line} -> loc.lineno
additionally, the message can contain any number of positional
arguments to add further context to the message.
KeywordLocation loc("KW", "file.inc", 100);
OpmInputError("Error at line {line} in file {file} - keyword: {keyword} ignored", location);
OpmInputError("Error at line {line} in file {file} - keyword: {keyword} has invalid argument {}", invalid_argument);
*/
template<typename ... Args>
OpmInputError(const std::string& reason, const KeywordLocation& location, const Args& ...furtherLocations)
: locations { location, furtherLocations... }
, m_what {
locations.size() == 1
? formatSingle(reason, locations[0])
: formatMultiple(reason, locations)
}
{ }
/*
Allows for the initialisation of an OpmInputError from another exception.
Usage:
try {
.
.
.
} catch (const Opm::OpmInputError&) {
throw;
} catch (const std::exception& e) {
std::throw_with_nested(Opm::OpmInputError(e, location));
}
*/
OpmInputError(const std::exception& error, const KeywordLocation& location)
: locations { location }
, m_what { formatException(error, locations[0]) }
{ }
const char * what() const throw()
{
return this->m_what.c_str();
}
static std::string format(const std::string& msg_format, const KeywordLocation& loc);
private:
// The location member is here for debugging; depending on the msg_fmt
// passed in the constructor we might not have captured all the information
// in the location argument passed to the constructor.
std::vector<KeywordLocation> locations;
std::string m_what;
static std::string formatException(const std::exception& e, const KeywordLocation& loc);
static std::string formatSingle(const std::string& reason, const KeywordLocation&);
static std::string formatMultiple(const std::string& reason, const std::vector<KeywordLocation>&);
};
}
#endif

View File

@@ -0,0 +1,118 @@
/*
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/>.
*/
#include <cstring>
#include <string>
#include <unordered_map>
#include <vector>
#ifndef OPM_SERIALIZER_HPP
#define OPM_SERIALIZER_HPP
namespace Opm {
/*
This is a very basic serialization class used to support serialization of
small state objects from opm common. The main serialization code used in
opm/flow is initiated and controlled from the restart code, and therefor
slightly cumbersome to use for objects which should be serialized not as part
of the restart code.
*/
class Serializer {
public:
Serializer() = default;
explicit Serializer(const std::vector<char>& buffer_arg) :
buffer(buffer_arg)
{}
template <typename T>
void put(const T& value) {
this->pack(std::addressof(value), sizeof(T));
}
template <typename T>
void put(const T* ) {
throw std::logic_error("Serializer can not pack pointers");
}
template <typename T>
T get() {
T value;
std::memcpy(&value, &this->buffer[this->read_pos], sizeof(T));
this->read_pos += sizeof(T);
return value;
}
template<typename K, typename T>
void put(const std::unordered_map<K,T>& values) {
this->put(values.size());
for (const auto& value_pair : values) {
this->put(value_pair.first);
this->put(value_pair.second);
}
}
template<typename K, typename T>
std::unordered_map<K,T> get() {
std::unordered_map<K,T> values;
auto size = this->get<std::size_t>();
for (std::size_t index = 0; index < size; index++) {
auto key = this->get<K>();
auto value = this->get<T>();
values.insert( std::make_pair(key,value) );
}
return values;
}
std::vector<char> buffer;
private:
void pack(const void * ptr, std::size_t value_size) {
std::size_t write_pos = this->buffer.size();
std::size_t new_size = write_pos + value_size;
this->buffer.resize( new_size );
std::memcpy(&this->buffer[write_pos], ptr, value_size);
}
std::size_t read_pos = 0;
};
template <>
void inline Serializer::put(const std::string& value) {
this->put(value.size());
if (value.empty())
return;
this->pack(value.c_str(), value.size());
}
template<>
std::string inline Serializer::get<std::string>() {
std::string::size_type length = this->get<std::string::size_type>();
if (length == 0)
return std::string{};
this->read_pos += length;
return {std::addressof(this->buffer[this->read_pos - length]), length};
}
}
#endif

View File

@@ -0,0 +1,108 @@
#ifndef OPM_UTILITY_STRING_HPP
#define OPM_UTILITY_STRING_HPP
#include <algorithm>
#include <cctype>
#include <sstream>
#include <string>
#include <vector>
namespace Opm {
template< typename T, typename U >
U& uppercase( const T& src, U& dst ) {
const auto up = []( char c ) { return std::toupper( c ); };
std::transform( std::begin( src ), std::end( src ), std::begin( dst ), up );
return dst;
}
template< typename T >
typename std::decay< T >::type uppercase( T&& x ) {
typename std::decay< T >::type t( std::forward< T >( x ) );
return uppercase( t, t );
}
template<typename T>
std::string ltrim_copy(const T& s)
{
auto ret = std::string(s.c_str());
const auto start = ret.find_first_not_of(" \t\n\r\f\v");
if (start == std::string::npos)
return "";
return ret.substr(start);
}
template<typename T>
std::string rtrim_copy(const T& s)
{
auto ret = std::string(s.c_str());
const auto end = ret.find_last_not_of(" \t\n\r\f\v");
if (end == std::string::npos)
return "";
return ret.substr(0, end + 1);
}
template<typename T>
std::string trim_copy(const T& s)
{
return ltrim_copy( rtrim_copy(s) );
}
template<typename T>
void replaceAll(T& data, const T& toSearch, const T& replace)
{
// Get the first occurrence
size_t pos = data.find(toSearch);
// Repeat till end is reached
while (pos != std::string::npos)
{
// Replace this occurrence of Sub String
data.replace(pos, toSearch.size(), replace);
// Get the next occurrence from the current position
pos = data.find(toSearch, pos + replace.size());
}
}
inline std::vector<std::string> split_string(const std::string& input,
char delimiter)
{
std::vector<std::string> result;
std::string token;
std::istringstream tokenStream(input);
while (std::getline(tokenStream, token, delimiter))
result.push_back(token);
return result;
}
inline std::vector<std::string> split_string(const std::string& input,
const std::string& delimiters)
{
std::vector<std::string> result;
std::string::size_type start = 0;
while (start < input.size()) {
auto end = input.find_first_of(delimiters, start);
if (end == std::string::npos) {
result.push_back(input.substr(start));
end = input.size() - 1;
} else if (end != start)
result.push_back(input.substr(start, end-start));
start = end + 1;
}
return result;
}
}
#endif //OPM_UTILITY_STRING_HPP

View File

@@ -0,0 +1,105 @@
/*
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;
}
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(year);
serializer(month);
serializer(day);
}
};
TimeStampUTC() = default;
explicit TimeStampUTC(const std::time_t tp);
explicit TimeStampUTC(const YMD& ymd);
TimeStampUTC(int year, int month, int day);
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_; }
template<class Serializer>
void serializeOp(Serializer& serializer)
{
ymd_.serializeOp(serializer);
serializer(hour_);
serializer(minutes_);
serializer(seconds_);
serializer(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);
std::time_t asLocalTimeT(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).
@@ -58,7 +43,7 @@ namespace Opm
{
OPM_THROW(std::runtime_error, "Maximum number of iterations exceeded: " << maxiter << "\n"
<< "Current interval is [" << std::min(x0, x1) << ", "
<< std::max(x0, x1) << "]");
<< std::max(x0, x1) << "] abs(x0-x1) " << std::abs(x0-x1));
return -1e100; // Never reached.
}
};
@@ -79,7 +64,7 @@ namespace Opm
OPM_REPORT;
std::cerr << "Maximum number of iterations exceeded: " << maxiter
<< ", current interval is [" << std::min(x0, x1) << ", "
<< std::max(x0, x1) << "]";
<< std::max(x0, x1) << "] abs(x0-x1) " << std::abs(x0-x1);
return 0.5*(x0 + x1);
}
};
@@ -139,7 +124,7 @@ namespace Opm
iterations_used = 0;
// In every iteraton, x1 is the last point computed,
// and x0 is the last point computed that makes it a bracket.
while (fabs(x1 - x0) >= 1e-9*eps) {
while (fabs(x1 - x0) >= eps) {
double xnew = regulaFalsiStep(x0, x1, f0, f1);
double fnew = f(xnew);
// cout << "xnew = " << xnew << " fnew = " << fnew << endl;
@@ -236,7 +221,7 @@ namespace Opm
iterations_used = 0;
// In every iteraton, x1 is the last point computed,
// and x0 is the last point computed that makes it a bracket.
while (fabs(x1 - x0) >= 1e-9*eps) {
while (fabs(x1 - x0) >= eps) {
double xnew = regulaFalsiStep(x0, x1, f0, f1);
double fnew = f(xnew);
// cout << "xnew = " << xnew << " fnew = " << fnew << endl;
@@ -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 >= 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

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

View File

@@ -44,16 +44,20 @@ public:
template <typename T>
const std::vector<T>& getRft(const std::string& name, const std::string& wellName,
int year, int month, int day) const;
template <typename T>
const std::vector<T>& getRft(const std::string& name, int reportIndex) const;
std::vector<std::string> listOfWells() const;
std::vector<RftDate> listOfdates() const;
using RftReportList = std::vector<std::pair<std::string, RftDate>>;
using RftReportList = std::vector<std::tuple<std::string, RftDate, float>>;
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(int reportIndex ) const;
std::vector<EclEntry> listOfRftArrays(const std::string& wellName,
const RftDate& date) const;
@@ -63,8 +67,12 @@ public:
bool hasArray(const std::string& arrayName, const std::string& wellName,
const RftDate& date) const;
bool hasArray(const std::string& arrayName, int reportInd) const;
int numberOfReports() { return numReports; }
private:
std::map<int, std::pair<int,int>> arrIndexRange;
std::map<int, std::tuple<int,int>> arrIndexRange;
int numReports;
std::vector<float> timeList;
@@ -72,9 +80,11 @@ private:
std::set<RftDate> dateList;
RftReportList rftReportList;
std::map<std::pair<std::string,RftDate>,int> reportIndex; // mapping report index to wellName and date (tupe)
std::map<std::tuple<std::string,RftDate>,int> reportIndices; // mapping report index to wellName and date (tupe)
int getReportIndex(const std::string& wellName, const RftDate& date) const;
int getArrayIndex(const std::string& name, int reportIndex) const;
int getArrayIndex(const std::string& name, const std::string& wellName,
const RftDate& date) const;
};

79
opm/io/eclipse/ERsm.hpp Normal file
View File

@@ -0,0 +1,79 @@
/*
Copyright 2020 Equinor ASA.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_IO_ERSM_HPP
#define OPM_IO_ERSM_HPP
#include <deque>
#include <string>
#include <unordered_map>
#include <variant>
#include <vector>
#include <opm/io/eclipse/SummaryNode.hpp>
#include <opm/common/utility/TimeService.hpp>
namespace Opm { namespace EclIO {
/*
Small class to load RSM files. The RSM file is a text based version of the
information found in the summary file. The format seems quite fragile - with
significant whitespace all over the place.The ambition of this ERsm clas is to
be able to do regression testing of the RSM files we export from the ESmry
class - it is not meant to be a rock-solid-works-in-every-lunar phase RSM
loader.
*/
class ESmry;
class ERsm
{
struct Vector{
SummaryNode header;
std::vector<double> data;
Vector(SummaryNode header_, std::size_t size_advice) :
header(std::move(header_))
{
this->data.reserve(size_advice);
}
};
public:
ERsm(const std::string& fname);
const std::vector<TimeStampUTC>& dates() const;
const std::vector<double>& days() const;
bool has_dates() const;
const std::vector<double>& get(const std::string& key) const;
bool has(const std::string& key) const;
private:
void load_block(std::deque<std::string>& lines , std::size_t& vector_length);
std::unordered_map<std::string, Vector> vectors;
std::variant<std::vector<double>, std::vector<TimeStampUTC>> time;
};
bool cmp(const ESmry& esmr, const ERsm& ersm);
}
}
#endif

View File

@@ -42,10 +42,19 @@ public:
void loadReportStepNumber(int number);
template <typename T>
const std::vector<T>& getRst(const std::string& name, int reportStepNumber);
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;
size_t numberOfReportSteps() const { return seqnum.size(); };
const std::vector<int>& listOfReportStepNumbers() const { return seqnum; }
std::vector<EclEntry> listOfRstArrays(int reportStepNumber);
friend class OutputStream::Restart;
@@ -59,10 +68,12 @@ private:
void initUnified();
void initSeparate(const int number);
int getArrayIndex(const std::string& name, int seqnum) const;
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

View File

@@ -19,43 +19,131 @@
#ifndef OPM_IO_ESMRY_HPP
#define OPM_IO_ESMRY_HPP
#include <chrono>
#include <ostream>
#include <string>
#include <unordered_map>
#include <vector>
#include <map>
#include <stdint.h>
#include <opm/common/utility/FileSystem.hpp>
#include <opm/io/eclipse/SummaryNode.hpp>
namespace Opm { namespace EclIO {
using ArrSourceEntry = std::tuple<std::string, std::string, int, uint64_t>;
using TimeStepEntry = std::tuple<int, int, uint64_t>;
class ESmry
{
public:
explicit ESmry(const std::string& filename, bool loadBaseRunData=false); // filename (smspec file) or file root name
// 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;
const std::vector<float>& get(const SummaryNode& node) const;
std::vector<std::chrono::system_clock::time_point> dates() const;
std::vector<float> get_at_rstep(const std::string& name) const;
std::vector<float> get_at_rstep(const SummaryNode& node) const;
std::vector<std::chrono::system_clock::time_point> dates_at_rstep() const;
const std::vector<std::string>& keywordList() const { return keyword; }
void LoadData(const std::vector<std::string>& vectList) const;
void LoadData() const;
bool make_lodsmry_file();
std::chrono::system_clock::time_point startdate() const { return startdat; }
const std::vector<std::string>& keywordList() const;
std::vector<std::string> keywordList(const std::string& pattern) const;
const std::vector<SummaryNode>& summaryNodeList() const;
int timestepIdxAtReportstepStart(const int reportStep) const;
size_t numberOfTimeSteps() const { return nTstep; }
const std::string& get_unit(const std::string& name) const;
const std::string& get_unit(const SummaryNode& node) const;
void write_rsm(std::ostream&) const;
void write_rsm_file(std::optional<Opm::filesystem::path> = std::nullopt) const;
private:
int nVect, nI, nJ, nK;
std::string path="";
Opm::filesystem::path inputFileName, lodFileName;
int nI, nJ, nK, nSpecFiles;
bool fromSingleRun, lodEnabeled;
uint64_t lod_offset, lod_arr_size;
size_t nVect, nTstep;
void ijk_from_global_index(int glob, int &i, int &j, int &k) const;
std::vector<std::vector<float>> param;
std::vector<bool> formattedFiles;
std::vector<std::string> dataFileList;
mutable std::vector<std::vector<float>> vectorData;
mutable std::vector<bool> vectorLoaded;
std::vector<TimeStepEntry> timeStepList;
std::vector<std::map<int, int>> arrayPos;
std::vector<std::string> keyword;
std::map<std::string, int> keyword_index;
std::vector<int> nParamsSpecFile;
std::vector<std::vector<std::string>> keywordListSpecFile;
std::vector<int> seqIndex;
std::vector<float> seqTime;
void getRstString(const std::vector<std::string> &restartArray, std::string &path, std::string &rootN) const;
void updatePathAndRootName(std::string &path, std::string &rootN) const;
void ijk_from_global_index(int glob, int &i, int &j, int &k) const;
std::vector<SummaryNode> summaryNodes;
std::unordered_map<std::string, std::string> kwunits;
std::chrono::system_clock::time_point startdat;
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;
std::string unpackNumber(const SummaryNode&) const;
std::string lookupKey(const SummaryNode&) const;
void write_block(std::ostream &, bool write_dates, const std::vector<std::string>& time_column, const std::vector<SummaryNode>&) const;
template <typename T>
std::vector<T> rstep_vector(const std::vector<T>& full_vector) const {
std::vector<T> result;
result.reserve(seqIndex.size());
for (const auto& ind : seqIndex){
result.push_back(full_vector[ind]);
}
return result;
}
std::vector<std::tuple <std::string, uint64_t>> getListOfArrays(std::string filename, bool formatted);
std::vector<int> makeKeywPosVector(int speInd) const;
std::string read_string_from_disk(std::fstream& fileH, uint64_t size) const;
void inspect_lodsmry();
void Load_from_lodsmry(const std::vector<int>& keywIndVect) const;
};
}} // namespace Opm::EclIO
inline std::ostream& operator<<(std::ostream& os, const Opm::EclIO::ESmry& smry) {
smry.write_rsm(os);
return os;
}
#endif // OPM_IO_ESMRY_HPP

View File

@@ -35,7 +35,7 @@ namespace Opm { namespace EclIO {
class EclFile
{
public:
explicit EclFile(const std::string& filename);
explicit EclFile(const std::string& filename, bool preload = false);
bool formattedInput() { return formatted; }
void loadData(); // load all data
@@ -52,7 +52,7 @@ public:
char_array.clear();
}
using EclEntry = std::tuple<std::string, eclArrType, int>;
using EclEntry = std::tuple<std::string, eclArrType, int64_t>;
std::vector<EclEntry> getList() const;
template <typename T>
@@ -62,8 +62,10 @@ public:
const std::vector<T>& get(const std::string& name);
bool hasKey(const std::string &name) const;
std::size_t count(const std::string& name) const;
const std::vector<std::string>& arrayNames() const { return array_name; }
std::size_t size() const;
protected:
bool formatted;
@@ -77,9 +79,9 @@ protected:
std::vector<std::string> array_name;
std::vector<eclArrType> array_type;
std::vector<int> array_size;
std::vector<int64_t> array_size;
std::vector<unsigned long int> ifStreamPos;
std::vector<uint64_t> ifStreamPos;
std::map<std::string, int> array_index;
@@ -107,7 +109,7 @@ 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);
void loadFormattedArray(const std::string& fileStr, std::size_t arrIndex, int64_t fromPos);
};

View File

@@ -26,6 +26,7 @@
#include <opm/io/eclipse/EclIOdata.hpp>
#include <opm/io/eclipse/PaddedOutputString.hpp>
#include <iostream>
namespace Opm { namespace EclIO { namespace OutputStream {
class Restart;
@@ -78,7 +79,7 @@ public:
friend class OutputStream::SummarySpecification;
private:
void writeBinaryHeader(const std::string& arrName, int size, eclArrType arrType);
void writeBinaryHeader(const std::string& arrName, int64_t size, eclArrType arrType);
template <typename T>
void writeBinaryArray(const std::vector<T>& data);
@@ -94,6 +95,7 @@ private:
void writeFormattedCharArray(const std::vector<std::string>& data);
void writeFormattedCharArray(const std::vector<PaddedOutputString<8>>& data);
void writeArrayType(const eclArrType arrType);
std::string make_real_string(float value) const;
std::string make_doub_string(double value) const;

View File

@@ -23,18 +23,56 @@
#include <string>
#include <tuple>
#include <vector>
#include <functional>
namespace Opm { namespace EclIO {
int flipEndianInt(int num);
int64_t flipEndianLongInt(int64_t num);
float flipEndianFloat(float num);
double flipEndianDouble(double num);
bool isEOF(std::fstream* fileH);
bool fileExists(const std::string& filename);
bool isFormatted(const std::string& filename);
std::tuple<int, int> block_size_data_binary(eclArrType arrType);
std::tuple<int, int, int> block_size_data_formatted(eclArrType arrType);
std::string trimr(const std::string &str1);
uint64_t sizeOnDiskBinary(int64_t num, Opm::EclIO::eclArrType arrType);
uint64_t sizeOnDiskFormatted(const int64_t num, Opm::EclIO::eclArrType arrType);
void readBinaryHeader(std::fstream& fileH, std::string& tmpStrName,
int& tmpSize, std::string& tmpStrType);
void readBinaryHeader(std::fstream& fileH, std::string& arrName,
int64_t& size, Opm::EclIO::eclArrType &arrType);
void readFormattedHeader(std::fstream& fileH, std::string& arrName,
int64_t &num, Opm::EclIO::eclArrType &arrType);
template<typename T, typename T2>
std::vector<T> readBinaryArray(std::fstream& fileH, const int64_t size, Opm::EclIO::eclArrType type,
std::function<T(T2)>& flip);
std::vector<int> readBinaryInteArray(std::fstream &fileH, const int64_t size);
std::vector<float> readBinaryRealArray(std::fstream& fileH, const int64_t size);
std::vector<double> readBinaryDoubArray(std::fstream& fileH, const int64_t size);
std::vector<bool> readBinaryLogiArray(std::fstream &fileH, const int64_t size);
std::vector<std::string> readBinaryCharArray(std::fstream& fileH, const int64_t size);
template<typename T>
std::vector<T> readFormattedArray(const std::string& file_str, const int size, int64_t fromPos,
std::function<T(const std::string&)>& process);
std::vector<int> readFormattedInteArray(const std::string& file_str, const int64_t size, int64_t fromPos);
std::vector<std::string> readFormattedCharArray(const std::string& file_str, const int64_t size, int64_t fromPos);
std::vector<float> readFormattedRealArray(const std::string& file_str, const int64_t size, int64_t fromPos);
std::vector<bool> readFormattedLogiArray(const std::string& file_str, const int64_t size, int64_t fromPos);
std::vector<double> readFormattedDoubArray(const std::string& file_str, const int64_t size, int64_t fromPos);
}} // namespace Opm::EclIO
#endif // OPM_IO_ECLUTIL_HPP

View File

@@ -0,0 +1,79 @@
/*
Copyright 2020 Equinor ASA.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_IO_SUMMARYNODE_HPP
#define OPM_IO_SUMMARYNODE_HPP
#include <functional>
#include <optional>
#include <string>
#include <unordered_set>
namespace Opm { namespace EclIO {
struct SummaryNode {
enum class Category {
Well,
Group,
Field,
Region,
Block,
Connection,
Segment,
Aquifer,
Node,
Miscellaneous,
};
enum class Type {
Rate,
Total,
Ratio,
Pressure,
Count,
Mode,
Undefined,
};
std::string keyword;
Category category;
Type type;
std::string wgname;
int number;
std::string fip_region;
constexpr static int default_number { std::numeric_limits<int>::min() };
std::string unique_key() const;
using number_renderer = std::function<std::string(const SummaryNode&)>;
std::string unique_key(number_renderer) const;
bool is_user_defined() const;
static Category category_from_keyword(const std::string&, const std::unordered_set<std::string> &miscellaneous_keywords = {});
std::optional<std::string> display_name() const;
std::optional<std::string> display_number() const;
std::optional<std::string> display_number(number_renderer) const;
};
}} // namespace Opm::EclIO
#endif // OPM_IO_SUMMARYNODE_HPP

View File

@@ -0,0 +1,70 @@
/*
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, std::size_t rst_index, int nsconz, const int* icon, const float* scon, const double *xcon);
static double inverse_peaceman(double cf, double kh, double rw, double skin);
std::size_t rst_index;
std::array<int,3> ijk;
Connection::State state;
int drain_sat_table;
int imb_sat_table;
int completion;
Connection::Direction dir;
int segment;
Connection::CTFKind cf_kind;
float skin_factor;
float cf;
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;
double r0;
};
}
}
#endif

View File

@@ -0,0 +1,92 @@
/*
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 RstHeader& header,
const std::string* zwel,
const int * igrp,
const float * sgrp,
const double * xgrp);
std::string name;
int parent_group;
int prod_cmode;
int winj_cmode;
int ginj_cmode;
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 voidage_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,133 @@
/*
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 {
class UnitSystem;
namespace RestartIO {
struct RstHeader {
RstHeader(const UnitSystem& unit_system, 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;
int nwgmax;
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;
bool group_control_active;
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 guide_rate_delay;
double guide_rate_damping;
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, int segment_number, 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,103 @@
/*
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>
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Tuning.hpp>
namespace Opm {
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);
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;
const ::Opm::UnitSystem unit_system;
RstHeader header;
std::vector<RstWell> wells;
std::vector<RstGroup> groups;
Tuning tuning;
private:
void load_tuning(const std::vector<int>& intehead,
const std::vector<double>& doubhead);
void add_groups(const std::vector<std::string>& zgrp,
const std::vector<int>& igrp,
const std::vector<float>& sgrp,
const std::vector<double>& xgrp);
};
}
}
#endif

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

@@ -0,0 +1,132 @@
/*
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>
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleTypes.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;
WellType wtype;
int well_status;
int active_control;
int vfp_table;
int pred_requested_control;
bool allow_xflow;
int hist_requested_control;
int msw_index;
int completion_ordering;
int pvt_table;
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;
float drainage_radius;
float efficiency_factor;
float alq_value;
double oil_rate;
double water_rate;
double gas_rate;
double liquid_rate;
double void_rate;
double thp;
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 void_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,12 +30,26 @@ namespace Json {
class JsonObject {
public:
explicit JsonObject(const boost::filesystem::path& jsonFile );
JsonObject();
explicit JsonObject(const Opm::filesystem::path& jsonFile );
explicit JsonObject(const std::string& inline_json);
explicit JsonObject(const char * inline_json);
explicit JsonObject(cJSON * root);
~JsonObject();
void add(double value);
void add(int value);
void add(const std::string& value);
JsonObject add_array();
JsonObject add_object();
void add_item(const std::string& key, double value);
void add_item(const std::string& key, int value);
void add_item(const std::string& key, const std::string& value);
JsonObject add_array(const std::string& key);
JsonObject add_object(const std::string& key);
std::string dump() const;
bool has_item(const std::string& key) const;
JsonObject get_array_item( size_t index ) const;
JsonObject get_item(const std::string& key) const;

View File

@@ -0,0 +1,76 @@
/*
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 fluxRate; //< Aquifer influx rate (liquid aquifer)
// TODO: volume should have a better name, since meaning not clear
double volume; //< Produced liquid volume
double initPressure; //< Aquifer's initial pressure
double datumDepth; //< Aquifer's pressure reference depth
AquiferType type;
std::shared_ptr<FetkovichData> aquFet;
double get(const std::string& key) const
{
if ( key == "AAQR" ) {
return this->fluxRate;
} else if ( key == "AAQT" ) {
return this->volume;
} else if ( key == "AAQP" ) {
return this->pressure;
}
return 0.;
}
};
// TODO: not sure what extension we will need
using Aquifers = std::map<int, AquiferData>;
}} // Opm::data
#endif // OPM_OUTPUT_AQUIFER_HPP

View File

@@ -36,10 +36,10 @@ namespace data {
from the TargetType enum which indicates why they they have been
added to the container - and where they are headed.
RESTART_SOLUTION : Fields which represent primary variables, and
are reqired for restart. Typically pressure and
suturation. WIll end up in the SOLUTION section of the restart
file.
RESTART_SOLUTION : Cell-based quantities that are output to the
SOLUTION section of the restart file. ECLIPSE-compatible names.
Many, but not necessarily all, of these quantities are required
for restarting the simulator.
RESTART_AUXILIARY : Fields with extra information, not required
for restart. Examples of this include fluid in place values or
@@ -52,6 +52,10 @@ namespace data {
will not be output anywhere else.
INIT : Fields which should go to the INIT file.
RESTART_OPM_EXTENDED: Cell-based quantities that are specific to
OPM-Flow. Output only to extended OPM restart files. Specifically
not output to ECLIPSE-compatible restart files.
*/
@@ -60,6 +64,7 @@ namespace data {
RESTART_AUXILIARY,
SUMMARY,
INIT,
RESTART_OPM_EXTENDED,
};
/**
@@ -69,6 +74,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;
}
};
}

224
opm/output/data/Groups.hpp Normal file
View File

@@ -0,0 +1,224 @@
/*
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/>.
*/
#ifndef OPM_OUTPUT_GROUPS_HPP
#define OPM_OUTPUT_GROUPS_HPP
#include <cstddef>
#include <map>
#include <stdexcept>
#include <string>
#include <utility>
#include <vector>
#include <opm/output/data/GuideRateValue.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp>
namespace Opm { namespace data {
struct GroupConstraints {
Opm::Group::ProductionCMode currentProdConstraint;
Opm::Group::InjectionCMode currentGasInjectionConstraint;
Opm::Group::InjectionCMode currentWaterInjectionConstraint;
template <class MessageBufferType>
void write(MessageBufferType& buffer) const;
template <class MessageBufferType>
void read(MessageBufferType& buffer);
bool operator==(const GroupConstraints& other) const
{
return this->currentProdConstraint == other.currentProdConstraint &&
this->currentGasInjectionConstraint == other.currentGasInjectionConstraint &&
this->currentWaterInjectionConstraint == other.currentWaterInjectionConstraint;
}
inline GroupConstraints& set(Opm::Group::ProductionCMode cpc,
Opm::Group::InjectionCMode cgic,
Opm::Group::InjectionCMode cwic);
};
struct GroupGuideRates {
GuideRateValue production{};
GuideRateValue injection{};
template <class MessageBufferType>
void write(MessageBufferType& buffer) const
{
this->production.write(buffer);
this->injection .write(buffer);
}
template <class MessageBufferType>
void read(MessageBufferType& buffer)
{
this->production.read(buffer);
this->injection .read(buffer);
}
bool operator==(const GroupGuideRates& other) const
{
return this->production == other.production
&& this->injection == other.injection;
}
};
struct GroupData {
GroupConstraints currentControl;
GroupGuideRates guideRates{};
template <class MessageBufferType>
void write(MessageBufferType& buffer) const
{
this->currentControl.write(buffer);
this->guideRates .write(buffer);
}
template <class MessageBufferType>
void read(MessageBufferType& buffer)
{
this->currentControl.read(buffer);
this->guideRates .read(buffer);
}
bool operator==(const GroupData& other) const
{
return this->currentControl == other.currentControl
&& this->guideRates == other.guideRates;
}
};
struct NodeData {
double pressure { 0.0 };
template <class MessageBufferType>
void write(MessageBufferType& buffer) const
{
buffer.write(this->pressure);
}
template <class MessageBufferType>
void read(MessageBufferType& buffer)
{
buffer.read(this->pressure);
}
bool operator==(const NodeData& other) const
{
return this->pressure == other.pressure;
}
};
class GroupAndNetworkValues {
public:
std::map<std::string, GroupData> groupData {};
std::map<std::string, NodeData> nodeData {};
template <class MessageBufferType>
void write(MessageBufferType& buffer) const
{
this->writeMap(this->groupData, buffer);
this->writeMap(this->nodeData, buffer);
}
template <class MessageBufferType>
void read(MessageBufferType& buffer)
{
this->readMap(buffer, this->groupData);
this->readMap(buffer, this->nodeData);
}
bool operator==(const GroupAndNetworkValues& other) const
{
return (this->groupData == other.groupData)
&& (this->nodeData == other.nodeData);
}
void clear()
{
this->groupData.clear();
this->nodeData.clear();
}
private:
template <class MessageBufferType, class ValueType>
void writeMap(const std::map<std::string, ValueType>& map,
MessageBufferType& buffer) const
{
const unsigned int size = map.size();
buffer.write(size);
for (const auto& [name, elm] : map) {
buffer.write(name);
elm .write(buffer);
}
}
template <class MessageBufferType, class ValueType>
void readMap(MessageBufferType& buffer,
std::map<std::string, ValueType>& map)
{
unsigned int size;
buffer.read(size);
for (std::size_t i = 0; i < size; ++i) {
std::string name;
buffer.read(name);
auto elm = ValueType{};
elm.read(buffer);
map.emplace(name, std::move(elm));
}
}
};
/* IMPLEMENTATIONS */
template <class MessageBufferType>
void GroupConstraints::write(MessageBufferType& buffer) const {
buffer.write(this->currentProdConstraint);
buffer.write(this->currentGasInjectionConstraint);
buffer.write(this->currentWaterInjectionConstraint);
}
template <class MessageBufferType>
void GroupConstraints::read(MessageBufferType& buffer) {
buffer.read(this->currentProdConstraint);
buffer.read(this->currentGasInjectionConstraint);
buffer.read(this->currentWaterInjectionConstraint);
}
inline GroupConstraints&
GroupConstraints::set(Opm::Group::ProductionCMode cpc,
Opm::Group::InjectionCMode cgic,
Opm::Group::InjectionCMode cwic)
{
this->currentGasInjectionConstraint = cgic;
this->currentWaterInjectionConstraint = cwic;
this->currentProdConstraint = cpc;
return *this;
}
}} // Opm::data
#endif //OPM_OUTPUT_GROUPS_HPP

View File

@@ -0,0 +1,156 @@
/*
Copyright (c) 2020 Equinor ASA
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_OUTPUT_DATA_GUIDERATEVALUE_HPP
#define OPM_OUTPUT_DATA_GUIDERATEVALUE_HPP
#include <array>
#include <bitset>
#include <cstddef>
#include <stdexcept>
#include <string>
namespace Opm { namespace data {
class GuideRateValue {
public:
enum class Item : std::size_t {
Oil, Gas, Water, ResV,
// -- Must be last enumerator --
NumItems,
};
void clear()
{
this->mask_.reset();
this->value_.fill(0.0);
}
constexpr bool has(const Item p) const
{
const auto i = this->index(p);
return (i < Size) && this->mask_[i];
}
bool operator==(const GuideRateValue& vec) const
{
return (this->mask_ == vec.mask_)
&& (this->value_ == vec.value_);
}
double get(const Item p) const
{
if (! this->has(p)) {
throw std::invalid_argument {
"Request for Unset Item Value for " + this->itemName(p)
};
}
return this->value_[ this->index(p) ];
}
GuideRateValue& set(const Item p, const double value)
{
const auto i = this->index(p);
if (i >= Size) {
throw std::invalid_argument {
"Cannot Assign Item Value for Unsupported Item '"
+ this->itemName(p) + '\''
};
}
this->mask_.set(i);
this->value_[i] = value;
return *this;
}
GuideRateValue& operator+=(const GuideRateValue& rhs)
{
for (auto i = 0*Size; i < Size; ++i) {
if (rhs.mask_[i]) {
this->mask_.set(i);
this->value_[i] += rhs.value_[i];
}
}
return *this;
}
template <class MessageBufferType>
void write(MessageBufferType& buffer) const
{
auto maskrep = this->mask_.to_ullong();
buffer.write(maskrep);
for (const auto& x : this->value_) {
buffer.write(x);
}
}
template <class MessageBufferType>
void read(MessageBufferType& buffer)
{
this->clear();
{
auto mask = 0ull;
buffer.read(mask);
this->mask_ = std::bitset<Size>(mask);
}
for (auto& x : this->value_) {
buffer.read(x);
}
}
private:
enum { Size = static_cast<std::size_t>(Item::NumItems) };
std::bitset<Size> mask_{};
std::array<double, Size> value_{};
constexpr std::size_t index(const Item p) const noexcept
{
return static_cast<std::size_t>(p);
}
std::string itemName(const Item p) const
{
switch (p) {
case Item::Oil: return "Oil";
case Item::Gas: return "Gas";
case Item::Water: return "Water";
case Item::ResV: return "ResV";
case Item::NumItems:
return "Out of bounds (NumItems)";
}
return "Unknown (" + std::to_string(this->index(p)) + ')';
}
};
}} // namespace Opm::data
#endif // OPM_OUTPUT_DATA_GUIDERATEVALUE_HPP

View File

@@ -30,6 +30,10 @@
#include <unordered_map>
#include <vector>
#include <opm/output/data/GuideRateValue.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
namespace Opm {
namespace data {
@@ -64,6 +68,8 @@ namespace Opm {
well_potential_water = (1 << 14),
well_potential_oil = (1 << 15),
well_potential_gas = (1 << 16),
brine = (1 << 17),
alq = (1 << 18)
};
using enum_size = std::underlying_type< opt >::type;
@@ -82,14 +88,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;
@@ -113,11 +121,13 @@ namespace Opm {
double well_potential_water = 0.0;
double well_potential_oil = 0.0;
double well_potential_gas = 0.0;
double brine = 0.0;
double alq = 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;
@@ -127,6 +137,19 @@ namespace Opm {
double cell_saturation_water;
double cell_saturation_gas;
double effective_Kh;
double trans_factor;
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;
@@ -134,11 +157,91 @@ namespace Opm {
void read(MessageBufferType& buffer);
};
class SegmentPressures {
public:
enum class Value : std::size_t {
Pressure, PDrop, PDropHydrostatic, PDropAccel, PDropFriction,
};
double& operator[](const Value i)
{
return this->values_[this->index(i)];
}
double operator[](const Value i) const
{
return this->values_[this->index(i)];
}
bool operator==(const SegmentPressures& segpres2) const
{
return this->values_ == segpres2.values_;
}
template <class MessageBufferType>
void write(MessageBufferType& buffer) const
{
for (const auto& value : this->values_) {
buffer.write(value);
}
}
template <class MessageBufferType>
void read(MessageBufferType& buffer)
{
for (auto& value : this->values_) {
buffer.read(value);
}
}
private:
constexpr static std::size_t numvals = 5;
std::array<double, numvals> values_;
std::size_t index(const Value ix) const
{
return static_cast<std::size_t>(ix);
}
};
struct Segment {
Rates rates;
double pressure;
SegmentPressures pressures;
std::size_t segNumber;
bool operator==(const Segment& seg2) const
{
return rates == seg2.rates &&
pressures == seg2.pressures &&
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;
@@ -154,11 +257,51 @@ namespace Opm {
int control;
std::vector< Connection > connections;
std::unordered_map<std::size_t, Segment> segments;
CurrentControl current_control;
GuideRateValue guide_rates{};
inline bool flowing() const noexcept;
template <class MessageBufferType>
void write(MessageBufferType& buffer) const;
template <class MessageBufferType>
void read(MessageBufferType& buffer);
const Connection* find_connection(Connection::global_index connection_grid_index) const {
const auto connection = std::find_if( this->connections.begin() ,
this->connections.end() ,
[=]( const Connection& c ) {
return c.index == connection_grid_index; });
if( connection == this->connections.end() )
return nullptr;
return &*connection;
}
Connection* find_connection(Connection::global_index connection_grid_index) {
auto connection = std::find_if( this->connections.begin() ,
this->connections.end() ,
[=]( const Connection& c ) {
return c.index == connection_grid_index; });
if( connection == this->connections.end() )
return nullptr;
return &*connection;
}
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 &&
guide_rates == well2.guide_rates;
}
};
@@ -213,10 +356,9 @@ namespace Opm {
this->emplace(name, well);
}
}
};
using Wells = WellRates;
using Wells = WellRates;
/* IMPLEMENTATIONS */
@@ -252,6 +394,30 @@ 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 &&
brine == rate.brine &&
alq == rate.alq;
}
/*
* To avoid error-prone and repetitve work when extending rates with new
@@ -281,6 +447,8 @@ namespace Opm {
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;
case opt::brine: return this->brine;
case opt::alq: return this->alq;
}
throw std::invalid_argument(
@@ -296,12 +464,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>
@@ -324,6 +495,8 @@ namespace Opm {
buffer.write(this->well_potential_water);
buffer.write(this->well_potential_oil);
buffer.write(this->well_potential_gas);
buffer.write(this->brine);
buffer.write(this->alq);
}
template <class MessageBufferType>
@@ -336,13 +509,26 @@ namespace Opm {
buffer.write(this->cell_saturation_water);
buffer.write(this->cell_saturation_gas);
buffer.write(this->effective_Kh);
buffer.write(this->trans_factor);
}
template <class MessageBufferType>
void Segment::write(MessageBufferType& buffer) const {
buffer.write(this->segNumber);
this->rates.write(buffer);
buffer.write(this->pressure);
this->pressures.write(buffer);
}
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>
@@ -366,6 +552,9 @@ namespace Opm {
seg.second.write(buffer);
}
}
this->current_control.write(buffer);
this->guide_rates.write(buffer);
}
template <class MessageBufferType>
@@ -388,6 +577,8 @@ namespace Opm {
buffer.read(this->well_potential_water);
buffer.read(this->well_potential_oil);
buffer.read(this->well_potential_gas);
buffer.read(this->brine);
buffer.read(this->alq);
}
template <class MessageBufferType>
@@ -400,13 +591,26 @@ namespace Opm {
buffer.read(this->cell_saturation_water);
buffer.read(this->cell_saturation_gas);
buffer.read(this->effective_Kh);
buffer.read(this->trans_factor);
}
template <class MessageBufferType>
void Segment::read(MessageBufferType& buffer) {
buffer.read(this->segNumber);
this->rates.read(buffer);
buffer.read(this->pressure);
this->pressures.read(buffer);
}
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>
@@ -443,6 +647,9 @@ namespace Opm {
const auto segNumber = seg.segNumber;
this->segments.emplace(segNumber, std::move(seg));
}
this->current_control.read(buffer);
this->guide_rates.read(buffer);
}
}} // Opm::data

View File

@@ -0,0 +1,127 @@
/*
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;
namespace Action {
class State;
}
} // 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::Action::State& action_state,
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

@@ -23,7 +23,7 @@
#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>
@@ -32,7 +32,8 @@
namespace Opm {
class Schedule;
class SummaryState;
class Group2;
//class Group;
class UnitSystem;
} // Opm
namespace Opm { namespace RestartIO { namespace Helpers {
@@ -42,10 +43,11 @@ class AggregateGroupData
public:
explicit AggregateGroupData(const std::vector<int>& inteHead);
void captureDeclaredGroupData(const Opm::Schedule& sched,
const std::size_t simStep,
const Opm::SummaryState& sumState,
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
{
@@ -70,14 +72,18 @@ public:
const std::vector<std::string> restart_group_keys = {"GOPP", "GWPP", "GOPR", "GWPR", "GGPR",
"GVPR", "GWIR", "GGIR", "GWCT", "GGOR",
"GOPT", "GWPT", "GGPT", "GVPT", "GWIT",
"GGIT",
"GGIT", "GVIT",
"GOPTH", "GWPTH", "GGPTH",
"GWITH", "GGITH"};
"GWITH", "GGITH",
"GOPGR", "GWPGR", "GGPGR", "GVPGR",
"GOIGR", "GWIGR", "GGIGR",
};
// Note: guide rates don't exist at the FIELD level.
const std::vector<std::string> restart_field_keys = {"FOPP", "FWPP", "FOPR", "FWPR", "FGPR",
"FVPR", "FWIR", "FGIR", "FWCT", "FGOR",
"FOPT", "FWPT", "FGPT", "FVPT", "FWIT",
"FGIT",
"FGIT", "FVIT",
"FOPTH", "FWPTH", "FGPTH",
"FWITH", "FGITH"};
@@ -96,14 +102,55 @@ public:
{"GVPT", 13},
{"GWIT", 15},
{"GGIT", 16},
{"GVIT", 17},
{"GOPP", 22},
{"GWPP", 23},
{"GOPGR", 85},
{"GWPGR", 86},
{"GGPGR", 87},
{"GVPGR", 88},
{"GOIGR", 89},
{"GWIGR", 91},
{"GGIGR", 93},
{"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},
};
// Note: guide rates don't exist at the FIELD level.
const std::map<int, inj_cmode_enum> ICntlModeToiCMode = {
{0, inj_cmode_enum::NONE},
{1, inj_cmode_enum::RATE},
{2, inj_cmode_enum::RESV},
{3, inj_cmode_enum::REIN},
{4, inj_cmode_enum::VREP}, };
using p_cmode = Opm::Group::ProductionCMode;
const std::map<int, p_cmode> PCntlModeToPCMode = {
{0, p_cmode::NONE},
{1, p_cmode::ORAT},
{2, p_cmode::WRAT},
{3, p_cmode::GRAT},
{4, p_cmode::LRAT},
{9, p_cmode::CRAT},
{5, p_cmode::RESV},
{6, p_cmode::PRBL},
};
const std::map<std::string, size_t> fieldKeyToIndex = {
{"FOPR", 0},
@@ -120,6 +167,7 @@ public:
{"FVPT", 13},
{"FWIT", 15},
{"FGIT", 16},
{"FVIT", 17},
{"FOPP", 22},
{"FWPP", 23},
{"FOPTH", 135},

View File

@@ -41,6 +41,7 @@ namespace Opm {
class Schedule;
class UDQInput;
class UDQActive;
class UDQState;
} // Opm
namespace Opm { namespace RestartIO { namespace Helpers {
@@ -57,7 +58,7 @@ public:
void captureDeclaredUDQData(const Opm::Schedule& sched,
const std::size_t simStep,
const Opm::SummaryState& st,
const Opm::UDQState& udqState,
const std::vector<int>& inteHead);
const std::vector<int>& getIUDQ() const
@@ -94,12 +95,12 @@ void captureDeclaredUDQData(const Opm::Schedule& sched,
{
return this->dUDW_.data();
}
const std::vector<double>& getDUDG() const
{
return this->dUDG_.data();
}
const std::vector<double>& getDUDF() const
{
return this->dUDF_.data();
@@ -127,10 +128,10 @@ private:
/// 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_;

View File

@@ -23,6 +23,7 @@
#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>
@@ -32,6 +33,9 @@ namespace Opm {
class Schedule;
class SummaryState;
class UnitSystem;
namespace Action {
class State;
}
} // Opm
namespace Opm { namespace data {
@@ -45,11 +49,12 @@ namespace Opm { namespace RestartIO { namespace Helpers {
public:
explicit AggregateWellData(const std::vector<int>& inteHead);
void captureDeclaredWellData(const Schedule& sched,
const UnitSystem& units,
const std::size_t sim_step,
const ::Opm::SummaryState& smry,
const std::vector<int>& inteHead);
void captureDeclaredWellData(const Schedule& sched,
const UnitSystem& units,
const std::size_t sim_step,
const ::Opm::Action::State& action_state,
const ::Opm::SummaryState& smry,
const std::vector<int>& inteHead);
void captureDynamicWellData(const Opm::Schedule& sched,
const std::size_t sim_step,
@@ -80,8 +85,8 @@ namespace Opm { namespace RestartIO { namespace Helpers {
return this->zWell_.data();
}
private:
/// Aggregate 'IWEL' array (Integer) for all wells.
WindowedArray<int> iWell_;

View File

@@ -25,7 +25,7 @@
#include <vector>
namespace Opm {
class Tuning;
struct Tuning;
class Schedule;
class UDQParams;
}
@@ -39,7 +39,18 @@ namespace Opm { namespace RestartIO {
std::chrono::time_point<std::chrono::system_clock> start;
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;
@@ -50,7 +61,6 @@ 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);
@@ -59,8 +69,9 @@ namespace Opm { namespace RestartIO {
DoubHEAD& drsdt(const Schedule& sched,
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

@@ -45,7 +45,8 @@ class EclipseState;
class Schedule;
class SummaryConfig;
class SummaryState;
class UDQState;
namespace Action { class State; }
/*!
* \brief A class to write the reservoir state and the well state of a
* blackoil simulation to disk using the Eclipse binary format.
@@ -174,7 +175,9 @@ public:
* hardcoded static map misc_units in Summary.cpp.
*/
void writeTimeStep( const SummaryState& st,
void writeTimeStep( const Action::State& action_state,
const SummaryState& st,
const UDQState& udq_state,
int report_step,
bool isSubstep,
double seconds_elapsed,
@@ -220,7 +223,7 @@ 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(SummaryState& summary_state, const std::vector<RestartKey>& solution_keys, const std::vector<RestartKey>& extra_keys = {}) const;
RestartValue loadRestart(Action::State& action_state, SummaryState& summary_state, const std::vector<RestartKey>& solution_keys, const std::vector<RestartKey>& extra_keys = {}) const;
const out::Summary& summary();
EclipseIO( const EclipseIO& ) = delete;

View File

@@ -25,15 +25,16 @@
#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;
@@ -85,6 +86,7 @@ namespace Opm { namespace RestartIO {
int litmin;
int mxwsit;
int mxwpit;
int wseg_mx_rst;
};
struct Group {
@@ -93,8 +95,24 @@ namespace Opm { namespace RestartIO {
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;
@@ -115,14 +133,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& 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
{

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