Compare commits

..

1120 Commits

Author SHA1 Message Date
Markus Blatt
a30fcddfd4 Update release version to final 2019.10 2019-11-18 08:59:20 +01:00
Markus Blatt
edbf93e762 Bump version to 2019.10-rc4 2019-11-11 20:45:19 +01:00
Markus Blatt
f8e6aa595b Merge pull request #1215 from blattms/backport-of-pr-1068
improvements related to Aquifer modeling (Backport of pr #1068)
2019-11-11 20:03:31 +01:00
Kai Bao
78a2aa5c3e addressing reviewing comments from PR #1068 2019-11-11 14:46:00 +01:00
Kai Bao
109c9bb256 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-11-11 14:44:53 +01:00
Kai Bao
d9968f6380 correcting the definition of keyword AQUFETP
default_value looks like not working in term of specifying default value
for the item.
2019-11-11 12:52:15 +01:00
Markus Blatt
1ba0a174db Merge pull request #1214 from blattms/backport-of-pr-1113
Apply MULTZ also in the edit section (backport of #1113)
2019-11-11 12:48:31 +01:00
Tor Harald Sandve
5b317b856b Apply MULTZ also in the edit section 2019-11-11 10:01:07 +01:00
Markus Blatt
ef6f42d457 Bump version to 2019.10-rc3 2019-11-04 12:34:46 +01:00
Markus Blatt
69a0a31309 Merge pull request #1183 from blattms/backport-of-pr-1176
Added changelog 2019.10 release (Backport of pr #1176)
2019-10-30 21:58:22 +01:00
Joakim Hove
3be35ec286 Add bullet point about Eclipse restart capabilities 2019-10-30 21:55:45 +01:00
Markus Blatt
0469d28fa2 Skipped python and restart in changelog 2019-10-30 21:55:45 +01:00
Markus Blatt
7cd7c7a158 Added entries to changelog concerning 2019.10 release 2019-10-30 21:55:45 +01:00
Markus Blatt
7bc1fc8362 Merge pull request #1172 from blattms/backport-of-pr-1171
update redhat packaging (backport of PR #1171)
2019-10-28 12:38:13 +01:00
Arne Morten Kvarving
b573c28594 update redhat packaging 2019-10-28 12:36:22 +01:00
Markus Blatt
693c4607c8 Merge pull request #1161 from akva2/2019.10_rc2
bump version to 2019.10-rc2
2019-10-25 14:06:59 +02:00
Arne Morten Kvarving
1c17a5daed bump version to 2019.10-rc2 2019-10-25 08:33:05 +02:00
Markus Blatt
edee59df30 Merge pull request #1160 from blattms/backport-of-pr-1158
Keywords on Q (backport of PR #1158)
2019-10-24 19:51:01 +02:00
Joakim Hove
c5fcbf2084 Keywords on Q 2019-10-24 19:38:43 +02:00
Markus Blatt
8e860c4b7a Merge pull request #1159 from blattms/backport-of-pr-1154
added more keywords beginning with M. (backport of #1154)
2019-10-24 19:37:42 +02:00
Steinar Foss
ad9fbfe4ea added more keywords beginning with M.
added keywords MULTOUTS, MULTREAL, MULTREGD.

added keywords MULTREGH, MULTSIG, MULTSIGV.

added keywords NARROW, NCONSUMP, NEFAC.
2019-10-24 19:22:54 +02:00
Markus Blatt
53fff6bb3f Merge pull request #1155 from blattms/backport-of-pr-1149
fixing severe performance issue with ESmry (backport of PR #1149)
2019-10-24 13:08:01 +02:00
Torbjørn Skille
8e23316eba fixing severe performance issue with ESmry 2019-10-24 12:07:39 +02:00
Markus Blatt
d4e6c9ec44 Merge pull request #1147 from blattms/backport-of-pr-1142
Multiply MULT(XYZ) keywords in the EDIT section (backport of #1142)
2019-10-22 19:58:36 +02:00
Joakim Hove
ae9712232e Multiply MULT(XYZ) keywords in the EDIT section 2019-10-22 19:43:34 +02:00
Markus Blatt
d376ee9ed4 Merge pull request #1140 from blattms/backport-of-pr-1128
Exc warning (Backport of pr #1128)
2019-10-21 08:48:32 +02:00
Joakim Hove
1067b66696 Use const& to avoiw warnings 2019-10-21 08:44:17 +02:00
Joakim Hove
ac43482944 Remove trailing whitespace 2019-10-21 08:44:17 +02:00
Markus Blatt
3ca39f2e62 Merge pull request #1139 from blattms/backport-of-pr-1096
Some janitoring (partial backport of pr #1096)
2019-10-21 08:36:27 +02:00
Arne Morten Kvarving
aaaa22e279 remove noop explicit template instantation after specialization 2019-10-21 08:29:19 +02:00
Arne Morten Kvarving
646d263883 avoid returning uninitialized result if wrong indices are given 2019-10-21 08:29:19 +02:00
Arne Morten Kvarving
f1e0dcea81 remove unused assignment 2019-10-21 08:29:19 +02:00
Arne Morten Kvarving
7b3b26c452 remove unused initialization 2019-10-21 08:29:19 +02:00
Arne Morten Kvarving
5f9d67a6eb remove unused variable 2019-10-21 08:27:35 +02:00
Arne Morten Kvarving
8e44ca1b2c remove unused function 2019-10-21 08:27:35 +02:00
Markus Blatt
89e2ebd5f9 Merge pull request #1137 from blattms/backport-of-pr-1119
Added keywords beginning w/ M. (backport of PR #1119)
2019-10-21 07:55:12 +02:00
Steinar Foss
06287e8631 Added keywords beginning w/ M.
added keywords MINPORV, MLANG, MLANGSLV.
2019-10-20 12:13:36 +02:00
Markus Blatt
4cd26c5f9a Merge pull request #1136 from blattms/backport-of-pr-1101
Add keywords starting with R (backport of #1101)
2019-10-20 12:11:00 +02:00
Joakim Hove
d4ce9fe909 Add keywords starting with R 2019-10-20 11:23:17 +02:00
Markus Blatt
7ee05a9ceb Merge pull request #1135 from blattms/backport-of-pr-1109
added keywords beginning w/ L. (backport of #1099)
2019-10-20 11:20:48 +02:00
Steinar Foss
8a9814ad16 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-20 11:17:45 +02:00
Markus Blatt
96b7bb65e2 Merge pull request #1134 from blattms/backport-of-pr-1099
added keywords beginning w/ I, J, K and L. (backport of PR #1099)
2019-10-20 11:09:25 +02:00
Steinar Foss
4761fe724b 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-20 10:53:29 +02:00
Markus Blatt
8488efde1f Merge pull request #1126 from blattms/backport-of-pr-1125
Fix memory error during EclipseGrid creation with Actnum. (backport PR #1125)
2019-10-17 20:29:25 +02:00
Markus Blatt
3a89d05646 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 20:26:55 +02:00
Markus Blatt
0d3037383a Merge pull request #1120 from blattms/backport-of-pr-1116
fixed: build using gcc 5 (ubuntu xenial) (backport of PR #1116
2019-10-17 13:25:35 +02:00
Arne Morten Kvarving
de67ce4083 fixed: build using gcc 5 (ubuntu xenial)
the tuple-from-initializer-list constructor is explicit.
2019-10-17 13:21:25 +02:00
Markus Blatt
0fadb026af Merge pull request #1118 from blattms/backport-of-pr-1107
Decouple OPM Flow From Libecl  (Backport of pr #1107)
2019-10-17 13:08:52 +02:00
Bård Skaflestad
fe275a55fd Drop libecl From Python Setup
Suggested by [at]akva2.
2019-10-17 12:21:53 +02:00
Arne Morten Kvarving
a44febc314 remove libecl from buildsystem, jenkins and packaging 2019-10-17 12:21:53 +02:00
Bård Skaflestad
895c43dff0 Reimplement test_Restart in Terms of TimeStampUTC
Only affects the 'first_sim()' helper function.
2019-10-17 11:53:15 +02:00
Bård Skaflestad
e2ca798005 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-17 11:53:15 +02:00
Bård Skaflestad
8fa07537fc 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-17 11:53:15 +02:00
Bård Skaflestad
7f9d250fd3 Reimplement TimeMap in Terms of TimeStampUTC 2019-10-17 11:53:15 +02:00
Bård Skaflestad
5eab9b003f 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-17 11:53:15 +02:00
Bård Skaflestad
14625b3279 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-17 11:53:15 +02:00
Bård Skaflestad
3cb23e6857 Reimplement 'test_EclipseIO' in Terms of Opm-Common Classes
In particular, use EGrid, ERst and EclFile as appropriate.
2019-10-17 11:53:15 +02:00
Markus Blatt
f8f1efc0ac Merge pull request #1111 from blattms/backport-of-pr-1110
Allow building a module with dependencies installed (backport of #1110)
2019-10-16 13:56:12 +02:00
Markus Blatt
6d92c1f5de 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 13:52:47 +02:00
Markus Blatt
c68ec9c28b Merge pull request #1108 from blattms/backport-of-pr-1092
Update of ESmry, now supporting non-unified result files. (backport of PR #1092)
2019-10-16 09:47:38 +02:00
Torbjørn Skille
2dd6400d06 Update of ESmry, now supporting non-unified result files. 2019-10-16 09:12:02 +02:00
Markus Blatt
aa10ded01a Merge pull request #1104 from blattms/backport-of-pr-1094
Make RestartKey default contructable. (Backport of #1094)
2019-10-14 22:13:54 +02:00
Markus Blatt
edaa5ae561 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 21:46:43 +02:00
Markus Blatt
aa56a40e8d Merge pull request #1103 from blattms/backport-pr-1088
Backport of pr #1088
2019-10-14 21:43:00 +02:00
Bård Skaflestad
2d7ba6a3c9 INTEHEAD Test: Initialize Maximum Number of Wells in Field
Fixes a warning about missing initializers.
2019-10-14 21:38:32 +02:00
Bård Skaflestad
6c397ff2a8 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 21:29:27 +02:00
Bård Skaflestad
c83feddb28 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 21:29:27 +02:00
Bård Skaflestad
6d9deefb29 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 21:29:27 +02:00
Bård Skaflestad
afaa99d3f4 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 21:29:27 +02:00
Bård Skaflestad
c69a111e7a 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 21:29:27 +02:00
Markus Blatt
112e698d0a Merge pull request #1102 from blattms/backport-pr-1082
Backport PR #1082
2019-10-14 21:12:11 +02:00
Bård Skaflestad
7dffd9f2e7 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-14 20:47:36 +02:00
Bård Skaflestad
a3f2c115f1 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-14 20:47:36 +02:00
Joakim Hove
32ac0034a7 Merge pull request #1091 from stefoss23/deck_keyword_vector
deckkeyword: new constructors takes (ParserKeyword, std::vector).
2019-10-11 20:04:50 +02:00
Steinar Foss
17f246c1a7 deckkeyword: new constructors takes (ParserKeyword, std::vector).
DeckKeyword: test for vector<int> data constructor.

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

...

...

...

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

removed shedule.py.

test_connection.py passed.

test_wells.py: test_completion passes.

removed opm.io.config.

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

added keyword HMxxxxxx.

added keywords HRFIN, HWKRO, HWKRORH.

added keywords HWKRORW, HWKRWM HWKRWR.

added keyword HWPCW.

added keywords HWSNUM, HWSOGCR, HWSOWCR.

added keyword HWSWCR.

added keywords HWSWL, HWSWLPC, HWSWU.

added keywords HXFIN, HYDRHEAD, HYFIN.

added keywords HYMOBGDR, HYST, HYSTCHCK.

added keyword HZFIN.

added keywords IHOST, IMBNUMMF, IMPCVD.

IMPLICIT, IMPORT, IMSPCVD.

added keywords INSPEC, INTPC, IONROCK.

added keywords IONXROCK, IONXSURF.

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

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

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

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

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

...

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

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

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

Log use of UDA for output purposes

Output UDQ keywords to restart file

Add size() method to UDQConfig

Add UDQVarTYpe member to UDQInput class

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

Add unit to UDQInput class

use maps

Add operator[] to UDQConfig class

Use UDQInput class when creating restart file

UDQInput: use correct input index

Add UDQActive::get() method

Make sure UDQ DEFINE overwrite correctly

WIP

WIP - further code to output IGPH vector

WIP

Fix IUAD input index

Output use_index for IUAD

Fix bug with size of IUAD array

UAD usage hashing based on udqstring and controltype

Add UDQ test and input file

Refactor UDQActive - handles vanishing UDA

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

Further work for making unit tests for UDQ restart data

WIP Further work unit tests

WIP some minor corrections

WIP changes to add first version of BOOST test for IUDQ

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

Further added unit tests to the writing of UDQ data

add code to output IUAP array

Fixed group-group2 transition, disable Restart output

WIP Initial changes to add DUDW array to restart output

WIP further work on DUDW data

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

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

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

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

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

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

DeckKeyword: invalid arg for wrong nr. of records.

DeckValue: type_tag replaces DeckValueEnum.

DeckValue: added as source for genkw.

DeckValue: default is unknown type.

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

DeckKeyword: added function add_deckvalue.

.. xx --

...

...

...

...

...

...

...

DeckValue: is<double> true also if integer.

...

...

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

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

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

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

added keywords GTMULT, GUIDECAL, GUPFREQ.

added keyword GWRTWC.

added keywords HALFTRAN, HMPROPS.

added keywords HAxxxxxx, HBNUM, HDISP.

added keywords HMADUCT, HMAQUFET, HMAQUNUM.

added keywords HDIMS, HMFAULTS, FMNLAQUN.

added keywords HMMLCTAW, HMMLFTAQ, HMMLTWCN.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

added keywords GDIMS, GDRILPOT.

added keywords GETGLOB, GI.

added keywords GIMODEL, GINODE, GLIFTLIM.

added keywords GNETDP, GNETPUMP.

added keywords GRADGRUP, GRADRESV.

added keywords GRADRFT, GRADWELL, GRAVCONS.

added keywords GRAVDR, GRAVDRB, GRAVDRM.

keyword GRACONS set to size unlimited.

added keyword GRDREACH.

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

python parserkeyword: removed create_deckkeyword.

DeckKeyword: member parser_keyword is shared_ptr.

python DeckKeyword constructor.

python: no exposure of ParserKeyword.

DeckKeyword: shared_ptr<ParserKeyword> -> ParskerKeyword.

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

test_parser.py: simplified test_pyinut.

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

python: added constructor for Schedule.

test_schedule: reintroduced most tests.

python test_schedule: all test works.

python test_wells. opened up some tests.

test_wells: opened up most.

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

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

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

    bool Schedule::hasGroup(groupName, timeStep)

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

    Schedule::getGroup2(groupName, timeStep)

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

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

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

    void Opm::RftIO::write()

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

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

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

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

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

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

added keywords FOAMMOBP.

added keywords FOAMOBS, FORMFEED.

added keywords GASBEGIN, GASCONC.

added keywords GASEND, GASFCOMP.

added keywords GASFDECR, GASFDELC.

added keywords GASFIELD, GASFTARG.

added keywords GASMONTH, GASPERIO.

added keywords GASSATC, GASYEAR.

added keyword GCALECON.

added keywords GCONCAL, GCONENG.

added keyword GCONCAL.

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

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

added keyword ENPCVD.

added keyword ENSPCVD.

added keyword EPSDBGS.

added keyword EPSDEBUG.

added keyword EQLZCORN.

added keyword ESSNODE.

added keyword EXCAVATE.

added keyword EXTFIN.

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

added pythonclass ParserKW.

python acces to ParserKW.

removed wrong kw PYINPUT.

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

added keyword COMPRPL.

added keyword COMPVEL.

addded keyword CSKIN.

added keyword DEPTHTAB.

added keyword DIFFCOAL.

added deck_names DIFF.

...

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

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

...

field.

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

..

GCONPROD reads meaningless GUIDE_RATE.

guide_rate_def.

..2

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

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

libsunbeam -> libopmcommon_python.

sunbeam -> opm: test_connection ok.

test_deck ok.

test_group_tree ok.

test_grupnet ok.

test_parse_deck.py ok.

test_parse.py ok.

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

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

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

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

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

WIP Further work unit tests

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

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

moved python tests to python/python.

added __init__.py under python/tests.

added 'test_' before all python test names.

test_ prefix added to tests.

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

setuptools executes from root python.

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

python tests: temp reduced to test_deck only.

python setup.py: manually linked opmcommon.

setup.py: linked ecl.

setup.py linked boost_filesystem.

setup.py: linked boost_regex.

python all tests run.

removec usr/local from setup.py ext_module.

cmake make copies entire python dir to build.

setup.py can execute from build.

setup.py executes from build/python.

python tests run under setup.py.

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

removed cmake files from sunbeam.

sunbeam: added code for install.

setup.py: removed 'import ecl'.

python/src -> python->src_sunbeam.

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

build-opm_module.sh: added prefix_path to opm.

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

setup.py: infer include directories from cmake target

CMakeLists.txt: under python: align install statement.

CMakeLists build python: removed find_package.

src_sunbeam -> cxx.

setup.py: test_suite as string.

setup.py: tests_suite -> test_suite.

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

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

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

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

    writeCellPropertiesWithDefaultFlag()
    writeCellPropertiesValuesOnly()

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

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

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

    writeSatFuncScaling()

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

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

    writeCellProperties()

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

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

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

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

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

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

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

    setPostProcessor

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

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

    Eclipse3DProperties::adjustSOGCRwithSWL

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

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

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

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

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

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

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

    EclipseIO::Impl::writeINITFile()

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

    Opm::EclIO::OutputStream::Init

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

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

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

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

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

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

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

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

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

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

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

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

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

    Opm::ecl::OutputStream::Restart

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

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

Intended use of the Restart class is

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

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

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

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

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

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

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

    ERst::restartStepWritePosition(seqnum)

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

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

    EclFile::seekPosition(arrayIndex)

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

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

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

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

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

Specifically, import the I/O classes into namespace Opm::ecl, and
place the files in physical location opm/io/eclipse, and move the
test utilities to new top-level directory 'test_util/'.  While here,
discontinue the 'testutil' static library since most of its features
are now available in the main 'opmcommon' library.  This does entail
compiling a few of the test_util/ CPP files multiple times, and
adding the objects to each executable independently.
2019-05-23 10:23:01 +02:00
Joakim Hove
464bc4b795 Merge pull request #731 from joakim-hove/remove-old-well
Remove old well
2019-05-22 23:15:58 +02:00
Joakim Hove
94b160258e Remove old well implementation 2019-05-22 21:44:50 +02:00
Bård Skaflestad
1d31de03c7 Merge pull request #765 from tskille/compareECL
update of compareECL, failes test if output file present for reference
2019-05-22 13:32:10 +02:00
Joakim Hove
ad9cc20258 Merge pull request #779 from joakim-hove/new-keywords
New keywords
2019-05-22 11:52:47 +02:00
Joakim Hove
c0ccd06250 Add keyword GCONSALE 2019-05-22 07:13:57 +02:00
Joakim Hove
eb2c0b7441 Add keyword BRANPROP 2019-05-22 07:13:57 +02:00
Joakim Hove
c986c49113 Add keyword NODEPROP 2019-05-22 07:13:57 +02:00
Joakim Hove
5a31ae874b Add keyword GUIDERAT 2019-05-22 07:13:57 +02:00
Joakim Hove
cd55d69ef7 Add keyword GCONSUMP 2019-05-22 07:13:57 +02:00
Joakim Hove
76acb98c67 Add keyword GPMAINT 2019-05-22 07:13:57 +02:00
Joakim Hove
30a1a0b26e Improve error message for invalid json 2019-05-22 07:13:57 +02:00
Joakim Hove
16dabd5dc4 Merge pull request #777 from joakim-hove/well2-prediction-mode
Add method bool Well2::predictionMode()
2019-05-21 06:52:59 +02:00
Joakim Hove
272d0fc9a1 Merge pull request #776 from joakim-hove/parse-WOPRL
Parse WOPRL
2019-05-20 16:31:35 +02:00
Joakim Hove
8231b84a11 Add method bool Well2::predictionMode() 2019-05-20 16:13:20 +02:00
Joakim Hove
c1f60b769c Split summary keywords WxxxL in separate config 2019-05-20 12:52:05 +02:00
Joakim Hove
d42e86426f Remove extra whitespace 2019-05-20 12:34:37 +02:00
Torbjørn Skille
50f907f608 update of compareECL, failes if output file present in reference folder, but not in test folder" 2019-05-10 15:07:04 +02:00
Joakim Hove
77795b5005 Add 'python/' from commit '278373703455ea6562a0f8e5278b4db46eb1fc7e'
git-subtree-dir: python
git-subtree-mainline: e8dbf7d8ee
git-subtree-split: 2783737034
2019-05-08 07:20:29 +02:00
Andrea Brambilla
2783737034 Fixed travis build status in README.md 2019-03-27 13:41:06 +01:00
Andrea Brambilla
a6587b3f68 Remove unneeded printout of gcc version in travis 2019-01-22 16:18:13 +01:00
Markus Fanebust Dregi
6ab8c9611c Add optional log argument to getWriteRestartFile 2019-01-22 16:18:13 +01:00
Markus Fanebust Dregi
249cee7766 Use gcc 4.9 for build on Travis 2019-01-22 16:18:13 +01:00
Jørgen Kvalsvik
70ba4fbc81 Run tests against opm-parser upstream HEAD 2019-01-22 16:18:13 +01:00
Jørgen Kvalsvik
93485e2aec Pass ErrorGuard to parse file/string function
The upstream signature is updated to take an error guard, which on top
of breaking the interface since no default is provided, tears down (!)
the host process on invalid input.

The way of stopping this happening is to call the clear() method after
running the parser.
2019-01-22 16:18:13 +01:00
Joakim Hove
e3e67874dd Merge pull request #91 from joakim-hove/version-0.1.2
Set __version__ to 0.1.2
2018-11-06 11:49:50 +01:00
Joakim Hove
b7fc40078b Set __version__ to 0.1.2 2018-11-06 11:18:00 +01:00
Joakim Hove
70cb7f0084 Merge pull request #90 from joakim-hove/find-boos
Use find_package(Boost ...) to find and link with Boost
2018-11-04 09:18:31 +01:00
Joakim Hove
cf7c2ee537 Use find_package(Boost ...) to find and link with Boost 2018-11-02 07:14:46 +01:00
Joakim Hove
c4b9378245 Merge pull request #89 from joakim-hove/komodo-build
Deteect DEST_PREFIX when adding lib dependencies
2018-09-21 14:17:49 +02:00
Joakim Hove
55eeb620ac Deteect DEST_PREFIX when adding lib dependencies 2018-09-21 14:16:38 +02:00
Joakim Hove
dcb4528e71 Merge pull request #88 from joakim-hove/connection-updates
Update sunbeam to use opm-common/2018.09
2018-09-19 15:12:56 +02:00
Joakim Hove
0a378bd49d Update sunbeam to use opm-common/2018.09 2018-09-17 21:34:39 +02:00
Joakim Hove
6d2a4b5daa Merge pull request #86 from Statoil/joakim-hove-patch-1
Update README.md
2018-08-25 07:25:17 +02:00
Joakim Hove
e46f3bf48a Update README.md 2018-08-25 07:24:48 +02:00
Joakim Hove
f3f702e503 Merge pull request #85 from joakim-hove/use-opm-common
Use opm-common
2018-08-09 10:41:27 +02:00
Joakim Hove
eed1309b7a Adapt to api changes in opm-common 2018-08-09 08:13:35 +02:00
Joakim Hove
d6147c386f Use opm-common
fixup! WIP: Use opm-common
2018-08-09 08:13:35 +02:00
Joakim Hove
514df9c289 Merge pull request #84 from joakim-hove/delete-bug
Fix bug with TimeVector.delet()
2018-06-15 09:53:02 +02:00
Joakim Hove
b50da115b9 Fix bug with TimeVector.delet() 2018-06-14 16:03:42 +02:00
Joakim Hove
d22ba5b19a Merge pull request #83 from joakim-hove/drop-dates
Implement functionality to delete dates from TimeVector
2018-06-12 10:11:48 +02:00
Joakim Hove
7ab73165be Implement functionality to delete dates from TimeVector 2018-06-11 17:12:32 +02:00
Joakim Hove
800a4221ec Merge pull request #82 from joakim-hove/issues
Verify that first keyword in TimeVector is not dates
2018-06-11 16:56:33 +02:00
Joakim Hove
ef2384baf7 Verify that first keyword in TimeVector is not dates 2018-06-11 16:36:20 +02:00
Joakim Hove
ca4400224f Merge pull request #76 from joakim-hove/time-vector-bug
Time vector bug??
2018-05-31 21:34:13 +02:00
Joakim Hove
7dc82a43e3 Fix bug with DATES with no interleaved data 2018-05-31 21:24:37 +02:00
Joakim Hove
9f802a30ee Add utils.py with testing utilities 2018-05-31 20:48:39 +02:00
Joakim Hove
1f9de9be02 Add decorator as required module 2018-05-31 20:48:38 +02:00
Joakim Hove
4591353f68 Merge pull request #72 from joakim-hove/time-vector-reorg
Changed time_vector to start with DATES. Ignore TSTEP
2018-03-23 13:50:37 +01:00
Joakim Hove
2252a7bd33 Changed time_vector to start with DATES. Ignore TSTEP 2018-03-22 10:17:45 +01:00
Joakim Hove
23153f32ab Merge pull request #71 from joakim-hove/version-0.0.6
Set version to 0.0.6
2018-03-21 12:41:08 +01:00
Joakim Hove
83428bd716 Set version to 0.0.6 2018-03-21 12:40:41 +01:00
Joakim Hove
0ae305fc5d Merge pull request #70 from joakim-hove/version-0.0.5
Raised version to 0.0.5
2018-03-21 12:36:34 +01:00
Joakim Hove
cc82c1241e Raised version to 0.0.5 2018-03-21 12:35:48 +01:00
Joakim Hove
86625ee014 Merge pull request #69 from joakim-hove/sched-tool
Schedule merge functionality.
2018-03-20 22:16:10 +01:00
Joakim Hove
d33a5a39b6 Added class TimeVector to be used as basis for Schedule merging. 2018-03-15 10:10:01 +01:00
Kristian Reed
371f8fe59e Merge pull request #66 from ReedOnly/groupnet_v2
Add VFP table to Group
2018-02-27 14:29:53 +01:00
ReedMe
60f1ac8c67 Add vfp_table_nr to Group
VFP table nr  is added from GRUPNET for further use
related to GroupTree in Webportalen
2018-02-27 10:49:01 +01:00
Joakim Hove
baa4524a56 Merge pull request #62 from joakim-hove/opm-parser-masterII
Opm parser master ii
2018-02-23 15:54:03 +01:00
Joakim Hove
66cf592e8d Added package sunbeam.deck and function sunbeam.deck.parse() 2018-02-23 13:50:02 +01:00
Joakim Hove
83f2714766 Have create SunbeamState object for access to four top level objects. 2018-02-22 20:54:23 +01:00
Joakim Hove
c61218c496 Removed test which used to work due to side-effect 2018-02-22 15:15:28 +01:00
Joakim Hove
f22e884eb4 Merge pull request #64 from ReedOnly/python3
Python3 support
2018-02-22 10:30:15 +01:00
Kristian Reed
491c1461f2 add python 3 support and travis test 2018-02-22 10:19:32 +01:00
Joakim Hove
4f26da6e20 Merge pull request #61 from Statoil/0.0.4
Raised version number to 0.0.4
2018-02-14 21:21:03 +01:00
Joakim Hove
ee0bbb70bb Raised version number to 0.0.4 2018-02-14 21:19:15 +01:00
Pål Grønås Drange
86215b69a1 Merge pull request #58 from joakim-hove/use-pybind11
Use pybind11
2018-02-09 12:18:09 +01:00
Joakim Hove
c708381f52 Update travis to use pyenv 2018-02-08 18:53:15 +01:00
Joakim Hove
5eed642924 Fix testing of times:
- The first seven timesteps were specified as steps of length 365/7.0 days,
   when converted to seconds one second was lost due to rounding. This has been
   changed by using integer length TSTEP.

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

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

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

* Bump version to 0.0.3

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

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

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

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

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

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

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

20
.clang-format Normal file
View File

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

4
.gitignore vendored
View File

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

0
.gitmodules vendored Normal file
View File

View File

@@ -8,11 +8,9 @@ set(OPM_MACROS_ROOT ${PROJECT_SOURCE_DIR})
option(ENABLE_ECL_INPUT "Enable eclipse input support?" ON)
option(ENABLE_ECL_OUTPUT "Enable eclipse output support?" ON)
option(ENABLE_MOCKSIM "Build the mock simulator for io testing" ON)
option(ENABLE_WELL_TEST "Enable testing of well code when building Schedule object" OFF)
option(OPM_ENABLE_PYTHON "Enable python bindings?" OFF)
option(OPM_ENABLE_EMBEDDED_PYTHON "Enable python bindings?" OFF)
if (ENABLE_WELL_TEST)
add_definitions(-DWELL_TEST)
endif()
# Output implies input
if(ENABLE_ECL_OUTPUT)
@@ -114,6 +112,8 @@ macro (sources_hook)
# Append generated sources
list(APPEND opm-common_SOURCES ${PROJECT_BINARY_DIR}/ParserKeywords.cpp)
endif()
set_source_files_properties(src/opm/parser/eclipse/Python/Python.cpp
PROPERTIES COMPILE_FLAGS -Wno-shadow)
endmacro (sources_hook)
macro (fortran_hook)
@@ -149,7 +149,7 @@ if (ENABLE_MOCKSIM)
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
foreach( test test_msim test_msim_ACTIONX )
opm_add_test(${test} SOURCES tests/msim/${test}
opm_add_test(${test} SOURCES tests/msim/${test}.cpp
LIBRARIES ${_libs}
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/tests)
endforeach()
@@ -157,27 +157,51 @@ endif()
# Build the compare utilities
if(ENABLE_ECL_INPUT)
add_library(testutil STATIC
examples/test_util/EclFile.cpp
examples/test_util/EclFilesComparator.cpp
examples/test_util/EclOutput.cpp
examples/test_util/EclRegressionTest.cpp
examples/test_util/EclUtil.cpp
examples/test_util/EGrid.cpp
examples/test_util/ERft.cpp
examples/test_util/ERst.cpp
examples/test_util/ESmry.cpp)
add_executable(compareECL
test_util/EclFilesComparator.cpp
test_util/EclRegressionTest.cpp
test_util/compareECL.cpp
)
add_executable(convertECL
test_util/convertECL.cpp
)
foreach(target compareECL convertECL)
add_executable(${target} examples/test_util/${target}.cpp)
target_link_libraries(${target} testutil opmcommon)
target_link_libraries(${target} opmcommon)
install(TARGETS ${target} DESTINATION bin)
endforeach()
# Add the tests
set(_libs testutil opmcommon
set(_libs opmcommon
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
foreach(test test_EclFilesComparator test_EclIO test_EclRegressionTest
test_EGrid test_ERft test_ERst test_ESmry)
opm_add_test(test_EclFilesComparator
CONDITION
ENABLE_ECL_INPUT
SOURCES
tests/test_EclFilesComparator.cpp
test_util/EclFilesComparator.cpp
LIBRARIES
${_libs}
WORKING_DIRECTORY
${PROJECT_BINARY_DIR}/tests
)
opm_add_test(test_EclRegressionTest
CONDITION
ENABLE_ECL_INPUT
SOURCES
tests/test_EclRegressionTest.cpp
test_util/EclFilesComparator.cpp
test_util/EclRegressionTest.cpp
LIBRARIES
${_libs}
WORKING_DIRECTORY
${PROJECT_BINARY_DIR}/tests
)
foreach(test test_EclIO test_EGrid test_ERft test_ERst test_ESmry)
opm_add_test(${test} CONDITION ENABLE_ECL_INPUT
LIBRARIES ${_libs}
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/tests)
@@ -189,3 +213,90 @@ install(DIRECTORY cmake DESTINATION share/opm)
# Install tab completion skeleton
install(FILES etc/opm_bash_completion.sh.in DESTINATION share/opm/etc)
if (OPM_ENABLE_PYTHON)
# -------------------------------------------------------------------------
# 1: Wrap C++ functionality in Python
find_package(PythonInterp REQUIRED)
include(FindPythonInterp)
make_directory(${CMAKE_BINARY_DIR}/python)
set(PYTHON_PACKAGE_PATH "site-packages")
set(PYTHON_INSTALL_PREFIX "lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/${PYTHON_PACKAGE_PATH}" CACHE STRING "Subdirectory to install Python modules in")
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}")
set(_opmcommon_lib_dirs ${CMAKE_BINARY_DIR}/lib ${CMAKE_PREFIX_PATH}/lib)
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
build
build_ext
--build-lib=${CMAKE_BINARY_DIR}/python/python/opm
--library-dirs=${_setup_lib_dirs}
--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)
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} )" )
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
)
set_target_properties(opmcommon PROPERTIES POSITION_INDEPENDENT_CODE ON)
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${CMAKE_BINARY_DIR}/python/python)
# -------------------------------------------------------------------------
# Let cmake configure some small shell scripts which can be used to simplify
# building and testing of the Python extensions.
configure_file(python/setup-build.sh.in tmp/setup-build.sh)
file( COPY ${PROJECT_BINARY_DIR}/tmp/setup-build.sh
DESTINATION ${PROJECT_BINARY_DIR}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE )
configure_file(python/setup-test.sh.in tmp/setup-test.sh)
file( COPY ${PROJECT_BINARY_DIR}/tmp/setup-test.sh
DESTINATION ${PROJECT_BINARY_DIR}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE )
configure_file(python/enable-python.sh.in enable-python.sh)
# -------------------------------------------------------------------------
# 2: Embed the Python interpreter for keywords like PYACTION and PYINPUT
if (OPM_ENABLE_EMBEDDED_PYTHON)
add_subdirectory(python/pybind11)
target_include_directories(opmcommon PRIVATE "python/pybind11/include;${PYTHON_INCLUDE_DIRS}")
target_link_libraries(opmcommon PUBLIC ${PYTHON_LIBRARY})
add_definitions(-DEMBEDDED_PYTHON)
endif()
endif()

View File

@@ -1,5 +1,5 @@
# This file sets up five lists:
# MAIN_SOURCE_FILES List of compilation units which will be included in
# MAIN_SOURCE_FILES List of compilation units which will be included in
# the library. If it isn't on this list, it won't be
# part of the library. Please try to keep it sorted to
# maintain sanity.
@@ -35,17 +35,20 @@ list (APPEND MAIN_SOURCE_FILES
src/opm/common/utility/parameters/ParameterGroup.cpp
src/opm/common/utility/parameters/ParameterTools.cpp
src/opm/common/utility/numeric/calculateCellVol.cpp
src/opm/common/utility/TimeService.cpp
)
if(ENABLE_ECL_INPUT)
list(APPEND MAIN_SOURCE_FILES
src/opm/json/JsonObject.cpp
src/opm/parser/eclipse/Deck/Deck.cpp
src/opm/parser/eclipse/Deck/DeckItem.cpp
src/opm/parser/eclipse/Deck/DeckValue.cpp
src/opm/parser/eclipse/Deck/DeckKeyword.cpp
src/opm/parser/eclipse/Deck/DeckRecord.cpp
src/opm/parser/eclipse/Deck/DeckOutput.cpp
src/opm/parser/eclipse/Deck/Section.cpp
src/opm/parser/eclipse/Deck/UDAValue.cpp
src/opm/parser/eclipse/Python/Python.cpp
src/opm/parser/eclipse/EclipseState/AquiferCT.cpp
src/opm/parser/eclipse/EclipseState/Aquifetp.cpp
src/opm/parser/eclipse/EclipseState/Aquancon.cpp
@@ -72,22 +75,29 @@ if(ENABLE_ECL_INPUT)
src/opm/parser/eclipse/EclipseState/Grid/setKeywordBox.cpp
src/opm/parser/eclipse/EclipseState/Grid/TransMult.cpp
src/opm/parser/eclipse/EclipseState/InitConfig/Equil.cpp
src/opm/parser/eclipse/EclipseState/InitConfig/FoamConfig.cpp
src/opm/parser/eclipse/EclipseState/InitConfig/InitConfig.cpp
src/opm/parser/eclipse/EclipseState/IOConfig/IOConfig.cpp
src/opm/parser/eclipse/EclipseState/IOConfig/RestartConfig.cpp
src/opm/parser/eclipse/EclipseState/Runspec.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionAST.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionContext.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionResult.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/Actdims.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/Actions.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionX.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionParser.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionValue.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/ASTNode.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/Condition.cpp
src/opm/parser/eclipse/EclipseState/Schedule/ArrayDimChecker.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Events.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Group.cpp
src/opm/parser/eclipse/EclipseState/Schedule/GroupTree.cpp
src/opm/parser/eclipse/EclipseState/Schedule/injection.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Group/Group2.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/GTNode.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/injection.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MessageLimits.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MSW/Compsegs.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.cpp
@@ -96,17 +106,17 @@ if(ENABLE_ECL_INPUT)
src/opm/parser/eclipse/EclipseState/Schedule/OilVaporizationProperties.cpp
src/opm/parser/eclipse/EclipseState/Schedule/RFTConfig.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp
src/opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.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/Well/Well.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/WellConnections.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WList.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WListManager.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellEconProductionLimits.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellFoamProperties.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellPolymerProperties.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellTracerProperties.cpp
@@ -133,14 +143,15 @@ if(ENABLE_ECL_INPUT)
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParams.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParser.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQSet.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQWellSet.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQActive.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQAssign.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQDefine.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQEnums.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQInput.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQConfig.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQContext.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunction.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunctionTable.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQInput.cpp
src/opm/parser/eclipse/EclipseState/Schedule/VFPInjTable.cpp
src/opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.cpp
src/opm/parser/eclipse/Parser/ErrorGuard.cpp
@@ -150,33 +161,68 @@ if(ENABLE_ECL_INPUT)
src/opm/parser/eclipse/Parser/ParserItem.cpp
src/opm/parser/eclipse/Parser/ParserKeyword.cpp
src/opm/parser/eclipse/Parser/ParserRecord.cpp
src/opm/parser/eclipse/RawDeck/RawKeyword.cpp
src/opm/parser/eclipse/RawDeck/RawRecord.cpp
src/opm/parser/eclipse/RawDeck/StarToken.cpp
src/opm/parser/eclipse/Parser/raw/RawKeyword.cpp
src/opm/parser/eclipse/Parser/raw/RawRecord.cpp
src/opm/parser/eclipse/Parser/raw/StarToken.cpp
src/opm/parser/eclipse/Units/Dimension.cpp
src/opm/parser/eclipse/Units/UnitSystem.cpp
src/opm/parser/eclipse/Utility/Functional.cpp
src/opm/parser/eclipse/Utility/Stringview.cpp
)
if (OPM_ENABLE_EMBEDDED_PYTHON)
list( APPEND PYTHON_SOURCE_FILES
src/opm/parser/eclipse/Python/PythonInterp.cpp
python/cxx/connection.cpp
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/parsecontext.cpp
python/cxx/parser.cpp
python/cxx/schedule.cpp
python/cxx/export.cpp
python/cxx/common_state.cpp
python/cxx/table_manager.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})
endif()
if(NOT cjson_FOUND)
list(APPEND MAIN_SOURCE_FILES external/cjson/cJSON.c)
endif()
endif()
if(ENABLE_ECL_OUTPUT)
list( APPEND MAIN_SOURCE_FILES
src/opm/io/eclipse/EclFile.cpp
src/opm/io/eclipse/EclOutput.cpp
src/opm/io/eclipse/EclUtil.cpp
src/opm/io/eclipse/EGrid.cpp
src/opm/io/eclipse/ERft.cpp
src/opm/io/eclipse/ERst.cpp
src/opm/io/eclipse/ESmry.cpp
src/opm/io/eclipse/OutputStream.cpp
src/opm/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/CreateDoubHead.cpp
src/opm/output/eclipse/CreateInteHead.cpp
src/opm/output/eclipse/CreateLogiHead.cpp
src/opm/output/eclipse/CreateUdqDims.cpp
src/opm/output/eclipse/DoubHEAD.cpp
src/opm/output/eclipse/EclipseGridInspector.cpp
src/opm/output/eclipse/EclipseIO.cpp
src/opm/output/eclipse/InteHEAD.cpp
src/opm/output/eclipse/libECLRestart.cpp
src/opm/output/eclipse/LinearisedOutputTable.cpp
src/opm/output/eclipse/LoadRestart.cpp
src/opm/output/eclipse/LogiHEAD.cpp
@@ -185,6 +231,8 @@ if(ENABLE_ECL_OUTPUT)
src/opm/output/eclipse/Tables.cpp
src/opm/output/eclipse/RegionCache.cpp
src/opm/output/eclipse/RestartValue.cpp
src/opm/output/eclipse/WriteInit.cpp
src/opm/output/eclipse/WriteRFT.cpp
src/opm/output/data/Solution.cpp
)
endif()
@@ -214,15 +262,18 @@ if(ENABLE_ECL_INPUT)
tests/parser/ConnectionTests.cpp
tests/parser/COMPSEGUnits.cpp
tests/parser/CopyRegTests.cpp
tests/parser/DeckValueTests.cpp
tests/parser/DeckTests.cpp
tests/parser/DynamicStateTests.cpp
tests/parser/DynamicVectorTests.cpp
tests/parser/Eclipse3DPropertiesTests.cpp
tests/parser/EclipseGridTests.cpp
tests/parser/EmbeddedPython.cpp
tests/parser/EqualRegTests.cpp
tests/parser/EventTests.cpp
tests/parser/FaceDirTests.cpp
tests/parser/FaultTests.cpp
tests/parser/FoamTests.cpp
tests/parser/FunctionalTests.cpp
tests/parser/GeomodifierTests.cpp
tests/parser/GridPropertyTests.cpp
@@ -236,8 +287,11 @@ if(ENABLE_ECL_INPUT)
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/ResinsightTest.cpp
tests/parser/RestartConfigTests.cpp
tests/parser/RockTableTests.cpp
tests/parser/RunspecTests.cpp
@@ -273,14 +327,16 @@ if(ENABLE_ECL_OUTPUT)
tests/test_AggregateGroupData.cpp
tests/test_AggregateMSWData.cpp
tests/test_AggregateConnectionData.cpp
tests/test_AggregateUDQData.cpp
tests/test_ArrayDimChecker.cpp
tests/test_CharArrayNullTerm.cpp
tests/test_EclipseIO.cpp
tests/test_DoubHEAD.cpp
tests/test_InteHEAD.cpp
tests/test_LinearisedOutputTable.cpp
tests/test_LogiHEAD.cpp
tests/test_OutputStream.cpp
tests/test_regionCache.cpp
tests/test_PaddedOutputString.cpp
tests/test_Restart.cpp
tests/test_RFT.cpp
tests/test_Solution.cpp
@@ -288,7 +344,7 @@ if(ENABLE_ECL_OUTPUT)
tests/test_Tables.cpp
tests/test_Wells.cpp
tests/test_WindowedArray.cpp
tests/test_writenumwells.cpp
tests/test_restartwellinfo.cpp
)
endif()
@@ -297,6 +353,7 @@ 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
@@ -309,8 +366,10 @@ if(ENABLE_ECL_OUTPUT)
tests/SUMMARY_EFF_FAC.DATA
tests/SPE1CASE1.DATA
tests/SPE1CASE1.SMSPEC
tests/SPE1CASE1A.SMSPEC
tests/SPE9_CP_PACKED.DATA
tests/SOFR_TEST.DATA
tests/UDQ_TEST_WCONPROD_IUAD-2.DATA
)
endif()
@@ -324,7 +383,10 @@ if(ENABLE_ECL_INPUT)
tests/SPE1CASE1.RFT
tests/SPE1_TESTCASE.UNRST
tests/SPE1_TESTCASE.FUNRST
tests/SPE1_TESTCASE.F0025
tests/SPE1_TESTCASE.X0025
tests/SPE1CASE1.UNSMRY
tests/SPE1CASE1A.UNSMRY
tests/SPE1CASE1_RST60.SMSPEC
tests/SPE1CASE1_RST60.UNSMRY
)
@@ -380,6 +442,7 @@ list( APPEND PUBLIC_HEADER_FILES
opm/common/utility/parameters/ParameterStrings.hpp
opm/common/utility/parameters/ParameterTools.hpp
opm/common/utility/numeric/calculateCellVol.hpp
opm/common/utility/TimeService.hpp
)
if(ENABLE_ECL_INPUT)
list(APPEND PUBLIC_HEADER_FILES
@@ -404,7 +467,9 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/Parser/ParserConst.hpp
opm/parser/eclipse/EclipseState/InitConfig/InitConfig.hpp
opm/parser/eclipse/EclipseState/InitConfig/Equil.hpp
opm/parser/eclipse/EclipseState/InitConfig/FoamConfig.hpp
opm/parser/eclipse/EclipseState/Util/Value.hpp
opm/parser/eclipse/EclipseState/Util/IOrderSet.hpp
opm/parser/eclipse/EclipseState/Util/OrderedMap.hpp
opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp
opm/parser/eclipse/EclipseState/Edit/EDITNNC.hpp
@@ -466,6 +531,8 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/EclipseState/Tables/TableContainer.hpp
opm/parser/eclipse/EclipseState/Tables/AqutabTable.hpp
opm/parser/eclipse/EclipseState/Tables/PlyadsTable.hpp
opm/parser/eclipse/EclipseState/Tables/FoamadsTable.hpp
opm/parser/eclipse/EclipseState/Tables/FoammobTable.hpp
opm/parser/eclipse/EclipseState/Tables/PbvdTable.hpp
opm/parser/eclipse/EclipseState/Tables/SorwmisTable.hpp
opm/parser/eclipse/EclipseState/Tables/PlymaxTable.hpp
@@ -498,22 +565,27 @@ if(ENABLE_ECL_INPUT)
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/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/ArrayDimChecker.hpp
opm/parser/eclipse/EclipseState/Schedule/TimeMap.hpp
opm/parser/eclipse/EclipseState/Schedule/VFPInjTable.hpp
opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/Connection.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.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/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/WellInjectionProperties.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/WellPolymerProperties.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/WellTracerProperties.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/WellTracerProperties.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/WellTestConfig.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/WellTestState.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/WellConnections.hpp
@@ -522,12 +594,14 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/EclipseState/Schedule/RFTConfig.hpp
opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp
opm/parser/eclipse/EclipseState/Schedule/Tuning.hpp
opm/parser/eclipse/EclipseState/Schedule/Group.hpp
opm/parser/eclipse/EclipseState/Schedule/Group/GTNode.hpp
opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp
opm/parser/eclipse/EclipseState/Schedule/Group/GuideRate.hpp
opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateConfig.hpp
opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateModel.hpp
opm/parser/eclipse/EclipseState/Schedule/MessageLimits.hpp
opm/parser/eclipse/EclipseState/Schedule/Events.hpp
opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp
opm/parser/eclipse/EclipseState/Schedule/OilVaporizationProperties.hpp
opm/parser/eclipse/EclipseState/Schedule/GroupTree.hpp
opm/parser/eclipse/EclipseState/Schedule/DynamicState.hpp
opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.hpp
opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.hpp
@@ -541,11 +615,11 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQAssign.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQDefine.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQContext.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQInput.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQConfig.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQEnums.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParams.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQInput.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQWellSet.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQActive.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQSet.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunction.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunctionTable.hpp
@@ -553,17 +627,24 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/Deck/Deck.hpp
opm/parser/eclipse/Deck/Section.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/RawDeck/StarToken.hpp
opm/parser/eclipse/RawDeck/RawEnums.hpp
opm/parser/eclipse/RawDeck/RawRecord.hpp
opm/parser/eclipse/RawDeck/RawKeyword.hpp
opm/parser/eclipse/RawDeck/RawConsts.hpp)
opm/parser/eclipse/Python/Python.hpp)
endif()
if(ENABLE_ECL_OUTPUT)
list(APPEND PUBLIC_HEADER_FILES
opm/io/eclipse/EclFile.hpp
opm/io/eclipse/EclIOdata.hpp
opm/io/eclipse/EclOutput.hpp
opm/io/eclipse/EclUtil.hpp
opm/io/eclipse/EGrid.hpp
opm/io/eclipse/ERft.hpp
opm/io/eclipse/ERst.hpp
opm/io/eclipse/ESmry.hpp
opm/io/eclipse/PaddedOutputString.hpp
opm/io/eclipse/OutputStream.hpp
opm/output/data/Cells.hpp
opm/output/data/Solution.hpp
opm/output/data/Wells.hpp
@@ -572,18 +653,18 @@ if(ENABLE_ECL_OUTPUT)
opm/output/eclipse/VectorItems/intehead.hpp
opm/output/eclipse/VectorItems/logihead.hpp
opm/output/eclipse/VectorItems/msw.hpp
opm/output/eclipse/VectorItems/tabdims.hpp
opm/output/eclipse/VectorItems/well.hpp
opm/output/eclipse/AggregateGroupData.hpp
opm/output/eclipse/AggregateConnectionData.hpp
opm/output/eclipse/AggregateMSWData.hpp
opm/output/eclipse/AggregateUDQData.hpp
opm/output/eclipse/AggregateWellData.hpp
opm/output/eclipse/CharArrayNullTerm.hpp
opm/output/eclipse/DoubHEAD.hpp
opm/output/eclipse/EclipseGridInspector.hpp
opm/output/eclipse/EclipseIO.hpp
opm/output/eclipse/EclipseIOUtil.hpp
opm/output/eclipse/InteHEAD.hpp
opm/output/eclipse/libECLRestart.hpp
opm/output/eclipse/LinearisedOutputTable.hpp
opm/output/eclipse/LogiHEAD.hpp
opm/output/eclipse/RegionCache.hpp
@@ -592,6 +673,8 @@ if(ENABLE_ECL_OUTPUT)
opm/output/eclipse/Summary.hpp
opm/output/eclipse/Tables.hpp
opm/output/eclipse/WindowedArray.hpp
opm/output/eclipse/WriteInit.hpp
opm/output/eclipse/WriteRFT.hpp
opm/output/eclipse/WriteRestartHelpers.hpp
opm/output/OutputWriter.hpp
)

View File

@@ -1,5 +1,5 @@
# 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)
# Generated source, needs to be here
@@ -49,15 +49,13 @@ list(APPEND EXTRA_TESTS EclipseStateTests)
foreach (test BoxTest
CheckDeckValidity
EclipseGridCreateFromDeck
EDITNNCTests
EDITNNCTests
IncludeTest
IntegrationTests
IOConfigIntegrationTest
NNCTests
ParseKEYWORD
ParseDATAWithDefault
Polymer
ResinsightTest
ScheduleCreateFromDeck
TransMultIntegrationTests)
@@ -87,6 +85,8 @@ if(HAVE_OPM_TESTS)
${OPM_TESTS_ROOT}/spe3/SPE3CASE2.DATA
${OPM_TESTS_ROOT}/spe9/SPE9_CP.DATA
${OPM_TESTS_ROOT}/spe9/SPE9_CP_GROUP.DATA
${OPM_TESTS_ROOT}/spe9/SPE9_CP_SHORT.DATA
${OPM_TESTS_ROOT}/spe9/SPE9_CP_SHORT_RESTART.DATA
${OPM_TESTS_ROOT}/spe9/SPE9.DATA
${OPM_TESTS_ROOT}/spe10model1/SPE10_MODEL1.DATA
${OPM_TESTS_ROOT}/spe10model2/SPE10_MODEL2.DATA
@@ -96,6 +96,7 @@ if(HAVE_OPM_TESTS)
EXE_NAME parse_write
TEST_ARGS ${deck})
endforeach()
opm_add_test("SPE9_CP_GROUP2" NO_COMPILE EXE_NAME parse_write TEST_ARGS "${OPM_TESTS_ROOT}/spe9group/SPE9_CP_GROUP.DATA")
set_property(TEST NORNE_ATW2013
PROPERTY ENVIRONMENT "OPM_ERRORS_IGNORE=PARSE_RANDOM_SLASH")
endif()

View File

@@ -1,6 +1,7 @@
set(genkw_SOURCES src/opm/json/JsonObject.cpp
src/opm/parser/eclipse/Parser/createDefaultKeywordList.cpp
src/opm/parser/eclipse/Deck/UDAValue.cpp
src/opm/parser/eclipse/Deck/DeckValue.cpp
src/opm/parser/eclipse/Deck/Deck.cpp
src/opm/parser/eclipse/Deck/DeckItem.cpp
src/opm/parser/eclipse/Deck/DeckKeyword.cpp
@@ -14,9 +15,9 @@ set(genkw_SOURCES src/opm/json/JsonObject.cpp
src/opm/parser/eclipse/Parser/ParserItem.cpp
src/opm/parser/eclipse/Parser/ParserKeyword.cpp
src/opm/parser/eclipse/Parser/ParserRecord.cpp
src/opm/parser/eclipse/RawDeck/RawKeyword.cpp
src/opm/parser/eclipse/RawDeck/RawRecord.cpp
src/opm/parser/eclipse/RawDeck/StarToken.cpp
src/opm/parser/eclipse/Parser/raw/RawKeyword.cpp
src/opm/parser/eclipse/Parser/raw/RawRecord.cpp
src/opm/parser/eclipse/Parser/raw/StarToken.cpp
src/opm/parser/eclipse/Units/Dimension.cpp
src/opm/parser/eclipse/Units/UnitSystem.cpp
src/opm/parser/eclipse/Utility/Stringview.cpp
@@ -31,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 Boost::regex Boost::filesystem Boost::system)
# Generate keyword list
include(src/opm/parser/eclipse/share/keywords/keyword_list.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,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

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

View File

@@ -20,6 +20,7 @@
# - CMP0026 to allow access to the LOCATION target property
# - CMP0048 to indicate that we want to deal with the *VERSION*
# variables ourselves
# - CMP0064 to indicate that we want TEST if conditions to be evaluated
if (POLICY CMP0026)
cmake_policy(SET CMP0026 OLD)
endif()
@@ -28,6 +29,10 @@ if (POLICY CMP0048)
cmake_policy(SET CMP0048 OLD)
endif()
if(POLICY CMP0064)
cmake_policy(SET CMP0064 NEW)
endif()
# set the behavior of the policy 0054 to NEW. (i.e. do not implicitly
# expand variables in if statements)
if (POLICY CMP0054)
@@ -256,9 +261,13 @@ macro (cond_disable_test name)
endif ((NOT DEFINED HAVE_${name}) OR (NOT HAVE_${name}))
endmacro (cond_disable_test name)
# use this target to run all tests
# use this target to run all tests, with parallel execution
cmake_host_system_information(RESULT TESTJOBS QUERY NUMBER_OF_PHYSICAL_CORES)
if(TESTJOBS EQUAL 0)
set(TESTJOBS 1)
endif()
add_custom_target (check
COMMAND ${CMAKE_CTEST_COMMAND}
COMMAND ${CMAKE_CTEST_COMMAND} -j${TESTJOBS}
DEPENDS test-suite
COMMENT "Checking if library is functional"
VERBATIM

View File

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

View File

@@ -1,8 +1,5 @@
# - Build satellites that are dependent of main library
option(ADD_DISABLED_CTESTS "Add the tests which are disabled due to failed preconditions to the ctest output (this makes ctest return an error if such a test is present)" ON)
mark_as_advanced(ADD_DISABLED_CTESTS)
#
# Enumerate all source code in a "satellite" directory such as tests/,
# compile each of them and optionally set them as a test for CTest to
@@ -11,144 +8,136 @@ mark_as_advanced(ADD_DISABLED_CTESTS)
# The following suffices must be defined for the opm prefix passed as
# parameter:
#
# _LINKER_FLAGS Necessary flags to link with this library
# _TARGET CMake target which creates the library
# _LIBRARIES Other dependencies that must also be linked
# _LINKER_FLAGS Necessary flags to link with this library
# _TARGET CMake target which creates the library
# _LIBRARIES Other dependencies that must also be linked
# Synopsis:
# opm_compile_satellites (opm satellite excl_all test_regexp)
# opm_compile_satellites (opm satellite excl_all test_regexp)
#
# Parameters:
# opm Prefix of the variable which contain information
# about the library these satellites depends on, e.g.
# pass "opm-core" if opm-core_TARGET is the name of
# the target the builds this library. Variables with
# suffixes _TARGET and _LIBRARIES must exist.
# opm Prefix of the variable which contain information
# about the library these satellites depends on, e.g.
# pass "opm-core" if opm-core_TARGET is the name of
# the target the builds this library. Variables with
# suffixes _TARGET and _LIBRARIES must exist.
#
# satellite Prefix of variable which contain the names of the
# files, e.g. pass "tests" if the files are in the
# variable tests_SOURCES. Variables with suffixes
# _DATAFILES, _SOURCES and _DIR should exist. This
# name is also used as name of the target that builds
# all these files.
# satellite Prefix of variable which contain the names of the
# files, e.g. pass "tests" if the files are in the
# variable tests_SOURCES. Variables with suffixes
# _DATAFILES, _SOURCES and _DIR should exist. This
# name is also used as name of the target that builds
# all these files.
#
# excl_all EXCLUDE_FROM_ALL if these targets should not be built by
# default, otherwise empty string.
# excl_all EXCLUDE_FROM_ALL if these targets should not be built by
# default, otherwise empty string.
#
# test_regexp Regular expression which picks the name of a test
# out of the filename, or blank if no test should be
# setup.
# test_regexp Regular expression which picks the name of a test
# out of the filename, or blank if no test should be
# setup.
#
# Example:
# opm_compile_satellites (opm-core test "" "^test_([^/]*)$")
# opm_compile_satellites (opm-core test "" "^test_([^/]*)$")
#
macro (opm_compile_satellites opm satellite excl_all test_regexp)
# if we are going to build the tests always, then make sure that
# the datafiles are present too
if (NOT (${excl_all} MATCHES "EXCLUDE_FROM_ALL"))
set (_incl_all "ALL")
set (_incl_all "ALL")
else (NOT (${excl_all} MATCHES "EXCLUDE_FROM_ALL"))
set (_incl_all "")
set (_incl_all "")
endif (NOT (${excl_all} MATCHES "EXCLUDE_FROM_ALL"))
# if a set of datafiles has been setup, pull those in
add_custom_target (${satellite} ${_incl_all})
if (${satellite}_DATAFILES)
add_dependencies (${satellite} ${${satellite}_DATAFILES})
add_dependencies (${satellite} ${${satellite}_DATAFILES})
endif (${satellite}_DATAFILES)
# compile each of these separately
foreach (_sat_FILE IN LISTS ${satellite}_SOURCES)
get_filename_component (_sat_NAME "${_sat_FILE}" NAME_WE)
add_executable (${_sat_NAME} ${excl_all} ${_sat_FILE})
add_dependencies (${satellite} ${_sat_NAME})
set_target_properties (${_sat_NAME} PROPERTIES
LINK_FLAGS "${${opm}_LINKER_FLAGS_STR}"
)
if(HAVE_DYNAMIC_BOOST_TEST)
set_target_properties (${_sat_NAME} PROPERTIES
COMPILE_DEFINITIONS BOOST_TEST_DYN_LINK
)
endif()
# are we building a test? luckily, the testing framework doesn't
# require anything else, so we don't have to figure out where it
# should go in the library list
if (NOT "${test_regexp}" STREQUAL "")
set (_test_lib "${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}")
else (NOT "${test_regexp}" STREQUAL "")
set (_test_lib "")
add_static_analysis_tests(_sat_FILE ${opm}_INCLUDE_DIRS)
endif (NOT "${test_regexp}" STREQUAL "")
target_link_libraries (${_sat_NAME} ${${opm}_TARGET} ${${opm}_LIBRARIES} ${_test_lib})
if (STRIP_DEBUGGING_SYMBOLS)
strip_debug_symbols (${_sat_NAME} _sat_DEBUG)
list (APPEND ${satellite}_DEBUG ${_sat_DEBUG})
get_filename_component (_sat_NAME "${_sat_FILE}" NAME_WE)
add_executable (${_sat_NAME} ${excl_all} ${_sat_FILE})
add_dependencies (${satellite} ${_sat_NAME})
set_target_properties (${_sat_NAME} PROPERTIES
LINK_FLAGS "${${opm}_LINKER_FLAGS_STR}")
if(HAVE_DYNAMIC_BOOST_TEST)
set_target_properties (${_sat_NAME} PROPERTIES
COMPILE_DEFINITIONS BOOST_TEST_DYN_LINK)
endif()
# are we building a test? luckily, the testing framework doesn't
# require anything else, so we don't have to figure out where it
# should go in the library list
if (NOT "${test_regexp}" STREQUAL "")
set (_test_lib "${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}")
else (NOT "${test_regexp}" STREQUAL "")
set (_test_lib "")
add_static_analysis_tests(_sat_FILE ${opm}_INCLUDE_DIRS)
endif (NOT "${test_regexp}" STREQUAL "")
target_link_libraries (${_sat_NAME} ${${opm}_TARGET} ${${opm}_LIBRARIES} ${_test_lib})
if (STRIP_DEBUGGING_SYMBOLS)
strip_debug_symbols (${_sat_NAME} _sat_DEBUG)
list (APPEND ${satellite}_DEBUG ${_sat_DEBUG})
endif()
# variable with regular expression doubles as a flag for
# whether tests should be setup or not
set(_sat_FANCY)
if (NOT "${test_regexp}" STREQUAL "")
foreach (_regexp IN ITEMS ${test_regexp})
if ("${_sat_NAME}" MATCHES "${_regexp}")
string (REGEX REPLACE "${_regexp}" "\\1" _sat_FANCY "${_sat_NAME}")
elseif(NOT _sat_FANCY)
set(_sat_FANCY ${_sat_NAME})
endif()
endforeach (_regexp)
get_target_property (_sat_LOC ${_sat_NAME} LOCATION)
# Run tests through mpi-run. Ubuntu 14.04 provided mpi libs will crash
# in the MPI_Finalize() call otherwise.
if(MPI_FOUND)
set(_sat_LOC ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 1 ${_sat_LOC})
endif()
if (CMAKE_VERSION VERSION_LESS "2.8.4")
add_test (NAME ${_sat_FANCY}
COMMAND ${CMAKE_COMMAND} -E chdir "${PROJECT_BINARY_DIR}/${${satellite}_DIR}" ${_sat_LOC})
else (CMAKE_VERSION VERSION_LESS "2.8.4")
add_test (${_sat_FANCY} ${_sat_LOC})
# run the test in the directory where the data files are
set_tests_properties (${_sat_FANCY} PROPERTIES
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/${${satellite}_DIR})
endif (CMAKE_VERSION VERSION_LESS "2.8.4")
if(NOT TARGET test-suite)
add_custom_target(test-suite)
endif()
add_dependencies(test-suite "${_sat_NAME}")
endif(NOT "${test_regexp}" STREQUAL "")
# variable with regular expression doubles as a flag for
# whether tests should be setup or not
set(_sat_FANCY)
if (NOT "${test_regexp}" STREQUAL "")
foreach (_regexp IN ITEMS ${test_regexp})
if ("${_sat_NAME}" MATCHES "${_regexp}")
string (REGEX REPLACE "${_regexp}" "\\1" _sat_FANCY "${_sat_NAME}")
elseif(NOT _sat_FANCY)
set(_sat_FANCY ${_sat_NAME})
endif()
endforeach (_regexp)
get_target_property (_sat_LOC ${_sat_NAME} LOCATION)
# Run tests through mpi-run. Ubuntu 14.04 provided mpi libs will crash
# in the MPI_Finalize() call otherwise.
if(MPI_FOUND)
set(_sat_LOC ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 1 ${_sat_LOC})
endif()
if (CMAKE_VERSION VERSION_LESS "2.8.4")
add_test (
NAME ${_sat_FANCY}
COMMAND ${CMAKE_COMMAND} -E chdir "${PROJECT_BINARY_DIR}/${${satellite}_DIR}" ${_sat_LOC}
)
else (CMAKE_VERSION VERSION_LESS "2.8.4")
add_test (${_sat_FANCY} ${_sat_LOC})
# run the test in the directory where the data files are
set_tests_properties (${_sat_FANCY} PROPERTIES
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/${${satellite}_DIR}
)
endif (CMAKE_VERSION VERSION_LESS "2.8.4")
if(NOT TARGET test-suite)
add_custom_target(test-suite)
endif()
add_dependencies(test-suite "${_sat_NAME}")
endif(NOT "${test_regexp}" STREQUAL "")
# if this program on the list of files that should be distributed?
# we check by the name of the source file
list (FIND ${satellite}_SOURCES_DIST "${_sat_FILE}" _is_util)
if (NOT (_is_util EQUAL -1))
install (TARGETS ${_sat_NAME} RUNTIME
DESTINATION bin${${opm}_VER_DIR}/
)
endif (NOT (_is_util EQUAL -1))
# if this program on the list of files that should be distributed?
# we check by the name of the source file
list (FIND ${satellite}_SOURCES_DIST "${_sat_FILE}" _is_util)
if (NOT (_is_util EQUAL -1))
install (TARGETS ${_sat_NAME} RUNTIME
DESTINATION bin${${opm}_VER_DIR}/)
endif (NOT (_is_util EQUAL -1))
endforeach (_sat_FILE)
endmacro (opm_compile_satellites opm prefix)
# Synopsis:
# opm_data (satellite target dirname files)
# opm_data (satellite target dirname files)
#
# provides these output variables:
#
# ${satellite}_INPUT_FILES List of all files that are copied
# ${satellite}_DATAFILES Name of target which copies these files
# ${satellite}_INPUT_FILES List of all files that are copied
# ${satellite}_DATAFILES Name of target which copies these files
#
# Example:
#
# opm_data (tests datafiles "tests/")
# opm_data (tests datafiles "tests/")
#
macro (opm_data satellite target dirname)
# even if there are no datafiles, create the directory so the
# satellite programs have a homedir to run in
execute_process (
COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/${dirname}
)
execute_process (COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/${dirname})
# if ever huge test datafiles are necessary, then change this
# into "create_symlink" (on UNIX only, apparently)
@@ -158,26 +147,27 @@ macro (opm_data satellite target dirname)
# to a tests/ directory in the output tree (if different)
set (${satellite}_INPUT_FILES)
if (NOT PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
foreach (input_datafile IN LISTS ${satellite}_DATA)
file (RELATIVE_PATH rel_datafile "${PROJECT_SOURCE_DIR}" ${input_datafile})
set (output_datafile "${PROJECT_BINARY_DIR}/${rel_datafile}")
add_custom_command (
OUTPUT ${output_datafile}
COMMAND ${CMAKE_COMMAND}
ARGS -E ${make_avail} ${input_datafile} ${output_datafile}
DEPENDS ${input_datafile}
VERBATIM
)
list (APPEND ${satellite}_INPUT_FILES "${output_datafile}")
endforeach (input_datafile)
foreach (input_datafile IN LISTS ${satellite}_DATA)
if (IS_ABSOLUTE ${input_datafile})
file (RELATIVE_PATH rel_datafile "${PROJECT_SOURCE_DIR}" ${input_datafile})
else()
set(rel_datafile ${input_datafile})
endif()
set (output_datafile "${PROJECT_BINARY_DIR}/${rel_datafile}")
add_custom_command (OUTPUT ${output_datafile}
COMMAND ${CMAKE_COMMAND}
ARGS -E ${make_avail} ${input_datafile} ${output_datafile}
DEPENDS ${input_datafile}
VERBATIM)
list (APPEND ${satellite}_INPUT_FILES "${output_datafile}")
endforeach (input_datafile)
endif(NOT PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
# setup a target which does all the copying
set (${satellite}_DATAFILES "${target}")
add_custom_target (${${satellite}_DATAFILES}
DEPENDS ${${satellite}_INPUT_FILES}
COMMENT "Making \"${satellite}\" data available in output tree"
)
DEPENDS ${${satellite}_INPUT_FILES}
COMMENT "Making \"${satellite}\" data available in output tree")
if(NOT TARGET test-suite)
add_custom_target(test-suite)
endif()
@@ -309,6 +299,8 @@ macro(opm_add_test TestName)
# only compile the binary but do not run it as a test
add_executable("${CURTEST_EXE_NAME}" ${CURTEST_EXCLUDE_FROM_ALL} ${CURTEST_SOURCES})
target_link_libraries (${CURTEST_EXE_NAME} ${CURTEST_LIBRARIES})
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
add_static_analysis_tests(CURTEST_SOURCES dirs)
if(TARGET ${project}_prepare)
add_dependencies("${CURTEST_EXE_NAME}" ${project}_prepare)
@@ -324,10 +316,11 @@ macro(opm_add_test TestName)
add_executable("${CURTEST_EXE_NAME}" ${CURTEST_EXCLUDE_FROM_ALL} ${CURTEST_SOURCES})
if(HAVE_DYNAMIC_BOOST_TEST)
set_target_properties (${CURTEST_EXE_NAME} PROPERTIES
COMPILE_DEFINITIONS BOOST_TEST_DYN_LINK
)
endif()
COMPILE_DEFINITIONS BOOST_TEST_DYN_LINK)
endif()
target_link_libraries (${CURTEST_EXE_NAME} ${CURTEST_LIBRARIES})
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
add_static_analysis_tests(CURTEST_SOURCES dirs)
if(CURTEST_DEPENDS)
add_dependencies("${CURTEST_EXE_NAME}" ${CURTEST_DEPENDS})
@@ -370,15 +363,6 @@ macro(opm_add_test TestName)
endif()
add_dependencies(test-suite "${CURTEST_EXE_NAME}")
endif()
else() # test is skipped
# the following causes the test to appear as 'skipped' in the
# CDash dashboard. it this is removed, the test is just silently
# ignored.
if (NOT CURTEST_ONLY_COMPILE AND ADD_DISABLED_CTESTS)
add_test(${_FANCY} skip_test_dummy)
endif()
endif()
endmacro()

View File

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

View File

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

View File

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

View File

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

2
debian/changelog vendored
View File

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

2
debian/control vendored
View File

@@ -5,7 +5,7 @@ Build-Depends: build-essential, debhelper (>= 9),
pkg-config, cmake, git, libtool, doxygen,
texlive-latex-extra, texlive-latex-recommended,
ghostscript, libboost-system-dev, libboost-test-dev,
libecl-dev, libboost-regex-dev, libboost-filesystem-dev,
libboost-regex-dev, libboost-filesystem-dev,
zlib1g-dev
Standards-Version: 3.9.2
Section: libs

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: 2019.10
Label: 2019.10
Maintainer: opm@opm-project.org
MaintainerName: OPM community
Url: http://opm-project.org

View File

@@ -48,6 +48,6 @@ int main(int /* argc */, char** argv) {
Opm::msim msim(state);
Opm::EclipseIO io(state, state.getInputGrid(), schedule, summary_config);
msim.run(schedule, io);
msim.run(schedule, io, false);
}

View File

@@ -33,11 +33,12 @@
struct keyword {
keyword(const std::string& name, const std::string& filename, std::size_t line_number, std::size_t content_hash) :
name(name),
filename(filename),
line_number(line_number),
content_hash(content_hash)
keyword(const std::string& name_arg, const std::string& filename_arg,
std::size_t line_number_arg, std::size_t content_hash_arg) :
name(name_arg),
filename(filename_arg),
line_number(line_number_arg),
content_hash(content_hash_arg)
{}

View File

@@ -28,6 +28,15 @@
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/common/OpmLog/OpmLog.hpp>
#include <opm/common/OpmLog/StreamLog.hpp>
#include <opm/common/OpmLog/LogUtil.hpp>
void initLogging() {
std::shared_ptr<Opm::StreamLog> cout_log = std::make_shared<Opm::StreamLog>(std::cout, Opm::Log::DefaultMessageTypes);
Opm::OpmLog::addBackend( "COUT" , cout_log);
}
inline void loadDeck( const char * deck_file) {
Opm::ParseContext parseContext;
@@ -45,6 +54,7 @@ inline void loadDeck( const char * deck_file) {
int main(int argc, char** argv) {
initLogging();
for (int iarg = 1; iarg < argc; iarg++)
loadDeck( argv[iarg] );
}

View File

@@ -1,431 +0,0 @@
/*
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 <string>
#include <string.h>
#include <sstream>
#include <iterator>
#include <iomanip>
#include <algorithm>
#include <unistd.h>
#include <limits>
#include <set>
#include "EclFile.hpp"
#include "ESmry.hpp"
/*
KEYWORDS WGNAMES NUMS | PARAM index Corresponding ERT key
------------------------------------------------+--------------------------------------------------
WGOR OP_1 0 | 0 WGOR:OP_1
FOPT +-+-+-+- 0 | 1 FOPT
WWCT OP_1 0 | 2 WWCT:OP_1
WIR OP_1 0 | 3 WIR:OP_1
WGOR WI_1 0 | 4 WWCT:OP_1
WWCT W1_1 0 | 5 WWCT:WI_1
BPR +-+-+- 12675 | 6 BPR:12675, BPR:i,j,k
RPR +-+-+- 1 | 7 RPR:1
FOPT +-+-+- 0 | 8 FOPT
GGPR NORTH 0 | 9 GGPR:NORTH
COPR OP_1 5628 | 10 COPR:OP_1:56286, COPR:OP_1:i,j,k
RXF +-+-+- 32768*R1(R2 + 10) | 11 RXF:2-3
SOFX OP_1 12675 | 12 SOFX:OP_1:12675, SOFX:OP_1:i,j,jk
*/
ESmry::ESmry(const std::string &filename, bool loadBaseRunData)
{
std::string rootN;
std::vector<int> actInd;
bool formatted=false;
char buff[1000];
getcwd( buff, 1000 );
std::string currentWorkingDir(buff);
std::string currentDir=currentWorkingDir;
std::string smspec_filen;
std::string unsmry_filen;
if (filename.substr(filename.length() - 7, 7) == ".SMSPEC") {
rootN = filename.substr(0,filename.length() -7);
} else if (filename.substr(filename.length() -8, 8) == ".FSMSPEC") {
rootN=filename.substr(0,filename.length() -8);
formatted = true;
} else {
rootN = filename;
}
path = currentWorkingDir;
updatePathAndRootName(path, rootN);
if (formatted) {
smspec_filen = path + "/" + rootN + ".FSMSPEC";
unsmry_filen = path + "/" + rootN + ".FUNSMRY";
} else {
smspec_filen = path + "/" + rootN + ".SMSPEC";
unsmry_filen = path + "/" + rootN + ".UNSMRY";
}
std::vector<std::pair<std::string,int>> smryArray;
EclFile smspec1(smspec_filen);
smspec1.loadData(); // loading all data
std::set<std::string> keywList;
std::vector<int> dimens = smspec1.get<int>("DIMENS");
nI = dimens[1];
nJ = dimens[2];
nK = dimens[3];
std::vector<std::string> restartArray = smspec1.get<std::string>("RESTART");
std::vector<std::string> keywords = smspec1.get<std::string>("KEYWORDS");
std::vector<std::string> wgnames = smspec1.get<std::string>("WGNAMES");
std::vector<int> nums = smspec1.get<int>("NUMS");
for (unsigned int i=0; i<keywords.size(); i++) {
std::string str1 = makeKeyString(keywords[i], wgnames[i], nums[i]);
if (str1.length() > 0) {
keywList.insert(str1);
}
}
std::string rstRootN = "";
std::string pathRstFile = path;
getRstString(restartArray, pathRstFile, rstRootN);
smryArray.push_back({smspec_filen, dimens[5]});
// checking if this is a restart run. Supporting nested restarts (restart, from restart, ...)
// std::set keywList is storing keywords from all runs involved
while ((rstRootN != "") && (loadBaseRunData)) {
std::string rstFile=pathRstFile+"/"+rstRootN+".SMSPEC";
EclFile smspec_rst(rstFile);
smspec_rst.loadData();
std::vector<int> dimens = smspec_rst.get<int>("DIMENS");
std::vector<std::string> restartArray = smspec_rst.get<std::string>("RESTART");
std::vector<std::string> keywords = smspec_rst.get<std::string>("KEYWORDS");
std::vector<std::string> wgnames = smspec_rst.get<std::string>("WGNAMES");
std::vector<int> nums = smspec_rst.get<int>("NUMS");
std::vector<std::string> units = smspec_rst.get<std::string>("UNITS");
for (size_t i = 0; i < keywords.size(); i++) {
std::string str1 = makeKeyString(keywords[i], wgnames[i], nums[i]);
if (str1.length() > 0) {
keywList.insert(str1);
}
}
smryArray.push_back({rstFile,dimens[5]});
getRstString(restartArray, pathRstFile, rstRootN);
}
int nFiles = static_cast<int>(smryArray.size());
// arrayInd should hold indices for each vector and runs
// n=file number, i = position in param array in file n (one array pr time step), example arrayInd[n][i] = position in keyword list (std::set)
std::vector<std::vector<int>> arrayInd;
for (int i = 0; i < nFiles; i++){
arrayInd.push_back({});
}
int n = nFiles - 1;
while (n >= 0){
auto smry = smryArray[n];
EclFile smspec(std::get<0>(smry));
smspec.loadData();
std::vector<int> dimens = smspec.get<int>("DIMENS");
nI = dimens[1];
nJ = dimens[2];
nK = dimens[3];
std::vector<std::string> keywords = smspec.get<std::string>("KEYWORDS");
std::vector<std::string> wgnames = smspec.get<std::string>("WGNAMES");
std::vector<int> nums = smspec.get<int>("NUMS");
std::vector<int> tmpVect(keywords.size(), -1);
arrayInd[n]=tmpVect;
std::set<std::string>::iterator it;
for (size_t i=0; i < keywords.size(); i++) {
std::string keyw = makeKeyString(keywords[i], wgnames[i], nums[i]);
it = std::find(keywList.begin(), keywList.end(), keyw);
if (it != keywList.end()){
arrayInd[n][i] = distance(keywList.begin(), it);
}
}
n--;
}
// param array used to stor data for the object, defined in the private section of the class
param.assign(keywList.size(), {});
int fromReportStepNumber = 0;
int reportStepNumber = 0;
int toReportStepNumber;
float time = 0.0;
int step = 0;
n = nFiles - 1;
while (n >= 0){
reportStepNumber = fromReportStepNumber;
if (n > 0) {
auto rstFrom = smryArray[n-1];
toReportStepNumber = std::get<1>(rstFrom);
} else {
toReportStepNumber = std::numeric_limits<int>::max();
}
std::string smspecFile = std::get<0>(smryArray[n]);
std::string unsmryFile = smspecFile.substr(0, smspecFile.size() - 6) + "UNSMRY";
EclFile unsmry(unsmryFile);
unsmry.loadData();
std::vector<EclFile::EclEntry> list1 = unsmry.getList();
// 2 or 3 arrays pr time step.
// If timestep is a report step: MINISTEP, PARAMS and SEQHDR
// else : MINISTEP and PARAMS
// if summary file starts with a SEQHDR, this will be ignored
int i = 0;
if (std::get<0>(list1[0]) == "SEQHDR") {
i = 1;
}
while (i < static_cast<int>(list1.size())){
if (std::get<0>(list1[i]) != "MINISTEP"){
std::string message="Reading summary file, expecting keyword MINISTEP, found '" + std::get<0>(list1[i]) + "'";
throw std::invalid_argument(message);
}
std::vector<int> ministep = unsmry.get<int>(i);
i++;
if (std::get<0>(list1[i]) != "PARAMS") {
std::string message="Reading summary file, expecting keyword PARAMS, found '" + std::get<0>(list1[i]) + "'";
throw std::invalid_argument(message);
}
std::vector<float> tmpData = unsmry.get<float>(i);
time = tmpData[0];
if (time == 0.0) {
seqTime.push_back(time);
seqIndex.push_back(step);
}
i++;
if (i < static_cast<int>(list1.size())){
if (std::get<0>(list1[i]) == "SEQHDR") {
i++;
reportStepNumber++;
seqTime.push_back(time);
seqIndex.push_back(step);
}
} else {
reportStepNumber++;
seqTime.push_back(time);
seqIndex.push_back(step);
}
// adding defaut values (0.0) in case vector not found in this particular summary file
for (size_t i = 0; i < param.size(); i++){
param[i].push_back(0.0);
}
for (size_t j = 0; j < tmpData.size(); j++) {
int ind = arrayInd[n][j];
if (ind > -1) {
param[ind][step] = tmpData[j];
}
}
if (reportStepNumber >= toReportStepNumber) {
i = static_cast<int>(list1.size());
}
step++;
}
fromReportStepNumber = toReportStepNumber;
n--;
}
nVect = keywList.size();
for (auto keyw : keywList){
keyword.push_back(keyw);
}
};
void ESmry::getRstString(const std::vector<std::string>& restartArray, std::string& pathRst, std::string& rootN) const {
rootN = "";
for (auto str : restartArray) {
rootN = rootN + str;
}
updatePathAndRootName(pathRst, rootN);
}
void ESmry::updatePathAndRootName(std::string& dir, std::string& rootN) const {
if (rootN.substr(0,2) == "./") {
rootN = rootN.substr(2, rootN.size() - 2);
}
if (rootN.substr(0,1) == "/") {
int p = rootN.find_last_of("/");
dir = rootN.substr(0, p);
rootN = rootN.substr(p + 1, rootN.size() - p - 1);
} else if (rootN.find_first_of("/") != std::string::npos) {
int p = rootN.find_last_of("/");
dir = dir + "/" + rootN.substr(0, p);
rootN = rootN.substr(p + 1, rootN.size() - p - 1);
};
}
bool ESmry::hasKey(const std::string &key) const
{
return std::find(keyword.begin(), keyword.end(), key) != keyword.end();
}
void ESmry::ijk_from_global_index(int glob,int &i,int &j,int &k)
{
int tmpGlob = glob - 1;
k = 1 + tmpGlob / (nI * nJ);
int rest = tmpGlob % (nI * nJ);
j = 1 + rest / nI;
i = 1 + rest % nI;
}
std::string ESmry::makeKeyString(const std::string &keyword, const std::string &wgname, int num)
{
std::string keyStr;
std::vector<std::string> segmExcep= {"STEPTYPE", "SEPARATE", "SUMTHIN"};
if (keyword.substr(0, 1) == "A") {
keyStr = keyword + ":" + std::to_string(num);
} else if (keyword.substr(0, 1) == "B") {
int _i,_j,_k;
ijk_from_global_index(num, _i, _j, _k);
keyStr = keyword + ":" + std::to_string(_i) + "," + std::to_string(_j) + "," + std::to_string(_k);
} else if (keyword.substr(0, 1) == "C") {
int _i,_j,_k;
if (num > 0) {
ijk_from_global_index(num, _i, _j, _k);
keyStr = keyword + ":" + wgname+ ":" + std::to_string(_i) + "," + std::to_string(_j) + "," + std::to_string(_k);
}
} else if (keyword.substr(0, 1) == "G") {
if ( wgname != ":+:+:+:+") {
keyStr = keyword + ":" + wgname;
}
} else if (keyword.substr(0, 1) == "R" && keyword.substr(2, 1) == "F") {
// NUMS = R1 + 32768*(R2 + 10)
int r2 = 0;
int y = 32768 * (r2 + 10) - num;
while (y <0 ) {
r2++;
y = 32768 * (r2 + 10) - num;
}
r2--;
int r1 = num - 32768 * (r2 + 10);
keyStr = keyword + ":" + std::to_string(r1) + "-" + std::to_string(r2);
} else if (keyword.substr(0, 1) == "R") {
keyStr = keyword + ":" + std::to_string(num);
} else if (keyword.substr(0, 1) == "S") {
auto it = std::find(segmExcep.begin(), segmExcep.end(), keyword);
if (it != segmExcep.end()) {
keyStr = keyword;
} else {
keyStr = keyword + ":" + wgname + ":" + std::to_string(num);
}
} else if (keyword.substr(0,1) == "W") {
if (wgname != ":+:+:+:+") {
keyStr = keyword + ":" + wgname;
}
} else {
keyStr = keyword;
}
return keyStr;
}
const std::vector<float>& ESmry::get(const std::string& name) const
{
auto it = std::find(keyword.begin(), keyword.end(), name);
if (it == keyword.end()) {
std::string message="keyword " + name + " not found ";
OPM_THROW(std::invalid_argument, message);
}
int ind = std::distance(keyword.begin(), it);
return param[ind];
}

View File

@@ -1,88 +0,0 @@
#include <iostream>
#include <chrono>
#include <tuple>
#include <iomanip>
#include <examples/test_util/EclFile.hpp>
#include <examples/test_util/EclOutput.hpp>
template<typename T>
void write(EclOutput& outFile, EclFile& file1,
const std::string& name, int index)
{
auto vect = file1.get<T>(index);
outFile.write(name, vect);
}
int main(int argc, char **argv) {
if (argc != 2) {
std::cout << "\nInvalid input, need 1 argument which should be the eclipse output file to be converted \n" << std::endl;
exit(1);
}
// start reading
auto start = std::chrono::system_clock::now();
std::string filename = argv[1];
EclFile file1(filename);
file1.loadData();
auto end1 = std::chrono::system_clock::now();
std::chrono::duration<double> elapsed_seconds1 = end1 - start;
bool formattedOutput = file1.formattedInput() ? false : true;
int p = filename.find_last_of(".");
int l = filename.length();
std::string rootN = filename.substr(0,p);
std::string extension = filename.substr(p,l-p);
std::string resFile;
if (formattedOutput) {
resFile = rootN + ".F" + extension.substr(1, extension.length() - 1);
} else {
resFile = rootN + "." + extension.substr(2, extension.length() - 2);
}
std::cout << "\033[1;31m" << "\nconverting " << argv[1] << " -> " << resFile << "\033[0m\n" << std::endl;
EclOutput outFile(resFile, formattedOutput);
auto arrayList = file1.getList();
for (size_t index = 0; index < arrayList.size(); index++) {
std::string name = std::get<0>(arrayList[index]);
EIOD::eclArrType arrType = std::get<1>(arrayList[index]);
if (arrType == EIOD::INTE) {
write<int>(outFile, file1, name, index);
} else if (arrType == EIOD::REAL) {
write<float>(outFile, file1, name,index);
} else if (arrType == EIOD::DOUB) {
write<double>(outFile, file1, name, index);
} else if (arrType == EIOD::LOGI) {
write<bool>(outFile, file1, name, index);
} else if (arrType == EIOD::CHAR) {
write<std::string>(outFile, file1, name, index);
} else if (arrType == EIOD::MESS) {
// shold not be any associated data
outFile.write(name,std::vector<char>());
} else {
std::cout << "unknown array type " << std::endl;
exit(1);
}
}
auto end2 = std::chrono::system_clock::now();
std::chrono::duration<double> elapsed_seconds2 = end2-end1;
std::cout << "\ntime to load from file : " << argv[1] << ": " << elapsed_seconds1.count() << " seconds" << std::endl;
std::cout << "time to write to file : " << resFile << ": " << elapsed_seconds2.count() << " seconds\n" << std::endl;
return 0;
}

View File

@@ -3,8 +3,8 @@
declare -A configurations
declare -A EXTRA_MODULE_FLAGS
EXTRA_MODULE_FLAGS[opm-common]="-DENABLE_WELL_TEST=ON"
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"
# Parse revisions from trigger comment and setup arrays
# Depends on: 'upstreams', upstreamRev',
@@ -110,11 +110,12 @@ function build_module {
cmake --build .
fi
test $? -eq 0 || exit 2
TESTTHREADS=${TESTTHREADS:-1}
if test -z "$CTEST_CONFIGURATION"
then
ctest -T Test --no-compress-output
ctest -T Test --no-compress-output -j$TESTTHREADS
else
ctest -C $CTEST_CONFIGURATION --timeout 5000 -T Test --no-compress-output
ctest -j$TESTTHREADS -C $CTEST_CONFIGURATION --timeout 5000 -T Test --no-compress-output
fi
# Convert to junit format
@@ -145,12 +146,7 @@ function clone_module {
mkdir -p $WORKSPACE/deps/$1
cd $WORKSPACE/deps/$1
git init .
if [ "$1" == "libecl" ]
then
git remote add origin https://github.com/Statoil/$1
else
git remote add origin https://github.com/OPM/$1
fi
git remote add origin https://github.com/OPM/$1
git fetch --depth 1 origin $2:branch_to_build
git checkout branch_to_build
git log HEAD -1 | cat

View File

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

View File

@@ -9,7 +9,7 @@ upstreams=(libecl
opm-common
opm-material
opm-grid
ewoms
opm-models
opm-simulators
opm-upscaling
)
@@ -19,7 +19,7 @@ upstreamRev[libecl]=master
upstreamRev[opm-common]=master
upstreamRev[opm-material]=master
upstreamRev[opm-grid]=master
upstreamRev[ewoms]=master
upstreamRev[opm-models]=master
upstreamRev[opm-simulators]=master
upstreamRev[opm-upscaling]=master

View File

@@ -21,28 +21,27 @@ namespace Opm {
class EclipseIO;
class ParseContext;
class Parser;
class SummaryState;
class msim {
public:
using well_rate_function = double(const EclipseState&, const Schedule&, const data::Solution&, size_t report_step, double seconds_elapsed);
using well_rate_function = double(const EclipseState&, const Schedule&, const SummaryState& st, const data::Solution&, size_t report_step, double seconds_elapsed);
using solution_function = void(const EclipseState&, const Schedule&, data::Solution&, size_t report_step, double seconds_elapsed);
msim(const EclipseState& state);
void well_rate(const std::string& well, data::Rates::opt rate, std::function<well_rate_function> func);
void solution(const std::string& field, std::function<solution_function> func);
void run(Schedule& schedule, EclipseIO& io);
void post_step(Schedule& schedule, data::Solution& sol, data::Wells& well_data, size_t report_step, EclipseIO& io) const;
void run(Schedule& schedule, EclipseIO& io, bool report_only);
void post_step(Schedule& schedule, const SummaryState& st, data::Solution& sol, data::Wells& well_data, size_t report_step) const;
private:
void run_step(const Schedule& schedule, data::Solution& sol, data::Wells& well_data, size_t report_step, EclipseIO& io) const;
void run_step(const Schedule& schedule, data::Solution& sol, data::Wells& well_data, size_t report_step, double dt, EclipseIO& io) const;
void output(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, data::Solution& sol, data::Wells& well_data, size_t report_step, double seconds_elapsed, double time_step) const;
void run_step(const Schedule& schedule, SummaryState& st, data::Solution& sol, data::Wells& well_data, size_t report_step, EclipseIO& io) const;
void run_step(const Schedule& schedule, SummaryState& st, data::Solution& sol, data::Wells& well_data, size_t report_step, double dt, EclipseIO& io) const;
void output(SummaryState& st, size_t report_step, bool substep, double seconds_elapsed, const data::Solution& sol, const data::Wells& well_data, EclipseIO& io) const;
void simulate(const Schedule& schedule, const SummaryState& st, data::Solution& sol, data::Wells& well_data, size_t report_step, double seconds_elapsed, double time_step) const;
EclipseState state;
std::map<std::string, std::map<data::Rates::opt, std::function<well_rate_function>>> well_rates;
std::map<std::string, std::function<solution_function>> solutions;
};

View File

@@ -21,6 +21,7 @@
#include <opm/output/eclipse/EclipseIO.hpp>
#include <opm/output/eclipse/RestartValue.hpp>
#include <opm/output/eclipse/Summary.hpp>
#include <opm/output/data/Solution.hpp>
#include <opm/output/data/Wells.hpp>
@@ -33,48 +34,52 @@
namespace Opm {
msim::msim(const EclipseState& state) :
state(state)
msim::msim(const EclipseState& state_arg) :
state(state_arg)
{}
void msim::run(Schedule& schedule, EclipseIO& io) {
void msim::run(Schedule& schedule, EclipseIO& io, bool report_only) {
const double week = 7 * 86400;
data::Solution sol;
data::Wells well_data;
SummaryState st(std::chrono::system_clock::from_time_t(schedule.getStartTime()));
io.writeInitial();
for (size_t report_step = 1; report_step < schedule.size(); report_step++) {
double time_step = std::min(week, 0.5*schedule.stepLength(report_step - 1));
run_step(schedule, sol, well_data, report_step, time_step, io);
post_step(schedule, sol, well_data, report_step, io);
if (report_only)
run_step(schedule, st, sol, well_data, report_step, io);
else {
double time_step = std::min(week, 0.5*schedule.stepLength(report_step - 1));
run_step(schedule, st, sol, well_data, report_step, time_step, io);
}
post_step(schedule, st, sol, well_data, report_step);
}
}
void msim::post_step(Schedule& schedule, data::Solution& /* sol */, data::Wells& /* well_data */, size_t report_step, EclipseIO& io) const {
const auto& actions = schedule.actions();
void msim::post_step(Schedule& schedule, const SummaryState& st, data::Solution& /* sol */, data::Wells& /* well_data */, size_t report_step) const {
const auto& actions = schedule.actions(report_step);
if (actions.empty())
return;
const SummaryState& summary_state = io.summaryState();
ActionContext context( summary_state );
std::vector<std::string> matching_wells;
Action::Context context( st );
auto sim_time = schedule.simTime(report_step);
for (const auto& action : actions.pending(sim_time)) {
if (action->eval(sim_time, context, matching_wells))
schedule.applyAction(report_step, *action, matching_wells);
auto result = action->eval(sim_time, context);
if (result)
schedule.applyAction(report_step, *action, result);
}
}
void msim::run_step(const Schedule& schedule, data::Solution& sol, data::Wells& well_data, size_t report_step, EclipseIO& io) const {
this->run_step(schedule, sol, well_data, report_step, schedule.stepLength(report_step - 1), io);
void msim::run_step(const Schedule& schedule, SummaryState& st, data::Solution& sol, data::Wells& well_data, size_t report_step, 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, data::Solution& sol, data::Wells& well_data, size_t report_step, double dt, EclipseIO& io) const {
void msim::run_step(const Schedule& schedule, SummaryState& st, data::Solution& sol, data::Wells& well_data, size_t report_step, double dt, EclipseIO& io) const {
double start_time = schedule.seconds(report_step - 1);
double end_time = schedule.seconds(report_step);
double seconds_elapsed = start_time;
@@ -84,10 +89,20 @@ void msim::run_step(const Schedule& schedule, data::Solution& sol, data::Wells&
if ((seconds_elapsed + time_step) > end_time)
time_step = end_time - seconds_elapsed;
this->simulate(schedule, sol, well_data, report_step, seconds_elapsed, time_step);
this->simulate(schedule, st, sol, well_data, report_step, seconds_elapsed, time_step);
seconds_elapsed += time_step;
this->output(report_step,
io.summary().eval(st,
report_step,
seconds_elapsed,
this->state,
schedule,
well_data,
{});
this->output(st,
report_step,
(seconds_elapsed < end_time),
seconds_elapsed,
sol,
@@ -98,19 +113,17 @@ void msim::run_step(const Schedule& schedule, data::Solution& sol, data::Wells&
void msim::output(size_t report_step, bool /* substep */, double seconds_elapsed, const data::Solution& sol, const data::Wells& well_data, EclipseIO& io) const {
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(report_step,
io.writeTimeStep(st,
report_step,
false,
seconds_elapsed,
value,
{},
{},
{});
value);
}
void msim::simulate(const Schedule& schedule, 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, 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);
@@ -123,7 +136,7 @@ void msim::simulate(const Schedule& schedule, data::Solution& sol, data::Wells&
auto rate = rate_pair.first;
auto func = rate_pair.second;
well.rates.set(rate, func(this->state, schedule, sol, report_step, seconds_elapsed + time_step));
well.rates.set(rate, func(this->state, schedule, st, sol, report_step, seconds_elapsed + time_step));
}
// This is complete bogus; a temporary fix to pass an assert() in the

View File

@@ -15,7 +15,6 @@ set (opm-common_DEPS
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")

View File

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

View File

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

View File

@@ -16,10 +16,10 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef EGRID_HPP
#define EGRID_HPP
#ifndef OPM_IO_EGRID_HPP
#define OPM_IO_EGRID_HPP
#include "EclFile.hpp"
#include <opm/io/eclipse/EclFile.hpp>
#include <array>
#include <iostream>
@@ -29,6 +29,7 @@
#include <ctime>
#include <map>
namespace Opm { namespace EclIO {
class EGrid : public EclFile
{
@@ -43,15 +44,15 @@ public:
std::array<int, 3> ijk_from_active_index(int actInd) const;
std::array<int, 3> ijk_from_global_index(int globInd) const;
void getCellCorners(int globindex, std::vector<double>& X, std::vector<double>& Y, std::vector<double>& Z) const;
void getCellCorners(const std::array<int, 3>& ijk, std::vector<double>& X, std::vector<double>& Y, std::vector<double>& Z) const;
void getCellCorners(int globindex, std::array<double,8>& X, std::array<double,8>& Y, std::array<double,8>& Z) const;
void getCellCorners(const std::array<int, 3>& ijk, std::array<double,8>& X, std::array<double,8>& Y, std::array<double,8>& Z) const;
int activeCells() const { return nactive; }
int totalNumberOfCells() const { return nijk[0] * nijk[1] * nijk[2]; }
private:
std::array<int, 3> nijk;
int nNNC, nactive;
int nactive;
std::vector<int> act_index;
std::vector<int> glob_index;
@@ -59,4 +60,6 @@ private:
std::vector<float> zcorn_array;
};
#endif
}} // namespace Opm::EclIO
#endif // OPM_IO_EGRID_HPP

View File

@@ -16,20 +16,20 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ERFT_HPP
#define ERFT_HPP
#ifndef OPM_IO_ERFT_HPP
#define OPM_IO_ERFT_HPP
#include <opm/io/eclipse/EclFile.hpp>
#include "EclFile.hpp"
#include <iostream>
#include <string>
#include <fstream>
#include <vector>
#include <ctime>
#include <map>
#include <set>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
namespace Opm { namespace EclIO {
class ERft : public EclFile
{
@@ -79,5 +79,6 @@ private:
const RftDate& date) const;
};
#endif
}} // namespace Opm::EclIO
#endif // OPM_IO_ERFT_HPP

View File

@@ -16,19 +16,22 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ERST_HPP
#define ERST_HPP
#ifndef OPM_IO_ERST_HPP
#define OPM_IO_ERST_HPP
#include <opm/io/eclipse/EclFile.hpp>
#include "EclFile.hpp"
#include <iostream>
#include <string>
#include <fstream>
#include <vector>
#include <ctime>
#include <ios>
#include <map>
#include <string>
#include <unordered_map>
#include <vector>
namespace Opm { namespace EclIO { namespace OutputStream {
class Restart;
}}}
namespace Opm { namespace EclIO {
class ERst : public EclFile
{
@@ -45,13 +48,23 @@ public:
std::vector<EclEntry> listOfRstArrays(int reportStepNumber);
friend class OutputStream::Restart;
private:
int nReports;
std::vector<int> seqnum; // report step numbers, from SEQNUM array in restart file
std::unordered_map<int,bool> reportLoaded;
std::map<int, std::pair<int,int>> arrIndexRange; // mapping report step number to array indeces (start and end)
void initUnified();
void initSeparate(const int number);
int getArrayIndex(const std::string& name, int seqnum) const;
std::streampos
restartStepWritePosition(const int seqnumValue) const;
};
#endif
}} // namespace Opm::EclIO
#endif // OPM_IO_ERST_HPP

View File

@@ -16,45 +16,55 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ESMRY_HPP
#define ESMRY_HPP
#ifndef OPM_IO_ESMRY_HPP
#define OPM_IO_ESMRY_HPP
#include <iostream>
#include <string>
#include <fstream>
#include <vector>
#include <ctime>
#include <map>
#include <boost/filesystem.hpp>
namespace Opm { namespace EclIO {
class ESmry
{
public:
explicit ESmry(const std::string& filename, bool loadBaseRunData=false); // filename (smspec file) or file root name
const int numberOfVectors() const { return nVect; }
// input is smspec (or fsmspec file)
explicit ESmry(const std::string& filename, bool loadBaseRunData=false);
int numberOfVectors() const { return nVect; }
bool hasKey(const std::string& key) const;
const std::vector<float>& get(const std::string& name) const;
std::vector<float> get_at_rstep(const std::string& name) const;
const std::vector<std::string>& keywordList() const { return keyword; }
int timestepIdxAtReportstepStart(const int reportStep) const;
private:
int nVect, nI, nJ, nK;
std::string path="";
void ijk_from_global_index(int glob, int &i, int &j, int &k);
void ijk_from_global_index(int glob, int &i, int &j, int &k) const;
std::vector<std::vector<float>> param;
std::vector<std::string> keyword;
std::vector<int> seqIndex;
std::vector<float> seqTime;
std::vector<std::string> checkForMultipleResultFiles(const boost::filesystem::path& rootN, bool formatted) const;
void getRstString(const std::vector<std::string>& restartArray,
boost::filesystem::path& pathRst,
boost::filesystem::path& rootN) const;
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 updatePathAndRootName(boost::filesystem::path& dir, boost::filesystem::path& rootN) const;
std::string makeKeyString(const std::string& keyword, const std::string& wgname, int num);
std::string makeKeyString(const std::string& keyword, const std::string& wgname, int num) const;
};
#endif
}} // namespace Opm::EclIO
#endif // OPM_IO_ESMRY_HPP

View File

@@ -16,22 +16,21 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ECLFILE_HPP
#define ECLFILE_HPP
#ifndef OPM_IO_ECLFILE_HPP
#define OPM_IO_ECLFILE_HPP
#include <opm/common/ErrorMacros.hpp>
#include <examples/test_util/data/EclIOdata.hpp>
#include <iostream>
#include <opm/io/eclipse/EclIOdata.hpp>
#include <ios>
#include <string>
#include <fstream>
#include <vector>
#include <ctime>
#include <map>
#include <stdexcept>
#include <tuple>
#include <unordered_map>
#include <stdio.h>
#include <vector>
namespace EIOD = Opm::ecl;
namespace Opm { namespace EclIO {
class EclFile
{
@@ -53,7 +52,7 @@ public:
char_array.clear();
}
using EclEntry = std::tuple<std::string, EIOD::eclArrType, int>;
using EclEntry = std::tuple<std::string, eclArrType, int>;
std::vector<EclEntry> getList() const;
template <typename T>
@@ -77,7 +76,7 @@ protected:
std::unordered_map<int, std::vector<std::string>> char_array;
std::vector<std::string> array_name;
std::vector<EIOD::eclArrType> array_type;
std::vector<eclArrType> array_type;
std::vector<int> array_size;
std::vector<unsigned long int> ifStreamPos;
@@ -85,7 +84,7 @@ protected:
std::map<std::string, int> array_index;
template<class T>
const std::vector<T>& getImpl(int arrIndex, EIOD::eclArrType type,
const std::vector<T>& getImpl(int arrIndex, eclArrType type,
const std::unordered_map<int, std::vector<T>>& array,
const std::string& typeStr)
{
@@ -98,13 +97,20 @@ protected:
loadData(arrIndex);
}
return array.find(arrIndex)->second;
return array.at(arrIndex);
}
std::streampos
seekPosition(const std::vector<std::string>::size_type arrIndex) const;
private:
std::vector<bool> arrayLoaded;
void loadArray(std::fstream& fileH, int arrIndex);
void loadBinaryArray(std::fstream& fileH, std::size_t arrIndex);
void loadFormattedArray(const std::string& fileStr, std::size_t arrIndex, long int fromPos);
};
#endif
}} // namespace Opm::EclIO
#endif // OPM_IO_ECLFILE_HPP

View File

@@ -17,24 +17,19 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_ECLIO_DATA_HPP
#define OPM_ECLIO_DATA_HPP
#ifndef OPM_IO_ECLIODATA_HPP
#define OPM_IO_ECLIODATA_HPP
#include <tuple>
namespace Opm {
namespace ecl {
namespace Opm { namespace EclIO {
// type MESS have no assisiated data
enum eclArrType {
INTE, REAL, DOUB, CHAR, LOGI, MESS
};
// named constants related to binary file format
const unsigned int true_value = 0xffffffff;
const unsigned int false_value = 0x00000000;
@@ -51,7 +46,6 @@ namespace Opm {
const int MaxBlockSizeChar = 840; // Maximum block size for CHAR arrays in binary files
// named constants related to formatted file file format
const int MaxNumBlockInte = 1000; // maximum number of Inte values in block => hard line shift
const int MaxNumBlockReal = 1000; // maximum number of Real values in block => hard line shift
const int MaxNumBlockDoub = 1000; // maximum number of Doub values in block => hard line shift
@@ -69,8 +63,7 @@ namespace Opm {
const int columnWidthDoub = 23; // number of characters fore each Inte Element
const int columnWidthLogi = 3; // number of characters fore each Inte Element
const int columnWidthChar = 11; // number of characters fore each Inte Element
} // ecl
} // Opm
#endif // OPM_ECLIO_DATA_HPP
}} // namespace Opm::EclIO
#endif // OPM_IO_ECLIODATA_HPP

View File

@@ -15,75 +15,90 @@
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ECL_OUTPUT_HPP
#define ECL_OUTPUT_HPP
#ifndef OPM_IO_ECLOUTPUT_HPP
#define OPM_IO_ECLOUTPUT_HPP
#include <iostream>
#include <fstream>
#include <vector>
#include <iomanip>
#include <ios>
#include <string>
#include <typeinfo>
#include <vector>
#include <examples/test_util/data/EclIOdata.hpp>
#include <opm/io/eclipse/EclIOdata.hpp>
#include <opm/io/eclipse/PaddedOutputString.hpp>
namespace EIOD = Opm::ecl;
namespace Opm { namespace EclIO { namespace OutputStream {
class Restart;
class SummarySpecification;
}}}
namespace Opm { namespace EclIO {
class EclOutput
{
public:
EclOutput(const std::string& inputFile, bool formatted);
EclOutput(const std::string& filename,
const bool formatted,
const std::ios_base::openmode mode = std::ios::out);
template<typename T>
void write(const std::string& name,
const std::vector<T>& data)
{
EIOD::eclArrType arrType = EIOD::MESS;
eclArrType arrType = MESS;
if (typeid(T) == typeid(int))
arrType = EIOD::INTE;
arrType = INTE;
else if (typeid(T) == typeid(float))
arrType = EIOD::REAL;
arrType = REAL;
else if (typeid(T) == typeid(double))
arrType = EIOD::DOUB;
arrType = DOUB;
else if (typeid(T) == typeid(bool))
arrType = EIOD::LOGI;
arrType = LOGI;
else if (typeid(T) == typeid(char))
arrType = EIOD::MESS;
arrType = MESS;
if (isFormatted)
{
writeFormattedHeader(name, data.size(), arrType);
if (arrType != EIOD::MESS)
if (arrType != MESS)
writeFormattedArray(data);
}
else
{
writeBinaryHeader(name, data.size(), arrType);
if (arrType != EIOD::MESS)
if (arrType != MESS)
writeBinaryArray(data);
}
}
void message(const std::string& msg);
void flushStream();
friend class OutputStream::Restart;
friend class OutputStream::SummarySpecification;
private:
void writeBinaryHeader(const std::string& arrName, int size, EIOD::eclArrType arrType);
void writeBinaryHeader(const std::string& arrName, int size, eclArrType arrType);
template <typename T>
void writeBinaryArray(const std::vector<T>& data);
void writeBinaryCharArray(const std::vector<std::string>& data);
void writeBinaryCharArray(const std::vector<PaddedOutputString<8>>& data);
void writeFormattedHeader(const std::string& arrName, int size, EIOD::eclArrType arrType);
void writeFormattedHeader(const std::string& arrName, int size, eclArrType arrType);
template <typename T>
void writeFormattedArray(const std::vector<T>& data);
void writeFormattedCharArray(const std::vector<std::string>& data);
void writeFormattedCharArray(const std::vector<PaddedOutputString<8>>& data);
std::string make_real_string(float value) const;
std::string make_doub_string(double value) const;
std::ofstream ofileH;
bool isFormatted;
std::ofstream ofileH;
};
@@ -91,4 +106,11 @@ template<>
void EclOutput::write<std::string>(const std::string& name,
const std::vector<std::string>& data);
#endif
template <>
void EclOutput::write<PaddedOutputString<8>>
(const std::string& name,
const std::vector<PaddedOutputString<8>>& data);
}} // namespace Opm::EclIO
#endif // OPM_IO_ECLOUTPUT_HPP

View File

@@ -16,25 +16,25 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ECL_UTIL_HPP
#define ECL_UTIL_HPP
#ifndef OPM_IO_ECLUTIL_HPP
#define OPM_IO_ECLUTIL_HPP
#include <opm/io/eclipse/EclIOdata.hpp>
#include <string>
#include <tuple>
#include <examples/test_util/data/EclIOdata.hpp>
namespace Opm { namespace EclIO {
namespace Opm {
namespace ecl {
int flipEndianInt(int num);
float flipEndianFloat(float num);
double flipEndianDouble(double num);
int flipEndianInt(int num);
float flipEndianFloat(float num);
double flipEndianDouble(double num);
std::tuple<int, int> block_size_data_binary(eclArrType arrType);
std::tuple<int, int, int> block_size_data_formatted(eclArrType arrType);
std::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);
}
}
std::string trimr(const std::string &str1);
#endif
}} // namespace Opm::EclIO
#endif // OPM_IO_ECLUTIL_HPP

View File

@@ -0,0 +1,455 @@
/*
Copyright (c) 2019 Equinor ASA
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_IO_OUTPUTSTREAM_HPP_INCLUDED
#define OPM_IO_OUTPUTSTREAM_HPP_INCLUDED
#include <opm/io/eclipse/PaddedOutputString.hpp>
#include <array>
#include <chrono>
#include <ios>
#include <memory>
#include <string>
#include <vector>
namespace Opm { namespace EclIO {
class EclOutput;
}} // namespace Opm::EclIO
namespace Opm { namespace EclIO { namespace OutputStream {
struct Formatted { bool set; };
struct Unified { bool set; };
/// Abstract representation of an ECLIPSE-style result set.
struct ResultSet
{
/// Output directory. Commonly "." or location of run's .DATA file.
std::string outputDir;
/// Base name of simulation run.
std::string baseName;
};
/// File manager for "init" output streams.
class Init
{
public:
/// Constructor.
///
/// Opens file stream for writing.
///
/// \param[in] rset Output directory and base name of output stream.
///
/// \param[in] fmt Whether or not to create formatted output files.
explicit Init(const ResultSet& rset,
const Formatted& fmt);
~Init();
Init(const Init& rhs) = delete;
Init(Init&& rhs);
Init& operator=(const Init& rhs) = delete;
Init& operator=(Init&& rhs);
/// Write integer data to underlying output stream.
///
/// \param[in] kw Name of output vector (keyword).
///
/// \param[in] data Output values.
void write(const std::string& kw,
const std::vector<int>& data);
/// Write boolean data to underlying output stream.
///
/// \param[in] kw Name of output vector (keyword).
///
/// \param[in] data Output values.
void write(const std::string& kw,
const std::vector<bool>& data);
/// Write single precision floating point data to underlying
/// output stream.
///
/// \param[in] kw Name of output vector (keyword).
///
/// \param[in] data Output values.
void write(const std::string& kw,
const std::vector<float>& data);
/// Write double precision floating point data to underlying
/// output stream.
///
/// \param[in] kw Name of output vector (keyword).
///
/// \param[in] data Output values.
void write(const std::string& kw,
const std::vector<double>& data);
private:
/// Init file output stream.
std::unique_ptr<EclOutput> stream_;
/// Open output stream.
///
/// Writes to \c stream_.
///
/// \param[in] fname Filename of new output stream.
///
/// \param[in] formatted Whether or not to create a
/// formatted output file.
void open(const std::string& fname,
const bool formatted);
/// Access writable output stream.
EclOutput& stream();
/// Implementation function for public \c write overload set.
template <typename T>
void writeImpl(const std::string& kw,
const std::vector<T>& data);
};
/// File manager for restart output streams.
class Restart
{
public:
/// Constructor.
///
/// Opens file stream pertaining to restart of particular report
/// step and also outputs a SEQNUM record in the case of a unified
/// output stream.
///
/// Must be called before accessing the stream object through the
/// stream() member function.
///
/// \param[in] rset Output directory and base name of output stream.
///
/// \param[in] seqnum Sequence number of new report. One-based
/// report step ID.
///
/// \param[in] fmt Whether or not to create formatted output files.
///
/// \param[in] unif Whether or not to create unified output files.
explicit Restart(const ResultSet& rset,
const int seqnum,
const Formatted& fmt,
const Unified& unif);
~Restart();
Restart(const Restart& rhs) = delete;
Restart(Restart&& rhs);
Restart& operator=(const Restart& rhs) = delete;
Restart& operator=(Restart&& rhs);
/// Generate a message string (keyword type 'MESS') in underlying
/// output stream.
///
/// \param[in] msg Message string (e.g., "STARTSOL").
void message(const std::string& msg);
/// Write integer data to underlying output stream.
///
/// \param[in] kw Name of output vector (keyword).
///
/// \param[in] data Output values.
void write(const std::string& kw,
const std::vector<int>& data);
/// Write boolean data to underlying output stream.
///
/// \param[in] kw Name of output vector (keyword).
///
/// \param[in] data Output values.
void write(const std::string& kw,
const std::vector<bool>& data);
/// Write single precision floating point data to underlying
/// output stream.
///
/// \param[in] kw Name of output vector (keyword).
///
/// \param[in] data Output values.
void write(const std::string& kw,
const std::vector<float>& data);
/// Write double precision floating point data to underlying
/// output stream.
///
/// \param[in] kw Name of output vector (keyword).
///
/// \param[in] data Output values.
void write(const std::string& kw,
const std::vector<double>& data);
/// Write unpadded string data to underlying output stream.
///
/// \param[in] kw Name of output vector (keyword).
///
/// \param[in] data Output values.
void write(const std::string& kw,
const std::vector<std::string>& data);
/// Write padded character data (8 characters per string)
/// to underlying output stream.
///
/// \param[in] kw Name of output vector (keyword).
///
/// \param[in] data Output values.
void write(const std::string& kw,
const std::vector<PaddedOutputString<8>>& data);
private:
/// Restart output stream.
std::unique_ptr<EclOutput> stream_;
/// Open unified output file and place stream's output indicator
/// in appropriate location.
///
/// Writes to \c stream_.
///
/// \param[in] fname Filename of output stream.
///
/// \param[in] formatted Whether or not to create a
/// formatted output file.
///
/// \param[in] seqnum Sequence number of new report. One-based
/// report step ID.
void openUnified(const std::string& fname,
const bool formatted,
const int seqnum);
/// Open new output stream.
///
/// Handles the case of separate output files or unified output file
/// that does not already exist. Writes to \c stream_.
///
/// \param[in] fname Filename of new output stream.
///
/// \param[in] formatted Whether or not to create a
/// formatted output file.
void openNew(const std::string& fname,
const bool formatted);
/// Open existing output file and place stream's output indicator
/// in appropriate location.
///
/// Writes to \c stream_.
///
/// \param[in] fname Filename of output stream.
///
/// \param[in] writePos Position at which to place stream's output
/// indicator. Use \code streampos{ streamoff{-1} } \endcode to
/// place output indicator at end of file (i.e, simple append).
void openExisting(const std::string& fname,
const bool formatted,
const std::streampos writePos);
/// Access writable output stream.
///
/// Must not be called prior to \c prepareStep.
EclOutput& stream();
/// Implementation function for public \c write overload set.
template <typename T>
void writeImpl(const std::string& kw,
const std::vector<T>& data);
};
/// File manager for RFT output streams
class RFT
{
public:
struct OpenExisting { bool set; };
/// Constructor.
///
/// Opens file stream for writing.
///
/// \param[in] rset Output directory and base name of output stream.
///
/// \param[in] fmt Whether or not to create formatted output files.
///
/// \param[in] existing Whether or not to open an existing output file.
explicit RFT(const ResultSet& rset,
const Formatted& fmt,
const OpenExisting& existing);
~RFT();
RFT(const RFT& rhs) = delete;
RFT(RFT&& rhs);
RFT& operator=(const RFT& rhs) = delete;
RFT& operator=(RFT&& rhs);
/// Write integer data to underlying output stream.
///
/// \param[in] kw Name of output vector (keyword).
///
/// \param[in] data Output values.
void write(const std::string& kw,
const std::vector<int>& data);
/// Write single precision floating point data to underlying
/// output stream.
///
/// \param[in] kw Name of output vector (keyword).
///
/// \param[in] data Output values.
void write(const std::string& kw,
const std::vector<float>& data);
/// Write padded character data (8 characters per string)
/// to underlying output stream.
///
/// \param[in] kw Name of output vector (keyword).
///
/// \param[in] data Output values.
void write(const std::string& kw,
const std::vector<PaddedOutputString<8>>& data);
private:
/// Init file output stream.
std::unique_ptr<EclOutput> stream_;
/// Open output stream.
///
/// Writes to \c stream_.
///
/// \param[in] fname Filename of new output stream.
///
/// \param[in] formatted Whether or not to create a
/// formatted output file.
///
/// \param[in] existing Whether or not to open an
/// existing output file (mode ios_base::app).
void open(const std::string& fname,
const bool formatted,
const bool existing);
/// Access writable output stream.
EclOutput& stream();
/// Implementation function for public \c write overload set.
template <typename T>
void writeImpl(const std::string& kw,
const std::vector<T>& data);
};
class SummarySpecification
{
public:
using StartTime = std::chrono::system_clock::time_point;
enum class UnitConvention
{
Metric = 1,
Field = 2,
Lab = 3,
Pvt_M = 4,
};
struct RestartSpecification
{
std::string root;
int step;
};
class Parameters
{
public:
void add(const std::string& keyword,
const std::string& wgname,
const int num,
const std::string& unit);
friend class SummarySpecification;
private:
std::vector<PaddedOutputString<8>> keywords{};
std::vector<PaddedOutputString<8>> wgnames{};
std::vector<int> nums{};
std::vector<PaddedOutputString<8>> units{};
};
explicit SummarySpecification(const ResultSet& rset,
const Formatted& fmt,
const UnitConvention uconv,
const std::array<int,3>& cartDims,
const RestartSpecification& restart,
const StartTime start);
~SummarySpecification();
SummarySpecification(const SummarySpecification& rhs) = delete;
SummarySpecification(SummarySpecification&& rhs);
SummarySpecification& operator=(const SummarySpecification& rhs) = delete;
SummarySpecification& operator=(SummarySpecification&& rhs);
void write(const Parameters& params);
private:
int unit_;
int restartStep_;
std::array<int,3> cartDims_;
StartTime startDate_;
std::vector<PaddedOutputString<8>> restart_;
/// Summary specification (SMSPEC) file output stream.
std::unique_ptr<EclOutput> stream_;
void rewindStream();
void flushStream();
EclOutput& stream();
};
std::unique_ptr<EclOutput>
createSummaryFile(const ResultSet& rset,
const int seqnum,
const Formatted& fmt,
const Unified& unif);
/// Derive filename corresponding to output stream of particular result
/// set, with user-specified file extension.
///
/// Low-level string concatenation routine that does not know specific
/// relations between base names and file extensions. Handles details
/// of base name ending in a period (full stop) or having a name that
/// might otherwise appear to contain a file extension (e.g., CASE.01).
///
/// \param[in] rsetDescriptor Output directory and base name of result set.
///
/// \param[in] ext Filename extension.
///
/// \return outputDir/baseName.ext
std::string outputFileName(const ResultSet& rsetDescriptor,
const std::string& ext);
}}} // namespace Opm::EclIO::OutputStream
#endif // OPM_IO_OUTPUTSTREAM_HPP_INCLUDED

View File

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

View File

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

View File

@@ -21,7 +21,6 @@
#define OPM_AGGREGATE_MSW_DATA_HPP
#include <opm/output/data/Wells.hpp>
#include <opm/output/eclipse/CharArrayNullTerm.hpp>
#include <opm/output/eclipse/WindowedArray.hpp>
#include <string>
@@ -55,13 +54,13 @@ namespace Opm { namespace RestartIO { namespace Helpers {
std::vector<double> sofr;
std::vector<double> swfr;
std::vector<double> sgfr;
};
};
class AggregateMSWData
{
public:
explicit AggregateMSWData(const std::vector<int>& inteHead);
void captureDeclaredMSWData(const Opm::Schedule& sched,
const std::size_t rptStep,
const Opm::UnitSystem& units,

View File

@@ -0,0 +1,142 @@
/*
Copyright (c) 2018 Statoil ASA
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_AGGREGATE_UDQ_DATA_HPP
#define OPM_AGGREGATE_UDQ_DATA_HPP
#include <opm/output/eclipse/WindowedArray.hpp>
#include <opm/io/eclipse/PaddedOutputString.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQInput.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQDefine.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQActive.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQAssign.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQEnums.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParams.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunctionTable.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <cstddef>
#include <string>
#include <vector>
#include <map>
namespace Opm {
class Schedule;
class UDQInput;
class UDQActive;
} // Opm
namespace Opm { namespace RestartIO { namespace Helpers {
class igphData {
public:
const std::vector<int> ig_phase(const Opm::Schedule& sched, const std::size_t simStep, const std::vector<int>& inteHead);
};
class AggregateUDQData
{
public:
explicit AggregateUDQData(const std::vector<int>& udqDims);
void captureDeclaredUDQData(const Opm::Schedule& sched,
const std::size_t simStep,
const Opm::SummaryState& st,
const std::vector<int>& inteHead);
const std::vector<int>& getIUDQ() const
{
return this->iUDQ_.data();
}
const std::vector<int>& getIUAD() const
{
return this->iUAD_.data();
}
const std::vector<EclIO::PaddedOutputString<8>>& getZUDN() const
{
return this->zUDN_.data();
}
const std::vector<EclIO::PaddedOutputString<8>>& getZUDL() const
{
return this->zUDL_.data();
}
const std::vector<int>& getIGPH() const
{
return this->iGPH_.data();
}
const std::vector<int>& getIUAP() const
{
return this->iUAP_.data();
}
const std::vector<double>& getDUDW() const
{
return this->dUDW_.data();
}
const std::vector<double>& getDUDG() const
{
return this->dUDG_.data();
}
const std::vector<double>& getDUDF() const
{
return this->dUDF_.data();
}
private:
/// Aggregate 'IUDQ' array (Integer) for all UDQ data (3 integers pr UDQ)
WindowedArray<int> iUDQ_;
/// Aggregate 'IUAD' array (Integer) for all UDQ data (5 integers pr UDQ that is used for various well and group controls)
WindowedArray<int> iUAD_;
/// Aggregate 'ZUDN' array (Character) for all UDQ data. (2 * 8 chars pr UDQ -> UNIT keyword)
WindowedArray<EclIO::PaddedOutputString<8>> zUDN_;
/// Aggregate 'ZUDL' array (Character) for all UDQ data. (16 * 8 chars pr UDQ DEFINE "Data for operation - Msth Expression)
WindowedArray<EclIO::PaddedOutputString<8>> zUDL_;
/// Aggregate 'IGPH' array (Integer) for all UDQ data (3 - zeroes - as of current understanding)
WindowedArray<int> iGPH_;
/// Aggregate 'IUAP' array (ICharArrayNullTermnteger) for all UDQ data (1 integer pr UDQ constraint used)
WindowedArray<int> iUAP_;
/// Aggregate 'DUDW' array (Double Precision) for all UDQ data. (Dimension = max no wells * noOfUDQ's)
WindowedArray<double> dUDW_;
/// Aggregate 'DUDG' array (Double Precision) for all UDQ data. (Dimension = (max no groups + 1) * noOfUDQ's)
WindowedArray<double> dUDG_;
/// Aggregate 'DUDF' array (Double Precision) for all UDQ data. (Dimension = Number of FU - UDQ's, with value equal to the actual constraint)
WindowedArray<double> dUDF_;
};
}}} // Opm::RestartIO::Helpers
#endif //OPM_AGGREGATE_WELL_DATA_HPP

View File

@@ -20,9 +20,10 @@
#ifndef OPM_AGGREGATE_WELL_DATA_HPP
#define OPM_AGGREGATE_WELL_DATA_HPP
#include <opm/output/eclipse/CharArrayNullTerm.hpp>
#include <opm/output/eclipse/WindowedArray.hpp>
#include <opm/io/eclipse/PaddedOutputString.hpp>
#include <cstddef>
#include <string>
#include <vector>
@@ -74,7 +75,7 @@ namespace Opm { namespace RestartIO { namespace Helpers {
}
/// Retrieve Character Well Data Array.
const std::vector<CharArrayNullTerm<8>>& getZWell() const
const std::vector<EclIO::PaddedOutputString<8>>& getZWell() const
{
return this->zWell_.data();
}
@@ -92,7 +93,7 @@ namespace Opm { namespace RestartIO { namespace Helpers {
WindowedArray<double> xWell_;
/// Aggregate 'ZWEL' array (Character) for all wells.
WindowedArray<CharArrayNullTerm<8>> zWell_;
WindowedArray<EclIO::PaddedOutputString<8>> zWell_;
/// Maximum number of groups in model.
int nWGMax_;

View File

@@ -27,6 +27,7 @@
namespace Opm {
class Tuning;
class Schedule;
class UDQParams;
}
namespace Opm { namespace RestartIO {
@@ -38,7 +39,7 @@ namespace Opm { namespace RestartIO {
std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::duration<double, std::chrono::seconds::period> elapsed;
};
DoubHEAD();
~DoubHEAD() = default;
@@ -57,7 +58,9 @@ namespace Opm { namespace RestartIO {
DoubHEAD& drsdt(const Schedule& sched,
const std::size_t lookup_step,
const double cnvT);
const double cnvT);
DoubHEAD& udq_param(const UDQParams& udqPar);
const std::vector<double>& data() const
{

View File

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

View File

@@ -39,6 +39,7 @@ namespace Opm { namespace RestartIO {
int maxPerf;
int maxWellInGroup;
int maxGroupInField;
int maxWellsInField;
};
struct WellSegDims {
@@ -89,6 +90,10 @@ namespace Opm { namespace RestartIO {
struct Group {
int ngroups;
};
struct UdqParam {
int udqParam_1;
};
InteHEAD();
~InteHEAD() = default;
@@ -117,6 +122,7 @@ namespace Opm { namespace RestartIO {
InteHEAD& wellSegDimensions(const WellSegDims& wsdim);
InteHEAD& regionDimensions(const RegDims& rdim);
InteHEAD& ngroups(const Group& gr);
InteHEAD& udqParam_1(const UdqParam& udqpar);
const std::vector<int>& data() const
{

View File

@@ -24,23 +24,11 @@
#ifndef RESTART_IO_HPP
#define RESTART_IO_HPP
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
#include <opm/parser/eclipse/EclipseState/Runspec.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
#include <opm/output/data/Cells.hpp>
#include <opm/output/data/Solution.hpp>
#include <opm/output/data/Wells.hpp>
#include <opm/output/eclipse/RestartValue.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp>
#include <ert/ecl/EclKW.hpp>
#include <ert/ecl/ecl_rsthead.h>
#include <ert/ecl/ecl_rst_file.h>
#include <ert/util/util.h>
#include <map>
#include <string>
#include <utility>
#include <vector>
@@ -48,11 +36,15 @@ namespace Opm {
class EclipseGrid;
class EclipseState;
class Phases;
class Schedule;
} // namespace Opm
namespace Opm { namespace EclIO { namespace OutputStream {
class Restart;
}}}
/*
The two free functions RestartIO::save() and RestartIO::load() can
@@ -77,24 +69,25 @@ namespace Opm {
*/
namespace Opm { namespace RestartIO {
void save(const std::string& filename,
int report_step,
double seconds_elapsed,
RestartValue value,
const EclipseState& es,
const EclipseGrid& grid,
const Schedule& schedule,
const SummaryState& sumState,
bool write_double = false);
void save(EclIO::OutputStream::Restart& rstFile,
int report_step,
double seconds_elapsed,
RestartValue value,
const EclipseState& es,
const EclipseGrid& grid,
const Schedule& schedule,
const SummaryState& sumState,
bool write_double = false);
std::pair<RestartValue, SummaryState>
load(const std::string& filename,
int report_step,
const std::vector<RestartKey>& solution_keys,
const EclipseState& es,
const EclipseGrid& grid,
const Schedule& schedule,
const std::vector<RestartKey>& extra_keys = {});
RestartValue load(const std::string& filename,
int report_step,
SummaryState& summary_state,
const std::vector<RestartKey>& solution_keys,
const EclipseState& es,
const EclipseGrid& grid,
const Schedule& schedule,
const std::vector<RestartKey>& extra_keys = {});
}} // namespace Opm::RestartIO

View File

@@ -34,7 +34,9 @@ namespace Opm {
std::string key;
UnitSystem::measure dim;
bool required;
bool required = false;
RestartKey() = default;
RestartKey( const std::string& _key, UnitSystem::measure _dim)
: key(_key),

View File

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

View File

@@ -24,11 +24,6 @@
#include <vector>
#include <ert/ecl/FortIO.hpp>
#include <ert/ecl/EclKW.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/PvtoTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/PvtgTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/FlatTable.hpp>
namespace Opm {
@@ -39,9 +34,6 @@ namespace Opm {
public:
explicit Tables( const UnitSystem& units);
void addPVTO(const std::vector<PvtoTable>& pvtoTables);
void addPVTG(const std::vector<PvtgTable>& pvtgTables);
void addPVTW(const PvtwTable& pvtwTable);
void addDensity(const DensityTable& density);
/// Add normalised PVT function tables to INIT file's TAB vector.
@@ -137,20 +129,6 @@ namespace Opm {
/// TableManager sub-object.
void addWaterPVTTables(const EclipseState& es);
};
/// Emit normalised tabular information (TABDIMS and TAB vectors) to
/// ECL-like result set file (typically INIT file).
///
/// \param[in] tables Collection of normalised tables. Its \code
/// tabdims() \endcode and \code tab() \endcode vectors will be
/// emitted to \p fortio as ECL keywords "TABDIMS" and "TAB",
/// respectively.
///
/// \param[in,out] fortio ECL-like result set file. Typically
/// corresponds to a preopened stream attached to the INIT file.
void fwrite(const Tables& tables,
ERT::FortIO& fortio);
}
#endif
#endif // OUTPUT_TABLES_HPP

View File

@@ -30,6 +30,9 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
TsInit = 1, // Maximum Length of Next Timestep
TsMaxz = 2, // Maximum Length of Timestep After Next
TsMinz = 3, // Minumum Length of All Timesteps
UdqPar_2 = 212, // UDQPARAM item number 2 (Permitted range (+/-) of user-defined quantities)
UdqPar_3 = 213, // UDQPARAM item number 3 (Value given to undefined elements when outputting data)
UdqPar_4 = 214, // UDQPARAM item number 4 (fractional equality tolerance used in ==, <= etc. functions)
};
}}}} // Opm::RestartIO::Helpers::VectorItems

View File

@@ -76,6 +76,8 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
NSCAQZ = 46, // Number of data elements per aquifer connection in SCAQ array
NACAQZ = 47, // Number of data elements per aquifer connection in ACAQ array
NWMAXZ = 163, // Maximum number of wells in the model
NSEGWL = 174, // Number of multisegment wells defined with WELSEG
NSWLMX = 175, // Maximum number of segmented wells (item 1 ofWSEGDIMS)
NSEGMX = 176, // Maximum number of segments per well (item 2 of WSEGDIMS)
@@ -84,6 +86,7 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
NISEGZ = 178, // Number of entries per segment in ISEG array
NRSEGZ = 179, // Number of entries per segment in RSEG array
NILBRZ = 180, // Number of entries per segment in ILBR array
UDQPAR_1 = 267, // Integer seed value for the RAND /
};
}}}} // Opm::RestartIO::Helpers::VectorItems

View File

@@ -0,0 +1,76 @@
/*
Copyright (c) 2019 Equinor ASA
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_OUTPUT_ECLIPSE_VECTOR_TABDIMS_HPP
#define OPM_OUTPUT_ECLIPSE_VECTOR_TABDIMS_HPP
#include <vector>
namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems {
namespace TabDims {
enum index : std::vector<int>::size_type {
// Number of elements in 'TAB' array
TabSize = 0,
// Oil PVT table
PvtoMainStart = 6,
PvtoCompStart = 7,
NumPvtoCompNodes = 8,
NumPvtoPressNodes = 9,
NumPvtoTables = 10,
// Water PVT table
PvtwStart = 11,
NumPvtwTables = 12,
// Gas PVT tables
PvtgMainStart = 13,
PvtgPressStart = 14,
NumPvtgCompNodes = 15,
NumPvtgPressNodes = 16,
NumPvtgTables = 17,
// Density tables
DensityTableStart = 18,
DensityNumTables = 19,
// SWFN tables
SwfnTableStart = 20,
SwfnNumSatNodes = 21,
SwfnNumTables = 22,
// SGFN tables
SgfnTableStart = 23,
SgfnNumSatNodes = 24,
SgfnNumTables = 25,
// SOFN tables
SofnTableStart = 26,
SofnNumSatNodes = 28,
SofnNumTables = 29,
// Size of TABDIMS array
TabDimsNumElems = 100,
};
} // namespace TabDims
}}}} // namespace Opm::RestartIO::Helpers::VectorItems
#endif // OPM_OUTPUT_ECLIPSE_VECTOR_TABDIMS_HPP

View File

@@ -21,7 +21,9 @@
#define OPM_WINDOWED_ARRAY_HPP
#include <cassert>
#include <exception>
#include <iterator>
#include <stdexcept>
#include <type_traits>
#include <vector>
@@ -72,7 +74,10 @@ namespace Opm { namespace RestartIO { namespace Helpers {
explicit WindowedArray(const NumWindows n, const WindowSize sz)
: x_ (n.value * sz.value)
, windowSize_(sz.value)
{}
{
if (sz.value == 0)
throw std::invalid_argument("Window array with windowsize==0 is not permitted");
}
/// Retrieve number of windows allocated for this array.
Idx numWindows() const
@@ -179,7 +184,10 @@ namespace Opm { namespace RestartIO { namespace Helpers {
const WindowSize& sz)
: data_ (NumWindows{ nRows.value * nCols.value }, sz)
, numCols_(nCols.value)
{}
{
if (nCols.value == 0)
throw std::invalid_argument("Window matrix with columns==0 is not permitted");
}
/// Retrieve number of columns allocated for this matrix.
Idx numCols() const

View File

@@ -0,0 +1,60 @@
/*
Copyright (c) 2019 Equinor ASA
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_WRITE_INIT_HPP
#define OPM_WRITE_INIT_HPP
#include <map>
#include <string>
#include <vector>
namespace Opm {
class EclipseGrid;
class EclipseState;
class NNC;
class Schedule;
} // namespace Opm
namespace Opm { namespace data {
class Solution;
}} // namespace Opm::data
namespace Opm { namespace EclIO { namespace OutputStream {
class Init;
}}} // namespace Opm::EclIO::OutputStream
namespace Opm { namespace InitIO {
void write(const ::Opm::EclipseState& es,
const ::Opm::EclipseGrid& grid,
const ::Opm::Schedule& schedule,
const ::Opm::data::Solution& simProps,
std::map<std::string, std::vector<int>> int_data,
const ::Opm::NNC& nnc,
::Opm::EclIO::OutputStream::Init& initFile);
}} // namespace Opm::InitIO
#endif // OPM_WRITE_INIT_HPP

View File

@@ -0,0 +1,89 @@
/*
Copyright (c) 2019 Equinor ASA
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_WRITE_RFT_HPP
#define OPM_WRITE_RFT_HPP
namespace Opm {
class EclipseGrid;
class Schedule;
class UnitSystem;
} // namespace Opm
namespace Opm { namespace data {
class WellRates;
}} // namespace Opm::data
namespace Opm { namespace EclIO { namespace OutputStream {
class RFT;
}}} // namespace Opm::EclIO::OutputStream
namespace Opm { namespace RftIO {
/// Collect RFT data and output to pre-opened output stream.
///
/// RFT data is output for all affected wells at a given timestep,
/// and consists of
///
/// 1) Time stamp (elapsed and date)
/// 2) Metadata about the output (units of measure, well types,
/// data type identifier)
/// 3) Depth, pressure, Sw, Sg, (I,J,K), and hostgrid for each
/// reservoir connection of the affected well.
///
/// If no RFT output is requested at given timestep, then this
/// function returns with no output written to the RFT file.
///
/// \param[in] reportStep Report step time point for which to output
/// RFT data.
///
/// \param[in] elapsed Number of seconds of simulated time until
/// this report step (\p reportStep).
///
/// \param[in] usys Unit system conventions for output. Typically
/// corresponds to run's active unit system (i.e., \code
/// EclipseState::getUnits() \endcode).
///
/// \param[in] grid Run's active grid. Used to determine which
/// reservoir connections are in active grid cells.
///
/// \param[in] schedule Run's SCHEDULE section from which to access
/// the active wells and the RFT configuration.
///
/// \param[in,out] rftFile RFT output stream. On input, appropriately
/// positioned for new content (i.e., at end-of-file). On output,
/// containing new RFT output (if applicable) and positioned after
/// new contents.
void write(const int reportStep,
const double elapsed,
const ::Opm::UnitSystem& usys,
const ::Opm::EclipseGrid& grid,
const ::Opm::Schedule& schedule,
const ::Opm::data::WellRates& wellSol,
::Opm::EclIO::OutputStream::RFT& rftFile);
}} // namespace Opm::RftIO
#endif // OPM_WRITE_RFT_HPP

View File

@@ -36,6 +36,7 @@ namespace Opm {
class Schedule;
class Well;
class UnitSystem;
class UDQActive;
} // Opm
@@ -63,6 +64,11 @@ namespace Opm { namespace RestartIO { namespace Helpers {
std::vector<bool>
createLogiHead(const EclipseState& es);
std::vector<int>
createUdqDims(const Schedule& sched,
const std::size_t lookup_step,
const std::vector<int>& inteHead);
}}} // Opm::RestartIO::Helpers

File diff suppressed because it is too large Load Diff

View File

@@ -124,10 +124,6 @@ namespace Opm {
using iterator = std::vector< DeckKeyword >::iterator;
Deck();
// cppcheck-suppress noExplicitConstructor
Deck( std::initializer_list< DeckKeyword > );
// cppcheck-suppress noExplicitConstructor
Deck( std::initializer_list< std::string > );
Deck( const Deck& );

View File

@@ -35,12 +35,10 @@ namespace Opm {
class DeckItem {
public:
DeckItem() = default;
explicit DeckItem( const std::string& );
DeckItem( const std::string&, int, size_t size_hint = 8 );
DeckItem( const std::string&, double, size_t size_hint = 8 );
DeckItem( const std::string&, std::string, size_t size_hint = 8 );
DeckItem( const std::string&, UDAValue, size_t size_hint = 8 );
DeckItem( const std::string&, int);
DeckItem( const std::string&, double);
DeckItem( const std::string&, std::string);
DeckItem( const std::string&, UDAValue);
const std::string& name() const;
@@ -61,7 +59,7 @@ namespace Opm {
size_t out_size() const;
//template< typename T > T& get( size_t ) ;
template< typename T > const T& get( size_t ) const;
template< typename T > T get( size_t ) const;
double getSIDouble( size_t ) const;
std::string getTrimmedString( size_t ) const;
@@ -123,8 +121,12 @@ namespace Opm {
std::string item_name;
std::vector< bool > defaulted;
std::vector< Dimension > dimensions;
mutable std::vector< double > SIdata;
/*
To save space we mutate the dval object in place when asking for SI
data; the current state of of the dval member is tracked with the
raw_data bool member.
*/
mutable bool raw_data = true;
template< typename T > std::vector< T >& value_ref();
template< typename T > const std::vector< T >& value_ref() const;
template< typename T > void push( T );

View File

@@ -23,25 +23,36 @@
#include <string>
#include <vector>
#include <memory>
#include <utility>
#include <opm/parser/eclipse/Parser/ParserKeyword.hpp>
#include <opm/parser/eclipse/Deck/DeckValue.hpp>
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
namespace Opm {
class ParserKeyword;
class DeckOutput;
class ParserKeyword;
class DeckKeyword {
public:
typedef std::vector< DeckRecord >::const_iterator const_iterator;
explicit DeckKeyword(const std::string& keywordName);
DeckKeyword(const std::string& keywordName, bool knownKeyword);
explicit DeckKeyword(const ParserKeyword& parserKeyword);
DeckKeyword(const ParserKeyword& parserKeyword, const std::string& keywordName);
DeckKeyword(const ParserKeyword& parserKeyword, const std::vector<std::vector<DeckValue>>& record_list);
DeckKeyword(const ParserKeyword& parserKeyword, const std::vector<int>& data);
DeckKeyword(const ParserKeyword& parserKeyword, const std::vector<double>& data);
const std::string& name() const;
void setFixedSize();
void setLocation(const std::string& fileName, int lineNumber);
void setLocation(const std::pair<const std::string&, std::size_t>& location);
const std::string& getFileName() const;
int getLineNumber() const;
std::pair<std::string, std::size_t> location() const;
size_t size() const;
void addRecord(DeckRecord&& record);
@@ -49,13 +60,13 @@ namespace Opm {
DeckRecord& getRecord(size_t index);
const DeckRecord& getDataRecord() const;
void setDataKeyword(bool isDataKeyword = true);
bool isKnown() const;
bool isDataKeyword() const;
const std::vector<int>& getIntData() const;
const std::vector<double>& getRawDoubleData() const;
const std::vector<double>& getSIDoubleData() const;
const std::vector<std::string>& getStringData() const;
const ParserKeyword& parserKeyword() const;
size_t getDataSize() const;
void write( DeckOutput& output ) const;
void write_data( DeckOutput& output ) const;
@@ -83,9 +94,9 @@ namespace Opm {
int m_lineNumber;
std::vector< DeckRecord > m_recordList;
bool m_knownKeyword;
bool m_isDataKeyword;
bool m_slashTerminated;
ParserKeyword parser_keyword;
};
}

View File

@@ -0,0 +1,58 @@
/*
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 DECK_VALUE_HPP
#define DECK_VALUE_HPP
#include <string>
#include <opm/parser/eclipse/Utility/Typetools.hpp>
namespace Opm {
class DeckValue {
public:
DeckValue();
explicit DeckValue(int);
explicit DeckValue(double);
explicit DeckValue(const std::string&);
bool is_default() const;
template<typename T>
T get() const;
template<typename T>
bool is_compatible() const;
private:
bool default_value;
type_tag value_enum;
int int_value;
double double_value;
std::string string_value;
};
}
#endif

View File

@@ -23,6 +23,7 @@
#include <stdexcept>
#include <vector>
#include <string>
#include <iosfwd>
#include <opm/parser/eclipse/Units/Dimension.hpp>
@@ -40,6 +41,11 @@ public:
template<typename T>
bool is() const;
void reset(double value);
void reset(const std::string& value);
void assert_numeric() const;
void assert_numeric(const std::string& error_msg) const;
void set_dim(const Dimension& dim) const;
const Dimension& get_dim() const;
@@ -54,6 +60,8 @@ private:
const-ness of the data in a deck item. */
mutable Dimension dim;
};
std::ostream& operator<<( std::ostream& stream, const UDAValue& uda_value );
}

View File

@@ -56,14 +56,20 @@ namespace Opm {
private:
std::vector<Aquancon::AquanconOutput> logic_application(const std::vector<Aquancon::AquanconOutput>& original_vector);
static std::vector<Aquancon::AquanconOutput> logic_application(const std::vector<Aquancon::AquanconOutput>& original_vector);
void collate_function(std::vector<Aquancon::AquanconOutput>& output_vector,
static void collate_function(std::vector<Aquancon::AquanconOutput>& output_vector,
std::vector<Opm::AquanconRecord>& m_aqurecord,
std::vector<int> m_aquiferID_per_record, int m_maxAquID);
const std::vector<int>& m_aquiferID_per_record, int m_maxAquID);
void convert_record_id_to_aquifer_id(std::vector<int>& record_indices_matching_id, int i,
std::vector<int> m_aquiferID_per_record);
static void convert_record_id_to_aquifer_id(std::vector<int>& record_indices_matching_id, int i,
const std::vector<int>& m_aquiferID_per_record);
// for a cell to be inside reservoir, its indices need to be within the reservoir grid dimension range,
// and it needs to be active
static bool cellInsideReservoirAndActive(const EclipseGrid& grid, int i, int j, int k);
static bool neighborCellInsideReservoirAndActive(const EclipseGrid& grid, int i, int j, int k, FaceDir::DirEnum faceDir);
std::vector<Aquancon::AquanconOutput> m_aquoutput;
};

View File

@@ -77,7 +77,8 @@ namespace Opm {
const EclipseGrid& eclipseGrid);
void scanSection(const Section& section,
const EclipseGrid& eclipseGrid);
const EclipseGrid& eclipseGrid,
bool edit_section);
void handleADDKeyword( const DeckKeyword& deckKeyword, BoxManager& boxManager);
void handleBOXKeyword( const DeckKeyword& deckKeyword, BoxManager& boxManager);
@@ -96,7 +97,10 @@ namespace Opm {
void handleOPERATERKeyword( const DeckKeyword& deckKeyword);
void loadGridPropertyFromDeckKeyword(const Box& inputBox,
const DeckKeyword& deckKeyword);
const DeckKeyword& deckKeyword,
bool edity_section);
void adjustSOGCRwithSWL();
std::string m_defaultRegion;
UnitSystem m_deckUnitSystem;

View File

@@ -25,23 +25,24 @@
#include <cstddef>
namespace Opm {
class EclipseGrid;
class Box {
public:
Box() = default;
Box(int nx , int ny , int nz);
Box(const Box& globalBox , int i1 , int i2 , int j1 , int j2 , int k1 , int k2); // Zero offset coordinates.
Box(int nx, int ny, int nz, int i1 , int i2 , int j1 , int j2 , int k1 , int k2);
struct index_pair {
std::size_t global;
std::size_t active;
};
Box(const EclipseGrid& grid);
Box(const EclipseGrid& grid , int i1 , int i2 , int j1 , int j2 , int k1 , int k2);
size_t size() const;
bool isGlobal() const;
size_t getDim(size_t idim) const;
const std::vector<index_pair>& index_list() const;
const std::vector<size_t>& getIndexList() const;
bool equal(const Box& other) const;
explicit operator bool() const;
std::vector<size_t>::const_iterator begin() const;
std::vector<size_t>::const_iterator end() const;
int I1() const;
int I2() const;
@@ -52,12 +53,14 @@ namespace Opm {
private:
void initIndexList();
const EclipseGrid& grid;
size_t m_dims[3] = { 0, 0, 0 };
size_t m_offset[3];
size_t m_stride[3];
bool m_isGlobal;
std::vector<size_t> m_indexList;
std::vector<size_t> global_index_list;
std::vector<index_pair> m_index_list;
int lower(int dim) const;
int upper(int dim) const;

View File

@@ -25,6 +25,7 @@
#include <memory>
#include <opm/parser/eclipse/EclipseState/Grid/Box.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
/*
This class implements a simple book keeping system for the current
@@ -53,7 +54,7 @@ namespace Opm {
class BoxManager {
public:
BoxManager(int nx , int ny , int nz);
BoxManager(const EclipseGrid& grid);
void setInputBox( int i1,int i2 , int j1 , int j2 , int k1 , int k2);
void setKeywordBox( int i1,int i2 , int j1 , int j2 , int k1 , int k2);
@@ -63,14 +64,12 @@ namespace Opm {
void endKeyword();
const Box& getActiveBox() const;
const Box& getGlobalBox() const;
const Box& getInputBox() const;
const Box& getKeywordBox() const;
private:
Box m_globalBox;
Box m_inputBox;
Box m_keywordBox;
const EclipseGrid& grid;
std::unique_ptr<Box> m_globalBox;
std::unique_ptr<Box> m_inputBox;
std::unique_ptr<Box> m_keywordBox;
};
}

View File

@@ -26,9 +26,9 @@
#include <opm/parser/eclipse/EclipseState/Grid/MinpvMode.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/PinchMode.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/GridDims.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/NNC.hpp>
#include <ert/ecl/ecl_grid.h>
#include <ert/util/ert_unique_ptr.hpp>
#include <opm/io/eclipse/EclFile.hpp>
#include <array>
#include <memory>
@@ -59,9 +59,9 @@ namespace Opm {
These constructors will make a copy of the src grid, with
zcorn and or actnum have been adjustments.
*/
EclipseGrid(const EclipseGrid& src, const double* zcorn , const std::vector<int>& actnum);
EclipseGrid(const EclipseGrid& src, const std::vector<double>& zcorn , const std::vector<int>& actnum);
EclipseGrid(const EclipseGrid& src) = default;
EclipseGrid(const EclipseGrid& src, const std::vector<int>& actnum);
EclipseGrid(const EclipseGrid& src, const double* zcorn, const std::vector<int>& actnum);
EclipseGrid(size_t nx, size_t ny, size_t nz,
double dx = 1.0, double dy = 1.0, double dz = 1.0);
@@ -77,7 +77,6 @@ namespace Opm {
/// explicitly. If a null pointer is passed, every cell is active.
EclipseGrid(const Deck& deck, const int * actnum = nullptr);
static bool hasGDFILE(const Deck& deck);
static bool hasCylindricalKeywords(const Deck& deck);
static bool hasCornerPointKeywords(const Deck&);
@@ -88,8 +87,7 @@ namespace Opm {
size_t activeIndex(size_t i, size_t j, size_t k) const;
size_t activeIndex(size_t globalIndex) const;
void save(const std::string& filename, UnitSystem::UnitType output_units) const;
void addNNC(const NNC& nnc);
void save(const std::string& filename, bool formatted, const Opm::NNC& nnc, const Opm::UnitSystem& units) const;
/*
Observe that the there is a getGlobalIndex(i,j,k)
implementation in the base class. This method - translating
@@ -105,6 +103,7 @@ namespace Opm {
applied in the 'THETA' direction; this will only apply if
the theta keywords entered sum up to exactly 360 degrees!
*/
bool circle( ) const;
bool isPinchActive( ) const;
double getPinchThresholdThickness( ) const;
@@ -114,7 +113,6 @@ namespace Opm {
MinpvMode::ModeEnum getMinpvMode() const;
const std::vector<double>& getMinpvVector( ) const;
/*
Will return a vector of nactive elements. The method will
behave differently depending on the lenght of the
@@ -127,6 +125,7 @@ namespace Opm {
??? : Exception.
*/
template<typename T>
std::vector<T> compressedVector(const std::vector<T>& input_vector) const {
if( input_vector.size() == this->getNumActive() ) {
@@ -151,13 +150,13 @@ namespace Opm {
/// Will return a vector a length num_active; where the value
/// of each element is the corresponding global index.
const std::vector<int>& getActiveMap() const;
std::array<double, 3> getCellCenter(size_t i,size_t j, size_t k) const;
std::array<double, 3> getCellCenter(size_t globalIndex) const;
const std::array<double, 3>& getCellCenter(size_t i,size_t j, size_t k) const;
const std::array<double, 3>& getCellCenter(size_t globalIndex) const;
std::array<double, 3> getCornerPos(size_t i,size_t j, size_t k, size_t corner_index) const;
double getCellVolume(size_t globalIndex) const;
double getCellVolume(size_t i , size_t j , size_t k) const;
double getCellThicknes(size_t globalIndex) const;
double getCellThicknes(size_t i , size_t j , size_t k) const;
double getCellThickness(size_t globalIndex) const;
double getCellThickness(size_t i , size_t j , size_t k) const;
std::array<double, 3> getCellDims(size_t i,size_t j, size_t k) const;
std::array<double, 3> getCellDims(size_t globalIndex) const;
bool cellActive( size_t globalIndex ) const;
@@ -166,19 +165,28 @@ namespace Opm {
double getCellDepth(size_t globalIndex) const;
ZcornMapper zcornMapper() const;
const std::vector<double>& getCOORD() const;
const std::vector<double>& getZCORN() const;
const std::vector<int>& getACTNUM( ) const;
const std::vector<double>& getMAPAXES() const;
const std::string& getMAPUNITS() const { return m_mapunits; } ;
/*
The exportZCORN method will adjust the z coordinates to ensure that cells do not
overlap. The return value is the number of points which have been adjusted.
The fixupZCORN method is run as part of constructiong the grid. This will adjust the
z-coordinates to ensure that cells do not overlap. The return value is the number of
points which have been adjusted. The number of zcorn nodes that has ben fixed is
stored in private member zcorn_fixed.
*/
size_t exportZCORN( std::vector<double>& zcorn) const;
size_t fixupZCORN();
size_t getZcornFixed() { return zcorn_fixed; };
// resetACTNUM with no arguments will make all cells in the grid active.
void resetACTNUM();
void resetACTNUM( const std::vector<int>& actnum);
void exportMAPAXES( std::vector<double>& mapaxes) const;
void exportCOORD( std::vector<double>& coord) const;
void exportACTNUM( std::vector<int>& actnum) const;
void resetACTNUM( const int * actnum);
bool equal(const EclipseGrid& other) const;
const ecl_grid_type * c_ptr() const;
private:
std::vector<double> m_minpvVector;
@@ -186,25 +194,35 @@ namespace Opm {
Value<double> m_pinch;
PinchMode::ModeEnum m_pinchoutMode;
PinchMode::ModeEnum m_multzMode;
mutable std::vector<double> volume_cache;
mutable std::vector< int > activeMap;
bool m_circle = false;
/*
The internal class grid_ptr is a a std::unique_ptr with
special copy semantics. The purpose of implementing this is
that the EclipseGrid class can now use the default
implementation for the copy and move constructors.
*/
using ert_ptr = ERT::ert_unique_ptr<ecl_grid_type , ecl_grid_free>;
class grid_ptr : public ert_ptr {
public:
using ert_ptr::unique_ptr;
grid_ptr() = default;
grid_ptr(grid_ptr&&) = default;
grid_ptr(const grid_ptr& src) :
ert_ptr( ecl_grid_alloc_copy( src.get() ) ) {}
};
grid_ptr m_grid;
size_t zcorn_fixed = 0;
bool m_useActnumFromGdfile = false;
// Input grid data.
std::vector<double> m_zcorn;
std::vector<double> m_coord;
std::vector<double> m_mapaxes;
std::vector<int> m_actnum;
std::string m_mapunits;
// Mapping to/from active cells.
int m_nactive;
std::vector<int> m_active_to_global;
std::vector<int> m_global_to_active;
// Geometry data.
std::vector<double> m_volume;
std::vector<double> m_depth;
std::vector<double> m_dx;
std::vector<double> m_dy;
std::vector<double> m_dz;
std::vector<std::array<double, 3>> m_cellCenter;
void initGridFromEGridFile(Opm::EclIO::EclFile& egridfile, std::string fileName);
void initBinaryGrid(const Deck& deck);
void initCornerPointGrid(const std::array<int,3>& dims ,
@@ -213,6 +231,8 @@ namespace Opm {
const int * actnum,
const double * mapaxes);
bool keywInputBeforeGdfile(const Deck& deck, const std::string keyword) const;
void initCylindricalGrid( const std::array<int, 3>&, const Deck&);
void initCartesianGrid( const std::array<int, 3>&, const Deck&);
void initCornerPointGrid( const std::array<int, 3>&, const Deck&);
@@ -229,6 +249,20 @@ namespace Opm {
static std::vector<double> createDVector(const std::array<int, 3>& dims, size_t dim, const std::string& DKey,
const std::string& DVKey, const Deck&);
static void scatterDim(const std::array<int, 3>& dims , size_t dim , const std::vector<double>& DV , std::vector<double>& D);
std::vector<double> makeCoordDxDyDzTops(const std::array<int, 3>& dims, const std::vector<double>& dx, const std::vector<double>& dy, const std::vector<double>& dz, const std::vector<double>& tops) const;
std::vector<double> makeZcornDzTops(const std::array<int, 3>& dims, const std::vector<double>& dz, const std::vector<double>& tops) const ;
std::vector<double> makeZcornDzvDepthz(const std::array<int, 3>& dims, const std::vector<double>& dzv, const std::vector<double>& depthz) const;
std::vector<double> makeCoordDxvDyvDzvDepthz(const std::array<int, 3>& dims, const std::vector<double>& dxv, const std::vector<double>& dyv, const std::vector<double>& dzv, const std::vector<double>& depthz) const;
double sumIdir(int j, int k, int i1, const std::array<int, 3>& dims, const std::vector<double>& dx) const;
double sumJdir(int i, int k, int j1, const std::array<int, 3>& dims, const std::vector<double>& dy) const;
double sumKdir(int i, int j, const std::array<int, 3>& dims, const std::vector<double>& dz) const;
void calculateGeometryData();
void getCellCorners(const std::array<int, 3>& ijk, const std::array<int, 3>& dims, std::array<double,8>& X, std::array<double,8>& Y, std::array<double,8>& Z) const;
};
class CoordMapper {

View File

@@ -54,9 +54,6 @@
namespace Opm {
void setKeywordBox( const DeckRecord& deckRecord,
BoxManager& boxManager);
class Eclipse3DProperties;
template <typename T>
@@ -181,7 +178,7 @@ namespace Opm {
/// this method exists for (friend) Eclipse3DProperties to be allowed initializing PORV and ACTNUM keyword
void postAddKeyword(const std::string& name,
const T defaultValue,
std::function< void( std::vector< T >& ) > postProcessor,
std::function< void( const std::vector<bool>& defaulted, std::vector< T >& ) > postProcessor,
const std::string& dimString,
const bool defaultInitializable );

View File

@@ -21,6 +21,7 @@
#include <functional>
#include <string>
#include <utility>
#include <vector>
/*
@@ -45,7 +46,18 @@ class GridPropertySupportedKeywordInfo {
GridPropertySupportedKeywordInfo() = default;
using init = std::function< std::vector< T >( size_t ) >;
using post = std::function< void( std::vector< T >& ) >;
/**
* Property post-processor function type.
*
* Defaulted flag (one element for each Cartesian cell/data element)
* identifies whether the property value was defaulted in that cell
* (true) or assigned through a deck mechanism (false).
*/
using post = std::function<
void(const std::vector<bool>& defaulted,
std::vector< T >&)
>;
GridPropertySupportedKeywordInfo(
const std::string& name,
@@ -82,6 +94,37 @@ class GridPropertySupportedKeywordInfo {
const post& postProcessor() const;
bool isDefaultInitializable() const;
/**
* Replace post-processor after object is created.
*
* XXX: This is essentially a hack, but it enables using
* post-processors that can't be created at construction time.
*
* One example of this use case is the post-processor for SOGCR in
* a run using Family I (SWOF/SGOF) saturation function tables.
* The SGOF table is implicitly defined in terms of the connate
* water saturation, and the critical oil-in-gas saturation
* post-processor needs to take this fact into account. That, in
* turn, means that the post-processor must have a way of
* accessing SWL data (defaulted or assigned) which means that the
* post-processor needs to be aware of the collection of grid
* properties, not just a single property in isolation.
*
* In our current system, the GridPropertySupportedKeywordInfo
* objects are constructor arguments to that collection and so
* have no way of referring to the collection itself. This method
* provides a mechanism for creating the post-processor once the
* collection is formed.
*
* \param[in] processor New post-processor function. Replaces
* existing post-processor, typically created at construction
* time.
*/
void setPostProcessor(post processor)
{
this->m_postProcessor = std::move(processor);
}
private:
std::string m_keywordName;
@@ -110,6 +153,7 @@ public:
void iset(size_t i , size_t j , size_t k , T value);
const std::vector<bool>& wasDefaulted() const;
const std::vector<T>& getData() const;
std::vector<T>& getData();
@@ -131,8 +175,8 @@ public:
DeckKeyword equals nx*ny*nz.
*/
void loadFromDeckKeyword( const DeckKeyword& );
void loadFromDeckKeyword( const Box&, const DeckKeyword& );
void loadFromDeckKeyword( const DeckKeyword& , bool);
void loadFromDeckKeyword( const Box&, const DeckKeyword& , bool);
void copyFrom( const GridProperty< T >&, const Box& );
void scale( T scaleFactor, const Box& );
@@ -265,10 +309,15 @@ public:
private:
const DeckItem& getDeckItem( const DeckKeyword& );
void setDataPoint(size_t sourceIdx, size_t targetIdx, const DeckItem& deckItem);
void mulDataPoint(size_t sourceIdx, size_t targetIdx, const DeckItem& deckItem);
void setElement(const typename std::vector<T>::size_type i,
const T value,
const bool defaulted = false);
size_t m_nx, m_ny, m_nz;
SupportedKeywordInfo m_kwInfo;
std::vector<T> m_data;
std::vector<bool> m_defaulted;
bool m_hasRunPostProcessor = false;
bool assigned = false;
};

View File

@@ -20,7 +20,7 @@
#ifndef OPM_IO_CONFIG_HPP
#define OPM_IO_CONFIG_HPP
#include <boost/date_time/gregorian/gregorian_types.hpp>
#include <string>
namespace Opm {

View File

@@ -1,17 +1,13 @@
#ifndef OPM_EQUIL_HPP
#define OPM_EQUIL_HPP
#include <cstddef>
#include <vector>
namespace Opm {
class DeckKeyword;
class DeckRecord;
class EquilRecord {
public:
explicit EquilRecord( const DeckRecord& );
double datumDepth() const;
double datumDepthPressure() const;
double waterOilContactDepth() const;
@@ -23,7 +19,9 @@ namespace Opm {
bool wetGasInitConstantRv() const;
int initializationTargetAccuracy() const;
EquilRecord( double datum_depth_arg, double datum_depth_pc_arg, double woc_depth, double woc_pc, double goc_depth, double goc_pc, bool live_oil_init, bool wet_gas_init, int target_accuracy);
private:
double datum_depth;
double datum_depth_ps;
double water_oil_contact_depth;

View File

@@ -0,0 +1,76 @@
/*
Copyright 2019 SINTEF Digital, Mathematics and Cybernetics.
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_FOAMCONFIG_HPP
#define OPM_FOAMCONFIG_HPP
#include <cstddef>
#include <vector>
namespace Opm
{
class Deck;
class DeckRecord;
/// Foam behaviour data for a single SATNUM region.
class FoamData
{
public:
FoamData(const DeckRecord& FOAMFSC_record, const DeckRecord& FOAMROCK_record);
explicit FoamData(const DeckRecord& FOAMROCK_record);
double referenceSurfactantConcentration() const;
double exponent() const;
double minimumSurfactantConcentration() const;
bool allowDesorption() const;
double rockDensity() const;
private:
double reference_surfactant_concentration_;
double exponent_;
double minimum_surfactant_concentration_;
bool allow_desorption_;
double rock_density_;
};
/// Foam behaviour data for all SATNUM regions.
class FoamConfig
{
public:
FoamConfig() = default;
explicit FoamConfig(const Deck&);
const FoamData& getRecord(std::size_t index) const;
std::size_t size() const;
bool empty() const;
using const_iterator = std::vector<FoamData>::const_iterator;
const_iterator begin() const;
const_iterator end() const;
private:
std::vector<FoamData> data_;
};
} // end namespace Opm
#endif // OPM_FOAMCONFIG_HPP

View File

@@ -23,6 +23,7 @@
#include <string>
#include <opm/parser/eclipse/EclipseState/InitConfig/Equil.hpp>
#include <opm/parser/eclipse/EclipseState/InitConfig/FoamConfig.hpp>
namespace Opm {
@@ -41,12 +42,22 @@ namespace Opm {
bool hasEquil() const;
const Equil& getEquil() const;
bool hasFoamConfig() const;
const FoamConfig& getFoamConfig() const;
bool filleps() const
{
return this->m_filleps;
}
private:
Equil equil;
FoamConfig foamconfig;
bool m_filleps;
bool m_restartRequested = false;
int m_restartStep = 0;
std::string m_restartRootName;
Equil equil;
};
} //namespace Opm

View File

@@ -25,6 +25,7 @@
#include <opm/parser/eclipse/EclipseState/Tables/Tabdims.hpp>
#include <opm/parser/eclipse/EclipseState/EndpointScaling.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParams.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Action/Actdims.hpp>
namespace Opm {
class Deck;
@@ -37,9 +38,13 @@ enum class Phase {
SOLVENT = 3,
POLYMER = 4,
ENERGY = 5,
POLYMW = 6
POLYMW = 6,
FOAM = 7
// If you add more entries to this enum, remember to update NUM_PHASES_IN_ENUM below.
};
constexpr int NUM_PHASES_IN_ENUM = static_cast<int>(Phase::FOAM) + 1; // Used to get correct size of the bitset in class Phases.
Phase get_phase( const std::string& );
std::ostream& operator<<( std::ostream&, const Phase& );
@@ -47,12 +52,12 @@ class Phases {
public:
Phases() noexcept = default;
Phases( bool oil, bool gas, bool wat, bool solvent = false, bool polymer = false, bool energy = false,
bool polymw = false ) noexcept;
bool polymw = false, bool foam = false ) noexcept;
bool active( Phase ) const noexcept;
size_t size() const noexcept;
private:
std::bitset< 7 > bits;
std::bitset< NUM_PHASES_IN_ENUM > bits;
};
@@ -167,6 +172,7 @@ public:
const WellSegmentDims& wellSegmentDimensions() const noexcept;
int eclPhaseMask( ) const noexcept;
const EclHysterConfig& hysterPar() const noexcept;
const Actdims& actdims() const noexcept;
private:
Phases active_phases;
@@ -176,6 +182,7 @@ private:
WellSegmentDims wsegdims;
UDQParams udq_params;
EclHysterConfig hystpar;
Actdims m_actdims;
};

View File

@@ -0,0 +1,46 @@
/*
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 ACTDIMS_HPP_
#define ACTDIMS_HPP_
#include <opm/parser/eclipse/Deck/Deck.hpp>
namespace Opm {
class Actdims {
public:
Actdims();
explicit Actdims(const Deck& deck);
std::size_t max_keywords() const;
std::size_t max_line_count() const;
std::size_t max_characters() const;
std::size_t max_conditions() const;
private:
std::size_t keywords;
std::size_t line_count;
std::size_t characters;
std::size_t conditions;
};
}
#endif

View File

@@ -25,26 +25,35 @@
#include <vector>
#include <memory>
namespace Opm {
#include <opm/parser/eclipse/EclipseState/Schedule/Action/ActionResult.hpp>
class ActionContext;
namespace Opm {
namespace Action {
class Context;
class ASTNode;
/*
The Action::AST class implements a tree with the result of the parsing of the
ACTIONX condition. The AST does not contain any context, that is supplied with
a Action::Context instace when calling the eval() methoid is called.
*/
class ActionAST{
class AST{
public:
ActionAST() = default;
explicit ActionAST(const std::vector<std::string>& tokens);
bool eval(const ActionContext& context, std::vector<std::string>& matching_wells) const;
AST() = default;
explicit AST(const std::vector<std::string>& tokens);
Result eval(const Context& context) const;
private:
/*
The use of a pointer here is to be able to create this class with only a
forward declaration of the ASTNode class. Would have prefered to use a
unique_ptr, but that requires writing custom destructors - the use of a
shared_ptr does not imply any shared ownership.
shared_ptr does not imply any shared ownership of the ASTNode.
*/
std::shared_ptr<ASTNode> condition;
};
}
}
#endif

View File

@@ -27,13 +27,17 @@
#include <opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp>
namespace Opm {
namespace Action {
class ActionContext {
/*
The Action::Context class is used as context when the ACTIONX condition is
evaluated. The Action::Context class is mainly just a thin wrapper around the
SummaryState class.
*/
class Context {
public:
/*
Observe that the ActionContext takes a copy of the SummaryState object.
*/
explicit ActionContext(const SummaryState& summary_state);
explicit Context(const SummaryState& summary_state);
/*
The get methods will first check the internal storage in the 'values' map
@@ -48,8 +52,9 @@ public:
std::vector<std::string> wells(const std::string& func) const;
private:
SummaryState summary_state;
const SummaryState& summary_state;
std::map<std::string, double> values;
};
}
}
#endif

View File

@@ -0,0 +1,110 @@
/*
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.
but eliminates the memory saving DynamicState is intended to enable. You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ACTION_RESULT_HPP
#define ACTION_RESULT_HPP
#include <string>
#include <unordered_set>
#include <vector>
#include <memory>
namespace Opm {
namespace Action {
/*
The Action::Result class is used to hold the boolean result of a ACTIONX
condition like:
WWCT > 0.75
and also the final evaluation of an ACTIONX condition comes as a
Action::Result instance.
In addition to the overall truthness of the expression an Action::Result
instance can optionally have a set of matching wells. For instance the
the result of:
FWCT > 0.75
Will not contain any wells, whereas the result of:
WWCT > 0.75
will contain a set of all the wells matching the condition. The set of
matching wells can be queries with the wells() method. When a result with
wells and a result without wells are combined as:
WWCT > 0.50 AND FPR > 1000
The result will have all the wells corresponding to the first condition, when
several results with wells are combined with logical operators AND and OR the
set of matching wells are combined correspondingly. It is actually possible
to have a result which evaluates to true and still have and zero matching
wells - e.g.
WWCT > 1.25 OR FOPT > 1
If the condition evaluates to true the set of matching wells will be passed
to the Schedule::applyAction() method, and will be used in place of '?' in
keywords like WELOPEN.
*/
class WellSet {
public:
WellSet() = default;
explicit WellSet(const std::vector<std::string>& wells);
void add(const std::string& well);
std::size_t size() const;
std::vector<std::string> wells() const;
bool contains(const std::string& well) const;
WellSet& intersect(const WellSet& other);
WellSet& add(const WellSet& other);
private:
std::unordered_set<std::string> well_set;
};
class Result {
public:
explicit Result(bool result_arg);
Result(bool result_arg, const std::vector<std::string>& wells);
Result(bool result_arg, const WellSet& wells);
explicit operator bool() const;
std::vector<std::string> wells() const;
void add_well(const std::string& well);
Result& operator|=(const Result& other);
Result& operator&=(const Result& other);
private:
void assign(bool value);
bool result;
std::unique_ptr<WellSet> matching_wells;
};
}
}
#endif

View File

@@ -27,8 +27,16 @@
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Action/ActionAST.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Action/ActionResult.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Action/Condition.hpp>
namespace Opm {
class DeckKeyword;
namespace Action {
/*
The ActionX class internalizes the ACTIONX keyword. This keyword represents a
small in-deck programming language for the SCHEDULE section. In the deck the
@@ -53,9 +61,6 @@ namespace Opm {
*/
class DeckKeyword;
class ActionContext;
class ActionX {
public:
ActionX(const std::string& name, size_t max_run, double max_wait, std::time_t start_time);
@@ -64,7 +69,7 @@ public:
void addKeyword(const DeckKeyword& kw);
bool ready(std::time_t sim_time) const;
bool eval(std::time_t sim_time, const ActionContext& context, std::vector<std::string>& wells) const;
Action::Result eval(std::time_t sim_time, const Action::Context& context) const;
std::string name() const { return this->m_name; }
@@ -74,6 +79,13 @@ public:
std::vector<DeckKeyword>::const_iterator begin() const;
std::vector<DeckKeyword>::const_iterator end() const;
static bool valid_keyword(const std::string& keyword);
/*
The conditions() and keyword_strings() methods, and their underlying data
members are only present to support writing formatted restart files.
*/
const std::vector<Condition>& conditions() const;
std::vector<std::string> keyword_strings() const;
private:
std::string m_name;
size_t m_max_run = 0;
@@ -81,10 +93,12 @@ private:
std::time_t m_start_time;
std::vector<DeckKeyword> keywords;
ActionAST condition;
Action::AST condition;
std::vector<Condition> m_conditions;
mutable size_t run_count = 0;
mutable std::time_t last_run = 0;
};
}
}
#endif /* WELL_HPP_ */

View File

@@ -23,11 +23,17 @@
#include <string>
#include <ctime>
#include <map>
#include <vector>
#include <opm/parser/eclipse/EclipseState/Schedule/Action/ActionX.hpp>
namespace Opm {
namespace Action {
/*
The Actions class is a container of ACTIONX keywords. The main functionality
is to provide a list of ACTIONX keywords which are ready to be evaluated.
*/
class Actions {
public:
@@ -36,10 +42,15 @@ public:
bool empty() const;
void add(const ActionX& action);
bool ready(std::time_t sim_time) const;
ActionX& at(const std::string& name);
const ActionX& get(const std::string& name) const;
const ActionX& get(std::size_t index) const;
std::vector<const ActionX *> pending(std::time_t sim_time) const;
std::vector<ActionX>::const_iterator begin() const;
std::vector<ActionX>::const_iterator end() const;
private:
std::map<std::string, ActionX> actions;
std::vector<ActionX> actions;
};
}
}
#endif

View File

@@ -17,34 +17,63 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UDQWELLSET_HPP
#define UDQWELLSET_HPP
#ifndef ACTIONX_CONDITION_HPP
#define ACTIONX_CONDITION_HPP
#include <vector>
#include <string>
#include <unordered_map>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQSet.hpp>
#include <vector>
namespace Opm {
class UDQWellSet : public UDQSet {
namespace Action {
class Quantity {
public:
UDQWellSet(const std::string& name, const std::vector<std::string>& wells);
UDQWellSet(const std::string& name, const std::vector<std::string>& wells, const UDQSet& values);
UDQWellSet(const std::string& name, const std::vector<std::string>& wells, double scalar_value);
void assign(const std::string& well, double value);
void assign(double value);
const UDQScalar& operator[](const std::string& well) const;
private:
std::size_t wellIndex(const std::string& well) const;
std::unordered_map<std::string, std::size_t> well_index;
Quantity() = default;
Quantity(const std::string& arg) :
quantity(arg)
{}
void add_arg(const std::string& arg);
std::string quantity;
std::vector<std::string> args;
};
class Condition {
public:
enum class Logical {
AND,
OR,
END
};
enum class Comparator {
EQUAL,
GREATER,
LESS,
GREATER_EQUAL,
LESS_EQUAL,
INVALID
};
Condition(const std::vector<std::string>& tokens, const std::pair<std::string, std::size_t>& location);
Quantity lhs;
Quantity rhs;
Logical logic = Logical::END;
Comparator cmp = Comparator::INVALID;
std::string cmp_string;
};
}
}
#endif

View File

@@ -90,17 +90,17 @@ class DynamicState {
}
std::vector<std::pair<std::size_t, T>> unique() {
std::vector<std::pair<std::size_t, T>> unique() const {
if (this->m_data.empty())
return {};
auto& current_value = this->m_data[0];
const auto * current_value = std::addressof(this->m_data[0]);
std::size_t current_index = 0;
std::vector<std::pair<std::size_t, T>> result{{current_index, current_value}};
std::vector<std::pair<std::size_t, T>> result{{current_index, *current_value}};
while (true) {
if (this->m_data[current_index] != current_value) {
current_value = this->m_data[current_index];
result.emplace_back(current_index, current_value);
if (this->m_data[current_index] != *current_value) {
current_value = std::addressof(this->m_data[current_index]);
result.emplace_back(current_index, *current_value);
}
current_index++;
@@ -203,6 +203,10 @@ class DynamicState {
}
std::size_t size() const {
return this->m_data.size();
}
private:
std::vector< T > m_data;
size_t initial_range;

View File

@@ -1,151 +0,0 @@
/*
Copyright 2013 Statoil ASA.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GROUP_HPP_
#define GROUP_HPP_
#include <memory>
#include <set>
#include <string>
#include <stddef.h>
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
#include <opm/parser/eclipse/EclipseState/Runspec.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/DynamicState.hpp>
namespace Opm {
class TimeMap;
namespace GroupInjection {
struct InjectionData {
explicit InjectionData( const TimeMap& );
DynamicState< Phase > phase;
DynamicState< GroupInjection::ControlEnum > controlMode;
DynamicState< double > rate;
DynamicState< double > surfaceFlowMaxRate;
DynamicState< double > reservoirFlowMaxRate;
DynamicState< double > targetReinjectFraction;
DynamicState< double > targetVoidReplacementFraction;
};
}
namespace GroupProduction {
struct ProductionData {
explicit ProductionData( const TimeMap& );
DynamicState< GroupProduction::ControlEnum > controlMode;
DynamicState< GroupProductionExceedLimit::ActionEnum > exceedAction;
DynamicState< double > oilTarget;
DynamicState< double > waterTarget;
DynamicState< double > gasTarget;
DynamicState< double > liquidTarget;
DynamicState< double > reservoirVolumeTarget;
};
}
class Group {
public:
Group(const std::string& name, const size_t& seqIndex, const TimeMap& timeMap , size_t creationTimeStep);
bool hasBeenDefined(size_t timeStep) const;
const std::string& name() const;
const size_t& seqIndex() const;
bool isProductionGroup(size_t timeStep) const;
bool isInjectionGroup(size_t timeStep) const;
void setProductionGroup(size_t timeStep, bool isProductionGroup);
void setInjectionGroup(size_t timeStep, bool isInjectionGroup_);
/******************************************************************/
void setInjectionPhase(size_t time_step, Phase);
Phase getInjectionPhase(size_t time_step) const;
void setInjectionControlMode(size_t time_step , GroupInjection::ControlEnum ControlMode);
GroupInjection::ControlEnum getInjectionControlMode( size_t time_step) const;
void setInjectionRate(size_t time_step , double rate);
double getInjectionRate( size_t time_step) const;
void setSurfaceMaxRate( size_t time_step , double rate);
double getSurfaceMaxRate( size_t time_step ) const;
void setReservoirMaxRate( size_t time_step , double rate);
double getReservoirMaxRate( size_t time_step ) const;
void setTargetReinjectFraction( size_t time_step , double rate);
double getTargetReinjectFraction( size_t time_step ) const;
void setTargetVoidReplacementFraction( size_t time_step , double rate);
double getTargetVoidReplacementFraction( size_t time_step ) const;
/******************************************************************/
void setProductionControlMode( size_t time_step , GroupProduction::ControlEnum controlMode);
GroupProduction::ControlEnum getProductionControlMode( size_t time_step ) const;
GroupProductionExceedLimit::ActionEnum getProductionExceedLimitAction(size_t time_step) const;
void setProductionExceedLimitAction(size_t time_step , GroupProductionExceedLimit::ActionEnum action);
void setOilTargetRate(size_t time_step , double oilTargetRate);
double getOilTargetRate(size_t time_step) const;
void setGasTargetRate(size_t time_step , double gasTargetRate);
double getGasTargetRate(size_t time_step) const;
void setWaterTargetRate(size_t time_step , double waterTargetRate);
double getWaterTargetRate(size_t time_step) const;
void setLiquidTargetRate(size_t time_step , double liquidTargetRate);
double getLiquidTargetRate(size_t time_step) const;
void setReservoirVolumeTargetRate(size_t time_step , double reservoirVolumeTargetRate);
double getReservoirVolumeTargetRate(size_t time_step) const;
void setGroupEfficiencyFactor(size_t time_step, double factor);
double getGroupEfficiencyFactor(size_t time_step) const;
void setTransferGroupEfficiencyFactor(size_t time_step, bool transfer);
bool getTransferGroupEfficiencyFactor(size_t time_step) const;
void setGroupNetVFPTable(size_t time_step, int table);
int getGroupNetVFPTable(size_t time_step) const;
static bool groupNameInGroupNamePattern(const std::string& groupName, const std::string& groupNamePattern);
/*****************************************************************/
bool hasWell(const std::string& wellName , size_t time_step) const;
const std::set< std::string >& getWells( size_t time_step ) const;
size_t numWells(size_t time_step) const;
void addWell(size_t time_step, const std::string& well_name);
void delWell(size_t time_step, const std::string& wellName );
private:
size_t m_creationTimeStep;
std::string m_name;
size_t m_seqIndex;
GroupInjection::InjectionData m_injection;
GroupProduction::ProductionData m_production;
DynamicState< std::set< std::string > > m_wells;
DynamicState<int> m_isProductionGroup;
DynamicState<int> m_isInjectionGroup;
DynamicState<double> m_efficiencyFactor;
DynamicState<int> m_transferEfficiencyFactor;
DynamicState<int> m_groupNetVFPTable;
};
}
#endif /* GROUP_HPP_ */

View File

@@ -0,0 +1,56 @@
/*
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 <vector>
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
#ifndef GROUPTREE2
#define GROUPTREE2
namespace Opm {
class GTNode {
public:
GTNode(const Group2& group, const GTNode* parent);
void add_group(const GTNode& child_group);
void add_well(const Well2& well);
const std::vector<Well2>& wells() const;
const std::vector<GTNode>& groups() const;
const std::string& name() const;
const GTNode& parent() const;
const Group2& group() const;
private:
const Group2 m_group;
const GTNode * m_parent;
/*
Class T with a stl container <T> - supposedly undefined behavior before
C++17 - but it compiles without warnings.
*/
std::vector<GTNode> m_child_groups;
std::vector<Well2> m_wells;
};
}
#endif

View File

@@ -0,0 +1,227 @@
/*
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 GROUP2_HPP
#define GROUP2_HPP
#include <string>
#include <opm/parser/eclipse/Deck/UDAValue.hpp>
#include <opm/parser/eclipse/EclipseState/Util/IOrderSet.hpp>
#include <opm/parser/eclipse/EclipseState/Runspec.hpp>
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
namespace Opm {
class SummaryState;
class Group2 {
public:
// A group can have both injection controls and production controls set at
// the same time, i.e. this enum is used as a bitmask.
enum class GroupType : unsigned {
NONE = 0,
PRODUCTION = 1,
INJECTION = 2,
MIXED = 3
};
enum class ExceedAction {
NONE = 0,
CON = 1,
CON_PLUS = 2, // String: "+CON"
WELL = 3,
PLUG = 4,
RATE = 5
};
static const std::string ExceedAction2String( ExceedAction enumValue );
static ExceedAction ExceedActionFromString( const std::string& stringValue );
enum class InjectionCMode : int {
NONE = 0,
RATE = 1,
RESV = 2,
REIN = 4,
VREP = 8,
FLD = 16
};
static const std::string InjectionCMode2String( InjectionCMode enumValue );
static InjectionCMode InjectionCModeFromString( const std::string& stringValue );
enum class ProductionCMode : int {
NONE = 0,
ORAT = 1,
WRAT = 2,
GRAT = 4,
LRAT = 8,
CRAT = 16,
RESV = 32,
PRBL = 64,
FLD = 128
};
static const std::string ProductionCMode2String( ProductionCMode enumValue );
static ProductionCMode ProductionCModeFromString( const std::string& stringValue );
enum class GuideRateTarget {
OIL = 0,
WAT = 1,
GAS = 2,
LIQ = 3,
RES = 4,
COMB = 5,
WGA = 6,
CVAL = 7,
INJV = 8,
POTN = 9,
FORM = 10,
NO_GUIDE_RATE = 11
};
static GuideRateTarget GuideRateTargetFromString( const std::string& stringValue );
struct GroupInjectionProperties {
Phase phase = Phase::WATER;
InjectionCMode cmode = InjectionCMode::NONE;
UDAValue surface_max_rate;
UDAValue resv_max_rate;
UDAValue target_reinj_fraction;
UDAValue target_void_fraction;
int injection_controls = 0;
bool operator==(const GroupInjectionProperties& other) const;
bool operator!=(const GroupInjectionProperties& other) const;
};
struct InjectionControls {
Phase phase;
InjectionCMode cmode;
double surface_max_rate;
double resv_max_rate;
double target_reinj_fraction;
double target_void_fraction;
int injection_controls = 0;
bool has_control(InjectionCMode control) const;
};
struct GroupProductionProperties {
ProductionCMode cmode = ProductionCMode::NONE;
ExceedAction exceed_action = ExceedAction::NONE;
UDAValue oil_target;
UDAValue water_target;
UDAValue gas_target;
UDAValue liquid_target;
double guide_rate;
GuideRateTarget guide_rate_def;
double resv_target = 0;
int production_controls = 0;
bool operator==(const GroupProductionProperties& other) const;
bool operator!=(const GroupProductionProperties& other) const;
};
struct ProductionControls {
ProductionCMode cmode;
ExceedAction exceed_action;
double oil_target;
double water_target;
double gas_target;
double liquid_target;
double guide_rate;
GuideRateTarget guide_rate_def;
double resv_target = 0;
int production_controls = 0;
bool has_control(ProductionCMode control) const;
};
Group2(const std::string& group_name, std::size_t insert_index_arg, std::size_t init_step_arg, double udq_undefined_arg, const UnitSystem& unit_system);
bool defined(std::size_t timeStep) const;
std::size_t insert_index() const;
const std::string& name() const;
int getGroupNetVFPTable() const;
bool updateNetVFPTable(int vfp_arg);
bool update_gefac(double gefac, bool transfer_gefac);
const std::string& parent() const;
bool updateParent(const std::string& parent);
bool updateInjection(const GroupInjectionProperties& injection);
bool updateProduction(const GroupProductionProperties& production);
bool isProductionGroup() const;
bool isInjectionGroup() const;
void setProductionGroup();
void setInjectionGroup();
double getGroupEfficiencyFactor() const;
bool getTransferGroupEfficiencyFactor() const;
std::size_t numWells() const;
bool addGroup(const std::string& group_name);
bool hasGroup(const std::string& group_name) const;
void delGroup(const std::string& group_name);
bool addWell(const std::string& well_name);
bool hasWell(const std::string& well_name) const;
void delWell(const std::string& well_name);
const std::vector<std::string>& wells() const;
const std::vector<std::string>& groups() const;
bool wellgroup() const;
ProductionControls productionControls(const SummaryState& st) const;
InjectionControls injectionControls(const SummaryState& st) const;
const GroupProductionProperties& productionProperties() const;
const GroupInjectionProperties& injectionProperties() const;
ProductionCMode production_cmode() const;
InjectionCMode injection_cmode() const;
Phase injection_phase() const;
bool has_control(ProductionCMode control) const;
bool has_control(InjectionCMode control) const;
private:
bool hasType(GroupType gtype) const;
void addType(GroupType new_gtype);
std::string m_name;
std::size_t m_insert_index;
std::size_t init_step;
double udq_undefined;
UnitSystem unit_system;
GroupType group_type;
double gefac;
bool transfer_gefac;
int vfp_table;
std::string parent_group;
IOrderSet<std::string> m_wells;
IOrderSet<std::string> m_groups;
GroupInjectionProperties injection_properties{};
GroupProductionProperties production_properties{};
};
Group2::GroupType operator |(Group2::GroupType lhs, Group2::GroupType rhs);
Group2::GroupType operator &(Group2::GroupType lhs, Group2::GroupType rhs);
}
#endif

View File

@@ -0,0 +1,98 @@
/*
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 GUIDE_RATE_HPP
#define GUIDE_RATE_HPP
#include <string>
#include <cstddef>
#include <ctime>
#include <unordered_map>
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp>
namespace Opm {
class Schedule;
class GuideRate {
private:
struct GuideRateValue {
GuideRateValue() = default;
GuideRateValue(double t, double v, GuideRateModel::Target tg):
sim_time(t),
value(v),
target(tg)
{}
bool operator==(const GuideRateValue& other) const {
return (this->sim_time == other.sim_time &&
this->value == other.value);
}
bool operator!=(const GuideRateValue& other) const {
return !(*this == other);
}
double eval(GuideRateModel::Target target_arg) const;
double sim_time;
double value;
GuideRateModel::Target target;
};
struct Potential {
Potential() = default;
Potential(double op, double gp, double wp) :
oil_pot(op),
gas_pot(gp),
wat_pot(wp)
{}
double eval(Group2::GuideRateTarget target) const;
double eval(Well2::GuideRateTarget target) const;
double oil_pot;
double gas_pot;
double wat_pot;
};
public:
GuideRate(const Schedule& schedule);
void compute(const std::string& wgname, size_t report_step, double sim_time, double oil_pot, double gas_pot, double wat_pot);
double get(const std::string& well, Well2::GuideRateTarget target) const;
double get(const std::string& group, Group2::GuideRateTarget target) const;
private:
void well_compute(const std::string& wgname, size_t report_step, double sim_time, double oil_pot, double gas_pot, double wat_pot);
void group_compute(const std::string& wgname, size_t report_step, double sim_time, double oil_pot, double gas_pot, double wat_pot);
double eval_form(const GuideRateModel& model, double oil_pot, double gas_pot, double wat_pot, const GuideRateValue * prev) const;
double eval_group_pot() const;
double eval_group_resvinj() const;
std::unordered_map<std::string,GuideRateValue> values;
std::unordered_map<std::string,Potential> potentials;
const Schedule& schedule;
};
}
#endif

View File

@@ -0,0 +1,65 @@
/*
Copyright 2019 Equinor ASA.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GUIDE_RATE_CONFIG_HPP
#define GUIDE_RATE_CONFIG_HPP
#include <string>
#include <unordered_map>
#include <memory>
#include <opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateModel.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
namespace Opm {
class GuideRateConfig {
public:
struct Well {
double guide_rate;
Well2::GuideRateTarget target;
double scaling_factor;
};
struct Group {
double guide_rate;
Group2::GuideRateTarget target;
};
const GuideRateModel& model() const;
bool has_model() const;
bool update_model(const GuideRateModel& model);
void update_well(const Well2& well);
void update_group(const Group2& group);
const Well& well(const std::string& well) const;
const Group& group(const std::string& group) const;
bool has_well(const std::string& well) const;
bool has_group(const std::string& group) const;
private:
std::shared_ptr<GuideRateModel> m_model;
std::unordered_map<std::string, Well> wells;
std::unordered_map<std::string, Group> groups;
};
}
#endif

View File

@@ -0,0 +1,93 @@
/*
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 GUIDE_RATE_MODEL_HPP
#define GUIDE_RATE_MODEL_HPP
#include <opm/parser/eclipse/Deck/UDAValue.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
namespace Opm {
class GuideRateModel {
public:
enum class Target {
OIL = 0,
LIQ = 1,
GAS = 2,
WAT = 3,
RES = 4,
COMB = 5,
NONE = 6
};
static Target TargetFromString(const std::string& s);
GuideRateModel(double time_interval_arg,
Target target_arg,
double A_arg,
double B_arg,
double C_arg,
double D_arg,
double E_arg,
double F_arg,
bool allow_increase_arg,
double damping_factor_arg,
bool use_free_gas_arg);
GuideRateModel() = default;
bool updateLINCOM(const UDAValue& alpha, const UDAValue& beta, const UDAValue& gamma);
double eval(double oil_pot, double gas_pot, double wat_pot) const;
double update_delay() const;
bool allow_increase() const;
double damping_factor() const;
bool operator==(const GuideRateModel& other) const;
bool operator!=(const GuideRateModel& other) const;
Target target() const;
static Target convert_target(Group2::GuideRateTarget group_target);
static Target convert_target(Well2::GuideRateTarget well_target);
private:
double pot(double oil_pot, double gas_pot, double wat_pot) const;
/*
Unfortunately the default values will give a GuideRateModel which can not
be evaluated, due to a division by zero problem.
*/
double time_interval = 0;
Target m_target = Target::NONE;
double A = 0;
double B = 0;
double C = 0;
double D = 0;
double E = 0;
double F = 0;
bool allow_increase_ = true;
double damping_factor_ = 1.0;
bool use_free_gas = false;
bool default_model = true;
UDAValue alpha;
UDAValue beta;
UDAValue gamma;
};
}
#endif

View File

@@ -1,73 +0,0 @@
/*
Copyright 2013 Statoil ASA.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GROUPTREE_HPP
#define GROUPTREE_HPP
#include <string>
#include <vector>
#include <map>
namespace Opm {
class GroupTree {
public:
struct group {
std::string name;
std::string parent;
bool operator<( const group& rhs ) const;
bool operator==( const std::string& name ) const;
bool operator!=( const std::string& name ) const;
bool operator<( const std::string& name ) const;
bool operator==( const group& rhs ) const;
bool operator!=( const group& rhs ) const;
};
void update( const std::string& name);
void update( const std::string& name, const std::string& parent);
void updateSeqIndex( const std::string& name, const std::string& other_parent);
bool exists( const std::string& group ) const;
const std::string& parent( const std::string& name ) const;
std::vector< std::string > children( const std::string& parent ) const;
const std::map<std::string , size_t>& nameSeqIndMap() const;
const std::map<size_t, std::string >& seqIndNameMap() const;
bool operator==( const GroupTree& ) const;
bool operator!=( const GroupTree& ) const;
std::vector<GroupTree::group>::const_iterator begin() const;
std::vector<GroupTree::group>::const_iterator end() const;
private:
std::vector< group >::iterator find( const std::string& );
friend bool operator<( const std::string&, const group& );
std::vector< group > groups = { group { "FIELD", "" } };
std::map<std::string , size_t> m_nameSeqIndMap;
std::map<size_t, std::string > m_seqIndNameMap;
};
std::ostream& operator<<(std::ostream& stream, const GroupTree& gt);
}
#endif /* GROUPTREE_HPP */

View File

@@ -23,7 +23,6 @@
#include <vector>
#include <map>
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.hpp>
namespace Opm {
@@ -32,6 +31,31 @@ namespace Opm {
class WellSegments {
public:
enum class LengthDepth{
INC = 0,
ABS = 1
};
static const std::string LengthDepthToString(LengthDepth enumValue);
static LengthDepth LengthDepthFromString(const std::string& stringValue);
enum class CompPressureDrop {
HFA = 0,
HF_ = 1,
H__ = 2
};
static const std::string CompPressureDropToString(CompPressureDrop enumValue);
static CompPressureDrop CompPressureDropFromString(const std::string& stringValue);
enum class MultiPhaseModel {
HO = 0,
DF = 1
};
static const std::string MultiPhaseModelToString(MultiPhaseModel enumValue);
static MultiPhaseModel MultiPhaseModelFromString(const std::string& stringValue);
WellSegments() = default;
const std::string& wellName() const;
@@ -40,8 +64,8 @@ namespace Opm {
double lengthTopSegment() const;
double volumeTopSegment() const;
WellSegment::CompPressureDropEnum compPressureDrop() const;
WellSegment::MultiPhaseModelEnum multiPhaseModel() const;
CompPressureDrop compPressureDrop() const;
MultiPhaseModel multiPhaseModel() const;
// mapping the segment number to the index in the vector of segments
int segmentNumberToIndex(const int segment_number) const;
@@ -63,7 +87,6 @@ namespace Opm {
void processABS();
void processINC(const bool first_time);
// name of the well
std::string m_well_name;
// depth of the nodal point of the top segment
// it is taken as the BHP reference depth of the well
@@ -74,11 +97,11 @@ namespace Opm {
// effective wellbore volume of the top segment
double m_volume_top;
// type of the tubing length and depth information
WellSegment::LengthDepthEnum m_length_depth_type;
LengthDepth m_length_depth_type;
// components of the pressure drop to be included
WellSegment::CompPressureDropEnum m_comp_pressure_drop;
CompPressureDrop m_comp_pressure_drop;
// multi-phase flow model
WellSegment::MultiPhaseModelEnum m_multiphase_model;
MultiPhaseModel m_multiphase_model;
// There are X and Y cooridnate of the nodal point of the top segment
// Since they are not used for simulations and we are not supporting plotting,
// we are not handling them at the moment.

View File

@@ -27,8 +27,9 @@
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.hpp>
namespace Opm {
WellConnections * newConnectionsWithSegments(const DeckKeyword& compsegs, const WellConnections& input_connections,
const WellSegments& segments, const EclipseGrid& grid);
WellConnections * newConnectionsWithSegments(const DeckKeyword& compsegs, const WellConnections& input_connections,
const WellSegments& segments, const EclipseGrid& grid,
const ParseContext& parseContext, ErrorGuard& errors);
}
#endif

View File

@@ -23,8 +23,6 @@
#include <memory>
#include <vector>
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
namespace Opm
{
/*
@@ -35,12 +33,19 @@ namespace Opm
*/
class OilVaporizationProperties {
public:
enum class OilVaporization {
UNDEF = 0,
VAPPARS = 1,
DRDT = 2 // DRSDT or DRVDT
};
explicit OilVaporizationProperties(const size_t numPvtReginIdx);
static void updateDRSDT(Opm::OilVaporizationProperties& ovp, const std::vector<double>& maxDRSDT, const std::vector<std::string>& option);
static void updateDRVDT(Opm::OilVaporizationProperties& ovp, const std::vector<double>& maxDRVDT);
static void updateVAPPARS(Opm::OilVaporizationProperties& ovp, const std::vector<double>& vap1, const std::vector<double>& vap2);
Opm::OilVaporizationEnum getType() const;
OilVaporization getType() const;
double getVap1(const size_t pvtRegionIdx) const;
double getVap2(const size_t pvtRegionIdx) const;
double getMaxDRSDT(const size_t pvtRegionIdx) const;
@@ -59,7 +64,7 @@ namespace Opm
bool operator!=( const OilVaporizationProperties& ) const;
private:
Opm::OilVaporizationEnum m_type = OilVaporizationEnum::UNDEF;
OilVaporization m_type = OilVaporization::UNDEF;
std::vector<double> m_vap1;
std::vector<double> m_vap2;
std::vector<double> m_maxDRSDT;

View File

@@ -31,6 +31,26 @@ namespace Opm {
class TimeMap;
class RFTConfig {
public:
enum class RFT {
YES = 1,
REPT = 2,
TIMESTEP = 3,
FOPN = 4,
NO = 5
};
static std::string RFT2String(RFT enumValue);
static RFT RFTFromString(const std::string &stringValue);
enum class PLT {
YES = 1,
REPT = 2,
TIMESTEP = 3,
NO = 4
};
static std::string PLT2String(PLT enumValue);
static PLT PLTFromString( const std::string& stringValue);
explicit RFTConfig(const TimeMap& time_map);
bool rft(const std::string& well, std::size_t report_step) const;
bool plt(const std::string& well, std::size_t report_step) const;
@@ -40,16 +60,16 @@ public:
bool active(std::size_t report_step) const;
std::size_t firstRFTOutput() const;
void updateRFT(const std::string& well, std::size_t report_step, RFTConnections::RFTEnum value);
void updatePLT(const std::string& well, std::size_t report_step, PLTConnections::PLTEnum value);
void updateRFT(const std::string& well, std::size_t report_step, RFT value);
void updatePLT(const std::string& well, std::size_t report_step, PLT value);
void addWellOpen(const std::string& well, std::size_t report_step);
private:
const TimeMap& tm;
std::pair<bool, std::size_t> well_open_rft_time;
std::unordered_set<std::string> well_open_rft_name;
std::unordered_map<std::string, std::size_t> well_open;
std::unordered_map<std::string, DynamicState<std::pair<RFTConnections::RFTEnum, std::size_t>>> rft_config;
std::unordered_map<std::string, DynamicState<std::pair<PLTConnections::PLTEnum, std::size_t>>> plt_config;
std::unordered_map<std::string, DynamicState<std::pair<RFT, std::size_t>>> rft_config;
std::unordered_map<std::string, DynamicState<std::pair<PLT, std::size_t>>> plt_config;
};
}

View File

@@ -28,10 +28,10 @@
#include <opm/parser/eclipse/EclipseState/Schedule/DynamicState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/DynamicVector.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Events.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Group.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/GroupTree.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Group/GTNode.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateConfig.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/OilVaporizationProperties.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Tuning.hpp>
#include <opm/parser/eclipse/EclipseState/Util/OrderedMap.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/MessageLimits.hpp>
@@ -39,14 +39,54 @@
#include <opm/parser/eclipse/EclipseState/Schedule/RFTConfig.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/VFPInjTable.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WellTestConfig.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Action/Actions.hpp>
/*
The DynamicState<std::shared_ptr<T>> pattern: The quantities in the Schedule
section like e.g. wellrates and completion properties are typically
characterized by the following behaviour:
1. They can be updated repeatedly at arbitrary points in the Schedule
section.
2. The value set at one timestep will apply until is explicitly set again at
a later timestep.
These properties are typically stored in a DynamicState<T> container; the
DynamicState<T> class is a container which implements this semantics:
1. It is legitimate to ask for an out-of-range value, you will then get the
last value which has been set.
2. When assigning an out-of-bounds value the container will append the
currently set value until correct length has been reached, and then the
new value will be assigned.
3. The DynamicState<T> has an awareness of the total length of the time
axis, trying to access values beyound that is illegal.
For many of the non-trival objects like eg Well2 and Group2 the DynamicState<>
contains a shared pointer to an underlying object, that way the fill operation
when the vector is resized is quite fast. The following pattern is quite
common for the Schedule implementation:
// Create a new well object.
std::shared_ptr<Well> new_well = this->getWell2( well_name, time_step );
// Update the new well object with new settings from the deck, the
// updateXXXX() method will return true if the well object was actually
// updated:
if (new_well->updateRate( new_rate ))
this->dynamic_state.update( time_step, new_well);
*/
namespace Opm
{
class Actions;
class Deck;
class DeckKeyword;
@@ -61,7 +101,8 @@ namespace Opm
class UnitSystem;
class ErrorGuard;
class WListManager;
class UDQInput;
class UDQConfig;
class UDQActive;
class Schedule {
public:
@@ -115,39 +156,47 @@ namespace Opm
size_t numWells() const;
size_t numWells(size_t timestep) const;
bool hasWell(const std::string& wellName) const;
bool hasWell(const std::string& wellName, std::size_t timeStep) const;
std::vector<std::string> wellNames(const std::string& pattern, size_t timeStep, const std::vector<std::string>& matching_wells = {}) const;
std::vector<std::string> wellNames(const std::string& pattern) const;
std::vector<std::string> wellNames(size_t timeStep) const;
std::vector<std::string> wellNames() const;
std::vector<std::string> groupNames(const std::string& pattern, size_t timeStep) const;
std::vector<std::string> groupNames(size_t timeStep) const;
std::vector<std::string> groupNames(const std::string& pattern) const;
std::vector<std::string> groupNames() const;
void updateWell(std::shared_ptr<Well2> well, size_t reportStep);
const Well2& getWell2(const std::string& wellName, size_t timeStep) const;
std::vector< const Well2* > getChildWells2(const std::string& group_name, size_t timeStep, GroupWellQueryMode query_mode) const;
const Well* getWell(const std::string& wellName) const;
std::vector< const Well* > getOpenWells(size_t timeStep) const;
std::vector< const Well* > getWells() const;
std::vector< const Well* > getWells(size_t timeStep) const;
std::vector< const Well* > getChildWells(const std::string& group_name, size_t timeStep, GroupWellQueryMode query_mode) const;
const Well2& getWell2atEnd(const std::string& well_name) const;
std::vector<Well2> getWells2(size_t timeStep) const;
std::vector<Well2> getWells2atEnd() const;
std::vector<const Group2*> getChildGroups2(const std::string& group_name, size_t timeStep) const;
std::vector<Well2> getChildWells2(const std::string& group_name, size_t timeStep) const;
const OilVaporizationProperties& getOilVaporizationProperties(size_t timestep) const;
const UDQActive& udqActive(size_t timeStep) const;
const WellTestConfig& wtestConfig(size_t timestep) const;
const WListManager& getWListManager(size_t timeStep) const;
const UDQInput& getUDQConfig(size_t timeStep) const;
const Actions& actions() const;
const UDQConfig& getUDQConfig(size_t timeStep) const;
const Action::Actions& actions(std::size_t timeStep) const;
void evalAction(const SummaryState& summary_state, size_t timeStep);
const GroupTree& getGroupTree(size_t t) const;
std::vector< const Group* > getChildGroups(const std::string& group_name, size_t timeStep) const;
GTNode groupTree(std::size_t report_step) const;
GTNode groupTree(const std::string& root_node, std::size_t report_step) const;
size_t numGroups() const;
size_t numGroups(size_t timeStep) const;
bool hasGroup(const std::string& groupName) const;
const Group& getGroup(const std::string& groupName) const;
std::vector< const Group* > getGroups() const;
std::vector< const Group* > getGroups(size_t timeStep) const;
bool hasGroup(const std::string& groupName, std::size_t timeStep) const;
const Group2& getGroup2(const std::string& groupName, size_t timeStep) const;
const Tuning& getTuning() const;
const MessageLimits& getMessageLimits() const;
void invalidNamePattern (const std::string& namePattern, const ParseContext& parseContext, ErrorGuard& errors, const DeckKeyword& keyword) const;
const GuideRateConfig& guideRateConfig(size_t timeStep) const;
const RFTConfig& rftConfig() const;
const Events& getEvents() const;
@@ -166,13 +215,12 @@ namespace Opm
void filterConnections(const EclipseGrid& grid);
size_t size() const;
void applyAction(size_t reportStep, const ActionX& action, const std::vector<std::string>& matching_wells);
void applyAction(size_t reportStep, const Action::ActionX& action, const Action::Result& result);
int getNupcol(size_t reportStep) const;
private:
TimeMap m_timeMap;
OrderedMap< std::string, Well > m_wells;
OrderedMap< std::string, Group > m_groups;
OrderedMap< std::string, DynamicState<std::shared_ptr<Well2>>> wells_static;
DynamicState< GroupTree > m_rootGroupTree;
OrderedMap< std::string, DynamicState<std::shared_ptr<Group2>>> groups;
DynamicState< OilVaporizationProperties > m_oilvaporizationproperties;
Events m_events;
DynamicVector< Deck > m_modifierDeck;
@@ -183,35 +231,43 @@ namespace Opm
std::map<int, DynamicState<std::shared_ptr<VFPInjTable>>> vfpinj_tables;
DynamicState<std::shared_ptr<WellTestConfig>> wtest_config;
DynamicState<std::shared_ptr<WListManager>> wlist_manager;
DynamicState<std::shared_ptr<UDQInput>> udq_config;
DynamicState<WellProducer::ControlModeEnum> global_whistctl_mode;
DynamicState<std::shared_ptr<UDQConfig>> udq_config;
DynamicState<std::shared_ptr<UDQActive>> udq_active;
DynamicState<std::shared_ptr<GuideRateConfig>> guide_rate_config;
DynamicState<Well2::ProducerCMode> global_whistctl_mode;
DynamicState<std::shared_ptr<Action::Actions>> m_actions;
RFTConfig rft_config;
DynamicState<int> m_nupcol;
Actions m_actions;
std::vector< Well* > getWells(const std::string& wellNamePattern, const std::vector<std::string>& matching_wells = {});
std::vector< Group* > getGroups(const std::string& groupNamePattern);
std::map<std::string,Events> well_events;
bool updateWellStatus( const std::string& well, size_t reportStep , WellCommon::StatusEnum status);
void addWellToGroup( Group& newGroup , const std::string& wellName , size_t timeStep);
GTNode groupTree(const std::string& root_node, std::size_t report_step, const GTNode * parent) const;
void updateGroup(std::shared_ptr<Group2> group, size_t reportStep);
bool checkGroups(const ParseContext& parseContext, ErrorGuard& errors);
void updateUDQActive( std::size_t timeStep, std::shared_ptr<UDQActive> udq );
bool updateWellStatus( const std::string& well, size_t reportStep , Well2::Status status);
void addWellToGroup( const std::string& group_name, const std::string& well_name , size_t timeStep);
void iterateScheduleSection(const ParseContext& parseContext , ErrorGuard& errors, const SCHEDULESection& , const EclipseGrid& grid,
const Eclipse3DProperties& eclipseProperties);
bool handleGroupFromWELSPECS(const std::string& groupName, GroupTree& newTree) const;
void addGroup(const std::string& groupName , size_t timeStep);
void addWell(const std::string& wellName, const DeckRecord& record, size_t timeStep, WellCompletion::CompletionOrderEnum wellCompletionOrder);
void addACTIONX(const Action::ActionX& action, std::size_t currentStep);
void addGroupToGroup( const std::string& parent_group, const std::string& child_group, size_t timeStep);
void addGroupToGroup( const std::string& parent_group, const Group2& child_group, size_t timeStep);
void addGroup(const std::string& groupName , size_t timeStep, const UnitSystem& unit_system);
void addWell(const std::string& wellName, const DeckRecord& record, size_t timeStep, Connection::Order connection_order, const UnitSystem& unit_system);
void handleUDQ(const DeckKeyword& keyword, size_t currentStep);
void handleWLIST(const DeckKeyword& keyword, size_t currentStep);
void handleCOMPORD(const ParseContext& parseContext, ErrorGuard& errors, const DeckKeyword& compordKeyword, size_t currentStep);
void handleWELSPECS( const SCHEDULESection&, size_t, size_t );
void handleWELSPECS( const SCHEDULESection&, size_t, size_t , const UnitSystem& unit_system, const ParseContext& parseContext, ErrorGuard& errors);
void handleWCONHIST( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
void handleWCONPROD( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
void handleWGRUPCON( const DeckKeyword& keyword, size_t currentStep);
void handleCOMPDAT( const DeckKeyword& keyword, size_t currentStep, const EclipseGrid& grid, const Eclipse3DProperties& eclipseProperties, const ParseContext& parseContext, ErrorGuard& errors);
void handleCOMPLUMP( const DeckKeyword& keyword, size_t currentStep );
void handleWELSEGS( const DeckKeyword& keyword, size_t currentStep);
void handleCOMPSEGS( const DeckKeyword& keyword, size_t currentStep, const EclipseGrid& grid);
void handleWCONINJE( const SCHEDULESection&, const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
void handleCOMPSEGS( const DeckKeyword& keyword, size_t currentStep, const EclipseGrid& grid, const ParseContext& parseContext, ErrorGuard& errors);
void handleWCONINJE( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
void handleWFOAM( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
void handleWPOLYMER( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
void handleWSOLVENT( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
void handleWTRACER( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
@@ -219,16 +275,19 @@ namespace Opm
void handleWPMITAB( const DeckKeyword& keyword, const size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
void handleWSKPTAB( const DeckKeyword& keyword, const size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
void handleWINJTEMP( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
void handleWCONINJH( const SCHEDULESection&, const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
void handleWCONINJH(const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
void handleWELOPEN( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors, const std::vector<std::string>& matching_wells = {});
void handleWELTARG( const SCHEDULESection&, const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
void handleGCONINJE( const SCHEDULESection&, const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
void handleGCONINJE( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
void handleGCONPROD( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
void handleGEFAC( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
void handleGUIDERAT( const DeckKeyword& keyword, size_t currentStep);
void handleLINCOM( const DeckKeyword& keyword, size_t currentStep);
void handleWEFAC( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
void handleTUNING( const DeckKeyword& keyword, size_t currentStep);
void handleGRUPTREE( const DeckKeyword& keyword, size_t currentStep);
void handleGRUPNET( const DeckKeyword& keyword, size_t currentStep);
void handleNUPCOL( const DeckKeyword& keyword, size_t currentStep);
void handleGRUPTREE( const DeckKeyword& keyword, size_t currentStep, const UnitSystem& unit_system, const ParseContext& parseContext, ErrorGuard& errors);
void handleGRUPNET( const DeckKeyword& keyword, size_t currentStep, const UnitSystem& unit_system);
void handleWRFT( const DeckKeyword& keyword, size_t currentStep);
void handleWTEST( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
void handleWRFTPLT( const DeckKeyword& keyword, size_t currentStep);
@@ -255,9 +314,6 @@ namespace Opm
const UnitSystem& unit_system,
std::vector<std::pair<const DeckKeyword*, size_t > >& rftProperties);
void addWellEvent(const std::string& well, ScheduleEvents::Events event, size_t reportStep);
#ifdef WELL_TEST
bool checkWells(const ParseContext& parseContext, ErrorGuard& errors) const;
#endif
};
}

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