Compare commits

...

4018 Commits

Author SHA1 Message Date
Arne Morten Kvarving
8e25265952 bump versions to 2018.04-rc1 2018-04-16 09:48:22 +02:00
Atgeirr Flø Rasmussen
fb4fbc318b Merge pull request #381 from akva2/mark_explicit
mark constructor explicit
2018-04-13 11:35:38 +02:00
Atgeirr Flø Rasmussen
b9f7e89c48 Merge pull request #380 from joakim-hove/vfp-rebase
Make VFP tables dynamic
2018-04-13 11:32:06 +02:00
Joakim Hove
e5c4c2b504 Handle changes to VFP tables during simulation
With this commit the VFP tables are stored internally in DynamicState<VFPxTable>
container, this facilitates updates to the VFP tables during the simulation. In
addition the default constructor and the ::init( ) method has been removed from
the VFPxTable implementations.
2018-04-12 19:02:15 +02:00
Joakim Hove
033362bed7 White space change 2018-04-12 19:00:22 +02:00
Joakim Hove
5d9c6f9fc4 Remove comments 2018-04-12 18:57:08 +02:00
Atgeirr Flø Rasmussen
438ccdebd0 Merge pull request #379 from joakim-hove/move-vfp-tables-api
Move vfp tables api
2018-04-12 11:20:27 +02:00
Arne Morten Kvarving
1bd6e9ca66 mark constructor explicit 2018-04-12 10:52:33 +02:00
Joakim Hove
a119dadb45 Add (unused) new constroctors 2018-04-11 08:10:53 +02:00
Joakim Hove
8d7e890967 Add argument timeStep to VFP access methods. 2018-04-11 06:23:28 +02:00
Joakim Hove
4d835fc759 Add events VFPINJ_UPDATE and VFPPROD_UPDATE 2018-04-11 06:19:24 +02:00
Joakim Hove
b8cdeefaec Add missing <mumeric> header 2018-04-11 06:14:56 +02:00
Joakim Hove
e131ca5d75 Merge pull request #378 from andlaus/internalize_WINJTEMP
internalize the WINJTEMP keyword
2018-04-11 06:11:02 +02:00
Andreas Lauser
10258f247b internalize the WINJTEMP keyword
currently the only quantity that us used is the well temperature,
i.e., specifying the fluid enthalpy does not have any effect.
2018-04-10 14:56:11 +02:00
Joakim Hove
d381110119 Merge pull request #374 from andlaus/add_PETOPTS
Add PETOPTS
2018-04-09 16:41:26 +02:00
Arne Morten Kvarving
bfb0cae466 Merge pull request #376 from akva2/missing_data_to_tests
fixed: missing OPM_DATA_ROOT -> OPM_TESTS_ROOT
2018-04-09 14:30:08 +02:00
Arne Morten Kvarving
f4a68c7e64 fixed: missing OPM_DATA_ROOT -> OPM_TESTS_ROOT 2018-04-09 10:56:59 +02:00
Andreas Lauser
ea5b35ac46 fix the definition of RSCONSTT
without setting the "size" item, an additional slash is needed to
terminate the keyword. this is not correct.
2018-04-06 14:23:17 +02:00
Andreas Lauser
0a4a256c78 add the PETOPTS keyword
this makes it more convenient to work with cases developed with PETREL
because it prevents the parser from choking on the unmodified output.
2018-04-06 13:24:06 +02:00
Joakim Hove
c37e5f9503 Move VFP tables to Schedule. 2018-04-06 12:42:47 +02:00
Atgeirr Flø Rasmussen
936f5e5963 Merge pull request #367 from joakim-hove/udq-start
Internalize UDQ keywords
2018-04-06 10:39:59 +02:00
Atgeirr Flø Rasmussen
cfec35903d Merge pull request #373 from joakim-hove/parse-symlink
Parse symlink
2018-04-06 09:26:49 +02:00
Joakim Hove
da8424e1e8 Add UDQ container class 2018-04-05 17:45:30 +02:00
Joakim Hove
8176c5a826 Add UDQExpression class - for one UDQ record 2018-04-05 17:45:30 +02:00
Joakim Hove
4a7410d412 Add UDQConfig object. 2018-04-05 17:42:23 +02:00
Joakim Hove
19a4960ff7 Add test for finding include files with symlinked main file. 2018-04-05 13:21:15 +02:00
Joakim Hove
b57a5628c7 Make sure the symlink based tests are run 2018-04-05 13:16:50 +02:00
Joakim Hove
5979131127 Merge pull request #371 from akva2/use_init_list
changed: use initializer list for enums
2018-04-04 18:20:02 +02:00
Atgeirr Flø Rasmussen
a846f7ad54 Merge pull request #372 from atgeirr/fix-missing-include
Add missing <cmath> include for std::fabs().
2018-04-04 15:23:28 +02:00
Atgeirr Flø Rasmussen
f250a87298 Add missing <cmath> include for std::fabs(). 2018-04-04 14:22:12 +02:00
Arne Morten Kvarving
0b9615947b changed: use initializer list for enums 2018-04-04 14:16:07 +02:00
Joakim Hove
b6d5995b7c Merge pull request #369 from joakim-hove/raw-string
Value type: RAW_STRING
2018-04-04 08:21:10 +02:00
Joakim Hove
c58e812421 Merge pull request #370 from joakim-hove/lgr-keywords
Add LGR related keywords
2018-04-03 14:35:19 +02:00
Joakim Hove
5ce9e64ec6 Add LGR related keywords 2018-04-03 10:55:59 +02:00
Joakim Hove
a65d6d7152 Add value type RAW_STRING
When parsing RAW_STRING items the following applies:

 - Quotes are retained - as in 'P20'
 - Asteriks are not replaced with defaults
2018-03-30 13:35:23 +02:00
Arne Morten Kvarving
92422a6e9a Merge pull request #352 from akva2/data_to_tests
Use regression test data from opm-tests, not opm-data
2018-03-27 14:56:04 +02:00
Arne Morten Kvarving
21aa4ac1e0 add some temporary backwards compat code
required until jenkins side scripting has been modified.
2018-03-27 12:09:09 +02:00
Arne Morten Kvarving
e823b0a93e changed: replace opm-data with new opm-tests repository 2018-03-27 12:09:09 +02:00
Joakim Hove
aa06db984c Remove unused enum for ParserItem value type 2018-03-26 17:04:08 +02:00
Joakim Hove
8058bab5ea Merge pull request #350 from joakim-hove/restart-embed-step
Embed restart_step in restarted summary writer.
2018-03-26 15:28:58 +02:00
Joakim Hove
e3758e41ea Merge pull request #368 from stefoss23/RemoveMessageContainer
Removed MessageContainer. OpmLog used instead.
2018-03-26 13:04:23 +02:00
Steinar Foss
d9ffb579e1 Removed MessageContainer. OpmLog used instead.
...

...

...

GenerateKeywords.cmake changed.

ParserContext.handleerror takes only two args.

Schedule: removed all MessageContainer.

...

...

...

GridProperties: removed MessageContiner.

...

Eclipse3DProperties: removed MessageContainer.

...

TabelManager:removed MessageContainer.

...

.nnn.

...

...

...

...

...

...

...

...

...

...

...

...

...
2018-03-26 10:15:18 +02:00
Atgeirr Flø Rasmussen
49c0d3fa83 Merge pull request #358 from tskille/master
Added routine for calculating cell volumes based on corner point input.
2018-03-23 09:22:27 +01:00
Joakim Hove
8706c5630f Merge pull request #366 from lars-petter-hauge/Eff_fac_historic_volumes
Add eff_fac for historic volumes
2018-03-23 08:56:12 +01:00
Joakim Hove
9eab56858c Merge pull request #364 from GitPaean/adding_keywords_SPOLYMW
adding keyword SPOLYMW
2018-03-22 17:13:01 +01:00
Lars Petter Øren Hauge
8040f32db9 Add eff_fac for historic volumes 2018-03-22 16:04:28 +01:00
Kai Bao
e02610c94a adding keyword SPOLYMW
to initialize the polymer molecular weight.
2018-03-22 15:28:08 +01:00
Joakim Hove
be6748d93f Merge pull request #365 from bska/expose-additional-dimension-values
Expose Additional Maximum Dimension Values to EclipseState Clients
2018-03-22 15:17:51 +01:00
Torbjørn skille
43d24d179e fixed typo in file CMakeLists_files.cmake 2018-03-22 14:58:01 +01:00
Bård Skaflestad
aa97b76fbb Runspec: Retrieve WSEGDIMS Default Values from Keyword Impl
Suggested by: [at]joakim-hove
2018-03-22 14:23:02 +01:00
Bård Skaflestad
da2b6aec77 Runspec: Add Support for Parsing Limited Subset of WSEGDIMS
Capture the maximum number of segmented wells, the maximum number of
segments per well, and the maximum number of lateral branches per
(segmented) well.

These maximum sizes are needed to correctly define portions of the
contents of the INTEHEAD vector in a restart step.
2018-03-22 11:14:51 +01:00
Bård Skaflestad
15eb84d3e9 Expose "REGDIMS" Keyword from TableManager
Some of these values are needed for restart purposes (go into the
INTEHEAD) vector.
2018-03-22 00:00:48 +01:00
Torbjørn skille
25fd3fcc14 updated name of function, and fix space around assignments 2018-03-20 14:40:21 +01:00
Torbjrn Skille
bee5699d79 Files renamed, forgot to add new files. Here they are 2018-03-19 19:56:16 +01:00
Torbjrn Skille
5374faa9b8 includes additional updates based on feedback from maintainer 2018-03-19 19:40:16 +01:00
Atgeirr Flø Rasmussen
b4d69b929d Merge pull request #360 from joakim-hove/ordered-groups
Ordered groups
2018-03-19 14:08:35 +01:00
Joakim Hove
f5a80f807f Using OrderedMap as container for groups 2018-03-18 19:33:58 +01:00
Joakim Hove
0dbabc19ca Added at() method to orderedmap. 2018-03-18 19:24:48 +01:00
Torbjrn Skille
c8f99ee59e code updated based on feedback from maintainer. 2018-03-16 19:47:58 +01:00
Torbjrn Skille
94beeb67cb Added reference to publication 2018-03-16 13:16:00 +01:00
Torbjrn Skille
9b1c421f0f Added routine for calculating cell volumes based on corner point input. 2018-03-16 12:52:53 +01:00
Joakim Hove
def103ec90 Merge pull request #356 from joakim-hove/input-units
Added pseudo unit system for untransformed input values.
2018-03-15 13:06:53 +01:00
Joakim Hove
2d8457e3a9 Added pseoudo unit system for untransformed input values. 2018-03-15 10:43:53 +01:00
Arne Morten Kvarving
84f44ac036 Merge pull request #354 from joakim-hove/timestep_fix
Timestep fix
2018-03-15 09:05:35 +01:00
Joakim Hove
e63283093c Merge pull request #355 from joakim-hove/add-keywords
Added new keyword LICENSE. Fixed misconfigured connection keywords
2018-03-14 12:09:03 +01:00
Joakim Hove
0ba730ba72 Added new keyword LICENSE. Fixed misconfigured connection keywords 2018-03-14 10:05:17 +01:00
Joakim Hove
1e5b532e78 Using sim_step when evaluating flowing wells. 2018-03-14 09:50:14 +01:00
Atgeirr Flø Rasmussen
a1225ac715 Merge pull request #351 from akva2/remove_more_refs
fixed: remove left-over opm-parser/opm-output references
2018-03-13 12:43:14 +01:00
Arne Morten Kvarving
067ad664d8 fixed: remove left-over opm-parser/opm-output references 2018-03-13 08:28:25 +01:00
Lars Petter Øren Hauge
bbf2ae26f1 Match timestep for well info
Decrement timestep where necessary to avoid well post-configuration.

Consider the following:

.
.
.

WELLSPECS
 'W1'  'G1' ... /

TSTEP
 2*1 /

WELLSPECS
 'W1'  'G2' .../

TSTEP
 2*1 /

In that case the parent group of W1 is changed after two timesteps. At timestep
two the Group parent will indicate G2, while the GOPT:G2 at timestep two should
be reported for what has progressed up until timestep two.
2018-03-13 08:16:07 +01:00
Joakim Hove
f706d6e7c1 Embed restart_step in restarted summary writer. 2018-03-12 17:13:17 +01:00
Joakim Hove
091756bfc7 Merge pull request #349 from GitPaean/adding_missing_item_wconinje
adding missing SURFACE_WATER_FRACTION to WCONINJE
2018-03-12 14:53:43 +01:00
Kai Bao
34605e7f2c adding missing SURFACE_WATER_FRACTION to WCONINJE 2018-03-12 09:05:48 +01:00
Joakim Hove
a0eb47d976 Merge pull request #347 from GitPaean/silencing_extra_
silencing warning related to an extra ;
2018-03-09 18:18:55 +01:00
Joakim Hove
dd543d2dad Merge pull request #348 from GitPaean/adding_keywords_polymw
Adding keywords POLYMW, PINTDIMS and PLYVMH
2018-03-09 18:18:34 +01:00
Kai Bao
02ea808fa0 adding keyword PLYVMH
we only the definition with METRIC unit system. Not sure how they should
be used with other unit sytem, since we do not know the units of these
values, which is not easy to find out either.

For the moment, we only handle the METRIC unit system for now.
2018-03-09 12:21:40 +01:00
Kai Bao
d8ce4b944e adding keyword PINTDIMS 2018-03-09 08:56:42 +01:00
Kai Bao
bb4936c6c1 adding POLYMW to phase class in Runspec 2018-03-09 08:38:10 +01:00
Kai Bao
c8bc4d9649 adding keyword POLYMW 2018-03-08 21:57:39 +01:00
Kai Bao
000efd5341 silencing warning related to an extra ; 2018-03-08 14:34:34 +01:00
Joakim Hove
504e827139 Merge pull request #346 from bska/minimal-welldims
Runspec: Add Support for Parsing Limited Subset of WELLDIMS
2018-03-08 13:22:22 +01:00
Bård Skaflestad
af07812167 Runspec: Add Support for Parsing Limited Subset of WELLDIMS
Capture the maximum number of connections/perforations per well, the
maximum number of wells (or sub-groups) per well/node group, and the
maximum number of well/node groups in the field.

These maximum sizes are needed to correctly define the portions of
the contents of the INTEHEAD vector in a restart step.
2018-03-08 10:50:47 +01:00
Joakim Hove
938db7a198 Merge pull request #342 from GitPaean/small_fixing_pvt_tables
small fixes of the pvtables.
2018-03-07 16:37:40 +01:00
Atgeirr Flø Rasmussen
5d2d9e574f Merge pull request #345 from akva2/fix_packaging_repo_merge
fix packaging after repo merge
2018-03-07 11:10:56 +01:00
Kai Bao
dbf2a4c425 small fixes of the pvtables.
some rules are from testing output.
2018-03-07 08:31:00 +01:00
Arne Morten Kvarving
32764b0128 fix packaging after repo merge 2018-03-07 08:20:17 +01:00
Arne Morten Kvarving
35ebab0b69 Merge pull request #341 from akva2/import_parser_output
Import opm-parser and opm-output
2018-03-06 15:34:27 +01:00
Arne Morten Kvarving
932cece7d3 add imported parser/output sources to build system
use -DENABLE_ECL_INPUT=0 to disable input (and output) support
use -DENABLE_ECL_OUTPUT=0 to disable output support

both default to on
2018-03-06 11:18:03 +01:00
Arne Morten Kvarving
dbba64e5c3 Import opm-output 2018-03-05 10:30:59 +01:00
Arne Morten Kvarving
726ccd7fd7 Import opm-parser 2018-03-05 10:30:29 +01:00
Arne Morten Kvarving
bdb17fdece Merge pull request #339 from blattms/fix-libecl-path-in-flow
Always add ecl target to ecl_LIBRARIES.
2018-03-05 10:29:35 +01:00
Atgeirr Flø Rasmussen
0672c5ac34 Merge pull request #340 from andlaus/include_config.h
include config.h in all unit tests
2018-03-05 09:20:53 +01:00
Andreas Lauser
1083db48a3 test_LinearisedOutputTable: include config.h unconditionally
this is already the case for the vast majority of the other OPM code.
2018-03-03 13:23:37 +01:00
Andreas Lauser
2dc08dd0a7 include config.h in all unit tests
in some it was already included, so let's fix that inconsistency The
Right Way (TM).
2018-03-03 13:11:12 +01:00
Markus Blatt
0e25c9f2e9 Always add ecl target to ecl_LIBRARIES.
Otherwise the flow binary does not know the correct
path to libecl in some situations.
2018-03-02 22:15:54 +01:00
Arne Morten Kvarving
c63ab13a89 Merge pull request #335 from akva2/split_src_headers
changed: split headers and sources
2018-03-01 07:01:28 +01:00
Arne Morten Kvarving
27c31b58ed changed: split headers and sources
keep headers in opm/ and move sources to src/opm/
2018-02-28 13:56:49 +01:00
Arne Morten Kvarving
4b49e934e4 changed: drop opmjson library 2018-02-28 09:57:21 +01:00
Lars Petter Øren Hauge
800cc2af62 Support default construction uppon ADD/MULTIPLY
Allow keywords that can be default constructed to do so when acted uppon
by MULTIPLY and ADD.

Setting the "MULTIPLY" keyword to act on "PORV" would throw an
exception:

"Program threw an exception: Fatal error processing MULTIPLY keyword.
Tried to scale not defined keyword PORV"

Now the initPORV is called if the MULTIPLY keyword is parsed with PORV.
Note that MULTIPLY for PORV will also work in the GRID section (which it
does not in eclipse), but will fail if it is placed prior to setting a
variable PORV depends on.

Commit authored by Sveinung Styve Rundhovde and Lars Petter Hauge
2018-02-26 13:51:37 +01:00
Sveinung Rundhovde
a693d21c68 Set PORV dimension to ReservoirVolume
PORV dimension string was set to "Volume". This is not a valid dimension
string, causing an exception.
2018-02-22 08:44:51 +01:00
Joakim Hove
4d1333e2ff Merge pull request #1218 from joakim-hove/summary-missing-wells
Summary missing wells
2018-02-20 22:16:08 +01:00
Joakim Hove
7a2bf8a0b5 SummaryConfig: changed implementation for empty well/group keywords.
Will never raise SUMMARY_UNKNOWN_WELL for empty well related summary keywords.
2018-02-20 16:51:38 +01:00
Atgeirr Flø Rasmussen
ac56621759 Silence warning.
Unlike returning const references, returning const values is no different
from returning a non-const value.
2018-02-20 14:11:18 +01:00
Lars Petter Øren Hauge
fdb06aa77f Apply efficiency factors
Efficiency factors are multiplied when specified at multiple levels of
the well/group hierarchy.

The factors are included as follows:

* Well Rate        - No efficiency factor
* Well Total       - WEFAC & GEFAC (whole hierarchy)
* Group Rate       - WEFAC & GEFAC (only subgroups)
* Group Total      - WEFAC & GEFAC (whole hierarchy)
* Field Rate       - WEFAC & GEFAC (whole hierarchy)
* Field Total      - WEFAC & GEFAC (whole hierarchy)
* Region Rate      - WEFAC & GEFAC (whole hierarchy)
* Region Total     - WEFAC & GEFAC (whole hierarchy)
* Completion Rate  - No efficiency factor
* Completion Total - WEFAC & GEFAC (whole hierarchy)

Authored by Sveinung Rundhovde and Lars Petter Hauge
2018-02-20 10:26:54 +01:00
Sveinung Rundhovde
22ebda2ea7 Add wells to arguments for region keywords
Applying efficiency factor to region keywords requires a list of wells
having completions inside the region.

Authored by Sveinung Rundhovde and Lars Petter Hauge
2018-02-20 10:03:59 +01:00
Lars Petter Øren Hauge
dde1ccaae0 Fix minor name error 2018-02-20 10:03:59 +01:00
Atgeirr Flø Rasmussen
05c904a04e Merge pull request #250 from totto82/MoveWell
Some more cleaning in the output code  in opm-output, ewoms and opm-simulator
2018-02-19 15:05:24 +01:00
Joakim Hove
c904c6bf98 Added action argument to ParseContext::addKey() 2018-02-19 14:52:21 +01:00
Joakim Hove
da650aa7ff Merge pull request #1177 from nairr/aquifer_obj
Carter-Tracy aquifer object
2018-02-15 17:47:17 +01:00
Joakim Hove
ce7654765c Merge pull request #1209 from GitPaean/not_turing_off_injector
not turning off injector because of defaulted rates.
2018-02-15 16:38:02 +01:00
Rohith Nair
57792f1316 Carter-Tracy aquifer object to collect items from keywords AQUCT and AQUTAB
clean up

removed aquancon collection from Aquifer CT

clean up and unit test

clean up

Conflicts:
	lib/eclipse/CMakeLists.txt

Add reference to Van Everdingen and Hurst

remove cmakelists

added test in Cmake

Added aquiferct to cmake
2018-02-15 12:01:19 +01:00
Arne Morten Kvarving
ae56723b7e Merge pull request #254 from akva2/dyn_boost_test_bs
changed: let the build system handle the dynamic boost test defines
2018-02-15 08:14:32 +01:00
Arne Morten Kvarving
8ab7beb13d Merge pull request #334 from akva2/fix_dyn_boost_test
fixed: set the boost dynamic test define if we build shared libs
2018-02-15 08:13:48 +01:00
Arne Morten Kvarving
03ab8fe400 changed: let the build system handle the dynamic boost test defines 2018-02-15 07:21:35 +01:00
Arne Morten Kvarving
cedb010a04 fixed: set the boost dynamic test define if boost::unit_test_framework
is a shared library

additional condition for opm-parser as it forces dyn boost test (not
strictly necessary but it highlights the different behaviour for now)
2018-02-15 07:21:35 +01:00
Joakim Hove
1034c82fab Merge pull request #253 from GitPaean/adding_few_keywords
adding a few summary keywords
2018-02-14 21:37:13 +01:00
Joakim Hove
65be35d488 Merge pull request #1211 from GitPaean/adding_some_summary_keywords
adding a few summary keywords
2018-02-14 18:30:05 +01:00
Arne Morten Kvarving
7f79101fb2 changed: let the build system handle the dynamic boost test defines 2018-02-14 16:03:57 +01:00
Atgeirr Flø Rasmussen
007007184a Merge pull request #1199 from akva2/old_is_the_new_new
changed: switch to the shared opm build system
2018-02-14 09:16:42 +01:00
Atgeirr Flø Rasmussen
d501d183e6 Merge pull request #324 from akva2/export_targets
added: add exported targets
2018-02-14 09:16:24 +01:00
Kai Bao
e76df698c6 changing the counting of the schecule in SCHEDULE_WELLS2
basically, all the control keywords should be combined with the
TSTEP/DATES afterwards as a complete report step.
2018-02-14 09:09:27 +01:00
Kai Bao
43cb8e5739 adding a few summary keywords
WWVIR, WGVPR and WGVIR
2018-02-13 19:39:30 +01:00
Kai Bao
bedf0dd257 adding a few summary keywords
add WWVIR, WGVPR and WGVIR, and removing WOVPR
2018-02-13 15:07:46 +01:00
Arne Morten Kvarving
94f71b730d fixed: prefix created dir with PROJECT_BINARY_DIR to facilitate superbuild 2018-02-13 15:05:49 +01:00
Arne Morten Kvarving
c486e6ebd8 re-add fancy names 2018-02-13 14:10:18 +01:00
Arne Morten Kvarving
535d7df784 changed: add targets for tests even if BUILD_TESTING is off
we still want to be able to build them, just not by default.
ref 'make check' and 'make test-suite'.
2018-02-13 14:10:18 +01:00
Arne Morten Kvarving
c151e09aec changed: filter out some include paths which leads us down a path to bogus 2018-02-13 14:10:18 +01:00
Arne Morten Kvarving
e681b47de2 added: use exported targets 2018-02-13 14:10:18 +01:00
Arne Morten Kvarving
e81784c9eb fixed: libecl recently enforced stricter filename rules
in particular, no mixed case. either all upper or all lower
2018-02-12 15:06:13 +01:00
Arne Morten Kvarving
f7c288a3f4 changed: switch to the shared opm build system 2018-02-12 13:36:49 +01:00
Atgeirr Flø Rasmussen
cf26fb3550 Merge pull request #331 from akva2/remove_err_brace
fixed: remove erroneous brace
2018-02-12 12:32:04 +01:00
Kai Bao
3c8c65b65c not turning of injector because of defaulted rates.
it must be a limit to turn it off. The old implementation make it
impossible to have a injector with only bhp control.
2018-02-12 12:27:44 +01:00
Tor Harald Sandve
e2e38ddc0c Add write/read test for data::wells 2018-02-12 11:42:59 +01:00
Atgeirr Flø Rasmussen
96526d0451 Merge pull request #333 from akva2/jenkins_show_last_log
changed: output last log entry in branches for jenkins builds
2018-02-09 11:04:42 +01:00
Arne Morten Kvarving
8d3030a004 changed: output last log entry in branches for jenkins builds
can help identifying issues with builds
2018-02-08 16:32:36 +01:00
Andreas Lauser
211cd4b734 Merge pull request #332 from andlaus/separate_opm-common_concerns
move some infrastructure to opm-material
2018-02-08 16:24:37 +01:00
Tor Harald Sandve
206241c9ae Store global index instead of active index in well completions
Fix bug in output of completion related stuff when run on mulitiple
cores.
2018-02-08 14:11:04 +01:00
Andreas Lauser
038841a2ef move some infrastructure to opm-material
These classes are only used by opm-material and its downstreams. The
reason for doing moving it there is that this allows more freedom in
reorganizing the lower-level OPM modules (i.e., opm-common,
opm-parser, opm-output) while still avoiding a hard dependency of the
thermodynamic and numerical framework modules on the ECL file parsing
libraries.
2018-02-07 15:40:52 +01:00
Joakim Hove
cc4e56cc18 Merge pull request #1206 from joakim-hove/filter-completions
Added ability to filter out completions from inactive cells.
2018-02-07 15:06:19 +01:00
Tor Harald Sandve
55ed844438 Add cell data in perforation cells to data::well::completion
With this no cell data is needed in opm-output
2018-02-07 14:32:01 +01:00
Joakim Hove
3a590a0cab Added ability to filter out completions in inactive cells. 2018-02-07 11:22:35 +01:00
Joakim Hove
40fd922b6e Added iterator access to DynamicState<T> 2018-02-07 11:22:35 +01:00
Tor Harald Sandve
3f85198032 Fix merge conflict 2018-02-06 14:47:35 +01:00
Tor Harald Sandve
5822c362f5 Communicate well data 2018-02-06 14:47:35 +01:00
Tor Harald Sandve
cbf61996d7 Remove unused stuff 2018-02-06 14:47:35 +01:00
Tor Harald Sandve
dec7e0068d fix typo 2018-02-05 14:44:11 +01:00
Tor Harald Sandve
06b7afc9be Remove data::Solution cells from Summary 2018-02-05 14:23:19 +01:00
Tor Harald Sandve
8a5062ae27 Pass pointers of region and block data to eclIO 2018-02-05 14:23:19 +01:00
Tor Harald Sandve
890b2226b2 Get Block values from simulator
Avoids communication of the whole state
2018-02-05 14:23:19 +01:00
Tor Harald Sandve
ba29cfa81e Remove unused stuff 2018-02-05 14:23:19 +01:00
Tor Harald Sandve
45267477b4 Get Region and Field values from simulator
Avoid cell based computations in opm-output as it could slow down the
MPI run.
2018-02-05 14:19:50 +01:00
Arne Morten Kvarving
3a447d8532 fixed: remove erroneous brace 2018-02-05 11:36:01 +01:00
Andreas Lauser
c9291f165c address review comments 2018-02-05 10:38:57 +01:00
Atgeirr Flø Rasmussen
7d5aa79922 Merge pull request #327 from atgeirr/silence-warning
Silence unused argument warnings.
2018-02-05 09:22:05 +01:00
Andreas Lauser
ce93d98b80 respect the fact that non-SI temperature may be offset from zero
also, the UnitTests test was buggy.

V2: improve the accuracy of the °F->K offset, unit test all temperature measures
2018-02-02 17:13:50 +01:00
Atgeirr Flø Rasmussen
54294f369e Merge pull request #330 from akva2/trim_whitespace
fixed: trim whitespace in pr number
2018-02-02 12:41:46 +01:00
Joakim Hove
cb5a3bdcea Revert "Revert "Res vol keywords (WVPR + WVPT & WVPRT+FVPRT)"" 2018-02-02 12:11:23 +01:00
Arne Morten Kvarving
627d475ef3 fixed: trim whitespace in pr number 2018-02-02 11:45:30 +01:00
Joakim Hove
2f332ed702 Revert "Revert "Add support for keywords (WVIT+GVIR+GVIT) "" 2018-02-02 10:41:35 +01:00
Atgeirr Flø Rasmussen
f0b31ce3dd Merge pull request #329 from joakim-hove/remove-opm-core
Removed opm-core reference from update_data script
2018-02-02 09:08:31 +01:00
Joakim Hove
a88561b010 Revert "Add support for keywords (WVIT+GVIR+GVIT) " 2018-02-02 09:00:04 +01:00
Joakim Hove
6094552b55 Revert "Res vol keywords (WVPR + WVPT & WVPRT+FVPRT)" 2018-02-02 08:59:15 +01:00
Joakim Hove
4194a6daed Removed opm-core reference from update_data script 2018-02-02 08:50:52 +01:00
Joakim Hove
494dda28a8 Revert "respect the fact that non-SI temperature may be offset from zero" 2018-02-01 15:08:12 +01:00
Atgeirr Flø Rasmussen
380490613e Silence unused argument warnings. 2018-02-01 09:57:28 +01:00
Joakim Hove
6a7412af7e Increased tolerance when testing TEMP in restart test. 2018-02-01 08:41:41 +01:00
Joakim Hove
d39ad3a865 Merge pull request #238 from lars-petter-hauge/res_vol_keywords
Res vol keywords (WVPR + WVPT & WVPRT+FVPRT)
2018-01-31 23:58:23 +01:00
Joakim Hove
a496158ed6 Merge pull request #1203 from andlaus/fix_measures
respect the fact that non-SI temperature may be offset from zero
2018-01-31 17:53:15 +01:00
Joakim Hove
5ca0792801 Merge pull request #1200 from andlaus/cp_to_cv
rename c_p to c_v in specrock and specheat table classes
2018-01-31 17:51:00 +01:00
Atgeirr Flø Rasmussen
fe55a73a4b Merge pull request #326 from akva2/relocate_files
Relocate files
2018-01-31 13:17:53 +01:00
Andreas Lauser
d6f4cb016e respect the fact that non-SI temperature may be offset from zero
also, the UnitTests test was buggy.
2018-01-31 13:17:06 +01:00
Atgeirr Flø Rasmussen
36afd2c99e Silence sign comparison warnings. 2018-01-30 15:02:58 +01:00
Atgeirr Flø Rasmussen
0abdc8b40e Merge pull request #325 from akva2/fix_prepare_target
fixed: really handle the _prepare target for tests
2018-01-30 14:06:37 +01:00
Arne Morten Kvarving
53e4217c27 changed: relocate the remaining files in opm/core/utility
move to opm/common/utility/numeric
2018-01-30 14:05:37 +01:00
Arne Morten Kvarving
5b56ed5da7 changed: opm/[core -> common]/utility/parameters 2018-01-30 12:53:00 +01:00
Arne Morten Kvarving
dd4559b961 changed: opm/[core/linalg -> common/utility/numeric]/blas_lapack.h 2018-01-30 12:53:00 +01:00
Arne Morten Kvarving
0e1553409d changed: opm/common/[->utility]/ResetLocale.hpp 2018-01-30 12:53:00 +01:00
Arne Morten Kvarving
1bda4a812b changed: opm/common/[->utility/]ConditionalStorage.hpp 2018-01-30 12:52:59 +01:00
Arne Morten Kvarving
5ad6502f12 changed: opm/common/[util->utility]/numeric/cmp.hpp 2018-01-30 12:52:59 +01:00
Andreas Lauser
8a95794277 rename c_p to c_v in specrock and specheat table classes
even though the official documentation does not seem to specify
whether the specified heat capacities of the SPECROCK and SPECHEAT
keywords are for constant pressure or for constant volume, the
implicitly seem to be for the latter: pressure dependent heat
capacites cannot be specified, yet the enthalpy for an incompressible
fluid *is* pressure dependent, so the specified heat capacities must
be for constant volume and they specify the internal energy instead of
the enthalpy.
2018-01-30 12:06:58 +01:00
Arne Morten Kvarving
b4e439fc19 fixed: really handle the _prepare target for tests 2018-01-30 11:51:18 +01:00
Arne Morten Kvarving
d76a15539e Merge pull request #319 from blattms/slu_dune2.6_full
added: support building with superlu for dune 2.6 (complete version)
2018-01-30 10:38:38 +01:00
Atgeirr Flø Rasmussen
b46348f074 Merge pull request #321 from akva2/super_build
Some changes to facilitate building using a super project
2018-01-29 16:28:09 +01:00
Sveinung Rundhovde
2d01813f01 Add support for GVIT keyword 2018-01-29 08:46:02 +01:00
Sveinung Rundhovde
db963b7286 Add support for GVIR keyword 2018-01-29 08:46:02 +01:00
Sveinung Rundhovde
c623452823 Add support for WVIT keyword 2018-01-29 08:46:02 +01:00
Atgeirr Flø Rasmussen
c7b5799071 Merge pull request #320 from blattms/support-dune-uggrid
Support dune-uggrid (successor of UG).
2018-01-26 12:24:07 +01:00
Lars Petter Øren Hauge
9a404c2e93 Support WVPRT+FVPRT 2018-01-26 08:03:19 +01:00
Lars Petter Øren Hauge
2343c5ada9 Support WVPR + WVPT 2018-01-26 08:02:44 +01:00
Joakim Hove
53d8d65c7b Merge pull request #1190 from nairr/aquancon_object
Aquancon object
2018-01-25 14:38:37 +01:00
Arne Morten Kvarving
81036d42fc Merge pull request #323 from akva2/enough_with_the_fancy_smancy
changed: do not require a "fancy name" for tests
2018-01-25 11:38:58 +01:00
Rohith Nair
9552d24f77 clean up test 2018-01-25 10:46:14 +01:00
Ove Sævareid
ec83e0fc18 Support for kw MAXVALUE/MINVALUE. 2018-01-24 16:01:09 +01:00
Arne Morten Kvarving
bd316fa27f changed: do not require a "fancy name" for tests
earlier the assumption has been that all test executables have a test_ prefix
which was stripped off. now we just use the full name if the prefix is not
found.
2018-01-24 12:32:45 +01:00
Arne Morten Kvarving
0c9ceedc08 changed: remove duplicated test 2018-01-24 11:29:04 +01:00
Lars Petter Øren Hauge
a8d6259514 Support FOPR(S/F) FOPT(S/F) 2018-01-23 14:36:56 +01:00
Lars Petter Øren Hauge
10f2f7d366 Add missing part of test WOPTS+WOPTF 2018-01-23 08:17:06 +01:00
Lars Petter Øren Hauge
f8cb32c7d2 Support WOPRS+WOPRF 2018-01-23 08:16:15 +01:00
Markus Blatt
3dff53ec16 [squash] fix typo in comment 2018-01-22 15:45:50 +01:00
Arne Morten Kvarving
5e0157f407 added: support building with superlu for dune 2.6 2018-01-22 15:29:44 +01:00
Arne Morten Kvarving
72ca4a4ded Merge pull request #322 from akva2/remove_dc_autotools_hack
changed: remove hack for dunecontrol+autotools compatibility
2018-01-22 12:55:15 +01:00
Arne Morten Kvarving
d0fa9ce9dc changed: remove hack for dunecontrol+autotools compatibility
all supported dune versions have cmake builds which should be used
2018-01-22 11:06:36 +01:00
Rohith Nair
4c0514a5f4 edit 2018-01-19 17:03:06 +01:00
Rohith Nair
c8e1734efd add test for aquancon object 2018-01-19 17:00:34 +01:00
Arne Morten Kvarving
a3a0f90811 check for the existence of a opmmodule_prepare target
if it exists, add this as a dependecy for satellites
2018-01-19 16:33:13 +01:00
Arne Morten Kvarving
5b6dcfa619 fixed: allow more than two build types for jenkins 2018-01-19 16:21:21 +01:00
Arne Morten Kvarving
2b8ee5a82d changed: check for existing target before importing
to aid use of a super project for opm
2018-01-19 14:35:58 +01:00
Arne Morten Kvarving
4e9f15dec3 changed: use ${project}. to aid use of a super-project for opm 2018-01-19 14:35:58 +01:00
Arne Morten Kvarving
fdb0ec1e71 fixed: add missing project declaration 2018-01-19 14:35:58 +01:00
Markus Blatt
3681fe0800 Support dune-uggrid (successor of UG). 2018-01-18 22:39:40 +01:00
Joakim Hove
3a03c2226c Added support for defaults in the in-keyword boxes. 2018-01-18 12:58:32 +01:00
Joakim Hove
e1d0b39733 Added accessor functions to Box class 2018-01-18 12:58:32 +01:00
Joakim Hove
972979c931 Added nine argument(!) constructor for Box class 2018-01-18 10:50:04 +01:00
Rohith Nair
26cdaa8598 clean up, moved items to constructor, facedir mod etc. 2018-01-18 09:43:40 +01:00
Atgeirr Flø Rasmussen
27204e3439 Merge pull request #318 from akva2/remove_opm_core
remove opm-core from downstream list
2018-01-17 21:14:00 +01:00
Arne Morten Kvarving
9e72f17453 Merge pull request #317 from akva2/fix_mpi
fixed: we need to do mpi disabling earlier
2018-01-17 17:39:44 +01:00
Arne Morten Kvarving
4340691ff8 added: handle QuadMath support like MPI 2018-01-17 15:57:48 +01:00
Arne Morten Kvarving
de7f4e168d fixed: we need to do mpi disabling earlier
if not, prereqs do not see this file, and the option ends
up not being operational for prereqs looking for MPI.
2018-01-17 15:57:16 +01:00
Joakim Hove
b9f8bb4730 Merge pull request #1187 from stefoss23/handle_extra_records
WIP: Added ParseContext::IGNORE_EXTRA_RECORDS
2018-01-17 14:15:52 +01:00
Atgeirr Flø Rasmussen
14888816f6 Merge pull request #316 from akva2/stfu_static_analyzer
Fix some static analyzer errors
2018-01-17 12:41:44 +01:00
Arne Morten Kvarving
b59eaea633 remove opm-core from downstream list 2018-01-17 11:50:23 +01:00
Steinar Foss
5d9f529637 PARSE_EXtRA_RECORDS: added more info to error msg. 2018-01-17 10:27:37 +01:00
Arne Morten Kvarving
6f174d910c prefer prefix operators for non-primitives 2018-01-17 10:23:54 +01:00
Arne Morten Kvarving
5bd7d4c6b6 mark constructors explicit 2018-01-17 10:21:46 +01:00
Arne Morten Kvarving
63a308f9f3 remove unused variables 2018-01-17 10:21:10 +01:00
Joakim Hove
da70718beb Merge pull request #230 from lars-petter-hauge/support_fprp
Add support for FPRP
2018-01-17 09:03:39 +01:00
Lars Petter Øren Hauge
37709e9e04 Add support for FPRP 2018-01-17 08:54:38 +01:00
Joakim Hove
d0a973738b Merge pull request #315 from joakim-hove/remove-travis
Removed travis scripts.
2018-01-16 20:27:38 +01:00
Joakim Hove
fdea1b4ef0 Removed travis scripts. 2018-01-16 20:18:02 +01:00
Joakim Hove
c4346cd065 Removed travis integration. 2018-01-16 20:12:42 +01:00
Joakim Hove
e46d1115ca Removed travis integration from opm-parser. 2018-01-16 20:10:52 +01:00
Atgeirr Flø Rasmussen
f4bc748329 Merge pull request #314 from akva2/import_more_utilities
Import more utilities from opm-core
2018-01-16 17:44:52 +01:00
Steinar Foss
ab716c6036 added extra test function Handle_extra_records_2. 2018-01-16 17:15:37 +01:00
Steinar Foss
41dc44345e parseState.lastSizeType initialized during construction. 2018-01-16 16:58:30 +01:00
Steinar Foss
56d1291898 parseState.lastStizeType default to SLASH_TERMINATED. 2018-01-16 16:58:30 +01:00
Steinar Foss
24dd4e664e changed check order in ParserState::handleRandomText. 2018-01-16 16:58:30 +01:00
Steinar Foss
5ef8d22a48 IGNORE_EXTRA_RECORDS changed to PARSE_EXTRA_RECORDS.
...
2018-01-16 16:58:29 +01:00
Steinar Foss
e85162703e Added ParseContext::IGNORE_EXTRA_RECORDS
...

...

...

...

...
2018-01-16 16:58:29 +01:00
Rohith Nair
5068acb29c Aquancon object
Aquancon object

Reorganized and changed the way the aqurecord object works

Working aquancon object. Still need to implement better logic. Also added test case

Changed indexing bug

Fixed the correct indices for the collate function

Made a private function for getting the record index matching the aquifer id

Reformatted the private function for readibility

Added logic to find unique global cell indices

Collate function done... Now need to apply logic to these entries...

clean up

Conflicts:
	lib/eclipse/EclipseState/Aquancon.cpp

edit object definition
2018-01-16 15:47:40 +01:00
Rohith Nair
1edd7cbd92 Carter-Tracy aquifer object to collect items from keywords AQUCT, AQUTAB and AQUANCON 2018-01-16 15:32:36 +01:00
Atgeirr Flø Rasmussen
4c0333ce2b Merge pull request #311 from akva2/mark_explicit
changed: mark single-parameter constructor explicit
2018-01-16 14:37:09 +01:00
Arne Morten Kvarving
0e2c558501 add imported utility classes to build system 2018-01-16 13:57:17 +01:00
Arne Morten Kvarving
fdfda315d3 Import some more generic utilities from opm-core 2018-01-16 13:56:25 +01:00
Joakim Hove
2b4fa833ea Updated test. 2018-01-16 11:24:09 +01:00
Joakim Hove
61c5bb3721 Merge pull request #1134 from atgeirr/fix-test
[WIP] Minor fix for test program.
2018-01-16 10:48:44 +01:00
Tor Harald Sandve
8a98cd4963 Add keywords to required fields map 2018-01-16 10:38:32 +01:00
Atgeirr Flø Rasmussen
bbf700b404 Merge pull request #312 from akva2/import_utilities
Import some generic utility classes from opm-core
2018-01-12 10:42:55 +01:00
Arne Morten Kvarving
af80986d97 add imported utility classes to build system 2018-01-11 16:59:10 +01:00
Arne Morten Kvarving
95f7d62e9e Import some generic utility classes from opm-core 2018-01-11 16:55:53 +01:00
Atgeirr Flø Rasmussen
d16842646e Make constructor generic.
This supports std::vector and Opm::TableColumn (from opm-parser) as before,
but without requiring any OPM includes, making the class independent.
2018-01-11 15:00:49 +01:00
Atgeirr Flø Rasmussen
9419997a16 Remove unused boost include. 2018-01-11 15:00:20 +01:00
Joakim Hove
d0565a317d Merge pull request #1186 from akva2/pass_const_ref
changed: pass by const ref
2018-01-11 13:54:03 +01:00
Arne Morten Kvarving
120ad9e4fa changed: pass by const ref
quells a static analyzer warning
2018-01-11 13:18:41 +01:00
Arne Morten Kvarving
3475d45772 changed: mark single-parameter constructor explicit
quells a static analyzer warning
2018-01-11 13:03:27 +01:00
Kai Bao
b2cc783f43 adding keyword FRICTION 2018-01-11 09:50:34 +01:00
Joakim Hove
7f063e3ead Merge pull request #1179 from GitPaean/fixing_history_matching_well_1
Fixing history matching wells part 1
2018-01-09 14:36:57 +01:00
Joakim Hove
0118b8ac3e Merge pull request #1181 from GitPaean/adding_keywords_wsegsicd
adding keyword WSEGSICD
2018-01-09 14:35:19 +01:00
Joakim Hove
e4449b8129 Merge pull request #1183 from joakim-hove/dim-eror
Added generated keyword test.
2018-01-09 14:34:34 +01:00
Kai Bao
11e8202a38 adding keyword WSEGSICD 2018-01-08 17:19:35 +01:00
Joakim Hove
61cf4818ea Merge pull request #1182 from totto82/addPBDVandPDDV
Add support for PDVD and PBVD
2018-01-08 15:56:00 +01:00
Joakim Hove
9c9afc613a Added generated keyword test. 2018-01-08 15:20:39 +01:00
Tor Harald Sandve
867df8b7ce Add support for PDVD and PBVD 2018-01-08 14:17:37 +01:00
Andreas Lauser
98a61c67dc add the TOLCRIT keyword 2018-01-08 11:57:43 +01:00
Kai Bao
35ecd2e37a fixing WCONHIST. 2018-01-06 21:49:27 +01:00
Sveinung Rundhovde
5993cb7764 Add support for FGIPG keyword 2018-01-04 14:52:07 +01:00
Sveinung Rundhovde
dcfb0a4e47 Add support for FOIPL keyword 2018-01-04 14:52:06 +01:00
Sveinung Rundhovde
d0bf9753d9 Add support for FWIP keyword 2018-01-04 14:52:06 +01:00
Atgeirr Flø Rasmussen
c91291246c Merge pull request #310 from akva2/remove_build_status
remove travis build status from README.md
2018-01-04 13:00:15 +01:00
Arne Morten Kvarving
3fdd39160b remove travis build status from README.md 2018-01-04 12:07:46 +01:00
Lars Petter Øren Hauge
130ec2f0a8 Add support for FGPT(F/S) 2018-01-03 14:46:58 +01:00
Lars Petter Øren Hauge
afbe8081f6 Add support for FGPR(F/S) 2018-01-03 14:46:46 +01:00
Lars Petter Øren Hauge
9497dfa1e5 Change unsupported keyword test
Support of FVIR is now implemented.
2018-01-03 13:56:15 +01:00
Lars Petter Øren Hauge
fc75de6fb0 Add tests for FV(I/P)/(R/T) 2018-01-03 13:56:15 +01:00
Lars Petter Øren Hauge
257e5fd983 Add FV(I/P)(R/T) keywords 2018-01-03 13:56:15 +01:00
Joakim Hove
58ea8da47c Merge pull request #309 from joakim-hove/remove-travis
Removed travis intgeration
2018-01-02 20:33:11 +01:00
Joakim Hove
1d6041b482 Removed travis intgeration 2018-01-02 20:32:26 +01:00
Rohith Nair
531a531650 aquatab table object 2017-12-22 13:24:54 +01:00
Atgeirr Flø Rasmussen
6bc39f0ed0 Merge pull request #308 from atgeirr/fix-debug-log
Corrected debug log output
2017-12-22 11:14:35 +01:00
Rohith Nair
9e3e41b79a Adds tablemanager scheme for aqutab + modifications to aquct and aquancon parsing 2017-12-22 10:54:59 +01:00
hnil
3726641d08 corrected DEBUG log output 2017-12-22 09:21:29 +01:00
Rohith Nair
6361c12c65 Introduces an aqudims class and a test for the same 2017-12-21 15:10:32 +01:00
Arne Morten Kvarving
8fc5283b05 Merge pull request #306 from blattms/fix-pr-304
Include <module>-prereqs.cmake in <module>-config.cmake to process all dependencies
2017-12-21 14:00:32 +01:00
Markus Blatt
4c0625aa8b Include <module>-prereqs.cmake in <module>-config.cmake for transitive search
Otherwise implicit dependencies are never search for. That was the case
for dune-geometry and dune-grid when configuring opm-core as these are only
transitively required via opm-grid.

With this commit we include <module>-prereqs.cmake in <module>-config.cmake
and thus trigger searches for all modules that this module depends on.

We also install the file now <module>-prereqs.cmake as we need it for
installed modules, too.
2017-12-21 12:52:33 +00:00
Arne Morten Kvarving
390bf74f66 Merge pull request #307 from akva2/stupid_test_code
fixed: this test code slipped through
2017-12-21 13:10:15 +01:00
Arne Morten Kvarving
3a60e567bb fixed: this test code slipped through in 9737538708
sorry about that
2017-12-21 13:05:00 +01:00
Sveinung Rundhovde
69c08ff677 Add support for GVPRT keyword 2017-12-20 16:32:19 +01:00
Arne Morten Kvarving
f730e9bc80 Merge pull request #304 from akva2/pure_config_prereqs_in_repos
changed: get rid of find modules for opm modules
2017-12-20 15:18:36 +01:00
Arne Morten Kvarving
9737538708 changed: get rid of find modules for opm modules
use pure config mode.

we no longer compile a test application for the libraries,
however checks have been tightened by making sure version of
all opm modules are the same.

this allows for putting prereqs directly in the module repositories
2017-12-20 11:12:01 +01:00
Arne Morten Kvarving
6ba3f2e695 put more stuff in the config file
we cannot use the information from the imported targets as
it is incompatible with the rest of the opm build system setup.
2017-12-19 16:04:02 +01:00
Sveinung Rundhovde
42befdfa4c Add suport for GVPT keyword 2017-12-19 10:23:02 +01:00
Sveinung Rundhovde
ffb85c98bf Add support for GVPR keyword 2017-12-19 10:22:55 +01:00
Joakim Hove
0be2a44fcd Merge pull request #1171 from andlaus/fix_rtempvd
fix the TEMPI property if it is initialized using RTEMPVD
2017-12-15 13:12:22 +01:00
Andreas Lauser
c01a1a9d79 fix the TEMPI property if it is initialized using RTEMPVD
E100 seems to silently use equil region zero if EQLNUM was not
specified, and the data contained in the EQLNUM array uses
fortran-style indices.
2017-12-13 11:23:57 +01:00
Arne Morten Kvarving
58f5115c71 Merge pull request #303 from andlaus/update_dune.module
add dune-common to the list of modules depended on by dune.module
2017-12-13 11:04:13 +01:00
Andreas Lauser
7ab3cee7a7 add dune-common to the list of modules depended on by dune.module
since dune.module is primarily required for dunecontrol support and
you cannot run dunecontrol without dune-common anyway, nothing changes
for dunecontrol users.

for users who do not use dunecontrol, nothing changes either because
the dependencies are specified in opm-common-prereqs.cmake which stays
untouched by this commit.
2017-12-13 11:02:06 +01:00
Andreas Lauser
87ec3c0c23 add more thermal keywords and the associated infrastructure 2017-12-11 10:37:27 +01:00
ReedMe
c9c6128bb4 add GRUPNET to group 2017-12-07 15:28:04 +01:00
Arne Morten Kvarving
1ca9533862 Merge pull request #294 from akva2/fix_jenkins_install_at_end
fixed: perform installation at end of main module
2017-12-05 17:32:46 +01:00
Arne Morten Kvarving
68cbdc7397 fixed: perform installation at end of main module
not only if we build downstreams
2017-12-05 11:02:27 +01:00
Joakim Hove
2a7185baed Merge pull request #1165 from joakim-hove/new-sched-ctx
New sched ctx
2017-12-04 13:38:35 +01:00
Joakim Hove
56180285b3 Merge pull request #1164 from joakim-hove/one-arg-parsecontext
Added one-argument ParseContext constructor.
2017-12-04 13:38:09 +01:00
Joakim Hove
3f4f566c1e Added Schedule constructor which takes EclipseState arg. 2017-12-03 09:00:56 +01:00
Joakim Hove
6ef1bd7c25 Made ParseContext argument to Schedule constructor optional. 2017-12-03 09:00:02 +01:00
Joakim Hove
22074a46bf Added one-argument ParseContext constructor. 2017-12-03 08:38:27 +01:00
Joakim Hove
a55f8497b6 Merge pull request #222 from sveinung-r/Well_pri_3_keywords
Add WTHPH+WBHPH keywords
2017-12-02 09:20:46 +01:00
Sveinung Styve Rundhovde (IT SI SIB)
b3a994211c Add WTHPH+WBHPH keywords 2017-12-01 14:01:13 +01:00
Sveinung Styve Rundhovde (IT SI SIB)
ff193322e4 Add support for WTHPH+WBHPH keywords 2017-12-01 13:20:31 +01:00
Joakim Hove
a51c921d23 Merge pull request #221 from lars-petter-hauge/warn_unused_sumkeys
WIP:Warn unused sumkeys
2017-12-01 13:01:51 +01:00
Lars Petter Øren Hauge
30f531fffc Add warning unsupported keywords 2017-12-01 12:42:04 +01:00
Joakim Hove
adb017aec4 Merge pull request #1158 from andlaus/thermal_stuff
Thermal stuff
2017-12-01 12:19:28 +01:00
Atgeirr Flø Rasmussen
006cccf5b7 Merge pull request #288 from andlaus/add_ConditionalStorage
add a simple helper class that allows to store data members conditionally
2017-11-30 21:15:11 +01:00
Andreas Lauser
43cf644c78 add a simple unit test for the ConditionalStorage class 2017-11-30 11:40:08 +01:00
Andreas Lauser
0b097b60f4 add a simple helper class that allows to store data members conditionally
the class takes a boolean parameter as its first template parameter
and a type name as the second. if the boolean parameter is false,
nothing is stored, else an object of the type of the second template
parameter gets created. this mechanism allows to disable member
attributes based on compile time conditions.

The usage semantics of that class are that of a smart pointer class, i.e.,
the equivalent of

```
Foo foo;
foo.bar()
```

is

```
Opm::ConditionalStorage<true, Foo> foo;
foo->bar();
```

If the condition argument for the ConditionalStorage is false, that
code will still compile but an exception is thrown at runtime.
2017-11-30 11:36:57 +01:00
Andreas Lauser
30ebb323d7 wells: add support for energy 2017-11-29 14:02:41 +01:00
Lars Petter Øren Hauge
405d95e545 Fix spelling 2017-11-29 12:24:51 +01:00
Joakim Hove
3a8adeb0b3 Merge pull request #218 from totto82/fixGasOilFPR
Fix FPR and RPR for 2p GasOil case
2017-11-28 10:12:59 +01:00
Joakim Hove
56bd653e51 Added optional shift attribute in keyword size configuration. 2017-11-28 10:09:41 +01:00
Atgeirr Flø Rasmussen
a346cf5e16 Merge pull request #285 from akva2/add_ndebug_option
added: option to not define NDEBUG for release builds
2017-11-28 07:30:42 +01:00
Andreas Lauser
f353dcf745 add temperature to the well injection properties
so far, this uses the WTEMP keyword. the WINJTEMP keyword is still to
do!
2017-11-27 14:00:57 +01:00
Atgeirr Flø Rasmussen
2204a160cf Merge pull request #291 from akva2/fix_core_test_program
fixed: do not use ParameterGroup code in opm-core test program
2017-11-27 13:21:38 +01:00
Bård Skaflestad
440b6259ef Table Output: Switch Naming Convention for Data Members
Mostly to remove trailing underscores.  The internal 'tabdims'
vector in Opm::Tables has been renamed to 'm_tabdims' to avoid
conflicting with the member function named 'tabdims'.
2017-11-27 10:25:48 +01:00
Bård Skaflestad
ec756dde45 Init File: Hook Saturation Function Writing Up to System 2017-11-27 09:15:00 +01:00
Bård Skaflestad
f681862f7c INIT File: Add Support for Writing Saturation Function Tables
This commit extends the INIT file Table writing to also output the
saturation function tables in normalised form.  We support
generating the INIT file's SGFN, SOFN, and SWFN tables--including
the derivative information--for both two and three phases from both
families of saturation function keywords (S{G,W}OF and S{G,W}FN +
SOF{2,3}).  We do not yet support generating the appropriate tables
from input keyword SLGOF.

We leverage the LinearisedOutputTable to abstract away some of the
details of indexing into the linear 'tab' array and create a helper
function to loop across saturation function regions whence each
table generator need only be concerned about the specific data
pertaining to that region's saturation function (i.e., the values of
independent and dependent variates and number of active rows).  We
allocate the output tables according to information in the TABDIMS
keyword, notably the number of saturation nodes (item 3 of TABDIMS).

Generating the three-phase SOFN table, which has the same columns as
the input table SOF3, in the case of family One (SGOF and SWOF) is
slightly involved.  In particular we need to join the SGOF and SWOF
tables on common oil saturation values and derive/insert missing
KroX data through piecewise linear interpolation in the appropriate
input table.  We defer the details of merging on common (and uniqe)
oil saturation values to the standard library routine 'set_union()'
which outputs repeated saturation values exactly once rather than
for each occurrence.  That way we only need to wrap the input tables
in a simple class to facilitate look-up of oil saturation values and
the mechanics of piecewise linear interpolation of the relative
permeability column for oil.  Due to this merging process, the
number of rows in SOFN is twice the number of saturation nodes in
this case.

Since this support depends on being able to determine which phases
are active in a particular run, what table sizes to use for the
output and which keywords are being used to represent the saturation
function tables we introduce a single new public member function

    void Tables::addSatFunc(const EclipseState& es)

This function determines the run's active phases and dispatches to
the new helper functions

    void Tables::addSatFunc_FamilyOne()
    void Tables::addSatFunc_FamilyTwo()

according to which keyword family exists in the input deck.  These
functions in turn call additional helper functions to handle each
phase table separately.  For instance addSatFunc_FamilyOne() uses
the helper function

    SatFunc::Oil::ThreePhase::fromSGOFandSWOF()

to generate a three-phase SOFN table based on the information in the
SGOF and SWOF tables.

Information about slopes/derivatives for the piecewise interpolants
of the dependent variates is computed through the helper function

    DifferentiateOutputTable::calcSlopes()

whence the first entry of each derivative column is undefined (i.e.,
assigned the sentinel value 1e+20).  This should arguably be zero
instead.  Further testing and comparison with INIT result sets
generated by ECL will inform the decision here.

We add unit tests for all combinations of number of active phases
(two or three) and which saturation function keyword family is
present in the simulation case.  The unit tests use the tables from
SPE 9 for keyword family One and the tables from SPE 1 for keyword
family Two.  Comparison data is extracted directly from the ECL INIT
file in the case of the SPE 9 tables and derived from independent
calculation for the SPE 1 tables.
2017-11-27 09:15:00 +01:00
Bård Skaflestad
67cf8764aa Linearised Output Table: Store Derivatives at Right-Hand End Point
This is more in keeping with the intended application--at least for
saturation function output to the INIT result set.

While here, also remove an unused data table (SWOF from SPE1).
2017-11-27 09:15:00 +01:00
Bård Skaflestad
e2bf7bf699 Table Output: Add Facility to Simplify Indexing Details
This commit introduces a new helper class, LinearisedOutputTable,
that is oriented towards managing tabular data such as the PVT or
saturation functions in an ECL result set (typically, .INIT file).
The class knows about row padding and the column oriented nature of
Fortran-like tables.

While here, and in anticipation of adding output of tabulated
saturation functions, also provide a mechanism for calculating
slopes of piecewise linear interpolants.  The ECL format stipulates
that function derivatives be output along with the actual table
data for most functions.
2017-11-27 09:15:00 +01:00
Bård Skaflestad
e26d647252 Table Output: Don't Store ECL Keywords Internally
This commit switches the internal implementation of the 'tab' and
'tabdims' vectors from being a mix of ECL keyword structures and
std::vector<>s to being purely std::vector<>s.  We remove the
fwrite() member function and rather reimplement the feature in terms
of new query member functions

    const std::vector<int>& tabdims() const
    const std::vector<double>& tab() const

that return read-only references to internal data members.
2017-11-27 09:15:00 +01:00
Bård Skaflestad
a2883e5057 Table Output: Switch to One-Based Offset Indices
This is needed for compatibility with Fortran and external software
that reads the .INIT file.
2017-11-27 09:15:00 +01:00
Andreas Lauser
96c5843421 add an energy "phase"
this is just like the solvent "phase" and the polymer "phase". Since
IMO this is a bit awkward, the Phases class should possibly be renamed to
something like "ConservedQuantities".
2017-11-25 18:08:28 +01:00
Andreas Lauser
1f7cda4569 add the infrastructure for SPECROCK
this is analogous to the SPECHEAT patch:

- fix the JSON definition
- add a table class
- wire the table class into TableManager
2017-11-25 18:08:28 +01:00
Andreas Lauser
a5f334977c add the higher-level infrastructure for the SPECHEAT keyword
This changes the JSON definition of the SPEHEAT keyword from a blob to
a table, adds a SpecHeatTable class and wires it into the
TableManager.
2017-11-25 18:08:28 +01:00
Andreas Lauser
c2b204ab28 add some missing thermal keywords and grid properties 2017-11-25 18:08:28 +01:00
Andreas Lauser
62333f08a8 units: add energy
an alternative is to add heat capacity, but this is more cumbersome
because some heat capacities are volumetric while others are mass
specific. (note that the "single division" shenengian of the unit
system's expression parser needs to be considered for most energy
related keywords.)
2017-11-25 18:08:28 +01:00
Andreas Lauser
fa0d1ff4bd add a OILDENT keyword
just like GASDENT, this keyword is OPM specific but it is exactly
analogous to WATDENT.
2017-11-25 18:08:28 +01:00
Andreas Lauser
84c561b44c add a GASDENT keyword
this keyword is OPM-specific and specifies the thermal expansion
of gas. it is completely analogous to WATDENT.
2017-11-25 18:08:28 +01:00
Andreas Lauser
d2615a508e WATDENT: fix the defaults
the old default values seemed to be the ones for imperial units, not
the metric ones.
2017-11-25 18:08:28 +01:00
Andreas Lauser
b1cbddb18c fix the value returned by TableManager.rtemp()
because everything in opm-parser uses SI units this needs to be
Kelvin, not degrees Celsius!
2017-11-25 18:08:28 +01:00
Andreas Lauser
b83bbf89ca fix the JSON definition of the STCOND keyword 2017-11-25 18:08:28 +01:00
Atgeirr Flø Rasmussen
78173581ee Merge pull request #290 from andlaus/remove_configure
remove the configure wrapper script
2017-11-24 13:10:58 +01:00
Arne Morten Kvarving
af503d2c48 fixed: do not use ParameterGroup code in opm-core test program
it now sits in opm-common. yields confusing output as test
program compilation will succeed even if opm-common but not opm-core
is available
2017-11-24 12:44:03 +01:00
Andreas Lauser
2c6db2a109 remove the configure wrapper script
this used to provide autotools compatibility, but it has not been working for a while. Thus it is IMO better to remove it in order not to mislead people.
2017-11-24 10:37:40 +01:00
Andreas Lauser
94aafeb93c remove the configure wrapper script
this used to provide autotools compatibility, but it has not been working for a while. Thus it is IMO better to remove it in order not to mislead people.
2017-11-24 10:36:46 +01:00
Andreas Lauser
b1564370a8 remove the configure wrapper script
this used to provide autotools compatibility, but it has not been working for a while. Thus it is IMO better to remove it in order not to mislead people.
2017-11-24 10:36:46 +01:00
Tor Harald Sandve
7a8db84a31 Fix FPR and RPR for 2p GasOil 2017-11-24 08:53:09 +01:00
Tor Harald Sandve
f90ed86124 Add TUNING_CHANGE event for TUNING 2017-11-23 14:22:36 +01:00
Lars Petter Øren Hauge
efd108da56 Add GOP(R/T)(F/S)
Handling keywords to output rate and total for free and vaporized oil
2017-11-23 11:34:31 +01:00
Lars Petter Øren Hauge
8e6387456c Add GGPTS+GGPTF 2017-11-23 11:34:19 +01:00
Tor Harald Sandve
b5d4959375 Use linear interpolation for kro columen in SOF2 Table 2017-11-23 10:49:22 +01:00
Steinar Foss
87b79b5d36 EclipseIO::writeInitial: adjusted comment on int_data 2017-11-21 13:17:02 +01:00
Steinar Foss
0c20baa523 scatterVector method not used anymore 2017-11-21 11:15:26 +01:00
Steinar Foss
0679a63a3b test_EclipseIO.cpp: removed use of test_assert functions from ERT. 2017-11-21 10:30:45 +01:00
Steinar Foss
2dce52478c EclipseIO::writeInitial: added comments on int_data argument 2017-11-21 10:30:45 +01:00
Steinar Foss
73420104b5 variable named map renamed to int_data 2017-11-21 10:30:45 +01:00
Steinar Foss
045e355720 Added possiblity: writing integer fields to INIT files.
added std::map argument to EclipseIO::Impl::writeINITFile

writing EclipseIO::Impl::writeINITFile argument to INIT file

...

...
2017-11-21 10:30:45 +01:00
Tor Harald Sandve
7aaad448d4 Add support for WEFAC 2017-11-21 09:55:07 +01:00
Atgeirr Flø Rasmussen
c55885633c Merge pull request #286 from akva2/import_param_group
Import ParameterGroup code from opm-core
2017-11-18 09:14:07 +01:00
Arne Morten Kvarving
933b28ab7b add ParameterGroup code to build system 2017-11-17 13:10:06 +01:00
Arne Morten Kvarving
8f637064c4 changed: remove embedded 'parameters' namespace in ParamGroup
inconsistent and unnecessary.

this is purely a cosmetic change, the only exception was a function with
the generic name 'split', which was renamed to splitParam to avoid confusion.
2017-11-17 13:10:06 +01:00
Arne Morten Kvarving
3a54a224cf changed: remove XML support for ParameterGroup 2017-11-17 13:10:06 +01:00
Liu Ming
18533e990d paramemters output should go in Debug mode. 2017-11-17 13:10:06 +01:00
Liu Ming
95d91b0f05 fix strange indentation. 2017-11-17 13:10:06 +01:00
Liu Ming
a66ebf5fcb fix indentation and messages. 2017-11-17 13:10:06 +01:00
Liu Ming
d1768a8c1c write well related information into OpmLog. 2017-11-17 13:10:06 +01:00
Liu Ming
61b0d2e22e write the parameters information into OpmLog. 2017-11-17 13:10:06 +01:00
Andreas Lauser
57fc9d0179 use the error macros from opm-common 2017-11-17 13:10:06 +01:00
Markus Blatt
6cd2560cd6 Allow to prevent ParameterGroup from printing to std::cout.
This commit adds a verbose flag to the constructor of
ParameterGroup to allow for deactivating any
output to std:cout. This is handy for parallel runs where we only
want to print statistics on one process.
2017-11-17 13:10:06 +01:00
Atgeirr Flø Rasmussen
0cee419b89 Make test argc/argv data mimic POSIX correct data. 2017-11-17 13:10:06 +01:00
Atgeirr Flø Rasmussen
c4e9b06569 Update test to work correctly with new behaviour.
Also add a test to verify that we throw when we are supposed to.
2017-11-17 13:10:06 +01:00
Atgeirr Flø Rasmussen
3dd2d565fc Modified behaviour for unhandled arguments.
Use constructor argument verify_syntax to decide course of action: if false,
store unhandled arguments, if true, write a message and throw.
2017-11-17 13:10:06 +01:00
Atgeirr Flø Rasmussen
9d6489f68d Return const reference from unhandledArguments(). 2017-11-17 13:10:06 +01:00
Atgeirr Flø Rasmussen
2ed7955f81 Add test for ParameterGroup::unhandledArgument(). 2017-11-17 13:10:06 +01:00
Atgeirr Flø Rasmussen
a1784d9f1f Store unhandled command-line arguments.
A new method ParameterGroup::unhandledArguments() is available to
access the list of unhandled arguments. Before, when such arguments
were encountered they were ignored and a warning was printed to
standard out.

Apart from the lack of a (potentially misleading) warning, this
should not change the behaviour of existing clients of the class.
2017-11-17 13:10:06 +01:00
Roland Kaufmann
a82e866050 Convert functions in anonymous namespace into statics
These functions are referred to from templates which may not be
instantiated. Since they were in an anonymous namespace they were
not reachable otherwise, and a warning is emitted. This only applies
to Clang; GCC consider them used.

If we make them static helper functions instead, the warning
disappears.
2017-11-17 13:10:06 +01:00
Andreas Lauser
e86c12dcf4 fix headers
make all non-implementation headers includable without
preconditions. Also, this removes the GravityColumnSolver.hpp file,
because it tried to include a non-existing file and it was thus unused.
2017-11-17 13:10:06 +01:00
Andreas Lauser
02cc08dd37 use std::shared_ptr instead of boost::shared_ptr
our policy is that we only use boost if necessary, i.e., if the oldest
supported compiler does not support a given feature but boost
does. since we recently switched to GCC 4.4 or newer, std::shared_ptr
is available unconditionally.
2017-11-17 13:10:06 +01:00
Júlio Hoffimann
73139aecc2 Remove trailing whitespaces 2017-11-17 13:10:06 +01:00
Markus Blatt
6a10f17496 Changed std::tr1 occurences to boost.
std::tr1 might not be supported by all compilers and will eventually
be dropped by others. Using boost instead makes this more
portable.
2017-11-17 13:10:06 +01:00
Roland Kaufmann
8b4578b9d8 Restructure tests directory to unit tests
Every program that relies on manual inspection has been moved to a new
(hopefully short-lived) directory called not-unit/; every remaining
file has been given the prefix test_ to indicate that this is the
executable test to be run.
2017-11-17 13:10:06 +01:00
Atgeirr Flø Rasmussen
9712bad814 Changed OpenRS->OPM in copyright notices and #include guards. 2017-11-17 13:10:06 +01:00
Bård Skaflestad
5b29859362 Remove a derelict statement inherited from original implementation.
Disabled by default, this statement attempted to pass a std::istream to
function std::fclose() which is meaningless and should not be enabled at
any time--even for a MATLAB-related build.
2017-11-17 13:10:06 +01:00
Xavier Raynaud
77da35fef1 Corrected typo in comments. 2017-11-17 13:10:06 +01:00
Atgeirr Flø Rasmussen
9b7529a265 Suppressed multiple warnings. 2017-11-17 13:10:06 +01:00
Xavier Raynaud
785a7308a5 Added possibility to parse comments in readparam. 2017-11-17 13:10:06 +01:00
Xavier Raynaud
9c79ab9794 merge 2017-11-17 13:10:06 +01:00
Bjørn Spjelkavik
98bfb48081 Changed namespace Dune -> namespace Opm. 2017-11-17 13:10:06 +01:00
Bård Skaflestad
da2e458f01 Support switching off syntax check in constructor.
This is useful if a set of parameters can all be defaulted in which
case launching the executable *should* be a simple as

    ./a.out

but the constructor requirement leads to using

    ./a.out a=b

or something similar.
2017-11-17 13:10:06 +01:00
Atgeirr Flø Rasmussen
9ebc0e5745 Now library contents build. Headers and tests not done yet. 2017-11-17 13:10:06 +01:00
Sveinung Styve Rundhovde (IT SI SIB)
3fffeda7d7 Add WOPTS+WOPTF keywords 2017-11-17 09:36:05 +01:00
Sveinung Styve Rundhovde (IT SI SIB)
ff3d0cda28 Add vaporized_oil to Rates 2017-11-17 09:36:05 +01:00
Sveinung Styve Rundhovde (IT SI SIB)
85eca28c84 Add WGPTS+WGPTF keywords 2017-11-17 09:36:05 +01:00
Sveinung Styve Rundhovde (IT SI SIB)
72a08beb39 Add WGPRS+WGPRF keywords 2017-11-17 09:36:05 +01:00
Lars Petter Øren Hauge
1e776429f5 Add GGPRS+GGPRF keywords 2017-11-15 12:02:42 +01:00
Lars Petter Øren Hauge
0695ac5894 Add dissolved_gas to Rates 2017-11-15 12:02:42 +01:00
Arne Morten Kvarving
439aae72d2 added: option to not define NDEBUG for release builds 2017-11-13 12:16:23 +01:00
Atgeirr Flø Rasmussen
4f6a398db1 Merge pull request #284 from blattms/only-set-existent-library-dirs-2
Only set the library directories if module builds a library.
2017-11-08 20:53:09 +01:00
Markus Blatt
4a46e4a4cd Only set the library directories if module builds a library. 2017-11-08 14:58:38 +01:00
Joakim Hove
7f02fdc409 Merge pull request #1153 from andreabrambilla/master
Added missing include in Equil.hpp
2017-11-06 17:08:41 +01:00
Joakim Hove
198037d7fc Merge pull request #207 from joakim-hove/extract-schdeule
Extract Schedule and SummaryConfig.
2017-11-06 17:05:58 +01:00
Joakim Hove
8ece3efa76 Merge pull request #1138 from joakim-hove/extract-schedule
WIP: Extract schedule
2017-11-06 17:05:45 +01:00
Andrea Brambilla
8620ad485a Added missing include in Equil.hpp
When running test in opm-parser, this never showed up as a problem since
Equil.hpp seems to be always included after <vector> is included (either
directly or by including other files). However, this can become a
problem when using opm-parser in other projects (eg, sunbeam)
2017-11-06 15:13:26 +01:00
Joakim Hove (IT SI SIB)
ea10f1331a Added message to update list of missing features. 2017-11-06 13:16:57 +01:00
Rohith Nair
689c316c70 added RSCONSTT 2017-10-30 11:20:10 +01:00
Arne Morten Kvarving
d0c1eb28e3 Merge pull request #281 from andlaus/opm-simulators_no_umfpack_required
don't mark UMFpack as required for opm-simulators
2017-10-30 11:05:32 +01:00
Andreas Lauser
b6aa59aa66 Merge pull request #282 from atgeirr/minor-buildsys-fixes
Minor buildsystem fixes
2017-10-27 17:44:25 +02:00
Atgeirr Flø Rasmussen
1709398e25 Remove RT lib dependency. 2017-10-27 10:09:25 +02:00
Rohith Nair
db489f7b6c New keywords (#1150)
New keywords: AQUCT, AQUTAB, RSCONST, OPERATER
2017-10-27 09:11:16 +02:00
Atgeirr Flø Rasmussen
de70cdcb52 Library not needed nor found on macOS. 2017-10-26 11:08:10 +02:00
Atgeirr Flø Rasmussen
5519643aa4 Always set include-related CMake variables. 2017-10-26 10:51:18 +02:00
Andreas Lauser
fe7938d82a don't mark UMFpack as required for opm-simulators
before OPM/opm-simulators#1309 it was required, but this was not
enforced by the build system because the SuiteSparse tests are run by
the opm-core build system first and UMFpack is optional there.

thanks to [at]akva2 and [at]blattms for the heads-up.
2017-10-25 16:48:33 +02:00
Atgeirr Flø Rasmussen
1554574728 Merge pull request #280 from akva2/update_rh_packaging
update redhat packaging
2017-10-25 13:06:13 +02:00
Arne Morten Kvarving
5667a4877a update redhat packaging 2017-10-25 09:37:22 +02:00
Joakim Hove
612e255d4f Extracted Schedule and SummaryConfig, 2017-10-24 09:27:42 +02:00
Joakim Hove
77fcc865de Extracted SummaryConfig out from EclipseState 2017-10-24 09:13:21 +02:00
Arne Morten Kvarving
339d003a38 Merge pull request #276 from blattms/cmakify-dune-version
[cleanup] Use the module version that CMake exports directly.
2017-10-23 14:51:31 +02:00
Markus Blatt
8e58ea8567 Print package version and origin only for found modules. 2017-10-20 12:37:34 +02:00
Markus Blatt
c030dd865c Use module_DIR as the location in found status message. 2017-10-20 12:36:51 +02:00
Markus Blatt
63dd29ceb0 Use the module version that CMake exports directly.
Since all supported DUNE versions have a CMake based build system,
when can drop the magic and use the module version exported by CMake
directly.

The magic used previously was broken when setting CMAKE_INSTALL_LIBDIR to
an absolute path.
2017-10-20 12:31:17 +02:00
Andreas Lauser
683bca9131 change version to 2018.04-pre 2017-10-19 19:30:30 +02:00
Andreas Lauser
ef0b41419e Merge pull request #279 from akva2/remove_stale_file
remove stale file
2017-10-19 19:24:23 +02:00
Arne Morten Kvarving
f8cac9cf3f remove stale file 2017-10-19 13:46:01 +02:00
Atgeirr Flø Rasmussen
c784931db8 Merge pull request #278 from GitPaean/require_umfpack_opm_simulators
[discussion] adding UMFpack to prerequisite of opm-simulators
2017-10-17 07:02:45 +02:00
Atgeirr Flø Rasmussen
f682a87f5d Merge pull request #1145 from GitPaean/msw_support_more_perf
obtaining the depth for the completions based on segment information
2017-10-16 22:46:31 +02:00
Kai Bao
4e6bf8f019 obtaining the depth for the completions based on segment information 2017-10-16 21:53:49 +02:00
Kai Bao
e7b1172528 adding UMFpack to prerequisite of opm-simulators 2017-10-16 21:17:28 +02:00
Arne Morten Kvarving
e1f7da13d2 Merge pull request #273 from blattms/cmakify-sibling-search
Simplify dune/opm module search by relying on cmake package config files
2017-10-16 20:02:27 +02:00
Joakim Hove
c5a19f2a0e Merge pull request #1147 from blattms/fix-libecl-search-for-install
Fix search path of libecl for installed opm-parser.
2017-10-15 18:26:33 +02:00
Andreas Lauser
e3920a861c remove unused travis files
these have not been used for a while. .travis.yml and the files in opm-common/travis/ are in charge
2017-10-14 12:33:24 +02:00
Andreas Lauser
7b1ff93fa4 replace #if HAVE_CONFIG_H by #ifdef HAVE_CONFIG_H
it seems like most build systems pass a -DHAVE_CONFIG_H flag to the
compiler which still causes `#if HAVE_CONFIG_H` to be false while it
clearly is supposed to be triggered.

That said, I do not really see a good reason why the inclusion of the
`config.h` file should be guarded in the first place: the file is
guaranteed to always available by proper build systems, and if it was
not included the build either breaks at the linking stage or -- at the
very least -- the runtime behavior of the resulting libraries will be
very awkward.
2017-10-14 12:33:24 +02:00
Andreas Lauser
46b00ffc03 delete the bit-rotten EclipseReader.cpp
it do not even build because it the "EclipseGridInspector.hpp" header
file is nowhere to be seen. I'm deleting this file outright because if
this functionallity ought to be revived, the code can be brought back
from the annals of git.
2017-10-14 12:33:24 +02:00
Markus Blatt
6715ed6d48 Allow multiple find_package calls in config mode 2017-10-13 21:35:24 +02:00
Markus Blatt
5662f2a188 Allow second search for opm-common to get all its dependencies and defines.
As opm-common is search in the toplevel CMakeLists.txt of each module in
config mode and the dependencies and defines are only processed in
opm_find_package(opm-common), we allow a second search using module mode
to trigger opm_find_package.
2017-10-13 21:20:30 +02:00
Markus Blatt
db0a52ffdb Force module mode in search for dune and opm even if *_DIR is set.
Otherwise some defines and macros will not be set as this is done
in opm_find_package. This might also make sense for dunecontrol
which always will set *_DIR.
2017-10-13 21:19:11 +02:00
Atgeirr Flø Rasmussen
bfe098c1d4 Merge pull request #1142 from atgeirr/silence-warnings
Silence minor warnings.
2017-10-13 14:52:57 +02:00
Markus Blatt
c7fc21e343 Stop setting COMPARE_(SUMMARY|ECL)_COMAND in Findopm-output.cmake.
Theses variables are already set in opm-output-config.cmake. Unfortunately,
theres is still a bug there which will be fixed by a PR in opm-output. After
that everything should work and have less guess work in it.
2017-10-11 14:37:21 +02:00
Markus Blatt
e11fca5850 Fix search path of libecl for installed opm-parser.
Previously, ecl_DIR was always set to the build directory used even
for the installed cmake configuration file. This patch at least allows
to overwrite that location and for the installed version tries to guess
the correct location. The guess is that libecl and opm-parser are installed
under the same prefix. As a fallback we use the package registry.
2017-10-10 13:16:13 +02:00
Markus Blatt
7a891baef7 Use correct default clone directory in sibling search for ecl.
Previously we assumed it to be ecl (like the project name).
That is not correct. With this commit we now use the correct
default clone directory, libecl, in the sibling search.
2017-10-10 12:44:22 +02:00
Markus Blatt
fc4bac6b7a Suppress message "finding .. using module mode" for OPM modules. 2017-10-10 12:42:49 +02:00
Arne Morten Kvarving
352b5a371d Merge pull request #275 from akva2/fix_message
fix message posted on repeated update_data calls
2017-10-09 12:51:21 +02:00
Arne Morten Kvarving
2edffb8e61 fix message posted on repeated update_data calls 2017-10-09 12:40:14 +02:00
Atgeirr Flø Rasmussen
29d3df8e58 Merge pull request #274 from akva2/no_new_pr
changed: do not open a new PR in repeated update-data calls
2017-10-09 12:15:01 +02:00
Arne Morten Kvarving
2c74f75231 changed: do not open a new PR in repeated update-data calls 2017-10-09 11:10:46 +02:00
Markus Blatt
7c779697c7 Deactivate package cache and activate sibling search for ecl.
Even though people are telling that ecl is already found using
sibling search it turned out that this statement is false. It
was always found using the CMake package cache. When installing
this lead to the installed package using ecl from the build tree.
With this commit we first try to find ecl without the package cache
but maybe using sibling search. Building installed packages no works
by setting -DSIBLING_SEARCH=Off -DCMAKE_INSTALL_PREFIX=/install/path
2017-10-06 22:36:40 +02:00
Bård Skaflestad
f9973c5cf0 Parser: Recognise Keywords 'LAB' and 'PVT-M'
Add test to verify that the parser recognises these keywords.
2017-10-06 15:34:49 +02:00
Bård Skaflestad
c1fad41ae5 Deck Handling: Hook PVT-M Units Up to Deck Unit System
Missing in commit 17f518e.  Thanks to Joakim Hove for administering
the clue-by-four.

Pointy Hat: [at]bska.
2017-10-05 22:17:14 +02:00
Bård Skaflestad
e821f5534b UnitSystem: Add Support for PVT-M Unit Conventions
The PVT-M unit convention is essentially the same as the Metric
collection, except that pressure values are measured in atmospheres
rather than bars.
2017-10-05 17:39:45 +02:00
Joakim Hove
2c7d4dec41 Merge pull request #1135 from totto82/shutCompletionsFix
Fix shut well logic when WELOPEN and COMPDAT is combined
2017-10-05 14:27:34 +02:00
Atgeirr Flø Rasmussen
26a57dc4c9 Silence minor warnings. 2017-10-03 12:41:07 +02:00
Joakim Hove
21a2944885 Extract Schedule and SummaryConfig. 2017-10-03 09:29:25 +02:00
Tor Harald Sandve
eb4f0b68d6 Fix shut well logic when WELOPEN and COMPDAT is combined
Do not shut well if all completions are shut using WELOPEN but new
completions are opened using COMPDAT in the same time step.
2017-10-03 08:26:09 +02:00
Joakim Hove
a8f07228ce Using correct grid in restore_wells. 2017-10-02 08:58:31 +02:00
Arne Morten Kvarving
e6e5491c74 add HAVE_SUITESPARSE_UMFPACK to opm-simulators config.h 2017-09-29 23:19:48 +02:00
Arne Morten Kvarving
48472bcf1a typo: SUITEPARSE -> SUITESPARSE 2017-09-29 21:13:10 +02:00
Arne Morten Kvarving
fd411cb1b7 Merge pull request #259 from blattms/fix-check-for-opm-grid-with-dune-2.5
Fix check for opm grid with dune 2.5
2017-09-29 20:21:40 +02:00
Jens Gåsemyr Magnus
6aa83ab0d3 Added deck support for several keywords
Added deck support for the following keywords
  ACTION,
  APIGROUP,
  ENDACTIO,
  GLIFTOPT,
  GSATPROD,
  LIFTOPT,
  NOWARN,
  PPCWMAX,
  QDRILL,
  WARN,
  WELPI,
  WGASPROD,
  WINJMULT,
  WLIMTOL,
  WORKTHP
2017-09-29 15:07:01 +02:00
Markus Blatt
38e198d961 Always append CONFIG_VARS to ${module}_CONFIG_VARS.
It seems like this variable was not empty for e.g. dune-grid
and therefore we did not add some necessary defines before this
commit.
2017-09-29 11:02:14 +02:00
Joakim Hove
f82a6fd281 Removed unused function tracking first RFT. 2017-09-28 08:38:55 +02:00
Arne Morten Kvarving
3283278090 Merge pull request #265 from akva2/add_another_alias
add another alias for UMFPACK
2017-09-27 08:44:06 +02:00
Joakim Hove
0f211bd2c1 Merge pull request #1132 from joakim-hove/schedule-refactor
EclipseState: refactor constructor
2017-09-26 18:43:43 +02:00
Bård Skaflestad
151e6e55e4 Merge pull request #272 from akva2/update_fdapps_prereqs
changed: update opm-flowdiagnostics-applications prereqs
2017-09-26 17:23:04 +02:00
Markus Blatt
f5bf291f7d Simplify dune/opm module search by relying on cmake package configuration files.
We use ${module}_DIR to set the correct path when sibling search is activated.
The package configuration files set all the necessary variable and we save
us a lot of CMake magic.
2017-09-26 16:49:18 +02:00
Joakim Hove
9a0e8a40ba Updated SummaryConfig constructor call. 2017-09-26 14:01:09 +02:00
Arne Morten Kvarving
9646753a10 changed: update opm-flowdiagnostics-applications prereqs
it is now ecl, not ERT
2017-09-26 13:48:03 +02:00
Atgeirr Flø Rasmussen
9ca5b7d37b Merge pull request #271 from akva2/prune_old_branches
added: prune old branches from jenkins4opm remote on update_data calls
2017-09-26 10:34:32 +02:00
Arne Morten Kvarving
73d978d6c5 added: prune old branches from jenkins4opm remote on update_data calls 2017-09-26 09:48:15 +02:00
Atgeirr Flø Rasmussen
c04fcd0aeb Minor fix for test program. 2017-09-25 11:42:44 +02:00
Joakim Hove
a580259d99 Changed summaryconfig constructor. 2017-09-25 10:05:09 +02:00
Joakim Hove
6379cec8e0 Changed Transmult constructor 2017-09-24 15:43:29 +02:00
Joakim Hove
28f62a019f Removed GridDims from EclipseState. 2017-09-24 09:22:54 +02:00
Joakim Hove
df12c44963 Moved SummaryConfig to EclipseState root. 2017-09-24 02:35:36 +02:00
Joakim Hove
4c3aacc685 Moved SummaryConfig to EclipseState root. 2017-09-24 02:22:16 +02:00
Joakim Hove
726f7e9507 MOved SimulationConfig to EclipseState root. 2017-09-24 02:09:51 +02:00
Joakim Hove
6b3db2f9fe Removed EclipseState::getSchedule( ) calls. 2017-09-24 01:46:05 +02:00
Arne Morten Kvarving
0ea57b9054 Merge pull request #268 from andlaus/compile-ONLY_COMPILE
also compile tests marked `ONLY_COMPILE` on `make test-suite`
2017-09-22 11:46:16 +02:00
Alf Birger Rustad
66841bdb14 Added include on cmath to restore build on Debian. 2017-09-12 06:24:47 +02:00
Joakim Hove
77ea1decbd Added keyword CPRL to symmary parse test. 2017-09-11 18:24:48 +02:00
Joakim Hove
9a738d2363 Merge pull request #1128 from joakim-hove/cprl
Added CPRL as support connection keyword.
2017-09-11 17:26:53 +02:00
Joakim Hove
50206efd42 Added CPRL as support connection keyword. 2017-09-11 15:47:46 +02:00
Alf Birger Rustad
9919525c79 Merge pull request #201 from joakim-hove/rft-open-file
Make sure RFT file is opened in correct mode.
2017-09-11 09:02:13 +02:00
Joakim Hove
896f806492 Make sure RFT file is opened in correct mode. 2017-09-10 22:56:40 +02:00
Joakim Hove
4b3c06cbcc Fixed bug in time dependence of RFT configuration. 2017-09-08 23:33:52 +02:00
Joakim Hove
1bc7f306d9 Added method DynamicState::update_elm() 2017-09-08 23:33:50 +02:00
Jens Gåsemyr Magnus
fa100bba1a Added Deck copy constructor
Copying Decks caused the first and last iterators in DeckView to point
to invalid memory.
2017-09-07 09:34:23 +02:00
Tor Harald Sandve
c96f1cd6ca Fix RPR summary output
- weight RPR by hydrocarbon pore volume
2017-09-06 12:47:10 +02:00
Andreas Lauser
4b60de7248 also compile tests marked ONLY_COMPILE on make test-suite 2017-09-03 17:44:22 +02:00
Joakim Hove
266937ce0f Merge pull request #1120 from joakim-hove/deckitem-cout
Deck operator<<
2017-09-02 10:21:04 +02:00
Joakim Hove
5d6efc2d42 Merge pull request #1123 from joakim-hove/add-rptsmry
Added keyword RPTSMRY
2017-08-31 18:29:52 +02:00
Joakim Hove
54a5ea6393 Added keyword RPTSMRY 2017-08-30 18:23:00 +02:00
Joakim Hove
114c5da03b Added dump -> re_parse test loop for test decks. 2017-08-30 17:00:11 +02:00
Joakim Hove
1050b8cba9 Added operator<< suppport for Deckxxx 2017-08-30 16:57:23 +02:00
Joakim Hove
1f646711d4 Added DeckXXX::equal( ) method. 2017-08-30 16:57:22 +02:00
Joakim Hove
da55685b62 Added simple DeckOutput class for output. 2017-08-30 16:57:21 +02:00
Jens Gåsemyr Magnus
e8bfc517ee Remove python bindings
The Sunbeam project https://github.com/Statoil/sunbeam is replacing the
python bindings. The bindings have long been deprecated and are finally
removed.
2017-08-25 14:15:11 +02:00
Joakim Hove
1908e86c66 Added OPM keyword RHO. 2017-08-17 12:12:09 +02:00
Arne Morten Kvarving
0a9bae6587 add another alias for UMFPACK
used by dune 2.5
2017-08-16 12:25:20 +02:00
Joakim Hove
a50f4d174c Merge pull request #1112 from joakim-hove/smspec-sort
Sort SummaryConfig with smspec_node_cmp( ).
2017-08-11 05:41:13 +02:00
Arne Morten Kvarving
a809db074a fixed: usage of libecl from sibling directories 2017-08-10 12:17:31 +02:00
Andreas Lauser
af736c1837 make the build system compatible with Dune's cmake build system
before this, dune modules that are not using the OPM build system
needed to treat opm-parser as an external library. With this patch,
opm-parser can be build as part of duncontrol build chains, i.e.,
other modules just need to specify a depencency on opm-parser in their
dune.module file and opm-parser's libraries and headers get picked up
just fine.

Things like generating opm-parser-config.cmake should quite likely be
done in a better way, but I'm not really a cmake expert and the
solution proposed in this patch seems to get things done regardless of
whether opm-parser is system-installed or not. Comprehensive solutions
are highly appreciated.
2017-08-10 12:17:31 +02:00
Joakim Hove
e6320dc783 Merge pull request #1116 from joakim-hove/properties-scan-order
Change order of section scan.
2017-08-09 11:34:58 +02:00
Joakim Hove
99b9ec199a Change order of section scan. 2017-08-09 10:03:55 +02:00
Atgeirr Flø Rasmussen
a70dbddfa4 Merge pull request #198 from blattms/allow-to-overwrite-initial-oip
Allow simulator to overwrite initial OIP value.
2017-08-01 16:15:53 +02:00
Atgeirr Flø Rasmussen
78f7f9b347 Add missing <string> include. 2017-08-01 13:23:49 +02:00
Joakim Hove
0b60b4811a Sort SummaryConfig with smspec_node_cmp( ). 2017-07-31 11:52:15 +02:00
Joakim Hove
23e3bd8d4b Using Schedule::getWells( group, time_step)
When evaluating a group variable, like e.g. GOPR we need to traverse the
group tree all the way down to the leaf nodes, i.e. wells.
2017-07-26 09:24:48 +02:00
Joakim Hove
44d4aa64cc Added Schedule::getWells( group, time) overload
The new Schedule::getWells( group, time) overload will recursively scan
th group tree rooted at 'group' and return all the wells in that tree.
2017-07-25 20:19:12 +02:00
Arne Morten Kvarving
c6f6b078a7 changed: avoid use of targets for exports
the exported file refers to imported targets through their
name with the expectation that these are defined whenever
the target file is included.

the use of custom imported targets for boost thus becomes
problematic in downstreams, since they are forced to define
these targets prior to opm-parser inclusion.

as the targets are named the same as their library
counterparts it appears to work per murphy's law.
cmake will simply fall back to interpreting the target names as
library names, e.g. it will do -lboost_filesystem.
2017-07-21 12:37:09 +02:00
Markus Blatt
9f5dd5738d Allow simulator to overwrite initial OIP value.
Up to now we assumed that if there is interest in the
initial OIP value (e.g. to calculate FOE) then oip has
to be presented to EclipseWriter during the call of
writeInitial. For the downstream simulators OIP is
not available at this stage. This commit gives the simulator
the possibility to overwrite/reset the values later and
allows the current implementations to let output calculate
and output FOE.
2017-07-19 21:37:22 +02:00
Andreas Lauser
294f09ec44 make opm-parser fully independent of opm-common
i.e. now it does not use anything from opm-common anymore even when
it is build using dunecontrol.
2017-07-05 17:30:28 +02:00
Joakim Hove
20f34386c9 Merge pull request #1104 from joakim-hove/timemap
Timemap
2017-07-03 13:22:30 +02:00
Joakim Hove
384e2c8d0a Skip SPE10 tests on Appveyer.
Windows does not handle times before 1970 when using std::time_t
2017-07-03 11:57:39 +02:00
Joakim Hove
af18b76d48 Implement mkdate by mkdatetime. 2017-06-30 15:25:42 +02:00
Joakim Hove
b280ab9cdf Changed TimeMap::forward to use int64_t 2017-06-30 15:23:10 +02:00
Jens Ivar Jørdre
bbf29540a3 Update to new interface of TimeMap 2017-06-30 10:54:17 +02:00
Joakim Hove
9ffc7ebab2 Will insert RESTART header in summary files. 2017-06-30 10:22:42 +02:00
Jens Ivar Jørdre
d5d9a2aa93 Make use of forward() and sscanf()
Replace addition of last time and step by forward().

Replace use of strptime() by sscanf().
2017-06-30 09:32:13 +02:00
Jens Ivar Jørdre
cbc7f3cbd9 Update and augment tests
Remove or update referring to Boost ptime.

Change type of exception tested for in
dateFromEclipseThrowsInvalidRecord.

Add test initTimestepsLongStep that has a deck with time step of 25550
days.

Add test initTimestepsDistantDates that has a deck with dates of Jan 1st
2040 and 2050.

Add test for mkdatetime().
2017-06-29 14:54:20 +02:00
Jens Ivar Jørdre
47bfce0f3a Remove Boost ptime and augment tests
Remove constructor and overloads using Boost ptime. Also remove methods
rendered obsolete by the removal of ptime dependency. Rename methods
whose name was initially set to differentiate from ptime counterparts,
an example of which being 'timeTFromEclipse' renamed to
'timeFromEclipse'.

Replace use of gmtime() with util_set_date_values_utc().

Change signature of addTStep(std::time_t) to addTStep(int64_t).

Change base of month indices returned from eclipseMonthIndices(). Now
indices are 1-based.

Simplify timeFromEclipse() (previously timeTFromEclipse()).

Add mkdatetime(), analogous to mkdate() but with also hour, minute
and second parameters.
2017-06-29 14:42:59 +02:00
Joakim Hove
6da29073b3 Merge pull request #1103 from joakim-hove/ioconfig-gridfile-default
Changed IOConfig to correctly handle defaults.
2017-06-28 10:41:52 +02:00
Joakim Hove
7b6a7f8f6c Changed IOConfig to correctly handle defaults. 2017-06-27 15:53:21 +02:00
Jens Ivar Jørdre
4e08595430 Add new tests and revamp existing ones 2017-06-27 13:18:17 +02:00
Jens Ivar Jørdre
1646b3b994 Clean up code
Make use of static method mkdate() rather then using new static method
dateToTM().

Fix error in addTime(std::time_t)

Remove obsolete method dateToTm() and TODO comments.
2017-06-27 13:15:44 +02:00
Joakim Hove
bfca3e895c Moved integration tests. 2017-06-27 09:47:15 +02:00
Joakim Hove
416959c359 Merge pull request #1097 from joakim-hove/explicit-keyworlist
Added EclipseGrid method to get corner positions.
2017-06-27 09:41:24 +02:00
Joakim Hove
3c9f56a146 Initialize TEMPI property from RTEMP keyword. 2017-06-26 18:32:52 +02:00
Joakim Hove
65165f4049 Added keywords RTEMP and RTEMPA. 2017-06-26 18:32:52 +02:00
Jens Ivar Jørdre
c9af992b71 Add support for 64 bit time steps
Replace internal use of boost::posix_time::ptime with std::time_t.
2017-06-26 14:37:35 +02:00
Joakim Hove
009e00ed61 Added EclipseGrid method to get corner positions. 2017-06-23 17:05:11 +02:00
Markus Blatt
f8841cea15 Search for same header as used in compile test of Findopm-grid.cmake 2017-06-21 13:23:05 +00:00
Markus Blatt
3dd214ba34 Include geometry version in config.h.
This is needed with DUNE 2.5 as otherwise the includes of
geometry headers are for older DUNE versions.
2017-06-21 13:15:12 +00:00
Markus Blatt
ef5f730786 Make check for opm-grid work with DUNE 2.5.
Previously, we checked for header CpGrid.hpp which finally
tried to include the non-existent generic geometry headers
as the checks for dune-geometry versions do not work during
 a CMake run.
With this patch we search for the header GlobalIdMapper.hpp which
does not use any version checks and therefore works for every DUNE
version.
2017-06-21 13:15:12 +00:00
Joakim Hove
27096ea70f Merge pull request #1095 from bska/support-radial-properties
3D Properties Test: Check Radial Tensor Support
2017-06-21 11:55:22 +02:00
Joakim Hove
9ad260ad5c Merge pull request #1093 from andlaus/add_PLMIXNUM
Add plmixnum
2017-06-21 11:15:38 +02:00
Andreas Lauser
a3c02e8228 add the PLMIXNUM keyword and the corresponding grid property 2017-06-21 10:44:10 +02:00
Bård Skaflestad
df4176ae39 3D Properties Test: Check Radial Tensor Support
Mostly for completeness since the underlying implementation just
piggy-backs on the existing support for Cartesian tensors.
2017-06-21 10:16:12 +02:00
Andreas Lauser
c0ee823513 fix some shenanigans in the OPERNUM grid property definition
it would be weird if the default for the OPERNUM would be region 0
(a.k.a. -1 in C++) while it is 1 for any other *NUM keyword.

also, the //* token should never appear in any productive code. if a
case distinction between C and C++ is necessary, use `#if __cplusplus`!
2017-06-20 23:14:13 +02:00
Bård Skaflestad
e4010e87bc Eclipse3DProperties: Recognize Radial Permeability
Specifically, the PERMR and PERMTHT keywords honour the same rules
as the Cartesian specification (PERMX &c).
2017-06-20 20:37:43 +02:00
Bård Skaflestad
419ec32a2b Relocate RADIAL Keyword to RUNSPEC
As per specification.
2017-06-20 20:35:51 +02:00
Joakim Hove
537ddbea4b Merge pull request #1081 from joakim-hove/explicit-keyworlist
Added explicit list of keywordfiles.
2017-06-20 16:42:22 +02:00
Tor Harald Sandve
80d07d4191 Merge pull request #1091 from totto82/runSpec
Add polymer to phase class in Runspec
2017-06-20 16:20:09 +02:00
Joakim Hove
b2bee96c34 Keyword generator will use explicit list.
The keyword generator will no longer scan the directory with keywords,
instead the explicitly/manually maintained list of keywords will be
passed as an argument to the keyword generator.

The generator will only run once, creating header files, source and
test.
2017-06-20 10:45:06 +02:00
Joakim Hove
16b062ccc2 Added explicit list of keywordfiles. 2017-06-20 10:45:06 +02:00
Joakim Hove
16e12b0a65 Added TimeMap::forward( ) 2017-06-19 10:54:34 +02:00
Joakim Hove
e802737ec4 Changed from boost datetim to std::time_t. 2017-06-19 10:54:33 +02:00
Joakim Hove
f299984280 Changed TimeMap::operator[] to return std::time_t 2017-06-19 10:54:33 +02:00
Joakim Hove
b6afb2ab8c Removed date accessor from IOconfig/RestartConfig. 2017-06-18 16:55:22 +02:00
Tor Harald Sandve
bb0f4f2886 Add polymer to phase class in Runspec
Also add test for solvent in RunspecTests.
2017-06-16 14:01:10 +02:00
Joakim Hove
554e7217db Create boost targets names dynamically
On some systems, in particular Windows or custom boosts, plenty
information about configuration is embedded into the library name.
However, opm-parser's boost names were hard coded to the vanilla library
names, which leads to libraries not being found.

Generate the target names dynamically (and address them as variables) so
that the target names match the name of the library actually being
linked to - a name which is also then later exported to the
opm-parser-config.cmake file.
2017-06-14 15:34:24 +02:00
Atgeirr Flø Rasmussen
3502105357 Merge pull request #1083 from akva2/adjust_spe5
adjust for changed opm-data path
2017-06-12 14:35:36 +02:00
Andreas Lauser
178be3e8a6 add SSOL to the double grid properties
the keyword is already present, but as far as I can see it was not yet
treated as a grid property.
2017-06-12 11:02:28 +02:00
Andreas Lauser
938bac204c add support for the the SPOLY keyword
i.e. this allows to specify the initial polymer concentration within
the reservoir.
2017-06-12 11:02:28 +02:00
Arne Morten Kvarving
fba9072c17 adjust for changed opm-data path 2017-06-12 10:29:01 +02:00
Joakim Hove
11632729d3 Merge pull request #1082 from joakim-hove/travis-environment
Set env variable when running travis.
2017-06-11 23:33:01 +02:00
Joakim Hove
1548305837 Set env variable when running travis. 2017-06-11 22:29:44 +02:00
Joakim Hove
cf67d56dba Dsiable test when running travis. 2017-06-10 11:19:31 +02:00
Arne Morten Kvarving
b353126acf pass by reference 2017-06-09 17:38:42 +02:00
Arne Morten Kvarving
d459db661f quell signed/unsigned mismatch comparison warnings 2017-06-09 17:38:42 +02:00
Arne Morten Kvarving
aa21cd8b13 quell cppcheck warnings for non-explicit constructor
- the implicit casts from std::string/char* is part of the design for
the view class so we do not want to disable those.
- intializer list constructors should be implicitly called
2017-06-09 17:38:42 +02:00
Arne Morten Kvarving
1eae9ed8c7 explicitly add default constructor to quell warnings 2017-06-09 17:38:42 +02:00
Arne Morten Kvarving
18f15e7432 mark constructors as explicit 2017-06-09 17:38:42 +02:00
Arne Morten Kvarving
7805a533f8 initialize members 2017-06-09 17:38:42 +02:00
Arne Morten Kvarving
2faaab198e prefer initializer list 2017-06-09 17:38:42 +02:00
Arne Morten Kvarving
51208ac4f5 add static analysis support 2017-06-09 15:46:21 +02:00
Arne Morten Kvarving
2a3afbe846 initialize values to avoid maybe-unitialize-use-warnings 2017-06-09 12:11:35 +02:00
Arne Morten Kvarving
0b68a2f69e changed: make RestartValue constructor explicit
update code which previously relied on the implicit cast
2017-06-09 11:57:48 +02:00
Arne Morten Kvarving
ca8d18386c disable unused private method 2017-06-08 17:17:55 +02:00
Arne Morten Kvarving
f7a2d10d82 reduce scope of variables 2017-06-08 17:17:38 +02:00
Arne Morten Kvarving
9fbda39404 pass by reference 2017-06-08 17:16:39 +02:00
Arne Morten Kvarving
bc3eac293f make constructors explicit 2017-06-08 17:15:38 +02:00
Arne Morten Kvarving
8a90f30ed8 add (default) constructor to Rates 2017-06-08 17:14:33 +02:00
Arne Morten Kvarving
fe4d8e5dde remove unused variables 2017-06-08 17:14:15 +02:00
Joakim Hove
159eb7b562 Using std::to_string insteadof boost::lexical_cast. 2017-06-08 08:27:24 +02:00
Joakim Hove
494cb74124 Limited support for cylindrical grids.
For cylindrical grids based on the keyword set DRV, DTHETAV, DZV and
TOPS the EclipseGrid implementation will create a cornerpoint
representation of the grid.
2017-06-08 08:26:43 +02:00
Joakim Hove
fbb2ce73cd Added circle property to EclipseGrid 2017-06-08 07:01:25 +02:00
Joakim Hove
d4a4401b59 New keywords required to support cylindrical grids 2017-06-08 07:01:24 +02:00
Markus Blatt
cfbcd27ced Merge pull request #1078 from joakim-hove/DEBUG-debug
Changed debug -> DEBUG to avoid #define conflict
2017-06-06 21:33:27 +02:00
Joakim Hove
eefbdd2efb Changed debug -> DEBUG to avoid #define conflict 2017-06-06 20:32:56 +02:00
Joakim Hove
9120c67cf8 Ability to pass misc values to summary writer. 2017-06-06 15:40:34 +02:00
jokva
6af2cad882 Merge pull request #1071 from jokva/include-filesystem-path
Include filesystem path, boost_test depends on system
2017-06-02 18:38:12 +02:00
Arne Morten Kvarving
dd5aac18eb update path due to opm-data restructuring 2017-06-02 14:33:30 +02:00
Jørgen Kvalsvik
f9639a330b Include header for boost/filesystem/path 2017-06-02 14:04:20 +02:00
Jørgen Kvalsvik
c138e817bb Include boost/filesystem/path.hpp in JsonObject 2017-06-01 15:29:23 +02:00
Jørgen Kvalsvik
4adda14564 Generate keywords source and test files separately
Simplify the generator logic a bit by only creating one
ParserKeywords.cpp file, and create either source code for the library
or for the test. This is faster to compile serially, but is not possible
to compile in parallel. Still, it's a fair simplification, and clarifes
the makefile quite a bit, and makes dependencies and generation clearer.
2017-06-01 15:29:23 +02:00
Jørgen Kvalsvik
477fa5a988 Combine test files, reduce number of targets
In an effort to reduce the numbers of targets built, and consequently
the repeated work and overhead of compiling boost test, a series of
test programs are combined to larger modules.

Every target typically has a constant cost of 3-6s, depending on the
computer, just for the make to set up dependencies and for the compiler
to parse and compile the testing framework and other dependencies. Each
set of tests typically add very little, so significant savings are
achieved by merging targets.

When tested on a 2015 i5m laptop, this reduced serial, single-core
compile time from ~14m45s to ~11m15s.
2017-06-01 15:29:23 +02:00
Jørgen Kvalsvik
e884b0664c Redesign cmake
Tune the makefile according to new principles, which adds a few bells
and whistles and for clarity.

Synopsis:

* The dependency on opm-common is completely gone. This is reflected in
  travis and appveyor as well. No non-kitware cmake modules are used.
* Directories are flattened, quite a bit - source code is located in the
  lib/ directory if it belongs to opm-parser, and external/ if third
  party.
* The sibling build feature is implemented through cmake's
  export(PACKAGE) rather than implicitly looking through source files.
* Targets explicitly set required public and private include
  directories, compile options and definitions, which cmake will handle
  and propagate
* opm-parser-config.cmake for downstream users is now provided.
* Dependencies are set up using targets. In the future, when cmake 3.x+
  can be used, these should be either targets from newer Find modules,
  or interface libraries.
* Fewer system specific assumptions are coded in, instead we assume
  cmake or users set up system specific details.
* All module wide configuration and looking up libraries is handled in
  the root makefile - all sub directories only set up libraries and
  compile options for the module in question.
* Targets are defined and links handled transitively because cmake now
  is told about them. ${module_LIBRARIES} variables are gone.

This is largely guided by the principles outlined in
https://rix0r.nl/blog/2015/08/13/cmake-guide/

Most source files are just moved - if they have some content change then
it's nothing more than include fixes or similar in order to make them
compile.
2017-06-01 15:29:23 +02:00
Joakim Hove
430b216027 Merge pull request #1069 from jijordre/field_oil_efficiency
Add unit test for field oil efficiency (aka FOE)
2017-06-01 12:06:27 +02:00
Jens Ivar Jørdre
699f84f009 Add unit test for field oil efficiency (aka FOE) 2017-05-31 11:33:21 +02:00
Joakim Hove
5565bead86 Fixed mismerge. 2017-05-31 11:14:07 +02:00
Joakim Hove
59838f41c2 Changed library link from eclxx to ecl. 2017-05-31 11:13:15 +02:00
Joakim Hove
3d66efa262 Handle meta keyword PERFORMA.
When adding a ECL_SMSPEC_MISC_TYPE we protect against adding metakeyword
like 'PERFORMA' and 'ALL'.
2017-05-31 09:44:03 +02:00
Joakim Hove
4ce5681a21 SummaryConfig will internalize MISC keywords. 2017-05-31 09:44:02 +02:00
Joakim Hove
79ee673465 Merge pull request #1066 from joakim-hove/summary-rpr
Summary rpr
2017-05-31 09:10:09 +02:00
Joakim Hove
ac70c34c68 Write (incorect) TCPU value to summary files. 2017-05-30 06:33:46 +02:00
Joakim Hove
976a963f7a Explicitly added REGDIMS to test deck. 2017-05-26 00:40:57 +02:00
Joakim Hove
b9823a4c2e Changed region expansion in Rxxx SUMAMRY keywords.
If the region keywords from the SUMMARY section, like e.g. RPR, are
specified without explicit region numbers a summary key is added for all
region values from 1..NTFIP, irrespective of which region values are
actually present.
2017-05-25 23:39:45 +02:00
Joakim Hove
66efc1fd1f Small function which returns number of FIP regions 2017-05-24 21:05:42 +02:00
Markus Blatt
9cdb08b7ee Fixes shadowing member warning
```
opm-parser/opm/parser/eclipse/EclipseState/EndpointScaling.cpp: In constructor ‘Opm::EndpointScaling::EndpointScaling(const Opm::Deck&)’:

/opm-parser/opm/parser/eclipse/EclipseState/EndpointScaling.cpp:102:14: warning: declaration of ‘reversible’ shadows a member of 'this' [-Wshadow]

         bool reversible = true;
```
2017-05-24 11:22:01 +02:00
Joakim Hove
55cca82d91 Merge pull request #186 from joakim-hove/trvis-cmake
Using ppa for newer version of cmake in travis.
2017-05-18 12:06:14 +02:00
Joakim Hove
20bf8569ed Using ppa for newer version of cmake in travis. 2017-05-18 10:47:41 +02:00
Jørgen Kvalsvik
6294a5e03d Consume libecl as cmake targets
The upstream libecl exposes targets, not _LIBRARIES variables, and a
-config.cmake rather than a Find module.
2017-05-16 14:34:59 +02:00
Jørgen Kvalsvik
80c0bacaaa Appveyor; clone libecl, not ensembles/ert 2017-05-16 13:24:38 +02:00
Tor Harald Sandve
5ca412291a Add tests for FPR 2017-05-10 13:38:38 +02:00
Tor Harald Sandve
01c56deb3f PV weight FPR 2017-05-10 10:03:31 +02:00
Joakim Hove
7a0a230282 Merge pull request #181 from atgeirr/silence-warnings
Silence warnings
2017-04-26 15:11:58 +02:00
Markus Blatt
d50ccf507d Fixes some problems with option parsing.
Namely, that m requires an argument and not n as indicated to
getopt. This caused the help message to be printed whenever users
did not want exceptions to be thrown.

Additionally we fix the error message for options that need an argument
but do not get one.
2017-04-19 15:14:25 +02:00
Atgeirr Flø Rasmussen
cf0a572977 Remove unused function arguments. 2017-04-12 10:33:00 +02:00
Atgeirr Flø Rasmussen
4e11ce151a Silence sign mismatch errors. 2017-04-12 10:32:37 +02:00
Atgeirr Flø Rasmussen
ada3e302b8 Silence shadowing warnings. 2017-04-12 10:31:53 +02:00
Atgeirr Flø Rasmussen
d5faef5aba Remove unused function. 2017-04-12 10:05:12 +02:00
Joakim Hove
621b94235c RestartIO::load( ) can specifiy optional keys. 2017-04-11 14:35:10 +02:00
Joakim Hove
368e63c0ed Revert "Made extra data support also float data"
This reverts commit 14052f9691e95bbe2886750ac3f356d6de86c1ad.
2017-04-11 13:03:50 +02:00
babrodtk
8a93d918be Made extra data support also float data 2017-04-07 16:14:18 +02:00
Joakim Hove
540a64330c fixup! Added Polymer EVENT. 2017-04-05 16:39:53 +02:00
Joakim Hove
2a591a1661 Added Polymer EVENT. 2017-04-05 16:05:25 +02:00
Joakim Hove
4ec72ba32b Added Well::firstTimeStep( ) 2017-04-05 16:05:12 +02:00
Joakim Hove
67dd83264b Added events to wells. 2017-04-05 14:46:00 +02:00
Joakim Hove
c65dadaa07 Merge pull request #176 from joakim-hove/data-type-changes
Change in ert data_type for ecl_kw.
2017-04-03 13:21:35 +02:00
Joakim Hove
39859c8d88 Skip random text when unknown keyword. 2017-03-29 18:25:23 +02:00
Joakim Hove
aa5a0b1ed9 Merge pull request #1055 from joakim-hove/disable-opm-common-build
Do not build opm-common on Windows.
2017-03-29 18:25:07 +02:00
Joakim Hove
08602e3d7d Do not build opm-common on Windows. 2017-03-29 17:16:08 +02:00
Joakim Hove
01f43dc6ca Change in ert data_type for ecl_kw. 2017-03-25 21:23:07 +01:00
Joakim Hove
010404ed8f Travis: apt-get install bc 2017-03-21 19:56:13 +01:00
Joakim Hove
f6b168c598 Travis: apt-get install bc 2017-03-21 16:22:45 +01:00
Tor Harald Sandve
adf37d72bb Do not extrapolate initial rs and rv values in the depth tables 2017-03-16 12:57:56 +01:00
Joakim Hove
0fdde95759 EndpointScaling: will create default is SWATINIT 2017-03-16 08:24:58 +01:00
Kai Bao
3cc14028e9 updating the path to the 2D MSW deck in opm-data
after the path to the deck is changed in opm-data.
2017-03-15 16:33:13 +01:00
Kai Bao
a99cf7c78f adding 1 atma deafult BHP for keyword WCONPROD
and always employing a BHP constraint
2017-03-10 12:51:18 +01:00
Joakim Hove
ace3e10ac5 RestartIO::load extra keys can be marked optional. 2017-03-09 14:49:34 +01:00
Joakim Hove
2cd85aa885 Added json config for keyword: COMPIMB 2017-03-08 08:20:18 +01:00
Joakim Hove
3d2a0a6368 Changes to restart IO.
- Will throw an exception if solution data has wrong size.
 - struct ResatrtValue used as RestartIO::load( ) return value.
 - RestartIO can take arbitrary double vectors as extra data.
2017-03-03 08:21:44 +01:00
Joakim Hove
00d7f7e155 Added ability to save restart fields in double. 2017-02-22 18:24:10 +01:00
Joakim Hove
c0aa0ccf6c Added no-crash well load test to file comparator. 2017-02-17 15:57:06 +01:00
Joakim Hove
46d92517f7 Added well load test to restart testing. 2017-02-17 15:17:08 +01:00
Joakim Hove
cff2bacade Merge pull request #167 from joakim-hove/document-INIT
Document init
2017-02-17 10:38:58 +01:00
Joakim Hove
1446bda82c Merge pull request #168 from akva2/no_throw_init_restart
added: option to not throw on error in restart/init regression test
2017-02-16 17:25:32 +01:00
Arne Morten Kvarving
594572152a added: option to not throw on error in restart/init regression test
useful for doing a more thorough analysis of the failure
2017-02-16 15:51:11 +01:00
Joakim Hove
ebc3a3ac79 Added GridProperties::hasDeckKeyword( )
The GridProperties::hasDeckKewyord( ) will return false for keywords
which have only been auto generated. Have also renamed
getInitializedkeyword( ) to getDeckKeyword( ).
2017-02-16 15:13:13 +01:00
Joakim Hove
0dcf411e8c Changed semantics of GridProperties.hasKeyword( )
The GridProperties.hasKeyword( ) would previously return false if a
keyword in the properties container had been auto created. This is now
changed, the hasKeyword( ) implementation will not consider whether a
keyword has been autocreated or not.

Have also added a void method GridProperties.assertKeyword( kw ) which by
side effect will ensure that the container contains the keyword kw.
2017-02-16 15:13:12 +01:00
Joakim Hove
304c788e56 Minor python fixup. 2017-02-16 13:51:09 +01:00
Joakim Hove
4df345d18b Merge pull request #1040 from totto82/sat_tableId
Store saturation tableId for completions
2017-02-16 12:57:19 +01:00
Joakim Hove
4889c34b2a Write NTG to INIT file. 2017-02-16 11:00:29 +01:00
Joakim Hove
b71fce3dd8 Document writeInitial. 2017-02-16 09:08:51 +01:00
Tor Harald Sandve
78e7428b37 Add non-default SATNUM values to the CompletionsFromDeck test 2017-02-16 08:37:36 +01:00
Tor Harald Sandve
89e0e69510 Change SATNUM value to plain int 2017-02-16 08:36:41 +01:00
Tor Harald Sandve
cdfd54593f Default saturation table_id in completions with cell satnum value
Pass eclGridProperties from EclipseState to Completions in order to set
default saturation table. Most changes are due to interface change in
Schedule(...)
2017-02-16 08:27:29 +01:00
Tor Harald Sandve
884d0712e3 Store saturation tableId for completions 2017-02-16 08:27:29 +01:00
Joakim Hove
aa07753769 Merge pull request #1042 from joakim-hove/properties
Added very basic Eclipse3DProperties in Python.
2017-02-15 16:15:13 +01:00
babrodtk
1ec5baeb2e Fixed auxillary=>auxiliary 2017-02-15 14:50:17 +01:00
Joakim Hove
9e23ad144b Added very basic Eclipse3DProperties in Python. 2017-02-15 14:24:18 +01:00
Andreas Lauser
1fa80328cf TableManager: export the Eqldims object
this object corresponds to the EQLDIMS keyword. Probably it is not the
most intuitive place to provide access to this keyword, but as far as
I can see the table manager is the only place where this object is
already properly instantiated.
2017-02-13 16:38:23 +01:00
Joakim Hove
c410f99625 Merge pull request #1039 from atgeirr/replace-backslash-include
Replace backslash in INCLUDE paths
2017-02-13 13:35:00 +01:00
Atgeirr Flø Rasmussen
8936d9ab38 Fix tests: actually check for keyword in deck. 2017-02-13 11:16:32 +01:00
Atgeirr Flø Rasmussen
8527e646a1 Improve tests by checking for present keyword. 2017-02-10 13:02:21 +01:00
Atgeirr Flø Rasmussen
b82d9eb9b3 Add tests and test files with backslashes in INCLUDE paths. 2017-02-09 21:17:14 +01:00
Atgeirr Flø Rasmussen
b52381ca14 In INCLUDE paths, replace backslashes with slashes. 2017-02-09 21:08:16 +01:00
Joakim Hove
f3a4029195 Added test of require3D functionality from Summary 2017-02-07 14:40:11 +01:00
Joakim Hove
9e0495dfee Added FWIP as WIP dependency. 2017-02-07 14:35:37 +01:00
Andreas Lauser
4d67ce7b70 fix a GCC 7 warning
GCC 7 warns

```
dynamic exception specifications are deprecated in C++11; use ‘noexcept’ instead [-Wdeprecated]
```

here.
2017-02-07 12:55:26 +01:00
Joakim Hove
5ea448ac93 Check required restart fields for summary. 2017-02-07 11:16:28 +01:00
Arne Morten Kvarving
5a5d82fb86 throw runtime error if caller passes wrongly sized arrays to output 2017-02-06 14:11:56 +01:00
Joakim Hove
d0dcba2d72 Updated test-data to use active cells. 2017-02-06 14:07:16 +01:00
Arne Morten Kvarving
97a7ca3013 added: option to not throw on error in summary regression test
useful for doing a more thorough analysis of the failure
2017-02-03 09:40:54 +01:00
Arne Morten Kvarving
691e210915 added: print number of compared steps in summary tests
it will aid some scripts and is useful in either case
2017-02-02 14:54:25 +01:00
Joakim Hove
20abc2872b EclipseIO::writeTimestep ensure summary data.
Codeblocks in EclipseIO::writeTimestep( ) have been reorder to ensure
that summary data is added also for substeps.
2017-01-31 23:09:18 +01:00
Joakim Hove
d988a010ff Added INIT file output of PVTW and Density. 2017-01-27 08:35:11 +01:00
Joakim Hove
4d1693d027 Changes in the loading of restart files.
The main content of this commit is that the loading of restart files is
based on map of keys passed in from calling scope. This way the
selection of keywords to save and load is fully under control of calling
scope, but in addition there are many small refactorings:

 - The EclipseWriter class and implementation has been renamed
   EclipseIO.

 - The loading and saving of restart files has been moved to file and
   namespace RestartIO, which contains two loose functions load( ) and
   save( ).

 - The Summary() and RFT( ) data get their own copies of the data::Cells
   vector.

 - Removed some abstractions and wrrappers around C / ert
   datastructures. Using ecl_file_view when loading restart files,
   instead of bare ecl_file. Simplified opening of unified restart
   files.

 - Removed the ability to save restart keywords in double precision.
2017-01-17 16:58:56 +01:00
Joakim Hove
6ef1d909d9 Solution data::solution has SI units in Summary. 2017-01-16 10:29:31 +01:00
Pål Grønås Drange
4543de807b Merge pull request #1031 from pgdr/opernum_regions
added REGIONS to opernum kw
2017-01-13 12:53:42 +01:00
Pål Grønås Drange
149f39baf5 OPERNUM defaults to reg0 and note on redefinability 2017-01-13 11:55:00 +01:00
Joakim Hove
bc37418d47 Merge pull request #1029 from joakim-hove/runspec-ecl-phase-masl
Added method Runspec::eclPhaseMask( )
2017-01-13 09:52:14 +01:00
Joakim Hove
f1308fa352 Instantiate unit system from Eclipse type id. 2017-01-12 13:36:42 +01:00
Joakim Hove
6e64935d5c Implement restartfilename with ERT::EclFilename 2017-01-12 13:36:39 +01:00
Joakim Hove
ef6def6511 Added getEclType() to UnitSystem 2017-01-12 13:36:38 +01:00
Pål Grønås Drange
41dd173be6 added REGIONS to opernum kw 2017-01-12 12:25:39 +01:00
Joakim Hove
12b25a7baa Passing correct unit system ID when writing. 2017-01-12 08:04:13 +01:00
Pål Grønås Drange
97294c988c Made getRegion() in e3d private 2017-01-11 16:18:04 +01:00
Joakim Hove
4f076c4813 Added method Runspec::eclPhaseMask( ) 2017-01-11 13:48:12 +01:00
Pål Grønås Drange
b8b5bd374b Added FIP_PROBE and tests, we now accept FIPxxxx kws 2017-01-11 12:36:22 +01:00
Joakim Hove
e2d51413ba Fix units for RS and RVwhen loading from restart. 2017-01-10 13:58:17 +01:00
Joakim Hove
d4c7d6f92e Merge pull request #1021 from joakim-hove/endscale-rename
Endscale rename
2017-01-10 12:21:00 +01:00
Pål Grønås Drange
c4d13a4650 add WOVPR to WELL_PROBE JSON 2017-01-09 17:06:18 +01:00
Pål Grønås Drange
1c6d82ebd6 added JSON for OPERNUM 2017-01-09 16:47:05 +01:00
Pål Grønås Drange
58840f763a added JSON for FIPOWG 2017-01-09 16:19:40 +01:00
Pål Grønås Drange
14cf9ff16f dont choke on WPAVEDEP 2017-01-09 15:34:39 +01:00
Pål Grønås Drange
164d5f449a Do not choke when encounter AITS or ROCKNUM
* internalized ROCKNUM, added tests
2017-01-09 15:16:50 +01:00
Pål Grønås Drange
67e2199a68 implement == for Well 2017-01-09 15:16:43 +01:00
Joakim Hove
694ace932e Renamed endpoint_scaling() -> endpointScaling() 2017-01-03 19:29:56 +01:00
Joakim Hove
1e191fe928 Moved EndpointScaling.hpp to separate file. 2017-01-03 19:25:30 +01:00
Jørgen Kvalsvik
36d2e1349d Understand ENDSCALE and SCALECRS
Exposes the semantics defined by ENDSCALE (and SCALECRS) in
Runspec.endpoint_scaling.
2017-01-03 16:49:51 +01:00
Jørgen Kvalsvik
083b834cd1 Return uppercase() by value, don't force move 2017-01-03 15:42:30 +01:00
jokva
328c320641 Merge pull request #1015 from jokva/solvent-support-in-phases
Solvent support in Runspec.phases
2017-01-03 12:23:52 +01:00
jokva
35df865753 Merge pull request #1016 from jokva/pvcdo-viscref-watdent
Understand PVCDO, VISCREF, WATDENT
2017-01-03 11:51:38 +01:00
Jørgen Kvalsvik
45cfedb183 Understand PVDCO, VISCREF, WATDENT 2017-01-03 11:39:08 +01:00
Jørgen Kvalsvik
eec0ebf708 Changelog December 2016 2017-01-03 10:48:10 +01:00
Jørgen Kvalsvik
20abeb5754 Tests for production_rate+injection_rate 2017-01-03 10:18:36 +01:00
Atgeirr Flø Rasmussen
91879da04e Silence various warnings. 2016-12-29 13:51:07 +01:00
Pål Grønås Drange
e5de0ca8d1 Revert throw, write warning to stderr
* no throw on JFUNC abuse, std::cerr
* removed 'get' from function names
2016-12-28 19:20:31 +01:00
Pål Grønås Drange
172725aef8 Added JFUNC in TableManager and getJFuncColumn()
* Fully internalized JFUNC
* Added JFunc.cpp, throw on wrong FLAG/DIR in JFUNC kw
* added tests for JFUNC in TableManagerTests
* added protected member m_jfunc to SimpleTable
* Added getJFuncColumn to accompany getPcowColumn
* Throws if pressure or jfunc is accessed inappropriately
 * ... meaning if getPcowColumn is called when JFUNC is in deck, or
 * getJFuncColumn is called when JFUNC is not in deck
* added tests for throwing and for getJFuncColumn
* SimpleTable.getColumn("PCOW/PCOG") throws if JFUNC
* In the event that one tries to get "PCOW" or "PCOG" via getColumn
* ... this will throw if JFUNC is present in the deck.
* Added tests.
2016-12-28 19:20:31 +01:00
Jørgen Kvalsvik
295a808310 Const'd OilVaporizationProperties 2016-12-22 15:18:04 +01:00
Jørgen Kvalsvik
31b4c4a0fb Solvent support in Runspec.phases 2016-12-20 14:13:07 +01:00
jokva
848d701b0d Merge pull request #1013 from jokva/understand-density-keyword
Provide DENSITY & ROCK table through EclipseState
2016-12-20 14:06:47 +01:00
Jørgen Kvalsvik
9a336f62fb Understand the ROCK keyword 2016-12-20 12:52:43 +01:00
Jørgen Kvalsvik
5413b841ef Generalise 'flat table'; implement DENSITY, PVTW
Several tables are identical both in structure *and* parsing, i.e. the
code required to parse them only differ in output type and possibly
number of items to read.

FlatTable is a simple vector-based template that expands into this exact
parsing routine, based on a simple specification of the record.
2016-12-20 12:52:43 +01:00
Jørgen Kvalsvik
e12ec3c003 Support RS+RV 2016-12-20 10:53:55 +01:00
Jørgen Kvalsvik
3c8b092dc5 Parse TUNINGDP 2016-12-14 10:44:48 +01:00
Jørgen Kvalsvik
dd673d6025 Parse WORKLIM 2016-12-14 10:44:48 +01:00
Jørgen Kvalsvik
8a76c7acf0 Parse WEFAC 2016-12-14 10:44:48 +01:00
Jørgen Kvalsvik
896b882c4b Parse WDFACCOR 2016-12-14 10:44:48 +01:00
Jørgen Kvalsvik
05dc85379a Parse CECON 2016-12-14 10:44:48 +01:00
Jørgen Kvalsvik
2526c69690 Parse PRORDER 2016-12-14 10:44:48 +01:00
Jørgen Kvalsvik
656c609904 Parse GRUPRIG 2016-12-14 10:44:48 +01:00
Jørgen Kvalsvik
3d2923d585 Parse COORDSYS 2016-12-14 10:44:48 +01:00
Jørgen Kvalsvik
771fe671d9 Complete TRACERS specification. 2016-12-14 10:44:48 +01:00
Jørgen Kvalsvik
fa9c449fd9 Parse LGR
Don't choke on LGR keyword.
2016-12-14 10:44:47 +01:00
Jørgen Kvalsvik
6f53ce8abe DEBUG keyword
Adding the DEBUG keyword specification. Makes us no longer choke on it,
but we're not using it for anything in partcular. The keyword name is
DEBUG_ since DEBUG often is defined as a macro in C++ and the auto
generation would then fail. We look up the name itself by using the
deck_names field.
2016-12-13 14:49:20 +01:00
Jørgen Kvalsvik
6295435dd4 FMWSET expansion
FMWSET should, similar to ALL and GMWSET, expand to a set of field
property counting keywords.
2016-12-13 13:11:46 +01:00
Jørgen Kvalsvik
155e6d1cb5 GMWSET expansion
GMWSET should, similar to ALL, expand to a set of group property
counting keywords.
2016-12-13 12:55:09 +01:00
Jørgen Kvalsvik
ba824ac606 Don't choke on numerical aquifer keywords 2016-12-13 12:26:15 +01:00
Jørgen Kvalsvik
cba116fe59 Don't choke on analytical aquifers 2016-12-13 12:19:59 +01:00
jokva
4b45a02e79 Merge pull request #1008 from atgeirr/remove-pessimizing-move
Remove pessimizing move() in return statements.
2016-12-12 16:57:33 +01:00
jokva
1446cadb8f Merge pull request #1009 from atgeirr/extra-braces
Add extra braces for C++11 compilers.
2016-12-12 16:57:21 +01:00
Atgeirr Flø Rasmussen
b4360ff1e7 Add extra braces for C++11 compilers.
With C++14 the warnings generated will probably disappear, but for now
this keeps clang happy (warning-free).
2016-12-12 14:58:13 +01:00
Joakim Hove
3e3837c8f5 Merge pull request #997 from jokva/COMPLUMP
COMPLUMP support
2016-12-12 14:39:31 +01:00
Atgeirr Flø Rasmussen
489f9a658c Remove pessimizing move() in return statements. 2016-12-12 14:09:48 +01:00
Jørgen Kvalsvik
57843f4eab COMPLUMP support
Support for COMPLUMP. a keyword to re-assign completion numbers that can
be used with keywords such as WELOPEN.

Some helper functions were moved out of handleWELOPEN and reused in
handleCOMPLUMP.
2016-12-12 12:34:54 +01:00
Joakim Hove
7c9d91dd73 Merge pull request #1006 from atgeirr/facedir-variants
Allow 'X+', 'I+', 'Y+', 'J+', 'Z+' and 'K+' for FaceDir strings (in FAULTS)
2016-12-09 17:01:38 +01:00
Atgeirr Flø Rasmussen
d753ecd9b4 Allow 'X+', 'I+', 'Y+', 'J+', 'Z+' and 'K+'.
This has been encountered in the wild. We treat it like
the documented 'X', 'I' etc. strings.
2016-12-09 15:19:40 +01:00
Pål Grønås Drange
65a673496a Removed unused import CWrapper 2016-12-08 14:09:42 +01:00
Jørgen Kvalsvik
b3d44c83a7 Completion number aware WELOPEN
No longer chokes when WELOPEN is given its last two parameters, C1 and
C2 for completion number begin/end. Instead, these now weigh in on
whether or not a well matches the criteria for opening or closing.

Includes some test fixes and some restructuring of handleWELOPEN.
Obsolete verifications of throwing on COMPLUMP have been removed.
2016-12-07 09:17:55 +01:00
Joakim Hove
bf46f28fc1 Merge pull request #1003 from jokva/pvtw-table
TableManager.getPvtwTable
2016-12-06 22:41:27 +01:00
Joakim Hove
0bbd0b92e6 Merge pull request #1002 from jokva/no-crash-broken-locale
Don't crash keyword compilation on broken locales
2016-12-06 21:40:28 +01:00
Joakim Hove
c740479299 Merge pull request #993 from jokva/dynamic-state-sans-realloc
Remagine DynamicState
2016-12-06 21:39:25 +01:00
Jørgen Kvalsvik
1d535124ec TableManager.getPvtwTable
Provide a richer interface to the PVTW table.
2016-12-06 15:18:19 +01:00
jokva
4b25b7c82f Merge pull request #131 from joakim-hove/remove-unused
Remove unused files
2016-12-06 15:15:07 +01:00
Atgeirr Flø Rasmussen
af281de24c Remove writeVtkData(). 2016-12-06 09:42:34 +01:00
Jørgen Kvalsvik
5986393930 Don't crash keyword compilation on broken locales
Work around a weakness of older boosts by forcing C locale if
std::locale throws.

The real solution is to not have broken locales, but this should make it
slightly easier to get the JSON keywords compiled.
2016-12-06 09:39:36 +01:00
Joakim Hove
a2c0831836 Removed unused header file. 2016-12-05 18:49:52 +01:00
Joakim Hove
b92cecc7eb Removed writeECLData. 2016-12-05 18:49:52 +01:00
Joakim Hove
9f312d2508 Merge pull request #1001 from atgeirr/add-more-tests-for-unit-constants
Add some tests for the unit constants.
2016-12-05 18:48:20 +01:00
Atgeirr Flø Rasmussen
31dd76a39f Add some tests for the unit constants. 2016-12-05 12:49:45 +01:00
Joakim Hove
9b6436204d Merge pull request #1000 from joakim-hove/zcorn-fixup-cell2cell
ZCORN adjustments considers cell-cell relation.
2016-12-05 10:41:47 +01:00
jokva
237658825b Merge pull request #995 from jokva/complnum-not-increase-multiple-records-same-compl
Only increment complnum when a completion is new
2016-12-05 09:46:33 +01:00
Joakim Hove
eb283a1434 ZCORN adjustments considers cell-cell relation. 2016-12-04 22:56:54 +01:00
Jørgen Kvalsvik
3051c76593 Changelog for November 2016 2016-12-02 11:51:22 +01:00
Jørgen Kvalsvik
745ac685f8 Reimagined DynamicState, leveraging std::vector
Changes DynamicState's implementation to, instead of maintaining a
current and initial element, rely on std::vector's capabilities. This
introduces a small change in semantics.

The new DynamicState will up-front allocate a vector of TimeMap.size,
and all entries will be the initial value. Lookup is then simplified to
vector.at. DynamicState.update will assgin to the given index and *all
consecutive elements* which will enforce the same invariant as before.

The behavorial change is that DynamicState will no longer throw on
update(x); update(y); where y < x. Instead, the resulting effect will be
that update(x) was never called.

This means that the Group.setInjectionPhase function behaves slightly
differently, because DynamicState.size is non-sensical. If multiple
distinct injection phases are specified for a group inside the same time
step then the last specified phase will be used. The comment has been
updated accordingly.
2016-12-02 07:48:14 +01:00
Jørgen Kvalsvik
e0180bf35a Fix == for prod/inj properties; add ostream <<
Fixes operator== for production properties which didn't take prediction
into account. Additionally added the operator<< with iostream for
unit testing and debugging purposes.
2016-12-01 16:23:01 +01:00
Jørgen Kvalsvik
8d240c02f6 OilVaporizationProperties.defined
Extend the interface of OilVaporizationProperties to not rely on
checking the enum for existence checks. This facilities checking
hasOilVaporizationProperties which rely on DynamicState.size.
2016-12-01 16:23:01 +01:00
Jørgen Kvalsvik
7bb6b1ba62 Drop unecessary make_shared 2016-12-01 16:17:25 +01:00
Jørgen Kvalsvik
847084234b Schedule.modifier_deck is no longer shared_ptr 2016-12-01 16:17:25 +01:00
Jørgen Kvalsvik
fbd833125e EclipseState.schedule is no longer shared_ptr 2016-12-01 16:17:25 +01:00
Jørgen Kvalsvik
946cc18f3a Schedule.wells are no longer shared_ptrs 2016-12-01 16:17:25 +01:00
Jørgen Kvalsvik
e8d018e045 Schedule.timeMap is no longer shared_ptr 2016-12-01 16:17:25 +01:00
Jørgen Kvalsvik
21eb728966 Only increment complnum when a completion is new
Fixes a bug where completions specified after a record just updated a
completion would be assigned a too high completion number.

COMPDAT can be used to re-specify some properties of connections, in
which case they're not actually new completions and the completion
number shouldn't change.
2016-12-01 14:10:07 +01:00
Joakim Hove
47a13e0579 Added (not run) test for PVTW. 2016-12-01 13:50:45 +01:00
Joakim Hove
c01220f178 Merge pull request #991 from jokva/correct-conversion-gas-oil-ratio-field
Correct unit for Field gas-oil+oil-gas ratio
2016-12-01 09:54:35 +01:00
Jørgen Kvalsvik
b7ad522043 Register completion number from COMPDAT
Connections are given a completion number starting at 1 implicitly when
they're first defined by the COMPDAT keyword. Until now this number has
been ignored.

The number itself isn't *used* for anything with this patch, just stored
and accessible.
2016-11-30 19:27:38 +01:00
Arne Morten Kvarving
4ede95d587 removed unused variable 2016-11-29 21:37:18 +01:00
Jørgen Kvalsvik
18de2c0751 Correct unit for Field gas-oil+oil-gas ratio
The FIELD units don't use identity in their converison from SI, as the
unit is Mscf/stb rather than m3/m3.
2016-11-29 13:52:50 +01:00
Joakim Hove
72d699473a Added PVTG output. 2016-11-28 13:22:57 +01:00
Joakim Hove
180057c062 Framework for adding tables to INIT file - PVTO. 2016-11-28 10:55:33 +01:00
Joakim Hove
c022809073 Added functionality to "fix" ZCORN problems. 2016-11-23 14:59:48 +01:00
Joakim Hove
82f1277fe8 Merge pull request #143 from jokva/head-i-j-timestep
Write headI/J with timestep parameter
2016-11-22 23:12:43 +01:00
Joakim Hove
d01cf74dc8 Merge pull request #987 from jokva/move-head-i-loc
Well.headI/J can change on timesteps
2016-11-22 23:12:03 +01:00
Joakim Hove
9a53243bd9 Added support for block variables in Summary. 2016-11-22 15:17:43 +01:00
Jørgen Kvalsvik
c55934e503 Write headI/J with timestep parameter 2016-11-22 14:27:31 +01:00
Jørgen Kvalsvik
d6f51c5508 Well.refDepth can change on timesteps
The reference depth is not a static property on first creation, but can
change on subsequent WELSPECs. Wrap the ref depth in DynamicState to
handle this.
2016-11-22 14:21:19 +01:00
Jørgen Kvalsvik
5c1cf47966 Well.headI/J can change on timesteps
Well.headI and Well.headJ was assumed to be fixed on first declaration,
and that all subsequent changes of this position was an error. This
turns out not to be the case, so the I/J positions are made dynamic.
2016-11-22 14:13:07 +01:00
Joakim Hove
0badeb68c7 Merge pull request #140 from jokva/foe
FOE support
2016-11-22 13:00:04 +01:00
Jørgen Kvalsvik
84690ce6b6 RGIPL+RGIPG support. 2016-11-21 12:35:23 +01:00
Markus Blatt
465af132e4 Fixes warning about parameters shadowing members of this.
/home/mblatt/src/dune/opm/opm-parser/opm/parser/eclipse/EclipseState/Schedule/GroupTree.cpp: In member function ‘void Opm::GroupTree::update(const string&, const string&)’:
/home/mblatt/src/dune/opm/opm-parser/opm/parser/eclipse/EclipseState/Schedule/GroupTree.cpp:39:76: warning: declaration of ‘parent’ shadows a member of 'this' [-Wshadow]
 void GroupTree::update( const std::string& name, const std::string& parent ) {
                                                                            ^
/home/mblatt/src/dune/opm/opm-parser/opm/parser/eclipse/EclipseState/Schedule/GroupTree.cpp: In member function ‘std::vector<std::basic_string<char> > Opm::GroupTree::children(const string&) const’:
/home/mblatt/src/dune/opm/opm-parser/opm/parser/eclipse/EclipseState/Schedule/GroupTree.cpp:76:77: warning: declaration of ‘parent’ shadows a member of 'this' [-Wshadow]
 std::vector< std::string > GroupTree::children( const std::string& parent ) const {
2016-11-21 10:13:55 +01:00
Jørgen Kvalsvik
fc789d489a FOE support
Field efficiency: (OIP(initial) - OIP(now)) / OIP(initial). The initial
OIP is cached, and FOIP is reused for OIP(now). Adds the
operator-(double,quantity) to make the formula obvious from the FOE
function.
2016-11-18 11:40:45 +01:00
Joakim Hove
62edf9a394 Merge pull request #983 from joakim-hove/runspec-tabdims
Changes in Tabdims construction:
2016-11-18 10:48:30 +01:00
Joakim Hove
5ebddba40e Changes in Tabdims construction:
1. Removed Tabdims(int,int,int, ....) constructor and added
    Tabdims(Deck) constructor.

 2. Added Tabdims member to Runspec( ) object.

 3. Changed std_shared_ptr<Tabdims> to Tabdims member in TableManager.
2016-11-18 10:48:02 +01:00
Jørgen Kvalsvik
e5b5c3c1c4 Simplified DynamicVector implementation 2016-11-17 14:55:23 +01:00
Jørgen Kvalsvik
0253d1675d WellSet uses strings, not Well pointers 2016-11-17 12:48:54 +01:00
Jørgen Kvalsvik
6826043b02 Replace WellSet pointers with set-of-names
The WellSet class is replaced by std::set, allowing predictable copy
semantics of Group. This change has rather few consequences as accessing
a well through a wellset was hardly ever done.

Getting hold of the corresponding well instance will now have to be done
via a Schedule instance - however, this simplifies the dependency graph
by severing the edge between the Group object and Well objects.
2016-11-17 12:48:42 +01:00
Joakim Hove
b13ec43635 Added inner table iterators to PvtxTable. 2016-11-16 19:53:54 +01:00
Joakim Hove
d64a040a2c Document enum TargetType. 2016-11-16 16:29:30 +01:00
Joakim Hove
a7ff6c064d Merge pull request #976 from jokva/group-tree-as-implicit-tree
Replace explicit GroupTree with ordered strings
2016-11-16 13:25:19 +01:00
Jørgen Kvalsvik
70e7b02043 DeckItem.push_back overload for size = 1
DeckItem.push_back using insert for 1 element turns out to be very
expensive and caused a performance degredation.
2016-11-15 15:33:27 +01:00
Jørgen Kvalsvik
cc677580f2 Replace TimeMap member with int in Well 2016-11-15 15:33:02 +01:00
Jørgen Kvalsvik
0b7ca057dd Remove internal shared_ptrs in Well 2016-11-15 15:33:02 +01:00
Jørgen Kvalsvik
827adad4db Make DynamicState.find const
Probably an oversight in the original design; it has always had const
behaviour.
2016-11-15 15:33:02 +01:00
Joakim Hove
76f5a4d78b Handle keyword OPERATE. 2016-11-15 08:45:04 +01:00
Joakim Hove
0b9843bc10 Added defaults + some rename in keyword OPERATE. 2016-11-15 08:45:04 +01:00
Joakim Hove
2b53bc4c43 Add begin() and end() to Box. 2016-11-15 08:45:04 +01:00
Joakim Hove
f0e9c9133f Some diagnostic information when cases differ. 2016-11-11 16:31:12 +01:00
Jørgen Kvalsvik
bfa108deef Replace explicit GroupTree with ordered strings
Replaces The GroupTree + GroupTreeNode classes building an explicit tree
of named nodes with a sorted vector of { name, parent-name } pairs that
builds an implicit tree. Provides the same semantics as the previous
group tree implementation, but with less code and copying for free.
2016-11-11 13:21:20 +01:00
Jørgen Kvalsvik
6869210730 Only give needed source files to createKeywordList
The ahead-of-time JSON-to-C++-object compilation step does not need all
the source files as it was passed. Reduces the set of source files
compiled into the createKeywordList binary to just the files it needs.
2016-11-11 13:15:13 +01:00
Arne Morten Kvarving
10b2218c0c fixed: missing installation of Typetools.hpp 2016-11-11 11:24:36 +01:00
Joakim Hove
f3f87b5935 Merge pull request #950 from jokva/stack-allocd-items
Stack allocd items
2016-11-11 11:07:43 +01:00
Jørgen Kvalsvik
c3bd468005 Pass grid to constructor in summary test. 2016-11-10 11:53:41 +01:00
Jørgen Kvalsvik
8b1ca9803f FPR support 2016-11-10 11:01:27 +01:00
Jørgen Kvalsvik
d16436913c RWIP support 2016-11-10 11:01:27 +01:00
Jørgen Kvalsvik
7866e38c19 Region injection rates and totals
Support for ROIR, RGIR, RWIR, ROIT, RGIT and RWIT. The oil injection
keywords exist for symmetry.
2016-11-10 11:01:27 +01:00
Jørgen Kvalsvik
6ae9535c37 GGLR+GGLRH support 2016-11-10 11:01:27 +01:00
Jørgen Kvalsvik
99df6acb8d Remove deprecated SimDataContainer pointer 2016-11-10 11:01:27 +01:00
Pål Grønås Drange
d8400f05bd Minor fixes unrelated to PR:
* Implemented missing method "name" in TableColumn.cpp
* add inline to method in RestartConfig to remove warning
* Whitespace changes
2016-11-09 12:29:08 +01:00
Jørgen Kvalsvik
a22196546a ParserItem no longer requires heap alloc
Redesign of ParserItem so that its sum type nature no longer mandates
indirection, but rather a tag check on all operations. Because of this,
ParserRecords can now store ParserItems directly, and iterators are no
longer iterators to pointers, but behave like normal vector iterators.
2016-11-07 12:24:38 +01:00
Jørgen Kvalsvik
fdb772e075 DeckItem without internal inheritance.
Replaces the internal inheritance + unique_ptr scheme to a flat sum type
similar scheme that uses a tag to determine which operations are legal,
rather than using the indirection itself as a tag.
2016-11-07 12:24:38 +01:00
Joakim Hove
ac4640effe Check that completion corresponds to active cell. 2016-11-04 15:24:59 +01:00
Joakim Hove
63a04b6d0a Merge pull request #953 from ANerd/cond_prod_control
Only add present phases from WCONHIST
2016-11-03 15:44:30 +01:00
Anders Matheson
82b989079e Get phases from deck in Schedule python interface 2016-11-03 13:12:34 +01:00
Anders Matheson
276a599e30 Assume all phases in Schedule for python bindings 2016-11-03 10:31:41 +01:00
Markus Blatt
e20f521151 Support externally installed cJSON.
Using an external cJSON installed under /usr/include was not possible before
as the cJSON headers within opm were still used due to relative paths.
With this commit move the copied cJSON source to external/cjson and
thus prevent them to be found if an externally installed cJSON is there.
2016-11-02 20:10:35 +01:00
Joakim Hove
49a6166340 Merge pull request #963 from jokva/ignore-skiprest
Ignore SKIPREST
2016-11-02 18:00:23 +01:00
Anders Matheson
eacbade0c1 Remove default Phases from Schedule constructor 2016-11-02 15:50:39 +01:00
Joakim Hove
3449615a03 Merge pull request #962 from jokva/no-field-group-in-summary
Do not add FIELD group to summary
2016-11-02 15:35:32 +01:00
Joakim Hove
cd2ee0e897 Merge pull request #127 from joakim-hove/crate-inactive-index
Check if cell is active while building RegionCache
2016-11-02 14:06:33 +01:00
Joakim Hove
ec4d320959 Merge pull request #128 from jokva/fgmwin-fgmwpr
{F,G}MW{IN,PR} support and minor internal renaming
2016-11-02 14:06:05 +01:00
Jørgen Kvalsvik
066aba3f38 Ignore SKIPREST
The SKIPREST keyword is really only needed in eclipse - since we parse
through the entire deck and create a complete internal representation
with random access, we don't need to actually skip parts of the input.

The old behaviour was to mimic some possible failure modes for eclipse,
however this has caused issues for no real benefit.

refs:
* https://github.com/OPM/opm-parser/issues/773
* https://github.com/OPM/opm-parser/issues/960
2016-11-02 13:55:05 +01:00
Anders Matheson
6d0d17a895 Only add present phases from WCONHIST 2016-11-02 13:44:33 +01:00
Kai Bao
b001de2074 only using WHISTCTL for non-prediction mode. 2016-11-02 12:49:08 +01:00
Jørgen Kvalsvik
8a907be17b Replace function aliases with names for parameters
Several functions were aliased to hide the fact that they shared the
same templated function, but with different specialisations. By
introducing aliases for producer and injector some readability is gained
and some (clumsy) aliases are removed, in favour of passing the
interesting aspect along with the general base name.
2016-11-02 12:35:11 +01:00
Jørgen Kvalsvik
c167dc4e62 {F,G}MW{IN,PR} support
Add support for the FMWIN, FMWPR, GMWIN and GMWPR keywords.
2016-11-02 12:18:39 +01:00
Joakim Hove
000c9b5479 Merge pull request #125 from jokva/phase-in-runspec
Read phase information from EclipseState.runspec
2016-11-02 11:52:19 +01:00
Joakim Hove
f5eb4763ea Merge pull request #958 from jokva/phase-information-and-runspec
Phase information and runspec
2016-11-02 11:52:12 +01:00
Joakim Hove
c4f064f791 Check if cell is active while building RegionCache 2016-11-02 11:49:32 +01:00
Jørgen Kvalsvik
46de9696f7 Do not add FIELD group to summary 2016-11-02 10:19:15 +01:00
Joakim Hove
2032592d17 Fixup for completion rate units for inactive cell. 2016-11-02 09:59:09 +01:00
Jørgen Kvalsvik
21aaceaed9 Runspec object; move phases from TableManager
There has never really been a natural home for initial properties that
aren't InitConfig, meaning information such as phases in the deck and
other runspec information hasn't had a natural home.

This patch introduces the Runspec object on EclipseState for phase
information and other similar properties that are interesting and static
for when setting up parameters etc. for simulation, that aren't all that
interesting once simulation starts.

An additional benefit is a leaner implementation for the phase enum and
some stricter semantics via enum classes.
2016-11-01 16:41:19 +01:00
Kai Bao
eba6b7be75 fixing the runScheduleCrateFromDeck test. 2016-11-01 15:44:35 +01:00
Kai Bao
86851e2fed completing the keywrods GCONPROD
And putting a E300 version in 001_Eclipse300.
2016-11-01 13:48:20 +01:00
Kai Bao
879f7b504e adding a keyword WSEGITER.
K-model needs it while not sure if it is used actually.
2016-11-01 12:36:24 +01:00
Jørgen Kvalsvik
e06d591dd3 Read phase information from EclipseState.runspec 2016-11-01 11:19:59 +01:00
Joakim Hove
8656268f3c Pass NUM == 1 in when determining units. 2016-11-01 10:19:00 +01:00
Jørgen Kvalsvik
4ad9b17449 Remove shared_ptr constructor in Schedule 2016-10-31 16:18:24 +01:00
Kai Bao
eb6c8aa1dc always applying the BHP limit from WCONINJE. 2016-10-31 15:40:54 +01:00
Jørgen Kvalsvik
77d1c4464d Return zero when simulator does not provide FIP 2016-10-31 14:08:59 +01:00
Jørgen Kvalsvik
f2c895c701 Return zero for non-existing well/completion
To be consistent with the general summary behaviour and more input
tolerant, 0.0 is returned when some phase, completion or well is
requested that isn't provided by the simulator.

Solves the issue discussed in https://github.com/OPM/opm-output/pull/122
and extends the test input deck to trigger this behaviour.
2016-10-31 11:49:56 +01:00
Jørgen Kvalsvik
c07878800f changelog 2016-10 2016-10-28 20:00:03 +02:00
Jørgen Kvalsvik
b338943962 FOIP+FGIP support 2016-10-28 15:45:22 +02:00
Jørgen Kvalsvik
06b2eb2cd3 Look up correct fluid-in-place keyword 2016-10-28 14:23:36 +02:00
Jørgen Kvalsvik
84b18faf49 RGIP support 2016-10-28 12:48:12 +02:00
Jørgen Kvalsvik
9181a260e8 GWCTH support 2016-10-28 12:19:07 +02:00
Jørgen Kvalsvik
cc73c9d95f GGORH support 2016-10-28 12:18:55 +02:00
Joakim Hove
1b3fd64924 Support for region production. 2016-10-28 11:36:31 +02:00
Joakim Hove
2def85a70c Fixed bug in summary output of completion rates. 2016-10-26 19:50:17 +02:00
Joakim Hove
08d89858af Extended data::Wells to inherit from std::map. 2016-10-26 19:50:17 +02:00
Joakim Hove
776094aa2c Added ROIP / ROIPL / ROIPG summary keywords. 2016-10-26 19:50:17 +02:00
Joakim Hove
64f5c9d13e Added completion list to RegionCache. 2016-10-26 19:50:17 +02:00
Joakim Hove
a8d82221a8 Added small class RegionCache. 2016-10-26 19:50:17 +02:00
Anders Matheson
2f411b208e Add phases to summary_deck.DATA 2016-10-26 15:33:36 +02:00
Joakim Hove
045cd37a44 RFT writer will check for SGAS. 2016-10-26 10:56:14 +02:00
Joakim Hove
6e12cc461f Merge pull request #952 from atgeirr/fix-contructor-bug
Make constructor explicit, fix operator<<.
2016-10-25 15:58:15 +02:00
Atgeirr Flø Rasmussen
8eef0c98a6 Remove unnecessary shadowing aliases.
Warning-generating aliases like:
    const auto& es = this->es;
were removed. The rest of the code would not need any change since
then 'es' would refer directly to the data member, but in keeping with
the usual ways in this module I changed them to explicitly reference
'this->es', thereby restoring the visual clue that the member is used.
2016-10-25 14:20:49 +02:00
Atgeirr Flø Rasmussen
72c09a80b9 Silence some false-positive warnings. 2016-10-25 14:20:49 +02:00
Atgeirr Flø Rasmussen
8eb2a84983 Merge pull request #116 from jokva/exchange-completions-as-vector
data::Well::Completion is vector, not map
2016-10-25 13:58:42 +02:00
Atgeirr Flø Rasmussen
d34711d600 Make constructor explicit, fix operator<<. 2016-10-25 11:39:43 +02:00
Jørgen Kvalsvik
a89adafb4b Reference MessageLimit functions. 2016-10-24 17:06:50 +02:00
Jørgen Kvalsvik
30ef5a6099 data::Well::Completion is vector, not map
The data exchanged in data::Well::Completions is now a vector, more
closely matching the disk format and the order exposed by the simulator.
Zero'd wells and complations are still written for shut wells, or wells
the simulator does not provide any information for; however, all
non-closed wells (according to the schedule) will be restored. The
completions are written and restored in the same order as CompletionSet
from parser.
2016-10-24 16:52:26 +02:00
Joakim Hove
3eeb2e2027 Merge pull request #949 from jokva/appveyor-opm-data
appveyor clones opm-data
2016-10-24 13:40:24 +02:00
Joakim Hove
18fbbeecd3 Changes to MessageLimits:
1. Will retain already set values when only some items are set.
 2. Will parse the sections before the SCHEDULE section to create a
    correctly initialized MessageLimits object.
2016-10-24 13:00:04 +02:00
Jørgen Kvalsvik
df1c2448de appveyor clones opm-data 2016-10-24 08:52:30 +02:00
Joakim Hove
2cb15a3023 Will printf the number of keywords when error. 2016-10-23 23:22:52 +02:00
Jørgen Kvalsvik
9511d8252b Add Utility/Typetools
An enum and some utilities to build what's essentially sum types.
2016-10-23 15:47:20 +02:00
Joakim Hove
bd5c92737e Merge pull request #942 from GitPaean/efficiency_factor
efficiency factor should not be part of productiondata.
2016-10-21 16:42:26 +02:00
Joakim Hove
df9bdeabbc Merge pull request #946 from jokva/overflow-guarded-separator-check
Check for separator/quote table overflow
2016-10-21 16:41:40 +02:00
Jørgen Kvalsvik
ac9ed4ec5c OPM_IWEL Restart support 2016-10-21 12:50:17 +02:00
Jørgen Kvalsvik
b43461cb49 Prefer named data members over vectors in OPM_XWEL
Change the structure used to populate OPM_XWEL to use a plain map of
data::Wells objects rather than dumping a series of vectors to
data::Wells. Tests are added for serialising and restoring wells.
2016-10-21 12:50:17 +02:00
Jørgen Kvalsvik
38f9103e43 Widen rates bitmask to 32 bits. 2016-10-21 12:13:20 +02:00
Jørgen Kvalsvik
0c1dae7016 Check for separator/quote table overflow
Just relying on the char data type is not sufficient to guard against
overflows, and several input decks would invoke undefined behaviour.
This code path is extremely hot, so we're essentially only reading the
least significant 7 bits to achieve branchless lookup.
2016-10-21 10:33:28 +02:00
Kai Bao
85b47dffad efficiency factor should not be part of productiondata.
It applies to both the injection wells and production wells in the group.
2016-10-21 09:48:31 +02:00
Andreas Lauser
d48da54ded PORV: fix the case where PORO contains some NaNs but the code should not choke anyway
thanks to @joakim-hove for catching this.
2016-10-21 09:21:04 +02:00
Andreas Lauser
3008e45367 fix the PORV grid property for clang with optimizations
for some reason, it looks like `std::find_if()` does not work on
ubuntu 16.10 with clang and enabled optimizations. since as far I can
see this 'if' is a minor performance improvement in non-time critical
code, let's just remove the condition.
2016-10-21 09:21:04 +02:00
Joakim Hove
17ff5847b4 Merge pull request #947 from jokva/heuristic-short-circuit-strip
Short circuit when line terminator is found first
2016-10-21 08:50:32 +02:00
Joakim Hove
0cb12fff56 Merge pull request #112 from joakim-hove/solution-default-arg
Using constructor in default argument creation.
2016-10-20 19:38:18 +02:00
Joakim Hove
9336045966 Using constructor in default argument creation. 2016-10-20 18:20:50 +02:00
Jørgen Kvalsvik
728a9c2e69 Short circuit when line terminator is found first
The termination logic would sometimes need to scan the full line to see
if some terminating condition was found inside quotes. Plenty of
comments in a file start on the first character of a line, meaning this
scan is unnecessary.
2016-10-20 15:11:44 +02:00
Jørgen Kvalsvik
7652e0fcb5 TableColumn stores ColumnSchema, not pointer 2016-10-19 20:38:28 +02:00
Jørgen Kvalsvik
4c13f6ad06 Use public parseFile in cparser.cc 2016-10-19 20:38:28 +02:00
Jørgen Kvalsvik
331d61cba5 Parser.parseFile() assumes default parse context 2016-10-19 20:38:28 +02:00
Jørgen Kvalsvik
066be72ce1 Small doc on GridProperty guarantees 2016-10-19 20:38:28 +02:00
Jørgen Kvalsvik
6f35591fad Make IOConfig::getOutputEnabled const 2016-10-19 20:38:28 +02:00
Jørgen Kvalsvik
bf057f157c Deck units no longer unique 2016-10-19 20:38:28 +02:00
Jørgen Kvalsvik
37c04328ca Remove shared_ptr typedefs 2016-10-19 20:38:28 +02:00
Jørgen Kvalsvik
f2e509f59f UnitSystem named constructors with automatic storage 2016-10-19 20:38:28 +02:00
Jørgen Kvalsvik
0e7752c499 Make group no longer use shared_ptr 2016-10-19 20:38:28 +02:00
Jørgen Kvalsvik
f9cb516b99 Remove DeckPtr+ParserPtr aliases
Remove the deprecated DeckPtr and ParserPtr aliases and removes
shared_ptr<Deck> and friends from all interfaces.
2016-10-19 20:38:28 +02:00
Jørgen Kvalsvik
0059446147 Make Completion+CompletionSet no longer use shared_ptr 2016-10-19 20:38:28 +02:00
Jørgen Kvalsvik
239ef7a34c Remove shared_ptr typedef in TimeMap 2016-10-19 20:38:28 +02:00
Jørgen Kvalsvik
8645af71b8 Make PvtxTable no longer use shared_ptr 2016-10-19 20:38:28 +02:00
Jørgen Kvalsvik
8b4350f720 TransMult stores MULTREGTScanner as value
Improves copying semantics and fixes a memory leak in TransMult
initialisation.
2016-10-19 20:38:28 +02:00
Jørgen Kvalsvik
56608e9a10 3DProperties default constructible
This also means UnitSystem must be default constructible, which now
makes the default unit system metric. GridProperties must also be
default constructible (a valid 0x0x0 grid with no properties).
2016-10-19 20:38:28 +02:00
Jørgen Kvalsvik
7a13488fb1 Make SimpleTable no longer use shared_ptr 2016-10-19 20:38:28 +02:00
Jørgen Kvalsvik
930a6216c8 Make SimulationConfig no longer use shared_ptr 2016-10-19 20:38:28 +02:00
Jørgen Kvalsvik
5a48ec4539 Make ThresholdPressure no longer use shared_ptr 2016-10-19 20:38:28 +02:00
Jørgen Kvalsvik
4b51d9b0f5 Make Segment/Compsegs no longer use shared_ptr 2016-10-19 20:38:28 +02:00
Jørgen Kvalsvik
f5a1630dc0 Make InitConfig no longer use shared_ptr 2016-10-19 20:38:28 +02:00
Jørgen Kvalsvik
1906bf4d16 Make EclipseGrid no longer use shared_ptr 2016-10-19 20:38:28 +02:00
Jørgen Kvalsvik
fcc93085ee Make NNC no longer use shared_ptr 2016-10-19 20:38:27 +02:00
Jørgen Kvalsvik
64b44eda77 Make Box+BoxManager no longer use shared_ptr 2016-10-19 20:38:27 +02:00
Jørgen Kvalsvik
7cff418ae5 Make RestartConfig no longer use shared_ptr 2016-10-19 20:38:27 +02:00
Jørgen Kvalsvik
53f178d7ce Make IOConfig no longer use shared_ptr 2016-10-19 20:38:27 +02:00
Jørgen Kvalsvik
c893a92aa6 Make Dimension+UnitSystem no longer use shared_ptr 2016-10-19 20:38:27 +02:00
Jørgen Kvalsvik
d53c73fb41 Make Fault+FaultFace no longer use shared_ptr 2016-10-19 20:38:27 +02:00
Jørgen Kvalsvik
b3dbd6f930 Return const ref from getSchedule 2016-10-19 20:38:27 +02:00
Jørgen Kvalsvik
4b0e4c5cae Make Tuning no longer use shared_ptr 2016-10-19 20:38:27 +02:00
Jørgen Kvalsvik
4f0e6703f0 Remove DynamicState's reliance on TimeMap.
DynamicState assumes the time map is fully populated and stores only
its size (which is the only property it cares about).
2016-10-19 20:38:27 +02:00
Jørgen Kvalsvik
9ad3d78923 Remove DynamicVector's reliance on TimeMap.
DynamicVectors assumes the time map is fully populated and stores only
its size (which is the only property it cares about).
2016-10-19 20:38:27 +02:00
Jørgen Kvalsvik
47ca0b333d Remove unnecessary silencing of unused vars
__attribute__ is a gcc extension (supported by clang), but isn't
portable. However, this warning doesn't show up when the variables are
constexpr.
2016-10-19 20:37:43 +02:00
Jørgen Kvalsvik
bc58e417f8 Swap ConversionFactors/Units header in cmake 2016-10-19 15:03:51 +02:00
Jørgen Kvalsvik
9f41044447 Remove CornerpointChopper.hpp 2016-10-19 13:44:33 +02:00
Jørgen Kvalsvik
c07fe44d5e Update to shared_ptr-less parser interface. 2016-10-19 13:44:33 +02:00
Atgeirr Flø Rasmussen
a8639b8822 Merge pull request #105 from andlaus/opm-parser_units
adapt to the rename of the unit system header in opm-parser
2016-10-18 15:25:32 +02:00
Atgeirr Flø Rasmussen
43e759d261 Merge pull request #936 from andlaus/opm-parser_units
fully move the units code from opm-core to opm-parser
2016-10-18 15:25:14 +02:00
Arne Morten Kvarving
6433059067 changed: rename function getType
typeof is a semi-reserved symbol in gcc (gcc extension to get typeid)
2016-10-17 10:48:29 +02:00
Jørgen Kvalsvik
8ac5dc553f Implement Solution via std::map 2016-10-17 07:06:23 +02:00
Joakim Hove
79e7ce643d Using data::Solution for simulator <-> output.
Will use one common container for both the solution data required for the
restart, e.g. PRESSURE and SWAT and also the auxillary data like KRG and
FIP which is intended as extra information in the restart file, or
alternatively the summary file.
2016-10-17 07:04:06 +02:00
Joakim Hove
79a03c26d0 Using CelldataConatiner in opm-output. 2016-10-17 07:01:51 +02:00
Joakim Hove
c60f21af84 New class for simulator -> output data exchange. 2016-10-17 06:59:00 +02:00
Liu Ming
fce0bab79f Rename MesasgesLimits to MessageLimits. 2016-10-17 10:41:17 +08:00
Liu Ming
2f265f1407 Drop TimeMapConstPtr and temporary DynamicState object. 2016-10-17 09:22:54 +08:00
Liu Ming
7a73657e00 drop std::shared_ptr 2016-10-14 15:54:02 +08:00
Liu Ming
a25c5c0850 Merge remote-tracking branch 'opm/master' into get-messages 2016-10-14 13:48:49 +08:00
Liu Ming
c7b3e2cf57 Get MESSAGES limits from Schedule and update every time step. 2016-10-14 10:06:35 +08:00
Joakim Hove
a0c08ef4ba Added Well::getCompletions( ).
The new Well::getCompletions( ) method without argument will return all
the existing completions at the end of the simulation.
2016-10-12 10:34:09 +02:00
Joakim Hove
e1b2d2f13a Merge pull request #932 from jokva/fix-compiler-warnings-appveyor
Fix compiler warnings appveyor
2016-10-11 10:32:58 +02:00
Andreas Lauser
a8b6047b1d fully move the units code from opm-core to opm-parser
this fixes some annoying inconsistencies (e.g., the recently
introduced 'dyne' unit was unavailable in the opm-core version) and
gets rid of some compiler abiguity errors if 'using namespace
Opm::details' was used by code inside the 'Opm' namespace.

Since opm-parser is a hard dependency of opm-core, the only measure
which must be taken by higher-level code is to include
'opm/parser/eclipse/Units/Units.hpp' instead of
'opm/parser/eclipse/Units/ConversionFactors.hpp' or
'opm/core/utility/Units.hpp'.

Note that a potentially better location for this code would be
opm-common, but this would break the Windows build of opm-parser.
2016-10-10 17:45:37 +02:00
Andreas Lauser
117af55887 adapt to the rename of the unit system header in opm-parser 2016-10-10 17:27:18 +02:00
Andreas Lauser
0680e64b03 add a JSON definition of the JFUNC keyword 2016-10-06 17:18:10 +02:00
Andreas Lauser
eb9dd487c6 add the infrastructure needed to deal with surface tension
this is required for the JFUNC keyword...
2016-10-06 17:18:10 +02:00
Joakim Hove
eb929077a2 Moved Cells.hpp and Wells.hpp opm/output/data/ 2016-10-06 16:29:20 +02:00
Jørgen Kvalsvik
9a3e5e4c4f Explicit boolean expression in isAutoGenerated_ 2016-10-06 13:17:23 +02:00
Jørgen Kvalsvik
db66f0302c Explicit bool conversion in isRecognizedKeyword 2016-10-06 13:17:23 +02:00
Jørgen Kvalsvik
a51127f0c8 Make character lookup table boolean 2016-10-06 13:17:06 +02:00
jokva
1fc4fa633b Merge pull request #931 from joakim-hove/unit-system-vector-overlaod
Added vector overload of unit onversion methods.
2016-10-06 13:10:39 +02:00
Pål Grønås Drange
f73d7f66ae Merge pull request #930 from jokva/remove-shared-ptrs-from-schedule
Remove shared ptrs from schedule
2016-10-06 13:01:08 +02:00
Joakim Hove
0d4bfdea2d Added vector overload of unit onversion methods. 2016-10-06 11:47:49 +02:00
Jørgen Kvalsvik
f94ecc09a3 Schedule::getGroup returns reference, not pointer 2016-10-05 14:52:25 +02:00
Jørgen Kvalsvik
b932b0d2c2 fixup! Make Schedule.oilvaporization auto, not shared_ptr 2016-10-05 14:46:56 +02:00
Jørgen Kvalsvik
d5251d97e6 Make Schedule.groups auto, not a shared_ptr 2016-10-05 14:39:01 +02:00
Jørgen Kvalsvik
1638341a90 Default construction for OilVaporizationProperties
OilVaporizationProperties can now be default constructed, and its
storage has been changed from shared_ptr to value (which mandates the
support for default construction and equality/unequality).

The default constructed Property is considered unspecified and
operations on it will not make sense.
2016-10-05 14:11:57 +02:00
Jørgen Kvalsvik
a97890bce2 Make Schedule.grouptree auto, not a shared_ptr
Also makes the *contents* of the vector values, not shared_ptrs.
This introduces the copy constructor (as an alternative to deepcopy())
and comparison operators, mandated by DynamicState.
2016-10-05 10:36:35 +02:00
Jørgen Kvalsvik
fd26e24049 Make Schedule.oilvaporization auto, not shared_ptr 2016-10-05 10:36:21 +02:00
Jørgen Kvalsvik
5202c4ee6b Make Schedule.modifierDeck auto, not a shared_ptr 2016-10-05 10:12:46 +02:00
Jørgen Kvalsvik
81cbe53109 Make Schedule.events auto, not a shared_ptr 2016-10-05 10:09:45 +02:00
Jørgen Kvalsvik
f72b784a7e Make Schedule.tuning auto, not a shared_ptr 2016-10-05 10:04:36 +02:00
Jørgen Kvalsvik
6a0afc8a80 DynamicState::get returns const reference
dynamicstate.get returns a const reference rather than a by-value copy,
in order to be consistent with other container classes.

This introduces a problem for std::vector<bool> with its specialisation,
so all DynamicState<bool> instances has been replaced by
DynamicState<int> and explicit bool conversions.
2016-10-05 09:57:42 +02:00
Pål Grønås Drange
e7c2ebd915 Removed ERT_PYTHON_PATH, we only need cwrap path 2016-10-04 15:27:39 +02:00
Pål Grønås Drange
aa09373f18 added find cwrap from opm-common 2016-10-04 12:49:05 +02:00
Pål Grønås Drange
7ef665994b Use cwrap library from ert 2016-10-04 11:50:57 +02:00
Joakim Hove
2cf038e3b7 Merge pull request #94 from totto82/output_solvent
Output SSOL to restart file if present
2016-09-29 12:43:27 +02:00
Pål Grønås Drange
5a0e4c191d Merge pull request #929 from joakim-hove/python-test
Python test: locate testdata + add declarations.
2016-09-29 12:16:36 +02:00
Tor Harald Sandve
5d7d5be679 Add support for control mode in WHISTCTL
-- Control mode given by WHISTCTL overwrites control mode given in
WCONHIST
-- option for termination of run if changed to BHP control in not
implemented. But ParseContext is used to inform the user and make
throwing optional.
2016-09-29 08:29:57 +02:00
Joakim Hove
44f7d023b7 Added forward declaration. 2016-09-28 19:14:20 +02:00
Joakim Hove
36b5f8d0f5 Changed code to find testdata for Python tests. 2016-09-28 18:52:05 +02:00
Tor Harald Sandve
f3b9c88a53 Add support for output of solvent in summary file
The following keywords are implemented
[F,G,W,C]N[P,I][R,T]
FNPR, WNIR etc.
2016-09-28 15:03:15 +02:00
babrodtk
9ad8fcae19 Ignore non-restart variables when writing restart 2016-09-28 09:11:48 +02:00
babrodtk
231613c32a Added boolean flag for writing cell data to restart files 2016-09-28 09:11:48 +02:00
Pål Grønås Drange
9fe350e094 Made production group and injection group pure values 2016-09-28 07:39:24 +02:00
Jørgen Kvalsvik
687a4ca262 Removed unused private member. 2016-09-25 22:02:08 +02:00
Jørgen Kvalsvik
725aaac746 Overwrite UNRST file on first restart write.
Replaces checking if the report step is zero with maintaining some state
and determining if any given step is the first time an UNRST file is
written to or not. Extends the test to also cover this case. New
behaviour will remove all time steps from a pre-existing UNRST file from
the restart step being started from, but preserve all steps leading up
to that point.
2016-09-25 22:01:41 +02:00
Jørgen Kvalsvik
c0d99d2c5c Revert "Remove unused grid argument in RFT::writeTimeStep()."
This reverts commit 1a5f80ddf3bb0a86ba06f713ca71cf4bf044168f.
2016-09-25 22:00:30 +02:00
Atgeirr Flø Rasmussen
a9f5fcdfd5 Silence various warnings.
Mostly shadowing, also unused variable and unused argument.
2016-09-23 15:02:36 +02:00
Atgeirr Flø Rasmussen
07986d8fd4 Fix compile error: ambiguous call to std::abs(). 2016-09-23 15:01:42 +02:00
Atgeirr Flø Rasmussen
eb85e1b02c Remove unused grid argument in RFT::writeTimeStep(). 2016-09-23 15:00:16 +02:00
Kai Bao
7f49f5e53d fixing the group test. 2016-09-23 13:17:26 +02:00
Kai Bao
a70b1799c7 A well group can be both injection and production group. 2016-09-23 12:55:44 +02:00
Tor Harald Sandve
bf892a7976 Output SSOL to restart file if present 2016-09-22 14:54:10 +02:00
Pål Grønås Drange
36ab19bc73 Merge pull request #923 from joakim-hove/summary-config-query
Added simple test for hasKeyword.
2016-09-21 14:37:08 +02:00
Kai Bao
a4c2c5bec3 adding FLD to the ControlEnum of GroupProduction 2016-09-20 13:37:07 +02:00
Arne Morten Kvarving
ed9c800fa7 Merge pull request #90 from akva2/restructure_test_utilities_and_add_integration_test
Restructure test utilities and add integration test
2016-09-20 12:40:16 +02:00
Joakim Hove
09499a7c79 Merge pull request #916 from joakim-hove/python-schedule
Remove Grid from Schedule object + Python wrap Schedule and EclipseGrid
2016-09-20 09:22:16 +02:00
Joakim Hove
c42d2a7022 Added simple test for hasKeyword. 2016-09-19 20:18:51 +02:00
Joakim Hove
fc1a11af70 Use ecl_util_make_date() to create time_t value. 2016-09-19 19:28:06 +02:00
Arne Morten Kvarving
a403a8d21c Changed to two applications for comparison
- restartRegressionTest, initRegressionTest was squashed to one
 application, which also supports integration test as well as test
 of restart files (non-unified) and .RFT files.

- summaryRegressionTest was renamed compareSummary -- now it can
 execute an integration test as well as regression test. Also other
 improvements were made.
2016-09-19 14:36:03 +02:00
Petter Taule
3bb1cda00c Added integration tests in compare libraries
- The compare library summaryIntegrationTest.cpp and header was added,
 which implements a integration test for summary files.

- The summary regression test was enhanced with extended
 functionality.

- EclFilesComparator.cpp with header file now includes an integration
 test for SGAS, SWAT and PRESSURE in UNRST files, and also the
 regression test was improved with cell volume check, as well as checks of more
 keyword types.
2016-09-14 13:09:38 +02:00
Arne Morten Kvarving
afedca7b18 quell signed/unsigned comparison warning
switch to using std::iota
2016-09-14 11:04:23 +02:00
Liu Ming
5fc2463097 Get print and stop limits from MESSAGES keyword. 2016-09-13 21:33:54 +08:00
Joakim Hove
7c0b4733d5 Added Python wrapper for Schedule class. 2016-09-12 21:42:34 +02:00
Joakim Hove
ae31249245 Added micro Python wrapper of EclipseGrid. 2016-09-12 21:42:34 +02:00
Joakim Hove
8100b6cb0d Completed rename parse_mode -> parse_context. 2016-09-12 21:42:34 +02:00
Joakim Hove
5636fd8aa1 Fixed to self bugs in Python bindings. 2016-09-12 21:42:34 +02:00
Joakim Hove
55756f944e Moved some python tests. 2016-09-12 21:42:34 +02:00
Joakim Hove
8ee057eca5 Added method Schedule::posixEndTime() 2016-09-12 21:42:34 +02:00
Joakim Hove
81b71d5d08 Removed EclipseGrid member from Schedule class. 2016-09-12 21:42:34 +02:00
Joakim Hove
8f3ebe23ee Removed grid argument from Well construction. 2016-09-12 21:42:34 +02:00
Joakim Hove
b47e7579d0 Completion: Internalize cell depth immediately. 2016-09-12 21:42:34 +02:00
Joakim Hove
9a1a1e2f00 Removed EclipseGrid dependency from CompletionSet. 2016-09-12 21:42:34 +02:00
Jørgen Kvalsvik
9aee6e7708 Return identity when compressing active-only cells. 2016-09-12 21:14:07 +02:00
Joakim Hove
74e1aff9dc Compress std::vector<T> and GridPropery. 2016-09-08 09:14:30 +02:00
Joakim Hove
56077998e0 Added EclipseGrid::getGlobalIndex( activeIndex ) 2016-09-08 09:14:29 +02:00
Joakim Hove
15588fe7ca Added EclipseGrid::allActive() convenience method. 2016-09-08 09:14:28 +02:00
Joakim Hove
489602c51c EclipseGrid: default copy and move constructors. 2016-09-08 09:14:27 +02:00
Joakim Hove
204ca5932b Outputwriter: use EclipseGrid
- The outputwriter will now take a a separate EclipseGrid instance as
  input argument, it is assumed that calling scope has already made sure
  ACTNUM and ZCORN are correct.

- All active/inactive cell mappings are based on the grid argument, the
  naked int* with global / active cell mappings has been completely
  removed.
2016-09-08 08:38:39 +02:00
Joakim Hove
516f0927da Merge pull request #905 from joakim-hove/eclipsgrid-processed-copy
WIP: Added EclipseGrid processed copy.
2016-09-07 11:10:52 +02:00
Joakim Hove
c2b4ee687f Added class ZcornMapper. 2016-09-07 11:08:31 +02:00
Joakim Hove
4af4c40dc6 Added EclipseGrid processed copy. 2016-09-07 11:07:51 +02:00
babrodtk
4d9bd066a3 Added inverse formation volume factors 2016-09-06 14:17:46 +02:00
babrodtk
863ce30a94 Merge branch 'master' of github.com:OPM/opm-parser into output_writer_celldata 2016-09-06 10:34:54 +02:00
babrodtk
ec43c9c86f Fixed warnings 2016-09-06 07:54:21 +02:00
Joakim Hove
c8d77dff99 Expand ALLPROPS in SOLUTION section RPTRST. 2016-09-06 00:25:07 +02:00
Joakim Hove
ba6e2a0eb1 Merge pull request #909 from andlaus/implement_multregp
Implement support for MULTREGP
2016-09-05 18:11:18 +02:00
Joakim Hove
2fa5ee628b Merge pull request #910 from joakim-hove/store-mapaxes
Do not apply the MAPAXES transform.
2016-09-05 17:31:39 +02:00
babrodtk
6097ebb1eb Added units required for formation volume factors 2016-09-05 16:05:47 +02:00
Joakim Hove
569f450f82 Merge pull request #912 from joakim-hove/debug-ALLPROPS
Added some tests to verify ALLPROPS handling.
2016-09-05 14:56:50 +02:00
Joakim Hove
bcb4f51a4d Added some tests to verify ALLPROPS handling. 2016-09-05 13:11:41 +02:00
babrodtk
71133c15a0 Deleted UnitSystem.cpp from Parser (has been moved to Units previously) 2016-09-05 08:27:29 +02:00
Joakim Hove
37c1418876 Do not apply the MAPAXES transform. 2016-09-02 14:35:14 +02:00
Andreas Lauser
cf8c957968 add a unit test for the MULTREGP keyword 2016-09-02 11:16:34 +02:00
Andreas Lauser
f9b3a42598 implement support for the MULTREGP keyword
Note that this keyword is pretty quirky. Depending on whether
E100/E300 considers it for MINPV handling or not, this patch is also
not going to cut it. (After this patch, OPM will consider MULTREGP for
the MINPV handling. Could somebody with access to E check?)
2016-09-02 11:16:34 +02:00
Joakim Hove
7e99d07144 Merge pull request #908 from jokva/lab-hr
Lab's unit for time is "HR"
2016-09-02 09:15:44 +02:00
Joakim Hove
10b36320c0 Merge pull request #903 from jokva/boost-spirit
Replace number parser with boost::spirit::qi
2016-09-02 08:47:16 +02:00
Jørgen Kvalsvik
0d44cd5ee1 Lab's unit for time is "HR" 2016-09-01 14:38:10 +02:00
Bård Skaflestad
7d67ddc099 UnitSystem: Add skeleton implementation of LAB conventions
This commit adds conversion factors for the ECL LAB unit
conventions--notably Atmospheres for pressures, Hours for time,
Grams for mass, and cubic centimetres for volumes.
2016-09-01 12:21:53 +02:00
Joakim Hove
e9344a2591 Renamed constants '_ITEM' -> '_INDEX' 2016-08-29 12:43:38 +02:00
Joakim Hove
aa99e3e39c Merge pull request #904 from qilicun/fix-msg-order-issues
Argument of warning() method is msg, filename, linenumber.
2016-08-29 10:02:52 +02:00
Liu Ming
756b4d1edd argument of warning() method is msg, filename, linenumber. 2016-08-29 14:01:14 +08:00
Jørgen Kvalsvik
d9443c7355 Replace number parser with boost::spirit::qi
The hand-written number parser functions implemented using strtod and
friends were rather slow (profiling indicates that typically 30% of the
program is spent inside of strtod internals). By using
boost::spirit::qi, which we already depend on through boost-filesystem
and others this portion typically seem to be reduced to 20% (via
instruction count) and with somewhat better cache performance.
Rudimentary measuring indicates ~15% speedup overall.

Additionally, the intention is a lot clearer this way, so readability
received a boost. Compilation time of StarToken goes through the roof.
2016-08-28 11:08:30 +02:00
Joakim Hove
33ae96f2af Summary will output region pressure: RPR 2016-08-26 12:50:40 +02:00
Joakim Hove
b6c4043f20 Merge pull request #902 from joakim-hove/gridproperty-cells
Scan a property and return cells equal to a value.
2016-08-26 11:04:42 +02:00
Joakim Hove
bea47dc06d Scan a property and return cells equal to a value. 2016-08-25 17:27:36 +02:00
Joakim Hove
949b955d37 Merge pull request #901 from jokva/grid-export-compressed-map
Active cell cache with automatic storage
2016-08-25 15:15:49 +02:00
Jørgen Kvalsvik
bb2d0c5324 Active cell cache with automatic storage
Simplify slightly by using automatic memory management, rather than
heap-alloc.
2016-08-25 13:51:46 +02:00
Joakim Hove
aa9f43686d Merge pull request #900 from joakim-hove/grid-export-compressed-map
EclipseGrid::activeMap( ) will cache the results.
2016-08-25 13:46:35 +02:00
Joakim Hove
1c0716aefd EclipseGrid::activeMap( ) will cache the results. 2016-08-25 11:50:09 +02:00
Joakim Hove
422ac7335b Special case 'ALLPROPS' mneomonic. 2016-08-22 17:08:16 +02:00
Joakim Hove
30a4974178 Added RestartConfig::getkeyword() to check mneonic 2016-08-22 16:45:28 +02:00
Joakim Hove
e093e470c8 Added RPTRST memonic without corresponding int. 2016-08-22 16:45:28 +02:00
Joakim Hove
f03437722e Fixed appveyor build script. 2016-08-22 16:12:30 +02:00
Joakim Hove
2aa9dfbf48 Added optional argument simProps to writeTimestep.
The simProps argument is vector of field properties which have been
initialized / calculated by the simulator. Examples of such properties
include the relative permeabilites KRG, KRO and KRW and the fluid in
place vectors FIPOIL and FIPGAS.
2016-08-20 19:26:35 +02:00
Joakim Hove
4bfacb144d Moved argument 'sub_step' to 2. in argument list. 2016-08-20 19:26:35 +02:00
Andreas Lauser
d6287e4db5 add bare-bones support for the MULTREGP keyword
it is parsed and put into the deck, but it is not internalized in any
way. (Note that, given that this keyword is quite simple, adding
sophisticated code to absorb it into EclipseState would be overkill,
in my not so humble opinion.)
2016-08-19 19:43:06 +02:00
Atgeirr Flø Rasmussen
a40e094380 Do not use constexp pair constructor.
That constructor is not available in C++11, only from C++14 on.
2016-08-19 13:08:19 +02:00
Joakim Hove
667307f417 EclipseWriter: write restart with double.
In restart files generated by Eclipse the solution fields, i.e. pressure
and saturations are written in 32 bits precision using floats. For
compatibility that is the default behavior in opm/flow as well, but with
this patch it is optionally possible to write the solution fields with
64 bit double precision.

The resulting files will probably be incompatible with third party
applications, so this should be done with extreme caution.
2016-08-18 15:43:07 +02:00
Arne Morten Kvarving
fc90cdcf97 changed: remove unused references
quells unused variable compile warnings
2016-08-15 14:53:53 +02:00
Arne Morten Kvarving
4c32e602da changed: generate unit type conversion constants on compile-time
as a bonus it avoids unused variable warnings in compile units
only using parts of the conversion units.
2016-08-15 14:52:48 +02:00
Jørgen Kvalsvik
07b1706c58 Support for RPTRST/RPTSCHED options
A RestartConfig refurbishment that generalises some of the previously
special-casing. Short synopsis:

* Integer list input is first translated to their corresponding
  mnemonics.
* Mnemonic implementation support turning off input parameters via
  mnemonic=0, handled generally rather than special-cased for BASIC/FREQ
* Restart configuration setup is handled in one else-less, linear code
  path. RPTRST and RPTSCHED are interpreted by their separate helper
  functions, but they produce the same resulting object. Should be
  easier to follow
* Ignores unknown mnemonics, has a list of known/supported mnemonics
  that will be internalised.

The explicit list over supported keywords is from the Eclipse100 manual
and must be manually maintained, i.e. no dynamic solution is in place
yet. This might never be necessary, but support it dynamically isn't a
problem.
2016-08-11 09:59:54 +02:00
Jørgen Kvalsvik
295ef91063 Moved RestartConfig out of IOConfig
RestartConfig is a first-class citizen of EclipseConfig rather than
being embedded in IOConfig. This narrows IOConfig's responsibility to
only that of paths file system definitions and interactions, and
RestartConfig to what and when to output the restart file.
2016-08-11 09:59:54 +02:00
Jørgen Kvalsvik
5a84bb6ce5 Use RestartConfig instead of IOConfig 2016-08-10 16:56:08 +02:00
Joakim Hove
0e53246009 Internalize whih keywords to restart - in addition to when. 2016-08-10 16:33:25 +02:00
Joakim Hove
2b1b74d3ae Added method back() to DynamicState() 2016-08-10 16:33:05 +02:00
jokva
a77a9646a1 Merge pull request #74 from pgdr/ioconf-usecase
Minor cfg() api use case
2016-08-09 11:42:41 +02:00
Tor Harald Sandve
5ccc85b717 Shut wells where all completions are shut 2016-08-09 10:43:08 +02:00
Pål Grønås Drange
e4a2da1b7b Minor usecase of state.cfg().io() instead of ioconfig shared_ptr 2016-08-09 09:37:46 +02:00
Joakim Hove
9bcdadd443 Merge pull request #890 from pgdr/transmult-and-shared_ptrs
Removing some use of shared_ptr
2016-08-09 09:32:41 +02:00
Jørgen Kvalsvik
d928f53a52 Use getCellDepth; hoist size() in numApply 2016-08-08 11:56:40 +02:00
Pål Grønås Drange
41b158bb2b Shortified names, instead of state.getEclipseConfig().getSummaryConfig(), use state.cfg().summary() 2016-08-08 11:39:59 +02:00
Pål Grønås Drange
7d2de9117c InitConfig is reference, use ref EclipseState constructor 2016-08-08 10:03:58 +02:00
Jørgen Kvalsvik
db33a9cc55 Prefer function objects in Parser::clean
Implementing these checks as function objects improves performance
slightly (5% or so according to my measurements), probably due to the
functions being inlined rather than reduced to function pointers.
2016-08-08 09:42:41 +02:00
Jørgen Kvalsvik
f413e5441f Hoist loop variable.
Profiling indicates the size-check isn't hoisted properly. In this case,
manually hoising the loop invariant doesn't negatively impact clarity
nor give any more noise, and slightly improves performance.
2016-08-08 09:40:20 +02:00
Pål Grønås Drange
dde7a25673 Made EclipseConfig.SimulationConfig and .InitConfig references 2016-08-08 09:37:13 +02:00
Jørgen Kvalsvik
9966e3fbfd Prefer .at over checking size and throwing
Seems to be slightly faster and is much simpler.
2016-08-05 15:57:44 +02:00
Jørgen Kvalsvik
0650996655 Short-circuit table lookup of constant strings
A keyword cannot be equal to multiple distinct strings at once, so we
can stop looking if one proposition evaluates to true.
2016-08-05 15:45:39 +02:00
Jørgen Kvalsvik
d7ac7ee9b8 Remove SCHEDULE as a special section
SCHEDULESection with its special implementation is a remnant of older
design and largely unnecessary now. The implementation also relied on
shared_ptr for efficiency and was not really used at all.

SCHEDULESection now is no longer special, and uses the same
implementation as SUMMARY, RUNSPEC etc. The one thing that separated it,
looking up keywords within a timestep, was only used once and this
computation has been inlined in the function.
2016-08-05 15:28:29 +02:00
Pål Grønås Drange
b359e9c0fb transmult is member, use ref's, use proper constructor of EclipseState 2016-08-05 15:07:15 +02:00
Jørgen Kvalsvik
34a354c1dd Prefer to/from_si to string parsing for conversion 2016-08-05 13:24:30 +02:00
Jørgen Kvalsvik
6266314f8d String -> ScheduleEnum assumes pre-trimmed strings
Reduce the overhead in the WCONHIST parsing by assuming that strings are
pre-trimmed when they're given to the translation.
2016-08-05 12:34:08 +02:00
Jørgen Kvalsvik
e88cbc523b Precompute control modes in history/prediction 2016-08-05 12:22:48 +02:00
Jørgen Kvalsvik
99570ff72e Add all records to Deck at once
Rather than doing add-item-check-duplicates per DeckItem added to a
record, construct all the items at once, then pass them in full to the
DeckRecord object. The DeckRecord object still check for duplicate
names, but with lower complexity and cost.
2016-08-05 10:45:31 +02:00
Jørgen Kvalsvik
f571f21171 is_separator includes comma
This deprecates the comma replace function in the reader.
2016-08-04 16:05:53 +02:00
Jørgen Kvalsvik
7e9158d319 Anon namespace, removal of unused string constant 2016-08-04 16:05:53 +02:00
Jørgen Kvalsvik
b2f206d54a Replace RawRecord expanded items; reuse view
Reuses the original records string_view rather than expanding to the
same std::string, we save some allocations, memory cache misses and
simplify the class slightly.

Additionally, the uninteresting add-multiple-identical-records logic
ParserItem did before has been moved into RawRecord and is now performed
by std::deque (which also means it can allocate better for itself). The
addition of prepend deprecates push_front.
2016-08-04 16:05:53 +02:00
Jørgen Kvalsvik
11b4bc2dcd Lookup tables in is_separator/quote
The use of lookup tables reduce branching and seem to improve
performance by a few percent.
2016-08-04 16:05:53 +02:00
Jørgen Kvalsvik
adc602f6aa Manually copy over append in Parser.clean
Book keeping internally in the string class is rather unnecessary and
performed a lot (once per line in the input). Performing a manual copy
without string encumbered book keeping (essentially using the string as
a raw char* buffer) gives some performance, which scales well with the
lines in each deck.
2016-08-04 16:05:53 +02:00
Atgeirr Flø Rasmussen
dd6a364043 Add missing include directives.
These are required for std::accumulate (numeric) and
std::abs (cmath).
2016-08-01 15:47:23 +02:00
Atgeirr Flø Rasmussen
9b924b1fe1 Remove two unused functions. 2016-08-01 15:15:41 +02:00
Joakim Hove
b883e011db Merge pull request #66 from jokva/simpler-dsl-fwcth-keyword
Write units to Summary file.
2016-07-27 23:37:30 +02:00
Petter Taule
163f5a5cf5 Added applications using the regression test libraries
Added restartRegressionTest.cpp, initRegressionTest.cpp, rftRegressionTest.cpp, summaryRegressionTest.cpp, and modifying CMakeLists_files.cmake to include these.
2016-07-22 09:19:46 +02:00
Petter Taule
51c7a97af5 Added regression test libraries
Added EclFilesComparator.cpp, summaryComparator.cpp and summaryRegressionTest.cpp and corresponding header files. Also including these files in CMakeLists_files.cmake, and adding boost tests in the tests directory.
2016-07-22 09:19:46 +02:00
jokva
6ef249b9a7 Revert "C++ regression test of eclipse files (initial, unified restart and summary)" 2016-07-21 16:37:18 +02:00
Petter Taule
2f69ec7e23 Added applications using the regression test libraries
Added restartRegressionTest.cpp, initRegressionTest.cpp, rftRegressionTest.cpp, summaryRegressionTest.cpp, and modifying CMakeLists_files.cmake to include these.
2016-07-21 16:02:41 +02:00
Petter Taule
23a1171d6d Added regression test libraries
Added EclFilesComparator.cpp, summaryComparator.cpp and summaryRegressionTest.cpp and corresponding header files. Also including these files in CMakeLists_files.cmake, and adding boost tests in the tests directory.
2016-07-21 16:01:50 +02:00
Jørgen Kvalsvik
f84fb39d69 Summary keywords from model2 to be supported
Additional Summary keywords from model2 that we wish to support has been
added to the test summary deck.
2016-07-20 15:07:03 +02:00
Jørgen Kvalsvik
2158ea92bf FWCTH support 2016-07-19 14:44:35 +02:00
Jørgen Kvalsvik
9fc3fcfc38 Simplify DSL; unit conversion to quantity maths
By moving the unit conversion to the low-level arithmetic rather than
the high level functions, the DSL is simplified by inferring result
types rather than requiring explicit conversions. This means the
formulae are more lisp-like and more natural, since there is no more
need for liq_vol and fiends.

An added benefit is that multiplication now is commutative also with
respect to units, so the wonky left-hand-side-converts semantics are
gone.
2016-07-19 14:42:11 +02:00
Jørgen Kvalsvik
1ae6508f7f Write textual representation of unit in Summary
Write the corresponding unit type (as a string) to the values written in
the Summary file.

Accomplished by running every registered function as the ert entry is
created and obtaining the string representation of the result. The
computation is called with empty, dummy structures.
2016-07-19 14:39:40 +02:00
Jørgen Kvalsvik
f6cffb4c07 Support for ratio-type units 2016-07-19 14:34:51 +02:00
Jørgen Kvalsvik
c4e8149717 UnitSystem string-description of a unit
Analoguous to to/from_si but for string-representation of the unit in
question.
2016-07-19 14:34:21 +02:00
Joakim Hove
08bd6dbcdb Merge pull request #65 from jokva/completion-summary-keywords
Completion production/injection rates/totals; Field keywords
2016-07-19 10:52:10 +02:00
Jørgen Kvalsvik
ca5023c26f Completion rate function over unit, not list
There are no such thing as sum-over-completions or over multiple wells.
Treat them as such to communicate this, rather than sum-over-list.
2016-07-19 09:45:50 +02:00
Joakim Hove
19aa54a7e1 Merge pull request #883 from jokva/summary-config-well-name-matching
[Summary] W-keywords accept patterns
2016-07-19 09:43:57 +02:00
Jørgen Kvalsvik
223d9e55c5 Rename ecl_wells -> schedule_wells 2016-07-19 09:39:14 +02:00
jokva
6fc1aec8c0 Merge pull request #882 from joakim-hove/restart-config
Extracted configuration of *when* to write restart
2016-07-18 23:10:33 +02:00
Jørgen Kvalsvik
d98215ae40 [Summary] W-keywords accept patterns
The W-family of keywords accept a pattern to expand, rather than just
names or defaulted-all. This is the actual behaviour, according to the
manual.
2016-07-18 14:46:00 +02:00
Jørgen Kvalsvik
fcb3cb1bf8 Explanations in the Summary test deck
A few short lines to make the summary test deck more understandable.
2016-07-18 13:06:38 +02:00
Jørgen Kvalsvik
fa7656bedf [Summary] Rate and rate-derived F-keyword
Support for rate or rate-derived keywords (i.e. sans pressure, sales
etc.) from the Field family of keywords.
2016-07-18 12:57:06 +02:00
Jørgen Kvalsvik
ef64026bce Cuts/ratios only apply to production
In line with Eclipse water cuts, gas-oil ratio etc. only applies to
production values, rather than all rates. This sparked some other
refactoring that moves the negative-else-zero logic into the rate
calculation.
2016-07-18 12:02:29 +02:00
Joakim Hove
0069b02e9f Extracted configuration of *when* to write restart
The configuration of when to write restart files is quite complex,
involving at least the three keywords RPTSOL, RPTRST and RPTSCHED. This
commit moves that configuration from the IOConfig class to the
RestartConfig class.

At a later stage the RestartConfgig class will be extended with
information of *what* to save in the restart file.
2016-07-15 15:26:51 +02:00
Jørgen Kvalsvik
01ae50ba20 Completion production/injection rates/totals
A small set of the completion family of keywords, water/oil/gas
production and injection. The tests and example data file are updated
accordingly, with edge cases.
2016-07-15 15:20:56 +02:00
Jørgen Kvalsvik
3f98a747df Connection keywords support well matching
Looking up well keywords uses the well matching algorithm. This covers
all cases supplied by the eclipse documentation, and extends it slightly
by also allowing matching.
2016-07-15 14:40:27 +02:00
Jørgen Kvalsvik
9eb23b2971 Well matching gives empty list on no matches
The well matching algorithm has been tuned to not throw when a well name
is used for pattern and the well is not registered. Instead it will
return the empty list, meaning keywords that expects to match over
wells, but passes full identifiers, that also rely on the match to throw
for control flow, will have to manually check the emptiness of the well
list.
2016-07-15 14:40:22 +02:00
Joakim Hove
148b9b22ea Extracted configuration of *when* to write restart
The configuration of when to write restart files is quite complex,
involving at least the three keywords RPTSOL, RPTRST and RPTSCHED. This
commit moves that configuration from the IOConfig class to the
RestartConfig class.

At a later stage the RestartConfgig class will be extended with
information of *what* to save in the restart file.
2016-07-15 14:15:26 +02:00
Jørgen Kvalsvik
4635318e8f COMPDAT I/J can be defaulted
According to the manual, defaulting or putting 0 for I and J coordinates
will default to the well head I/J.
2016-07-15 12:04:01 +02:00
Joakim Hove
df9d3c660f Merge pull request #877 from jokva/remove-warnings
Remove warnings
2016-07-14 12:05:21 +02:00
Joakim Hove
ec0978f00e Writing INT properties to INIT file.
Refactor: Made helper functions templates functions.
2016-07-14 11:46:46 +02:00
Joakim Hove
4a22657e76 Added iterator support to GridProperties<T>
- Removed std::vector<> storage of GridProperty<T> objects.
 - Completely removed std::shared_ptr<> from GridProperties<T>.
2016-07-13 23:45:06 +02:00
Joakim Hove
c3e292399b Added getIntProperties() and getDoubleProperties() 2016-07-13 23:45:06 +02:00
Jørgen Kvalsvik
c804a1372a Remove BOOST_TEST_DYN_LINK directive from NNCTest 2016-07-13 23:40:35 +02:00
Jørgen Kvalsvik
178f563c72 Fix warnings in Compsegs 2016-07-13 23:40:35 +02:00
Jørgen Kvalsvik
784e04eb81 Fix warnings in IntegrationTests 2016-07-13 23:40:35 +02:00
Jørgen Kvalsvik
38573e9309 Fix warnings in IOConfigIntegrationTest 2016-07-13 23:40:35 +02:00
Jørgen Kvalsvik
5f6f7d2d03 Fix warnings in opmi 2016-07-13 23:40:35 +02:00
Jørgen Kvalsvik
d7aae5b75a Fix warnings in GridPropertyTests 2016-07-13 23:40:10 +02:00
Jørgen Kvalsvik
ecb2f0a1ab Fix warnings in SatfuncPropertyInitTests 2016-07-13 23:40:10 +02:00
Jørgen Kvalsvik
5df5c769f6 Fix warnings in TableManagerTests 2016-07-13 23:40:09 +02:00
Jørgen Kvalsvik
036a4619e2 Fix warnings in TableContainerTests 2016-07-13 23:40:09 +02:00
Jørgen Kvalsvik
de9ecedf2d Fix warnings in COMPSEGUnits 2016-07-13 23:40:09 +02:00
Jørgen Kvalsvik
ca2985d5a0 Fix warnings in ParserTests 2016-07-13 23:40:09 +02:00
Jørgen Kvalsvik
d85bbf9f2b Fix warnings in ParserKeywordTests 2016-07-13 23:40:09 +02:00
Jørgen Kvalsvik
616e810858 Fix warnings in Parser 2016-07-13 23:40:09 +02:00
Jørgen Kvalsvik
a84327ca25 Fix warnings in SummaryConfig 2016-07-13 23:40:09 +02:00
Jørgen Kvalsvik
de31ac9743 Fix warnings in NNC 2016-07-13 23:40:09 +02:00
Jørgen Kvalsvik
a7e45bf7d4 Fix warnings in GridProperty 2016-07-13 23:40:09 +02:00
Jørgen Kvalsvik
f36851d127 Fix warnings in GridDims 2016-07-13 23:40:09 +02:00
Jørgen Kvalsvik
7bcd4a428d Fix warnings in Tables 2016-07-13 23:40:09 +02:00
Jørgen Kvalsvik
508be3ecd5 Fix warnings in Stringview 2016-07-13 23:40:09 +02:00
Jørgen Kvalsvik
02785741a6 Fix warnings in Functional 2016-07-13 23:40:09 +02:00
Jørgen Kvalsvik
6226a154c7 Fix warnings in VFPProdTable 2016-07-13 23:40:09 +02:00
Jørgen Kvalsvik
ee121931b8 Fix warnings in ColumnSchema 2016-07-13 23:40:09 +02:00
Jørgen Kvalsvik
33a87a1ced Fix warnings in StarToken 2016-07-13 23:40:09 +02:00
Jørgen Kvalsvik
efc10007be Fix warnings in KeywordGenerator 2016-07-13 23:40:09 +02:00
Jørgen Kvalsvik
89f62a743d Fix warnings in Well 2016-07-13 23:40:09 +02:00
Jørgen Kvalsvik
ef9fa57fa6 Fix warnings in Eclipse3DProperties 2016-07-13 23:40:09 +02:00
Jørgen Kvalsvik
29604ac2af Fix warnings in DeckRecord 2016-07-13 23:39:29 +02:00
Jørgen Kvalsvik
aff1908529 Fix warnings in DeckItem 2016-07-13 23:39:29 +02:00
Jørgen Kvalsvik
2f0f7201eb Fix warnings in Deck 2016-07-13 23:39:29 +02:00
Joakim Hove
a15cee598a Removed OpmLog from opmi. 2016-07-13 15:37:48 +02:00
Joakim Hove
84321ba48d Changes to Properties lookup:
1. The normalizing in keyword names has been moved from
   Eclipse3DProperties to GridProperties.

2. The normalizing does both UPPERCASE and removes trailing
   whitespace.
2016-07-13 14:56:15 +02:00
Joakim Hove
2ce7be2b69 opmi will dump messages to std::cout 2016-07-13 14:56:15 +02:00
Joakim Hove
f2e94061d8 Added Json config for new keywords. 2016-07-13 14:56:15 +02:00
Joakim Hove
f16283e367 Removed the EclipseGrid.fwriteEGRID() method. 2016-07-12 14:28:57 +02:00
Joakim Hove
53625baf26 Write DEPTH and DX,DY,DZ keywords to INIT file. 2016-07-12 13:56:35 +02:00
Joakim Hove
b8ae72b8c5 Cleanup: Will remove test area. 2016-07-12 13:56:28 +02:00
Joakim Hove
14db80e91b Merge pull request #873 from jokva/appveyor
Appveyor support
2016-07-11 22:46:13 +02:00
Jørgen Kvalsvik
0823232aae Windows integration: boost::path for path equality
Use boost path for comparison, in order to get portable path comparison,
which makes the test pass on Windows.
2016-07-11 14:59:02 +02:00
Jørgen Kvalsvik
d78dcae1ce Windows integration; make portable temp path
Uses boost's temporary path facilities rather than suggesting /tmp for
temporary directory creation. Linux users will observe no difference,
but the test itself will run on Windows.
2016-07-11 14:59:02 +02:00
Jørgen Kvalsvik
a33c6ad1a2 IOConfig::fullBasePath gives correct OS path
Leverages boost to properly convert path speficiations to the current
platform's preferred format.
2016-07-11 14:59:02 +02:00
Jørgen Kvalsvik
590e3d2efe ALL_keywords in tests non-constexpr (MSVC compat)
Windows' compiler complains that {} yields a non-const expr for the
std::initializer_list, meaning compilation breaks. Changed to a const
static instead so that MSVC is happy.
2016-07-11 14:59:02 +02:00
Jørgen Kvalsvik
c84fd6ecaa Appveyor.yml 2016-07-11 14:59:02 +02:00
Joakim Hove
1e3000fc54 Merge pull request #871 from jokva/remove-dependency-opm-common
Remove opm-common dependency
2016-07-11 10:06:04 +02:00
Kai Bao
4a112f4fd5 updating the path for the MSW in the opm-data for test. 2016-07-09 16:37:44 +02:00
Jørgen Kvalsvik
3696b750cd Remove opm-common dependency
Severs the code dependency on opm-commmon. There was no actual
functional dependency here, with the exception of some enable/disable
warning headers. To properly make opm-parser a stand-alone module the
usage of these headers have been removed and the dependency on
opm-common is gone.
2016-07-08 15:53:40 +02:00
Jørgen Kvalsvik
44cd4868f8 Syntactic cleanup
Fixup of some messy constructors.
2016-07-05 08:22:13 +02:00
Jørgen Kvalsvik
e1befcc03f SummaryConfig: don't register duplicate entries
By using the ALL keyword or by denoting the same keyword multiple times,
there would be corresponding multiple entries in the SUMMARY file.
Address this by removing duplicate entries from the list of smspec
nodes.
2016-07-04 16:47:20 +02:00
Jørgen Kvalsvik
c998b35647 Reindentation 2016-07-04 16:47:19 +02:00
Jørgen Kvalsvik
27eeb9f85e Refactor SummaryConfig internals
The internal helper functions have been redesign. The initial ambition
was to create small, composable functions by-value functions and have
the high-level algorithm, which is essentially (concat . map handler
[kwlist]). However, MSVC breaking and therefore poor development speed
of utility libraries mandates adjusting the approach a bit.

The major change here is the "return value" of the helper functions
being passed by-reference to all helpers, which will append the elements
they generate onto the collection.
2016-07-04 16:47:04 +02:00
Jørgen Kvalsvik
daf833e3ba Minor control flow simplification 2016-07-04 13:15:25 +02:00
Jørgen Kvalsvik
3d01da1f4c ALL keyword SummaryConfig as parse-then-merge
Generalises the SummaryConfig internal representation building by no
longer special casing the ALL keyword in the loop, but rather explicitly
look it up, analyse the expanded list as a new and isolated deck, and
then merge the results.
2016-07-04 13:10:57 +02:00
Jørgen Kvalsvik
17464851ad Initializer list constructors for Deck
Initializer list support makes some tests much easier to write (and
read) and enables some nifty features for when small, special-purpose
decks are needed.
2016-07-04 12:40:31 +02:00
Jørgen Kvalsvik
4f8ad8a533 SummaryConfig::merge
Combine two Summary configs, essentially concatenating the underlying
vectors.
2016-07-04 12:02:43 +02:00
Jørgen Kvalsvik
ffc94fc0b2 SummaryConfig: anon namespace; private ALL list
Some minor hygiene, not exposing some highly internal detail. The list
of keywords ALL expands to is duplicated rather than acessible via a
method, but:

1. this is highly likely never an interesting list of applications
2. it's really only useful for testing **AND** is unlikely to change
3. unclutters the header files slightly
2016-07-04 11:47:22 +02:00
Liu Ming
9e0398c134 add comma. 2016-07-04 08:55:32 +08:00
Joakim Hove
d3f415c5aa ParseContext treatment of unknown wells/groups. 2016-07-01 17:04:58 +02:00
Joakim Hove
433b8ce73e Removed unused filter/remove functionality. 2016-07-01 17:04:58 +02:00
Joakim Hove
0db0637ef7 RPTRST / TimeMap updates
- Fixed bug with RPTRST BASIC=4 terminated before a year.

 - Refactored machinery to keep track of first report step in every
   month/year.
2016-07-01 17:04:58 +02:00
Joakim Hove
0c0cc14538 Removed TimeMap assemble from Schedule class. 2016-07-01 17:04:58 +02:00
Joakim Hove
5a7c208160 Merge pull request #867 from joakim-hove/python-jenkins-disable
Disable Python in jenkins build.
2016-07-01 15:40:38 +02:00
Joakim Hove
c4ce3b16d2 Check that HAVE_ERT_PYTHON before building Python. 2016-07-01 15:36:38 +02:00
Joakim Hove
55f482b202 Add ParseContext argument to SummaryConfig. 2016-07-01 13:59:18 +02:00
Joakim Hove
e40e731b2c Merge pull request #51 from joakim-hove/rename-writeInit
Rename write init
2016-07-01 13:56:47 +02:00
Joakim Hove
a40dc3c1c1 Fixed bug with global/active mapping for output. 2016-07-01 13:03:51 +02:00
Kai Bao
08c5a0c8e0 addressing the line-breaking and spelling comments. 2016-06-30 13:07:12 +02:00
Kai Bao
a10961470a small parenthesis adjustment. 2016-06-30 13:07:12 +02:00
Kai Bao
20f5315155 adding flag for automatic shut-in to Well. 2016-06-30 13:07:12 +02:00
Kai Bao
daab4454b4 function to indicate effecive ratio limit in WellEconProductionLimits 2016-06-30 13:07:12 +02:00
Kai Bao
0145c1301a add a function to indicate if WECON provides any effective limit. 2016-06-30 13:07:12 +02:00
Kai Bao
741c8604e9 adding integration tests for WECON. 2016-06-30 13:07:12 +02:00
Kai Bao
43b298dde6 adding default constructor for WellEconProductionLimits
adding correcting the usage related to dimensioinless items.
2016-06-30 13:07:11 +02:00
Kai Bao
ef7a7d1de8 adding WECON related to schedule. 2016-06-30 13:07:11 +02:00
Kai Bao
52aceb9e01 adding the WellEconProductionLimits to Well. 2016-06-30 13:07:11 +02:00
Kai Bao
fef83bde66 adding the == and != operators for WellEconProductionLimits 2016-06-30 13:07:11 +02:00
Kai Bao
0c06bfb492 default value 0.0 to min reservoir fluid rate in keyword WECON 2016-06-30 13:07:11 +02:00
Kai Bao
84b6ee2d55 adding class WellEconProductionLimits 2016-06-30 13:07:11 +02:00
Kai Bao
046ed93a4a adding the enum types related to WECON 2016-06-30 13:07:11 +02:00
Jørgen Kvalsvik
0c0a548219 New private Summary implementation
A rewritten Summary.cpp with some minor header modifications. Synposis
of the new implementation:

* Uses unordered_map< string, std::function > for dispatch, instead of
  multiple functions and a switch
* Some poor man's function composition support has been added
  (privately) to avoid a lot of reptition in the post processing.
* Functions assume they work over lists of wells instead of single wells
  being special cased - this means groups of well etc. can share
  implementation with single wells and field keywords.
* Unsupported keywords are not written in the Summary file.

Furthermore, some comments on special cases and overall approach and
a generally more declarative implementation. This change is invisible to
downstream developers. Users will obviously see no more garbage
keywords.
2016-06-30 09:54:40 +02:00
Joakim Hove
20bbeeda56 Added EclipseGrid::getActiveMap(). 2016-06-30 08:32:45 +02:00
Joakim Hove
cbeef6c556 Merge pull request #864 from joakim-hove/nosim-ioconfig
Moved NOSIM handling to IOConfig + allow override.
2016-06-29 16:41:28 +02:00
Joakim Hove
2333191908 Unrelated: Using C++ TestArea. 2016-06-29 13:10:35 +02:00
Joakim Hove
031306735a Unrelated: using EclipseGrid.getCartesianSize() 2016-06-29 13:10:35 +02:00
Joakim Hove
c0b56afb13 Removed NNC argument to EclipseWriter constructor. 2016-06-29 13:10:35 +02:00
Joakim Hove
4b11d9a059 Rename wrietInit -> writeInitAndEgrid() 2016-06-29 13:10:35 +02:00
Joakim Hove
12e36f6cff Moved NNC argument to writeInit() method. 2016-06-29 13:10:35 +02:00
Joakim Hove
28add15c71 Filename overload without report step argument. 2016-06-29 13:10:35 +02:00
Joakim Hove
6a1888af14 Refactored writeInit:
- Removed class Init completely - writeint an init file is handled by
   the method EclipseWriter::writeINITFile( )

 - Seperated writing of INIT file and EGRID file better.
2016-06-29 13:10:35 +02:00
Joakim Hove
7a64bf579e Renamed Filename::ertHandle() -> Filename::get() 2016-06-29 13:10:35 +02:00
Joakim Hove
b232c568af writeInit() - can optionally take properties. 2016-06-29 13:10:35 +02:00
Joakim Hove
9b1d0d3cee Added small struct data::CellData. 2016-06-29 13:10:35 +02:00
Joakim Hove
978bd9e857 Some reformatting. 2016-06-29 13:10:35 +02:00
Joakim Hove
3d460f16a5 Moved 'INIT' keyword in testdata. 2016-06-29 13:10:35 +02:00
Joakim Hove
791da336fe Removed unchecked calls to writeInit(). 2016-06-29 13:10:35 +02:00
Joakim Hove
93ab544443 Merge pull request #861 from kjellkongsvik/summary_ALL
Expands ALL keyword for summary
2016-06-29 13:06:53 +02:00
Kjell W. Kongsvik
03710ad799 Simplified key/name retrival from summary 2016-06-29 10:21:13 +02:00
Kjell W. Kongsvik
31ec1dcfb2 Minor code formatting changes 2016-06-29 10:11:06 +02:00
Joakim Hove
896c8881fd Moved NOSIM handling to IOConfig + allow override. 2016-06-29 07:44:30 +02:00
Joakim Hove
ec9dfd8277 Merge pull request #862 from jokva/improved-well-properties-interface
Improved well properties interface
2016-06-28 20:54:52 +02:00
Jørgen Kvalsvik
d6940647bd UnitSystem::measure::identity
Adds the "identity" unit which is a no-op under to_si/from_si
conversion.
2016-06-28 17:15:24 +02:00
Jørgen Kvalsvik
1a0465c4fc Add Well::production_rate/injection_rate
Two convenince call for downstream users that allows querying well rates
with the assumption that if something is unsupported or of the wrong
type, return plain zero.
2016-06-28 17:14:31 +02:00
Kjell W. Kongsvik
7f3cbcf91a Expands ALL keyword for summary
Only support F, G, W, not A
2016-06-28 15:39:59 +02:00
Joakim Hove
1a09986cd2 Merge pull request #858 from joakim-hove/ioconfig-path-base
Added IOConfig::getOutputBase()
2016-06-27 12:48:48 +02:00
Joakim Hove
66103cd2a0 Respect outputdir: using IOConfig::getOutputBase() 2016-06-27 11:57:49 +02:00
Joakim Hove
337a141d28 Added IOConfig::getOutputBase() 2016-06-27 11:55:58 +02:00
Anders Matheson
7c6ef1f786 Add missing namespace and include file 2016-06-27 10:20:07 +02:00
Joakim Hove
0f238d6552 Explicitly created output in subdirectory. 2016-06-24 19:39:46 +02:00
Joakim Hove
299b453b56 Using ERT::TestArea. 2016-06-24 19:39:17 +02:00
Joakim Hove
c3db8fc3a0 Merge pull request #854 from pgdr/grid-dim
Introducing GridDims, a wrapper around (x,y,z), superclassing EclipseGrid
2016-06-22 09:33:28 +02:00
Arne Morten Kvarving
361e9d49eb fixed: broken keyword in e576f399f18da63172aa983d3f630e05111e2b0d 2016-06-21 16:18:34 +02:00
Pål Grønås Drange
e7461ccfea Added DX/DY/DZ to summary_deck.DATA 2016-06-21 16:03:23 +02:00
Pål Grønås Drange
5b3eaada22 EclipseState demands full deck now, so added D(X|Y|Z) and TOPS to tests 2016-06-21 15:55:04 +02:00
Pål Grønås Drange
49f3356934 Removed getDims() and disable this EclipseGrid
* Removed method getDims since getNXYZ already exists
* Now we throw if EclipseGrid get lean deck
* Removed tests for assertCellInfo and hasCellInfo
* Fixed ResinsightTests to use GridDims
2016-06-21 14:56:34 +02:00
Kai Bao
64843da486 adding keyword WECON 2016-06-21 13:58:17 +02:00
Pål Grønås Drange
1fada954e2 Merge and rebase fixup 2016-06-21 13:13:00 +02:00
Pål Grønås Drange
ff26034445 Added DIMENS/SPECGRID test case, several GridDims changes
* Added a test to ensure DIMENS/SPECGRID are handled consistently
* Added GridDims.cpp source file and moved code from header
* Added GridDims.(c|h)pp to CMakeLists
* Removed use of MessageContainer in GridDims, updated calls
* Made function getDims(keyword) inline readDims
* Reformatted GridDimens
2016-06-21 12:39:16 +02:00
Pål Grønås Drange
ce4bbe8b9f Rewrote EclipseGrid to use std::array when 3D 2016-06-21 12:39:15 +02:00
Pål Grønås Drange
1176c56325 Fixed bug ref assign from value 2016-06-21 12:34:57 +02:00
Pål Grønås Drange
55e950a9a4 Fixed GridDims after rebase, removed ERT knowledge in GridDims 2016-06-21 12:34:57 +02:00
Pål Grønås Drange
12b1815f7b initial griddims 2016-06-21 12:34:11 +02:00
Pål Grønås Drange
96fe8e9968 Merge pull request #853 from pgdr/multregt-faults-ref
Minor refactor. Changed shared_ptr to references in EclipseState and related objects
2016-06-21 12:31:53 +02:00
Pål Grønås Drange
30b03b6aec Fixed value/reference bug, changed init to add...
* Fixed a Section to Section& bug that occurred after removing ptr's
* Renamed initFaults to addFaultFace
* Organized imports in EclipseState and Eclipse3DProperties
* Fixed 2013 to 2016 error in header in E3DP
2016-06-21 11:43:20 +02:00
Joakim Hove
b09a97a776 Added parse test of opm-data/msw test. 2016-06-20 23:20:27 +02:00
Joakim Hove
abc203b605 Merge pull request #852 from joakim-hove/cp-grid
Cornerpoint based EclipseGrid constructor.
2016-06-20 21:37:40 +02:00
Joakim Hove
0ab3917233 Merge pull request #849 from jokva/remove-well-ptr
Remove shared_ptr Well alias, make Schedule interface more consistent
2016-06-20 14:57:17 +02:00
Joakim Hove
b1920ef251 Merge pull request #43 from jokva/well-shared_ptr-deprecated
Well shared_ptr alias deprecated
2016-06-20 14:56:53 +02:00
Pål Grønås Drange
ff9ee958d7 Minor refactor. Changed shared_ptr to references in EclipseState, MULTREGTScanner and FaultCollection 2016-06-20 12:27:56 +02:00
Joakim Hove
a7e3d50e53 Cornerpoint based EclipseGrid constructor. 2016-06-16 22:24:39 +02:00
Joakim Hove
88c55dcd91 Merge pull request #851 from joakim-hove/suppress-warnings
Removed unused include and forward declaration.
2016-06-16 16:54:23 +02:00
Joakim Hove
371b0c94e6 Merge pull request #848 from joakim-hove/error-msg
Error msg
2016-06-16 16:51:53 +02:00
Joakim Hove
3ab1559a2b Improved error msg. 2016-06-16 16:05:02 +02:00
Joakim Hove
2b8a0ba1e6 Removed unused include and forward declaration. 2016-06-16 16:03:51 +02:00
Jørgen Kvalsvik
7c82e69a00 Copy and save a Grid copy in Writer; apply actnum
Simulators might modify the grid post EclipseState creation, so the Grid
fetched from there is unreliable. Copy the Deck-provided grid and apply
the manipulations at EclipseWriter construction time to ensure it uses
the same dimensions and has the same properties as the simulator.
2016-06-16 14:30:27 +02:00
Andreas Lauser
76da7a7429 use boost::regex unconditionally
this fixes opm-simulators#702. which turned out to be a quirk of the
build system which is due to the fact that opm-parser likes to do some
things differently than the rest of OPM. (in this case the culprit was
that it does not generate a `config.h` file which resulted in the
HAVE_REGEX macro to be different between opm-parser and downstream
which in turn causes the ABI to be incompatible.)

Note that it would be nice to use `std::regex` instead of Boost, but
this is currently blocked by the requirement that the oldest supported
compiler is GCC 4.8. (GCC 4.8 only provides a stub implementation of
`std::regex`.)
2016-06-16 14:23:39 +02:00
Jørgen Kvalsvik
44d7abc6fb Well shared_ptr alias removed
Deprecate the WellPtr -> shared_ptr aliases. The Schedule object is the
sole owner of these objects, and shared_ptr in the interfaces hid that.

The interfaces still relies on pointers to pass Wells around for now,
in order to (mostly) preserve source compability.
2016-06-16 13:58:12 +02:00
Jørgen Kvalsvik
04ea6c90a8 Well shared_ptr alias deprecated
The shared_ptr aliasing is deprecated, and in the Well case this has
been removed upstream.
2016-06-16 10:12:39 +02:00
Joakim Hove
f324f13e03 Merge pull request #846 from joakim-hove/suppress-warnings
Suppress warnings
2016-06-16 09:27:53 +02:00
Joakim Hove
10bf441076 Added ParseContext::PARSE_MISSING_INCLUDE 2016-06-15 17:34:44 +02:00
Jørgen Kvalsvik
3d30300091 Remove shared_ptr from WellSet interface
This change also propagates into some of Group's methods.
2016-06-15 16:20:22 +02:00
Joakim Hove
1e8a19f729 Hide unused variable. 2016-06-15 15:41:47 +02:00
Joakim Hove
9b874aabfb Avoid shadowing of member variable. 2016-06-15 15:31:37 +02:00
Joakim Hove
7f540951f4 Removed unused arguments. 2016-06-15 15:27:33 +02:00
Joakim Hove
0f53084015 Merge pull request #827 from joakim-hove/check-symlinks
Check for symlink() and compile test conditionally
2016-06-15 15:19:29 +02:00
Jørgen Kvalsvik
7e9f5b54d0 Schedule/getGroup const; references internally 2016-06-15 15:09:31 +02:00
Jørgen Kvalsvik
7941b99ee4 Schedule/updateWellStatus takes reference 2016-06-15 14:34:28 +02:00
Jørgen Kvalsvik
820513ddcd Schedule/checkWELSPECSConsistency takes reference 2016-06-15 14:29:29 +02:00
Atgeirr Flø Rasmussen
6f531033be Use namespace rather than member syntax. 2016-06-15 09:42:02 +02:00
Atgeirr Flø Rasmussen
8c538ce60e Avoid shadowing. 2016-06-15 09:41:43 +02:00
Atgeirr Flø Rasmussen
61bc977d27 Suppress boost warnings. 2016-06-15 09:40:18 +02:00
Joakim Hove
8e9dce4bd8 Merge pull request #839 from joakim-hove/ignore-operate
Added keyword OPERATE.
2016-06-15 09:10:26 +02:00
Joakim Hove
e65d19a49a Merge pull request #841 from pgdr/mixed-case
Supporting reading and writing mixed case properties
2016-06-15 08:56:09 +02:00
Pål Grønås Drange
1c5ce34a96 Using Utility/String.hpp helper function uppercase 2016-06-14 17:43:37 +02:00
Jørgen Kvalsvik
06c90c4bc7 RawKeyword uses uppercase from util 2016-06-14 17:01:50 +02:00
Jørgen Kvalsvik
2b10bba815 String.hpp/uppercase
A tiny utility file for shared string-related functions.
2016-06-14 17:01:50 +02:00
Jørgen Kvalsvik
eeba4f37e6 Expand on possible failure case in parser 2016-06-14 14:44:46 +02:00
Joakim Hove
8f089f284c Merge pull request #840 from jokva/parse-comma-separated-deck
Strip commas from the input deck
2016-06-14 14:40:59 +02:00
Jørgen Kvalsvik
f56a2d61d0 Strip commas from the input deck
Some decks use comma to separate items in a record, but the comma adds
no extra information and is essentially ignored. Post-process the file
after cleaning it and replace all commas with whitespace.

Considering the record "foo bar , , , baz" / baz will silently be moved
to the third item, but handling that situation is a **lot** more
difficult and time consuming and not worth the effort for now.
Additionally, we have yet to receive decks that fail in such a manner,
nor are we sure if it is even a valid record in Eclipse.
2016-06-14 12:57:05 +02:00
Pål Grønås Drange
3f980665e9 Supporting reading and writing mixed case properties/keyword 2016-06-14 12:54:37 +02:00
Joakim Hove
8cfb73d991 Added keyword OPERATE. 2016-06-14 12:29:31 +02:00
Jørgen Kvalsvik
e0721786c4 Replace boost-filesystem with ert
Ert is a hard dependency that provides much of the core functionality of
opm-output, whereas boost::filesystem only provided create-directory
features. Since Ert conveniently provides the same features with a
near-identical interface and is used for file-writing anyway, the
responsibility for interacting with the file system has been put on ert.

Boost is now only used for testing in opm-output.
2016-06-13 14:46:20 +02:00
Liu Ming
44fdf9b3c5 1. If the message is more than 1 line, add '\n' at the end of this message.
2. put file in front of line.
2016-06-13 13:40:57 +08:00
Joakim Hove
774c36c4a9 Check for symlink() and compile test conditionally 2016-06-11 07:45:24 +02:00
Joakim Hove
c45fcc5e50 Merge pull request #37 from joakim-hove/travis-reorg
Using travis build-all configuration.
2016-06-11 07:28:01 +02:00
Jørgen Kvalsvik
64ea598240 Remove unused message 2016-06-10 14:00:18 +02:00
Joakim Hove
7b4ed3cd63 Using travis build-all configuration. 2016-06-10 13:46:59 +02:00
Joakim Hove
aa7cf3b9f1 Merge pull request #824 from joakim-hove/travis-build-downstream
Travis build downstream
2016-06-10 13:00:32 +02:00
Joakim Hove
4d3bd50cb8 Travis: opm-common/travis/build-and-test.sh 2016-06-10 11:43:11 +02:00
Jørgen Kvalsvik
d65cf1d657 Only write positive values to Summary file
Since production is seen as negative injection, and production rates
often are zero, negative zeros would be returned. Likewise, occasionally
numerical noise gives slightly-below-zero values which are now rounded
to be plain zeros.
2016-06-10 10:04:00 +02:00
Jørgen Kvalsvik
87e24b91b6 Look up history rates at correct timestep
The input format and parser interacts non-intuitively, as the observed
rates for timestep N are written for timestep N-1.
2016-06-10 10:03:49 +02:00
Liu Ming
3bd87fb9c8 well related message should go into print file. 2016-06-10 09:13:12 +02:00
Liu Ming
d611c2deb6 remove unused variable. 2016-06-09 08:30:37 +02:00
Liu Ming
1f28277f70 minor typo issue. 2016-06-08 15:40:11 +02:00
Liu Ming
4b210aaa51 format the messages. 2016-06-08 15:38:21 +02:00
Liu Ming
c843c714de make the messages relates to history to print file. 2016-06-08 13:46:34 +02:00
Liu Ming
6c7af4afc1 Make a clear message for VFP. 2016-06-08 13:45:40 +02:00
Atgeirr Flø Rasmussen
1b55fb4259 Merge pull request #830 from qilicun/add-prtinfo-type
Add Prtinfo message type allows messages go into print file.
2016-06-08 11:35:23 +02:00
Liu Ming
98ed0521b5 fix indentation. 2016-06-08 11:11:16 +02:00
Liu Ming
dcb91aa070 change type order. 2016-06-08 09:25:07 +02:00
Liu Ming
5d631d7dd2 change Prtinfo to Note. 2016-06-08 09:12:58 +02:00
Joakim Hove
fd3245599e Merge pull request #818 from magnesj/vs2015-compiler-fixes
VS2015 : Workaround for VS2015 compiler bug
2016-06-08 00:15:14 +02:00
jokva
3137a92a41 Merge pull request #812 from pgdr/eclipse-config-container
Introducing EclipseConfig -- a container class
2016-06-07 15:21:23 +02:00
Pål Grønås Drange
415c1b22ba Moved initIOConfigPostSchedule into constructor, fixed includes 2016-06-07 14:53:58 +02:00
Pål Grønås Drange
e9bdf2d29d Introducing EclipseConfig -- a container class
* This class contains the following State methods
** getSchedule
** getIOConfig
** getInitConfig
** getSimulationConfig
** getSummaryConfig
* For better decoupling
* For future, ease the shared_ptr-ref transition
2016-06-07 14:53:38 +02:00
Liu Ming
dea35c4c34 Add Prtinfo message type allows messages go into print file. 2016-06-07 14:09:35 +02:00
Jørgen Kvalsvik
ac0ed1447c Don't crash when a Well is not in data::Wells
It's perfectly legitimate for clients to "default" a well result, e.g.
when it hasn't started up yet, in which case most output will default to
0. Avoid crashing when this happens, and instead calculate based on a
dummy well.
2016-06-07 08:42:30 +02:00
Jørgen Kvalsvik
c87ffb1608 Base Summary test durations on days
Basing the dest durations on days over seconds make them less noisy,
more readable and closer to actual idiomatic use. Removes some subtle
complexities from the tests.
2016-06-07 08:42:30 +02:00
Jørgen Kvalsvik
c5397488a8 Correctly calculate totals 2016-06-07 08:42:30 +02:00
Jørgen Kvalsvik
54fdaadff9 Use basename for filename, not title 2016-06-07 08:41:39 +02:00
Jørgen Kvalsvik
bb53a74763 Use alias for UnitSystem::measure 2016-06-07 08:41:38 +02:00
Jørgen Kvalsvik
c1ea13a550 Use grid-provided index calculations. 2016-06-07 08:40:41 +02:00
Jørgen Kvalsvik
800b214462 Relace ad-hoc keyword-struct with EclKW_ref 2016-06-07 08:40:41 +02:00
Jørgen Kvalsvik
b238762731 Replace ert_unique_ptr with FortIO 2016-06-07 08:40:41 +02:00
Jørgen Kvalsvik
e73475db80 Renaming: 'handle' names made more descriptive 2016-06-07 08:40:41 +02:00
Jørgen Kvalsvik
9e39b92c99 Keyword replaced with ERT::EclKW
Use library-provided ecl_kw abstraction rather than rolling our own RAII
wrapper.
2016-06-07 08:40:41 +02:00
Jørgen Kvalsvik
0f1a1d7ede NNC variable not defaulted in writeInit 2016-06-07 08:40:41 +02:00
Jørgen Kvalsvik
99e2a55204 Replace raw conversion_table with UnitSystem
The to_si/from_si functions were moved into UnitSystem which now manages
table lookup for clients, rather than having to store the raw
conversion tables.
2016-06-07 08:40:41 +02:00
Jørgen Kvalsvik
bed743c763 Travis: don't build material and core 2016-06-07 08:40:41 +02:00
Jørgen Kvalsvik
e2a5c01a8b Read sim start time from EclipseState
Reading the start time from EclipseState means it's no longer required
as a parameter to every method, and that the current time can be
calculated as start time + time elapsed.
2016-06-07 08:40:41 +02:00
Jørgen Kvalsvik
91d5cad61e Remove unused argument from writeInit 2016-06-07 08:40:41 +02:00
Jørgen Kvalsvik
ecbbec3aad Remove the OutputWriter-Eclipse inheritance
This is-a relationship is never used, and the vtable is never leveraged.
The augmented output writers already use uniquely named output writers
anyway, so there is no reason to go via the hurdle of inheritance.

This gives a lot of flexibility when it comes to interface, since
Eclipse output can make Eclipse-specific assumptions.
2016-06-07 08:40:40 +02:00
Jørgen Kvalsvik
6efe691629 Replace boost::posix_time with time_t
The boost object was only used to calculate elapsed posix time anyway,
which is required (and already managed) by the callers. This makes the
interface slightly less complicated and removes an otherwise pointless
dependency.
2016-06-07 08:40:40 +02:00
Jørgen Kvalsvik
a1d8ec4c09 Remove boost::to_upper_copy 2016-06-07 08:40:40 +02:00
Jørgen Kvalsvik
add5c6ba37 Use throw over OPM_THROW 2016-06-07 08:40:40 +02:00
Jørgen Kvalsvik
c1775bc1f1 Implement EclipseWriter as private; hide RFT
Hides all the EclipseWriter details and helper classes using pimpl,
which now enforces the non-copyability of EclipseWriter (which relies on
open and stateful file handles).
2016-06-07 08:40:40 +02:00
Jørgen Kvalsvik
ed6b884a9e Rewrite internal Init helper 2016-06-07 08:40:40 +02:00
Jørgen Kvalsvik
f50bbb1ac3 Rewrite internal Restart-Solution helper 2016-06-07 08:40:40 +02:00
Jørgen Kvalsvik
c3a9495c1a Rewrite internal Restart helper 2016-06-07 08:40:40 +02:00
Jørgen Kvalsvik
cc79b998af Rewrite internal FileName helper 2016-06-07 08:40:40 +02:00
Jørgen Kvalsvik
19324207dc Rewrite internal Keyword helper class 2016-06-07 08:40:40 +02:00
Jørgen Kvalsvik
ff6bcf713f Remove details namespace; introduce anon namespace
There is no reason for these symbols to be externally visible, so
they're now instead contained in an anonymous namespace.
2016-06-07 08:40:40 +02:00
Jørgen Kvalsvik
6f90959d42 Remove opm-core dependency in writenumwells test 2016-06-07 08:40:40 +02:00
Jørgen Kvalsvik
0e9238a175 Remove opm-core dependency in Restart test; rename
Removes the opm-core dependency in the restart test, and renames the
file to be more in style with the new test set.
2016-06-07 08:40:40 +02:00
Jørgen Kvalsvik
038007b431 Remove opm-core dependency in EclipseWriter test 2016-06-07 08:40:39 +02:00
Jørgen Kvalsvik
d1c0575f47 Remove opm-core dependency in RFT test; rename
Rewrites the RFT test to be independent of opm-core data types and
functions, and renames it to test_RFT since the class now represents the
full file, not some open-closing handle.
2016-06-07 08:40:39 +02:00
Jørgen Kvalsvik
913da19a14 Replace OPM_THROW with throw. 2016-06-07 08:40:39 +02:00
Jørgen Kvalsvik
6944ac69a2 Remove core/WellType from EclipseWriter 2016-06-07 08:40:39 +02:00
Jørgen Kvalsvik
0926f1a003 Disable UnstructuredGrid VTK output.
UnstructuredGrid is deeply tied to core, and is disabled for now.
writeVtk should be rewritten to use EclipseGrid as input or something
similar, but support is dropped in its current state.
2016-06-07 08:40:39 +02:00
Jørgen Kvalsvik
57ae14cfc7 Replace DataMap with std::map in writeVTK 2016-06-07 08:40:39 +02:00
Jørgen Kvalsvik
8adf7a2517 Removed deprecated VAG support. 2016-06-07 08:40:39 +02:00
Jørgen Kvalsvik
29f64a1a85 Remove ParameterGroup include from CornerpointChopper 2016-06-07 08:40:39 +02:00
Jørgen Kvalsvik
59480757d9 String fixup: core -> output 2016-06-07 08:40:39 +02:00
Jørgen Kvalsvik
ccb961c66c Remove opm-core from writeECLData 2016-06-07 08:40:39 +02:00
Jørgen Kvalsvik
1ab914e98a Simplify writing procedure 2016-06-07 08:40:39 +02:00
Jørgen Kvalsvik
9ea5e52144 Replace core/grid arg with dimensions in WriteECL
The grid structure was only used to read static size-related properties,
meaning the instance itself was rather uninteresting. Replace the grid
argument with raw ints.
2016-06-07 08:40:39 +02:00
Jørgen Kvalsvik
530407a3ad EclipseWriter header cleanup
Remove the unnecessary or unused includes. Consequence is well enum
conversions being no longer public static. To not break the tests the
functions have been implemented in writenumwells.
2016-06-07 08:40:39 +02:00
Jørgen Kvalsvik
5af3fb84fe Refactor RTFWriter
Remove the opm-core dependency and re-implement the RFT writer. The
approach has been changed in the sense that we now store and keep alive
a file instance for the RFT file, instead of re-opening the file at
every time step.
2016-06-07 08:40:38 +02:00
Jørgen Kvalsvik
dac3ef8bb6 Reorder fields in EclipseWriter 2016-06-07 08:40:38 +02:00
Jørgen Kvalsvik
0e5d705bd2 Store schedule ref for cleaner access. 2016-06-07 08:40:38 +02:00
Jørgen Kvalsvik
99e8eefd21 More intuitive order of rates in data::Wells 2016-06-07 08:40:38 +02:00
Jørgen Kvalsvik
8cf6617dc8 data::Wells::emplace 2016-06-07 08:40:38 +02:00
Jørgen Kvalsvik
72d27d663a Enable Summary support in EclipseWriter 2016-06-07 08:40:38 +02:00
Jørgen Kvalsvik
887491e851 Summary takes secs_elapsed, not per-step duration
To stay consistent with the interface exposed by the other
eclipse-writer components, the summary facilities takes its time elapsed
since simulation start, not on a per-step basis.
2016-06-07 08:40:38 +02:00
Jørgen Kvalsvik
bb6b6f535a Remove outdated comments 2016-06-07 08:40:38 +02:00
Jørgen Kvalsvik
6c8e3434d2 Rewrite support for reading restart files
The support for reading restart files has been written in order to break
the dependency on opm-core. init_from_restart_file now returns
opm-output defined data types that clients, typically simulators, can
use to populate its own internal structures at will.
2016-06-07 08:40:38 +02:00
Jørgen Kvalsvik
aa10cb8319 Remove unused multiplexer/static create feature 2016-06-07 08:40:38 +02:00
Jørgen Kvalsvik
1c89ba93a9 Replace WellState with data::Wells 2016-06-07 08:40:38 +02:00
Jørgen Kvalsvik
dcefc087a9 xwel member in Wells; init_list constructors
Adding the xwel member to data::Wells to support restart file output,
defining an exchange format with that in mind. For convenience,
introduces some initializer_list constructors as the buildup otherwise
is tedious and clumsy. Does not change much w.r.t. external interface.
2016-06-07 08:40:38 +02:00
Jørgen Kvalsvik
9a45661b36 Use unit conversion table from parser/units 2016-06-07 08:40:38 +02:00
Jørgen Kvalsvik
c81301b1fe Moved member init to initialisation list 2016-06-07 08:40:37 +02:00
Jørgen Kvalsvik
10261504de Remove unused member variables. 2016-06-07 08:40:37 +02:00
Jørgen Kvalsvik
616b95463a Remove unused headers 2016-06-07 08:40:37 +02:00
Jørgen Kvalsvik
8c9e2547be Replace phaseUsage with the raw ert mask 2016-06-07 08:40:37 +02:00
Jørgen Kvalsvik
778bed3d26 Store SimulationDataContainer for compability
In a transition period for non-eclipse output, store a pointer to the
underlying SimulationDataContainer. Should be deprecated by writing
non-eclipse output with the new input types.
2016-06-07 08:40:37 +02:00
Jørgen Kvalsvik
8776cc9c44 Output takes data::Solution over SimDataContainer
To break dependencies between modules, and to properly define the input
format for the output facilities, make writeTimeStep take data::Solution
over SimulationDataContainer.
2016-06-07 08:40:37 +02:00
Jørgen Kvalsvik
3a81e1bd3b writeTimeStep takes time parameters explicitly
Removes the dependency on SimulationTimerInterface, and instead expects
to get the raw values from caller.
2016-06-07 08:40:37 +02:00
Jørgen Kvalsvik
3a8c203ed4 Remove old Summary support. 2016-06-07 08:40:37 +02:00
Jørgen Kvalsvik
3bbdbf888f Remove SimulationTimer from RFTWriter 2016-06-07 08:40:37 +02:00
Jørgen Kvalsvik
94f0dd92ed Replace SimulationTimer with time_t in writeInit
Instead of passing a massive and complex instance around, reduce
dependencies by directly passing the interesting time values to
writeInit.
2016-06-07 08:40:37 +02:00
Jørgen Kvalsvik
e913a0cb31 Output format for cell data. 2016-06-07 08:40:37 +02:00
Joakim Hove
bbe67c01aa Merge pull request #828 from qilicun/log-vfp-messages
Write the VFP testing information into Debug file.
2016-06-06 14:43:10 +02:00
Liu Ming
8d59f6d3d8 remove unused method. 2016-06-06 13:48:47 +02:00
Liu Ming
9a23157b6a Write the VFR testing information into Debug file. 2016-06-06 12:26:26 +02:00
Jørgen Kvalsvik
744d2ee773 Remove IOConfig use in Schedule 2016-06-06 11:04:27 +02:00
Jørgen Kvalsvik
58d206f3b0 Comments in IOConfig. 2016-06-06 11:04:27 +02:00
Jørgen Kvalsvik
dcb291fa4d Remove magic numbers.
Prefer named indices in the integer lists when they are used in favour
of mnemonics.
2016-06-06 11:04:27 +02:00
Jørgen Kvalsvik
edb8cdc72d IOConfig creates TimeMap independently of Schedule
Completely remove the dependency between Schedule and IOConfig. IOConfig
will generate its own instance of TimeMap, rather than relying on
Schedule to construction and keeping it alive.
2016-06-06 09:04:30 +02:00
Jørgen Kvalsvik
4dfdf7ad7c IOConfig sets restart info, not Schedule
Break the cyclic dependency between IOConfig and Schedule where Schedule
updated parts of IOConfig. Instead, IOConfig completely builds its own
restart config.

Tests are updated to reflect this.
2016-06-06 09:04:30 +02:00
Jørgen Kvalsvik
e9ed9cda1b Remove Schedule::createTimeMap 2016-06-06 09:04:30 +02:00
Jørgen Kvalsvik
e7be3ebab5 Move initFromDeck into constructor 2016-06-06 09:04:30 +02:00
Jørgen Kvalsvik
8a38189c69 Simplify internal schedule IOConfigSettings loop 2016-06-06 09:04:30 +02:00
Jørgen Kvalsvik
469f33c575 Defaults for IOConfig; add string constructor
Brings back the Deck-less constructor for IOConfig, but leveraged by
default values for most members.
2016-06-06 09:04:30 +02:00
Jørgen Kvalsvik
f79f40802a IOConfig constructor accept Deck, use init list
IOConfig's string constructor has been deprecated in favour of accepting
a Deck. handleGridSection and handleRunspecSection been moved into the
constructor itself. This clarifies the *actual* dependency in expected
IOConfig usage.
2016-06-06 09:04:30 +02:00
Joakim Hove
1ac0de0d1e Merge pull request #815 from jokva/input-stack-std-stack
Implement InputStack with std::stack
2016-05-31 10:48:04 +02:00
Joakim Hove
a6e9f7a3b0 Merge pull request #817 from joakim-hove/eclipsegrid-copy
EclipseGrid copy constructor.
2016-05-28 08:06:14 +02:00
Joakim Hove
152069351c Added EclipseGrid::activeIndex( ) NB: throws!! 2016-05-27 15:14:40 +02:00
Joakim Hove
0792121bec EclipseGrid copy constructor.
Removed EclipseGrid::EclipseGrid( ecl_grid_type * )
2016-05-27 15:14:39 +02:00
Joakim Hove
0986d49c05 Small test of fun::map and fun::concat. 2016-05-27 09:18:39 +02:00
Joakim Hove
0289349ddb Merge pull request #819 from jokva/ecl-kw-changed-interface
Removed unused EclKW.
2016-05-26 13:27:33 +02:00
Jørgen Kvalsvik
ae8769ff7c Removed unused EclKW. 2016-05-26 09:22:07 +02:00
Magne Sjaastad
f66294832c VS2015 : Workaround for VS2015 compiler bug 2016-05-25 16:23:09 +02:00
Atgeirr Flø Rasmussen
3953869953 Use class scope (::) rather than access enum as member. 2016-05-25 11:36:44 +02:00
Magne Sjaastad
4186ce5a11 VS2015: Test for MSVC when guarding compiler flags 2016-05-25 10:39:19 +02:00
Magne Sjaastad
fafd718789 VS2015: Must name all BOOST_TEST_MODULE to be able to compile 2016-05-25 10:39:19 +02:00
Magne Sjaastad
d51645db72 VS2015 : Use generic_string in generated filenames 2016-05-25 10:39:19 +02:00
Magne Sjaastad
1f91ae2b09 VS2015 : Added include to math 2016-05-25 10:39:19 +02:00
Magne Sjaastad
85e3ae61b3 VS2015 : Added missing include to cctype 2016-05-25 10:39:19 +02:00
Magne Sjaastad
393bdb42f2 VS2015 : Added missing include to ssize_t 2016-05-25 10:39:19 +02:00
Jørgen Kvalsvik
210629aba0 Use UnitSystem::to/from_si over conversion_table
Keep up with a change in opm-parser which moves this functionality into
UnitSystem.
2016-05-24 14:26:36 +02:00
Jørgen Kvalsvik
726b0d0957 Implement InputStack with std::stack
Save some implementation by using std::stack as interface and
implementation for InputStack. Remove the vector pair of file and file*
and just use file directly.
2016-05-24 12:40:40 +02:00
Joakim Hove
bcc4183236 Merge pull request #32 from jokva/summary-correct-inj-prod
Write rates/totals correctly
2016-05-24 11:50:33 +02:00
Joakim Hove
21de4055bc Merge pull request #814 from jokva/unit-system-improvements
Unit system improvements
2016-05-24 11:48:54 +02:00
Jørgen Kvalsvik
289021d823 Grouped tests into fewer, more elaborate cases
The tests requires some boilerplate setup and quickly became slow to
maintain and run. Rewrite so that the tests are grouped on topic instead
of immediate keyword family.
2016-05-24 10:31:14 +02:00
Jørgen Kvalsvik
d27b3db9fd Injection rate tests 2016-05-24 10:31:14 +02:00
Jørgen Kvalsvik
6cfb52ae69 Summary: Production is negative injection.
Represent simulator-provided data as production = negative injection,
and write rates accordingly. Tests updated.
2016-05-24 10:31:07 +02:00
Joakim Hove
5cf9932b1d Refactored Eclipse3DProperties
- Moved the handling of keywords from Eclipse3DProperties to
   GridProperties<T>.

 - The GridProperty<T> postprocessor is invoked from
   GridProperties<T>::getKeyword() method. The question of whether the
   postprocessor should be invoked or not is determined by the
   overload:

     public:
       const GridProperty<T>& getKeyword(const std::string) const;

     private:
       GridProperty<T>& getKeyword(const std::string);

   The public const overload will run the postprocessor, whereas the
   non-const private overload should (will) be used in the construction
   phase and should not invoke the post processor.

 - The two pass passing where we first internalize integer keywords and
   then floating point keywords has been removed.

 - Code in GridProperties has mainly been moved to GridProperties.cpp
   with explicit instantiation for int and double.
2016-05-24 09:50:15 +02:00
Joakim Hove
5ff1297b57 Merge pull request #31 from jokva/summary-without-boost
Remove boost from Summary; use posixStartTime
2016-05-24 09:03:40 +02:00
Joakim Hove
1a0a822cbb Renamed member variable. 2016-05-24 08:50:56 +02:00
Joakim Hove
8f70ee7d0b Removed GridProperties::getKeyword( size_t ) 2016-05-24 08:50:56 +02:00
Joakim Hove
c7d4c7fff2 Added ACTNUM postprocessor.
Added a post processor to the ACTNUM property which will set ACTNUM to
zero for all cells with PORV == 0.
2016-05-24 08:50:56 +02:00
Joakim Hove
4c610eb040 GridProperty::runPostProcessor() is public. 2016-05-24 08:50:56 +02:00
Joakim Hove
58f9837eac Call resetACTNUM() unconditionally. 2016-05-24 08:50:56 +02:00
Joakim Hove
3035a89b71 Add test of PORO == 0 -> ACTNUM = 0 behavior. 2016-05-24 08:50:56 +02:00
Jørgen Kvalsvik
5dde6323e8 Alternative 'getUnits' to 'getDeckUnitSystem'
getDeckUnitSystem largely implies getting an *identifier* to the unit
system used in the deck, where the actual object returned has conversion
features to/from SI as well. Augment EclipseState's interface with the
simpler getUnits name.
2016-05-23 15:12:12 +02:00
Jørgen Kvalsvik
1c7e7e08c6 Move to_si/from_si into UnitSystem
UnitSystem already offered similar functionality, but via string-map
lookup and a very clunky interface. Offer simple to/from methods as an
addition.
2016-05-23 15:11:33 +02:00
Jørgen Kvalsvik
6affc5f9c1 Split Well/Group; ignore unknown names
Occasionally the SUMMARY section requests wells or groups that aren't
defined in the Deck. Ignore these names (which would typically crash
downstream) and carry on.
2016-05-23 10:32:41 +02:00
Joakim Hove
6882311984 Merge pull request #810 from jokva/schedule-posix-start-time
Support Schedule::posixStartTime()
2016-05-19 14:07:28 +02:00
Joakim Hove
fe3bf63bd2 Merge pull request #27 from pgdr/nnc-structure
Added support for writing NNC information
2016-05-19 13:44:23 +02:00
Joakim Hove
5ef7519115 Merge pull request #806 from pgdr/nnc-input
Renamed getNNC() to getInputNNC() avoids confusion
2016-05-19 13:44:06 +02:00
Jørgen Kvalsvik
b32c9130a0 Remove defaultStartDate as a public property 2016-05-19 12:39:22 +02:00
Jørgen Kvalsvik
203557cb29 Remove boost from Summary; use posixStartTime 2016-05-19 12:22:22 +02:00
Jørgen Kvalsvik
a44679f58e Support Schedule::posixStartTime()
Allow clients to query time as time_t, not boost::posix::ptime
2016-05-19 12:15:51 +02:00
Pål Grønås Drange
ded7759e10 Merge pull request #809 from jokva/eclipse-state-copy-unit-system
EclipseState stores copy of Deck's UnitSystem
2016-05-18 12:09:39 +02:00
Jørgen Kvalsvik
92656f7e6a EclipseState stores copy of Deck's UnitSystem
With the introduction of Parser::parse methods and the relaxed lifetime
requirement of Deck (i.e. users no longer need to keep a Deck instance
around for EclipseState to be considered valid), the UnitSystem cannot
be a reference, but must rather be stored.

Since the unit system is immutable once the deck is read this is
unproblematic. It's also small and cheap to copy.
2016-05-18 09:39:14 +02:00
Liu Ming
cb74ccf589 adapt API changes in ParseContext. 2016-05-14 09:15:27 +02:00
Liu Ming
ca085fa6a2 remove ParseContext. 2016-05-14 09:15:26 +02:00
Liu Ming
14c33394f4 add MessageContainer argument for logging messages. 2016-05-14 08:42:40 +02:00
Liu Ming
c8625b2fc0 log messages to message container. 2016-05-14 08:42:40 +02:00
Liu Ming
e538ed43dc log messages before handleError. 2016-05-14 08:42:40 +02:00
Pål Grønås Drange
607e4e2b9a Renamed getNNC() to getInputNNC() avoids confusion
* The NNC in the eclipse state is and will always be the nnc from deck
* updated tests
2016-05-13 14:09:29 +02:00
Joakim Hove
e20bdc3788 Merge pull request #805 from totto82/add_spe9_cp_group
Add SPE9_CP_GROUP as test case for the parser
2016-05-13 11:04:47 +02:00
Tor Harald Sandve
7f7c840364 Add SPE9_CP_GROUP as test case for the parser 2016-05-12 11:37:04 +02:00
Jørgen Kvalsvik
dfb9a629e4 Support for eclipse -> SI unit conversions 2016-05-12 11:30:51 +02:00
Joakim Hove
64fe528f6d Merge pull request #801 from pgdr/deckkeyword-throw-name
Throw now contains name() of deckKeyword
2016-05-10 15:23:04 +02:00
Pål Grønås Drange
3124c9569c Throw now contains name() of deckKeyword 2016-05-10 14:45:35 +02:00
Jørgen Kvalsvik
99829e1696 Ignore RPTONLY 2016-05-10 14:43:19 +02:00
Jørgen Kvalsvik
40e48af625 Moved SI-to-metric/field to opm-parser 2016-05-10 13:55:57 +02:00
Pål Grønås Drange
9f3a5d3304 Added SI conversion for NNC output 2016-05-10 10:40:05 +02:00
Jørgen Kvalsvik
42992d9b91 Add missing member constructor call. 2016-05-10 10:08:29 +02:00
Joakim Hove
afc76ccd7e Merge pull request #797 from jokva/summary-config-from-eclipsestate
Summary config from eclipsestate
2016-05-10 09:55:11 +02:00
Pål Grønås Drange
bd5df6a247 Added writing of NNC
* Writer takes NNC argument
* Sets NNC info to ecl_self_add_nnc
* Writes TRANNNC to INIT
* Writes NNCHEAD, NNC1 and NNC2 to EGRID
2016-05-09 16:55:10 +02:00
Jørgen Kvalsvik
822ac1bcb2 SI-to-unitsystem conversion tables. 2016-05-09 15:10:23 +02:00
Jørgen Kvalsvik
3106e6ae8a Create SummaryConfig object in EclipseState 2016-05-09 15:10:21 +02:00
Jørgen Kvalsvik
00066e225f Special-case handling of RUNSUM keyword
The RUNSUM keyword is identified as a Region-type keyword, but isn't
really. It's to be ignored by the SummaryConfig construction.
2016-05-09 15:09:43 +02:00
Jørgen Kvalsvik
63fd998e2a Allow Section objects to be empty
Preserves expect Deck-like behaviour by allowing empty sections.
2016-05-09 15:09:43 +02:00
Jørgen Kvalsvik
79a8f6efc5 Clean up initialisation order in EclipseState
The previous order was inaccurate and confusing. Clean up member and
initialisation order to more closely reflect the actual intent and
behaviour.
2016-05-09 15:09:42 +02:00
Jørgen Kvalsvik
0aa3e533f8 Remove unused EclipseGrid argument from Compsegs 2016-05-09 14:56:04 +02:00
Jørgen Kvalsvik
caa10631b0 IOConfig::handle* takes references over shared_ptr 2016-05-09 14:56:04 +02:00
Jørgen Kvalsvik
1d5ae5ea55 EclipseGrid::getNXYZ which returns xyz as array 2016-05-09 14:55:24 +02:00
Jørgen Kvalsvik
ee8710d3cb SummaryConfig does not require EclipseState
Rewrite construction to accept EclipseState components instead of the
full state. Enables having SummaryConfig as a member in EclipseState.
2016-05-09 14:55:24 +02:00
Jørgen Kvalsvik
28ae15cf0f Move getRegions into 3DProperties 2016-05-09 14:55:24 +02:00
Joakim Hove
3289b046c3 Check deck for ACTNUM keyword. 2016-05-09 09:44:31 +02:00
Pål Grønås Drange
091dc196f3 Added parse functions for Parser, for simpler creation of state and grids 2016-05-06 12:21:41 +02:00
Pål Grønås Drange
b8b1ba9528 ParseContext is now a member of EclipseState
* EclipseState now copies input ParseContext and keeps it as member
* Made the argument (ParseContext) default as ParseContext()
* Now you can make a new EclipseState with only deck as argument
* Removed test that tested address equality of ParseContext objects
2016-05-06 11:37:26 +02:00
Joakim Hove
350297e8ec Merge pull request #792 from jokva/bugfixes
Bugfixes
2016-05-04 09:30:30 +02:00
Jørgen Kvalsvik
1f2c2ba98d Name cases where TITLE is unset
When the TITLE keyword was present in the deck, but no parameter was
given the parser would consume the next keyword as the simulation TITLE.
Override this by writing a default TITLE if it's unset.
2016-05-03 15:42:30 +02:00
Pål Grønås Drange
672b240e00 fixed bug in Parser, use openRootFile 2016-05-03 15:22:34 +02:00
Pål Grønås Drange
d9eb3ebf86 Added test for IOConfigBaseName and fixed a self-introduced bug in E.S. 2016-05-03 14:07:01 +02:00
Jørgen Kvalsvik
0966a9cb8c Fix RawKeywor tests to reflect assumptions 2016-05-03 13:39:36 +02:00
Pål Grønås Drange
3a3ec10649 moved initialization of primary's to header, fixed rebase 2016-05-03 13:22:57 +02:00
Pål Grønås Drange
5a7dcc5427 Made FaultCollection reference in State thereby fixing compiler warn 2016-05-03 13:22:57 +02:00
Pål Grønås Drange
63e452167c Introduce deckptr-less EclipseState and EclipseGrid 2016-05-03 13:22:56 +02:00
Jørgen Kvalsvik
41fc16ad92 Keep ParserKeyword instances; internalName removed
Internal names are deprecated, and instead added ParserKeyword instances
are maintained and kept for the lifetime of the ParserKeyword instance.
Querying keyword existence from python picks up on Deck names, expected
to always be the intended case, instead of internal names.
2016-05-03 12:59:57 +02:00
Jørgen Kvalsvik
ba5983483e Throw on error from fread 2016-05-03 09:30:57 +02:00
Jørgen Kvalsvik
dcc3668fdd Rename strip_after -> find_terimnator 2016-05-03 09:30:57 +02:00
Jørgen Kvalsvik
8cb64dad72 Encapsulate ParserState's internals. 2016-05-03 09:30:57 +02:00
Jørgen Kvalsvik
ff301622b6 Append newline to input; remove branch in getline
By allowing getline to assume that the next line always starts after the
found \n *or* that after the found newline is the \0, we can avoid a
branch and potential stall.
2016-05-03 09:30:57 +02:00
Jørgen Kvalsvik
8014ec817c Prefer empty over size 2016-05-03 09:30:56 +02:00
Jørgen Kvalsvik
a7d18cd8df Reindentation. 2016-05-03 09:30:56 +02:00
Jørgen Kvalsvik
de3db110c9 Replace static with anon namespace
This is done to hide symbols such as class definitions in addition to
functions.
2016-05-03 09:30:56 +02:00
Jørgen Kvalsvik
de691c0bd5 Replace ParserState shared_ptr with auto var 2016-05-03 09:30:56 +02:00
Jørgen Kvalsvik
64291e6cca Moved parseState out of Parser; source-file only
This function is not an obvious member of Parser, as it is just as
reliant on ParserState which is source-file private to Parser. Moves to
source file only, without externally-visible private symbol table entry.
2016-05-03 09:30:56 +02:00
Jørgen Kvalsvik
9031ca9406 Make tryParseKeyword/createRawKeyword non-visible
tryParseKeyword and createRawKeyword don't use anything non-public and
does not rely on any non-public parser state, so they are now
implemented as functions private/static in Parser.cpp
2016-05-03 09:19:23 +02:00
Jørgen Kvalsvik
6df67c7de2 Encapsulate getline behaviour onto ParserState
A getline implementation that carries mostly the same assumptions as
istream::getline. Requires ParserState::done() to always be checked (for
negative) to safely retrieve the next line.

Enables tryParseKeywords and friend to only maintain a high level view
of the parsing procedure, and not deal with stream positioning.
2016-05-03 09:19:23 +02:00
Jørgen Kvalsvik
9cf2c9fd98 Formalised stack semantics for input in parser
Moves the storage/lifetime components of ParserState into its own
helper utility class. Splits the implementation responsibility so that
all input data and state is handled by the InputStack, and "global"
information is managed directly by ParserState.
2016-05-03 09:19:22 +02:00
Jørgen Kvalsvik
120a30e94b Replace std::isspace in parser; add \r to is_sep 2016-05-03 09:16:28 +02:00
Jørgen Kvalsvik
1622a5bd49 Use explicit loop invariant in loadFromDeckKeyword
gcc doesn't seem to do this for us.
2016-05-03 09:16:28 +02:00
Jørgen Kvalsvik
784a1a5d78 Replace std::isspace with hand-rolled version
Profiling indicate isspace isn't inlined properly, so we replace it with
a hand-rolled easier-to-inline version.
2016-05-03 09:16:28 +02:00
Jørgen Kvalsvik
60c20f8057 Explicitly store loop invariants in assertSIData
Profiling shows that gcc isn't recognising these as loop invariants, so
we help it a little bit by explicitly storing them.
2016-05-03 09:16:28 +02:00
Jørgen Kvalsvik
8a4eb5279c Splitting records with string_view; test updates
The splitting of RawRecords into individual symbols uses string_view.
Also updates tests since RawRecord now assumes that the record string it
receives is complete and does *not* contain the terminating slash.
2016-05-03 09:16:28 +02:00
Jørgen Kvalsvik
a105f3a193 string_view char* constructor 2016-05-03 09:16:28 +02:00
Jørgen Kvalsvik
c2b5da457c Re-implement is_separator to use isspace 2016-05-03 09:16:28 +02:00
Jørgen Kvalsvik
07eea89c34 Remove redundant overloads
These overloads were written to allow testing, but with string_view
accepting char* they're unecessary and confusing.
2016-05-03 09:16:28 +02:00
Jørgen Kvalsvik
6b64796d49 Add char* constructor to string_view
Mostly relevant for testing, this enables string_view to work as
expected with string literals.
2016-05-03 09:16:28 +02:00
Jørgen Kvalsvik
bfa3f799b9 Improved fast path in number parsing
Since string_view uses char* for representation, there is no longer a
need to copy into a local char array for most code paths (only when the
input must be modified due to fortran float formatting).
2016-05-03 09:16:28 +02:00
Jørgen Kvalsvik
b648719513 Base string_view on char*, not string::iterator
By representing string_view as char* instead of
std::string::const_iterator the string_view class bring possibly
slightly lower overhead, but mostly enables some optimisations.
2016-05-03 09:16:27 +02:00
Jørgen Kvalsvik
bda128ee23 front/back support in string_view 2016-05-03 09:16:27 +02:00
Jørgen Kvalsvik
cb29336a44 Remove all non-data before parsing begins
Perform a pre-pass over the input and remove everything that isn't
interesting. Preserves empty lines to provide accurate line number for
diagnostics/error output.
2016-05-03 09:16:27 +02:00
Jørgen Kvalsvik
a1ae0e0067 Updated various functions to accept string_view
To take advantage of parser's internal string_view representation of
keyword names, several signatures have been updated to accept
string_view.
2016-05-03 09:16:27 +02:00
Jørgen Kvalsvik
82b1901841 Parser keyword maps uses string_view for keys
The use of string_view for keys allows comparison with keywords from the
file buffers to be compared directly, instead of having to go via
std::string. This removes the need for a series of (inherently)
unecessary copies.
2016-05-03 09:16:27 +02:00
Jørgen Kvalsvik
a93507087d string_view operator< and operator== support
In order for string_view to be useful as container member and sorting,
it has to support operator< and operator==
2016-05-03 09:16:27 +02:00
Jørgen Kvalsvik
096e843d08 Moved special-casing of TITLE to RawKeyword
Replaces the special-casing of the TITLE keyword where a terminating
slash is added onto the record with a non-mutating version.
2016-05-03 09:16:27 +02:00
Jørgen Kvalsvik
7d29d63bea Replace string with string_view in inner parser
Several inner parser functions modified to use string_view, to reduce
unecessary copying (and indirectly allocationg) related to passing
strings around.
2016-05-03 09:16:27 +02:00
Jørgen Kvalsvik
1edc6887be Replace parser stringstreams with string_view
Replaces the parser's dependence on streams with string_view, which
won't copy to its internal buffers. Involves hand-rolling std::getline
for string_view to preserve stream-like behaviour.
2016-05-03 09:16:27 +02:00
Jørgen Kvalsvik
e5ee6105b7 Remove parseStream support; strict input reading
Replaces the external stream-support by reading the entire contents of
input files at once, rather than lazily through streams. Uses
stringstreams internally, but keeps the entire file in memory through
std::string

openString/File has been renamed to loadString/File
2016-05-03 09:16:27 +02:00
Jørgen Kvalsvik
db6bb58f60 Remove redundant application of uppercase()
When considering if a keyword is valid, the parser procedures convert
the same string to uppercase twice, with copies. This behaviour has been
changed, and ParserKeyword now assumes it will be given a
correctly-formatted keyword to look up.
2016-05-03 09:15:46 +02:00
Jørgen Kvalsvik
4d7f97d322 Refactor ParseState to use explicit stack
Rewrites ParseState to use an explicit stack of open file streams
instead of spawning multiple ParseState objects. While recursion is
*the* most elegant to solve a typical include-file system, the global
nature of eclipse declarations make this clumsy (at best). Instead,
maintain an explicit stack of open files and logically parse the input
as if it was all concatenated into one large file.

Also adds some convenient ways of accessing the current (and
interesting) top of the stack.
2016-05-03 09:15:46 +02:00
Jørgen Kvalsvik
83555a52a1 Minor restructuring in Parser::getKeyword* 2016-05-03 09:15:46 +02:00
Jørgen Kvalsvik
9ce28fb7ea Restructure addRawRecordString
Redcues indentation slightly and adds multiple return to better
communicate that some conditions actually logically terminate at several
points.
2016-05-03 09:15:45 +02:00
Jørgen Kvalsvik
58489ca571 Restructured control flow of ParserKeyword::equal 2016-05-03 09:15:45 +02:00
Jørgen Kvalsvik
48e741efb6 ParserKeyword::parse restructure control flow
Reduce the number of concurrent branches and remove a seemingly
redundant check.
2016-05-03 09:15:45 +02:00
Jørgen Kvalsvik
3f3cb8c313 validDeckName uses all_of
Favours std::algorithm over hand-written loop.
2016-05-03 09:15:45 +02:00
Jørgen Kvalsvik
76336e2047 getDeckName without boost; uses range copy
Deprecates boost::trim in ParserKeyword and replaces it with range
search and copy.
2016-05-03 09:15:45 +02:00
Jørgen Kvalsvik
d385275c5b Reformulated validInternalName with iterators 2016-05-03 09:15:45 +02:00
Jørgen Kvalsvik
6780202352 Simplify hasDimension 2016-05-03 09:15:45 +02:00
Jørgen Kvalsvik
fb8e8b09c1 Parser::applyUnitsToDeck restructured control flow 2016-05-03 09:15:45 +02:00
Jørgen Kvalsvik
02e9b50df9 Deck::iterator support
Add support for iterators that support mutations, which are useful for
the Deck assembly stage.
2016-05-03 09:15:45 +02:00
Jørgen Kvalsvik
cb8e21de01 Restructure createRawKeyword.
Restructures createRawKeyword to use multiple return statements over
if-else and updating variables, reducing indentation to have fewer
contemporary branches.
2016-05-03 09:15:23 +02:00
Jørgen Kvalsvik
bdce26480a createRawKeyword return on unmet preconditions
Changes the control flow of Parser::createRawKeyword to return on
failing to meet preconditions, rather than if-else block. Reduces
indentation and concurrent code paths.
2016-05-03 09:15:23 +02:00
Jørgen Kvalsvik
1330bfc681 parseState use return over break for control flow
Makes the actual effects of the various condtions more clear by
emphasising the return of the function rather than some possible action
after the loop.
2016-05-03 09:15:23 +02:00
Jørgen Kvalsvik
28f297f854 Reduce indentation in parseState
Restructures the per-iteration check of whether or not to continue
parsing to happen first and be an early-break, instead of this flow
being handled by if-else.
2016-05-03 09:15:23 +02:00
Jørgen Kvalsvik
86a5a89429 ParseState early abort over if-else
A small syntactic change that reduces indentation by a level. Checks the
preconditions first and throws if they aren't met (i.e. stream is
broken).
2016-05-03 09:15:23 +02:00
Jørgen Kvalsvik
033223720a trim_right replaced by trim
Augment trim_right with the dual trim_left and their composition trim
which strips all spaces from either side before the RawKeyword stage
starts.
2016-05-03 09:15:23 +02:00
Jørgen Kvalsvik
4b4d2c02c0 Reimplementation of stripComments
The implementation has been rewritten to use iterators and renamed for
internal use. The public static function still exists for testability
and easy verification, but should be considered an internal part of the
parser.
2016-05-03 09:15:22 +02:00
Jørgen Kvalsvik
bfb7f6ec0c RawRecord internals use ranges over string methods
Rewrites the internal string mainpulation functions of RawRecord to use
std::algorithm and ranges over string methods.
2016-05-03 09:15:22 +02:00
Joakim Hove
1db2c7c69c Merge pull request #21 from kjellkongsvik/remove_parameters_from_EclipseWriter
Remove parameters from eclipse writer
2016-05-02 15:00:16 +02:00
Kjell W. Kongsvik
db7958d439 Return type -> const & 2016-05-02 10:13:28 +02:00
Kjell W. Kongsvik
929e470af0 Set basename so that there is a filename to create 2016-05-02 10:07:04 +02:00
Kjell W. Kongsvik
34dbf826de Support explicit setting of BaseName
Needed when reading deck from string and trying to write to disk.
If this is not set there is no baseName to base the file name on.
2016-04-29 16:04:16 +02:00
Kjell W. Kongsvik
8cc923e2b4 Use tmp area for running EclipseWriterIntegration test
Due to old files on disk test did not fail as it should have
2016-04-29 15:45:40 +02:00
Kjell W. Kongsvik
d248ef304f Added missing test file 2016-04-29 14:15:20 +02:00
Kjell W. Kongsvik
e7454e69db Remove phaseUsage parameter, get it from eclipseState 2016-04-29 14:15:20 +02:00
Kjell W. Kongsvik
db87f24ebb Revert back code so that output grid is not recreated unsafely
Readded necessary parameters for this
2016-04-29 14:15:20 +02:00
Kjell W. Kongsvik
9c78c11972 Use getBaseName() not getDeckFileName
The check of .DATA suffix is not needed
2016-04-29 14:15:20 +02:00
Kjell W. Kongsvik
85caa436ee Cleanup of comparisons when restoring 2016-04-29 14:15:20 +02:00
Kjell W. Kongsvik
8aa3526f82 Improved refactoring of EclipseReadWriteWellStateData 2016-04-29 14:15:20 +02:00
Kjell W. Kongsvik
35e7507f3e Refactored tests
Move 2 decks from strings to seperate files

Started to make test_writeReadRestartfile more simple
2016-04-29 14:15:20 +02:00
Kjell W. Kongsvik
bd1d8dc576 Removed parameters to EclipseWriter
Paramater::ParameterGroup& params and numCells and compressedToCartesianCellIndex
These are now stored in the IOconfig object
2016-04-29 14:15:20 +02:00
Kjell W. Kongsvik
d622f6e04b Removed compressedToCartesianCellIdx parameter
Noted that internal calculation of compressedToCartesianCellIdx should be done in EclipseGrid
2016-04-29 14:15:20 +02:00
Kjell W. Kongsvik
c6bfcef5e6 Removed numCells parameter 2016-04-29 14:15:20 +02:00
Atgeirr Flø Rasmussen
1867e7199d Const has no effect in by-value return. 2016-04-29 13:58:19 +02:00
Atgeirr Flø Rasmussen
28d6237749 Silence warning in brace-init of std::array. 2016-04-29 13:45:26 +02:00
Joakim Hove
d86343f8a5 Merge pull request #784 from kjellkongsvik/clean_EclipseWriter
Clean eclipse writer
2016-04-29 11:42:41 +02:00
Kjell W. Kongsvik
bedd431b10 Use path of input as default output path
Custom output path can be set explicitly using IOConfig::setOutputDir(path)
2016-04-29 11:24:48 +02:00
Jørgen Kvalsvik
8b5d067f64 Completions mapped on active_index 2016-04-29 09:28:13 +02:00
Joakim Hove
bc000899c8 Merge pull request #777 from joakim-hove/ignore-skiprest
Ignore skiprest
2016-04-28 22:20:44 +02:00
Jørgen Kvalsvik
dcdcf99758 Support and tests for history matching G-keywords 2016-04-28 16:20:03 +02:00
Kjell W. Kongsvik
65277fcc9f Removed getDeckFileName as the usage of it in EclipseWriter is not needed
Remove in opm-output
2016-04-28 16:19:56 +02:00
Joakim Hove
c8a059db67 Added NUMRES keyword. 2016-04-28 16:04:23 +02:00
Joakim Hove
d32b409c27 Added Eclipse3DProperties PRESSURE, SGAS & SWAT. 2016-04-28 16:03:29 +02:00
Joakim Hove
25ef8781c9 Added ability to set restart parameters. 2016-04-28 16:03:29 +02:00
Jørgen Kvalsvik
d8b9c88164 Well Injection history matching unit tests 2016-04-28 15:42:28 +02:00
Joakim Hove
6d0d0280bc Merge pull request #781 from joakim-hove/deck-use-warning
Emit compiler warning when including Deck.hpp
2016-04-28 15:42:09 +02:00
Kjell W. Kongsvik
b3b8cebeff Simplified deck filename handling. Only set filename if successfully opened 2016-04-28 15:42:07 +02:00
Jørgen Kvalsvik
e4c3bbd958 Fix oil/gas injection lookups being switched. 2016-04-28 15:41:41 +02:00
Kjell W. Kongsvik
79ab818c3a Default output dir is current active directory
Optionally specify using IOCondig::setOutputDir()
2016-04-28 13:45:09 +02:00
Kjell W. Kongsvik
5fb3a6fc53 Add dataFile to Deck if loaded from file
If loaded from string keep empty
2016-04-28 13:45:08 +02:00
Kjell W. Kongsvik
1640ad0826 Removed meaningless "path" paramater in tests
This parameter will be used in a more meaningful way
2016-04-28 13:45:08 +02:00
Kjell W. Kongsvik
206e16fba5 Added fields to IOConfig so parameters can be removed from EclipseWriter
std::string     m_deck_filename;
bool            m_output_enabled;
std::string     m_output_dir;
2016-04-28 13:45:08 +02:00
Jørgen Kvalsvik
715fd6ff78 Fix signature; pass vector ref to group_wells 2016-04-28 10:50:51 +02:00
Jørgen Kvalsvik
5266fa213a GWIT support 2016-04-28 10:49:19 +02:00
Jørgen Kvalsvik
d7c5a43226 WGLR+WGLRH support 2016-04-28 09:46:01 +02:00
Jørgen Kvalsvik
eb7f6afae6 Rename gor to glr
This function doesn't care if the liquid is pure water, pure oil or a
mixture.
2016-04-28 09:44:57 +02:00
Joakim Hove
54579155a1 Merge pull request #782 from jokva/grid-properties-std-function
Refactor GridPropertyInitializers to use std::function
2016-04-28 09:02:25 +02:00
Pål Grønås Drange
e1ab313cb7 Added method getIJK in EclipseGrid 2016-04-27 12:55:14 +02:00
Jørgen Kvalsvik
e7bdb796da Replace boost::lexical_cast with std::to_string 2016-04-27 11:51:45 +02:00
Jørgen Kvalsvik
eb1182da27 Moved temp init into GridProperty
The GridPropertyInitializers files now really only held the temperature
initialisation function, and has been merged into GridProperty.
2016-04-27 11:51:45 +02:00
Jørgen Kvalsvik
0889c8c286 Bind parameters individually to init/post hooks
With the inflexible GridProperty*Function replaced with std::function,
bind parameters individually to each property, indicating exactly what
dependencies any function has.
2016-04-27 11:51:45 +02:00
Jørgen Kvalsvik
5f22a99a96 Replace Grid*Function with std::function
Replaces the home-grown capturing function object with std::function.
Using the library provided std::function enables creating the objects
via std::bind, enabling non-uniform signatures and relieves us of a
maintenance burden.
2016-04-27 11:51:45 +02:00
Joakim Hove
22c766acf8 Merge pull request #779 from jokva/group-get-wells-method
Adds Group::getWells method
2016-04-27 11:30:29 +02:00
Jørgen Kvalsvik
885ed13fa0 Precompute string-to-enum mapping of keywords
By precomputing and storing the keyword-to-enum mapping, accessing and
writing to a node overhead changes from log(N) to constant, and should
behave better w.r.t. cache and memory access.
2016-04-27 10:50:33 +02:00
Jørgen Kvalsvik
107015a57c Unsupported keywords write negative values
This provides easier-to-identify behaviour than simply writing zero and
going on its merry way.
2016-04-27 10:50:33 +02:00
Jørgen Kvalsvik
a0706a32af Replace silent wrong default with throw
Not asking sum_rate/vol for wat/oil/gas is a programmer error in the
library and shouldn't happen, but is unfortunately unverifiable with the
current tooling. The fall-through now signals a runtime error instead of
silently returning the wrong value.
2016-04-27 10:50:33 +02:00
Jørgen Kvalsvik
e84c888d72 Support for SUMMARY configured output G-keywords
Add support for a set of G-family summary keywords; productions, rates
and ratios.
2016-04-27 10:50:33 +02:00
Jørgen Kvalsvik
bf7217139d Rename wwct/wgor to wct/gor
These functions don't care if the source is a well, group or region, so
they've been renamed to emphasise its generality and reusability.
2016-04-27 09:54:21 +02:00
Joakim Hove
01cf268f69 Emit compiler warning when including Deck.hpp
This commit is a first step towards reducing the use of the Deck api
outside of opm-parser. Downstream modules should preferably use the
EclipseState api which is richer in features, and also easier to use
correctly.

The current form of the code is temporary, in the future we will remove
the OPM_PARSER_DECK_API_WARNING compile guard.
2016-04-26 14:00:03 +02:00
Jørgen Kvalsvik
0786ec0156 Well dispatcher use partial applications
To clarify intent and the high-level formulas used to calculate the
requested values, a series of partial applications are introduced since
most parameters to the functions are fixed from the caller.

This increases signal-to-noise ratio in the switch dispatch, at the
expense of some boilerplate before the switch itself.
2016-04-26 13:50:52 +02:00
Jørgen Kvalsvik
e7a6ae5068 RAII cleanup of test files; WRITE removed
The WRITE test was a mere convenience to create and inspect a summary
file, but this should instead be moved to applications or examples, and
out of tests. The helper class setup now has a destructor that will
automatically attempt to clean up the files produced by ert.
2016-04-26 12:24:30 +02:00
Jørgen Kvalsvik
20b5b63f72 Adds Group::getWells method
Add support for querying what wells are in a given group at a certain
time step.
2016-04-26 10:40:42 +02:00
Joakim Hove
37381af2d6 Merge pull request #772 from qilicun/remove-OpmLog
Remove OpmLog usages in Parser folder.
2016-04-26 07:51:30 +02:00
Joakim Hove
fb8c39a8c4 Using compile time constants. 2016-04-25 15:37:46 +02:00
Joakim Hove
d097f95601 Will ignore SKIPREST keyword. 2016-04-25 15:37:46 +02:00
Jørgen Kvalsvik
e09e7fea1f Support for SUMMARY configured output W-keywords
Support for the creation and output of ecl-compatible SUMMARY-section
configured files. Supports a set of Well keywords, with unit conversions
based on user request, and comes with a test suite.
2016-04-25 15:35:46 +02:00
Jørgen Kvalsvik
2d1075efcb Check argument length in string_view == char*
Not doing this opens up for undefined behaviour when char* is shorter
than view.
2016-04-25 15:20:27 +02:00
Jørgen Kvalsvik
92f7ed163c Use swap for addParserKeyword over move-assign
Using move assign triggered some invalid read/write during
construction/destruction.
2016-04-25 14:51:02 +02:00
Jørgen Kvalsvik
bd4206c4b9 Add Deck for SUMMARY unit tests. 2016-04-25 11:59:11 +02:00
Jørgen Kvalsvik
74c54a7c06 Add thp field to data::Well. 2016-04-25 11:59:01 +02:00
Jørgen Kvalsvik
ee4e447e92 Rename Summary to SummaryConfig
This object turns out to be the actual configuration object, not a
mediator state to obtain a configuration. It is therefore renamed to
reflect intent and behaviour.
2016-04-25 11:45:39 +02:00
Liu Ming
59c6569a78 Make mutable MessageContainer member, recover the const qualifier for deck. 2016-04-25 16:25:15 +08:00
Jørgen Kvalsvik
0a5c7c85f8 Fix off-by-one error in satfuncinit.
Reported by Bård Skaflestad in
https://github.com/OPM/opm-parser/issues/774.
2016-04-25 08:37:48 +02:00
Liu Ming
5720192314 remove log from cmake files. 2016-04-25 10:04:40 +08:00
Liu Ming
960e362c66 delete opmlog fro python directory. 2016-04-25 09:48:22 +08:00
Liu Ming
9ad0219603 use MessageContainer to logging. 2016-04-22 18:41:34 +08:00
Liu Ming
a4640b55bc use MessageContainer instead of OpmLog. 2016-04-22 16:51:35 +08:00
Liu Ming
52af33c7e0 remove const constrain for Deck. 2016-04-22 16:51:04 +08:00
Liu Ming
180ff7336a remove unused OpmLog headers. 2016-04-22 16:30:07 +08:00
Liu Ming
c42cfafc90 Merge remote-tracking branch 'remotes/opm/master' into MessageContainer-sub-class
Conflicts:
	opm/parser/eclipse/EclipseState/EclipseState.cpp
	opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp
2016-04-22 14:53:16 +08:00
Liu Ming
b17e11a9ad collect all the messages in intGridProperties and doubleGridProperties. 2016-04-22 14:42:24 +08:00
Atgeirr Flø Rasmussen
1c4e4bd3da Silence some shadowing warnings. 2016-04-21 09:32:25 +02:00
Atgeirr Flø Rasmussen
9e0635d62a Bugfix: actually check the passed-in properties. 2016-04-21 09:30:00 +02:00
Pål Grønås Drange
40d9a22a5f Using getInputGrid API from Parser 2016-04-19 16:52:40 +02:00
Pål Grønås Drange
444f74642c Refactored EclipseState.getEclipseGrid to getInputGrid 2016-04-19 16:47:05 +02:00
Pål Grønås Drange
aaf0a2fcbc Renamed m_eclipseGrid to m_inputGrid internally in EclipseState 2016-04-19 13:06:37 +02:00
Pål Grønås Drange
b94c554249 Added fixture Setup to ThresholdPressureTest thereby removing leaks 2016-04-19 12:43:57 +02:00
Pål Grønås Drange
ba01b7eb53 Fixes support for BOXed ACTNUM
* Added ACTNUM as keyword to Eclipse3DProperties
* Removed certain checks from EclipseGrid that are no longer of use
* Added tests to EclipseGridTests that test boxed ACTNUM and activeCells
* Made EclipseGrid non-const in EclipseState since we must run resetACTNUM
* Fixed a minor typo in an error message in EclipseGrid
* Fixed typo in GridProperty: Deckeyword -> DeckKeyword
* Fixed two errors in tests recently introduced relating to Ecl3DProps
* Removed test in EclipseGridTests; We now accept too small ACTNUM vectors
* Added ACTNUM test for GridProperties
2016-04-19 10:54:09 +02:00
Liu Ming
17918ac5b3 use proper function to log filename, line number, msg. 2016-04-19 15:06:03 +08:00
Joakim Hove
909edc694b Merge pull request #765 from joakim-hove/python-doc
WIP: Added basic Python doc.
2016-04-18 20:01:40 +02:00
Arne Morten Kvarving
5f197da8c7 changed: do not prototype boost::filesystem::path
this breaks with g++ 4.8 used in redhat builds.

/usr/include/boost148/boost/filesystem/v3/path.hpp:710:24 error: 'path'
is already declared in this scope.
2016-04-18 09:45:47 +02:00
Liu Ming
2fd5477f44 make the memeber function as non-static, use MessageContainer to replace OpmLog. 2016-04-18 15:16:09 +08:00
Liu Ming
e5eb0a7a58 remove some comments. 2016-04-18 15:13:49 +08:00
Liu Ming
dc23a3135d made the member functions as no-static, use message container instead of OpmLog. 2016-04-18 14:27:12 +08:00
Liu Ming
7ddad9bf67 assemble messages in the constructor. 2016-04-18 14:26:39 +08:00
Joakim Hove
d1e603f17c Added basic Python doc. 2016-04-18 06:51:36 +02:00
Jørgen Kvalsvik
7a75174c1e fixup! fixup! data::Wells format for simulator data exchange 2016-04-15 10:10:25 +02:00
Jørgen Kvalsvik
1e3ff7afa4 fixup! data::Wells format for simulator data exchange 2016-04-15 09:33:26 +02:00
Liu Ming
7176753297 solve conflict. 2016-04-15 09:41:45 +08:00
Liu Ming
940d7f8449 Merge remote-tracking branch 'remotes/opm/master' into MessageContainer-sub-class
Conflicts:
	opm/parser/eclipse/EclipseState/EclipseState.cpp
2016-04-15 09:14:00 +08:00
Andreas Lauser
92a55cb267 avoid reserved names for guard macros
just like for macros that start and end with `__`, `clang++
-Weverything` likes to complain about macros which start and end with
a single underscore. This is basically the same issue as
Ensembles/ert#1048
2016-04-14 17:19:37 +02:00
Atgeirr Flø Rasmussen
209d30f0d0 Silence missing-braces warning.
Can switch back when we move to C++14 uniformly.
2016-04-14 14:51:42 +02:00
Joakim Hove
098ce7b9a8 Merge pull request #734 from jokva/new-summary-keywords
New summary keywords
2016-04-14 14:07:15 +02:00
Joakim Hove
244a9f9c1d Merge pull request #720 from jokva/fipnum-register-regions
Query the name of (FIP) regions in State
2016-04-14 12:44:33 +02:00
Jørgen Kvalsvik
fba6069b7d fixup! Parser support for SUMMARY/Region keywords 2016-04-14 09:44:08 +02:00
Jørgen Kvalsvik
2b6d871242 fixup! Summary: Calculate ijk from record in function 2016-04-14 09:43:43 +02:00
Jørgen Kvalsvik
302e656ea4 fixup! Internalisation of SUMMARY C keywords 2016-04-14 09:42:36 +02:00
Jørgen Kvalsvik
a705b0750b Query all IDs of (FIP) regions in State
Enable support for querying what fluid-in-point regions are defined in
the deck. For now the only interesting regions are the ones specified by
the FIPNUM keyword in the REGIONS section.

The implementation is somewhat inefficient (n log n over the number of
cells in the grid), but since this is likely to only be called when
default-expanding SUMMARY section keywords this isn't too bad, since the
implementation is so dead simple.
2016-04-14 09:30:55 +02:00
Liu Ming
37f13e3761 Add header that removed by mistake. 2016-04-14 13:57:53 +08:00
Liu Ming
77557eaa84 append messages. 2016-04-14 13:56:01 +08:00
Liu Ming
63e54c0157 use message container instead of OpmLog. 2016-04-14 11:03:53 +08:00
Liu Ming
f28dd65142 add MessageContainer object. 2016-04-14 09:39:28 +08:00
Liu Ming
d73b79c210 remove unused headers. 2016-04-14 09:38:54 +08:00
Joakim Hove
001e2a7ad0 Merge pull request #759 from pgdr/prop-test-lean-grid
Testing Eclipse3DProperties API
2016-04-13 14:44:31 +02:00
Jørgen Kvalsvik
e2b548bfb0 data::Wells format for simulator data exchange
Introduces a simple format for data exchange between the simulators and
the the output facilities. Output functions will expect these types, and
it is the simulator's responsibility to create and provide it.

This patch introduces aggregates for well-related information: well
rates, bottom hole pressures and completion rates. Uses a simple bitmask
scheme to differentiate between written values and random garbage.
2016-04-13 13:23:42 +02:00
Atgeirr Flø Rasmussen
e313378e23 Silence unused function parameter warnings. 2016-04-13 13:05:01 +02:00
Atgeirr Flø Rasmussen
0104055076 Suppress Boost warnings. 2016-04-13 13:04:33 +02:00
Atgeirr Flø Rasmussen
c49d824644 Remove unused ParseContext argument from helper function. 2016-04-13 12:57:16 +02:00
Atgeirr Flø Rasmussen
c74a441a3b Remove const with no effect on value return. 2016-04-13 12:56:05 +02:00
Pål Grønås Drange
4e97aab8aa Testing Eclipse3DProperties API
* Added Eclipse3DPropertiesTests
* Refactored tests to use Eclipse3DProperties instead of EclipseState
* Added unsigned literal to MessageContainerTest
2016-04-13 12:44:07 +02:00
jokva
c6bd9e70fd Merge pull request #751 from pgdr/kill-es-gridprop
Introduce Eclipse3DProperties
2016-04-13 10:59:45 +02:00
Joakim Hove
9c6a120414 Merge pull request #757 from qilicun/append-messagecontainer
Add appendMessages() function.
2016-04-13 09:57:27 +02:00
Liu Ming
c782068baf add size() function. 2016-04-13 15:07:12 +08:00
Liu Ming
0954e5349c delete blank line. 2016-04-13 14:15:28 +08:00
Liu Ming
920c2cb87f some improvements. 2016-04-13 14:04:41 +08:00
Liu Ming
72dd934c71 add test for appendMessages function. 2016-04-13 14:04:21 +08:00
Joakim Hove
63be9532aa Merge pull request #756 from qilicun/cleanup-header
remove unused OpmLog headers.
2016-04-13 07:38:06 +02:00
Liu Ming
9ca9c8ce1d Add appendMessages() function. 2016-04-13 12:06:37 +08:00
Liu Ming
7946d0175f remove unused OpmLog headers. 2016-04-13 11:59:29 +08:00
Pål Grønås Drange
526bee2a6f Using API get3DProperties() 2016-04-12 14:50:15 +02:00
Pål Grønås Drange
7cffdb0ecf Renamed to get3DProperties() 2016-04-12 14:42:35 +02:00
Pål Grønås Drange
21f94c0606 TableManager and Deck are now used as references, hid GridProperties
* Added keyword "OPERNUM" to supported keywords in Eclipse3DProperties
* Updated tests to use Eclipse3DProperties API instead of GridProperties
* Moved init sequence of title into constructor
* ThresholdPressure and SimulationConfig now tasks Deck ref instead of shared_ptr
* Removed obsolete test and unused tests that tested gridProperties
* Refactor use of TableManager.  Is now a reference.
* Added non-const GridProperties.getKeyword(size_t i)
2016-04-12 14:42:34 +02:00
Pål Grønås Drange
3680dfcb97 Substantial edits to Eclipse3DProperties and ptr's
* moved region-property from EclipseState to Eclipse3DProperties
* moved initGridopts from EclipseState to Eclipse3DProperties
* made several Eclipse3DProperties methods private
* removed obsolete tests
* replaced log with throw internally in private method---is domain_error
* removed typedef in SatFuncPropertyInitializers
* postprocessors take raw pointers, not shared_ptr---these will be phased out
* fixed return reference instead of copy several places
** gridProperties<T> in Eclipse3DProperties are now references, not shared_ptr
** Eclipse3DProperties takes const Deck&, not shared_ptr
** EclipseGrid and Section are references
2016-04-12 14:42:34 +02:00
Pål Grønås Drange
e48b64c41d Substantial edits to Eclipse3DProperties
* Removed all references to state, need to fix initPORV
* Made TransMult return raw pointer const GridProperty over shared pointer.
* Moved getDirectionProperty and hasDirectionProperty out of API
** Removed tests as these methods are no longer public
* Moved grid properties stuff to new class
* Removed use of deck in SatfuncInitializers, moved to TableManager
* Removed shared_ptr for several members of EclipseState and 3DProperties
* Moved region-property from EclipseState to Eclipse3DProperties
* Moved initGridopts from EclipseState to Eclipse3DProperties
* Made several Eclipse3DProperties methods private
* Postprocessors take raw pointers, not shared_ptr---these will be phased out
* Fixed return reference instead of copy several places
** GridProperties<T> in Eclipse3DProperties are now references, not shared_ptr
** Eclipse3DProperties takes const Deck&, not shared_ptr
* Removed obsolete tests
2016-04-12 14:42:18 +02:00
Joakim Hove
49a1c17eb8 Removed signed / unsigned comparison warning. 2016-04-12 13:59:02 +02:00
Joakim Hove
0b316092c8 Added missing include. 2016-04-12 13:56:31 +02:00
Joakim Hove
bf9cd5699c Merge pull request #752 from qilicun/use-message-container
Add MessageContainer to EclipseState and Deck.
2016-04-12 10:13:13 +02:00
Liu Ming
4eb2208e63 remove shared_ptr 2016-04-12 09:01:33 +08:00
jokva
30880b7757 Merge pull request #735 from jepebe/clang_support
Added clang support to Travis CI
2016-04-11 11:50:10 +02:00
Liu Ming
0dcb776940 Add MessageContainer to Deck. 2016-04-11 11:15:39 +08:00
Liu Ming
ed92c70efd Add MessageContainer to EclipseState. 2016-04-11 10:44:39 +08:00
Joakim Hove
0d0fc43e50 Merge pull request #750 from jokva/remove-possible-undefined-const-cast
Remove possible undefined const cast
2016-04-08 12:52:38 +02:00
Joakim Hove
4d84da2b9d Merge pull request #748 from jokva/message-container-internal-detail
Remove MessageContainer from ParseContext + storage type change
2016-04-06 17:15:06 +02:00
Jørgen Kvalsvik
f8bab0e703 DeckItemT::SIdata mutable modifier
Replaces const_cast in favour of mutable keyword in order to avoid
undefined behaviour under some conditions.
2016-04-06 15:09:32 +02:00
Jørgen Kvalsvik
135f405e93 InitUnitSystem private; constness managed by .get
The const_cast in Deck::get*UnitSystem are potentially undefined
behaviour under a series of (plausible) conditions, and are deprecated
in favour of mutable members. Removes initUnitSystem from the public
interface, as the initialisation is handled on the first getUnitSystem
anyway, cleaning up the Deck interface slightly.

Adds proper constness to the use of unit systems that don't actually
modify the internal state in any way.
2016-04-06 15:09:32 +02:00
Jørgen Kvalsvik
0d24ac2d4a Store Location::lineno as size_t
By storing it as size_t we explicitly disallow negative line numbers,
and keep 0 as an error/empty/undefined location.

A small problem with this is that MessageContainer.error and friends
still accept negative numbers (often without warning) via size_t
implicit conversion and wrap-around.
2016-04-06 11:41:22 +02:00
Jørgen Kvalsvik
3efa5fb90c ParseContext::handleError returns messagetypë́
For more transactional behaviour and to support MessageContainer in
favour of opm-log, this method now returns an enum describing how the
error should be handled, rather than throwing or no-oping. Throwing is
preserved if ParseContext is configured to do so.
2016-04-06 10:39:06 +02:00
Jørgen Kvalsvik
f3bef79562 MessageContainer::const_iterator bound
While the implementation is a simple alias to
std::vector<Message>::const_iterator, it enablese generic lookup of the
iterator type at compile time, and enables us to effortlessly change the
underlying implementation later.
2016-04-06 10:38:19 +02:00
Jørgen Kvalsvik
eb610453b4 MessageContainer::add support
Some phenomenons can be configured as error, warning or debug output,
and is not necessarily known in advanced by the entity adding a message.
To facilite adding a message with runtime-defined warning level, the add
method is supported.
2016-04-06 10:38:18 +02:00
Jørgen Kvalsvik
6c8487ea07 Message::location uses automatic members
By supporting operator bool() we get the same existence checking
capabilities as the unique_ptr implementations, without the hurdles of
non-copyability and manual heap allocation.
2016-04-06 10:38:13 +02:00
Andreas Lauser
27efc6d295 only update a summary file once per report step
this fixes the problem that well totals are off by a factor of
two. Note that the better solution would be to continue to write once
per substep but skipping report step writes if the adaptive time
stepper is used. since I've got no idea how to find this out I propose
this patch.
2016-04-05 18:58:28 +02:00
Joakim Hove
df751de42c Merge pull request #745 from joakim-hove/opmi
Opmi
2016-04-05 07:58:53 +02:00
Joakim Hove
e30054625a Merge pull request #746 from joakim-hove/keywords-polymer
Keywords: EDITNNC( new ) AQUCON (fixed)
2016-04-04 20:12:11 +02:00
Joakim Hove
74828204c2 Merge pull request #744 from joakim-hove/update-python-bind
Using bound Python prototype.
2016-04-04 20:11:38 +02:00
Joakim Hove
bdb1313f41 RawKeyword getRecord( int ) -> getFirstRecord()
The general loop through all raw records should be based on the iterator
interface of the RawKeyword, but to resolve INCLUDE statements we have
implemented a special case method to get the first record.
2016-04-04 16:21:52 +02:00
Andreas Lauser
01af172599 copy the configure wrapper from opm-autodiff
this enables to build opm-output using an unpatched `dunecontrol` from
Dune 2.3 (and Dune 2.4 if USE_CMAKE is set to "no").

In the medium term the build system needs to become compatible with
Dune's cmake based build system since I think I read somewhere that
the Dune devs intend to remove the autotools based build system before
their next release.
2016-04-04 15:38:26 +02:00
Jean-Paul Balabanian
4c48c1eeb0 Added clang support to Travis CI 2016-04-04 12:42:42 +02:00
Jørgen Kvalsvik
427baebe58 MessageContainer include guard corrected 2016-04-04 11:52:20 +02:00
Joakim Hove
769f2dee17 Merge pull request #8 from joakim-hove/refactor-rft-output
Refactor RFT output
2016-04-04 11:22:52 +02:00
Joakim Hove
51ce94cd62 Use range based for when iterating over RawRecords 2016-04-03 22:01:13 +02:00
Joakim Hove
e57d61468d Added non const record iterators to RawKeyword. 2016-04-03 22:00:30 +02:00
Joakim Hove
3548150c62 Added keyword EDITNNC 2016-04-02 22:52:56 +02:00
Joakim Hove
934ae26799 Fixed keyword AQUCON. 2016-04-02 22:52:55 +02:00
Joakim Hove
328a0ab27d Renamed OpmLoadDeck -> opmi
Have renamed the OpmLoadDeck test program to the working name opmi - Opm
Inspector. Currently the opmi executable will only load a deck and
create a EclipseState instance, but the plan is to extend this
executable to be a general Eclipse deck inspector, e.g.

   opmi --wells CASE.DATA

Could the list the wells and so on.
2016-04-02 21:44:11 +02:00
Joakim Hove
c848b4a24e Removed unused/unmainted "applications". 2016-04-02 21:39:19 +02:00
Joakim Hove
85f6cd1781 Using bound Python prototype. 2016-04-02 21:35:54 +02:00
Joakim Hove
d604262355 Merge pull request #742 from chflo/parser_support_symlink
Parser support symlink
2016-04-01 19:14:55 +02:00
Joakim Hove
484fe89308 Refactor RFT output
With this patch the RFT output writer will write a new RFT file for
every simulation, not update in place which was the case previously.
2016-04-01 15:37:43 +02:00
chflo
82bef27b8f Support symlink 2016-04-01 15:36:38 +02:00
chflo
8ee79e7be6 Support symlinks: Added test 2016-04-01 14:28:26 +02:00
chflo
b8e803162b Support symlinks: Added testdata 2016-04-01 14:28:26 +02:00
Jørgen Kvalsvik
8e4e9b15d8 ReadValueToken correctly parses numbers
Changes the implementation of numbers parsing from std::atoi/f to
std::strtod/l. These support setting the optional end-of-string pointer
which are used to determine if a parsing was successful or not. This has
the nice side effect of *greatly* simplifying the logic, at the expense
of some C-style details.

Tests added to verify that the different edge cases are handled
properly.
2016-04-01 10:13:37 +02:00
Atgeirr Flø Rasmussen
e6d66c3de2 Remove unused function argument. 2016-03-31 16:11:10 +02:00
Joakim Hove
63bfb550ff Merge pull request #737 from jokva/raw-keyword-record-std-list
RawKeyword iterator support and correct RawRecord management
2016-03-30 13:27:53 +02:00
Jørgen Kvalsvik
046afdd3be RawKeyword iterator support
Since RawRecords now has automatic storage, managed by std::list,
offering iterators is feasible. The random access
RawKeyword::getRecord's real use was accessing the records in order,
which now is handled via iterators.
2016-03-30 12:47:33 +02:00
Jørgen Kvalsvik
83ae276d67 Fix string_view iterator invalidation bug
By changing the underlying storage of RawKeyword to std::list, we ensure
that the RawRecords aren't reallocated and moved, preserving the
validity of string_view's. This changes the access complexity of
RawRecord from O(1) to O(n).
2016-03-30 12:31:00 +02:00
Atgeirr Flø Rasmussen
8031ba9d56 Silence unused argument warning. 2016-03-29 21:22:08 +02:00
Atgeirr Flø Rasmussen
edfe69f639 Add missing include directives. 2016-03-29 21:21:43 +02:00
Jørgen Kvalsvik
44b19a04ea Internalisation of SUMMARY C keywords
Implement support for creating and instantiation smspec_nodes for the
C-family of keywords of the SUMMARY section. Covers all defaulting
mechanisms.

Due to poor map/concat/filter support, this was written in a more
traditional foreach-if-then-append style.
2016-03-29 16:01:03 +02:00
Kjell W. Kongsvik
e4df4dd48d Updated with changes from opm-core master 2016-03-29 14:45:48 +02:00
Jørgen Kvalsvik
6ce846ca0b TimeMap::last() support
Query the last time step of the map.
2016-03-29 14:34:00 +02:00
Jørgen Kvalsvik
2e58d42ad0 Schedule::getWell const support 2016-03-29 14:34:00 +02:00
Jørgen Kvalsvik
2ed88df0db CompletionSet iterator support 2016-03-29 14:33:59 +02:00
Jørgen Kvalsvik
0c3a2093f2 Summary: Calculate ijk from record in function
To reduce duplication, calculating ijk positions with offset from
records is handled by a function instead of inline.
2016-03-29 14:33:59 +02:00
Jørgen Kvalsvik
e4d51c5d35 Summary: Calculate dims from grid in function
To reduce duplication, calculating a dimensions array from EclipseGrid
is its own function instead for a repeated body across multiple
(similar) functions.
2016-03-29 14:33:59 +02:00
Jørgen Kvalsvik
dbbbd2e8f7 Parser support for SUMMARY/Region keywords
The Summary object understands and stores some (simple) Region type
keywords. Does not support inter-region keywords, nor underscore or
custom regions.
2016-03-29 14:33:59 +02:00
Joakim Hove
b778beb507 Renamed enum symbols 2016-03-29 14:18:03 +02:00
Joakim Hove
4810b09c13 Merge pull request #731 from qilicun/add-msgcontainer-to-parsecontext
add member and functions.
2016-03-29 12:38:22 +02:00
Joakim Hove
7bd2707307 Merge pull request #730 from joakim-hove/first-output-step
First output step
2016-03-29 12:36:54 +02:00
Liu Ming
bf361cce86 add member and functions. 2016-03-29 15:19:43 +08:00
Joakim Hove
92ba3df9ab Merge pull request #729 from qilicun/add_message_container
Add message container
2016-03-29 08:49:49 +02:00
Liu Ming
1f44ade6c7 Add range based test. 2016-03-29 10:21:10 +08:00
Joakim Hove
b0a12b230e Internalize first output step for restart and RFT. 2016-03-28 18:47:30 +02:00
Joakim Hove
b91c6fdbf3 Added find() method to DynamicState 2016-03-28 18:47:29 +02:00
Liu Ming
aea8d7a5bf test iterator. 2016-03-28 08:52:56 +08:00
Liu Ming
a778f4b225 remove deleted file from cmake list. 2016-03-25 16:14:34 +08:00
Liu Ming
9828cdc1d9 fix copy right. 2016-03-25 11:21:43 +08:00
Liu Ming
b53d0909ba add tests for message container. 2016-03-25 10:55:22 +08:00
Liu Ming
82863ac090 add begin(), end() iterator function. 2016-03-25 09:52:27 +08:00
Liu Ming
6f3d8b0e07 move MessageType definition. add overload functions. 2016-03-25 09:47:57 +08:00
Liu Ming
2865f96eda Add message container. 2016-03-24 13:55:12 +08:00
Joakim Hove
1491898706 Merge pull request #728 from jokva/various-improvements
Various improvements
2016-03-23 16:55:39 +01:00
Joakim Hove
130cf072a2 Merge pull request #726 from joakim-hove/keywords
Added some new keywords.
2016-03-22 15:33:22 +01:00
Joakim Hove
41b30d5073 Merge pull request #724 from joakim-hove/WCONINJE-accept-WAT
Allow 'WAT' when parsing type string in WCONINJE.
2016-03-22 15:33:13 +01:00
Kjell W. Kongsvik
080f98cf67 Added 3 keywords
AQUDIMS
MEMORY
PARALLEL
2016-03-22 15:20:55 +01:00
Jørgen Kvalsvik
9e76ec5f78 Inline hot-but-trivial functions
These functions are called a lot and are trivial accessors to the
underlying containers. By opening them for inlining we get a decent
performance benefit "for free" via optimisation opportunities.
2016-03-22 14:45:17 +01:00
Joakim Hove
bddad93931 Added some new keywords. 2016-03-22 11:27:59 +01:00
Joakim Hove
d1652ef6ba Allow 'WAT' when parsing type string in WCONINJE. 2016-03-22 10:32:00 +01:00
Joakim Hove
fc15a7b7af Changes in travis configuration
1. The build-opm-parser.sh script - which is used by downstream
    modules, does not build the Python bindings.

 2. The main travis script uses the build-shared script from opm-common.
2016-03-22 10:12:27 +01:00
Jørgen Kvalsvik
0da5cadc75 RawRecords auto store, strings moved to RawRecord
The accumulated strings are moved into RawRecords, which reduces
execution time (rough measurements indicates 4-8%). To facilitate this,
RawRecords are stored directly in the vector in favour of via
shared_ptrs.
2016-03-22 08:58:48 +01:00
Jørgen Kvalsvik
e64d9f82a4 DeckItem tag explicit instead of vtable lookup
dynamic_cast turns out to be rather slow, and it is faster to look up an
explicit tag instead.
2016-03-22 08:58:48 +01:00
chflo
f2ed1ba7ea Moved OpmLog from opm-parser to opm-common 2016-03-21 22:07:49 +01:00
Joakim Hove
a49f6ca00c Merge pull request #695 from jokva/refactor-grid-property-intializers
Refactor grid property intialisers
2016-03-21 21:33:39 +01:00
Liu Ming
c42d9ed77e fix header guard. 2016-03-21 15:24:48 +08:00
Joakim Hove
f0158f6ca3 Merge pull request #718 from jokva/fix-uninitialised-values
Initialisation and memory errors fixed
2016-03-17 13:56:48 +01:00
Kjell W. Kongsvik
68b5c38f3a Copy changes from opm-core
Ref 81f6c2dd8e
2016-03-17 12:45:29 +01:00
Kjell W. Kongsvik
bbd526d348 fix travis: opm-material is dependant on dune 2016-03-17 09:37:42 +01:00
Liu Ming
33da3caa6e should be parse_context 2016-03-17 15:36:12 +08:00
Liu Ming
a164776b12 should be parse_context. 2016-03-17 15:22:36 +08:00
Liu Ming
fd4451a215 change sub folder name. 2016-03-17 15:00:11 +08:00
Liu Ming
15b818de24 fix renaming issue. 2016-03-17 14:50:00 +08:00
Liu Ming
25acd89325 rename the last files. 2016-03-17 08:42:46 +08:00
Liu Ming
1fe83c9a78 rename ParseMode as ParseContext in python folder. 2016-03-17 08:34:48 +08:00
Liu Ming
6e542cb083 rename ParseMode as ParseContext in Units folder. 2016-03-17 08:29:32 +08:00
Liu Ming
88d489e876 rename ParseMode as ParseContext in IntegrationTests folder. 2016-03-17 08:28:17 +08:00
Kjell W. Kongsvik
c8b9745fc9 Also include opm-material in travis build 2016-03-16 14:27:18 +01:00
Kjell W. Kongsvik
a4904a88c7 travis build must include opm-core 2016-03-16 14:06:42 +01:00
Kjell W. Kongsvik
51c8416e28 Moved OutputWriter to opm-output
Moved opm/core/io/* in opm-core to opm-output opm/output along with tests.
Is still dependant on opm-core.
2016-03-16 10:47:35 +01:00
Liu Ming
a4a449538d rename ParseMode as ParseContext in EclipseState folder. 2016-03-16 17:15:09 +08:00
Liu Ming
12268c7937 rename ParseMode as ParseContext in Deck folder. 2016-03-16 16:36:34 +08:00
Liu Ming
705a9dc168 rename ParseMode as ParseContex in Parser folder. 2016-03-16 16:34:58 +08:00
Liu Ming
88c89b707d rename ParseMode class as ParseContext. 2016-03-16 16:24:59 +08:00
Jørgen Kvalsvik
aa064a9050 Fix buffer overflow vulnerability
An attacker using very long decimal integers as input could trigger a
buffer overflow write during int/double parsing.

The vulnerability has been fixed and raw buffer boundaries are checked.
Additionally, integer buffer size is determined by platform 'int' width.
'double' uses a heuristic to support both pure decimal formats (up to 64
characters long) and float formats.
2016-03-15 16:42:02 +01:00
Jørgen Kvalsvik
23f01511bd Add string_view::empty() 2016-03-15 16:42:02 +01:00
Jørgen Kvalsvik
47ca6d31cc Remove unused dropParserKeyword
This method is not used at all, but creates noise in tests and is broken
(iterator invalidation).
2016-03-15 15:14:10 +01:00
Joakim Hove
53471d2329 PLYVISC: INCREASING instead of STRIVLY_INCREASING. 2016-03-15 14:11:42 +01:00
Jørgen Kvalsvik
79b1407e23 Default constructed Deck is well-defined
The underlying iterators were default constructed (aka uninitialised)
when a Deck was default constructed, meaning possible invocation of
undefined behaviour.

While the empty Deck typically is only used for testing, this is a
possible bug in production code. This small patch makes sure even
default constructed Decks are well defined.
2016-03-14 16:02:27 +01:00
Atgeirr Flø Rasmussen
78e0870bad Use std::list instead of std::vector to fix push_front().
The push_front() method can cause reallocation of expanded_items,
thereby invalidating iterators already stored in m_recordItems.
Switching to std::list fixes this.
2016-03-14 14:54:29 +01:00
Atgeirr Flø Rasmussen
32439fa87d Remove unused boost-specific helpers. 2016-03-14 14:54:00 +01:00
Atgeirr Flø Rasmussen
2e1940e5c3 Move string_view ops to Opm namespace. 2016-03-14 13:28:51 +01:00
Atgeirr Flø Rasmussen
f23af386cf Add missing include, remove unused function. 2016-03-14 13:22:22 +01:00
Joakim Hove
97aaa97d90 Merge pull request #706 from jokva/parser-performance-improvements
Parser performance improvements
2016-03-14 12:35:19 +01:00
Joakim Hove
2b79d2e57a Merge pull request #711 from qilicun/eclipse-PRTLog
Add EclipsePRTLog backend.
2016-03-14 12:23:03 +01:00
Liu Ming
3bea6360b9 using base class's constructors. 2016-03-14 17:09:10 +08:00
Liu Ming
5e0eebcbea add missing bracket. 2016-03-14 16:57:19 +08:00
Liu Ming
70bc978074 delete unused function. 2016-03-14 16:40:26 +08:00
Liu Ming
a28a1e3c3d remove temporary variables. 2016-03-14 16:39:18 +08:00
Jørgen Kvalsvik
cee22efd99 Pass readValueToken string_view 2016-03-14 08:55:02 +01:00
Jørgen Kvalsvik
1406630aa3 DeckItem constructor takes size hint
Enable preallocation by passing size hints to DeckItem constructor.
2016-03-14 08:29:54 +01:00
Jørgen Kvalsvik
84e245bdb5 DeckRecord preallocation support.
The translation between ParserRecord knows in advance how many DeckItem
entries there are in the resulting DeckRecord. We can use this
information to efficiently preallocate memory in the DeckRecord.
2016-03-14 08:29:54 +01:00
Jørgen Kvalsvik
55b46da658 Moved RawRecord::isTerminator out of interface
This feature is internal to the raw records and is removed from its
public interface.
2016-03-14 08:29:54 +01:00
Jørgen Kvalsvik
7440acaa6a Replaces boost::trim_right with faster version
boost::trim_right loses a lot of performance from being locale aware.
Since this is not a problem for our ASCII fortran-type files, ignore
this issue and use isspace for trimming.
2016-03-14 08:29:54 +01:00
Jørgen Kvalsvik
650037afb2 Inlined title keyword handling 2016-03-14 08:29:54 +01:00
Jørgen Kvalsvik
2a650d5972 RawRecord refactoring
Some simple refactoring to remove a redundant check and clean up some
initialisation routines.
2016-03-14 08:29:54 +01:00
Jørgen Kvalsvik
dc094cbb16 More efficient findTerminatingSlash
Uses some heuristics and quick exists to avoid always paying worst case
cost for finding terminating slash.
2016-03-14 08:29:54 +01:00
Jørgen Kvalsvik
28eb195ac3 readValueToken< double > split into fast/slow path.
readValueToken spent almost half its time dealing with weirdly formed or
broken floats. Now has a shorter path that can early return a
successfully parsed float and only do slow handling of cases that need
it (notably zero, fortran style exponent and errors).
2016-03-14 08:29:54 +01:00
Jørgen Kvalsvik
38f88b4e14 RawKeyword::isTerminator uses is_separator 2016-03-14 08:29:54 +01:00
Jørgen Kvalsvik
1d1715b421 RawConsts::is_separator function
This replaces the inefficient RawConsts::separators.find( char ) with an
availble, efficient and inlinable is_separator.
2016-03-14 08:29:53 +01:00
Jørgen Kvalsvik
717d495a98 Replace boost::to_upper_copy
This function was rather slow and accounted for too much execution time.
Replaced with a simple implementation relying on toupper. Locale
awareness, the benefit of to_upper_copy, is not an issue since it's all
ASCII.
2016-03-14 08:29:53 +01:00
Jørgen Kvalsvik
9a96f9fd8f Enable rvalue push_back in ParserItemScan
Instead of going via an immediately discarded temporary, feed the
readValueToken result value directly to push_back. This enables rvalue
optimisations to kick in, when available.
2016-03-14 08:29:53 +01:00
Jørgen Kvalsvik
93b7c0739b Replace boost::lexical_cast<> with std functions
The boost provided lexical cast are inefficient and is shown to be a
slowdown in the inner loop. Replaces them with std::atoi/std::atof and
some simple correctness checking.
2016-03-14 08:29:53 +01:00
Jørgen Kvalsvik
e4ddf884f1 Using operator+ and stream operators 2016-03-14 08:29:53 +01:00
Jørgen Kvalsvik
798084676a RawRecord uses string_view internally
Modifies RawRecord to internally use string_view instead of copies of
the substrings. This *vastly* reduces copying in the processing of each
record and subsequently improves performance. Reduces total memory usage
in Deck construction.
2016-03-14 08:29:53 +01:00
Jørgen Kvalsvik
8d4863ff86 Introducing string_view
A simple non-mutating view into a string. Implements a shallow reference
to a std::string, replicating its operations to be drop-in replaceable.

Primarily designed for inner loop use, where expensive string
allocations become a performance killer.
2016-03-14 08:29:53 +01:00
Joakim Hove
8cfafe7c52 Merge pull request #701 from qilicun/more-function-opmlog
More function opmlog
2016-03-14 07:34:44 +01:00
Liu Ming
e0cbb05cfe output numbers as string. 2016-03-14 12:53:20 +08:00
Liu Ming
289f6c3bdb Add EclipsePRTLog backend. 2016-03-14 11:09:17 +08:00
Joakim Hove
0979d8050e Load-test of opm-data/solvent_test_suite/SPE5CASE1 2016-03-12 19:18:55 +01:00
Liu Ming
ccd14fd433 remove StreamLog include file. 2016-03-12 21:04:45 +08:00
Liu Ming
2bd48b4d9d remove StreamLog from header. 2016-03-11 15:47:27 +08:00
Liu Ming
bea353aafd Add debug method. 2016-03-11 15:24:43 +08:00
Liu Ming
6506cb5dc1 remove StreamLog and int members. 2016-03-11 15:21:47 +08:00
Joakim Hove
7f6fa4b125 Merge pull request #707 from totto82/tlpmixpa
Add new keyword TLPMIXPA
2016-03-09 10:13:23 +00:00
Joakim Hove
b9aec3e3be Merge pull request #705 from jokva/remove-boost-from-startoken
Moves readValueToken implementation to source file
2016-03-08 17:37:31 +01:00
Jørgen Kvalsvik
39b3c32d3e Fix broken travis script. 2016-03-08 16:09:13 +01:00
Jørgen Kvalsvik
aa43346053 Rewrite cmake files to use opm infrastructure
Borrows macros and common infrastructure from the rest of the opm
project instead of half-implementing its own (as parser must do).
Largely a build system simplification.
2016-03-08 16:00:35 +01:00
Tor Harald Sandve
3991bf6e51 Add new keyword TLPMIXPA
The TLPMIXPA keyword can be used for giving pressure depended Todd-
Longstaff parameters. The implementation follows the description of
PMISC.
2016-03-08 15:14:21 +01:00
Jørgen Kvalsvik
d67a44b19d Include guards for Functional 2016-03-07 09:03:52 +01:00
Jørgen Kvalsvik
d0d4a74d31 Moves readValueToken implementation to source file
The templated readValueToken has been moved to source file, and uses
explicit instantiation and linking. The deprecated float specialisation
has been removed.
2016-03-04 18:27:44 +01:00
Joakim Hove
99266809b7 Merge pull request #698 from jokva/equil-keyword-lookup
Equil keyword lookup
2016-03-04 18:19:43 +01:00
chflo
0db3abab94 Added copyright header to files that were without it 2016-03-04 14:56:18 +01:00
Liu Ming
83e5ff1c00 Fix summary() issue. 2016-03-02 12:00:23 +08:00
Liu Ming
4c4788d73c Add more functions to OpmLog. 2016-03-02 11:56:00 +08:00
Atgeirr Flø Rasmussen
b026c55c3b Honor the ACTNUM keyword also for cartesian grids. 2016-03-01 14:40:36 +01:00
Atgeirr Flø Rasmussen
9e0c85dce7 Silence warnings from boost. 2016-03-01 10:12:09 +01:00
Atgeirr Flø Rasmussen
a828991bbc Add missing include directive. 2016-03-01 10:11:55 +01:00
Jørgen Kvalsvik
ff1ad83f08 Split GridPropertyFunction into Init+Post
The assumptions and interface for these two functions are distinct. Init
does not have to take a preallocated vector, but post processing
requires an input vector. Splits the two and changes their signatures.
2016-03-01 08:46:23 +01:00
Jørgen Kvalsvik
3e222f58d7 findVerticalPoints split up
Most users of the findVerticalPoints function didn't use more than one
of the vectors returned. By splitting them up into seperate functions,
we only have to compute what we'll use.
2016-03-01 08:46:23 +01:00
Jørgen Kvalsvik
7bf13fbb61 findCritical split up
Most users of the findCritical function didn't use more than one of the
vectors returned. By splitting them up into seperate functions, we only
have to compute what we'll use.
2016-03-01 08:46:23 +01:00
Jørgen Kvalsvik
9798b4667a findSaturationEndpoints split up
Most users of the findSaturationEndpoints function didn't use more than
one of the four vectors returned. By splitting them up into seperate
functions, we only have to compute what we'll use.
2016-03-01 08:46:23 +01:00
Jørgen Kvalsvik
24d4fe595e GridPropertyFunction interface improvements
Changes GridPropertyFunction's external interface to use references
rather than pointers. Means slightly less flexibility for tests, but
makes it clear what its dependencies are.
2016-03-01 08:46:23 +01:00
Jørgen Kvalsvik
34bfba42d3 Replace initializer classes, refactor PropertyInit
In an effort to make GridPropertyInitializer and
SatfuncPropertyInitializer functionality more maintainble, the
shared-ptr-to-base-class model has been replaced by a specialised
function object and free functions. This means:

* GridPropertyBaseInitializer and everything derived from it is gone
* All SatfuncPropertyInitializer code has been heavily rewritten to
  emphasise dependencies. Now behaves like proper functions.
* EclipseState intialisation code is somewhat simpler
* Code is more declarative. In particular, some maybe unintended
  behaviour has been discovered and described.
2016-03-01 08:46:23 +01:00
Jørgen Kvalsvik
80f3abe1c6 Move SatfuncInitializers to source file
Since the template-parameterised base header was moved to a source file,
there is no longer any reason for this to be header-only. Split into
source.
2016-03-01 08:46:23 +01:00
Jørgen Kvalsvik
7946f86f29 GridPropertyFunction interface in init/postprocess
The new GridPropertyFunction processes grid cell property vectors and
replaces GridPropertyBase* inheritance model. This implementation
re-uses the old implementations as a transition.
2016-03-01 08:46:23 +01:00
Jørgen Kvalsvik
357e1e0e53 Move GridProperty< T > to source file
GridProperty< T > has only two sensible types to parametrise, int and
double. Moves the implementation and instantiation of GridProperty to
GridProperty.cpp. This also applies to GridPropertyInitializers which
has also been moved to source files.

Results are a cleaner header file (for reading & understanding the
interface) and faster compilations.
2016-03-01 08:46:23 +01:00
Jørgen Kvalsvik
5b2ec6be75 GridProperties stores raw vector of keywords
Changes the type of the stored supported keywords from pointer-to-vector
to vector. This accomplishes the following:

* we avoid an unecessary level of indirection
* we enable initializer list syntax for tests etc.
* GridProperties' interface properly communicates that it takes over
  ownership of the passed keywords.
* it feels more natural in use as generating and returning a vector in a
  free function can be returned and directly passed to the constructor
  (the motivation for this change).

Bundled with this is the move of the supported keyword population into
using loops to exploit the similarities of families of keywords w.r.t.
GridProperties representation.
2016-03-01 08:46:22 +01:00
Jørgen Kvalsvik
5c02c60035 Introducing InitConfig/Equil
Introduces Equil, a thin storage class for 'EQUIL' derived information,
accessible through EclipseState.

Previously this was handled through "raw" deck access, provided by
EquilWrapper. The interface for Equil has been derived from the
EquilWrapper, but they're to be seen as different entities altogether.
More importantly, Equil is owned by EclipseState, not some stand-alone
Deck reading unit.
2016-03-01 08:44:38 +01:00
Jørgen Kvalsvik
51df3685f3 Remove EquilWrapper.
This file is deprecated.
2016-03-01 08:44:38 +01:00
Joakim Hove
36b42ec160 Merge pull request #696 from jokva/functional
Introduce Utility/Functional
2016-03-01 07:12:03 +01:00
Jørgen Kvalsvik
ba743e488c Introduce Utility/Functional
Utility/Functional is a lightweight high level functional-oriented sub
library that attempts to abstract some common uses and boilerplate
around the parser code (and later maybe for other modules to use).

This patch introduce only three functions, but they have proven common
enough to warrant some common implementation.
2016-02-29 13:50:32 +01:00
Atgeirr Flø Rasmussen
8c9d57d7a7 Silence warning from inconsistently using override spec.
Also fix minor whitespace (tab) issue.
2016-02-29 10:30:24 +01:00
Atgeirr Flø Rasmussen
7b19c37585 Silence brace-init warning.
Double braces should be used for std::array until C++14.
2016-02-29 10:27:00 +01:00
Atgeirr Flø Rasmussen
ca94a5b792 Silence unused argument warning. 2016-02-29 10:26:43 +01:00
Atgeirr Flø Rasmussen
c4be826212 Silence shadowing warnings. 2016-02-29 10:25:35 +01:00
Atgeirr Flø Rasmussen
2518d08aa1 Add missing include directives. 2016-02-29 10:10:14 +01:00
Jørgen Kvalsvik
0881fece8b Initial commit. Travis, dune and cmake support. 2016-02-22 16:17:32 +01:00
Joakim Hove
1c32ef5562 Merge pull request #682 from jokva/summary
Internalise SUMMARY section
2016-02-22 14:30:07 +01:00
Joakim Hove
a8f47b4dd5 Merge pull request #694 from jokva/minor-improvements
Simplify DeckRecord::addItem implementation
2016-02-22 10:45:52 +01:00
Jørgen Kvalsvik
a8d7b250ca Simplify DeckRecord::addItem implementation 2016-02-22 10:18:22 +01:00
Jørgen Kvalsvik
7bc3c79301 PATHS keyword has global scope.
ECLIPSE resolves path aliases defined in an included file globally, i.e.
/
|> include.inc
|-- PATHS 'alias' 'path/to/dir'
|> main.data
|-- INCLUDE 'include.inc' /
| [...]
|-- INCLUDE '$alias/file.inc' /

will resolve as 'path/to/dir/file.inc'. This behaviour is now adopted by
opm-parser.
2016-02-22 10:16:12 +01:00
Joakim Hove
7b5bc29d81 Merge pull request #691 from jokva/parser-keywords-unique
Parser stores keywords as unique_ptr
2016-02-22 09:09:03 +01:00
Jørgen Kvalsvik
78e1ab9db5 Parser stores keywords as unique_ptr
Removes shared_ptr< ParserKeyword > exchange in Parser interface and
replaces it with unique_ptr storage and raw pointers for return values.
This has some implications:

* addParserKeyword() no longer takes shared_ptr<>, but unique_ptr&&
  addParserKeyword has been modified to create unique_ptr instead of
  shared_ptr.

* generated-source/ParserKeyword* no longer use make_shared which had a
  -massive- impact on compile times, which are now more-or-less
  trivialised (on my machine: 7.5s -> 1s per file). This because the
  compiler no longer generates a bunch of forwarding make_shared
  instances of subclasses that are immediately thrown away, but rather
  uses an inline make_unique that instantiates the -parent- class
  unique_ptr.
2016-02-19 14:19:41 +01:00
Jørgen Kvalsvik
a187d58502 Removes unused function in ParserTests 2016-02-19 14:04:17 +01:00
Andreas Lauser
cfd38b8a66 EclipseState: rename the has*GridProperty() methods to hasDeck*GridProperty()
the intend is to better reflect that these properties where explicitly
created in the deck. The old method names can still be used, but they
will result in deprecation warnings.
2016-02-19 13:36:57 +01:00
Andreas Lauser
f83236588c GridProperties: print a (hopefully scary) warning if a grid property looses its ad-hoc status
I'm pretty sure that most users do not expect this. If that behaviour
was really intentional, one can add a

```
FOO
$NUM_CELLS*
```

line to the deck before the keyword which requires FOO to initialize
itself.
2016-02-19 13:36:53 +01:00
Andreas Lauser
442cdafeda EclipseState: make the grid properties returned by get*GridProperty() constant
that's because they are not supposed to be modified outside of the
EclipseState. (if they are, why? I'd consider that *very* bad style
since it is also possible to copy these objects and modify the copy
and also this was used nowhere within the OPM project.)

also, the has*Property() is now working as expected: if e.g.,

```c++
bool hasSatnum = eclipseState->hasIntProperty("SATNUM");
eclipseState->getIntProperty("SATNUM");
assert(hasSatnum == eclipseState->hasIntProperty("SATNUM"));
```

will now work for decks which does not explicitly specify
SATNUM. (before the getIntProperty() method silently created the
SATNUM property which caused hasIntProperty() to change its
opinion. With this patch, the property will still be silently created,
but has*Property() ignores it, i.e., that method could be renamed to
hasExplicit*Property() which -- as far as I understand this -- was its
intention from start.)
2016-02-19 13:35:45 +01:00
Jørgen Kvalsvik
74136ab348 Interalise Summary section of Deck
Builds an internal representation, based on ERT's smspec_node, of the
SUMMARY section of an input file, that can be used to determine what
data from a simulation to output.

In essence, this is a simple map from DeckKeyword to smspec_node that
carries over the interesting data. Introduces two higher order functions
(map and concat) to aid in this, thoroughly isolating each case.

Depends on ert pull request #1013
https://github.com/Ensembles/ert/pull/1013
2016-02-19 13:04:59 +01:00
Joakim Hove
0352b172dd Merge pull request #677 from jokva/unique-managed-keywords
Unique and automatically managed keywords
2016-02-18 22:37:04 +01:00
Kai Bao
c04f092212 fixing unit of compressibility and viscosibility in PVCDO keyword. 2016-02-18 17:47:38 +01:00
Jørgen Kvalsvik
7eb52f1023 Removes DeckKeyword's dependency on ParserKeyword
The completely constructed Deck isn't supposed to have any relationship
with the Parser structures (which are completely stateless in terms of
input data), and ParserKeyword in DeckKeyword was an anomaly. With
recent refactorings this lead to subtle lifetime issues.

This patch breaks this dependency and cleans up DeckKeyword accordingly,
while changing checkDeck to now take the parser as an additional
argument, to look up whether or not some DeckKeyword is in the right
section. This now also means that Parser* objects can be destroyed once
the Deck is created.

The Section::checkSectionTopology has been moved to Parser.cpp. It is a
temporary home for the feature to make the project compile nicely (i.e.
createKeywordList can be compiled as before, without introducing a
circular dependency on itself via Parser.cpp), until some proper cleanup
of the parser code has been done. It never really fully belonged in
Section.cpp anyway, so this is a first step in the direction of some
slight renaming.
2016-02-18 13:27:24 +01:00
Jørgen Kvalsvik
f0ae5db131 opm-parser adoption of Deck automatic ownership
Since the Deck* family of classes have changed their interfaces to no
longer use shared_ptr, a lot of code broke. This patch fixes all
problems in tests, other signatures and accesses to now use the new Deck
interfaces.
2016-02-18 13:27:24 +01:00
Jørgen Kvalsvik
9c577d8645 Deck uses automatic memory
The deck no longer exposes shared_ptrs, but uses automatically managed
memory, meaning ownership of DeckKeywords are now obvious and clear.
shared_ptr in the interface has been replaced by references.
2016-02-18 13:26:56 +01:00
Jørgen Kvalsvik
a0a063e386 Split Deck into RO/RW interfaces
This refactoring reflects the ownership semantics of Deck* classes -
Section and Section-derived classes no longer claim ownership over
partial decks, but rather provide a -view- into an already
established Deck.

The Deck class itself is now unique in the sense that it is the only
supporter of write operations, meaning a DeckView derived instance can
never modify the deck it's viewing.
2016-02-18 13:26:56 +01:00
Jørgen Kvalsvik
23007dd193 DeckKeyword uses automatic storage for records
DeckKeyword now internally uses a vector of records instead of a vector
of shared_ptr< DeckRecord >. Updates the interface to reflect this, by
returning references over shared_ptr. DeckKeyword is now the sole owner
of its own record resources.
2016-02-18 13:26:56 +01:00
Jørgen Kvalsvik
d4b909e885 DeckRecord uses automatic memory
Replaces shared_ptr use in DeckRecord with automatically allocated
DeckItem, as the DeckRecord itself owns and manages the lifetime of
DeckItems. To reflect this, methods and queries no longer return
shared_ptrs, but (const) references.
2016-02-18 13:26:56 +01:00
Jørgen Kvalsvik
3f9e6a7be5 DeckItem can be automatically allocated.
Using a virtual base class DeckItem that exposed DeckInt/Double/String
types means it cannot be held in a vector and managed automatically
without unique_ptr, which is clunky and makes iterator aliases
impossible. This patch moves the unique_ptr details into DeckItem which
now behaves as if it was virtual, except it only forwards calls to its
inner, managed object (much like private implementation).

This gives the benefit of automatic/stack allocation, and no particular
drawback aside from slightly less obvious implementation. Clients can
still call get< int > on a DeckItem::double, but that was also possible
with the virtual solution (i.e. nothing lost).
2016-02-18 13:26:55 +01:00
Jørgen Kvalsvik
0781ec968d Change static private methods to static functions
Since these really aren't a part of the class, they're moved to the more
approperiate static function to not pollute the header.
2016-02-18 13:26:55 +01:00
Jørgen Kvalsvik
6aa251b97d Remove std::map from DeckRecord
The map was used as an implementation detail for name-based lookup,
which has been re-implemented on top of linear searches over the vector.
2016-02-18 13:26:55 +01:00
Jørgen Kvalsvik
dc5afd5236 DeckKeyword::ParserKeyword to regular pointer 2016-02-18 13:26:55 +01:00
Joakim Hove
8083290214 Turned off building off tests in travis 2016-02-17 14:48:45 +01:00
Jørgen Kvalsvik
6f417b0a4d Remove unused Utility/Wrapper.hpp
These wrapper classes are not used within any opm project, and can be
removed to reduce maintenance.
2016-02-17 11:48:40 +01:00
Tor Harald Sandve
710df504e2 Add support for MISCNUM
- MISCNUM is used to specify miscibility regions
2016-02-15 15:04:59 +01:00
Atgeirr Flø Rasmussen
31961cc193 Silence unused function argument warning. 2016-02-15 00:10:13 +01:00
Atgeirr Flø Rasmussen
6064d7757b Add missing override. 2016-02-14 23:38:34 +01:00
Atgeirr Flø Rasmussen
e1301fa32e Add missing #include directives. 2016-02-14 23:38:24 +01:00
Jørgen Kvalsvik
3143643299 Removes push_back( deque ) from DeckItem
This feature is not used at all.
2016-02-11 15:09:02 +01:00
Joakim Hove
c82dca0dd0 Added update constructor to Messages. 2016-02-05 17:35:23 +01:00
Joakim Hove
3e8c065c58 Merge pull request #675 from joakim-hove/use-ert-unique-ptr
Using unique_ptr in EclipseGrid.
2016-02-05 10:46:04 +01:00
Joakim Hove
a3b004982f Merge pull request #676 from jepebe/updated_travis
Updated TravisCI integration
2016-02-05 10:45:32 +01:00
Joakim Hove
65c5786899 Merge pull request #678 from joakim-hove/internalize-messages
Internalize messages
2016-02-05 10:30:04 +01:00
Joakim Hove
0525b76579 Add ADSALNOD keyword. 2016-02-04 15:55:15 +01:00
Joakim Hove
551e65eca4 Internalize MESSAGES keyword. 2016-02-04 15:14:32 +01:00
Joakim Hove
7d6fd4c08e Renamed items in MESSAGES keyword configuration. 2016-02-04 15:14:07 +01:00
Joakim Hove
ff1802ebb7 Reformatted test adding. 2016-02-04 15:13:40 +01:00
Jean-Paul Balabanian
8572fe3c84 Updated support for Travis. 2016-02-04 11:55:22 +01:00
Joakim Hove
31c69e6702 Using unique_ptr in EclipseGrid. 2016-02-03 16:18:31 +01:00
Jørgen Kvalsvik
8b12fda9c3 Remove unused FloatItem classes
ParserItemFloat and DeckItemFloat is never used within the project.
2016-02-03 12:22:41 +01:00
Joakim Hove
837fe6f80f Merge pull request #669 from jokva/DeckItemT
Reimplement Deck<T>Item with templates
2016-02-03 11:07:04 +01:00
Jørgen Kvalsvik
b7d1e45f99 Move Deck<*>Item implementation into Deck.cpp
Due to their template base, separate source files are trivial and rather
unecessary, so the type-specific implementations are moved into
Deck.cpp.
2016-02-03 09:39:19 +01:00
Jørgen Kvalsvik
3a43509d04 Unify Deck<type>Item implementations.
The Deck<*> classes are mostly straight-up copies of eachother, but with
a different type parameter. Re-implementation of this into common
template implementations with local specialisations where necessary.

Functionally the implementation is identical.
2016-02-03 09:39:18 +01:00
Joakim Hove
ee5795d8e7 Pass -DENABLE_PYTHON in travis 2016-02-02 20:48:40 +01:00
Joakim Hove
b18292b6e3 Build ert with gcc/g++ 4.8 in travis 2016-02-02 17:21:17 +01:00
Jørgen Kvalsvik
381e419329 Adds Schedule::getGroups()
Similar to the already-existant Schedule::getWells, this simple method
returns (const) pointers to all groups, suitable for iteration, maps and
for-all-in operations.
2016-02-01 14:20:05 +01:00
Jørgen Kvalsvik
4b98943665 Replaces unecessary header includes with fwd decls
Every header is self-contained and includes only what it must to
function, relying on users include what they need in source files,
adopting a pay-what-you-use model (in particular for internal
dependencies).
2016-01-26 13:23:22 +01:00
Jørgen Kvalsvik
34eee09fc1 Removes unused header file 2016-01-25 18:47:55 +01:00
Joakim Hove
6892dcc619 Merge pull request #654 from chflo/prediction_keywords
Internalized GEFAC keyword, added support for WCONPROD controlmode option GRUP
2016-01-25 13:20:41 +01:00
Joakim Hove
cd0336c679 Fixup: fix install path 2016-01-25 12:42:10 +01:00
Joakim Hove
ba591bafe6 Merge pull request #659 from joakim-hove/add-python-site-init
Python updates
2016-01-25 12:20:45 +01:00
chflo
c365ca2c06 Tests for GEFAC keyword and WCONPROD GRUP controlmode option 2016-01-25 11:32:09 +01:00
chflo
3f266d02b7 Internalize GEFAC keyword 2016-01-25 11:32:08 +01:00
Jørgen Kvalsvik
72778290d0 Fixes autogen'd .hpp installing into wrong dir 2016-01-25 11:29:18 +01:00
chflo
cc2b7f5f50 Support GRUP controlmode in wellProductionProperties if well is available for group control 2016-01-25 10:47:22 +01:00
chflo
1b329657b7 Added JSON for keyword GEFAC 2016-01-25 10:47:22 +01:00
Joakim Hove
07d3837c01 Added the ability to configure a site module. 2016-01-24 21:40:56 +01:00
Joakim Hove
bd325e7060 Parser python updates:
1 - Add keywords dynamically from Python dictionary.
 2 - Parser.parseFile() can be used both bound and unbound.
2016-01-24 21:40:56 +01:00
Joakim Hove
14428ee000 Merge pull request #656 from jokva/master
Build system improvements & dependency/header cleanup
2016-01-21 11:59:06 +01:00
Jørgen Kvalsvik
04900a4bb6 ParserKeywords.hpp -> ParserKeywordsX.hpp
To reduce compiler stress and be more explicit w.r.t. dependencies, all
files now includes only the keywords they need, instead of the
collection of all files.
2016-01-21 09:25:58 +01:00
Jørgen Kvalsvik
c85a032240 Splits tables' implementations into .cpp file
Most tables are trivial extensions of SimpleTable, but had their
implementation in headers. This required them to include more headers
than we want to expose and makes them harder to maintain and verify.
Instead, all these SimpleTable derivatives are now implemented in
Tables.cpp, only declaring their interfaces in their respective .hpp
files. Clients won't notice the difference.

rebase into tables
2016-01-21 09:23:07 +01:00
Jørgen Kvalsvik
f404828d63 Cleans up headers to improve build preformance
This is an effort to improve build performance.  Several includes
scattered across the project are either unused or partially used (i.e.
just used to import a type name, not depending on the actual contents of
the header file).

Replaces a lot of these includes with forward declarations.
2016-01-21 09:22:06 +01:00
Joakim Hove
35b6ab8ec1 Parser python updates:
1 - Add keywords dynamically from Python dictionary.
 2 - Parser.parseFile() can be used both bound and unbound.
2016-01-19 16:01:51 +01:00
Jørgen Kvalsvik
c2eb0ea934 ParserKeywords split into multiple files
In order to reduce parsing load on clients, the generated ParserKeywords
now come in their own sorted-by-first-letter files, so that inclusion of
the entire tree is unnecessary when only a handful of keywords will do.

This also applies to the generated source code (which is pretty heavy to
compile), which now is split into multiple files to enable parallel
builds.
2016-01-19 15:16:53 +01:00
Joakim Hove
db2fe56f9b Added overload for Parser::addParserKeyword() 2016-01-19 13:39:58 +01:00
Joakim Hove
b73f117f41 Python wrapper for (simple)Table. 2016-01-18 10:41:41 +01:00
Joakim Hove
d59b34bcb5 Added copy constructor for TableIndex. 2016-01-17 16:37:31 +01:00
Joakim Hove
f9d708157e Improvements to table wrapping:
- Added new sub packages ecl_state.tables.
 - Added table class warpping SimpleTable C++ class
 - Added more methods to table_manager.
2016-01-17 09:14:17 +01:00
Joakim Hove
3a426cb4c9 Added simple python wrapper for Parser and Deck.
- Create a new shared library libcopmparser with small files cxxxx
   which wrap general Cxx classes with C linkage.

 - Added Python packages & modules, based on Python ctypes and the
   ert.cwrap package.
2016-01-15 16:35:09 +01:00
Joakim Hove
45c3ffbe15 Added find_package: python_interp and ERTPython. 2016-01-15 16:35:07 +01:00
Joakim Hove
1018c9ef4c Use Deck* and Deck& instead of shared_ptr<Deck>. 2016-01-12 12:16:27 +01:00
Joakim Hove
a9477d057e Added function get cellDxDyDz 2016-01-08 15:36:59 +01:00
Joakim Hove
356958309c Added hasColumn() method. 2016-01-08 14:04:30 +01:00
Joakim Hove
6cff4d5aae Changed PVTO / PVTG implementation 2016-01-08 14:04:29 +01:00
Joakim Hove
a2b64a83eb SimpleTable improvements:
- Added constructor without DeckItem
 - Added addRow( ) method
 - Added random access get( ) methd.
2016-01-08 14:04:28 +01:00
Joakim Hove
d9595c5193 Added TableColumn based overloads. 2016-01-06 09:19:47 +01:00
Joakim Hove
874a5320e7 Changed implementation of all SimpleTable tables. 2016-01-05 12:33:19 +01:00
Joakim Hove
772473ae1c Refactored SimpleTable class 2015-12-21 15:38:49 +01:00
Joakim Hove
40ac6ec7e8 Added class TableColumn. 2015-12-21 15:38:45 +01:00
Joakim Hove
5e469c0676 Added class TableSchema with table metadata. 2015-12-21 15:31:29 +01:00
Joakim Hove
e94d01e88c Added class ColumnSchema with table metadata. 2015-12-21 15:30:54 +01:00
Joakim Hove
a85bac0034 Changes in const'ness 2015-12-21 15:30:14 +01:00
Joakim Hove
102a994190 Added TableIndex to bookkeep linear interpolation. 2015-12-21 14:52:23 +01:00
Joakim Hove
8e0abec3eb Merge pull request #647 from jepebe/OPM-249
OPM-249 Added support for TravisCI
2015-12-15 20:22:31 +01:00
chflo
2ab9a8acdf OPM-252: Added VAPOIL, DISGAS to SimulationConfig 2015-12-15 13:50:54 +01:00
Jean-Paul Balabanian
859ff3e08d OPM-249 Added support for TravisCI 2015-12-15 07:51:48 +01:00
Atgeirr Flø Rasmussen
7e07977f26 Add warning suppression includes. 2015-12-14 14:51:03 +01:00
Atgeirr Flø Rasmussen
460e8c4477 Merge pull request #635 from totto82/nnc
Support for minpv-pinch-nnc
2015-12-14 11:33:16 +01:00
chflo
43216273b4 OPM-250: Added method to IOConfig to support restart 2015-12-09 14:36:09 +01:00
Tor Harald Sandve
369943461e Store the nncs in a vector of a struct rather than three vectors 2015-12-08 12:09:06 +01:00
Tor Harald Sandve
dd0689fef6 Add NNCs 2015-12-08 09:19:07 +01:00
Tor Harald Sandve
3ba7382146 Add missing methods in TableManager.cpp
Add missing methods for MSFN, PMISC, MISC, SGCWMIS and SORWMIS
2015-12-03 15:18:56 +01:00
Tor Harald Sandve
d3f3c74358 Adress minor issues
- rename checkRange() to assertUnitRange()
- use string instead of char
2015-12-01 14:12:39 +01:00
Tor Harald Sandve
dc7cf4ada6 Add missing tables 2015-12-01 13:53:05 +01:00
Tor Harald Sandve
ddcba13dfe Add support for MSFN 2015-12-01 12:19:43 +01:00
Tor Harald Sandve
9badf045a9 Add support for PMISC 2015-12-01 12:19:43 +01:00
Tor Harald Sandve
e97c6461e1 Add support for MISC 2015-12-01 12:19:43 +01:00
Tor Harald Sandve
ce595d7592 Add method to check that table input spans [0,1] 2015-12-01 12:19:43 +01:00
Tor Harald Sandve
5c35b8edeb Add support for SGCWMIS 2015-12-01 12:19:43 +01:00
Tor Harald Sandve
d151bfc83a Add support for SORWMIS 2015-12-01 12:19:42 +01:00
Joakim Hove
fdcd0593a3 Removed leftover opm/core subdirectory. 2015-11-27 12:12:38 +01:00
Joakim Hove
9346824756 ScheduleEnum will accept 'WAT' for 'WATER'. 2015-11-27 11:02:41 +01:00
Atgeirr Flø Rasmussen
0f005b8c68 Use warning suppression headers to avoid warnings from boost. 2015-11-26 10:44:22 +01:00
Atgeirr Flø Rasmussen
d87e20578c Change return type from tuple to array for getCellCenter(). 2015-11-24 14:25:37 +01:00
Kai Bao
33302f6edb moving the multi-segment related to MSW directory. 2015-11-12 12:28:08 +01:00
Kai Bao
97d969839f adding getFromIJK() for CompletionSet 2015-11-12 12:28:08 +01:00
Kai Bao
672d517aa2 using ParserKeywords::COMPSEGS for keywords parsing 2015-11-12 12:28:08 +01:00
Kai Bao
247a82caa1 not internalizing end_IJK. 2015-11-12 12:28:08 +01:00
Kai Bao
626309e8aa adding comments about the branch number. 2015-11-12 12:28:08 +01:00
Kai Bao
e094201097 adding attachedToSegment() to Completion. 2015-11-12 12:28:08 +01:00
Kai Bao
44e61fe620 adding attachSegment() for Completion
removing setSegmentNumber() and setCenterDepth()
2015-11-12 12:28:08 +01:00
Kai Bao
742ba0e14f remvoing the thermal length related processing.
and removing the defaulted 0 value in the keyword definition.
2015-11-12 12:28:08 +01:00
Kai Bao
e90c5b11bb correcting the typo in Schedule
handleWELSEGS to handleCOMPSEGS
2015-11-12 12:28:08 +01:00
Kai Bao
c9a691ce55 throw exectpion when specifying negative value for completion depth 2015-11-12 12:28:08 +01:00
Kai Bao
6c8736f1ce updating ParseMULTSEGWELL intergration test. 2015-11-12 12:28:08 +01:00
Kai Bao
e14d3f6ba1 adding function handleCOMPSEGS()
there are some other small changes to make the compilation work.
2015-11-12 12:28:08 +01:00
Kai Bao
030de17a20 adding updateCompletionsWithSegment() to Compsegs 2015-11-12 12:28:08 +01:00
Kai Bao
f5b3cc3a8a adding processCOMPSEGS() for Compsegs
Determing the related segments for completions and calculating the depth
with segment depth.
2015-11-12 12:28:08 +01:00
Kai Bao
e634fa7c07 adding member variables and functions for segment processing. 2015-11-12 12:28:08 +01:00
Kai Bao
fe50050e0e adding the structure Compsegs
limitations for now:
1.  The input with a range is not supported yet.
2.  More than one completion for a segment is not supported yet.
3.  Calculating distance based on thickness of grid block is not supported yet.
4.  Calculting completion depth based on COMPDAT is not supported yet.
2015-11-12 12:28:07 +01:00
Joakim Hove
7e0aba59fe Renamed parameter to avoid shadow warning. 2015-11-11 10:39:12 +01:00
Joakim Hove
1bde4e48ec ParserKeywords::hasDimension() check all records. 2015-11-11 10:39:11 +01:00
Kai Bao
9a5cb7e9dd handling both HO and H0 for mutliphase model input
to fix a failed test.
2015-11-11 09:33:30 +01:00
Tor Harald Sandve
192f7f698c Rename from HO to H0 2015-11-10 15:20:22 +01:00
Atgeirr Flø Rasmussen
ac478e04e5 Silence warnings from boost. 2015-11-09 16:43:31 +01:00
Kai Bao
ecb0186a08 using const std::string& for well_name and fix CMakeLists.txt
The problem for CMakeLists.txt is from the re-basing process.
2015-11-09 14:09:31 +01:00
Kai Bao
2737a5be31 beginning from the second segment in processINC().
Correcting the typo, although the original version will not cause any
problem. It is good to keep the information consistent.
2015-11-09 13:14:33 +01:00
Kai Bao
a3ddad5645 changing length to total_length to for more correct meaning. 2015-11-09 12:14:09 +01:00
Kai Bao
533de71d64 introducing setDepthAndLength() for Segment
and removing setDepth(), setLength() and setDataReady().
2015-11-09 12:14:09 +01:00
Kai Bao
3492794974 revising processINC() based on re-ordering information. 2015-11-09 12:14:09 +01:00
Kai Bao
544247dd9e revising SegmentSet::processABS() based on re-ordering. 2015-11-09 12:14:09 +01:00
Kai Bao
a27417c1da adding orderSegments() to SegmentSet. 2015-11-09 12:14:09 +01:00
Kai Bao
59d493acef introducing static invalid_value for Segment 2015-11-09 12:14:09 +01:00
Kai Bao
8a0c8838f8 moving the SegmentSet processing to class SegmentSet. 2015-11-09 12:14:09 +01:00
Kai Bao
65e75f2243 using SegmentSetConstPtr and SegmentConstPtr 2015-11-09 12:14:09 +01:00
Kai Bao
bc2f7f1808 deleting m_is_multi_segment from Well
which should have been done when fixing the isMultiSegment() function.
2015-11-09 12:14:09 +01:00
Kai Bao
22bba05754 deleting one unnecessary SegmentSet::numberToLocation() 2015-11-09 12:14:09 +01:00
Kai Bao
ec2d33fdae deleting all the length_x and length_y related.
They are not used for simulation and we are not supporting plotting for
the moment.
2015-11-09 12:14:09 +01:00
Kai Bao
e8ce831fcc removing unuseful setXXX functions in Segment. 2015-11-09 12:14:09 +01:00
Kai Bao
1dc7aa92ff revising function isMultiSegment() and numberSegment() 2015-11-09 12:14:09 +01:00
Kai Bao
c59aff430f correcting the typo in Presure 2015-11-09 12:14:09 +01:00
Kai Bao
b39866ce74 deleting Segments() function from SegmentSet 2015-11-09 12:14:09 +01:00
Kai Bao
b99540228c deleting the depth checking in addSegmentSetINC 2015-11-09 12:14:09 +01:00
Kai Bao
a8eb2b2970 revising function addSegmentSetABS 2015-11-09 12:14:09 +01:00
Kai Bao
4c617e76ac revising segmentsFromWELSEGSKeyword for better readability. 2015-11-09 12:14:09 +01:00
Kai Bao
8704c3eac6 adding a mutlisegment wells intergration test. 2015-11-09 12:14:08 +01:00
Kai Bao
2d0b5d8237 changing getRawDouble to getSIDouble in SegmentSet. 2015-11-09 12:12:39 +01:00
Kai Bao
2ed7e5985d adding addSegmentSet() to Well 2015-11-09 12:12:39 +01:00
Kai Bao
3e9320fc31 adding function handleWELSEGS to Schedule. 2015-11-09 12:12:39 +01:00
Kai Bao
157c86ea39 adding the multi-segment related member to Well. 2015-11-09 12:12:39 +01:00
Kai Bao
3e896fbeda removing the dependence on NLBRMX and NSEGMX
which is for Fortran style memory management. Although it can also be
good for preventing people from giving too random branch numbers and
segment numbers.
2015-11-09 12:12:39 +01:00
Kai Bao
4111146685 adding class SegmentSet 2015-11-09 12:12:39 +01:00
Kai Bao
edfefc7dd1 adding enumeration types in ScheduleEnums for the segment support. 2015-11-09 12:12:39 +01:00
Kai Bao
66e9e5bee5 adding Segment class. 2015-11-09 12:12:39 +01:00
Joakim Hove
9ee519ccc0 Changed signature in hasEvent() to allow multiple. 2015-11-09 12:05:28 +01:00
Joakim Hove
66423aacd0 Added integration test for modifiers in Schedule. 2015-11-09 12:05:28 +01:00
Joakim Hove
debcf2ed80 New method EclipseState::applyModifierDeck() 2015-11-09 12:05:27 +01:00
Joakim Hove
508e282d2f Added TransMult::applytMULTFLT( Fault ) overload. 2015-11-09 12:05:11 +01:00
Joakim Hove
e6f9843882 Updated error message. 2015-11-09 12:05:10 +01:00
Joakim Hove
aba35b180d Added isKeyword<> template method. 2015-11-09 12:05:10 +01:00
Joakim Hove
2b3e1c381a Added 'minideck' to Schedule object. 2015-11-09 12:05:10 +01:00
Joakim Hove
2ef418bf86 Added: DynamicVector::assertSize() 2015-11-09 12:05:09 +01:00
Joakim Hove
2cd69fcbda Added iget() and iset() methods to DynamicVector. 2015-11-09 12:05:09 +01:00
Joakim Hove
b20f46649d Track Schedule event GEO_MODIFIERS. 2015-11-09 12:05:08 +01:00
Tor Harald Sandve
d3a38b5039 Add test
Wells where crossflow is banned and the total rate is zero is not allow
to open. A test is added to check this behaviour.
2015-11-09 09:54:10 +01:00
Tor Harald Sandve
abe925ff2f Add method Well::canOpen(currentStep) and use it in Schedule 2015-11-09 09:52:23 +01:00
Tor Harald Sandve
a66c820f0a Prevent wells with zero rate and crossflow disabled to open 2015-11-05 14:37:47 +01:00
Joakim Hove
e08f369b97 Merge pull request #623 from andlaus/fix_build
fix build when using newish Boost libraries
2015-10-30 14:35:54 +01:00
Andreas Lauser
b99029a8b9 fix build when using newish Boost libraries
it seems that recent Boost versions (I used 1.59) enforce a semicolon
behind the BOOST_CHECK macros, while older ones did not.
2015-10-30 14:32:34 +01:00
Joakim Hove
4178257b17 Merge pull request #622 from joakim-hove/dynamic-vector
Dynamic vector
2015-10-30 10:33:45 +01:00
Joakim Hove
a5b97fc2b8 Implemented Events with DynamicVector.
As a side side effect the m_events member in the Schedule class has
become a shared pointer.
2015-10-29 14:28:24 +01:00
Joakim Hove
931f430028 Added simple DynamicVector bound to TimeMap. 2015-10-29 14:28:22 +01:00
Joakim Hove
90c55b0257 Drop BHP control when producer <-> injector. 2015-10-29 12:49:30 +01:00
Joakim Hove
ce9727b337 Added method for change injector <-> producer.
Will reset producer BHP limit to zero when changing to an injector, and
visa versa.
2015-10-28 17:13:34 +01:00
Joakim Hove
da7871feaf Enable BHP control for history and WELTARG. 2015-10-28 17:13:33 +01:00
Joakim Hove
6027711bad Minor prettyfying of test. 2015-10-28 17:13:31 +01:00
Joakim Hove
461c74cc57 Do not update well BHP limit from WCONHIST. 2015-10-28 17:13:29 +01:00
Tor Harald Sandve
863e96c673 Test for changing BhpLimit in history mode using weltarg 2015-10-28 17:13:28 +01:00
Markus Blatt
d0b54e9f25 Fixes warning about ignored qualifiers on function return types.
In particular this warning is removed:
"In file included from /home/mblatt/src/dune/opm/opm-parser/opm/parser/eclipse/EclipseState/EclipseState.cpp:34:0:
/home/mblatt/src/dune/opm/opm-parser/opm/parser/eclipse/EclipseState/Grid/SatfuncPropertyInitializers.hpp:438:66: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
     const SaturationFunctionFamily getSaturationFunctionFamily() const{"
                                                                  ^
2015-10-22 16:09:41 +02:00
Joakim Hove
95fde2080c Merge pull request #612 from akva2/add_versioning
added/fixed: set soversion for libraries
2015-10-19 13:56:18 +02:00
Arne Morten Kvarving
1d3b35c426 added/fixed: set soversion for libraries 2015-10-19 13:34:19 +02:00
Atgeirr Flø Rasmussen
7b0a6d2556 Make dist() call well-defined. 2015-10-19 11:00:42 +02:00
Kristian Flikka
c1e1e4bdd1 Deleted unused file MULTREGT.cpp 2015-10-16 13:50:03 +02:00
Kristian Flikka
a2c21f5d88 Added missing curly brace (found using sonar with cppcheck and vera++) 2015-10-16 13:01:39 +02:00
Joakim Hove
88fbe579ed Merge pull request #603 from totto82/shut_crossflow
Shut wells with zero rates and crossflow not allowed
2015-10-12 16:12:18 +02:00
Tor Harald Sandve
539e75081f Add paranthesis 2015-10-12 12:28:12 +02:00
Atgeirr Flø Rasmussen
c937867286 Do not use const for value return. 2015-10-12 10:04:35 +02:00
Joakim Hove
fa4ebe7931 Merge pull request #606 from qilicun/sgwfn
Add keyword SGWFN.
2015-10-12 08:47:20 +02:00
Liu Ming
664b6a80e5 SGWFN table. 2015-10-12 14:26:51 +08:00
Joakim Hove
3dfbc75bc4 Merge pull request #594 from iLoop2/AddDRSDT_DRVDT_VAPPOR
Add keywords DRSDT DRVDT VAPPARS
2015-10-12 08:18:54 +02:00
Liu Ming
68a9366d8d Add keyword SGWFN. 2015-10-12 10:56:21 +08:00
Liu Ming
eca2105f82 make the parameter as const. 2015-10-09 17:28:20 +08:00
Liu Ming
b0995cfc0b add PinchMode from string function. 2015-10-09 17:23:37 +08:00
Liu Ming
98f2659c84 add PinchMode to instead of string. 2015-10-09 16:28:53 +08:00
Fredrik Gundersen
ec74096dcb Changed return value for option to bool 2015-10-09 09:50:09 +02:00
Liu Ming
7181255d6d Add support for PINCH item 4 and 5. 2015-10-09 10:29:33 +08:00
Tor Harald Sandve
99c03c3914 Shut wells with zero rates and crossflow not allowed
Note: Producing wells in prediction mode is kept open even if the
control rate is set to zero.
2015-10-08 12:17:29 +02:00
Andreas Lauser
8db8167395 use the error macros from opm-common 2015-10-08 11:42:15 +02:00
Andreas Lauser
6bf907b0db use the error macros from opm-common 2015-10-08 11:42:15 +02:00
Fredrik Gundersen
80a77136cf Fix OilVaporizationProperties to have only one constructor 2015-10-08 11:17:24 +02:00
Joakim Hove
b67c183544 Merge pull request #600 from totto82/crossflow
Add flag allowCrossFlow()
2015-10-07 23:23:13 +02:00
Tor Harald Samdve
0d4d71dcef Use the autogenerated build constants 2015-10-07 12:23:04 +02:00
Atgeirr Flø Rasmussen
6cf9d01cc3 Avoid shadowing the 'record' variable. 2015-10-07 09:43:51 +02:00
Fredrik Gundersen
32914e2ed4 Merge remote-tracking branch 'upstream/master' 2015-10-07 07:59:02 +02:00
Tor Harald Sandve
9665b54ad3 Add flag allowCrossFlow()
This PR adds support for item 10 in welspecs where a flag is used to
determine whether the well should allow cross flow or not.

A test is added to check default behavior.
2015-10-06 15:47:07 +02:00
Joakim Hove
51e3aa82cc Update include path 2015-10-06 11:30:43 +02:00
Joakim Hove
dcb92434fd warning that warning macros moved to opm-common. 2015-10-06 11:29:35 +02:00
Joakim Hove
6dee686dc0 Implemented accessor functions for REGDIMS. 2015-10-06 08:44:00 +02:00
Joakim Hove
7070517d1c Removed debug output. 2015-10-05 07:46:49 +02:00
Joakim Hove
b3972de557 Immplemented PLYSHLOG table with TableContainer.
The PLYSHLOG table specification is based on alternating header and data
records, this is not supported by th parser - and the thing will throw
if more than table is specified.
2015-10-04 20:03:54 +02:00
Joakim Hove
ea86b51b8d TableContainer for PLYMAX and PLYROCK. 2015-10-04 20:03:53 +02:00
Joakim Hove
40fa456603 TableContainer for PLYADS,PLYDHFL and PLYVISC. 2015-10-04 20:03:51 +02:00
Joakim Hove
821bc9bc9e Implemented ROCKTAB with TableContainer. 2015-10-04 20:03:48 +02:00
Joakim Hove
fae6a9086f Added keyword ROCKCOMP. 2015-10-03 17:32:12 +02:00
Joakim Hove
4857f2299f Using TableContainer for RTEMPVD. 2015-10-03 17:32:12 +02:00
Joakim Hove
d1451bc4e3 Using TableContainer for gas viscosity. 2015-10-03 17:32:12 +02:00
Joakim Hove
1542957e49 Using TableContainer for oil and water viscosity. 2015-10-03 17:32:11 +02:00
Joakim Hove
eb69d85ee4 TableContainer: PVDO, PVDS and PVDG. 2015-10-03 17:32:11 +02:00
Joakim Hove
d9c5811e90 TableContainer: ENKRVD, ENPTVD, IMKRVD and IMPTVD. 2015-10-03 17:32:10 +02:00
Joakim Hove
295385cab7 TableContainer for RSVD and RVVD tables. 2015-10-03 17:32:10 +02:00
Joakim Hove
9c9e9f48fd TableContainer for SGFN, SWFN and SSFN tables. 2015-10-03 17:32:09 +02:00
Joakim Hove
836ea66a49 TableContainer for SWOF,SGOF,SLGOF,SOF2 ans SOF3. 2015-10-03 17:32:08 +02:00
Joakim Hove
f77e1af9f0 Added TableContainers for the simplest tables. 2015-10-03 17:32:08 +02:00
Joakim Hove
d1bb9bd2f0 Added Eqldims and Regdims wrapper classes 2015-10-03 17:32:07 +02:00
Joakim Hove
d377345f95 Added map of tablecontainers to TableManager. 2015-10-03 17:32:07 +02:00
Joakim Hove
2e1533c945 Added new default based Tabdims constructor. 2015-10-03 17:32:06 +02:00
Joakim Hove
dfb2ff6744 All simple table inits called from common method. 2015-10-03 17:32:06 +02:00
Joakim Hove
f9b1063175 Added simple TableContainer 2015-10-03 17:32:05 +02:00
Fredrik Gundersen
cc66cfff51 Merge remote-tracking branch 'upstream/master' 2015-10-02 10:55:42 +02:00
Fredrik Gundersen
d234c4a1bd OPM-230 Added tests for the new keywords 2015-10-02 10:49:56 +02:00
Fredrik Gundersen
73621d3f21 OPM-230 Added support for keywords 2015-10-02 10:49:23 +02:00
Fredrik Gundersen
65e2e22321 OPM-230 Created new enum 2015-10-02 10:48:45 +02:00
Fredrik Gundersen
8cc250d9fe OPM-230 Expanded the propertie class 2015-10-02 10:48:15 +02:00
Joakim Hove
ee6b5c9675 Added basic support for PLYADSS keyword. 2015-10-01 13:32:12 +02:00
Joakim Hove
f9accc018d Merge pull request #593 from joakim-hove/rename-elastic-vector
Renamed ElasticVector -> RecordVector
2015-09-29 23:04:04 +02:00
Joakim Hove
f2132df245 Added TABDIMS 25 items test 2015-09-29 18:50:06 +02:00
Joakim Hove
138e27fd92 Renamed ElasticVector -> RecordVector 2015-09-29 08:08:57 +02:00
Fredrik Gundersen
0f728302c7 OPM-230 Adde new properties file 2015-09-28 14:32:41 +02:00
Fredrik Gundersen
afcd37f9c8 OPM-230 Added new properties file for Oil Vap. 2015-09-28 14:31:36 +02:00
Joakim Hove
c1e94f788f ParseMode::PARSE_EXTRA_DATA
Extra elements in the input record are handled with
ParseMode::handleError() with the new error mode PARSE_EXTRA_DATA.
2015-09-28 13:43:22 +02:00
Joakim Hove
7b5894f4c9 Merge pull request #591 from joakim-hove/extend-tabdims
Updated the TABDIMS keyword.
2015-09-28 12:17:41 +02:00
Joakim Hove
d9f4264f30 Updated the TABDIMS keyword. 2015-09-28 12:17:10 +02:00
Joakim Hove
5d43c1d38e Merge pull request #586 from chflo/OPM-218-fix
Opm 218 fix
2015-09-25 11:23:53 +02:00
chflo
b773756be0 OPM-218-fix: Changes in ScheduleTests due to change in IOConfig logic 2015-09-25 10:29:39 +02:00
chflo
a39eb28f2d OPM-218-fix: Changes in EclipseStateTests due to change in IOConfig logic 2015-09-25 10:29:39 +02:00
chflo
67800715db OPM-218-fix: Cleanup in IOConfigTest.cpp 2015-09-25 10:29:38 +02:00
chflo
b209f796a6 OPM-218-fix: Changed TimeMapTest.cpp due to changed method signatures and functionality 2015-09-25 10:29:29 +02:00
chflo
1e83914a61 OPM-218-fix: Added integration testing against SPE1CASE2 2015-09-25 10:29:27 +02:00
chflo
fb3cc31c2c OPM-218-fix: Added testdata 2015-09-25 10:29:27 +02:00
chflo
b1ddf6deb5 OPM-218-fix: Fix in method getWriteRestartFileFrequency() for rptrst basic=3/4/5 2015-09-25 10:29:07 +02:00
chflo
f7046ff8e0 OPM-218-fix: TimeMap: Added vectors and methods for timestep Years/Months, init only once 2015-09-25 10:28:23 +02:00
Joakim Hove
8fc2927beb Hooops to support CPR in both SUMMARY and RUNSPEC. 2015-09-24 21:55:03 +02:00
Joakim Hove
e7f7c3ca3e Added class SUMMARYSection. 2015-09-24 21:17:11 +02:00
Joakim Hove
5288d5f2cc Initialize useCPR to false. 2015-09-24 20:46:15 +02:00
Joakim Hove
826bf33d5d Merge pull request #587 from joakim-hove/CPR-workaround
Temporarily remove parser support for CPR keyword
2015-09-23 15:58:28 +02:00
Joakim Hove
f365dae56e Internalize ParseMode in EclipseState. 2015-09-23 10:36:10 +02:00
Joakim Hove
703427caba Added OpmLoadDeck and load tests for opm-data. 2015-09-22 15:09:50 +02:00
Joakim Hove
e274826827 Added keyword OLDTRAN. 2015-09-22 15:03:42 +02:00
Joakim Hove
5c9c481fd1 Set default useCPR to True. 2015-09-22 10:08:04 +02:00
Joakim Hove
3e7fe5e027 Temporarily removed parser support for CPR keyword 2015-09-22 09:25:52 +02:00
Joakim Hove
6623b87ee6 Added Polymer integration test. 2015-09-17 22:28:30 +02:00
Joakim Hove
5cc263fe2a Fixed bug in PLYMAX table. 2015-09-17 22:28:12 +02:00
Joakim Hove
a44733405d Fixed special initialisation of PLYROCK tables. 2015-09-17 18:47:21 +02:00
Kjell W. Kongsvik
d15b472704 Support for CPR keyword in SimulationConfig 2015-09-15 16:43:01 +02:00
Kjell W. Kongsvik
dc0cc45e89 Allowed parser keywords without items 2015-09-15 16:43:01 +02:00
Joakim Hove
3dd8aad70b Changed MultiRecordTable implementation:
- Will not use any getFlatXxx() methods.

  - Will fetch item0 and items1 for reference Rs value and table data
    respectively.
2015-09-14 16:35:10 +02:00
Joakim Hove
8e649ec7e6 Changed PLYSHLOG implementation:
- Using the ParserKeywords::PLHSYLOG::ITEM templated access for items.
2015-09-14 16:35:09 +02:00
Joakim Hove
edad0b3795 Removed unneccessary typedef. 2015-09-14 16:35:06 +02:00
Joakim Hove
2681d1cc8f Refactor SimpleTable:
The SimpleTable class is initialized with a DeckItem instance containing
all the date for the table, instead of a DeckRecord (or DeckKeyword). As
a consequence the getFlatXxxx() methods have been removed.
2015-09-14 16:35:05 +02:00
Joakim Hove
3aff5378e7 Removed stale tests - moved to TableManagerTests. 2015-09-14 16:35:03 +02:00
Joakim Hove
bca167a53a Added THCONR as grid property 2015-09-11 14:03:30 +02:00
Joakim Hove
c75f7b4fcf Added hasItem() method to DeckRecord 2015-09-11 14:03:29 +02:00
Joakim Hove
fb0daa39f4 Changed std::cout message for keywordloader. 2015-09-11 14:03:28 +02:00
Joakim Hove
714990ae97 DeckXXX returns const std::string&.
fixup! DeckStringItem returns const std::string&.
2015-09-11 14:03:28 +02:00
Joakim Hove
99aa34588c Added some new keywords. 2015-09-11 14:03:27 +02:00
Joakim Hove
260ceeb757 Added BEFORE attribute to include_directories( ) 2015-09-10 17:38:15 +02:00
Fredrik Gundersen
2ca3b0c3ab Merge pull request #575 from joakim-hove/table-refactor
Minor table refactor
2015-09-09 13:48:08 +02:00
Atgeirr Flø Rasmussen
1a772d8edd Merge pull request #578 from akva2/rename_common
changed: sync with renaming to opm-common
2015-09-09 11:37:31 +02:00
Arne Morten Kvarving
f1feae7a9d changed: sync with renaming to opm-common 2015-09-08 10:34:45 +02:00
Joakim Hove
ebd1354805 Renamed SingleRecordTable -> SimpleTable 2015-09-07 15:54:14 +02:00
Joakim Hove
5e6044061b Using DeckRecord in table init() methods. 2015-09-07 15:54:11 +02:00
Joakim Hove
5fa02b7f17 Removed typedef SingleRecordTable ParentType; 2015-09-07 15:54:08 +02:00
Joakim Hove
e258097c19 Merge pull request #576 from iLoop2/OPM-223
Support for WCONINJH
2015-09-07 12:26:31 +02:00
Fredrik Gundersen
956b7c53fb OPM-223 Changed error text 2015-09-07 12:19:55 +02:00
Andreas Lauser
21ca5336e4 add the STONE1EX keyword 2015-09-04 17:55:06 +02:00
Fredrik Gundersen
69abd7b0ce OPM-223 Fix wrong factor used on Gas 2015-09-04 13:46:23 +02:00
Fredrik Gundersen
e8f9114944 OPM-223 Added missing behavior to WELTARG 2015-09-04 13:42:10 +02:00
Joakim Hove
7f853e9709 Merge pull request #572 from atgeirr/fix-minor-bug-and-warnings
Fix minor bug and warnings
2015-09-02 15:13:25 +02:00
babrodtk
c113c80e42 Changed throw => catch to an if test instead 2015-09-02 13:49:32 +02:00
Atgeirr Flø Rasmussen
76e6972042 Silence various warnings. 2015-09-02 13:08:11 +02:00
Atgeirr Flø Rasmussen
5981df7f82 Bugfix: adding integer to string literal is not concatenation. 2015-09-02 13:07:26 +02:00
Christine Fløysand
273b1ecdda Merge pull request #571 from chflo/OPM-222
OPM-222: Fixed error in completionorder enum conversion method
2015-09-02 12:27:23 +02:00
chflo
adcfba1810 OPM-222: Fixed error in completionorder enum conversion method 2015-09-02 12:24:33 +02:00
Joakim Hove
d0c9006580 Added getVFPTables 2015-09-01 17:54:07 +02:00
Joakim Hove
86b63013f3 Removed initSimpletables from EclipseState 2015-09-01 17:54:07 +02:00
Joakim Hove
cf5b4e36f8 Renamed file Tables -> TableManager 2015-09-01 17:54:06 +02:00
Joakim Hove
8bf744e590 Renamed class Tables -> TableManager 2015-09-01 17:54:05 +02:00
Joakim Hove
7c8152bb27 This works: renamed back -> Tables 2015-09-01 17:54:03 +02:00
Joakim Hove
07e5fa04ce Moved PVTO and PVTG tables EclipseState -> Tables 2015-09-01 17:54:02 +02:00
Joakim Hove
0250a9408c Moved VFP Tables EclipseState -> Tables 2015-09-01 17:54:01 +02:00
Joakim Hove
9e79fa2e41 Moved xxxVD tables EclipseState -> Tables 2015-09-01 17:54:01 +02:00
Joakim Hove
688447bc0d Moved PLYSHLOG EclipseState -> Tables 2015-09-01 17:54:00 +02:00
Joakim Hove
9c8c38bd9e Moved RTEMPVD table EclipseState -> Tables 2015-09-01 17:53:59 +02:00
Joakim Hove
39ad0dcfe5 MOved GASVISC tables EclipseState -> Tables 2015-09-01 17:53:58 +02:00
Joakim Hove
a032ea925d Moved RockTables EclipseState -> Tables 2015-09-01 17:53:57 +02:00
Joakim Hove
91d5facc4b Moved simple polymer tables EclipseState -> Tables 2015-09-01 17:53:56 +02:00
Joakim Hove
9cb2440068 Moved OILVISCT and WATVISCT EclipseState -> Tables 2015-09-01 17:53:55 +02:00
Joakim Hove
6709a7a377 Moved PVDS EclipseState -> Tables 2015-09-01 17:53:54 +02:00
Joakim Hove
fc69fe6c80 Moved SGFN, SSFN and SWFN EclipseState -> Tables 2015-09-01 17:53:53 +02:00
Joakim Hove
d08d8799c7 Moved PVDO & PVDG EclipseState -> Tables 2015-09-01 17:53:52 +02:00
Joakim Hove
805b14de09 Moved SOF2 & SOF3 EclipseState -> Tables 2015-09-01 17:53:52 +02:00
Joakim Hove
05775392b9 Moved SLGOF EclipseState -> Tables 2015-09-01 17:53:50 +02:00
Joakim Hove
265219d322 Moved SGOF EclipseState -> Tables 2015-09-01 17:53:50 +02:00
Joakim Hove
bc852bc974 Moved SWOF EclipseState -> Tables 2015-09-01 17:53:48 +02:00
Joakim Hove
dd1f425d32 Moved tabdims instance EclipseState -> Tables 2015-09-01 17:53:47 +02:00
Joakim Hove
e81a1e6880 Added empty TableManager class 2015-09-01 17:53:46 +02:00
chflo
2c27fa6076 Fix in getWells(..wellNamePattern), - use new Well::wellNameInWellNamePattern 2015-08-31 18:57:40 +02:00
chflo
a19c52566d OPM-222: Support COMPORD: Change in ParseModeTests due to added COMPORD INPUT support 2015-08-31 18:57:40 +02:00
chflo
fb9105d1e9 OPM-222: Support COMPORD: Verify new compord support 2015-08-31 18:57:39 +02:00
chflo
dba0ce4582 OPM-222: Support COMPORD: Check compord when handling WELSPECS 2015-08-31 18:57:39 +02:00
chflo
2cf06a2a4f OPM-222: Support COMPORD: Added comporder property to Well class 2015-08-31 18:57:38 +02:00
chflo
47ef5d3c9a OPM-222 Added new enum for completionOrder 2015-08-31 18:57:38 +02:00
chflo
e5dbfd9359 OPM-222: Support COMPORD: Added new class DeckTimeStep and populate SCHEDULESection with DeckTimeSteps 2015-08-31 18:57:37 +02:00
Atgeirr Flø Rasmussen
61c33599cf Silence unused argument warning. 2015-08-31 11:05:18 +02:00
Joakim Hove
717821cf90 Changed int -> size_t to squash warnings. 2015-08-28 15:20:44 +02:00
Joakim Hove
6701f91d90 Merge pull request #563 from andlaus/support_SLGOF
Support slgof
2015-08-25 18:05:47 +02:00
Joakim Hove
451fb97439 Added SimulationConfig::hasThresholdPressure() 2015-08-25 15:26:03 +02:00
Joakim Hove
f7283eb238 Changed THPRES implementation
With the current implementation the THPRES pressure table is implemented
with a map indexed by the equilibration region indicies for the regions
in contact.
2015-08-25 12:01:56 +02:00
Joakim Hove
e1e2487d5d ParseMode::INTERNAL_ERROR_UNINITIALZIED_THPRES 2015-08-25 12:01:55 +02:00
Andreas Lauser
619bd45052 update getSaturationFunctionFamily() for SLGOF
again, thanks to [at]totto82 for finding this
2015-08-25 11:48:30 +02:00
Andreas Lauser
018547eac4 add unit test for SLGOF
thanks to [at]totto82
2015-08-25 11:32:50 +02:00
Andreas Lauser
698a296cb4 SlgofTable: make the checks more strict
thanks to [at]totto82 for the hint.
2015-08-25 11:32:50 +02:00
Andreas Lauser
c99d0b08d3 implement finding the endpoints for SLGOF
before the code expected the SGOF tables to be used for family 1.
2015-08-25 11:32:50 +02:00
Andreas Lauser
dd99ac75a5 implement the table class for the SLGOF keyword
as far as I can see, this is the table which is required to support
all saturation functions.
2015-08-25 11:32:50 +02:00
Joakim Hove
3ee3c023e6 Handle quotes when stripping off comments. 2015-08-24 20:06:01 +02:00
Fredrik Gundersen
b10401d7c4 Added verification of values in ThresholdPressureTest 2015-08-24 15:35:32 +02:00
Fredrik Gundersen
5421609e65 Fixed tests to work with the new TP behavior 2015-08-24 14:26:01 +02:00
Fredrik Gundersen
e493ad22cb Added new Threshold Pressure behavior 2015-08-24 14:24:53 +02:00
Joakim Hove
89336ac6d8 Merge pull request #555 from chflo/OPM-217
Opm 217 IOConfig restart write
2015-08-19 12:07:52 +02:00
Tor Harald Sandve
aa3515fc6a Add phase info to tests
OIL, GAS and WATER is specified to avoid the 3-phase assert test in
SatfuncPropertyInitializers to fail
2015-08-19 09:05:10 +02:00
chflo
920759b2e0 OPM-217: IOConfig - changes after review 2015-08-18 16:50:24 +02:00
Joakim Hove
bb6537f631 Fixed minor bug. 2015-08-18 16:01:53 +02:00
Tor Harald Sandve
c6ac070b4f Remove print() 2015-08-18 13:34:00 +02:00
Tor Harald Sandve
70835021f7 Fix bug in ISWCR default? 2015-08-17 11:29:16 +02:00
Tor Harald Sandve
f59ca7f392 Support familyII in the SatfuncInitializer
- Moves saturation function family check from EclipseState to
SatfuncPropertyInitializers
- Add tests in SatfuncPropertyInitializersTests
- Fixes error in the SatfuncPropertyInitializers implementation for
familyII
2015-08-17 11:29:16 +02:00
Tor Harald Sandve
641ff37832 Support for family 2 is added to the satfunc property initializer
Now either family I (SWOF,SGOF) or family II (SWFN, SGFN and SOF3)
keywords can be specified.

Other keyword alternatives like SLGOF, SOF2 and SGWFN and the two
dimensional saturation tables are still not supported.
2015-08-17 11:29:16 +02:00
Tor Harald Sandve
c081090a30 Add function for getting the saturation function family
If SWOF and SGOF (family1) are specified in the deck the function
returns 1
If SWFN, SGFN and SOF3 (family2) are specified in the deck the function
return 2
If keywords are missing or mixed, an error is given.
2015-08-17 11:29:15 +02:00
Joakim Hove
3b12ed762d Merge pull request #554 from atgeirr/fix-groupcontrol-resv
Add reservoirVolumeTarget property for group production.
2015-08-14 13:47:32 +02:00
Joakim Hove
1f54a118a0 Merge pull request #552 from babrodtk/vfpinj
Updates for VFPINJ
2015-08-14 09:45:15 +02:00
chflo
a09ff8b80e OPM-217: Added integration test for IOConfig handling of restart file write 2015-08-13 11:43:30 +02:00
chflo
bbe73bd0fa OPM-217: Fixed IOConfig RPTRST BASIC with frequency 2015-08-13 11:41:03 +02:00
chflo
de844ad4b9 OPM-217: Added support for RPTSOL RESTART keyword to IOConfig 2015-08-13 11:35:18 +02:00
Atgeirr Flø Rasmussen
dc5a19a402 Add reservoirVolumeTarget property for group production.
Also change defaults for production rate properties to
-999e100, since 0 is an actual possible rate, and while
it would be possible to ask if a default was applied
(the default should be no rate or limit, not a zero rate),
unlike for wells there are no methods doing this currently.
2015-08-13 10:23:32 +02:00
Joakim Hove
e0b0c11864 Initialize group rates to large negative number.
Temporary fix to get old two phase simulators to work.
2015-08-12 15:28:12 +02:00
babrodtk
905715d74a Updated defaults and removed comments in WCONPROD for VFP tables 2015-08-12 10:34:29 +02:00
babrodtk
3c7e1c5624 Updates for VFPINJ 2015-08-11 16:28:52 +02:00
Joakim Hove
fdc8a0f936 Merge pull request #550 from totto82/familiy2
Add support for sat func family 2 keywords
2015-08-11 15:18:25 +02:00
Joakim Hove
482cba0639 Disable external warning: -Wunused-local-typedefs 2015-08-10 17:00:29 +02:00
Joakim Hove
d26428dd52 Reimplmented ParseMode based on string keys.
Completely reimplemented the ParseMode class. Now the main datastructure
is a map<string,action> where the possible error situations are the
keys. This approach allows for a much more flexible
setting/filtering/querying of the ParseMode settings.
2015-08-10 14:27:53 +02:00
Joakim Hove
601f1b577b Merge pull request #549 from atgeirr/fix-warnings
Fix warnings
2015-08-10 14:27:26 +02:00
Tor Harald Sandve
b9f1dd4fc9 Add support for sat func family 2 keywords
Saturation functions input using SGFN and SOF3
2015-08-10 14:07:18 +02:00
Atgeirr Flø Rasmussen
88049d4023 Disable external warning -Wcast-align. 2015-08-10 13:27:27 +02:00
Atgeirr Flø Rasmussen
c86dc758af Disable external warning -Wunused-parameter. 2015-08-10 13:23:05 +02:00
Joakim Hove
19e8c48bea Merge pull request #548 from totto82/ssfn
Add support for SSFN
2015-08-10 13:12:03 +02:00
Atgeirr Flø Rasmussen
3845e1c239 Suppress warnings from boost.
Done by using the disable_warnings.h and reenable_warnings.h headers.
In some cases also a little reordering of includes, to put all boost
includes in the warning-suppressed part.
2015-08-10 13:06:50 +02:00
Atgeirr Flø Rasmussen
21dda31ce6 Silence unused argument warnings. 2015-08-10 13:06:32 +02:00
Atgeirr Flø Rasmussen
519cdc6766 Fix bug in printf() output: formats and types. 2015-08-10 13:04:43 +02:00
Atgeirr Flø Rasmussen
3764c41405 Fix minor bug in helper function. 2015-08-10 12:50:49 +02:00
Atgeirr Flø Rasmussen
901a192caa Add warning-suppression utility headers. 2015-08-10 10:52:17 +02:00
Tor Harald Sandve
e211079648 Add support for SSFN
SSFN keyword is used by the solvent model to modify the gas/solvent
saturation functions
2015-08-10 08:43:01 +02:00
Joakim Hove
99cdc94345 Made exception message more useful. 2015-08-07 17:03:41 +02:00
Joakim Hove
18ead807f7 Changed VFPPRod string -> enum conversion routines.
Main change is in VFPPRod::getALQTYpe() where we use the
DeckItem::defaultApplied() method instead of comparing with the special
default value ' '. The other functions are changed just to be consistent.
2015-08-07 16:33:02 +02:00
Joakim Hove
c4e53b5621 Merge pull request #545 from joakim-hove/THPRES-parsemode
Added ParseMode switch for missing data in THPRES.
2015-08-07 16:31:48 +02:00
Joakim Hove
e964701023 Added ParseMode switch for missing data in THPRES. 2015-08-07 16:30:38 +02:00
Joakim Hove
c1e47e7053 Merge pull request #544 from babrodtk/vfp_printout_fix
Updated printout to be less verbose for not-so-nice data
2015-08-07 16:13:14 +02:00
Joakim Hove
bd5accc711 Merge pull request #543 from joakim-hove/COMPORD
Added ParseMode setting to handle COMPORD
2015-08-07 15:15:44 +02:00
Joakim Hove
1b752d59cf Added ParseMode setting to handle COMPORD 2015-08-07 15:13:52 +02:00
Joakim Hove
a344876a31 Merge pull request #537 from totto82/PVDS
Add support for PVDS
2015-08-07 13:34:39 +02:00
Joakim Hove
bdaa7090cf Merge pull request #542 from joakim-hove/Schedule-geo-message
Changed error message.
2015-08-07 12:01:15 +02:00
Joakim Hove
a79754bc1a Changed error message. 2015-08-07 12:00:26 +02:00
Joakim Hove
9c80bc2a53 Merge pull request #540 from joakim-hove/master
Fixed bug with nested includes
2015-08-07 10:59:44 +02:00
Joakim Hove
35d22ca526 Fixed bug with nested includes 2015-08-07 10:58:34 +02:00
Atgeirr Flø Rasmussen
3cc48145a1 Update case-insensitive-filesystem tests to use new ParserMode. 2015-08-07 10:43:31 +02:00
Tor Harald Sandve
a4a9de7d5e Add pvdsTables.hpp to cmakelist 2015-08-07 10:24:21 +02:00
Joakim Hove
5c55af2f86 Trim spaces before detecting randomSlash. 2015-08-07 10:22:00 +02:00
Tor Harald Sandve
46d787c7ce Add support for PVDS
-the PVDS implementation is essentially a copy of the PVDG
implementation as the PVDS table analogous the PVDG table
2015-08-07 10:09:48 +02:00
Joakim Hove
b253d828c7 Bug in IOConfig: using wrong timemap. 2015-08-06 17:06:15 +02:00
Joakim Hove
10a211cf8b Fixed bug in DynamicState when updating default. 2015-08-06 16:58:43 +02:00
Joakim Hove
f389fe2eca Fixed bug with IOConfig initialization. 2015-08-06 15:12:57 +02:00
Joakim Hove
268237f19b Added IOConfig integrationtest. 2015-08-06 15:12:56 +02:00
Joakim Hove
3ffbe75680 !! Fixed test due to bug in ScheduleParsing
During the work with ParseMode the the construction of the Schedule
object has been changed; previously the complete deck was iterated in
the method iterateSchedulesection() - whereas the correct is to only
iterate over the keywords in the Schedule section. This has led to a
minor fixup in the testdata for this commit.

There are probably more bugs in the IOConfig object - because there
RPTRST / RPTSCHED / keywords in the SOLUTION section have been taken
into account twice, both as part of the SOLUTION and then again
incorrectly as part of the SCHEDULE section.
2015-08-06 15:12:54 +02:00
Joakim Hove
e368a05e00 Merge fixup 2015-08-06 15:12:53 +02:00
Joakim Hove
91bd434963 Added ParseMode::randomSlash setting. 2015-08-06 15:12:51 +02:00
Joakim Hove
36a3708290 Added missing ParseMode() instance 2015-08-06 15:12:49 +02:00
Joakim Hove
2582064c5d Added ParseMode::unsupportedScheduleGeoModifiers
- Added const ParseMode& argument to EclipseState() and Schedule()
   constructors.
 - Schedule constructor iterates through SCHEDULESection instance
   instead of Deck instance.
2015-08-06 15:12:48 +02:00
Joakim Hove
ab40d500c6 Initialize unit system for Section objects. 2015-08-05 22:02:11 +02:00
Joakim Hove
19eac286a0 Added ParseMode::missingDIMSkeyword 2015-08-05 22:02:11 +02:00
Joakim Hove
5e64d0f147 Added parser error for 'random text'.
Previously random text in the input deck which was not formatted as a
valid keyword header was simply ignored; i.e. this

   DIMENS
     10 10 10 /

   Mohaha random gibbersih - not according to any Spec.

   GRID

Would suprisingly parse just fine. This will now be handled according
to the ParseMode::randomText setting. Observe that as a side effect of
this it turned out that many of the test datasets had additional
terminating slashes which were now detected as 'ranomdText'.
2015-08-05 22:02:10 +02:00
Joakim Hove
733af54777 Added struct ParseMode to control parse behaviour.
- Introduce a very simple class ParseMode which will become a simple
   value object which can be used to control the behavior when errors
   and inconsistencies are encountered in the parse and EclipseState
   construction phases.

 - Added ParseMode instance as second argument to all parseXXX()
   methods.
2015-08-05 22:02:09 +02:00
Joakim Hove
33fbbde28c Merge pull request #534 from totto82/WSOLVENT
Adding support for changing WSOLVENT during simulations
2015-08-05 21:12:43 +02:00
Joakim Hove
2391b28518 Merge pull request #533 from joakim-hove/OPM-218
Opm 218
2015-08-05 15:11:13 +02:00
Tor Harald Sandve
e6c4586605 Add test for WSOLVENT 2015-08-05 13:41:25 +02:00
Tor Harald Sandve
ef4a9c43e0 Remove unused function 2015-08-05 11:38:33 +02:00
Tor Harald Sandve
fc9b3f99e7 Add check that WSOLVENT keyword is applied to Gas injector 2015-08-05 11:38:33 +02:00
Tor Harald Sandve
d926dd0eb7 Simplify by removing WellSolventProperties structure 2015-08-05 11:38:33 +02:00
Tor Harald Sandve
dab5172912 Adding support for changing WSOLVENT during simulations 2015-08-05 11:38:33 +02:00
Tor Harald Sandve
4ae5049639 Add <algorithm> to make it compile for gcc 4-6 2015-08-05 08:48:03 +02:00
Joakim Hove
b2cf484ded Added comment. 2015-08-04 17:21:59 +02:00
Joakim Hove
923d715bb9 Bug in handleSolutionsection():
- The handleSolutionsection() method would initialize the timemap, but
   not the storage vector.

 - Renamed initRestartOutputConfig -> assertTimeMap and calling it
   unconditionally.
2015-08-04 17:15:46 +02:00
Joakim Hove
2df100dbc9 Added debug method IOCOnfig::dumpRestartConfig() 2015-08-04 15:20:30 +02:00
Joakim Hove
7152274be7 Added const& operator[] to TimeMap. 2015-08-04 14:40:54 +02:00
Joakim Hove
8ae2f01f5f Merge remote-tracking branch 'chflo/OPM-218' into OPM-218 2015-08-04 13:57:48 +02:00
Tor Harald Sandve
1f442393c3 Remove special from sections 2015-08-03 11:44:47 +02:00
Tor Harald Sandve
7413a66c1b Add keywords for solvent model 2015-08-03 07:34:51 +02:00
chflo
7855af03a2 OPM-218: Fixed restart interval write for RPTRST 2015-08-02 22:03:09 +02:00
chflo
1156fb6a90 OPM-218: Fixed restart interval write for basic=4/5 2015-08-02 22:01:50 +02:00
Joakim Hove
6362bd2eb1 Fixed typo. 2015-07-28 09:27:05 +02:00
Joakim Hove
847fc3ba6f Added EclipseGrid::cellThickNess() method 2015-07-27 17:57:34 +02:00
chflo
36279ae421 OPM-218: Fixed corresponding tests 2015-07-27 10:48:18 +02:00
chflo
1251484b32 OPM-218: Fixed flow vs eclipse restart interval write differences for rptrst basic 4 and 5 2015-07-27 10:47:38 +02:00
Joakim Hove
a741db7b7c Merge pull request #506 from joakim-hove/schedule-events
Schedule events
2015-07-24 14:21:20 +02:00
Joakim Hove
64ceffbbec Merge pull request #526 from joakim-hove/TOPS-z-tolerance
When fully specified TOPS agrees within 1e-6 with TOPS(k=1) and DZ: Enforce bitwise equality
2015-07-24 14:20:30 +02:00
Joakim Hove
e6343e1b0b Fixed bug in WELOPEN for all defaulted. 2015-07-24 12:40:50 +02:00
Joakim Hove
44ba386bcc Add events from Schedule::iterateScheduleSection() 2015-07-24 12:40:50 +02:00
Joakim Hove
f62c891f1a Added basic Event system for Schedule events 2015-07-24 12:40:49 +02:00
Joakim Hove
ddde52ad4c DynamicState::update() will return bool. 2015-07-24 12:40:48 +02:00
Joakim Hove
bc3b9837e0 Renamed DynamicState::add() -> Dynamicstate::update() 2015-07-24 12:40:47 +02:00
Andreas Lauser
e32f8b5742 make the 'd' exponent specifier the slow path
i.e. first try to convert it normally and only if this fails, replace
'd' by 'e' and try again.

this is because the slowdown when always taking the second path was
about 7 to 9% for the Norne deck on my machine. (I think this is quite
surprising.)

thanks to [at]joakim-hove for the hint.
2015-07-24 11:36:36 +02:00
Joakim Hove
d7406273c5 Enforce bitwise equality in ZCORN with full TOPS. 2015-07-24 09:32:54 +02:00
Andreas Lauser
1d388b3b78 implement support for fortran-style 'd' exponent indicators
also, extend the corresponding unit test.
2015-07-23 16:18:07 +02:00
Andreas Lauser
eca9a3016d fix the data of grid property unit test
critical saturations must always be defined. again thanks to [at]bska
for the hint.
2015-07-21 13:07:34 +02:00
Andreas Lauser
40bef918a5 SatfuncPropertyInitializer: determine the critical saturations correctly
At least I hope it's correct: the condition for breaking the loops
where inverted in some places.

thanks to [at]bska for discovering this.
2015-07-21 13:07:28 +02:00
Atgeirr Flø Rasmussen
3cdc01fbe3 Do not mix signed and unsigned. 2015-07-15 11:15:49 +02:00
Atgeirr Flø Rasmussen
4b11bf74d8 Fix order of initialisation. 2015-07-15 11:15:28 +02:00
Atgeirr Flø Rasmussen
26a6bffe06 Avoid using extremely long initialiser list.
The long list caused extreme compile-times for clang in optimised mode.
2015-07-13 12:50:03 +02:00
Atgeirr Flø Rasmussen
3713d65052 Add missing method implementation for hasNNC(). 2015-07-13 11:03:31 +02:00
Joakim Hove
924bac28e3 Merge pull request #511 from andlaus/vertical_scaling_properties
add grid properties required for the simple "vertical" endpoint scaling
2015-07-10 09:41:52 +02:00
babrodtk
91eae36f00 Updated printout to be less verbose for not-so-nice data 2015-07-09 17:13:40 +02:00
Andreas Lauser
d234d37616 grid properties: Add support for three point vertical relperm scaling
because it seems like the code in opm-core uses this at some point.
2015-07-09 12:16:08 +02:00
Andreas Lauser
f5c13deb0a add grid properties required for the simple "vertical" endpoint scaling
i.e., the PC[GW] and KR[OGW] properties plus their imbibition and
directional variants. the properties required for three-point vertical
scaling (i.e., KRWR, et al.) are still to be done.
2015-07-09 12:16:03 +02:00
Andreas Lauser
16c7fdce6d grid properties: check stricter has*Property() behavior in the unit test
thanks to [at]joakim-hove for the suggestion.
2015-07-09 12:16:01 +02:00
Andreas Lauser
0278a9c235 EclipseState: make has*GridProperty() more strict
i.e., it now throws if it is queried for an unsupported grid
properties. The main intention is to make code like

```c++
if (eclipseState->hasDoubleGridProperty("IHAVEATYPO"))
{
        auto prop = eclipseState->getDoubleGridProperty("IHAVEATYPO"));
}
```

no longer run without raising and exception.
2015-07-09 12:15:59 +02:00
Andreas Lauser
456e9379f6 grid properties: fix typo
the keyword is called 'MULTZX', not 'MULTXZ'!
2015-07-09 12:15:57 +02:00
Bård Skaflestad
9e10c97b2d Install VFP Table Headers
This commit marks the VFP*Table.hpp header files as installable.
That is needed for consumers of an installed opm-parser module.
2015-07-08 23:15:36 +02:00
André R. Brodtkorb
016c7f9af3 Fixed bug in test which checked for the wrong type of exception 2015-07-08 20:30:26 +02:00
babrodtk
e27b04692b Removed getNonEmptyItem function 2015-07-08 17:51:54 +02:00
babrodtk
109f47a001 More safety checks when reading VFPProdTables 2015-07-08 17:46:10 +02:00
babrodtk
6ffdec7e0b Minor bugfix for VFP tables 2015-07-07 15:53:28 +02:00
André R. Brodtkorb
546e3ef213 Updated EclipseState to use std::map for VFP*Tables 2015-07-03 10:10:12 +02:00
André R. Brodtkorb
eb783df5a9 Changed int to size_t 2015-07-03 09:50:42 +02:00
babrodtk
c87b21f328 Added VFPInjTable 2015-07-03 08:53:22 +02:00
André R. Brodtkorb
08d5a92ae1 Added tests that check 'fail path' for VFPProdTable 2015-06-29 16:01:32 +02:00
André R. Brodtkorb
49bd072c61 Updated VFPProdTable to use compile-time constants and removed superfluous asserts 2015-06-29 14:53:20 +02:00
André R. Brodtkorb
5eb810f54f Fixed warnings 2015-06-25 14:14:57 +02:00
André R. Brodtkorb
0c89cc92ff Added handling of units 2015-06-25 11:55:02 +02:00
André R. Brodtkorb
6a8595f7a9 Whitespace 2015-06-25 09:11:04 +02:00
André R. Brodtkorb
1a34a2f913 Fixed erronous include 2015-06-25 09:08:54 +02:00
André R. Brodtkorb
1d9f519111 Updated the way individual tables are parsed 2015-06-24 16:05:03 +02:00
André R. Brodtkorb
7fe4b95b0d Added initial version of VFPPROD tables support 2015-06-24 15:46:47 +02:00
Joakim Hove
e8e76e3422 Merge pull request #505 from GitPaean/correcting_copyright_information
correcting copyright information.
2015-06-23 14:02:54 +02:00
Kai Bao
e654ab23b8 correcting copyright information. 2015-06-23 13:13:07 +02:00
André R. Brodtkorb
e3ee5b0fec Removed default value for ALQ 2015-06-23 11:07:39 +02:00
André R. Brodtkorb
a57601661e Bugfixes VFPPROD and test 2015-06-23 09:40:20 +02:00
Joakim Hove
fccf5cd603 Merge pull request #502 from atgeirr/fix-updatefile
Improve updateFile and suppress warnings.
2015-06-22 11:47:23 +02:00
Joakim Hove
692b31c764 Merge pull request #500 from qilicun/plydhflf
Add keyword PLYDHFLF.
2015-06-22 11:46:44 +02:00
chflo
c9bf166b08 Fixed IOConfig compiler warning; wrong return type for method overrideRestartWriteInterval 2015-06-22 11:18:45 +02:00
Atgeirr Flø Rasmussen
6b59f78293 Improve updateFile and suppress warnings. 2015-06-22 10:17:19 +02:00
Liu Ming
e1fa3a98c8 Add keyword PLYDHFLF. 2015-06-20 16:57:42 +08:00
Alf B. Rustad
e8dea65435 typo 2015-06-18 12:06:38 +02:00
Alf B. Rustad
d8782650c3 Added information on Json for the uninformed. 2015-06-18 09:19:44 +02:00
Joakim Hove
b83b4b614e Claenup ParserState constructors. 2015-06-18 08:06:41 +02:00
Joakim Hove
875fd86c3c Added strict flag to parser:
Have added a new bool strict flag to the parsing functions, if the
strict flag is set to false the parser will just skip lines with unknwon
keywords, including pure garbage in the input. I.e. for a deck like:

TABDIMS
  1 1 1 /

Crap - not a keyword at all

-- Correctly formatted - unknown keyword
IGNORED
  0 1 /

The parser will load the TABDIMS keyword correctly, and skip the rest.
2015-06-18 08:06:40 +02:00
Joakim Hove
c38b892876 Moved initialization of FaultCollection. 2015-06-18 08:06:39 +02:00
Joakim Hove
f8bc617894 Changed Deck::getKeywordList:
The method will return an empty vector - instead of throwing, if you ask
for a missing keyword.
2015-06-18 08:06:38 +02:00
Joakim Hove
97a9f25260 Added template access to Deck::getKeywordList() 2015-06-18 08:06:37 +02:00
Atgeirr Flø Rasmussen
e11bd93646 Silence shadowing warning. 2015-06-16 14:41:45 +02:00
chflo
34211a34f1 OPM-212: Added nonconst getmethod of IOConfig to EclipseState 2015-06-15 11:50:04 +02:00
chflo
e477aaf3dc OPM-212: Added test of new method in IOCOnfig 2015-06-15 11:49:33 +02:00
chflo
7aea4129b3 OPM-212: Added method for overriding write of restart file interval to IOConfig 2015-06-15 11:49:32 +02:00
Joakim Hove
20170f888b Merge pull request #488 from iLoop2/OPM-97
Added WPIMULT keyword support
2015-06-13 00:17:22 +02:00
Edvin Brudevoll
b163ce400b OPM-211: Added InitConfig member to EclipseState 2015-06-11 12:40:10 +02:00
Edvin Brudevoll
90c023f1f0 OPM-211: Added new InitConfig class, and corresponding test 2015-06-11 12:40:09 +02:00
Edvin Brudevoll
3c5ed85bc0 OPM-211: Added RESTART keyword 2015-06-11 12:40:08 +02:00
Tor Harald Sandve
486182b7de Adress minor comments from PR
1) use addNNC() method to store the NNCs
2) convert all int's to size_t
3) remove .reserve() from the loop
4) use m_xxx instead of xxx_
5) rename xyz1 to ijk1 etc.
2015-06-11 06:43:25 +02:00
Tor Harald Sandve
8e005f953a Add NNC to EclipseState
The NNCs are read from the deck and stored in the EclipseState
2015-06-10 10:23:02 +02:00
Tor Harald Sandve
5221f273b5 Store the NNC in SI units 2015-06-10 10:23:02 +02:00
Tor Harald Sandve
8a2fed1bf8 Address minor comments
Change int to size_t
Remove hasNNC_
2015-06-10 10:23:02 +02:00
Tor Harald Sandve
5cd9a7f7b2 Add NNC class
This class provides the raw non-neighboring connections data as read
from the deck and/or added using the addNNC method.
The NNC data is currently not processed. I.e. multiple NNC connection
between the same cell can exist side by side.
2015-06-10 10:23:02 +02:00
Joakim Hove
6c844ab884 Merge pull request #494 from joakim-hove/public
Made constructors public:
2015-06-10 09:52:16 +02:00
Joakim Hove
f37c0f69b8 Made constructors public: 2015-06-10 09:50:17 +02:00
Fredrik Gundersen
186247f40e Added tests for wellpi
cumulative behavior and reset back to 1.0 with COMPDAT
2015-06-10 07:51:50 +02:00
Fredrik Gundersen
d6ee25e3d3 Changed to cumulative behavior for wellpi 2015-06-10 07:50:43 +02:00
Fredrik Gundersen
1e4f4571fd Added default value for wellpi 2015-06-10 07:50:18 +02:00
Fredrik Gundersen
b7d04ae0aa Merge remote-tracking branch 'upstream/master' into OPM-97 2015-06-10 07:19:44 +02:00
Joakim Hove
ba54398cf1 Merge pull request #489 from joakim-hove/create-default
Updated code generation
2015-06-09 17:19:51 +02:00
Joakim Hove
ef42deeb46 Added method globalReset() to DynamicState<T> 2015-06-08 14:15:03 +02:00
Joakim Hove
679ef35d0b Updated code to use compiled defaults 2015-06-08 11:29:21 +02:00
Joakim Hove
c0db611aa8 Added template method Parser::addKeyword<T>() 2015-06-08 11:29:20 +02:00
Joakim Hove
fd87b22f7d Added methods to Deck::getKeyword<T>() 2015-06-08 11:29:19 +02:00
Joakim Hove
1161e1098c Rewritten code generation:
With this commit the generation of built in keywords is completely
changed. The most important changes include:

  1) We have autogenerated a class for each keyword in the new
     ParserKeywords { ... } namespace.

  2) The autogenerated classes derive from ParserKeyword, and the
     default constructor will build of a fully initialized
     ParserKeyword instance, i.e. the keyword used to parse the EQUIL
     keyword can be instantiated as simple as:

         ParserKeywords::EQUIL kw;

  3) The generated keywords have built in static constants for keyword
     and item names, and item default values. That way it should be
     possible for the compiler to catch trivial errors like trying to
     access the keyword "PoRO"; also the the access to default values
     means that properties can be initialized without actually
     insantiating a DeckKeyword.

  4) Two new classes Generator/KeywordLoader and
     Generator/KeywordGenerator have been created, with the help of
     these classes the keyword generation code is significantly
     simplified.
2015-06-08 11:29:18 +02:00
Edvin Brudevoll
81d22c237d Added new method getNumPhases to EclipseState 2015-06-08 09:40:19 +02:00
Joakim Hove
3e77c88f31 ParserKeyword constructor with one argument works. 2015-06-05 14:26:36 +02:00
Joakim Hove
9ea6e03e37 Changed item names to avoid conflict with keyword name. 2015-06-05 14:26:36 +02:00
Joakim Hove
9413e5216e Changed name of data item to from Keyword to 'data' 2015-06-05 14:26:35 +02:00
Joakim Hove
8756435766 Added JsonObject::to_string() - removed content. 2015-06-05 14:26:35 +02:00
Joakim Hove
bb4d676d45 Added method ParserRecord::hasItem() 2015-06-05 14:26:34 +02:00
Joakim Hove
155ad22a05 Made constructors explicitly public 2015-06-05 14:26:34 +02:00
Fredrik Gundersen
c3758d623b Added test for WPIMULT 2015-06-02 13:30:53 +02:00
Fredrik Gundersen
60db596671 Added new keyword 2015-06-02 13:26:51 +02:00
Fredrik Gundersen
805cb410cd Update to support WPIMULT 2015-06-02 13:26:37 +02:00
Kai Bao
0bba4ef925 changing the first column of PLYSHLOG table to be dimensionless.
The unit will be handled in opm-polymer based on the keyword SHRATE.
2015-06-02 13:06:41 +02:00
Fredrik Gundersen
60ab4ecb77 Merge remote-tracking branch 'upstream/master' into OPM-97 2015-06-02 10:22:39 +02:00
Fredrik Gundersen
1305e87911 OPM-97 2015-06-02 09:30:08 +02:00
Kai Bao
4bbd66599c Adding keywords SHRATE. 2015-06-01 15:28:46 +02:00
Joakim Hove
5d2160438f Changed order in < comparison 2015-06-01 14:53:16 +02:00
chflo
3acd325c39 OPM-205: Reduced severity of output GRID file not supported from throw to warning 2015-05-29 12:07:34 +02:00
chflo
4854547606 OPM-205: Added tests for handling of RPTSCHED RESTART and RPTSCHED NOTHING 2015-05-29 12:07:33 +02:00
chflo
9eb13cfe06 OPM-205: Added handling of RPTSCHED RESTART and RPTSCHED NOTHING 2015-05-29 12:07:33 +02:00
chflo
c7d2c62d3d OPM-205: Added testing of new features in IOConfig 2015-05-29 12:07:32 +02:00
chflo
8a12c3eda9 OPM-205: Added support for RPTSCHED RESTART, and handling of RPTRST BASIC = 0 2015-05-29 12:07:32 +02:00
Joakim Hove
24b8ca5f69 Removing old stale text file 2015-05-29 12:00:00 +02:00
Joakim Hove
1d04d98fc8 Deleted old stale txt file 2015-05-29 11:59:12 +02:00
Joakim Hove
7ee8657fa6 Merge pull request #483 from joakim-hove/keyword-documentation
Added keyword documentation
2015-05-29 11:56:19 +02:00
Joakim Hove
d311b82983 Added keyword documentation 2015-05-29 11:54:46 +02:00
Joakim Hove
216e80a845 Fixed wrong include path 2015-05-29 09:55:50 +02:00
Joakim Hove
a3451a4f7f Merge pull request #466 from joakim-hove/remove-ert-cpp
Removed ERT Cxx wrappers
2015-05-29 09:22:16 +02:00
Joakim Hove
91826a3ffa Merge pull request #468 from iLoop2/OPM-203
Added suport for converting of Metric grid values
2015-05-29 09:22:05 +02:00
Joakim Hove
1bbda0f073 Merge pull request #481 from joakim-hove/open-wells
Added utility method Schedule::getOpenWells( )
2015-05-29 09:05:51 +02:00
Joakim Hove
81ceb24fda Added utility method Schedule::getOpenWells( ) 2015-05-29 09:05:16 +02:00
Joakim Hove
601c8cedcf Added placeholder ParserKeywords.hpp 2015-05-28 00:03:49 +02:00
Atgeirr Flø Rasmussen
2cc4c8ae8e Remove unused deck argument from IOConfig constructor.
Also made constructor explicit since it now only takes a single argument,
to avoid unintended implicit conversion.
2015-05-27 11:51:19 +02:00
Joakim Hove
ead856c3f6 Testing updates:
Have removed the inlineItemTest - this test did not add anything new
compared to the much more comprehensive inlinekeywordTest.
2015-05-27 09:38:59 +02:00
Joakim Hove
60eaacb6fe Removed ERT Cxx wrappers 2015-05-27 07:12:41 +02:00
Joakim Hove
0a2a1e0d68 Added documentation of the code generation. 2015-05-26 18:15:08 +02:00
Arne Morten Kvarving
5d572f846f fix linking of applications after targets was renamed 2015-05-26 14:25:21 +02:00
Joakim Hove
e62c434f47 Merge pull request #472 from akva2/fix_ioconfig_tests
Fix ioconfig tests
2015-05-26 14:20:53 +02:00
Arne Morten Kvarving
a53c6c2bc7 added: properly document BUILD_TESTING option 2015-05-26 14:13:00 +02:00
Arne Morten Kvarving
2f63f49ef9 fix new IOConfig tests 2015-05-26 14:12:36 +02:00
Arne Morten Kvarving
2acd2db5d0 changed: rename Parser to opmparser for consistency 2015-05-26 13:53:54 +02:00
Arne Morten Kvarving
4ed965bf55 changed: rename opm-json opmjson for consistency 2015-05-26 13:53:54 +02:00
Arne Morten Kvarving
9e96127705 change how tests are added in the build system
- use a opm-macro to reduce code duplication
- add a 'test-suite' target which builds tests. for use if BUILD_TESTING
  is 0.
- add a 'check' target which builds tests, then executes them
2015-05-26 13:07:44 +02:00
chflo
eb114ab03c OPM 199: Added IOConfig to EclipseState, and corresponding tests 2015-05-26 09:43:59 +02:00
chflo
8741d4497d OPM 199: Changes due to changes in Schedule constructor 2015-05-26 09:43:59 +02:00
chflo
b61d5f57e5 OPM 199: Added handling of IOConfig RPTRST to Schedule, and corresponding tests 2015-05-26 09:43:59 +02:00
chflo
a40d867704 OPM 199: Added new methods to TimeMap and corresponding tests 2015-05-26 09:43:58 +02:00
chflo
a7b97a3748 OPM 199: Added keyword NOGGF 2015-05-26 09:43:58 +02:00
chflo
783fad01b2 OPM 199: Added new class IOConfig and corresponding tests 2015-05-26 09:43:58 +02:00
Fredrik Gundersen
bb97d3f7bb Fix parameter name 2015-05-22 22:58:39 +02:00
Fredrik Gundersen
48699b569a OPM-203 Added supoort for converting of Metric grid values 2015-05-21 12:35:32 +02:00
Joakim Hove
f3b63d8bc1 Merge pull request #439 from joakim-hove/external-cmake
Using external cmake modules
2015-05-15 14:37:28 +02:00
Kai Bao
766ba71389 Making member functions of PlyshlogTable public and const some of them. 2015-05-12 11:32:38 +02:00
Kai Bao
6f297f9002 Adding member fucntion for PlyshlogTable for EclipseState. 2015-05-12 11:13:02 +02:00
Andreas Lauser
533c5bcd4c fix the opm-cmake dunecontrol support 2015-05-11 13:32:21 +02:00
Joakim Hove
99e5fa4e25 Using external cmake modules 2015-05-08 11:55:40 +02:00
Joakim Hove
e16ed8a5e5 Merge pull request #463 from iLoop2/Setting_Tuning
Setting tuning
2015-05-08 06:59:18 +02:00
Joakim Hove
24f49b35a8 Fixed bug 2015-05-06 12:27:43 +02:00
Joakim Hove
10facf19b3 Created classes for all the endpoint initializers. 2015-05-06 12:27:43 +02:00
Joakim Hove
121ec9320b Added ISGU / SGU classes 2015-05-06 12:27:42 +02:00
Joakim Hove
2947336982 Added derived iniitializer classes SWL and ISWL 2015-05-06 12:27:41 +02:00
Joakim Hove
2d08d78257 MOved satfunc initializers to separate file. 2015-05-06 12:27:40 +02:00
Joakim Hove
819e92965f Removed SGL and ISGL lookup from multiplex method 2015-05-06 12:27:40 +02:00
Joakim Hove
5aaf5ea6c2 Added derived class ISGLInitializer 2015-05-06 12:27:39 +02:00
Joakim Hove
5989d45b3a Added derived class SGLInitializer. 2015-05-06 12:27:38 +02:00
Joakim Hove
21951cda90 Added GridProperty<T>::checkLimits() 2015-05-06 12:27:38 +02:00
Joakim Hove
863b5f9441 Refactor: calculation of endpoint + critical 2015-05-06 12:27:37 +02:00
Joakim Hove
c6429c3fe8 Refactor: critcial and enpoint values are members. 2015-05-06 12:27:37 +02:00
Joakim Hove
84e65886fb Refactor: introduced const& and [] instead of at() 2015-05-06 12:27:36 +02:00
Joakim Hove
78408dab59 Refactor: extracted two small methods 2015-05-06 12:27:36 +02:00
Joakim Hove
63e16153c6 Renamed GridPropertyEndpointTableLookupInitializer -> EndpointInitializer 2015-05-06 12:27:35 +02:00
Joakim Hove
c11cca31dc Added comment with reference to documentation. 2015-05-06 12:27:34 +02:00
Joakim Hove
6882653433 Using EclipseState::getIntGridProperty()
Old code used to first initialize with 1, and then check the
EclipseState - will rather just ask the EclipseState; which will
automagically create a keyword if that is required.

Also The SATNUM keyword was previously immediately overwritten with the
content of the ENDNUM keyword, that is now changed.
2015-05-06 12:27:33 +02:00
Joakim Hove
e3d4b205cd Added test before finding critical saturations. 2015-05-06 12:27:32 +02:00
Joakim Hove
1b89196aa1 Using Tabdims in EclipseState and table initializer 2015-05-06 12:27:32 +02:00
Joakim Hove
7e81eb72b2 Added trivial class Tabdims 2015-05-06 12:27:31 +02:00
Joakim Hove
bf61731536 Added vector based get of Properties 2015-05-05 19:23:06 +02:00
Joakim Hove
725fb4fba5 Removed commented out code 2015-05-05 19:22:10 +02:00
Joakim Hove
f0adb6a2d8 Added C++ wrappers for ERT: ecl_kw and fortio 2015-05-05 17:02:09 +02:00
Fredrik Gundersen
15a86bbd34 Changed to be none destructive update of tuning 2015-05-05 12:34:44 +02:00
Fredrik Gundersen
4fb7c16f11 Remove comment 2015-05-05 08:38:09 +02:00
Fredrik Gundersen
b32ba60ec7 Added methods to change TUNING 2015-05-04 13:02:20 +02:00
Joakim Hove
8b80061494 Merge pull request #462 from GitPaean/plyshlog_keyword_support
Adding the support for the keyword PLYSHLOG.
2015-04-28 13:46:46 +02:00
Edvin Brudevoll
36b9c63cf4 New commit, NOSIM keyword 2015-04-28 09:56:12 +02:00
Edvin Brudevoll
678e8a520b Support for the NOSIM keyword. 2015-04-28 09:53:04 +02:00
Kai Bao
786908f723 Adding integration test for PLYSHLOG. 2015-04-27 11:38:12 +02:00
Kai Bao
ae5c6c4fe9 Adding the support for the keyword PLYSHLOG.
Assuming only one group of PLYSHLOG data is available.
2015-04-27 10:14:42 +02:00
Joakim Hove
58806c9f5b Merge pull request #458 from akva2/fix_pkgconfig
fixed: pkgconfig file
2015-04-23 13:02:13 +02:00
Arne Morten Kvarving
4d9ae70ba2 fixed: pkgconfig file
multiarch had not been setup and the _TARGET variable is not set
in this build system.
2015-04-23 10:49:22 +02:00
Fredrik Gundersen
5c3d1fe967 Merge pull request #457 from joakim-hove/TUNING
Internalized the TUNING keyword
2015-04-23 10:06:20 +02:00
Joakim Hove
d53657824a Merge pull request #455 from GitPaean/adding_plyshlog
Adding keywords PLYSHLOG.
2015-04-21 10:16:56 +02:00
Kai Bao
750a25aeeb Specifying the size of PLYSHLOG to be 2.
It works now as a temporary fix.
2015-04-20 15:28:32 +02:00
chflo
d70504e7a4 Fixed bug in Parser<double|float>Item.cpp:
Too low precision for floating point values in generated source code.
2015-04-20 15:13:22 +02:00
chflo
09275419e1 Added test of tuning class 2015-04-20 15:13:22 +02:00
chflo
1d3e702446 OPM-191: Added Tuning member and handling of TUNING keyword to Schedule class 2015-04-20 15:13:22 +02:00
chflo
78fee8b0ca Added new Tuning class. 2015-04-20 15:13:21 +02:00
chflo
3775cb69dd OPM-191: Updated TUNING keyword 2015-04-20 15:13:21 +02:00
Joakim Hove
b02e536ad8 Added ability to check index of keyword from Deck. 2015-04-20 14:56:52 +02:00
Joakim Hove
7bd566d6a6 Changed Deck & Section implementation
- Removed the KeywordContainer class; and implemented the behaviour
   directly in the Deck.

 - Added begin() and end() iterators to the Deck.

 - Section class inherits from Deck.
2015-04-20 14:56:52 +02:00
Joakim Hove
150a6f8ebd Merge pull request #456 from joakim-hove/Dynamicstate-initial
Dynamicstate initial
2015-04-20 14:55:36 +02:00
Joakim Hove
8f277d56ca Added modifiable initial value to DynamicState 2015-04-20 14:04:10 +02:00
Joakim Hove
446a94e97f Added read only operator[] to DynamicState 2015-04-20 14:03:44 +02:00
Kai Bao
e1b14e4f14 removing the size from the keyword PLYSHLOG. 2015-04-20 13:35:53 +02:00
Kai Bao
177c6b06ec adding keyword PLYSHLOG. 2015-04-20 12:59:32 +02:00
Kai Bao
96bf3648df Adding unit Salinity.
For the METRIC and FIELD system.
2015-04-16 16:59:59 +02:00
Joakim Hove
45e13a1b40 Minor changes to silence some warnings. 2015-04-15 22:59:58 +02:00
Joakim Hove
5d31eb29dc Merge pull request #444 from iLoop2/Fix_BUG_PATHS_Keyword
Fix bug paths keyword
2015-04-09 10:42:59 +02:00
Joakim Hove
b932208634 Merge pull request #441 from edbru/OPM-87
OPM-87, added code for handling keyword WELTARG.
2015-04-08 12:45:52 +02:00
Edvin Brudevoll
c620fde78a Updates and actions 2 related to Joacim's comments. 2015-04-08 12:12:57 +02:00
Edvin Brudevoll
8a7f8e6c59 Updates and actions related to Joacim's comments 2015-04-07 08:02:06 +02:00
Fredrik Gundersen
574deeff18 Clean up and fix indentation 2015-04-01 13:37:55 +02:00
Fredrik Gundersen
89960331cf Rewrite of constructor to support g++4.4 2015-04-01 13:34:23 +02:00
Fredrik Gundersen
5401b828ba Changed to use C++11 syntax for constructor 2015-04-01 08:49:36 +02:00
Fredrik Gundersen
a64c3a62bf Added new constuctor with PATHS parameter 2015-03-31 13:30:02 +02:00
Fredrik Gundersen
b522daf9b1 Updated test to include testing of nested PATHS replacment 2015-03-31 13:28:32 +02:00
Atgeirr Flø Rasmussen
bfea9e7406 Suppress warning in Logger::addMessageType(). 2015-03-25 08:52:59 +01:00
Atgeirr Flø Rasmussen
61f9855381 Suppress an unused argument warning. 2015-03-25 08:48:07 +01:00
Edvin Brudevoll (ITV DIS RD)
8ac548d564 OPM-87, added code for handling keyword WELTARG. 2015-03-25 08:20:22 +01:00
Joakim Hove
be93f81360 Removed Statoil internal test. 2015-03-18 13:58:31 +01:00
Joakim Hove
7afa65a230 Fixed bug with iterator modification 2015-03-09 12:38:16 +01:00
Joakim Hove
08a7132db8 Merge pull request #398 from joakim-hove/singleton-example
Singleton Logger
2015-03-09 08:08:12 +01:00
Atgeirr Flø Rasmussen
d33a05db70 Remove surplus const for return-by-value.
This triggers compiler warnings at high warning levels.
2015-03-06 08:52:39 +01:00
Joakim Hove
a5e6236580 Merge pull request #433 from joakim-hove/new-keywords
New keywords
2015-03-05 13:05:21 +01:00
chflo
439d0ee924 OPM-157: Added enum UnitType, using this when creating an UnitSystem instance 2015-03-05 12:40:59 +01:00
Joakim Hove
93d5d19fc1 Merge fixup 2015-03-04 22:32:42 +01:00
Joakim Hove
cb4e3571e3 Updated the default messagetypes - inspired by ECLIPSE 2015-03-04 22:14:33 +01:00
Joakim Hove
dc992bbc53 Added methods to remove a logger backend. 2015-03-04 22:14:32 +01:00
Joakim Hove
3562ac4344 Added TimerLog example 2015-03-04 22:14:32 +01:00
Joakim Hove
130879f01a Changed OpmLog to be more careful to create logger. 2015-03-04 22:14:32 +01:00
Joakim Hove
9fb229ccd7 Replaced references to logger with OpmLog::addMessage() 2015-03-04 22:14:31 +01:00
Joakim Hove
f3419e8e61 Removed methods from CounterLog:
- Methods to get the number of Warning, Errors and Notes.
  - Methods to get the file/line/description content of a message.
2015-03-04 22:12:53 +01:00
Joakim Hove
3a60605d99 Removed most of the functionality from CounterLog 2015-03-04 22:12:53 +01:00
Joakim Hove
33034b0319 Logger will throw if the messageType is not enabled. 2015-03-04 22:12:52 +01:00
Joakim Hove
ce5960bbcd Added new CounterLog constructor 2015-03-04 22:12:52 +01:00
Joakim Hove
25bff6480d Renamed MessageCounter -> CounterLog 2015-03-04 22:12:52 +01:00
Joakim Hove
aa604aad9e Add ostream.flush() call in the StreamLog 2015-03-04 22:10:02 +01:00
Joakim Hove
44d4b92f68 Renamed AllMessageTypes -> DefaultMessageTypes
A newly created Logger instance should have all these message types
enabled.
2015-03-04 22:10:01 +01:00
Joakim Hove
46a98747f9 Added messageType methods to OpmLog 2015-03-04 22:10:00 +01:00
Joakim Hove
139330ec88 Added backend manipulation through OpmLog frontend. 2015-03-04 22:09:59 +01:00
Joakim Hove
5d3daabaef Added Logger::getBackend<T>() method 2015-03-04 22:09:58 +01:00
Joakim Hove
e6c6209991 Added StreamLog backend. 2015-03-04 22:09:57 +01:00
Joakim Hove
2c2da004b9 WIP: Added simple backend map in Logger 2015-03-04 22:09:57 +01:00
Joakim Hove
f52b5397f7 Using LogUtil to format message. 2015-03-04 22:09:56 +01:00
Joakim Hove
245b91d0c2 Introduced LogUtil file + Logger class
- The new LogUtil.cpp / LogUtil.hpp files contain the enum definitions
  for MessageType and formatting functions.

- The Logger class is meant to be the instance which is held by the
  static OpmLog singleton class.
2015-03-04 22:09:55 +01:00
Joakim Hove
930d70744d Added thin abstract class LogBackend 2015-03-04 22:09:55 +01:00
Joakim Hove
d3277543ec Renamed existing Logger -> MessageCounter 2015-03-04 22:09:54 +01:00
Joakim Hove
738fb0c05c Moved MessageType enum to OpmLog 2015-03-04 22:07:04 +01:00
Joakim Hove
e2a11f620c Added simple static format functions to OpmLog 2015-03-04 22:07:03 +01:00
Joakim Hove
e18123b7f3 Merged Singleton Logger with existing logger. 2015-03-04 22:07:03 +01:00
Joakim Hove
2011abfcf8 Moved to SingleTonLog 2015-03-04 22:07:03 +01:00
Joakim Hove
2ac15ffae2 Rudimentary example of Log singleton.
This commit shows a very basic example of how Logging singleton can be
implemented. The commit consists of a fully static class OpmLog which
manages a Logger class; in this case an instance of the ParserLog
class. The static OpmLog class can then be used from anywhere in the opm
code with:

  OpmLog::addMessage( messageType , "Log message")

Before this can be really useful the Logger class should be extended /
subclassed / ... for general usability.
2015-03-04 22:07:01 +01:00
Joakim Hove
c7d89454b7 Changed sizetype of SAVE to UNKNOWN
The SAVE keyword should support both having one slash terminated record,
and no records at all. To be able to handle both of these forms we have
used size_type UNKNOWN.
2015-03-04 21:37:21 +01:00
Joakim Hove
bcd99c2c0b Added COMPSEGS keyword 2015-03-04 21:37:10 +01:00
Joakim Hove
e6d9499757 Added WELSEGS keyword 2015-03-04 19:42:01 +01:00
Joakim Hove
cbd7edc884 Added COMPORD keyword 2015-03-04 19:22:28 +01:00
Joakim Hove
61b7b1d414 Added SUMTHIN keyword 2015-03-04 19:10:20 +01:00
Joakim Hove
36a499624a Added FILLEPS keyword 2015-03-04 19:00:40 +01:00
Joakim Hove
e5fec55bdb Added STONE1 keyword 2015-03-04 18:58:29 +01:00
Joakim Hove
8d0e04ff22 Added SLGOF keyword 2015-03-04 18:56:14 +01:00
Joakim Hove
ac2749732b Added GDORIENT keyword 2015-03-04 18:52:30 +01:00
Joakim Hove
eeacaf310e Added RPTGRID keyword 2015-03-04 18:45:49 +01:00
Joakim Hove
89b7acc45e Added WSGEDIMS keyword 2015-03-04 18:42:55 +01:00
Joakim Hove
f6f3bda46a Added keyword EXTRAPMS 2015-03-04 18:36:35 +01:00
Joakim Hove
c55637019b Merge pull request #432 from andlaus/move_DZV
move the DZV keyword to the E300 ones
2015-03-04 14:43:21 +01:00
Andreas Lauser
2ad9664d1a move the DZV keyword to the E300 ones
in contrast to D[XY]V this is not supported by E100 for some reason...
2015-03-04 14:23:04 +01:00
chflo
f3b427121e OPM-157: Added method getGlobalIndex to EclipseGrid, needed from opm-core EclipseWriter 2015-03-04 14:09:43 +01:00
Joakim Hove
f4f163e874 Using defaultRegion for MULTREGTSCANNER 2015-03-04 11:11:15 +01:00
Joakim Hove
e06d14309c Using defaultRegion for xxxREG keywords 2015-03-04 11:11:14 +01:00
Joakim Hove
8846d4b7b8 EclipseState: infer default region from GRIDOPTS 2015-03-04 11:11:13 +01:00
Joakim Hove
bae2fa4b3a Updated VFPPROD keyword to include records. 2015-03-03 13:30:42 +01:00
Joakim Hove
ecb1d5bd74 Update code generator to use record iterator. 2015-03-03 13:30:42 +01:00
Joakim Hove
f0fb5c993f Added recordBegin() and recordEnd() 2015-03-03 13:30:42 +01:00
Joakim Hove
3c84bbbdca Added begin() end() to ElasticVector 2015-03-03 13:30:41 +01:00
Joakim Hove
233922e935 Using correct ParserRecord when applying units. 2015-03-03 13:30:41 +01:00
Joakim Hove
90e8af2a48 Added SGFN json configuration. 2015-03-03 13:04:13 +01:00
Joakim Hove
328097d541 Added SOF3 json configuration 2015-03-03 13:04:06 +01:00
Andreas Lauser
1d60612204 add the VISCREF keyword 2015-03-02 19:11:40 +01:00
Andreas Lauser
2ab85d3430 add the THERMAL keyword 2015-03-02 19:11:35 +01:00
Andreas Lauser
39338d97a2 add the THERMEX1 keyword
this is required to implement the temperature dependence of the oil
phase density.
2015-03-02 19:11:33 +01:00
Andreas Lauser
569917abbf add the custom keywords "GCOMPIDX" and "OCOMPIDX"
the intention of it is to specify the component index which should be
used to calculate the properties of the gas and oil phase in the case of
thermal black-oil runs. The keywords are supposed to use Eclipse-style
indices, i.e., "1" is stands for the first component.

The reason why I think that this is required at all is that I have not
found out if Eclipse does use temperature dependent gas viscosities
and densities for non-compositional runs. (I have found a few
equations in the RM and TD for gas which include temperature for
compositional runs on E300, though.)

Note that there won't be a WCOMPIDX because compositional simulations
in Eclipse do not seem to treat water as a separate component...

if somebody has a better idea or knows how eclipse does this for
thermal black-oil simulations, let me know...
2015-03-02 19:11:31 +01:00
Andreas Lauser
318bffaa13 add the ZFACTOR keyword family
again, these are mentioned in the "Thermal option" section of the TD.
2015-03-02 19:11:29 +01:00
Andreas Lauser
65d8dd6210 add the MW, MWS and OILMW keywords
these specify the molecular weight of the components (and in the case
of OILMW that of the oil phase) and are used by the "thermal option".
2015-03-02 19:11:26 +01:00
Andreas Lauser
d55fc434f7 add the [CDPT]REF and [CDPT]REFS keywords
these are required for the "thermal option".
2015-03-02 19:11:24 +01:00
Andreas Lauser
3d7a787f88 add the STCOND keyword
it allows to set the standard conditions and is mentioned in the
"Thermal option" section of the TD.
2015-03-02 19:11:22 +01:00
Andreas Lauser
724e902c80 add the keywords required for temperature dependence of the oil and water densities
strangely enough, [at]totto82 an me did not find a corresponding
keyword for the gas phase. Also, the documentation of the second item
of the WATDENT keyword seems to be incorrect to me because its default
in FIELD units it is off by a factor of 10^4 compared to the one for
METRIC (at least in my copy of the RM).
2015-03-02 19:11:20 +01:00
Andreas Lauser
03366fe2e4 add unit for absolute (i.e., thermodynamic) temperature
This is required for keywords which do not use "every-day" temperature
values but thermodynamic ones or keywords that use "per degree"
values. Examples of such specimen are the OILCOMPR and WATDENT
keywords.
2015-03-02 19:11:18 +01:00
Andreas Lauser
5ff07aa6f2 fix the COMPS keyword
the "size" item was missing...
2015-03-02 19:11:15 +01:00
Andreas Lauser
101b1c93ea fix the WATVISCT and OILVISCT table classes
in contrast to GASVISCT, the viscosity column is decreasing for these.

also, a comma was MIA in WatvisctTable...
2015-03-02 19:11:13 +01:00
Joakim Hove
be95805f15 Using variable ParserRecord when parsing. 2015-02-26 22:01:30 +01:00
Joakim Hove
f793ab09d1 Added basic support for records: in configuration. 2015-02-26 21:54:06 +01:00
Joakim Hove
62e7f2a3aa Moved item management from Keyword to record.
Withe this commit the ParserRecord objects are created as needed by the
ParserKeyword; i.e a parserkeyword can in principle be totally without a
record.
2015-02-26 19:55:06 +01:00
Joakim Hove
8ac17f744e Added Data awareness to ParserRecord. 2015-02-26 11:46:25 +01:00
Joakim Hove
9696f694bf Merge pull request #425 from joakim-hove/RecordVector
Record vector
2015-02-20 11:13:26 +01:00
Joakim Hove
0a857837df Merge pull request #422 from andlaus/correct_reservoir_volume_handling
Correct reservoir volume handling
2015-02-20 09:31:04 +01:00
Joakim Hove
875f591a1b Changed ParserKeyword to use vector of records 2015-02-20 00:21:32 +01:00
Joakim Hove
091acd1dd7 Added utility ElasticVector 2015-02-20 00:16:31 +01:00
Atgeirr Flø Rasmussen
36089420e1 Add missing throw check, also silencing warning. 2015-02-17 10:30:54 +01:00
Robert K
05af9e32b7 remove warnings, that is:
sizeType --> p_sizeType since it shadows a member method
trailing ;
comparison of signed and unsigned int
2015-02-13 14:19:24 +01:00
Andreas Lauser
2e6fcbca92 fix the PORV keyword
although the dimension of it's item was correct for the METRIC unit
system, it definitely wasn't when using FIELD!
2015-02-13 13:41:07 +01:00
Andreas Lauser
0d3659f111 introduce dimension "ReservoirVolume" and rename "*Volume" to "\1SurfaceVolume"
Also, I tried to convert all keywords that use reservoir volumes and
the associated code. Although I tried my best on that front, it might
not be enough. (in any case, I consider it very unlikely that there
are any regressions caused by this.)
2015-02-13 13:41:07 +01:00
Joakim Hove
832475e8ac Merge pull request #421 from andlaus/fix_for_WCONINJE
Schedule: fix handling of the RESV item of the WCONINE keyword
2015-02-13 13:09:46 +01:00
Andreas Lauser
d508b64312 Schedule: fix handling of the RESV item
it turns out that, in contrast to the RATE item, this item is always a
liquid rate (-> bbl/day in FIELD units), i.e., the dimension is always
"LiquidVolume/Time" irrespectibly of the fluid phase.
2015-02-12 19:07:03 +01:00
chflo
ef57b3f074 OPM-166: Internalized tresholdPressure in EclipseState 2015-02-12 16:51:04 +01:00
Joakim Hove
2e6dc98701 Added json config for keyword SAVE 2015-02-12 15:55:36 +01:00
Joakim Hove
e398155400 White space change 2015-02-12 15:36:39 +01:00
Joakim Hove
2a2078d599 Removed non const overloads 2015-02-12 15:32:31 +01:00
Joakim Hove
b6478c7f46 Removed unused getWells() overload 2015-02-12 14:59:59 +01:00
Andreas Lauser
c6e28b66c6 allow the schedule object to be immutable
quite a few important methods (e.g., getWells()) missed the variants
which are marked as 'const'. this leads to the problem that these
can't be called on the object returned by EclipseState::getSchedule()
because it returns a ScheduleConstPtr. (this issue can possibly be
worked-around by creating a new mutable copy of the schedule object
from the one returned by EclipseState::getSchedule(), but to me, this
seems to be strikingly inelegant and inefficient...)

this fixes the compilation of the ECL blackoil simulator of eWoms...
2015-02-12 12:54:57 +01:00
Fredrik Gundersen
ce5eb28c92 Fix of test after merge of pull request #416 2015-02-12 11:31:09 +01:00
Fredrik Gundersen
42711ee259 Merge remote-tracking branch 'upstream/master' into OPM-158 2015-02-12 10:30:55 +01:00
Fredrik Gundersen
4241e169fc Fix test after update of rules for OPEN well status 2015-02-12 10:29:21 +01:00
Liu Ming
8f61bcd59a Add MinpvMode namespace and remove the whitespace. 2015-02-12 16:00:31 +08:00
Fredrik Gundersen
1a6ec03ac1 Updates after feedback on code 2015-02-12 08:38:26 +01:00
Fredrik Gundersen
dccce11b37 Delete not needed properties class 2015-02-12 08:37:03 +01:00
Fredrik Gundersen
9d0ef9d318 Update to method names and text 2015-02-12 08:30:48 +01:00
Liu Ming
1dfb337a76 Remove isMinpvActive() function, use getMinpvMode() instead. 2015-02-10 16:45:48 +08:00
Liu Ming
3d0c79a4d9 Create Minpv mode enum. 2015-02-10 16:45:03 +08:00
Liu Ming
47b9ff6c1c move MINPVFIL to opm directory. 2015-02-10 14:33:24 +08:00
Liu Ming
785fa97c80 Merge remote-tracking branch 'remotes/opm/master' into add_minpvf 2015-02-09 09:52:40 +08:00
Liu Ming
15164b0e7f Add keyword MINPVF. 2015-02-09 09:52:11 +08:00
Joakim Hove
9f16165dfd Will compare connection factor > 0 before setting 2015-02-06 17:05:19 +01:00
Fredrik Gundersen
a41bc4ce18 Cleanup after merge 2015-02-06 15:02:38 +01:00
Fredrik Gundersen
88274cff6e Merge remote-tracking branch 'upstream/master' into OPM-158
Conflicts:
	opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp
	opm/parser/eclipse/EclipseState/Schedule/Well.cpp
2015-02-06 15:00:30 +01:00
Fredrik Gundersen
670d835fa1 Remove old code 2015-02-06 14:57:24 +01:00
Fredrik Gundersen
ba603634af Added tests to verify that RFT/RFTPLT parsing works 2015-02-06 14:55:03 +01:00
Fredrik Gundersen
2c332e6ef8 Added support for parsing RTF/PLT 2015-02-06 14:54:03 +01:00
Fredrik Gundersen
9a9d7ea053 Updated Well class to support RFT and PLT 2015-02-06 14:53:38 +01:00
Fredrik Gundersen
80a7b99f87 Added new enums for RFT and PLT keys 2015-02-06 14:52:59 +01:00
Fredrik Gundersen
340501f113 Added support for new keyword 2015-02-06 14:51:48 +01:00
Fredrik Gundersen
3de8caa848 Added class to hold RTF data during parsing 2015-02-06 14:51:31 +01:00
Joakim Hove
eda7b60f54 Handle missing xxxDIMS keywords
For some keywords the number of records is given as the value of an item
in another keyword, for instance the number of records in the EQUIL
keyword is given by NTEQUL item in the EQLDIMS keyword.

If the EQLDIMS keyword is not given in the deck the Parser will consult
the default values of EQLDIMS keyword; i.e. a missing keyword is treated
as all-defaulted.
2015-02-06 13:04:17 +01:00
Joakim Hove
af249cefd7 Added method to get keyword from Parser. 2015-02-06 13:03:44 +01:00
Joakim Hove
9fb5ab0a95 Made method public 2015-02-03 13:04:57 +01:00
Joakim Hove
b2ae92293c Merge pull request #407 from andlaus/add_COMPS
Add the "COMPS" E300 keyword
2015-01-30 17:01:01 +01:00
Joakim Hove
96a0a6b6ca Fixed gcc44 challenged calls to std::to_string() 2015-01-30 16:55:15 +01:00
Andreas Lauser
e3d5a3e860 Add the "COMPS" E300 keyword 2015-01-30 15:39:34 +01:00
Andreas Lauser
dcc36df62e correct the GasvisctTable class
it turns out that the number of columns of this class depends on the
number of specified components. this lead to all kinds of fun like
manual unit conversion, etc.
2015-01-30 14:28:23 +01:00
Andreas Lauser
0a477ed18a add table classes for the temperature dependent viscosity keywords 2015-01-30 14:28:14 +01:00
Andreas Lauser
664ca1e8ff add some keywords required to specify the temperature dependence of viscosity 2015-01-30 14:28:01 +01:00
Joakim Hove
2f9551242b Revert "Temperature dependent viscosity" 2015-01-30 10:12:17 +01:00
Andreas Lauser
d40f093f36 add table classes for the temperature dependent viscosity keywords 2015-01-29 23:02:17 +01:00
Andreas Lauser
b99128e6d9 add some keywords required to specify the temperature dependence of viscosity 2015-01-28 16:05:41 +01:00
Atgeirr Flø Rasmussen
c0d30a7739 Add checkUnhandledKeywords() method and use it. 2015-01-28 09:39:13 +01:00
Atgeirr Flø Rasmussen
38dde951bc Make conversion methods static.
The convertInjectionRateToSI() methods do not use data members and can therefore
be static just as convertEclipseStringToBool() already is.
2015-01-28 09:30:07 +01:00
Atgeirr Flø Rasmussen
44f16496d3 Removed surplus docs. 2015-01-28 09:09:30 +01:00
Atgeirr Flø Rasmussen
26fe9cf9b3 Removed const from value-type function arguments. 2015-01-28 09:04:41 +01:00
Atgeirr Flø Rasmussen
bdcb1f5243 Add assert() to findClosestCompletion() method. 2015-01-28 08:08:32 +01:00
Atgeirr Flø Rasmussen
b3f515b4bb Replace unneeded inline deck with new EclipseGrid constructor. 2015-01-27 10:56:48 +01:00
Atgeirr Flø Rasmussen
d150107746 Update test for cartesian constructor.
We will now have cell info, even with that one.
2015-01-27 10:41:35 +01:00
Atgeirr Flø Rasmussen
74d213ce18 Fix inconsistencies in test cases.
Not detected earlier since schedule did not access grid data.
2015-01-27 10:39:39 +01:00
Atgeirr Flø Rasmussen
ff80db33ba Improved cartesian convenience constructor.
It now can take cell size arguments, and it always creates a complete grid.
2015-01-27 09:54:10 +01:00
Atgeirr Flø Rasmussen
79f32521ed Make Well class order completions when added. 2015-01-26 16:40:32 +01:00
Atgeirr Flø Rasmussen
7d6c9e1ea3 Add tests for well completion ordering. 2015-01-26 16:40:13 +01:00
Atgeirr Flø Rasmussen
345337cb2a Add method orderCompletions() to CompletionSet. 2015-01-26 16:39:32 +01:00
Atgeirr Flø Rasmussen
0a6cf17431 Fix initialization order to avoid warning. 2015-01-26 16:38:17 +01:00
Joakim Hove
02e0a12b0a Reorder Grid and Schedule init. 2015-01-26 12:26:25 +01:00
Joakim Hove
1bf6e90e02 Removed query function for default on well ref.depth. 2015-01-26 12:26:24 +01:00
Joakim Hove
d8f7c9660c Added simple algorithm to get ref depth from completions. 2015-01-26 12:26:24 +01:00
Joakim Hove
e432a1c75a Added getCellDepth() method to EclipseGrid 2015-01-26 12:26:23 +01:00
Joakim Hove
8d506b01a1 Added grid property to Well class 2015-01-26 12:21:51 +01:00
Joakim Hove
3cfe0291fd Added EclipseGrid as argument to Schedule constructor 2015-01-26 12:21:51 +01:00
Joakim Hove
8e4fd2b408 White space change 2015-01-26 12:21:51 +01:00
Joakim Hove
37aebbd3f5 Using Value<double> for Well::m_refDepth 2015-01-26 12:21:50 +01:00
Joakim Hove
85092991f6 Merge pull request #400 from iLoop2/Add_COMPLUMP_keyword
Add complump keyword
2015-01-26 12:21:12 +01:00
Fredrik Gundersen
a796cc12fb Update test
Verify that well do not change status to OPEN if the completions are status SHUT
2015-01-22 07:39:29 +01:00
Fredrik Gundersen
4f066af438 Moved logic from schedule to well->setStatus
Only set status for well to open if well has open completions is now verified for all
2015-01-21 14:07:02 +01:00
Fredrik Gundersen
1901aa90bc Changed the error message 2015-01-20 10:27:44 +01:00
Fredrik Gundersen
cccde3a0ee Added more tests for COMPLUMP 2015-01-20 08:59:56 +01:00
Fredrik Gundersen
fafeeda3c1 Fix logic for missing COMPLUMP 2015-01-20 08:59:16 +01:00
Fredrik Gundersen
cd9ed822bf Added test of COMPLUMP keyword 2015-01-19 13:35:33 +01:00
Fredrik Gundersen
cf008fefe6 Added handling of COMPLUMP keyword 2015-01-19 13:35:05 +01:00
Fredrik Gundersen
af8f7577f4 Added COMPLUMP json file 2015-01-19 12:49:14 +01:00
chflo
4d7213651c OPM 147: WELOPEN: Shut well if all completions are closed; throw exception if trying to open a well with all completions shut 2015-01-16 18:05:49 +01:00
Joakim Hove
b7127ae2c9 Merge pull request #397 from chflo/OPM-145
Opm 145
2015-01-16 13:20:37 +01:00
chflo
18710b6aa0 OPM-145: Removed action from EXCEL, NEXSTEP, RUNSUM, SEPARATE and WCONINJ keywords 2015-01-14 12:13:08 +01:00
Fredrik Gundersen
94b33eaf6e Rename method 2015-01-14 11:41:32 +01:00
Fredrik Gundersen
7ed82d6458 Code refactoring, logic update 2015-01-14 11:41:13 +01:00
Fredrik Gundersen
4af77efe75 Added new constructor to completion 2015-01-14 11:40:28 +01:00
chflo
6b445a539f OPM-145: Removed action from TUNING keyword, added items 2015-01-14 10:15:07 +01:00
chflo
3298fe4337 OPM-145: Removed tests for ACTION 2015-01-14 10:14:06 +01:00
chflo
a82509c676 OPM-145: Removed test ParseACTION 2015-01-14 10:11:50 +01:00
chflo
26a4a1d57d OPM-145: Removed action-related code from Parser class 2015-01-14 10:08:40 +01:00
chflo
4a33b934fa OPM-145: Removed member ParserKeywordActionEnum m_action and all traces of it from class ParserKeyword 2015-01-14 10:06:21 +01:00
Fredrik Gundersen
65cc82f6d7 Remove default values 2015-01-13 15:06:49 +01:00
Fredrik Gundersen
a05cf32c42 Extended test to include more cases 2015-01-13 15:06:28 +01:00
Fredrik Gundersen
60d0f66587 Cleanup of logic
Added method to create value item from deckitem
2015-01-13 15:06:06 +01:00
Fredrik Gundersen
1a669d1c87 Merge remote-tracking branch 'upstream/master' into closed_completions 2015-01-13 12:57:46 +01:00
Fredrik Gundersen
e8aac2120c Update gitignore 2015-01-13 12:57:16 +01:00
Fredrik Gundersen
503a592b89 Update logic 2015-01-13 12:57:00 +01:00
Fredrik Gundersen
9a154d417c Update logic 2015-01-13 12:56:49 +01:00
Fredrik Gundersen
5f14914257 Added more tests 2015-01-13 12:56:17 +01:00
Fredrik Gundersen
5a9620d8b2 Added test for WELOPEN keyword 2015-01-13 11:25:46 +01:00
Fredrik Gundersen
b0d0c92b5d update handleWELOPEN
Enable update of completion status using the WELOPEN keyword
2015-01-13 11:25:28 +01:00
Fredrik Gundersen
2f9d5f9e65 added method to enable add of completionset 2015-01-13 11:24:31 +01:00
Joakim Hove
cdf576d5f1 Will translate STOP -> SHUT for completions. 2015-01-12 12:33:49 +01:00
Joakim Hove
b12bcdb47b Added WellCompletion namespace for completion enums 2015-01-12 10:58:30 +01:00
Joakim Hove
87cfbb4f75 Let the opm-eclkwtest also create EclipseState 2015-01-02 16:53:26 +01:00
Joakim Hove
b1a30272a2 Added hasValue() protection 2015-01-02 16:53:26 +01:00
Joakim Hove
ecac5fc691 Added DeckItem::hasValue() method 2015-01-02 16:53:25 +01:00
Joakim Hove
c3ae6164fa Added comment about default 2015-01-02 16:53:25 +01:00
Joakim Hove
6e8230db2f Set default phase to OIL in EHYSTR keyword 2015-01-02 16:53:25 +01:00
Joakim Hove
2ba6d909b5 Revert "Revert "Revert "add default values required to make it possible to terminate keywords early"""
This reverts commit a42aece4319c0e5346fc375ff0613b02a68901d4.
2015-01-02 16:51:30 +01:00
Joakim Hove
cf97b3bbe6 Revert "Revert "make the parsing stage pass even if non-defaultable items have been defaulted""
This reverts commit 13d31809e8ca7b9f283bf29a0871110071263449.
2015-01-02 16:51:15 +01:00
Joakim Hove
6d140840ee Revert "add pseudo default values for more items"
This reverts commit 317bbdb2fdded13719d9a91e493757e8c1a94a4c.
2015-01-02 16:51:02 +01:00
Andreas Lauser
17fdbfb9a8 add pseudo default values for more items
this is required by the Norne deck. the EQLOPTS keyword seems weird,
though, because its records seem to have a variable number of items...

for most of these the RM says that if nothing is specified, a value of
another item should be used. some items even have legitimate
defaults, but they are only mentioned in the prose of the RM's item
description. (e.g.the wetting_phase_flag item of the EHYSTR keyword...)
2014-12-19 23:02:21 +01:00
Andreas Lauser
e0706524e0 Revert "make the parsing stage pass even if non-defaultable items have been defaulted"
This reverts commit 5ce5a3539641ac6eac9362d9c2b8a09084f9c35b.
2014-12-19 19:02:53 +01:00
Andreas Lauser
86b617794b Revert "Revert "add default values required to make it possible to terminate keywords early""
This reverts commit 41dbe397db56e547f254f3b0302440b8f7a00db5.
2014-12-19 19:02:44 +01:00
Andreas Lauser
e12a0aab1b parser main loop: handle unknown sized keywords in a better way 2014-12-19 10:59:12 +01:00
Joakim Hove
85f247fd2a Minor rebase fixup 2014-12-18 18:02:15 +01:00
Joakim Hove
e56a136565 Added support for COPYREG keyword 2014-12-18 18:02:15 +01:00
Joakim Hove
a92ff43237 Added COPYREG keyword 2014-12-18 18:02:14 +01:00
Joakim Hove
a4620f5ed0 Added support for ADDREG keyword 2014-12-18 18:02:14 +01:00
Joakim Hove
275d69255f Added ADDREG keyword 2014-12-18 18:02:13 +01:00
Joakim Hove
9ddd8e83c0 Added GridProperty::maskedAdd() and maskedCopy() 2014-12-18 18:02:13 +01:00
Joakim Hove
233b9b9e32 Added support for MULTIREG keyword in EclipseState 2014-12-18 18:02:12 +01:00
Joakim Hove
22bba69159 Added MULTIREG keyword. 2014-12-18 18:02:12 +01:00
Joakim Hove
d75c830388 Added GridProperty::maskedMultiply() method 2014-12-18 18:02:11 +01:00
Joakim Hove
ed89b8ee9d Added test for EQUAL. 2014-12-18 18:02:11 +01:00
Joakim Hove
be08d6df2a Added support for EQUALREG in EclipseState 2014-12-18 18:02:10 +01:00
Joakim Hove
06f2715d10 Added method GridProperties::getInitializedKeyword()
The getKeyword() method will autocreate and initialize a keyword if you
ask for one which is supported, but has not yet been accessed. The new
getInitializedkeyword() method will raise an exception if the keyword
has not already been initialized.
2014-12-18 18:02:10 +01:00
Joakim Hove
7588096c08 Added GridProperty::getDimensionString() 2014-12-18 18:02:09 +01:00
Joakim Hove
a100d94608 Added const to GridProperty::containsNan() 2014-12-18 18:02:09 +01:00
Joakim Hove
867fdb2de5 Added maskedSet() and initMask() GridProperties<T> 2014-12-18 18:02:08 +01:00
Joakim Hove
60ad53c7d1 Added EQUALREG json configuration 2014-12-18 18:02:08 +01:00
Andreas Lauser
de3b3e2772 Revert "add default values required to make it possible to terminate keywords early"
This is not necessary anymore with approach of the previous commit...
2014-12-18 11:43:52 +01:00
Andreas Lauser
231cf39d47 make the parsing stage pass even if non-defaultable items have been defaulted
... but throw later when trying to access the data of the item in
question.

Note that this was demanded by [at] joakim-hove and that I do not want
to be held responsible for any issues which are caused by this
approach. (read: please direct your barks to Joakim if you fell on
your nose because of this...)
2014-12-18 11:43:52 +01:00
Andreas Lauser
0262b333fd make items which do not have a default un-defaultable
this was a much more common problem than it seemed initially...
2014-12-18 11:43:52 +01:00
Andreas Lauser
74d2cca3a4 add default values required to make it possible to terminate keywords early
for many of them the RM says "default is undefined" but that I've come
to the conclusion that this doesn't mean that no default could be
applied, but that the simulator is allowed to screw up if the values
of them are accessed. (Note that in this sense this change is no
change from the current situation, but makes the screw-up more
explicit.)

In particular, note the GRIDUNIT keyword which had some serious JSON
syntax errors in it but so far the unit tests worked anyway for some
reason...
2014-12-17 16:37:17 +01:00
Joakim Hove
1f111668ac Removed stale comments - problem has been fixed. 2014-12-15 17:36:11 +01:00
Joakim Hove
19c29ff6df Added BUILD_TESTING() guard 2014-12-15 17:36:10 +01:00
Joakim Hove
b585655a5c Changes in the log class:
1. Moved to from eclipse/Parser -> eclipse/Log
 2. Renamed ParserLog -> OpmLog
2014-12-15 17:36:10 +01:00
Andreas Lauser
cf7e293635 make the build fail if a JSON keyword definition file could not be parsed 2014-12-15 17:19:32 +01:00
Andreas Lauser
b8a5280428 fix the unit for transmissibility when using the metric unit system
I don't know why exactly this happend, but anyway thanks to [at] bska
for catching it...
2014-12-12 12:21:38 +01:00
Andreas Lauser
c1988ad8a3 get rid of the 'strict parsing' concept
this is the 'Joakim-style' variant of the patch, i.e., an exception
will always be thrown if an unknown keyword is encountered.
2014-12-11 12:43:12 +01:00
Joakim Hove
994932738d Merge pull request #339 from andlaus/low_level_improvments
Low level improvments
2014-12-11 11:49:32 +01:00
Andreas Lauser
d87a49a178 add grid properties for the TRAN[XYZ] keywords 2014-12-10 22:19:26 +01:00
Andreas Lauser
982ad52d10 add the TRAN[XYZ] keywords
these are required to directly specify the transmissibility of
neighboring connections.
2014-12-10 16:59:15 +01:00
Andreas Lauser
9d8406e799 add the NNC keyword
this can be used to directly specify transmissibilities for
NNCs. Note that this keyword is quite a mess for everything after
the mandatory items according to the documentation.
2014-12-10 16:59:15 +01:00
Andreas Lauser
764dd03153 add a "Transmissibility" unit
this is required because Eclipse is inconsistent when specifying
transmissiblities: the only difference between transmissibilities in
metric and field units is that the pressures are in bars instead of
PSI, i.e. the numerator for metric units is still given in centi-Poise
times bbl. This makes it impossible to specify the transmissibilities
in terms of their constituting bits...
2014-12-10 16:58:37 +01:00
Joakim Hove
89f3a29e49 Merge pull request #344 from andlaus/more_useful_exception_messages
ParserKeyword: make the exception messages more verbose
2014-12-09 16:20:16 +01:00
Joakim Hove
fa3686a526 Merge pull request #235 from andlaus/add_NOGRAV
add the NOGRAV flag keyword
2014-12-09 14:06:58 +01:00
Andreas Lauser
9510b976d5 ParserKeyword: make the exception messages more verbose
mostly, include the keyword names, so that the user can fix these
errors without using gdb. (Not that I mind gdb, but I have been told
that gdb is a big no-no. ;)

(this patch also fixes a few typos...)
2014-12-09 13:25:49 +01:00
Andreas Lauser
92250423a1 add the NOGRAV flag keyword
according to [at] bska this is from Frontsim and should be supported.
2014-12-09 13:22:12 +01:00
Andreas Lauser
0cba93a283 address the review comment of #373 2014-12-09 12:41:04 +01:00
Tor Harald Sandve
bb40baa96f Make MULTREGT work for NNC.
The region multipliers are no longer added  to the cartesian logical
MULT[XYZ] structure. Instead a new method
getRegionMultiplier(globalIndex1, globalIndex2,FaceDir) is added that
return the multiplier between globalIndex1 cell and globalIndex2 cell.
The face direction is added to support directional dependent MULTREGT
input. This implementation of MULTREGT also supports restricting the
multipliers to only apply for NNC or NONNNC.
2014-12-09 12:14:36 +01:00
Andreas Lauser
1fdc60e73b Well(Injection|Production)Properties: adapt it to the naming and style conventions of the rest of the module
this patch only changes the conventions which are internal to the
code, i.e., users of these classes do not need to be adapted...
2014-12-09 12:05:27 +01:00
Joakim Hove
b924f6cd02 DeckKeyword is immutable. 2014-12-09 11:56:05 +01:00
Joakim Hove
081b87b5b4 Removed m_deckIndex property from DeckKeyword 2014-12-09 11:56:05 +01:00
Andreas Lauser
f4e4ab2796 Parser::parseState(): remove the 'verbose' debugging facility
This one could only be enable by modifying the source code. If such
debugging output is needed, it should be directly added via std::cout
and removed it before proposing the PR...
2014-12-09 11:55:03 +01:00
Andreas Lauser
755c3311f3 don't enter the parsing main loop if the leftover-from-last time keyword does not have any records 2014-12-09 11:54:55 +01:00
Andreas Lauser
017e582e5a handle comments and empty lines directly in the parser's main loop
note that comment handling is currently a bit too simplistic as stuff
like

FOO
'-- hello' /

won't work. as far as I can see, this is not different from the state
before this patch, though.
2014-12-09 11:54:55 +01:00
Joakim Hove
e03413f149 Merge pull request #378 from andlaus/remove_trailing_whitespace
remove all trailing white space
2014-12-08 19:54:53 +01:00
Andreas Lauser
b127b472ed clang 3.3: fix "unknown escape sequence" warnings 2014-12-08 18:28:19 +01:00
Andreas Lauser
aeb17403a7 GridPropertyInitializers: fix signedness comparison warning 2014-12-08 18:28:19 +01:00
Andreas Lauser
ea38a25af4 remove all trailing white space
this is just the result of

```
find -iname "*.[ch]pp" | xargs sed -i "s/ *$//"
find opm/parser/share/keywords -type f |  xargs sed -i "s/ *$//"
```

so if it causes conflicts with other patches, the others should get
priority. The rationale behind this patch is that some people tell
their editor to remove white space which leads to larger than
necessary patches...
2014-12-08 16:34:28 +01:00
Joakim Hove
f9b1fc56c8 Merge pull request #377 from joakim-hove/BUILD_TESTING
Build testing
2014-12-08 16:17:16 +01:00
Joakim Hove
ac299e62bc Removed unused Deck argument in method 2014-12-08 15:55:44 +01:00
Joakim Hove
ec6d22c9c2 Changed backtics to single ticks in string literal. 2014-12-08 15:55:20 +01:00
Joakim Hove
3604350847 Added if (BUILD_TESTING) ... around tests. 2014-12-08 15:54:34 +01:00
Joakim Hove
5ce2c11d94 Merge pull request #375 from dr-robertk/PR/add-keyword-SOF2-SWFN
Added keywords SOF2 and SWFN to allow for different saturation functions.
2014-12-08 15:46:18 +01:00
Joakim Hove
b81e23cd7b Merge pull request #376 from dr-robertk/PR/add-keyword-FULLIMP-IMPES
added keywords FULLIMP and IMPES.
2014-12-08 15:27:03 +01:00
Robert K
f9f819beff added keywords FULLIMP and IMPES. 2014-12-08 14:38:03 +01:00
Robert K
01ddb76075 Added keywords SOF2 and SWFN to allow for different saturation functions. 2014-12-08 14:13:34 +01:00
Joakim Hove
b9545b865c FindERT.cmake: Look for libecl_well library 2014-12-08 13:06:16 +01:00
Joakim Hove
bb9cf64776 Merge pull request #372 from chflo/OPM_139_write_ecl_restart_wellinfo
OPM-139: Added methods to Schedule
2014-12-08 09:59:45 +01:00
chflo
82243d0ec1 OPM-139: Added methods to Schedule to support opm-core in writing wellinfo to restart files 2014-12-05 12:59:53 +01:00
Joakim Hove
a2bc01ac64 Merge pull request #370 from andlaus/basic_temperature_support
Basic temperature support
2014-12-03 20:38:01 +01:00
Andreas Lauser
ad7f915a3e add a grid property for TEMPI
by default it is initialized using the temperature vs depth table...
2014-12-03 18:51:00 +01:00
Andreas Lauser
9ab4897587 add a table for RTEMPVD 2014-12-03 18:51:00 +01:00
Andreas Lauser
fdd66d911c add the keywords required to specify the initial reservoir temperature
E100 does not know about TEMPI, but it is wise not to use the
geothermal gradient directly, but to go over the "temperature at
cell-center" detour as specified by the E300 TEMPI keyword. The depth
vs. temperature table is given by the RTEMPVD keyword. The intend is
that if TEMPI stays unspecified the temperature is calculated at each
cell center and the result is put into TEMPI from where it gets picked
up by the simulator.

(Note that E300 says that TEMPVD is an alias for RTEMPVD even though
the possible sections of these two do not exhibit any overlap, WTF?)
2014-12-03 16:56:25 +01:00
Andreas Lauser
b1de0bf338 unit system: add temperature
this requires the possibility of specifying an offset for the SI
conversion because Eclipse in its eternal wisdom chooses to specify
temperatures using degrees Celsius and degrees Fahrenheit instead of
using Kelvin an Rankine...
2014-12-03 16:56:25 +01:00
Joakim Hove
00dc724aba Merge pull request #368 from qilicun/wpolymer
add WPOLYMER to schedule section.
2014-12-02 12:21:40 +01:00
Liu Ming
5b3a92159a add unit test for WPOLYMER. 2014-11-21 13:21:24 +08:00
Liu Ming
81be71cac8 throw if group polymer/salt concentration is set. 2014-11-20 17:23:12 +08:00
Liu Ming
94974f0454 add WPOLYMER to schedule section. 2014-11-20 16:20:54 +08:00
Joakim Hove
cc9fd8e3f7 Merge pull request #361 from flikka/keyword-folder
Put keywords in subfolders
2014-11-19 14:55:30 +01:00
Arne Morten Kvarving
51de1faa85 fixed: compile cjson object into libopm-json
i see no reason to keep the separate library and this circumvents
shared vs static linking issues.

an alternative fix is to fix the opm buildsystems to prioritize config
mode. that would be more involved.
2014-11-18 13:19:25 +01:00
Kristian Flikka
83a1016aaf Changed behaviour when same keyword occurs again, delete existing entry, replace with new. 2014-11-18 11:51:35 +01:00
Arne Morten Kvarving
870cf4514b added: cmake config mode and pkgconfig 2014-11-18 11:10:07 +01:00
Arne Morten Kvarving
303b9bc885 changed: cjson handling
- probe only for system lib (i.e. only probe in prefix paths)
old code ended up not installing the json lib due to finding a copy
in the build folder if a reconfiguration was performed.

- build internal copy static and bundle in libopm-json.so
no reason to install this as a shared library. if it is updated
originating from opm, the entire parser library is updated anyways.
2014-11-18 10:27:03 +01:00
Arne Morten Kvarving
a42b503bac fixed: properly encapsulate cjson 2014-11-18 10:27:03 +01:00
Joakim Hove
84f49e6e92 Merge pull request #362 from akva2/fix_shared_libs
Fix shared libs
2014-11-17 16:28:38 +01:00
Arne Morten Kvarving
019f3e6672 changed: always build helper library static 2014-11-17 14:58:40 +01:00
Arne Morten Kvarving
85934aa769 fixed: add missing object in parserBuilder library 2014-11-17 14:58:33 +01:00
Kristian Flikka
71e8321d7c Created folders for keywords, these will be read in an alphanumerical sorted order. To enable organization and override of keywords. 2014-11-17 13:37:00 +01:00
Kristian Flikka
b8f87a1eb1 Prints a warning if a keyword that has already been added, occurs again. Next step, process keywords from several ordered, top-level folders 2014-11-17 13:37:00 +01:00
Kristian Flikka
94306e6fdc Changed the KeywordMap to use keyword and not path as key, to enable check for existing keyword 2014-11-17 13:37:00 +01:00
Kristian Flikka
86d2fd2907 Removed unused variable 2014-11-17 13:37:00 +01:00
Joakim Hove
b2fbbfc8a7 Added small method to check if cell is active. 2014-11-16 20:07:03 +01:00
Joakim Hove
56b7f4e8c0 Removed emacs config 2014-11-16 19:08:10 +01:00
Andreas Lauser
f7fcd65f9f .dir-locals.el: remove Statoil developer setup specific commands
my emacs always asks me whether I want to apply these settings as it
consideres them unsafe. Furthermore, I use a different directory
structure, so these settings are useless to harmful for me.

If you want to keep these settings around, please move them to ~/.emacs
2014-11-11 12:11:54 +01:00
Joakim Hove
bae5a0cb46 Merge pull request #353 from joakim-hove/EclipsestateNoGrid
Eclipsestate no grid
2014-11-11 11:00:58 +01:00
Joakim Hove
456d36ccba Added test of EQUALS keyword auto creation. 2014-11-10 17:07:56 +01:00
Joakim Hove
ad75b870a5 Changes to emacs file . 2014-11-10 17:07:56 +01:00
Joakim Hove
5f7a7d8083 Removed EclipseState::hasGrid() method 2014-11-10 17:07:56 +01:00
Joakim Hove
cf5a839d97 Removed unnecessary default values. 2014-11-10 17:07:55 +01:00
Joakim Hove
ffce0408c4 Removed unused dummy grids in test deck. 2014-11-10 17:07:55 +01:00
Joakim Hove
52883c9e69 Check that exception is raised if PORV is initialized without grid. 2014-11-10 00:17:10 +01:00
Joakim Hove
24cb9944c6 EclipseGrid - check content of c_ptr before use
This commit contains quite large changes to the EclipseGrid. The main
functional change is that the access to the ecl_grid_type pointer is
protected. In addition there are 'white space' changes due to methods
moving around and some methods have been marked static.
2014-11-10 00:14:55 +01:00
Joakim Hove
6f4b353fe5 Using shared_ptr<EclipseGrid> instead of bare EclipseGrid * 2014-11-09 23:46:56 +01:00
Joakim Hove
39bca17ce0 Split EclipseGrid in dimensions and cell info.
In many cases the only required information in an EclipseGrid instance
is the cartesian dimensions. To facilitate simpler testing - and not
have to create a full dummy grid the dimensions have been internalized
as a separate nx,ny,nz triplet. With this commit it is possible to
instantiate a grid with only dimensions, and no underlying ecl_grid_type
pointer.
2014-11-09 23:31:53 +01:00
Andreas Lauser
a7ba8af558 EclipseState: make specifying anything which requires a grid an error if no grid could be instantiated 2014-11-09 17:37:32 +01:00
Andreas Lauser
4e293ee3e6 EclipseState: make it instantiable without a grid
instead of throwing, we now add a warning to the parser log...
2014-11-08 23:55:25 +01:00
Andreas Lauser
ead7e0a8c9 make the parser case-insensitive
i.e., make keywords ALL_UPPERCASE before using them because Eclipse
seems to be case-insensitive (although this is one of its undocumented
features...)
2014-11-07 14:24:12 +01:00
Andreas Lauser
fff0c9cdf0 Revert "also eat keywords containing lowercase letters"
this was inadvertedly merged. the real fix is to make the parser
case-insensitive...
2014-11-07 14:23:08 +01:00
Andreas Lauser
382d449ebb also eat keywords containing lowercase letters
The Norne deck actually exhibits this atrocity in form of the
'fluxnum' keyword in the file 'INCLUDE/PETRO/FLUXNUM_0704.prop'.

I don't know if Eclipse cares about the case of the keywords, but
opm-parser currently does for sure. (If Eclipse turns out to be
case-insensitive, the easiest fix for us is to just make all keywords
ALL_UPPERCASE...)
2014-11-07 12:58:04 +01:00
Andreas Lauser
e424017a31 grid property modifier keywords: make the box specifiers optional for all of them
this means adding defaults to EQUALS and COPY. While at it use -1 as
the default value for boxes in all of these keywords...
2014-11-07 12:02:05 +01:00
Andreas Lauser
af8cab1a64 ParserKeyword: fix typos and improve exception messages 2014-11-07 12:02:05 +01:00
Andreas Lauser
7955ea5dac ParserState: make it possible to detect if initialization went wrong
this is required to get meaningful error messages if the file
specified by INCLUDE does not exist.
2014-11-06 16:16:29 +01:00
Andreas Lauser
5bdb17f7c1 Parser: rename the internal parseStream() method to parseState()
there is still the public variant of Parser::parseStream() which
parses an arbitrary std::istream. the name of the state-taking variant
was just confusing, IMO...
2014-11-06 15:16:19 +01:00
Andreas Lauser
b2c17e5d1d ParserDoubleItem: Fix typos in exception message 2014-11-06 14:48:25 +01:00
Joakim Hove
4283097f13 Merge pull request #336 from osae/fix_smax
A few missing "SWMAX" ... (confer issue #334)
2014-11-06 09:29:51 +01:00
Joakim Hove
25c99f2335 Merge pull request #337 from andlaus/add_endpoint_specifiers
add a JSON definition for endpoint specifier keywords
2014-11-06 09:29:20 +01:00
Andreas Lauser
cfa57713b8 ParserLog: some minor additions
- the AllMessageTypes is not part of the MessageType enum anymore
- the getMessageType() now returns a MessageType enum instead of an integer.
- the clear() and append() methods have been added.
2014-11-05 14:04:04 +01:00
Andreas Lauser
46ff1a0f41 unknown keywords: use the line number of the raw keyword instead of the current one of the ParserState
in this context, the line number of the parser state object is the
location where the keyword is finished, while it is much more useful
to get the line where the keyword starts...
2014-11-05 13:13:50 +01:00
Andreas Lauser
f8946b9e7e RawKeyword: rename tryParseKeyword() to isKeywordPrefix()
because the method never tried to *parse* the data as a keyword but always
returned whether the *calling* code should try to parse it...
2014-11-05 13:11:52 +01:00
Andreas Lauser
fbf6008da4 Parser: rename and split canParseKeyword to isRecognizedKeyword
which is more what the method does because the keyword can still
contain an error in its data which would make it non-parseable.

While at it, split the method into a "get keyword name from input
line" and "is a valid keyword name" part. (this will be needed later.)
2014-11-05 13:08:04 +01:00
Andreas Lauser
6eb3421f38 Handle quotes better
This allows to arbitrary characters like stars into strings. e.g.

MYKEYWORD
'123*456' 2*'Hello, World! (*)' /

is now a valid record with three strings while it threw an exception
before.

This patch works by transferring the removal of the quotes from the
RawDeck class to the readValueToken<T>() function which now has a
specialization for strings that deals with quotes. One small
complication is that the RawDeck needs to be adapted in order not to
split tokens in the middle of strings.

Finally, the StarToken class does not deal with the conversion from
string to the value type of the item anymore which allows it to become
a normal class instead of a template...
2014-11-05 13:05:22 +01:00
Andreas Lauser
d3188b6e8b add a JSON definition for endpoint specifier keywords 2014-10-30 20:52:25 +01:00
osae
954decba24 A few missing "SWMAX" ... (confer issue #334) 2014-10-30 18:49:34 +01:00
Joakim Hove
879f30e3ff Merge pull request #331 from andlaus/fix_PORV_tests_v2
Fix PORV tests v2
2014-10-21 14:44:16 +02:00
Andreas Lauser
3d2a6354a4 fix the "only <double> can be queried for NaN" exceptions
seems like some compilers don't overwrite an inline method of a
template class with its specialization. A compiler warning would have
been nice to have in this case, though...
2014-10-21 13:40:49 +02:00
Andreas Lauser
5b5a3337b0 EclipseState: don't use static vectors to specify supported grid properties
this fixes a really ugly and hard to find bug if EclipseState was
instanced multiple times: The EclipseState object passed to some of
these structures was destroyed, but the arrays stayed even if the next
EclipseState object was at a different location and also could use a
completely different grid...
2014-10-21 13:03:09 +02:00
Andreas Lauser
fa845b287e make the PORV test work more reliably
this seems to be a compiler bug, but it could be something
else. Anyway, using multiple functions for the tests instead of nested
scopes is probably not the worst idea anyway...
2014-10-21 11:48:51 +02:00
Joakim Hove
1cb4c1c082 Added missing sections: attribute 2014-10-20 10:36:45 +02:00
Joakim Hove
dc035c3c58 Merge pull request #314 from joakim-hove/PORV
Porv
2014-10-20 09:58:25 +02:00
Joakim Hove
322dbb67e4 Merge pull request #326 from joakim-hove/wellsmanager-crash
Wellsmanager crash
2014-10-17 08:06:14 +02:00
Joakim Hove
16ba570103 Merge pull request #296 from andlaus/add_section_awareness
Add section awareness
2014-10-15 18:44:35 +02:00
Joakim Hove
a50e66b8a9 Added BoxTest which will throw for oversized keyword 2014-10-15 13:26:14 +02:00
Joakim Hove
c637463327 Added functionality to calculate PORV property. 2014-10-15 13:26:14 +02:00
Joakim Hove
95c4d41a30 Merge pull request #322 from andlaus/non-strictly_monotonic_in_plyads
PlyadsTable: do not require the second column to be strictly monotonic
2014-10-14 22:14:19 +02:00
Joakim Hove
72cc1630f0 Added extra test case for closing wells. 2014-10-14 16:59:35 +02:00
Joakim Hove
3a48ace17f Fixed log message 2014-10-14 16:10:44 +02:00
Andreas Lauser
29cad4d51b add the ALL keyword
The documentation of this keyword is quite well hidden in the "Other
SUMMARY keywords" section of the Eclipse reference manual, but the
keyword itself seems to be widely used...
2014-10-14 12:07:14 +02:00
Andreas Lauser
6b6a5bf69e change the name for the generated keyword tests to make them unambigous
the problem was the ALL keyword which caused a naming conflict with
Opm::ParserItemSizeEnum::ALL. I haven't considered the possibility to
break the build by adding a keyword, so sorry for the breakage.

On a more philosophical ground I think it is a bit questionable to
auto-generate test cases at build time because they will automatically
match the keyword definition, whether this definition makes sense or
not...
2014-10-14 12:03:58 +02:00
Joakim Hove
21acc50115 Revert "add the ALL keyword" 2014-10-14 08:39:00 +02:00
Joakim Hove
a43d8e447c Fixed initialisation of well properties
Previously the control mode was initialized to ORAT; this was later set
to the correct value when parsing the relevant keywords - but in the
case of a SHUT well the control mode was not updated, and we were left
with a well under ORAT control.
2014-10-13 19:26:53 +02:00
Joakim Hove
ed1b1072c3 Added CMODE_UNDEFINED enum values 2014-10-13 19:24:55 +02:00
Joakim Hove
94a7a498b3 Moved WellInjectionproperties to separate files. 2014-10-13 19:24:02 +02:00
Andreas Lauser
85485db2a2 remove the TlmixparTable class
that's because the TLMIXPAR keyword is not a table...
2014-10-13 18:44:22 +02:00
Andreas Lauser
3b86bfd474 remove dangling file opm/parser/eclipse/Utility/tests/TableTests.cpp
somehow this fell through the cracks when doing the big tables overhaul.
2014-10-13 18:41:52 +02:00
Andreas Lauser
124aa75df8 PlyadsTable: add a unit test and fix a copy-and-paste bug unearthed by it 2014-10-13 18:40:42 +02:00
Andreas Lauser
0fd43afede add the ALL keyword
This keyword is undocumented but seems to be widely used. (It is even
featured by an example in the Reference Manual.)
2014-10-13 17:38:45 +02:00
Andreas Lauser
ee9b7d2cae Extend deck grooming functions to detect keywords which are in invalid sections 2014-10-13 16:06:09 +02:00
Andreas Lauser
a4f55f5f8d JSON keyword definitions: make the "sections" item mandatory
the empty list can be used which means that the keyword may occur in
any section. (which is useful for e.g. section delimiters.)
2014-10-13 16:06:09 +02:00
Andreas Lauser
d94097617b ParserKeyword: add the glue code so that it knows its sections 2014-10-13 16:05:59 +02:00
Andreas Lauser
28fa0fa3b4 JSON keyword definitions: add a "sections" item
this which specifies the allowed sections of the keyword. (surprise!)
2014-10-13 16:05:59 +02:00
Andreas Lauser
8d56ef5179 PlyadsTable: do not require the second column to be strictly monotonic
monotonic is sufficient. thanks to [at] qilicun for the catch!
2014-10-13 12:22:09 +02:00
Joakim Hove
da5fd34262 Merge pull request #319 from qilicun/add_wpolymer
Let parser recongnize keyword WPOLYMER.
2014-10-13 08:39:59 +02:00
Liu Ming
697f2245f7 Let parser recongnize keyword WPOLYMER. 2014-10-13 10:56:30 +08:00
Liu Ming
209ecbeb21 size of PLYMAX should be determined by NPLMIX in REGDIMS not MISCIBLE. 2014-10-13 09:52:12 +08:00
Joakim Hove
685bd7171a Merge pull request #317 from qilicun/kw_polymer
add kyeword polymer.
2014-10-11 14:16:12 +02:00
Liu Ming
173661f14b add kyeword polymer. 2014-10-11 11:31:42 +08:00
Joakim Hove
e0cf8cebde Added postprocessor properties to scatter from top.
For the petrophysical properties PERM? and PORO only the top layer must
be specified, cells further down can be copied from the layer
above. This functionality is implemented with a GridProperty
postprocessor.
2014-10-10 15:48:57 +02:00
Joakim Hove
1df2e656a9 Added post processor to GridProperty 2014-10-10 15:48:01 +02:00
Joakim Hove
f8abfe6333 Added keyword MULTPV 2014-10-10 15:48:01 +02:00
Joakim Hove
e8c5176f1b Added containsNaN() method to GridProperty 2014-10-10 15:48:01 +02:00
Joakim Hove
b26475031c Added GridProperty::multiplyWith( ) 2014-10-10 15:48:00 +02:00
Joakim Hove
88d9319197 Added iset() method to GridProperty 2014-10-10 15:48:00 +02:00
Joakim Hove
dc3f37dd27 Added LogParser argument. 2014-10-10 15:24:58 +02:00
Joakim Hove
82e8d1a56b Added static_cast<long long> before calling std::to_string() 2014-10-10 15:24:26 +02:00
Joakim Hove
14ba7e7e74 Merge pull request #310 from andlaus/improve_logging
Improve logging
2014-10-10 15:04:18 +02:00
Andreas Lauser
c41f5ac2ed ParserLog: print messages to a stream
If no ParserLog object is provided, stdout is used by default. The
stream can also be used to write to a logfile or it can be omitted
entirely. thanks to [at] joakim-hove for insisting on it...
2014-10-10 12:40:35 +02:00
Joakim Hove
e5fe0a9b9a New MULTREGT test based on copy FLUXNUM -> MULTNUM 2014-10-09 17:14:27 +02:00
Andreas Lauser
c73cb0b39a add most of the keywords required to parse decks used by the IRIS history matching codes
this basically comes down to adding a few flag keywords but also
requires to add a few E300 fields to TABDIMS...

the grid cannot be instantiated yet as these deck seem to use some
peculiar constructs to specify the grid data. In particular it uses
property modifiers for keywords that specify the grid. (which might be
not allowed by Eclipse but work anyway...) the deck contains something
like

```
GRID

EQUALS
DX  50.0 /
DY  50.0 /
DZ  50.0 /
/
```

which Opm::EclipseGrid can't handle yet because grid properties are only
evaluated after the grid has been instantiated...
2014-10-08 14:29:04 +02:00
Andreas Lauser
f51016db57 EclipseState: significantly extend usage of the new logging facility
in the process quite a few exceptions have been converted into log
messages.
2014-10-07 15:39:15 +02:00
Andreas Lauser
335a031185 add separate unit test for the Opm::checkDeck() function 2014-10-07 15:39:14 +02:00
Andreas Lauser
ff90fe71c0 replace the deck-internal logging system by ParserLog 2014-10-07 15:39:14 +02:00
Andreas Lauser
f600930a5f add a class for log messages of the parser
unsurprisingly, it's called ParserLog. For now, it is not used very
extensively, but it allows to demingle the log messages from the deck
objects. (i.e., it's possible to pass a const pointer to the deck
object to e.g. EclipseState and one will still get additional log
messages.)
2014-10-07 15:37:27 +02:00
Andreas Lauser
6736213bae Section::checkSectionTopology(): report more than the first error
i.e. don't return uppon encountering an error, just set a flag.
2014-10-07 14:22:56 +02:00
Andreas Lauser
76904f244f Opm::checkDeck(): complain about unrecognized keywords
"unrecognized" means "not created based on a ParserKeyword object"
2014-10-07 14:22:56 +02:00
Andreas Lauser
f76113f2b1 DeckKeyword: retain the ParserKeyword object
this is useful because DeckKeywords can have almost arbitrary names
(which match a regular expression) which makes it hard to retrieve
additional information about the keyword after it has been created...
2014-10-07 14:22:47 +02:00
Andreas Lauser
f651a8e9d8 add Opm::checkDeck()
this is analogous to Opm::Section::checkDeckTopology() but intended to be
more general. So far not too many tests are implemented...
2014-10-07 14:22:47 +02:00
Andreas Lauser
38797ea534 DeckKeyword: retain the location of keywords
this is useful for log messages.
2014-10-07 14:22:47 +02:00
Joakim Hove
4d88001b69 Merge pull request #309 from qilicun/plykw
update keyword PLYADS.
2014-09-28 11:59:17 +02:00
Liu Ming
daa6744116 update PLYADS "dimension". 2014-09-28 14:10:28 +08:00
Joakim Hove
e6733c7c8c Changed order of dimensions in PLYVISC 2014-09-28 07:54:15 +02:00
Liu Ming
f228554796 update keyword PLYADS. 2014-09-28 09:15:03 +08:00
Joakim Hove
5e6eb61023 Updated the PLYVISC keyword 2014-09-26 13:56:25 +02:00
Joakim Hove
70c94a36b2 Renamed GridProperty::size -> GridProperty::getCartesiansize 2014-09-26 09:57:33 +02:00
Joakim Hove
fa335b50fb Integrated the MULTREGT in the EclipseState/TransMult 2014-09-26 09:57:33 +02:00
Joakim Hove
9c43c63d9e Added class MULTREGTScanner
The class MULTREGTSCanner internalizes the content of one or several
MULTREGT keywords and can then scan through GridProperty region objects
to find region interfaces as specified in the MULTREGT keyword.
2014-09-26 09:53:25 +02:00
Joakim Hove
896a0b32fb Removed dummy -1 default values from MULTREGT 2014-09-26 09:53:24 +02:00
Joakim Hove
6a99d7c5ea Updated FaceDir functionality to support MULTREGT 2014-09-26 09:53:24 +02:00
Joakim Hove
95592ebbd7 Added MULTNUM keyword 2014-09-26 09:53:24 +02:00
Joakim Hove
f8cbb6592a Added getNXYZ() to the grid property. 2014-09-26 09:53:24 +02:00
Andreas Lauser
755b8f53cf check if the keyword item has sufficiently many data points before using defaultApplied()
this fixes the GridPropertyTests unit test. The morale of this is that
I should probably never trust my own stupidity...
2014-09-25 22:32:07 +02:00
Andreas Lauser
350c92375e add the PORV grid property and use NaNs as default values for most double grid property
when it comes to PORV, the final pore volumes of logically Cartesian
grids are hard to implement at this abstraction level because pore
volumes may be either specified using the PORO or by the PORV keywords
and both of them are grid properties. This means that to calculate the
pore volumes using the porosity, the porosity grid property must be
already finished when creating PORV. Because of potential interactions
between the PORV and PORO grid properties this is not possible to do
canonically at the grid property initializer stage...
2014-09-25 21:36:59 +02:00
Andreas Lauser
45619a93f2 GridPropertyInitializers: add unit test 2014-09-25 21:36:43 +02:00
Andreas Lauser
c5f602a17c grid properties: implement a table-lookup initializer for the endpoint scaling keywords 2014-09-25 21:36:42 +02:00
Andreas Lauser
f54de8eafb grid properties: introduce initializer objects
this makes it possible to define more complicated initializers for
grid properties. (needed for example for keywords like ISGU.) This
patch does not introduce them yet, but only adds the necessary
infrastructure.

notes:

 - to get around cyclic definitions in template classes, the
   EclipseState is changed to a (defaulted) template parameter which
   causes the compiler to only look up the class definition at
   instantiation time.
 - using std::shared_ptr in the property initializers would lead to
   cyclic references which would cause memory leaks. To avoid that,
   plain old references where used in most places. I think this is
   okay as the GridProperty objects should be considered internal to
   EclipseState and thus the EclipseState object should live at least
   as long as GridProperty objects...
2014-09-25 21:36:42 +02:00
Andreas Lauser
f8ec08e069 change the defaults for the *NUM integer properties to 1
and add the ENDNUM integer property.
2014-09-25 21:36:42 +02:00
Andreas Lauser
036db1da4a GridProperties: don't use the garbage from defaulted data items
e.g.

```
SWL
10*0.1 10* 10*0.2 /
```

resulted in the SWL keyword exhibiting undefined values for the middle
ten data points.
2014-09-25 21:36:42 +02:00
Andreas Lauser
68df912f7d data items: allow to set only a subset of the values
e.g. Eclipse specifies that for PERMX only the topmost layer needs to
be specified, i.e. the following is valid on a 3x3x3 grid

```
PERMX
9*10 /
```

the previous behaviour was to throw.

also, mark if data items have been defaulted, i.e., the item of

```
PERMX
* /
```

will now return true for 'defaultApplied()'.
2014-09-24 12:47:57 +02:00
Andreas Lauser
b4ff0efff8 EclipseState: export the IMPTVD and IMKRVD tables
and also fix a small build bug in these table classes. I don't know
why they have not been also fully dealt with in the recent table code
refactoring...
2014-09-24 12:47:57 +02:00
Xavier Raynaud
20c9a616e0 Use CMODE to set default control in WCONINJH. 2014-09-22 10:11:46 +02:00
Xavier Raynaud
4011cc96c6 Added test to check if default value is used. 2014-09-19 17:40:40 +02:00
Xavier Raynaud
9e61f55f6b Merge branch 'master' into wconinjh-support 2014-09-19 16:56:41 +02:00
Xavier Raynaud
48e687a8ea set controlMode to RATE for WCONINJH 2014-09-19 16:51:02 +02:00
Andreas Lauser
7ad309d3b3 move the table classes from .../Utility to .../EclipseState/Tables 2014-09-19 15:12:21 +02:00
Xavier Raynaud
fe15d4a1d2 Added support for wconinjh 2014-09-19 14:58:37 +02:00
Andreas Lauser
a057280492 tables: remove trailing underscores from the protected and private methods
opm-parser does not follow this convention...
2014-09-19 14:33:35 +02:00
Andreas Lauser
f6b2797e23 tables: make them instantiable exclusively by EclipseState
since tables can be tricky, we now enforce that the compiler bails out
if the user tries to instantiate a table class manually.

Note that a bit of trickery is needed to keep the low-level unit
tests working...
2014-09-19 14:33:35 +02:00
Andreas Lauser
aa0d7d2e6b EclipseState: initialize and expose the tables which are featured by the deck
since this code is becomming a bit tricky, it is now recommended to
use the tables of EclipseState instead of trying to initialize them
yourself...
2014-09-19 12:24:54 +02:00
Andreas Lauser
e994d7314e endpoint scaling tables: make the bare-metal getColumn(index) method public
it is _strongly_ encuraged to use the properly named methods to access
the respective columns, but opm-core's current endpoint scaling code
makes it hard to use these...
2014-09-19 12:24:54 +02:00
Andreas Lauser
59d35de3af add table classes for RSVD and RVVD
these keywords are used by opm-core, albeit currently in a
"bare-metal" way.
2014-09-19 12:24:54 +02:00
Andreas Lauser
f544c926df tables: propertly handle defaults and monotonicity of columns
for some kinds of tables this means linear interpolation for some
columns, constant for other columns and some tables do not allow to
specify default. Since there is no clear rule, this patch involved
checking the reference manual for every single f****** table keyword
plus some guess-work if the reference manual is unclear about
monotonicity and/or defaults.
2014-09-19 12:07:06 +02:00
Andreas Lauser
fd6209a34d make it possible to evaluate some tables using linear interpolation
... and constant interpolation at the fringes. this kind of evaluation
in between sampling point only makes sense for tables where the first
column is strictly monotonic, though.
2014-09-19 12:07:06 +02:00
Andreas Lauser
1bbe775831 make all table classes default constructible
this allows to store them in std::vectors, but requires to call the
init() method after construction...
2014-09-19 12:07:06 +02:00
Andreas Lauser
0055703aef remove PvcdoTable
because PVCDO is not a table keyword.
2014-09-19 12:07:06 +02:00
Andreas Lauser
0d423b83f4 remove the PvtwTable
because PVTW is not a table keyword...
2014-09-19 12:07:06 +02:00
Andreas Lauser
f440f34788 remove RockTable
because ROCK is not a table keyword
2014-09-19 12:07:06 +02:00
Andreas Lauser
c5f78788e0 add the IMPTVD and IMKRVD keywords and table classes
basically they are just renamed copies of the EN* variants...
2014-09-19 12:07:05 +02:00
Andreas Lauser
7f786a7ccc add the ROCKOPTS keyword
because to properly initialize the ROCKTAB table, it is required...
2014-09-19 12:07:05 +02:00
Andreas Lauser
ef6e76562b Deck: mark numKeywords() and getKeywordList() as const
this was probably an oversight...
2014-09-19 12:07:05 +02:00
Andreas Lauser
eccf3d4551 ParserItem: improve the equallity testing code and remove the defaultSet() method
but we still need the m_defaultSet member because NaN == NaN as well
as NaN != NaN...
2014-09-15 12:29:58 +02:00
Andreas Lauser
435e6aa6c5 extend "StarToken" class
that's because not every token which contains a star represents an
repetion, e.g.

'PROD*'

and

'123*456'

(with the quotes) are strings...
2014-09-15 12:27:28 +02:00
Andreas Lauser
6dbe6ae5ac remove the "value status" concept from deck items
I know it was only added recently, but all of the "setInDeck()" calls
can now be substituted by a combination of item->size() and
item->defaultApplied(index)...
2014-09-15 12:17:04 +02:00
Andreas Lauser
16337759b6 add some defaulted values to the unit test of PVTG 2014-09-15 12:17:03 +02:00
Andreas Lauser
e014896e35 add more explicit unit test for defaulted deck items
(the ParserItemTests already have one (Scan_All_WithDefaults) but a
second one won't hurt...)
2014-09-15 12:17:03 +02:00
Andreas Lauser
b72df6f406 make ParserItems always defaultable
i.e. remove the defaultSet() method and its friends. this is required
to be able to specify defaults in DATA items like grid properties or
saturation tables. e.g.

SGL
10*0.1 10* 10*0.2 /

would not be possible without this. If no meaningful default for an
item is defined, float and double items get NaN, int items get -1 and
string ones get an empty string. The hope is that if these values get
used in the simulation, they will make the result obviously
incorrect. (Whether a data point of an item was defaulted can be
queried using item->defaultApplied(index).)
2014-09-15 12:17:03 +02:00
Andreas Lauser
539c7a23ae make the defaults of an item settable per data point
instead of for the whole item...
2014-09-15 12:17:03 +02:00
Andreas Lauser
e6fa1e01a8 DeckItem: add indices to the methods which allow to query the defaulted status
also, this renames DeckItem::setInDeck() to DeckItem::wasSetInDeck()
because the former method can easily be confused with a setter method
(which it is not, it is a 'getter').

note that there is a small semantical difference now: the old
signatures specified the status of the whole *item* while the new
variants are specific for a single *data point* of an item. Though at
this point the index passed to the methods is still disregarded..
2014-09-15 12:17:03 +02:00
Andreas Lauser
09d9508c39 remove the 'ParserBoolItem.[ch]pp' files
they were empty and as far as I can see, Eclipse does not have the
concept of boolean items...
2014-09-15 12:17:03 +02:00
Joakim Hove
981d63e1ac Fixed dimension of Kh item to Permeability*Length 2014-09-09 14:11:37 +02:00
Andreas Lauser
76b8cc6e4f EclipseState: provide an accessor method for the unit system used by the deck
this is required to convert calculated quantities to the same units as
the ones used in the input deck.
2014-09-09 12:16:13 +02:00
Andreas Lauser
66139d9f07 fix compiler warnings and rename CF to ConnectionTransmissibilityFactor
for the compiler warnings, see e.g.

https://opm-project.org/CDash/viewBuildError.php?type=1&buildid=27777

the CF to ConnectionTransmissibilityFactor rename makes things much easier to
understand for people who are not intimately familiar with the wells
code.
2014-09-06 22:18:55 +02:00
Joakim Hove
152e07775a Merge pull request #294 from andlaus/GridProperties_first_int_then_double
first handle all integer properties, then all double ones
2014-09-05 14:42:22 +02:00
Joakim Hove
2b114b8b46 Removed explicit default value from two config items. 2014-09-05 12:31:57 +02:00
Andreas Lauser
09d149b0c7 Removed all trailing spaces from JSON 2014-09-05 11:01:44 +02:00
Andreas Lauser
b2570ef216 remove some keywords which are already covered by *_PROBE 2014-09-05 10:58:10 +02:00
Andreas Lauser
e73af3d182 REGION_PROBE: add more user defined keywords
these are not really documented, but they are used by the file
./INCLUDE/SUMMARY/extra.inc of the Norne deck. I don't know why this
did not bite anyone so far, probably people just commented out the
INCLUDE statement of this file...
2014-09-05 10:58:06 +02:00
Andreas Lauser
1f618ed546 add a PERFORMANCE_PROBE parser keyword
this contains all performance monitoring keywords like TCPU or PERFORMA
2014-09-05 10:57:59 +02:00
Joakim Hove
be32f91004 Changed Completion to use Value<double>. 2014-09-04 22:10:16 +02:00
Joakim Hove
f88fd65937 Implemented PINCH and MINPV as Value<double> 2014-09-04 22:10:16 +02:00
Joakim Hove
c08770c853 Added class Value<T>
The class Value<T> will keep track of a named variable, and whether that
particular value has been explicitly initialized. Will throw
std::logic_error if trying to use an unitialized value.
2014-09-04 22:10:09 +02:00
Joakim Hove
c1f42aee64 Moved OrderMap to EclipseState/Util 2014-09-04 14:09:33 +02:00
Joakim Hove
fedc3387fd Default: Added dataset from opm-core with test 2014-09-03 10:37:02 +02:00
Joakim Hove
544b6db1c0 Default: Added method hasValue() 2014-09-03 10:37:02 +02:00
Joakim Hove
52846a0761 Default: Explicitly set default values in config 2014-09-03 10:37:02 +02:00
Joakim Hove
e120c161c4 Default: Changes for default applied. 2014-09-03 10:37:01 +02:00
Joakim Hove
9cd30b8c7a Default: Removed invalid default value. 2014-09-03 10:37:01 +02:00
Joakim Hove
32d2901b0f Default: Split options keyword to have 197 items 2014-09-03 10:37:01 +02:00
Joakim Hove
b161bd6fc2 Default: Explicitly added default == 0 for box 2014-09-03 10:37:01 +02:00
Joakim Hove
d6fa1449af Default: Changed size_type: ALL -> SINGLE 2014-09-03 10:37:01 +02:00
Joakim Hove
cec42ff8d9 Default: Using setInDeck() instead of relying on size == 1 2014-09-03 10:37:01 +02:00
Joakim Hove
aa36738f04 Default: DeckItem will throw if you ask for missing data 2014-09-03 10:37:01 +02:00
Joakim Hove
61cdf7d402 Default: defaultApplied -> setInDeck()
The data values in a deck item can be in three different states, given
by the DeckValue enum in DeckItem.hpp. The three values are:

  SET_IN_DECK : The value has been set explictly in the deck.
  DEFAULT     : The value was not present in the input deck, but a default
                value has been supplied in the configuration and that value
                has been set.
  NOT_SET     : No value has been set for this item; it was not explicitly
                set in the deck and also not included in the configuration.

If you ask for DeckItem->value which is in state NOT_SET you will get an
exception. The method setInDeck() can be used to check if a value has
been set explicitly in the deck; the method defaultApplied() will check
if a default value has been applied.

Observe that the system for handling defaults is not really well suited
for multi valued data items, as it is only a scalar state variable. In
the case of multi valued data items both defaultApplied() and
setInDeck() might return true.
2014-09-03 10:37:01 +02:00
Joakim Hove
cebf991210 Default: Updates to the scan routine. 2014-09-03 10:37:01 +02:00
Joakim Hove
bf35919c6f Default: Changed default handling in ParserItem
This is the first of several large commits changing several aspects of
the handling of defaults. The overall main purpose of these changes is
to protect against using non sensible values in the case the values have
not been sensibly specified in the deck. The changes in this commit
include:

 1. The "default default" values to be used when an item without an
    explicit default are defaulted are removed completely.

 2. If a ParserItem is queried for a default value when no default has
    been assigned it will raise an exception.
2014-09-03 10:37:00 +02:00
Joakim Hove
be0558607c Default: Changed defaultApplied bool to enum
We now have an enum which can keep track of three possible states for
the data in a deck item:

  VALID   : A valid value has been set
  DEFAULT : The default value has been applied
  NOT_SET : The value has not been set.

The intention is to throw if/when a DeckItem with status == NOT_SET is
accessed.
2014-09-03 10:37:00 +02:00
Joakim Hove
6c7b613111 Default: Implemented ParserxxxItem::scan() with template 2014-09-03 10:37:00 +02:00
Joakim Hove
8b2981283f Default: Updates to ParserItem::equal()
1. The boolean flag m_defaultSet() is included in the actual
    comparison.

 2. The compare functions is implemented as a functions template.
2014-09-03 10:37:00 +02:00
Joakim Hove
de73c688e3 Removed debug output clutter 2014-09-03 10:37:00 +02:00
Joakim Hove
8f54c4e555 GroupTree::prinTree() takes std::ostream argument 2014-09-03 10:37:00 +02:00
Bård Skaflestad
422d37b138 Capture and provide completion direction
This is needed for clients to act intelligently in the presence of
horizontal completions (in the context of deviated wells).
2014-08-31 21:23:18 +02:00
Andreas Lauser
afa93d67b3 first handle all integer properties, then all double ones
this is required in situations where double grid properties depend on
the values of integer (i.e, *NUM) ones which appear later in the
deck. Example:

```
PROPS

SWU
* /

REGIONS

SATNUM
*2 /
```

the default value of the SWU keyword depends on the value of the
SATNUM property which only gets defined later in the deck. an
alternative to the approach of this patch would be to process the
grid properties of the REGIONS section before the others. I'm a bit
indifferent which approach is better...
2014-08-28 12:19:31 +02:00
Atgeirr Flø Rasmussen
1d66b2d04d Add dimension to the threshold pressure. 2014-08-27 17:37:17 +02:00
Joakim Hove
1f77c8251d Merge pull request #288 from andlaus/be_strict_by_default
EclipseState: require the canonical section topology
2014-08-26 21:36:16 +02:00
Andreas Lauser
b690d9add8 EclipseState: check the canonical section topology
at least if the "beStrict" parameter for the constructor is set to
true. by default nothing changes...
2014-08-26 12:29:17 +02:00
Andreas Lauser
180a4db1d5 work around an optimizer performance bug in clang.
It seems like some optimization passes of CLang which are enabled by
-O2 (at least in my version, 3.3) do not like nested scopes and long
functions too much. Thus, slightly change the generated source. Timing
on my (quite beefy) machine:

without patch:

make
rm -rf generated-source; time make
time make
[...]
real    10m31.110s
user    10m16.264s
sys     0m13.672s

with patch:

make
rm -rf generated-source; time make
time make
[...]
real    0m47.011s
user    0m44.670s
sys     0m1.968s

the memory used by the compiler goes from 28.8GB to about 330 MB. (I
suppose not everybody has 32 Gigs of memory yet. ;)
2014-08-25 16:08:27 +02:00
Joakim Hove
0b01c2d65f Merge pull request #287 from atgeirr/add-minpv
Add MINPV features to EclipseGrid
2014-08-25 14:22:00 +02:00
Andreas Lauser
c2329b72ba add a few missing includes
these includes are required by the headers. If the affected files
would have been included without the headers included before, a
compiler error would have been produced.
2014-08-25 14:07:28 +02:00
Atgeirr Flø Rasmussen
da50b320fa Add MINPV features to EclipseGrid class. 2014-08-25 11:15:39 +02:00
Atgeirr Flø Rasmussen
8a95b89bfb Add LiquidVolume dimension to MINPV keyword. 2014-08-25 11:15:15 +02:00
Atgeirr Flø Rasmussen
5300f75c05 Fix the NullStream class.
It is the std::streambuf that should be inherited from.
The NullStream class is just a convenience class.
2014-08-22 19:46:02 +02:00
Joakim Hove
9d92ba5648 Merge pull request #284 from atgeirr/new-eclipsegrid-constructor
Add new EclipseGrid constructor taking a Deck.
2014-08-22 18:09:52 +02:00
Andreas Lauser
166cd965e9 considerably extend the unit test for sections
for this, an Section::isDeckValid() method is introduced which checks
that a given deck is valid when it comes to the sections
(i.e. presence of mandatory sections and section ordering)
2014-08-22 17:26:01 +02:00
Andreas Lauser
3566b99b85 relax strictness of the section handling and fix/work around a few bugs
We now do not require the sections to be correctly ordered and the
presence of the mandatory sections since even the unit tests did not
always specify all mandatory sections, which lead to a section
containing the rest of the deck if one of the expected next sections
was not specified.

also it seems like the DeckKeyword::getDeckIndex() does not correctly
work in some situations which lead

assert(deck->getKeyword(i)->name() == startKeyword);

to fail in the Section::populateKeywords() method. now the deck is
always sequentially traversed to find the position of a section's
start keyword. (This is necessary anyway if one wants to make sure
that the deck does not specify the same section more than once, a
feature which this patch also adds.)
2014-08-22 17:25:44 +02:00
Atgeirr Flø Rasmussen
52c7a4bc3f Remove section-using EclipseGrid constructors.
Also:
 - Simplify implementation (no templates).
 - Update tests.
2014-08-22 12:12:37 +02:00
Atgeirr Flø Rasmussen
eaea25772e Create pointer-to-const objects.
Older gcc (4.4) does not allow conversion of shared_ptr<Foo> to
shared_ptr<const Foo>. Pointed out by @bska.
2014-08-21 15:13:50 +02:00
Atgeirr Flø Rasmussen
193e3d7012 Added test case for construction from deck with no sections. 2014-08-21 13:19:34 +02:00
Atgeirr Flø Rasmussen
4253fb151b Allow DIMENS to be used as well as SPECGRID when no sections are found.
Also refactor DIMENS/SPECGRID to dimension code as a function.
2014-08-21 13:14:03 +02:00
Atgeirr Flø Rasmussen
d3a2db6867 Add new constructor taking a Deck.
The new constructor allows us to create EclipseGrid objects from decks
that do not have a strict sectioned structure.

Also modify some implementation details. Many methods are now templates,
and can take Deck or Section objects (they have the same
hasKeyword/getKeyword interface).
2014-08-21 10:30:47 +02:00
Joakim Hove
e406e91629 Merge pull request #279 from andlaus/set_more_flag_variables
configure: also set the CMAKE_C*_FLAGS_DEBUG and CMAKE_C*_FLAGS_RELEASE ...
2014-08-20 22:59:20 +02:00
Atgeirr Flø Rasmussen
577f8a7088 Name magic constant (invalidThickness). 2014-08-20 13:38:46 +02:00
Atgeirr Flø Rasmussen
f831637a5f Follow opm-parser naming conventions for data members. 2014-08-20 13:05:21 +02:00
Andreas Lauser
a0039eae8a configure: also set the CMAKE_C*_FLAGS_DEBUG and CMAKE_C*_FLAGS_RELEASE of CXX_FLAGS is specified
for me, setting only CMAKE_CXX_FLAGS did not do the trick when I was
trying to compile everyting with libstdc++'s debug mode enabled. (it
caused linker errors because opm-parser was not linked against
std::debug in this case.) Maybe I got something wrong, though...
2014-08-20 11:28:17 +02:00
Atgeirr Flø Rasmussen
26d57d7ec1 More tests for proper pinch-related behaviour.
Now also check behaviour for no-pinch case.
2014-08-20 09:35:21 +02:00
Atgeirr Flø Rasmussen
03a74ade2d Make getPinchThresholdThickness() throw if isPinchActive() is false. 2014-08-20 09:34:44 +02:00
Atgeirr Flø Rasmussen
9d22253166 Add test for pinch features of EclipseGrid. 2014-08-20 09:25:16 +02:00
Atgeirr Flø Rasmussen
4529cbe468 Add isPinchActive() and getPinchThresholdThickness() members.
Now reading the optional PINCH keyword from the GRID section.
2014-08-20 09:23:32 +02:00
Atgeirr Flø Rasmussen
499afaf795 Also add dimension to MAX_EMPTY_GAP property. 2014-08-20 08:41:24 +02:00
Atgeirr Flø Rasmussen
afd6a429af Add dimension (length) to THRESHOLD_THICKNESS item. 2014-08-19 23:15:34 +02:00
Joakim Hove
c06e1bebbf Added new EclipseGrid constructor
The new EclipseGrid constructor EclipseGrid(nx,ny,nz , GridSection)
allows the construction of a GRID without the RUNSPEC section.
2014-08-19 08:25:10 +02:00
Joakim Hove
39d43158de Merge pull request #276 from andlaus/better_regex_test
make the regex test more thorough
2014-08-12 06:42:00 +02:00
Joakim Hove
56951b4f63 Merge pull request #275 from andlaus/add_FGIT
add the FGIT keyword to the FIELD_PROBE
2014-08-08 19:01:20 +02:00
Andreas Lauser
e06114c35a make the regex test more thorough
it seems like the std::regex delivered up to gcc 4.8 has problems with
constructs such as ".+". (at least if they appear at the end of a
regex...)
2014-08-08 16:13:00 +02:00
Andreas Lauser
e08ecd6fd9 add the FGIT keyword to the FIELD_PROBE
This is used by Norne, but for some reason it was not included in the
deck_names list...
2014-08-08 13:35:31 +02:00
Joakim Hove
fc24206dbb Merge pull request #273 from andlaus/allow_static_ERT
Allow static ert
2014-08-07 20:24:56 +02:00
Joakim Hove
f313990fea Merge pull request #274 from atgeirr/default-wellrefdepth
Correctly handle defaulted well reference depths
2014-08-07 17:39:22 +02:00
Atgeirr Flø Rasmussen
5aa037799a Update checkWELSPECSConsistency() method.
Now accounts for new refDepthDefaulted() method and semantics.
2014-08-07 17:00:22 +02:00
Atgeirr Flø Rasmussen
15ee739326 Change Well constructors to avoid explicit bool arg.
Suggested by Joakim Hove.
2014-08-07 16:59:40 +02:00
Atgeirr Flø Rasmussen
6dfeadc229 Adapt tests to use new Well constructor, add test for defaulted ref depth. 2014-08-07 12:35:21 +02:00
Atgeirr Flø Rasmussen
ad93424b6a Add refDepthDefaulted field to Well class. 2014-08-07 12:34:49 +02:00
Andreas Lauser
466a18da98 fix some harmless compiler warnings
this comes with a minor API change as well, as the FaultCollection
class did not use the Cartesian size of the grid at all, so I decided
to remove the attributes and the arguments to the constructor...
2014-08-06 21:47:50 +02:00
Andreas Lauser
37df21ed41 ERT: link to the threads library of the OS
this is required to make the opm-core build succeed if ERT was build
with -DBUILD_SHARED_LIBS=OFF . (without it, I get errors like

    /home/and/src/ert/devel/libert_util/src/thread_pool_posix.c:328: error: undefined reference to 'pthread_create'
2014-07-30 14:54:38 +02:00
Arne Morten Kvarving
ffd2eb1d73 fixed: ERT depends on libdl
this issue was triggered with static libs for ERT
2014-07-25 15:07:39 +02:00
Joakim Hove
069ceaa9b7 Added new method EclipseState::getEclipsegridcopy() 2014-07-17 21:20:42 +02:00
Joakim Hove
8ff5a91a4f Added constructor based on existing ecl_grid_type pointer 2014-07-17 21:20:09 +02:00
Joakim Hove
1737afb823 Added bool flag to ert function ecl_grid_compare() 2014-07-17 21:19:30 +02:00
Joakim Hove
e041cf337c Added c_ptr() method to EclipseGrid 2014-07-16 12:29:31 +02:00
Joakim Hove
b41e66594e Merge pull request #268 from joakim-hove/EclipseGrid-reset-actnum
Eclipse grid reset actnum
2014-07-16 09:48:01 +02:00
Joakim Hove
7a52e0c2ce Added EclipseGrid::fwriteEGRID
In addition an new constructor based on an existing binary GRID/EGRID
file.
2014-07-16 09:35:06 +02:00
Joakim Hove
040107d215 Added method EclipseGrid::resetACTNUM() 2014-07-16 09:21:05 +02:00
Andreas Lauser
38867de28c EclipseState: extend test to check the TransMult class 2014-07-15 16:47:31 +02:00
Andreas Lauser
abb49aead6 TransMult: implement non-fault transmissibility multipliers
i.e., the MULT[XYZ]-? keywords.
2014-07-15 16:47:31 +02:00
Andreas Lauser
9eda5bad44 GridProperty: mark getData() as const
it returns a const reference to a vector which does not allow
manipulation of its members. the getData() can thus be safely called
on constant GridProperty objects.
2014-07-15 16:47:31 +02:00
Andreas Lauser
523d5d049f fix ugly bug which prevented deck keyword names from having a minus in them
i.e. MULT[XYZ]- was trimmed to MULT[XYZ]. Also, the RawKeyword now
uses ParserKeyword::isValidDeckName() instead of a regular expression
which makes it automatically consistent and also should make it
slightly faster...
2014-07-15 16:47:31 +02:00
Kristian Flikka
697c273c19 OPM-94: Removed specialized int,double,string implementations, one generic covers the same 2014-07-10 13:24:49 +02:00
Joakim Hove
d6594c587f Added method GridProperty<T>::multiplyValueAtIndex 2014-07-10 12:00:30 +02:00
Kristian Flikka
766ed83a2b Added hasEDIT test, to avoid exception on decks without EDIT section 2014-07-09 13:27:26 +02:00
Joakim Hove
c4cd20f9f2 ERT-700: Included Fault treatment in EclipseState 2014-07-08 17:29:12 +02:00
Joakim Hove
5411f9ec74 Added internal MULTXYZ fields to TransMult 2014-07-08 17:26:44 +02:00
Joakim Hove
61c4e677c5 ERT-700: Added FaultCollection class 2014-07-08 17:26:37 +02:00
Joakim Hove
e319aefacb Added Fault class 2014-07-08 17:16:02 +02:00
Joakim Hove
c2e06ad7a8 Added FaultFace class 2014-07-08 17:16:02 +02:00
Joakim Hove
7a448752f4 Removed const from getData() 2014-07-08 17:16:02 +02:00
Joakim Hove
bcb84c7e57 Trivial whitespace change 2014-07-08 17:16:02 +02:00
Joakim Hove
08b27b3f61 Added missing compile guard to OrderedMap 2014-07-08 17:16:02 +02:00
Joakim Hove
29df8e9f89 Added count() method to Section class 2014-07-08 17:16:02 +02:00
Joakim Hove
1669138bf6 Added missing EDIT keyword to testdata. 2014-07-08 17:16:02 +02:00
Bård Skaflestad
92c179f4d3 Prediction mode: Support GRUP control
If a well is available for group control, we should add that control
mode to its Injection or ProductionProperties before assigning a new
current (active) control mode to the well ('.controlMode').

Suggested by: [at] joakim-hove.
2014-07-08 13:22:46 +02:00
Bård Skaflestad
ef5a9e8e1a Refactor WellProductionProperties manipulation code
This commit splits the creation of WellProductionProperties objects,
and especially the ad-hoc helper functions historyProperties()
and predictionProperties() out to a separate module,
WellProductionProperties.[hc]pp.  Creating the properties object
from a DeckRecordConstPtr is deferred to two named constructors,

    WellProductionProperties::history() and
    WellProductionProperties::prediction()

that, respectively, assume the roles of historyProperties() and
predictionProperties().  Reimplement handleWCONProducer() in terms
of these named constructors and remove the producerProperties()
helper whose task, inspecting the status and retrieving/setting the
CMODE if not SHUT, can be assumed by handleWCONProducer().

Add a simple test module, WellPropertiesTest.cpp, to enforce the
rather peculiar semantics of the WCONHIST keyword.  Control modes
{O,W,G}RAT, LRAT, and RESV are *always* (unconditionally) supported
in WCONHIST but there is no control mode switching.  The latter is
deferred to client code, depending on the '.predictionMode' flag.

Suggested by: [at] joakim-hove
2014-07-08 13:22:46 +02:00
Bård Skaflestad
93c133a7b8 historyProperties(): Extract BHP limit if not defaulted
This fixes a programming error introduced in the refactoring of
Schedule::handleWCONProducer() (commit 3889e92).  When there is a BHP
limit in WCONHIST, we obviously need the value specified in the input
deck.  The refactoring led to the limit being extracted only in the
prediction mode.

Pointy hat: [at] bska
2014-07-08 13:22:46 +02:00
Bård Skaflestad
e23659b286 historyProperties(): Add note on numerically zero defaults
This is a hint to a future maintainers that the subsequent control
modes are unconditionally supported.
2014-07-08 13:22:46 +02:00
Bård Skaflestad
07c7b59702 Rename helper: matchingProperties() -> historyProperties()
This more clearly reflects its actual purpose.

Suggested by: [at] joakim-hove
2014-07-08 13:22:45 +02:00
Bård Skaflestad
1111f87aa7 *Properties(): Rename control mode (enum) variable
Four characters (cmod) is less readable than "cmode".

Suggested by: [at] joakim-hove
2014-07-08 13:22:45 +02:00
Bård Skaflestad
cb3a196446 *Properties(): Switch to vector<string> for control modes
Update mode iteration accordingly.

Suggested by: [at]joakim-hove
2014-07-08 13:22:45 +02:00
Bård Skaflestad
1d34629cc2 Disable WCONHIST/GRAT non-existence test
Keyword WCONHIST always supports GRAT control mode, even when
defaulted.  The default value (zero) might not be very useful in a
simulation case but it's supported nonetheless.
2014-07-08 13:22:45 +02:00
Bård Skaflestad
3242976bf1 Refine semantics of WCONHIST implementation
This commit splits Schedule::handleWCONProducer() into those parts
that are specific to the individual keywords (WCONHIST/matching and
WCONPROD/prediction) and those that are common to both.

In particular we introduce two new helper functions

    matchingProperties() and predictionProperties()

of which the first constructs a WellProductionProperties object
specific to matching semantics and the latter constructs a similar
object specifc to prediction.  In the case of WCONHIST, the well
always supports component rates at surface conditions ({O,W,G}RAT)
as well as liquid rate (LRAT) and (total) reservoir volume rate
(RESV).  The prediction mode keeps the existing semantics of not
supporting control modes for which the values have been defaulted.

The final helper, function producerProperties(), dispatches to
matchingProperties() or predictionProperties() depending on
handleWCONProducer()'s 'isPredictionMode' flag and handles the
record properties that are common to both WCONHIST and WCONPROD,
including whether or not to assign a new active control mode.

The end result is that handleWCONProducer() becomes a loop of
keyword data records that

  1) Determines the wells affected by a given record
  2) Determines whether or not the wells are OPEN
  3) Computes control mode properties (producerProperties())
  4) Assigns status and those properties to all affected wells

This approach reorders the well loop compared to the previous
implementation which computed separate WellProductionProperties for
each well.
2014-07-08 13:22:45 +02:00
Andreas Lauser
3dac72d821 use extended regular expressions in the test for std::regex
for some compilers (e.g., GCC < 4.9) the default is buggy and
opm-parser thus uses extended expressions...

thanks to [at]bska for digging this up!
2014-07-08 13:01:20 +02:00
Kristian Flikka
e8310ffbca Changed from if to ifdef, to clarify the actual functionality 2014-07-08 12:49:12 +02:00
Andreas Lauser
1a72cade01 use std::regex if it is available
it turns out that boost::regex does not work for the libstdc++ debug
mode. This patch should fix this for sufficiently new compilers.

Note that this requires the FindCXX11Features.cmake tests pulled in
from opm-core and an additional compiler flag...
2014-07-07 17:50:46 +02:00
Andreas Lauser
f754bd9c45 fix some screw-up with internal vs deck names
Parser::hasKeyword() was called with deckNames but looked up the map
for internal names. This patch renames the method to hasDeckName(),
renames Parser::getKeyword() to Parser::getKeywordFromDeckName() and
adapts/extends the tests.
2014-07-01 17:07:43 +02:00
Andreas Lauser
e2eca64f59 fix boost::regex usage
turns out that boost::regex("foo") should be used instead of
boost::regex::basic_regex
2014-07-01 10:21:08 +02:00
Andreas Lauser
f6689d838e make ParserKeyword::matches only return true if the deck keyword name is valid 2014-06-29 14:32:06 +02:00
Andreas Lauser
fe638c2fc8 separate the internal keyword names and the deck names more clearly
so far, these two concepts were partially mingled in Opm::Parser...
2014-06-29 14:32:06 +02:00
Andreas Lauser
09c5a24473 add GROUP_PROBE 2014-06-29 14:32:06 +02:00
Andreas Lauser
d4409dbae0 add BLOCK_PROBE 2014-06-29 14:32:06 +02:00
Andreas Lauser
268d91192d add CONNECTION_PROBE 2014-06-29 14:32:06 +02:00
Andreas Lauser
936bed6804 add REGION_PROBE
which represents the approximately 500 thousand keywords to specify
the quantities the simulator is supposed to dump into the summary
section.
2014-06-29 14:32:06 +02:00
Andreas Lauser
62b8078e81 add FIELD_PROBE
i.e., the about a million keywords for which specify the field values
in the summary output.
2014-06-29 14:32:06 +02:00
Andreas Lauser
9d9b977d43 update the WELL_PROBE keywords 2014-06-29 14:32:06 +02:00
Andreas Lauser
49b48662ef change the TVDP keywords to use regular expressions instead of wildcards 2014-06-29 14:32:06 +02:00
Andreas Lauser
ac039598bc fix typo
the JSON name of DEPTH keyword was "DEPTHZ". since "DEPTH" is an
E100 keyword, this is most likely a mistake...
2014-06-29 14:32:06 +02:00
Andreas Lauser
fee11596f8 allow underscores in deck names and disallow sharps
underscores are used by a few of the summary specifier keywords
(e.g. BPR_X), but after closer inspection '#' symbols are not.
2014-06-29 14:32:06 +02:00
Andreas Lauser
96904b00f4 allow keywords to match regular expressions as their deck name
the RE used is specified via the "deck_name_regex" in the JSON file of
the respective keyword. A deck name is assumed to match a given parser
internal keyword if the deck name is valid and if it is either in the
list specified by the "deck_names" entry or if it matches the regular
expression.

This functionality is useful to implement the well probes for the
tracers as well as replacing the current "wild card keyword"
implementation which only allows a star as a suffix.
2014-06-29 14:32:06 +02:00
Andreas Lauser
ed4a1d3e09 add the boost::regex library as a prerequisite
this is required for regex-matching keywords. Once GCC 4.9 is the
minimum compiler version to be supported, this can be dropped in favor
of std::regex ...
2014-06-29 13:40:09 +02:00
Andreas Lauser
480e17e5b6 syncronize Findopm-parser.cmake with the opm-core version
the ERT libraries and headers were missing and a few other minor
cleanups. see https://github.com/OPM/opm-core/pull/601 for details.
2014-06-27 10:55:08 +02:00
Andreas Lauser
96ba492cf7 fix build
*grr* spurious comma! Though I'm wondering a bit why it compiled on my
 machine yesterday...
2014-06-26 11:18:22 +02:00
Kristian Flikka
81dbacc4e1 Changed from semicolon to comma, to fix compilation failure 2014-06-26 10:10:19 +02:00
Joakim Hove
6d88a8dabe Added SWATINIT as supported grid property. 2014-06-25 18:26:31 +02:00
Joakim Hove
93c5ac23f2 Typo in install target 2014-06-25 12:37:41 +02:00
Joakim Hove
c9f5e4682e Fixed trivial typo. 2014-06-25 12:22:25 +02:00
Joakim Hove
390f996f49 Merge pull request #245 from andlaus/add_ntg_gridproperty
grid properties: add support for the NTG keyword
2014-06-25 12:09:03 +02:00
Joakim Hove
09f928d52b Merge pull request #244 from joakim-hove/TransMultContainer
Trans mult container
2014-06-25 12:02:24 +02:00
Joakim Hove
59e6215967 Added TransMult object to EclipseState 2014-06-25 12:01:18 +02:00
Joakim Hove
a0ab4d4ecb Added transMult container - which only returns 1.0 2014-06-25 12:01:07 +02:00
Joakim Hove
afc83767d7 Added new enum to enumerate the different face directions. 2014-06-25 11:58:22 +02:00
Andreas Lauser
1a2bacf5d0 grid properties: add support for the NTG keyword
Whoever came up with that keyword deserves a spanking because its
semantics are adapting thickness of the grid layers using the rock
properties without modifying the grid (and thus the output is not
showing what is actually used). As I understood that whole affair,
this is also done incorrectly, because the flow is not distorted in
depth direction but this the permeability should be divided by the NTG
values as the fluids seep through the thinner layers more quickly...

Anyway, we have to implement it, so here we go.
2014-06-25 10:23:24 +02:00
Joakim Hove
e732564fb4 Merge pull request #242 from andlaus/deck_keyword_lists
Implement deck keyword lists
2014-06-20 13:54:30 +02:00
Andreas Lauser
7a015fcb76 use deck keyword name list for the well output specifier keywords 2014-06-13 13:54:24 +02:00
Andreas Lauser
7edad38fb2 avoid illegal internal names in the MULT keywords
before this, the variants with the trailing minus were just silently
ignored, and even if they were not, the code generator would have
produced illegal code, because the keyword name is used for a C++
variable there, i.e. the names needed to be valid names in the C++
sense. "Happily", these the former bug canceled the latter, so the
build went through...

now, there is only one internal keyword called "MULT_XYZ" which
matches on all possible variants which are allowed in a deck. The
mechanism used is a deck name list...
2014-06-13 13:17:03 +02:00
Andreas Lauser
5f949c11c3 add support for parser keywords specifying to multiple deck keywords
Say hello to the complete set of well, region, field and group output
specifiers soon...
2014-06-13 13:17:03 +02:00
Joakim Hove
a2d9d45da6 Added Parser test of deck with TOPS keyword. 2014-06-11 16:42:37 +02:00
Joakim Hove
5a13369b6d Added EclipseGrid::getCellVolume() and getCellCenter() 2014-06-11 16:42:37 +02:00
Joakim Hove
db2cbf9e87 Fixed bug in extending TOPS vector. 2014-06-11 16:42:36 +02:00
Andreas Lauser
d820a4d435 change construction of ParserKeyword objects to the factory paradigm
this makes it more explicit what the object is supposed to represent.
2014-06-11 15:08:58 +02:00
Andreas Lauser
b449a783f9 property operators: add quite a few additional keywords
These are all keywords which are used by the Norne deck within some
property modifiers plus all variants of these. (sans the variants for
radial grids which are completely pointless IMO.) The chances that
keywords which have not been added yet can also be used are very close
to 100%, though.

Note that the default values for these keywords are currently
incorrect as the Eclipse RM states that the values must be looked up
in their corresponding table if the keyword is left unspecified (see
e.g. the documentation SWU). This probably means that we need to
implement "ghosty" keywords which magically appear if they have not
been explicitly specified or maybe we should only provide them in
EclipseState to be able to do the context dependent table look-up
"vodoo"...
2014-06-10 12:21:14 +02:00
Andreas Lauser
71a0adf016 add some missing transmissibility multiplier keywords
and add a dimension to MULTZ
2014-06-10 12:19:22 +02:00
Joakim Hove
90562916b5 Merge pull request #230 from andlaus/remove_dimensionString_from_integer_grid_properties
Grid properties: get rid of the dimension string for integer properties
2014-06-10 06:43:37 +02:00
osae
de09df3bed Correct dimension is 'Pressure'. 2014-06-05 16:21:59 +02:00
osae
6cb0aad295 Keywords for capillary pressure scaling.
Four new keywords PCW/PCG/IPCW/IPCG and fixing SWATINIT.
2014-06-05 15:54:15 +02:00
Joakim Hove
c7987c987e Merge pull request #236 from akva2/no_references_for_you
fixed: keep a copy instead of a reference
2014-06-05 12:59:02 +02:00
Arne Morten Kvarving
d85782d9f5 fixed: keep a copy instead of a reference
storing string references are not a good idea, since temporaries are
often used. fixes RawRecordTest on my box
2014-06-05 11:48:17 +02:00
Andreas Lauser
fc8adb8453 add definition for the ROCKTAB keyword 2014-06-05 10:46:38 +02:00
Andreas Lauser
6f290a750d Grid properties: get rid of the dimension string for integer properties
this uses a small amount of template magic, to automatically change
the API of the GridProperty class depending on wheter it is
instantiated for double or for int.
2014-06-05 10:12:23 +02:00
Kristian Flikka
ac5dc9e6aa Added missing headers, to fix install-based build of opm-polymer 2014-06-04 14:22:09 +02:00
Andreas Lauser
52c5d3fbcb make GCC 4.4 happy
there was a "typename" outside of a template, but because the
syntactic sugar is created by the Boost unit testing framework, it was
not clear wheter it was a template or not.

Also, some harmless warnings have been fixed. These only appeared
because a few variables have recently been converted from int to
size_t...
2014-06-03 22:51:03 +02:00
Andreas Lauser
7c53febf57 fix the ADD and EQUALS grid property modifiers 2014-06-03 22:42:23 +02:00
Joakim Hove
c7429dbb23 Fixed bug: intGridProperties -> doubleGridProperties 2014-06-03 22:42:23 +02:00
Joakim Hove
491ccd9a8d Added #include <cstddef> to Box.hpp 2014-06-03 22:42:23 +02:00
Joakim Hove
7a16646cd8 Added throw when trying to load from unsupported keyword. 2014-06-03 22:42:23 +02:00
Joakim Hove
052fb7afad Fix stupid typo 2014-06-03 22:42:23 +02:00
Joakim Hove
1fa84d1923 Removed unused method argument. 2014-06-03 22:42:23 +02:00
Joakim Hove
3da0c228b9 Using size_t instead of int for EclipseGrid::getN? 2014-06-03 22:42:23 +02:00
Joakim Hove
b52ffe5a4a Avoid use of {} in init to satisfy clang. 2014-06-03 22:42:23 +02:00
Joakim Hove
73d88280a5 Renamed getXXXProperty -> getXXXGridProperty 2014-06-03 22:42:23 +02:00
Joakim Hove
40b15c59b3 Added const qualifier to EclipseState::getxxxProperty() methods. 2014-06-03 22:42:23 +02:00
Joakim Hove
5e56f16369 Added double properties for e.g. PERM and PORO to the EclipseState 2014-06-03 22:42:23 +02:00
Joakim Hove
7269924543 Added name() property to section objects. 2014-06-03 22:42:23 +02:00
Joakim Hove
6b29eb5176 Supporting the ADD and EQUALS keywords. 2014-06-03 22:42:23 +02:00
Joakim Hove
8137331d5d Added new keyword PVTNUM 2014-06-03 22:42:23 +02:00
Joakim Hove
eb9e11849e Added support for MULTIPLY keyword. 2014-06-03 22:42:23 +02:00
Joakim Hove
6301fd1ad7 EclipseState now handles COPY keyword. 2014-06-03 22:42:23 +02:00
Joakim Hove
bd1c756e30 Added copyFrom() property to GridProperty 2014-06-03 22:42:23 +02:00
Joakim Hove
22ed38b319 Added iterators begin() and end() to DeckKeyword class. 2014-06-03 22:42:23 +02:00
Joakim Hove
5c04cd4540 Basic BOX support when reading integer properties. 2014-06-03 22:42:23 +02:00
Joakim Hove
f5c5722508 ERT-656: Changed GridProperty to take (nx,ny,nz) instead of volume. 2014-06-03 22:42:23 +02:00
Joakim Hove
1d0e3c9772 Added BoxManager() to keep track of the currently active input box. 2014-06-03 22:42:23 +02:00
Joakim Hove
2a5ec9aac9 Added Box::equal() comparison function. 2014-06-03 22:42:23 +02:00
Joakim Hove
74f66a5f3c Added constructor for sub box. 2014-06-03 22:42:23 +02:00
Joakim Hove
e820eadfeb Added Box() class to book keep the indices in a box. 2014-06-03 22:42:23 +02:00
Andreas Lauser
ad1dfab8d7 fix spurious GCC warnings
The root cause are pretty (too?) strict flags w.r.t. compiler
warnings. In this case, the offenders are "-Wmissing-declarations" and
"-Wtype-limits".
2014-06-02 13:01:56 +02:00
Joakim Hove
c55cb6cb73 Fixed typo in item name 2014-05-30 23:41:25 +02:00
Joakim Hove
e6aca19601 Changed name of items in PVCDO keyword. 2014-05-30 15:28:26 +02:00
Joakim Hove
adab017f19 Merge pull request #222 from joakim-hove/fix-PVCDO
Changed name of oil compressibility item.
2014-05-27 13:59:07 +02:00
Joakim Hove
97f42219e8 Changed name of oil compressibility item. 2014-05-27 13:57:36 +02:00
Bård Skaflestad
317192ca63 Support 'SOIL' keyword
This commit introduces support for the SOIL (initial oil saturation)
keyword.  This is similar to existing keywords 'SWAT' and 'SGAS' and
needed to input some decks.
2014-05-26 18:57:45 +02:00
Andreas Lauser
d71cb1aa51 parser integration test: use std::istream as a template argument for std::shared_ptr
gcc 4.4 has problems with such implicit conversions...
2014-05-20 13:27:37 +02:00
Andreas Lauser
0d92cd43b0 export possibility to parse an arbitrary std::istream
this has the potential to reduce the memory requirements of the parser
for opm-benchmarks considerably and is quite easy to add since
internally all parsing happend on istreams anyway...

The parser integration test has been extended to test the new method
as well as `parseString()` which was omitted previously. (I wonder who
introduced this without changing the test. ;)
2014-05-20 12:12:12 +02:00
Joakim Hove
4316a6fa54 Merge pull request #215 from akva2/fix_linking
fixed: linking due to several specializations being generated
2014-05-19 13:58:59 +02:00
Arne Morten Kvarving
c1a3cc5e2f fixed: linking due to several specializations being generated 2014-05-19 13:43:05 +02:00
Arne Morten Kvarving
463eae9b07 fixed: don't mix member names and function parameters 2014-05-19 13:15:09 +02:00
Joakim Hove
e5c61b2816 Merge pull request #207 from joakim-hove/gridproperties
Gridproperties
2014-05-19 13:01:32 +02:00
Joakim Hove
b660cc1b6a Merge pull request #213 from atgeirr/conversion-factors
Conversion factors
2014-05-19 12:18:34 +02:00
Atgeirr Flø Rasmussen
61d1c1a2cf Make conversion factors more readable.
The using directives will put a lot into the Field and Metric
namespaces, but it should not be problematic.
2014-05-19 12:10:11 +02:00
Atgeirr Flø Rasmussen
799a52e8bc Embedded unit system from opm-core to ensure proper conversion factors. 2014-05-19 12:10:11 +02:00
Joakim Hove
e72a0da8b1 Added GridProrpties to EclipseState. 2014-05-16 15:58:04 +02:00
Joakim Hove
ce0dc92822 Added grid properties container. 2014-05-16 15:57:47 +02:00
Joakim Hove
dc6ddc789a Added GridProperty class. 2014-05-16 15:57:00 +02:00
Joakim Hove
2786b5e87b Added isDataKeyword() property to deckKeyword. 2014-05-16 15:29:54 +02:00
Joakim Hove
0728dbe76a Added grid method getCartesianSize() 2014-05-16 13:14:16 +02:00
Joakim Hove
30fe203932 Utility functions to check if deck has sections. 2014-05-16 13:10:20 +02:00
Andreas Lauser
03860714c8 fix build
from the error, it seems a bit like the well container was recently changed
from std::map to std::vector...
2014-05-16 12:36:13 +02:00
Kristian Flikka
82a38c1cc8 Merge pull request #208 from AtleH/wellnamewithwildcard
Added wildcard support in WCONINJE and WCONPROD
2014-05-16 12:28:39 +02:00
Atle Haugan
77ed32662c Enabled integration tests in ParseWellWithWildcards 2014-05-16 11:07:01 +02:00
Arne Morten Kvarving
eef7b53fdd fixed: don't check for unsigned values being positive
they definitely are. quells warnings
2014-05-15 14:46:16 +02:00
Arne Morten Kvarving
a8f216175a fixed: remove misplaced semi-colons 2014-05-15 14:46:16 +02:00
Arne Morten Kvarving
3827ddca64 fixed: mark static symbols as such to quell warnings 2014-05-15 14:46:16 +02:00
Arne Morten Kvarving
670e8b692b changed: don't use parameter names that conflicts with member function names
quells warnings (with gcc 4.8)
2014-05-15 14:46:16 +02:00
Arne Morten Kvarving
8cb2646995 fixed: initialize members 2014-05-15 14:46:16 +02:00
Atle Haugan
20380ca7c8 Changed name for (some) iterators in Schedule 2014-05-14 15:36:42 +02:00
Atle Haugan
0f4590a2f3 Removed obsolete include statements 2014-05-14 15:26:54 +02:00
Atle Haugan
47ef4ed0e6 Simplified implementation and (slightly) changed behaviour of Schedule::getWells(wellNamePattern)
Improved performance by checking for wildcard before entering the loop. Logic slightly changed since method now only supports wildcards at the end of the string.
2014-05-14 15:10:17 +02:00
Kristian Flikka
b5473ff1b4 Merge pull request #206 from joakim-hove/wellspecs-ordered-wells
Wellspecs ordered wells
2014-05-07 13:32:40 +02:00
Atle Haugan
344d02ad1c Add support for wildcard in WCONPROD and WCONINJE keywords. 2014-05-06 09:54:37 +02:00
Joakim Hove
31c45768bf Rename of installed headers. 2014-05-02 18:28:54 +02:00
Joakim Hove
142255268d Using OrderedMap to hold wells in Schedule object - thereby preserving
well insert order.
2014-05-02 17:02:10 +02:00
Joakim Hove
4c477b6f70 Added class OrderedMap which is insert-order preserving map. 2014-05-02 17:02:09 +02:00
Joakim Hove
71e9ac25b7 Merge pull request #201 from andlaus/table_improvements
Table improvements
2014-05-02 17:00:23 +02:00
Andreas Lauser
b7cbf1121a EclipseGrid: do not add integers to the addresses of const char* pointers
this results in funny error messages and (if the integers are large
enough) in segfaults. thanks to @atgeirr for pointing this out!
2014-04-30 12:27:01 +02:00
Joakim Hove
7bf588a166 Added DEPTHZ as alternative to TOPS. 2014-04-29 21:30:45 +02:00
Andreas Lauser
1909e22f48 fix the "number of table" calculation for multi-record tables
It turns out that the empty-record detection worked fine, but that the
last empty record of a keyword is ignored by opm-parser for reasons
which are not clear to me...

Now all unit tests pass.
2014-04-28 21:12:38 +02:00
Andreas Lauser
808e2d3717 rename SimpleTable to SingleRecordTable and SimpleMultiRecordTable to MultiRecordTable
because what's simple is in the eye of the beholder...
2014-04-28 18:29:44 +02:00
Andreas Lauser
de38673ce4 table tests: expand them considerably and actually run them
In the current version, the runTimeMapTest binary was run because of a
copy-and-pasto. oops.

Also, not all of the tests pass but that is because of another problem
of opm-parser for which I don't know a good fix: It currently seems to
be impossible to specify empty records if there are non-defaulted
items in the JSON keyword specification, but such empty records are
used as table separators by Eclipse...
2014-04-28 18:16:23 +02:00
Andreas Lauser
0713a3a767 add some comments to the capillary pressure retrival methods of S{g,w}ofTable
that's because the Eclipse capillary pressure definitions
inconsistent: SWOF specifies the "water-oil capillary pressure" as $p_o
- p_w$, while SGOF uses $p_g - p_o$ as the "oil-gas capillary pressure".
2014-04-28 17:05:31 +02:00
Andreas Lauser
4b2ab72eef add numTables() method to the table classes
For SimpleTable, that is simply the number of records in a keyword, for
MultiRecordTables, it is the number of _empty_ records.

this patch makes supporting multi-PVT easier and cleaner.
2014-04-28 17:05:31 +02:00
Joakim Hove
3718df3972 Added assert of the size of the vectors used to create a CornerPoint grid. 2014-04-27 23:51:43 +02:00
Joakim Hove
4672e386f0 Added getDataSize() method to DeckKeyword. 2014-04-27 23:51:43 +02:00
Joakim Hove
d1ac634991 Added keyword SMRYDIMS 2014-04-27 23:51:43 +02:00
Joakim Hove
62f935aad5 Merge pull request #192 from andlaus/check_filesystem_case_sensitiveness
add a cmake test to check if the used file system is case sensitive
2014-04-27 23:49:50 +02:00
Joakim Hove
6489c1269c Removed extra "," from WELTARG 2014-04-27 23:21:36 +02:00
Andreas Lauser
017e238d27 fix the PVCDO keyword
this was just a copy of PVTW and is quite embarassing. We should
prevent this in the future by making sure that the filename
corresponds to the JSON name when generating the C++ keyword list...
2014-04-26 11:44:09 +02:00
Joakim Hove
7cfbdf7904 The data of the mapaxes keyword was incorrectly accessed as a data() keyword. 2014-04-24 11:53:38 +02:00
Joakim Hove
1d672e53c1 Added keyword SMRYDIMS 2014-04-24 11:53:38 +02:00
Joakim Hove
4c9c690817 Added size:1 to some summary kewyords. 2014-04-24 11:51:50 +02:00
Joakim Hove
4579aa617c Added keyword SMRYDIMS 2014-04-24 11:51:50 +02:00
Joakim Hove
d937486f99 Added keyword SMRYDIMS 2014-04-24 10:41:16 +02:00
Joakim Hove
02f88ce8ff Added EclipseGrid to the EclipseState class 2014-04-24 09:01:58 +02:00
Joakim Hove
7905cbf462 Removed extra , 2014-04-23 23:01:35 +02:00
Joakim Hove
8f1a9953d5 Removed contextDependent dimension 2014-04-23 23:00:42 +02:00
Joakim Hove
1f04b4d3b8 Merge pull request #180 from andlaus/add_weltarg
add WELTARG keyword
2014-04-23 22:59:35 +02:00
Joakim Hove
0591acfc3c Merge pull request #188 from joakim-hove/EclipseGrid-fixes
Eclipse grid fixes
2014-04-23 22:56:14 +02:00
Kristian Flikka
c23ae4653d Merge pull request #189 from joakim-hove/eclipsegrid-export
Eclipsegrid export
2014-04-23 21:01:50 +02:00
Andreas Lauser
fc43fdd427 add a cmake test to check if the used file system is case sensitive
And fix the unit test for INCLUDE. This should make the test pass on
case insensitive file systems like the one of MacOS X. (Who uses that
anyway? ;))
2014-04-23 14:56:27 +02:00
Joakim Hove
5c8493b23f Changed working directory for test reading testdata. 2014-04-23 08:18:07 +02:00
Joakim Hove
3d4ea717db Merge pull request #186 from andlaus/check_file_existence
make sure that the file we are attempting to parse actually exists
2014-04-22 18:32:24 +02:00
Andreas Lauser
a1de9a0e9e add a test case for the INCLUDE statement 2014-04-22 17:09:02 +02:00
Joakim Hove
b2d99fb387 Added functionality to export MAPAXES data. 2014-04-22 01:14:34 +02:00
Joakim Hove
af6f18b5aa Added methods to export the ZCORN, COORD and ACTNUM keywords from the EclipseGrid. 2014-04-22 00:20:03 +02:00
Joakim Hove
7428e7862f Merge pull request #181 from andlaus/polymer_fixes
Polymer fixes
2014-04-17 23:09:42 +02:00
Joakim Hove
9a6afd2a6f The ability to only specify top layer applies DX and DY as well. Fixed
resize() usage.
2014-04-17 22:56:06 +02:00
Joakim Hove
5343414d97 Added missing dim argument in scatterDim function. 2014-04-17 22:54:35 +02:00
Joakim Hove
86ee7b5805 Merge pull request #182 from atgeirr/warning-suppresssion
Warning suppresssion
2014-04-17 22:34:08 +02:00
Andreas Lauser
0ca3a30697 make sure that the file we are attempting to parse actually exists
before that case was identical to an empty data file...
2014-04-15 13:52:08 +02:00
Atgeirr Flø Rasmussen
6b4ad26a9a Renamed function arguments to avoid shadowing. 2014-04-15 09:49:23 +02:00
Atgeirr Flø Rasmussen
79e4d51597 Renamed local variable to avoid shadowing. 2014-04-15 09:49:04 +02:00
Atgeirr Flø Rasmussen
e3d167048f Commented out unused function arguments. 2014-04-15 09:48:19 +02:00
Atgeirr Flø Rasmussen
41ddb2c460 Rename local variable to avoid shadowing. 2014-04-15 09:26:25 +02:00
Atgeirr Flø Rasmussen
b0d93977b9 Comment out unused function argument. 2014-04-15 09:26:04 +02:00
Andreas Lauser
406f294026 add table utility classes for the PLY{ADS,MAX,ROCK,VISC} and TLMIXPAR keywords
these are not really used as tables in the current opm-polymer code,
but the Eclipse RM says they are tables, so we should add these
classes...
2014-04-14 16:18:37 +02:00
Andreas Lauser
5d0c2283a6 add the TLMIXPAR keyword
this is used by opm-polymer...
2014-04-14 14:16:05 +02:00
Andreas Lauser
0bcd958c31 fix the PLYMAX keyword
- fix typo: use "POLYMER" instead of "PLOYMER"
- according to the Eclipse RM, the size of the table is given by the
  "NTMISC" item of the "MISCIBLE" keyword...
2014-04-14 14:16:04 +02:00
Andreas Lauser
262fa27d1e add the MISCIBLE keyword
it's only specified by R300, but it is required TLMIXPARAM which is used by
opm-polymer...
2014-04-14 14:16:04 +02:00
osae
475f1aede6 New keywords ENDNUM; IMBNUM and SATNUM. 2014-04-14 12:47:41 +02:00
Joakim Hove
eeb4403faf Fixed typo Pvdco -> Pvcdo in installed headers 2014-04-12 08:32:23 +02:00
Andreas Lauser
204a4b6742 add WELTARG keyword
this one is used deep inside opm-porsol and features a nasty context
dependent parameter...
2014-04-11 16:56:36 +02:00
Joakim Hove
6a1b887323 Merge pull request #178 from joakim-hove/data-with-default
Data with default
2014-04-11 13:45:02 +02:00
Joakim Hove
d5bf1726f2 Verified behaviour of defaults (i.e. *) for multivalued items. 2014-04-11 13:42:22 +02:00
Joakim Hove
f59fd25668 Added boolan flag scalar = true to DeckItem.
The purpose of this flag is to keep track of whether a keyword is
supposed to have only one element, i.e. scalar, or several. The
defaultApplied method only makes sense in the case of scalar items, this
method will now throw if it is called on a non-scalar item.
2014-04-11 13:42:22 +02:00
Joakim Hove
5becf79dd1 The ParserKeyword->parse() method will throw if the raw input argument is not finished.
Requires several changes to assure that the rawkeyword instances are
marked as finished before reacing the ParserKeyword->parse method.
2014-04-11 13:42:22 +02:00
osae
c26ba00794 Added default values for keywords ENPTVD/ENKRVD
Setting defaulted parameters to -1 for later identification.
2014-04-11 13:42:22 +02:00
Andreas Lauser
7eb19083ea add PVCDO keyword and fix typo pvdco -> pvcdo
this is used in opm-core but I doubt that these code paths have
actually been tested recently because the parser would have thrown up
as soon as it had encountered PVCDO...
2014-04-11 11:57:32 +02:00
Joakim Hove
72b183b0c6 Merge pull request #174 from joakim-hove/double-float-grid
Will temporarily convert double -> float before instantiating an ERT ecl...
2014-04-08 15:48:58 +02:00
Kristian Flikka
c0e17b79bb Added two dependencies to generated files, to avoid potential build failures due to premature use of them 2014-04-08 11:49:34 +02:00
Joakim Hove
e93a377eb6 Large changes to createDefaultkeywordlist: Will create both tests and testSource in one pass. The special sorce code to create test source is removed. The test source is marked with Generated_source attribute. 2014-04-08 01:44:27 +02:00
Joakim Hove
891b8ccb3e CMake beautification. 2014-04-08 01:43:05 +02:00
Joakim Hove
0a24d926c1 The createDefaultkeywordlist program will create the generated-source/ directory if it does not exist. 2014-04-07 17:07:24 +02:00
Joakim Hove
9ebd9a227b Moved test of valid keywordname to ensure that e.g editor backupfiles are not parsed. 2014-04-07 16:54:09 +02:00
Kristian Flikka
fa3e7582be Added PROPERTY GENERATED TRUE to generated file, to avoid cmake halt. File is always generated. 2014-04-07 14:42:52 +02:00
Joakim Hove
a14dc265b5 Will temporarily convert double -> float before instantiating an ERT eclipsegrid. 2014-04-07 12:28:07 +02:00
Atgeirr Flø Rasmussen
5a1c345e3f Add preferred phase to Well class.
This entails:
 - Adding a new data member of type Opm::Phase::PhaseEnum.
 - Adding method getPreferredPhase().
 - Adding extra constructor argument.
 - Modifying constructor call in Schedule::addWell().
 - Adding unit test for the new preferredPhase property.
 - Modifying constructor call in all the well unit tests.
2014-04-06 23:11:38 +02:00
Kristian Flikka
666ba3e607 Temporary revert and test removal - pending float/double cleanups 2014-04-04 15:39:29 +02:00
Kristian Flikka
029e461cd4 Desperate fix for build dependency on generated source file 2014-04-04 15:33:36 +02:00
Joakim Hove
71edc6336a Merge pull request #164 from atgeirr/remove-wrong-constructor
Deleted unneeded default constructor.
2014-04-04 14:35:14 +02:00
Joakim Hove
4625f079e6 Merge pull request #156 from AtleH/improvedbuild
Auto-detect of keyword changes in build
2014-04-04 13:40:03 +02:00
atleh
9d1d161def Merged CMake conflicts 2014-04-04 13:39:11 +02:00
atleh
07809cae2e Ready for merge? 2014-04-04 12:04:21 +02:00
atleh
02a915ba2d Adjustments in createDefaultKeywordList 2014-04-04 12:02:40 +02:00
atleh
25a5578677 Fixed bug regarding dump file usage in createDefaultKeywordList 2014-04-04 12:02:40 +02:00
atleh
c21a667f0e Some adjustments to createDefaultKeywordList. Not complete. 2014-04-04 12:02:40 +02:00
atleh
bd150b5684 Marked parameter as const 2014-04-04 12:02:40 +02:00
atleh
a6cd64afb7 added support for dump files in createDefaultKeywordList.cpp 2014-04-04 12:02:40 +02:00
atleh
47713c7a00 createDefaultKeywordList - minor refactoring 2014-04-04 12:02:40 +02:00
atleh
0505c0a9ca createDefaultKeywordList now able to generate dump file. 2014-04-04 12:02:40 +02:00
osae
e6ad224f33 Keywords for endpoint scaling: SWL and ISWL family 2014-04-04 10:24:54 +02:00
Atgeirr Flø Rasmussen
2df1761922 Deleted unneeded default constructor.
Its implementation was buggy, initialising references to temporary objects.
2014-04-04 10:05:04 +02:00
Joakim Hove
3087f33fd8 Merge pull request #155 from andlaus/schedule_trim_names
schedule: do not let us be disturbed by leading or trailing white space in names
2014-04-03 20:22:10 +02:00
atleh
77e47433a7 Ready for merge? 2014-04-03 15:18:55 +02:00
Andreas Lauser
ea1df5347d schedule tests: add some spaces around some names 2014-04-03 14:55:38 +02:00
Andreas Lauser
2a9111b9d2 Schedule: trim strings which are received from the deck
for SPE-9 only the well/group names contain spurious white space, but
I suppose that other decks also feature them in control modes, status,
etc. so it's probably a good idea to trim these as well...
2014-04-03 14:55:38 +02:00
Andreas Lauser
debe11a8f3 DeckItem: introduce getTrimmedString()
which is like getString() but with the leading and trailing white
space removed. It is intended for names which seem to not care about
such white space in Eclipse.
2014-04-03 14:32:25 +02:00
atleh
8b5bcf7947 Adjustments in createDefaultKeywordList 2014-04-03 14:16:08 +02:00
Kristian Flikka
1b085a4ea1 Merge pull request #157 from joakim-hove/OPM-75-create-grid
Opm 75 create grid
2014-04-02 22:15:56 +02:00
atleh
b96273a0f0 Fixed bug regarding dump file usage in createDefaultKeywordList 2014-04-02 15:17:18 +02:00
atleh
3429b1d93e Some adjustments to createDefaultKeywordList. Not complete. 2014-04-02 11:47:23 +02:00
Joakim Hove
3355979466 Merge pull request #162 from joakim-hove/PVTG-unit-change
Changed unit in PVTG.
2014-04-01 14:37:00 +02:00
Joakim Hove
dd91cacac4 Changed unit in PVTG. 2014-04-01 14:36:38 +02:00
Joakim Hove
94a56621c7 Merge pull request #161 from osae/kw-PVDO
New keyword PVDO
2014-04-01 14:32:55 +02:00
Joakim Hove
75107fdd32 Added keywords for SPE9. 2014-04-01 14:27:31 +02:00
osae
d0c08f83d9 New keyword PVDO 2014-04-01 14:26:05 +02:00
atleh
4d495ed94e Marked parameter as const 2014-04-01 13:38:22 +02:00
Joakim Hove
9c29c00c2b Added ability to create EclipseGrid from cornerpoint keywords. 2014-04-01 09:06:43 +02:00
Joakim Hove
edde68fa6a Added float data accessors. 2014-04-01 09:05:33 +02:00
Joakim Hove
9b446b4db9 Changed cornerpoint related keywords to use FLOAT. 2014-04-01 09:04:27 +02:00
atleh
cd20741415 added support for dump files in createDefaultKeywordList.cpp 2014-04-01 08:52:07 +02:00
atleh
77cb3e844f createDefaultKeywordList - minor refactoring 2014-03-31 14:26:35 +02:00
atleh
a3b8b57445 createDefaultKeywordList now able to generate dump file. 2014-03-31 14:25:45 +02:00
Joakim Hove
8b0acc2242 Added class EclipseGrid with constructor for cartesian grid from deck. 2014-03-31 14:19:34 +02:00
Joakim Hove
df7244418f Added ERT dependency in build of opm-parser. 2014-03-31 14:18:05 +02:00
Joakim Hove
bc461eec9d Added new keywords for parsing cartesian grid. 2014-03-28 19:10:44 +01:00
Joakim Hove
6c9d03258e Added getKeyword() method to Section class. 2014-03-28 19:09:56 +01:00
Joakim Hove
a135b7999f Merge pull request #153 from joakim-hove/SPE9-keywords
Spe9 fix
2014-03-28 18:58:33 +01:00
Joakim Hove
5785d088ea Added functionality in Completion class to adjust I and J to wellHead value if they have been defaulted (i.e. have value -1). This is unfortunate because we loose quite a lot of const correctness. 2014-03-28 18:56:21 +01:00
osae
ba5a793525 Two new keywords: RVVD and TOPS 2014-03-28 15:13:58 +01:00
Joakim Hove
a422a4929b Added keyword configuration for keywords used in SPE9 example. 2014-03-27 14:55:03 +01:00
Joakim Hove
a141d7722b Added missing #include <iostream> in two tests. 2014-03-25 12:34:48 +01:00
atleh
ec22c39f5c Minor adjustments in Section[Tests], Schedule and KeywordContainerTests 2014-03-25 09:26:43 +01:00
atleh
d761081d96 Commented out failing assert in KeywordContainerTests 2014-03-25 07:29:51 +01:00
atleh
73df57b920 Added some iterator support in KeywordContainer and Section. Not finished. 2014-03-24 18:55:35 +01:00
atleh
a4b8c08c0e Some code cleanup in XyzSection classes 2014-03-24 14:56:20 +01:00
atleh
7225ee8f90 First version of XyzSection classes implemented - based on Section class 2014-03-24 14:48:23 +01:00
atleh
0e9cd5ff33 Some more logic added to the Section class 2014-03-24 10:05:22 +01:00
atleh
0d3f74986a Added a few tests 2014-03-21 15:40:44 +01:00
atleh
14507208d5 Added first version of Section class 2014-03-21 14:39:24 +01:00
Joakim Hove
5b51d306be Merge pull request #143 from AtleH/OPM-68
Opm 68
2014-03-21 00:46:21 +01:00
Joakim Hove
f84ec0bb3f Made injection and production control variables into property variables. 2014-03-21 00:07:23 +01:00
Joakim Hove
011eb8a2c6 camelCased property attributes in the production and injection properties structures. 2014-03-20 23:27:18 +01:00
Atle Haugan
62f2a16496 Fixed unit tests after rebase/merge 2014-03-20 10:56:28 +01:00
Atle Haugan
eae65c3da3 Added unit tests 2014-03-20 10:43:21 +01:00
Atle Haugan
cfea44d264 Fixed implementation of getXyzProperties() - now returning correct reference to original object. Unit test still missing. 2014-03-20 10:43:21 +01:00
Atle Haugan
3daaf827c9 Renamed getXyzProperties to getXyzPropertiesCopy. Added new getXyzProperties which currently does not work... 2014-03-20 10:36:57 +01:00
Atle Haugan
af784c6734 Enabled the remaining tests. 2014-03-20 10:31:21 +01:00
Atle Haugan
2058bb5789 Re-activated the old tests. 2014-03-20 10:26:44 +01:00
Atle Haugan
7358ac5d5a Added addProductionControl() method to the WellProductionProperties struct. Same for WellInjectionProperties. 2014-03-20 10:19:20 +01:00
Atle Haugan
87599c9841 Moved has/drop/addProductionControl to WellProductionProperties. The same for WellInjectionProperties. 2014-03-20 10:11:56 +01:00
Andreas Lauser
674d380006 fix a few pedantic GCC warnings due to superfluous semicolons
these warnings are only only produced by GCC in its pedantic mode (and
possibly with -O3 in addition, but I haven't checked this...)
2014-03-19 16:24:28 +01:00
Atle Haugan
fb5c83086a Moved (duplicated) m_isInPredictionMode to WellProductionProperties and WellInjectionProperties. 2014-03-19 10:51:13 +01:00
Atle Haugan
d9772b83eb Removed unused Well::m_injectionControls, moved m_injectorType to WellInjectionProperties. 2014-03-19 10:42:22 +01:00
Atle Haugan
9c64af0b6b Moved BHPLimits and THPLimits to WellProductionProperties and WellInjectionProperties (duplicated). Several unit tests are still commented out - will fix. 2014-03-19 10:42:21 +01:00
Atle Haugan
3040697ccc Added WellInjectionProperties.InjectionControls. Adjusted som unit tests. Removed some dead code. 2014-03-19 10:40:48 +01:00
Atle Haugan
8aee879dc5 Added WellInjectionProperties, modified Well class to use it 2014-03-19 10:40:07 +01:00
Atle Haugan
df40a0aa21 Replaced single-item calls with call to get/setProductionProperties() 2014-03-19 10:13:58 +01:00
Atle Haugan
9650fce19a Using pointers for WellProductionProperties 2014-03-19 10:13:58 +01:00
Atle Haugan
cd549467b9 Well refactoring - fixed minor bug 2014-03-19 10:13:57 +01:00
Atle Haugan
32c2ef9060 Refactoring the Well class - intermediate step 1 2014-03-19 10:13:57 +01:00
Joakim Hove
77bed42742 Added method at() to the dynamicstate object to return a const reference. 2014-03-19 07:18:09 +01:00
Joakim Hove
c84857ff56 Minor syntax fix in JSON config. 2014-03-18 08:20:51 +01:00
Joakim Hove
1328385c69 Merge pull request #147 from qilicun/polymer_keyword
Polymer keywords
2014-03-18 06:49:58 +01:00
Joakim Hove
dca7a8efa1 Merge pull request #144 from qilicun/polymer_units
Add polymer density unit.
2014-03-18 06:49:31 +01:00
Liu Ming
49376a554c Add PolymerDensity to system. 2014-03-18 08:19:15 +08:00
Andreas Lauser
189b671930 ScheduleEnums: strip whitespace around the control mode strings
for some reason, the Norne deck included whitespace for some control
modes of some wells which lead to an exception. Since Eclipse seems to
eat this, and Eclipse is correct by defintion, let's adapt our
digestion system a bit...
2014-03-17 18:13:49 +01:00
Liu Ming
e29143d95e Add PLYSHEAR, to be used calculation of shear thinning/thickening. 2014-03-17 10:30:49 +08:00
Liu Ming
cf9bb49af5 Add PLYVISC to be used calculation of effective water viscosity. 2014-03-17 10:27:27 +08:00
Liu Ming
106c337435 Add PLYROCK, dealing with permeability reduction. 2014-03-17 10:24:17 +08:00
Liu Ming
45fa031dd4 Add PLYMAX, to be used calculation of the maximum polymer fluid viscosity. 2014-03-17 10:20:30 +08:00
Liu Ming
362585e056 Add PLYADS, dealing with polymer adsorption. 2014-03-17 10:18:18 +08:00
Liu Ming
8de830e225 Add PLMIXPAR for Todd-Longstaff mixing parameter. 2014-03-17 10:15:50 +08:00
Liu Ming
52bd8cceb9 Add polymer density unit. 2014-03-17 09:12:14 +08:00
Joakim Hove
b4bbbb7c8e Merge pull request #137 from joakim-hove/Norne-Schedule
Small changes to support loading of Norne Schedule file
2014-03-11 20:08:15 +01:00
Andreas Lauser
08331914bd TimeMap: extend unit tests for the time levels
I forgot, sorry...
2014-03-11 19:01:23 +01:00
Andreas Lauser
30a16410aa TimeMap: fix the timePassedUntil() method
whoever wrote the original code must have his brain left in the bed
that day ;)...
2014-03-11 15:01:14 +01:00
Joakim Hove
6e62e087ea Changed installation of keywords to use a plain recursive install without consulting git. 2014-03-06 07:00:11 +01:00
Joakim Hove
2259d32258 Added two new keywords. 2014-03-04 16:47:00 +01:00
Joakim Hove
8598fa279e Added throw() in Schedule if trying to control well on an item which has been defaulted. 2014-03-03 15:06:26 +01:00
Joakim Hove
7dc8767c80 Made sure that groups were added when reading the GRUPTREE keyword. 2014-03-03 15:06:26 +01:00
Joakim Hove
ceb4a8df8d Added check on Well->status before reading controlmode. 2014-03-03 15:06:25 +01:00
Atgeirr Flø Rasmussen
3ab6a5388c Suppress unused argument warnings. 2014-03-03 11:06:44 +01:00
Bård Skaflestad
57f34f2ab7 Restore C++-11 checks
While reformatting the parser-prereqs file I accidentally replaced
the feature search 'CXX11Features' with 'CXX10Features'.  This
commit fixes that blunder.
2014-02-28 22:17:13 +01:00
Joakim Hove
ee7e034b08 Merge pull request #134 from bska/uniform-parser-prereqs
Uniform parser 'prereqs' file
2014-02-28 21:18:41 +01:00
Joakim Hove
8c3f384b5f Merge pull request #132 from andlaus/add_rv
add RV keyword
2014-02-28 21:17:28 +01:00
Bård Skaflestad
600a07f7e2 Depend on Boost.Iostreams
The benchmark library uses Boost::iostreams to do decompression. Since
we only scan for the Boost dependency once, this submodule is added to
all of the projects in order to have a coherent dependency on Boost.
2014-02-28 19:21:33 +01:00
Bård Skaflestad
97980cb37f Reformat prerequisite file according to convention
This commit makes a few adjustments to the white-space of file
'opm-parser-prereqs.cmake' to honour the conventions of the other
*-prereqs.cmake files within the OPM project's module suites.

No functional changes.
2014-02-28 19:21:27 +01:00
Andreas Lauser
0901cd3586 add RV keyword
For now, this is required to read in the initial condition of Norne...
2014-02-28 16:27:20 +01:00
Andreas Lauser
b43859a2ad use raw values for context dependent rates in the wrapper of WCONINJE 2014-02-27 13:35:51 +01:00
Joakim Hove
f91229218e Moved the implementation of two micro functions from .hpp to .cpp file + changed one int -> size_t. 2014-02-26 23:24:31 +01:00
Joakim Hove
b0ee11ebb3 Merge pull request #130 from AtleH/pathskeyword
PATHS keyword
2014-02-26 23:10:45 +01:00
Joakim Hove
1907a8e467 Merge pull request #129 from andlaus/refactor_timemap
Refactor timemap
2014-02-26 23:09:50 +01:00
Andreas Lauser
af13b5ed31 TimeMap: always assume the presence of the TIME item
i.e., the number of items in a date record must now always be 4. to
make this happen, some tests had to be fixed, too...
2014-02-26 22:15:53 +01:00
Andreas Lauser
b9956385ef fixup! TimeMap: Expose more data 2014-02-26 15:46:18 +01:00
Andreas Lauser
57f199a6e8 fixup! TimeMap: add constructor which takes a deck 2014-02-26 15:33:08 +01:00
Atle Haugan
c81fe99fec Fixed definition for PATHS keyword + improved unit test for same 2014-02-26 15:03:04 +01:00
Joakim Hove
47fee36223 Merge pull request #128 from flikka/add-WGRUPCON
Add WGRUPCON support to parser
2014-02-25 20:06:45 +01:00
Joakim Hove
b28c082b1a Changed datatype FLOAT -> DOUBLE in configuration of WGRUPCON keyword. 2014-02-25 20:03:45 +01:00
Andreas Lauser
bffa709dd3 TimeMap: extend test to check "from deck construction" and the new accessor methods 2014-02-21 17:06:22 +01:00
Andreas Lauser
9b8c5d317e TimeMap: add constructor which takes a deck
this simplifies things considerably and hopefully avoids code
excessive code duplication..
2014-02-21 17:06:22 +01:00
Andreas Lauser
e6c0ff4546 TimeMap: Expose more data
basically, we now can access the beginning of a timestep its length
and the total time passed since the beginning of life, the universe
and all the rest.
2014-02-21 17:06:21 +01:00
Andreas Lauser
be137414c8 TimeMap: simplify the initialization of the eclipse month name map slightly 2014-02-21 17:06:21 +01:00
Andreas Lauser
18eb2fd8f4 TimeMap: replace boost::gregorian::date by boost::posix_time::ptime
this is necessary because boost::gregorian::date does not have a
notion of "time during a day" which is required to specify time step
lengths less than a day...
2014-02-21 17:06:21 +01:00
Andreas Lauser
1f9c5d2583 trivial: fix end-of-file comment in Completion.hpp
that clearly was a copy-and-pasteo...
2014-02-21 17:06:21 +01:00
Andreas Lauser
4a2ab048e9 fix the definition of the START keyword
this one had the same problems as DATES
2014-02-21 17:06:21 +01:00
Andreas Lauser
6b70634f94 fix the "DATES" keyword
The time of the day field was missing. The defaults for it are those
of E100.
2014-02-21 17:06:21 +01:00
Atle Haugan
e4a404023c Removed some logging output from Parser 2014-02-21 13:14:11 +01:00
Atle Haugan
280e722501 Forgot to add new JSON file for PATHS keyword 2014-02-21 12:57:26 +01:00
Atle Haugan
9ac0401af5 Support for PATHS keyword - first take 2014-02-21 12:56:20 +01:00
Kristian Flikka
b3dc1ea5ca Added rest of WGRUPCON handlingin Well and Schedule 2014-02-21 12:48:36 +01:00
Joakim Hove
d49ff37891 Merge pull request #126 from AtleH/floatitem
Added DeckFloatItem, ParserFloatItem
2014-02-20 12:56:43 +01:00
Kristian Flikka
e4eb60be4b Added guide rate phase enum 2014-02-20 09:30:33 +01:00
Atle Haugan
0d134e8dcd Removed special float/double handling in ParserFloatItem 2014-02-20 07:23:56 +01:00
Kristian Flikka
b69f41f32d Added support for guide rate 2014-02-19 15:43:42 +01:00
Atle Haugan
442d0fb7bf Added ParserFloatItem + some tests. More tests may be needed. 2014-02-18 11:02:38 +01:00
Kristian Flikka
bd564ad944 Added WGRUPCON, and simple YES/NO handling in Schedule 2014-02-17 16:10:31 +01:00
Atle Haugan
ed17058ad3 Renamed FLOAT to DOUBLE in JSON files, tests and some code using the enum 2014-02-17 15:02:40 +01:00
Atle Haugan
d672f4f5eb Added DOUBLE enum to ParserValueTypeEnum 2014-02-17 14:32:32 +01:00
Atle Haugan
6a907bc7b2 Added new DeckFloatItem with tests 2014-02-14 13:41:10 +01:00
Joakim Hove
3a3e40efb1 Merge pull request #125 from flikka/fix-treefromschedule-bug
Fix treefromschedule bug
2014-02-14 13:35:45 +01:00
Joakim Hove
c61f71f552 Merge pull request #124 from flikka/add-grouptree-child-iter-test
Add grouptree child iter test
2014-02-14 13:35:30 +01:00
Joakim Hove
99cbff8f3c Merge pull request #123 from flikka/constify-group-iterator
Changed the begin and end iterator functions of GroupTreeNode into const...
2014-02-14 13:35:21 +01:00
Kristian Flikka
56c3dd2085 Make sure that the tree is updated correctly after reading WELSPECS 2014-02-14 12:36:26 +01:00
Kristian Flikka
46b3a364d8 Added test to run through the iter functionality in GroupTreeNode 2014-02-14 11:38:49 +01:00
Kristian Flikka
dea586829c Changed the begin and end iterator functions of GroupTreeNode into const_iterators 2014-02-14 09:58:06 +01:00
Andreas Lauser
c972e6c0c1 GconinjeWrapper: return raw instead of SI rates
the wrapper could be a bit more sophisticated and do the conversion
internally, but the new wells management code seems to ignore the
wrapper anyway, so there is no real point in investing time into that
(yet).
2014-02-13 14:23:56 +01:00
Joakim Hove
b386b0b944 Merge pull request #119 from flikka/add-producergroup-status
Add producergroup status to Group object
2014-02-12 14:35:36 +01:00
Joakim Hove
452da21fc4 Merge pull request #118 from flikka/getnodes-grouptree
Added getNodes to get a vector of the group nodes in the tree
2014-02-12 14:34:57 +01:00
Kristian Flikka
720cd21b0e Merged from upstream/master 2014-02-12 10:13:49 +01:00
Kristian Flikka
e105b0b3c5 Added missing files from the Utility folder to the CMakeLists file. 2014-02-12 08:53:53 +01:00
Joakim Hove
e31873f560 Merge pull request #117 from andlaus/unit_system_cleanups
Unit system cleanups
2014-02-11 13:13:39 +01:00
Andreas Lauser
03d6e9a20b correct the context dependent rates in the schedule code 2014-02-11 12:45:44 +01:00
Andreas Lauser
849bc7df93 units: introduce a "ContextDependent" dimension
this is meant for those nasty keywords where the dimension of an entry
depends on a user-defined value of some field of a (potentially
different) keyword. One example for this are the surface rates of the
produced fluids for the .CON(INJ|PROD).* keywords which exhibit
different units depending on whether the user choses to control for
the surface gas or the liquid rate.

the approach taken in this patch is to convert all numbers to NaN if
the unit is queried in SI (via item->getSIDouble()). It might be more
desireable to throw an exception in this case, but this approach would
be more elaborate and NaNs should be quickly noticeable by the users
of this code.

I tried to adapt all implemented keywords, but it's quite likely that
I missed some...
2014-02-11 12:45:44 +01:00
Andreas Lauser
50f2288148 units: rename "m" to "Mass" 2014-02-11 12:45:44 +01:00
Andreas Lauser
690f26c223 units: rename "Rho" to "Density" 2014-02-11 12:45:43 +01:00
Andreas Lauser
ae73345763 units: rename "K" to "Permeability" 2014-02-11 12:45:43 +01:00
Andreas Lauser
ac60eed7d6 units: rename "1/Rs to "OilDissolutionFactor" and "Rs to "GasDissolutionFactor" 2014-02-11 12:45:43 +01:00
Andreas Lauser
bc4d467322 units replace: "mu" by "Viscosity" 2014-02-11 12:45:43 +01:00
Andreas Lauser
19d89d44cd units: Replace "P" by "Pressure" 2014-02-11 12:45:43 +01:00
Andreas Lauser
0129a382a8 units: Replace "L" by "Length" 2014-02-11 12:45:43 +01:00
Andreas Lauser
6a97d78cc6 units: replace "t" with "Time"
this makes things more explicit and more readable
2014-02-11 12:45:41 +01:00
Andreas Lauser
44f310bfbf units: substitute "FlowVolume" by "LiquidVolume" and "GasVolume"
because the units for them are different in the "Field" unit system.
2014-02-11 12:45:05 +01:00
Kristian Flikka
1988221d41 Added const to a couple of get-type methods 2014-02-11 09:32:34 +01:00
Kristian Flikka
f33b05248b Merge pull request #113 from blattms/make-arbitrary-sibling-possible
[PATCH] [cmake] Makes arbitrary build subdirectories possible.
2014-02-10 15:45:45 +01:00
Kristian Flikka
08ec94e15c Added setting of the injection/production status of group 2014-02-10 15:43:37 +01:00
Kristian Flikka
41a1e889b8 Added isProducerGroup to Group class, need this in opm-core 2014-02-10 15:43:37 +01:00
Kristian Flikka
9363f39cb9 Added getNodes to get a vector of the group nodes in the tree 2014-02-10 12:18:42 +01:00
Joakim Hove
e4c60e6aa1 Merge pull request #112 from andlaus/another_typo
fix another missibility typo
2014-02-06 22:25:51 +01:00
Joakim Hove
1447a8b05e Merge pull request #115 from andlaus/add_endpoint_scaling_stuff
add keywords used by the opm-core endpoint scaling code
2014-02-06 21:13:05 +01:00
Joakim Hove
d39bf25cb2 Merge pull request #116 from andlaus/remove_r300_column_in_rock
remove the "MATRIX_COMPRESSIBILITY" from ROCK
2014-02-06 21:10:57 +01:00
Andreas Lauser
b26656e741 remove the "MATRIX_COMPRESSIBILITY" from ROCK
This field is specific to the Eclipse 300 geomechanics module. IMHO,
either all fields for the eclipse 300 geomechanics module should be
added or none. Adapting the table code to "partially defined" keywords
is a pain I'd rather avoid!
2014-02-06 18:45:22 +01:00
Andreas Lauser
c41be6c91a add keywords used by the opm-core endpoint scaling code
plus some wrappers/tables
2014-02-06 18:44:10 +01:00
Kristian Flikka
15682a71df Merge pull request #114 from joakim-hove/valgrind
Valgrind
2014-02-06 16:39:30 +01:00
Joakim Hove
ae9b57409c Made unit system a shared_ptr to avoid memleak in test. 2014-02-06 15:45:23 +01:00
Joakim Hove
b2d4363fae Added explicit delete in keyword test code. 2014-02-06 15:35:18 +01:00
Joakim Hove
25221c78ad Changed order of elements in comparison: To avoid unitialized variable warning. 2014-02-06 15:08:02 +01:00
Joakim Hove
1943a05b08 Changed order of variables in comparison: avoid warning of uninitialised data. 2014-02-06 15:05:24 +01:00
Joakim Hove
e17f03b8a0 Merge remote-tracking branch 'akva2/run_tests_through_valgrind' into valgrind 2014-02-06 14:30:01 +01:00
Markus Blatt
52da1a7838 [PATCH] [cmake] Makes arbitrary build subdirectories possible.
Instead of guessing the suffix or subdir of the build directory,
we now simply compare PROJECT_{BINARY,SOURCE]_DIR to detect it.
By this e.g. opm-core/opm-parallel is a possible build directory, too.
2014-02-06 11:16:00 +01:00
Andreas Lauser
3a73a2c2b5 fix another missibility typo
this one was not fixed in @bska's PR because my branch for ROCKTAB was
not merged back then. /me is confused by too many things going on at
once...
2014-02-06 00:21:01 +01:00
Joakim Hove
c38e079a6d Merge pull request #111 from andlaus/better_rocktab
add a utility class for the ROCKTAB keyword
2014-02-05 15:47:42 +01:00
Andreas Lauser
d5bedde8a7 add a utility class to handle ROCK tables
So far, this only considers Eclipse R100...
2014-02-05 15:20:56 +01:00
Atgeirr Flø Rasmussen
3c9aceeb28 Fix unused argument warning and wrong behaviour.
The class WarnAndContinueOnError should write warnings irrespective
of the status of the OPM_VERBOSE symbol.
2014-02-05 15:07:17 +01:00
Andreas Lauser
6eab8d62b1 add a utility class for the ROCKTAB keyword
this one is a bit more complicated than a plain SimpleTable as the
number of columns depends on the deck. (to be precise, it depends on
the presence of the RKTRMDIR keyword which is also added in this
patch.)
2014-02-05 15:04:04 +01:00
Bård Skaflestad
9bfd5b92d7 Fix spelling.
The connection "strength" (conduction factor) is called
"transmissibility" (double 's'), not "transmiscibility" ('sc').
2014-02-05 13:39:28 +01:00
Kristian Flikka
9db42f6eb3 Added support for WELOPEN in the Schedule class, NOT support specific completions, only the well 2014-02-04 16:12:49 +01:00
Joakim Hove
0d35b7d3f6 Merge pull request #101 from AtleH/specialkeywords
Specialkeywords
2014-01-31 05:33:25 -08:00
Joakim Hove
bb444b5139 Added flag injectionControls to keep track of available injection controls. 2014-01-30 16:44:21 +01:00
Joakim Hove
49ee4ed1ed Added addProductionControl() and dropproductioncontrol() to Schedule. 2014-01-30 16:44:21 +01:00
Joakim Hove
137eb5b6e1 Added bitmask status flag to keep track of which controls have been set. 2014-01-30 16:44:21 +01:00
Joakim Hove
dbb0272d12 Changed ControlEnums to become 2^n 2014-01-30 16:44:21 +01:00
Joakim Hove
e42234b17a Added Well::Producercontrolmode 2014-01-30 16:44:21 +01:00
Joakim Hove
d0da1275c4 Changed name of item: ControlMode -> CMODE 2014-01-30 16:44:20 +01:00
Joakim Hove
5dd6865838 Added RESV target to Well. 2014-01-30 16:44:20 +01:00
Joakim Hove
7f58de5b3e Have added liquidRate setting from Schedule.cpp 2014-01-30 16:44:20 +01:00
Joakim Hove
a83d994494 Added well->liquidRate() from WCONPROD. 2014-01-30 16:44:20 +01:00
Atle Haugan
c20c3baf6f Fixed algorithm for concatenating strings 2014-01-30 15:18:34 +01:00
Atle Haugan
1dd448b178 Merge branch 'master' into specialkeywords
Conflicts:
	opm/parser/eclipse/EclipseState/EclipseState.hpp
2014-01-30 15:05:01 +01:00
Atle Haugan
825e976566 New version based on feedback from code review 2014-01-29 19:39:33 +01:00
Joakim Hove
46bd341808 Setting injectorType from Schedule class. 2014-01-29 16:42:55 +01:00
Joakim Hove
0f707b7498 Keeping track of well OPEN|SHUT|STOP status from WCONxxxx keywords. 2014-01-29 15:55:02 +01:00
Joakim Hove
0457525b10 Changed name of item to STATUS. 2014-01-29 15:54:15 +01:00
Joakim Hove
db26d6cf93 Added status flag as well property. 2014-01-29 15:34:33 +01:00
Joakim Hove
86e8cc3585 Added WellCommon namespace with StatusEnum. 2014-01-29 15:10:52 +01:00
Joakim Hove
49604cf631 Added injectorControlMode to Well class. 2014-01-29 13:33:28 +01:00
Joakim Hove
c60ce712ea Added ControlMode enum to the WellInjector namespace. 2014-01-29 13:21:04 +01:00
Joakim Hove
65e87189e4 Changed namespace InjectorType -> WellInjector. 2014-01-29 13:11:35 +01:00
Kristian Flikka
37084e991d Shifting WELSPECS and COMPDAT i,j,k indices down one, to go from 0 2014-01-29 11:48:02 +01:00
Joakim Hove
3f62b3c777 Updated numerical test values for connection factor; due to SI dimension. 2014-01-29 10:39:55 +01:00
Kristian Flikka
3c4f12f3c7 Added dimension to connection factor / well index in json config. Updated fetching to use SI value 2014-01-28 21:29:35 +01:00
Kristian Flikka
efcfad657e Merge pull request #102 from joakim-hove/well-injection-phase
Well injection phase
2014-01-28 11:37:49 -08:00
Joakim Hove
b0545fab0a Merge pull request #100 from flikka/add-to-completion
Added skinFactor and diameter to Completion
2014-01-28 07:04:40 -08:00
Kristian Flikka
e669e4110d Added CF, diameter and skinFactor check in integration test 2014-01-28 15:30:25 +01:00
Joakim Hove
7ce91cf504 Added well->Injectortype 2014-01-28 14:31:51 +01:00
Atle Haugan
5dcc90cfa6 Cosmetic fix - adjusted spacing in header file 2014-01-28 10:11:35 +01:00
Atle Haugan
1530425598 Fixed bug in ParseTITLE.cpp 2014-01-28 10:06:58 +01:00
Atle Haugan
cd3d4f9337 First cut: TITLE keyword now being parsed correctly. 2014-01-28 10:01:11 +01:00
Joakim Hove
eae4cbb889 Added InjectorType enum. 2014-01-28 08:35:12 +01:00
Joakim Hove
a464429388 Added namespace Phase around the PhaseEnum enum. 2014-01-28 08:18:03 +01:00
Kristian Flikka
fdee1d8b67 Added skinFactor and diameter to Completion 2014-01-27 19:32:00 +01:00
Joakim Hove
af00558ec7 Added THPLimit as well property. 2014-01-27 18:38:41 +01:00
Joakim Hove
3d2ddd70fc Setting Well->BHP limit from Schedule. 2014-01-27 18:31:22 +01:00
Joakim Hove
99ef84b438 Added BHPLimit as well property. 2014-01-27 18:30:05 +01:00
Joakim Hove
a145a329f3 ADded one more DATES keyword with WCONINJE to check loading of BHP limit. 2014-01-27 18:23:29 +01:00
Joakim Hove
dee5509108 Added default value for BHPLimit/target. 2014-01-27 18:22:57 +01:00
Arne Morten Kvarving
4a9c18ac9f run tests through valgrind 2014-01-27 15:16:34 +01:00
Kristian Flikka
3cbc7ea1a0 Made getCompletions const 2014-01-27 14:40:59 +01:00
Kristian Flikka
ca0956ec02 Merge pull request #96 from joakim-hove/well-reservoir-rate
Well injection: differentiate between surface rate and reservoir rate
2014-01-27 03:09:09 -08:00
Joakim Hove
1ba278022a Have added ReservoirRates to well injector. 2014-01-24 13:24:22 +01:00
Atle Haugan
51ac683ef2 OPM-17: Fixed bug in END[INC] logic. 2014-01-24 13:16:37 +01:00
Joakim Hove
1cc38786dc Renamed well->InjectionRate to SurfaceInjectionRate. 2014-01-24 12:36:45 +01:00
Atle Haugan
620774c3a4 Added missing files 2014-01-24 12:05:03 +01:00
Atle Haugan
f2c451e07a OPM-17: Minor change to END[INC] parsing + started to parse TITLE keyword 2014-01-24 11:18:07 +01:00
Atle Haugan
ef11a2331f OPM-17: First attempt to handle END and ENDINC keywords 2014-01-24 10:01:17 +01:00
Joakim Hove
581bf74e9a Changed int -> size_t many places. 2014-01-24 09:41:32 +01:00
Kristian Flikka
6229fd1250 Added functionality to get vector containing active / all wells 2014-01-22 14:40:10 +01:00
Kristian Flikka
a7d51c387e Merged upstream/master 2014-01-21 10:14:16 +01:00
Kristian Flikka
bd74a32c89 Added dimension to WELSPECS REF_DEPT, updated usage to query for SI 2014-01-21 10:10:05 +01:00
Kristian Flikka
3537de2209 Removed unused includes 2014-01-20 15:02:21 +01:00
Kristian Flikka
d09975e142 Introducing WELSPECS data in constructor to Wells. Throws if WELSPECS with different data for an existing well occurs 2014-01-20 14:52:30 +01:00
Andreas Lauser
ab65990653 avoid coverting the data of a deck item to SI multiple times
This resulted in _quadratic_ complexity if data points where retrieved
one-by-one. For the Norne case, this had the consequence that
retrieving the data for ZCORN (-> about 1M data points) took hours...
2014-01-18 13:34:12 +01:00
Andreas Lauser
a0785e37dd add dimension to the GCONTINJE keyword
these are required by the WellsManager for Norne
2014-01-17 11:37:29 +01:00
Andreas Lauser
123353b03c add the missing header files to CMakeLists.txt 2014-01-17 10:54:38 +01:00
Joakim Hove
fe01d09427 Added GPL header, with CopyRight Andreas Lauser to three tests. 2014-01-17 08:15:35 +01:00
Joakim Hove
4b35f79a35 Changed integer type int -> size_t throughout. 2014-01-17 08:13:08 +01:00
Andreas Lauser
9332f0edd1 PVTO: Add unit test and make the function names of the table class consistent with PVTG 2014-01-16 15:22:33 +01:00
Andreas Lauser
1c39df2d57 improve unit test for PVTG
now the data is parsed from a string specified in the source file
instead of a separate file, the PvtgTable utility class is tested and
the order of the fields in the JSON definition of PVTG is the same as
for that of PVTO.
2014-01-16 13:23:13 +01:00
Andreas Lauser
27efd0d1fa implement multi-region full tables
detecting empty records is still pretty hacky: When calculating the
number of flat items, we stop at the first item for which the default
was applied.

Also, this patch corrects the names of the columes used by the PVTG
keyword. (the first column is pressure, then comes Rv.)
2014-01-16 13:12:40 +01:00
Andreas Lauser
a2edc063b8 some additional dimensions for keywords used by the Norne case 2014-01-15 15:44:38 +01:00
Andreas Lauser
f9fa6d428c add additional dimensions for the keywords required to convert autodiff's sim_fibo_ad 2014-01-15 15:44:38 +01:00
Andreas Lauser
8d2ea3e0cd add wrapper classes for more eclipse keywords
these are convenient to convert everything required to rip out the old
parser of sim_fibo_ad. the concrete keywords are:

 - COMPDAT
 - EQUIL
 - GCONINJE
 - GCONPROD
 - GRUPTREE
 - WCONINJE
 - WCONINJ
 - WCONPROD
 - WELOPEN
 - WELSPECS
 - WGRUPCON

in the medium term it would be nice if these wrapper classes could be
automatically generated from the JSON keyword descriptions.
2014-01-15 15:44:38 +01:00
Andreas Lauser
93523a9a54 add wrapper class for "WCONINJ" 2014-01-15 15:44:38 +01:00
Andreas Lauser
f38e09f450 add a wrapper class for the "SPECGRID" keyword 2014-01-15 15:44:38 +01:00
Andreas Lauser
032916c1bd fix more of the annoying sign comparison warnings
hopefully all of them.
2014-01-15 12:52:12 +01:00
Andreas Lauser
0ed659de10 add a wrapper for records of the WELSPECS keyword 2014-01-15 12:52:12 +01:00
Andreas Lauser
6bf3e3ef8d add unit test for SGOF 2014-01-15 12:52:12 +01:00
Andreas Lauser
024774b605 add wrapper class for the START keyword 2014-01-15 12:52:12 +01:00
Andreas Lauser
34e39d2f31 add utility class for the 'TSTEP' keyword 2014-01-15 12:52:12 +01:00
Andreas Lauser
7a3755926b Units: add 'Timestep' dimension
the motivation for this is the 'TSTEP' eclipse keyword.

the reason why this dimension is not simply called 'Time' is that in
eclipse, different keywords might use different units, e.g. one
keyword could use seconds, another could use years while a third uses
days. As an added bonus, the used time units may be different for
different scales but identical in others (e.g., for one keyword times
might be specified in 'days' for the metric as well as for the
labscale, but in 'days' and 'hours' for another second keyword.)
2014-01-15 12:52:12 +01:00
Andreas Lauser
d261fcfe98 also constify the getSIDoubleData() method in DeckKeyword
in the item and in the record it already was marked as const, the
DeckKeyword class was forgotten during that excercise.
2014-01-15 12:52:12 +01:00
Andreas Lauser
079aa1417b move the SimpleMultiRecordTable class into its own files. 2014-01-15 12:52:12 +01:00
Andreas Lauser
8c83f0d8c1 remove the emacs and vim modelines
as it was decided that having editor-specific stuff in files is not
wanted in OPM. for emacs, a .dir-locals.el file is added to the
module's root directory which should have the same effect.
2014-01-15 12:52:12 +01:00
Andreas Lauser
6f721581bd add utility classes for some common keywords
the idea is to create a lightweight wrapper objects around
DeckKeywords which allow more convenient and more readable access to
the data. E.g. instead of

  std::vector outerColumnNames{"RV", "P", "BG", "MUG"};
  std::vector innerColumnNames{"P", "BG", "MUG"};
  Opm::FullTable pvtgTable(deck->getKeyword("PVTG"),
                           outerColumnNames, innerColumnNames);
  pvtgTable->getOuterTable()->getColumn(1);

one now better uses

  Opm::PvtgTable pvtgTable(deck->getKeyword("PVTG"));
  pvtgTable->getOuterTable()->getPressureColumn();

the idea for the other keywords is similar.
2014-01-15 12:52:12 +01:00
Andreas Lauser
d96b69c9ea add support for full-fledged tables 2014-01-15 12:52:12 +01:00
Andreas Lauser
3a3336028a add class for simple tables
This is intended for keywords like SWOF which currently is a big
vector of doubles but one needs to use the data in a column oriented
way.

This class is intended to be used like this:

Opm::DeckKeywordConstPtr swofKeyword = newParserDeck->getKeyword("SWOF");
Opm::SimpleTable swofTable(swofKeyword,
                           /*columns=*/std::vector<std::string>{"SW", "KRW", "KROW", "PCOW"},
                           /*recordIdx=*/table_num);
const std::vector<double>& sw = swofTable.getColumn(0);
// ...

what might be useful is to move the column names into the JSON
description of the keywords, but I could not find a way to go back to
the parser from the deck/keyword. maybe this is not even desireable as
decks might also be created by other means...

Also, a multi-record variant of the class is available. That one is
intended for keywords like PVTO where the first few items of each
record form a table (in the case of PVTO: Rs, pressure, Bo, and
viscosity for staturated oil) and the next entries constitute another
table (in the case of PVTO: pressure, Bo and viscosity for
undersaturated oil with the same RS factor as the first entry).

The second kind of tables can be constructed using the item-based
variant of SimpleTable.
2014-01-15 12:52:12 +01:00
Andreas Lauser
234625758c add dimensions to PVTG 2014-01-15 12:52:12 +01:00
Andreas Lauser
5fd51021d9 fix JSON of the PVTO keyword
the magic word is "num_tables" and not "size". with the latter it only
parses the first record of the keyword. Stupid me!
2014-01-15 12:52:12 +01:00
Andreas Lauser
9a09fa29af rename Parser::parse to Parser::parseFile and add Parser::parseData
Parser::parseData is quite useful for unit tests to prevent them
spilling files to everything. Also, what was formerly
Parser::parseFile has been renamed to Parser::parseStream and slightly
modified to not be specific for std::ifstream.
2014-01-10 14:51:56 +01:00
Joakim Hove
11f3ab1cb5 Merge pull request #85 from AtleH/KeywordDescriber
First attempt for the KeywordDescriber
2014-01-10 05:37:34 -08:00
Atle Haugan
53edd3bdc7 Renamed EclipseDataDoctor[.cpp] to opm-eclkwtest 2014-01-10 14:02:15 +01:00
Atle Haugan
5a34966a75 Renamed KeywordDescriber to opm-eclkw 2014-01-10 11:15:00 +01:00
Atle Haugan
ddd4563f97 Renamed from 'help' to 'description' for ParserKeyword and ParserItem 2014-01-10 10:57:35 +01:00
Atle Haugan
308cfda3c5 Improved some type usage based on code review feedback 2014-01-10 08:53:19 +01:00
Atle Haugan
3271156f9d First pull request candidate with help support 2014-01-09 13:33:32 +01:00
Atle Haugan
d3d6dc2c90 Added unit tests for ParserKeyword.help() 2014-01-09 08:42:27 +01:00
Atle Haugan
d837b688e6 Code cleanup in KeywordDescriber.cpp 2014-01-09 08:31:09 +01:00
Kristian Flikka
ab49cba392 Fixed erroneous include statement path 2014-01-08 16:03:19 +01:00
Kristian Flikka
fd99df1213 Added missing include statements 2014-01-08 15:59:38 +01:00
Atle Haugan
09135500d6 Improved output layout somewhat + refactored some code 2014-01-08 15:22:14 +01:00
Atle Haugan
c9cda9916f Code improvements based on code review feedback 2014-01-08 15:03:16 +01:00
Atle Haugan
6709523843 Removed even more green code 2014-01-08 11:20:31 +01:00
Atle Haugan
f9d06da6db Removed even more green code 2014-01-08 11:16:30 +01:00
Atle Haugan
e3f752f38b Removed some green code 2014-01-08 11:12:52 +01:00
Atle Haugan
64f7f31f46 Added output from hasDimensions() 2014-01-08 10:49:22 +01:00
Atle Haugan
0c5f7bf731 Added output for items 2014-01-08 10:49:22 +01:00
Atle Haugan
25eb08aa52 After code review with Kristian and Joakim 2014-01-08 10:49:21 +01:00
Atle Haugan
73dfc77aab Some more adjustments 2014-01-08 10:49:20 +01:00
Atle Haugan
a18cf41553 Some cleanup and refactoring 2014-01-08 10:49:20 +01:00
Atle Haugan
67ab48eee0 First running version of the KeyWordDescriber class. Some cleanup and refactoring required. 2014-01-08 10:49:20 +01:00
Atle Haugan
72545992e1 First running version of the KeyWordDescriber class. Some cleanup and refactoring required. 2014-01-08 10:49:20 +01:00
Atle Haugan (ITV DIS RD)
8f94b29547 Added KeywordDescriber.cpp 2014-01-08 10:49:19 +01:00
Joakim Hove
09f70a2205 Added std::set<enum PhaseEnum> to keep track of phases present to the EclipseState. 2014-01-07 17:52:20 +01:00
Joakim Hove
b90830ea79 Added class EclipseState which currently holds a Schedule instance. 2014-01-07 17:39:07 +01:00
Andreas Lauser
a88b47750e fix more (hopefully all) conversion factors
also, correct the dimension of the Rv item of the PVDG keyword which
is 1/Rs. Finally, the conversion factor for stock tank barrels to m^3
was off by a factor of 1000. (I suppose that liters instead of m^3
were assumed to be the SI unit in this case.)
2013-12-22 11:03:26 +01:00
Andreas Lauser
d1f224fd79 Units: fix thinko
milli means division by 1000 not multiplication...

this makes SPE1 converge nicely with opm-parser in autodiff!
2013-12-21 16:56:04 +01:00
Andreas Lauser
472b16b42a units: fix typo
Raito -> Ratio
2013-12-21 16:53:28 +01:00
Kristian Flikka
9f4d5c11ab Merge pull request #80 from joakim-hove/tablecollection-with-items
Tablecollection with items
2013-12-20 04:31:48 -08:00
Andreas Lauser
a1ae9ff6b5 add a few 'explicit' statements
this allows to constructs like

ParserIntItem("NRPVT");

which IMHO is more readable than the previous way, i.e.,

ParserIntItem(std::string("NRPVT"));
2013-12-19 15:39:47 +01:00
Andreas Lauser
e5066ae495 make the getSIDouble*() methods const
the fact that data is lazily converted to SI units should not be
relevant for the caller. This requires to decorate the array for SI
units in the DoubleItem as mutable, though...
2013-12-19 15:39:28 +01:00
Joakim Hove
c78c6d3e96 Merge remote-tracking branch 'upstream/master' into tablecollection-with-items 2013-12-19 13:56:54 +01:00
Joakim Hove
ae2260aa43 Table collection keywords PVTO and PVTG now have individual items: settings. 2013-12-19 13:54:51 +01:00
Andreas Lauser
3ae1890276 add dimensions to the PVTO keyword 2013-12-18 18:23:50 +01:00
Andreas Lauser
02afdf89da add dimensions to the SGOF keyword 2013-12-18 16:51:46 +01:00
Andreas Lauser
b7a67685c9 add dimensions for the PVDG table 2013-12-18 16:37:30 +01:00
Andreas Lauser
7096979a4b add a few missing dimensions
This makes getSIDouble*() work on PORO and PVTW.
2013-12-18 16:27:47 +01:00
Andreas Lauser
5f612a7e90 add missing PERM?? keywords 2013-12-18 15:35:55 +01:00
Andreas Lauser
6473a6eb69 add dimensions to PERMY and PERMZ 2013-12-18 15:28:12 +01:00
Joakim Hove
a227f02c2e Merge pull request #77 from joakim-hove/units
Added some documentation to the ConversionFactors.
2013-12-18 06:10:37 -08:00
Joakim Hove
6b29d4d0d2 Added some documentation to the ConversionFactors. 2013-12-18 12:52:29 +01:00
Joakim Hove
3db286a44b Merge pull request #76 from joakim-hove/units
Units
2013-12-18 03:33:15 -08:00
Joakim Hove
1d80ffaed8 Added test example for parsing DENSITY keyword. 2013-12-18 12:32:02 +01:00
Joakim Hove
70e66c4660 Enabled field keyword - removed ACTION:IGNORE_WARNING. 2013-12-18 12:30:45 +01:00
Joakim Hove
c1d7e87b71 Added dimension FlowVolume 2013-12-18 12:30:10 +01:00
Joakim Hove
dff2050ea5 Merge pull request #75 from joakim-hove/units
Updated ParsePORO test to also parse PERMX and check dimensions.
2013-12-17 23:58:39 -08:00
Joakim Hove
7be79cf450 Updated ParsePORO test to also parse PERMX and check dimensions. 2013-12-18 08:57:34 +01:00
Joakim Hove
f8684b822d Merge pull request #74 from joakim-hove/units
Added dimensions to SWOF keyword.
2013-12-17 07:40:39 -08:00
Joakim Hove
b4a97f514e Added dimensions to SWOF keyword. 2013-12-17 16:39:58 +01:00
Kristian Flikka
c3dfc9e0ea Merge pull request #73 from joakim-hove/units
Apply units
2013-12-17 02:53:12 -08:00
Joakim Hove
99542f6685 Added dimensions to GCONINJE / GCONPROD / WCONINJE / WCONINJH. 2013-12-16 17:23:46 +01:00
Joakim Hove
65c9882b53 Added dimensions to WCONHIST & WCONPROD. 2013-12-16 00:02:47 +01:00
Joakim Hove
800c4ff32e Added dimensions to TVDP* keyword family. 2013-12-15 22:38:57 +01:00
Joakim Hove
5f9f37e35e Added dimension to RSVD table; required new "quantity" Rs. 2013-12-15 22:31:54 +01:00
Joakim Hove
9de20014fc Correctly parses EQUIL with units. 2013-12-15 09:41:25 +01:00
Joakim Hove
f357a6d23f Added dimension create test in InlineKeywordTest. 2013-12-15 09:31:16 +01:00
Joakim Hove
04ae0a1798 Final applyUnits commit ... 2013-12-14 10:31:07 +01:00
Joakim Hove
5d7adb027d KeywordContainer is accessed in non-const fashion. 2013-12-14 10:30:37 +01:00
Joakim Hove
c4fbd24be6 Added getNewDimension for get-or-create semantics. 2013-12-14 10:29:59 +01:00
Joakim Hove
de16ff8da1 Added methods applyUnitsToDeck() which push units onto the deck. 2013-12-14 10:28:49 +01:00
Joakim Hove
d0bfaaece1 Added unitSystems to Deck. 2013-12-14 10:23:56 +01:00
Joakim Hove
55a77c2224 Deck->getKeyword() return modifiable DekcKeyword instance. Required to apply dimensions. 2013-12-14 10:22:55 +01:00
Joakim Hove
a485efbdd0 Added const to Dimension::equal(). 2013-12-14 10:20:57 +01:00
Joakim Hove
084fc24174 Changed parserItem::scan to return modifyable DeckItem - this is required to push dimension later. 2013-12-14 10:11:59 +01:00
Joakim Hove
e722aa0c25 Removed UnitMap from CMakeLists.txt. 2013-12-14 10:08:28 +01:00
Joakim Hove
3f536cda67 Added virtual method pushBack_dimensions() to deckitem. 2013-12-14 10:07:47 +01:00
Joakim Hove
94f9cf55a4 Removed UnitSystemMap. 2013-12-14 10:05:24 +01:00
Joakim Hove
c86b220e40 Added Dimension::equal() method. 2013-12-12 12:12:45 +01:00
Joakim Hove
8ff866266b Added missing std::endl in keyword serialisation. 2013-12-11 13:29:42 +01:00
Joakim Hove
c0e5318eb0 Added dimesnion to keyword definition. 2013-12-11 13:28:25 +01:00
Joakim Hove
870cbc6eb9 INcluding dimension in ParserKeyword::inlineNew(). 2013-12-11 13:28:10 +01:00
Joakim Hove
39ef9e3798 Calling initDimension for table collections and data keywords like PERMX. 2013-12-11 13:27:21 +01:00
Joakim Hove
7f213e4e9f Added check that dimensions are equal in ParserDoubleItem::equal() 2013-12-11 13:25:42 +01:00
Joakim Hove
ac740276f0 Added virtual function push_backDimension() and getDimension() to parserItem. 2013-12-11 13:24:27 +01:00
Joakim Hove
e1b0669f6c Pure white space. 2013-12-11 13:00:20 +01:00
Joakim Hove
5a69f64aef Added functionality to apply dimensions to ParserItem from JsonConfig. 2013-12-10 17:35:20 +01:00
Joakim Hove
dd53619e0f Added functions to query the dimensions on a ParserItem. 2013-12-10 17:34:52 +01:00
Andreas Lauser
8535ecdce3 do not force the use of static boost libraries if the ENABLE_SHARED variable is undefined
we only want to force the use of shared libraries if ENABLE_SHARED is
set to true. if it is unset, we don't care.
2013-12-10 17:26:14 +01:00
Andreas Lauser
5eb76e9062 make the module buildable using dunecontrol 2013-12-10 16:12:39 +01:00
Joakim Hove
7ea0bb8e53 Changed getDouble() -> getRawDouble throughout. 2013-12-10 14:16:54 +01:00
Joakim Hove
4fce7703db Added dimension to DeckDoubleItem and method get SIData(). 2013-12-10 13:49:15 +01:00
Joakim Hove
bb8b3ab240 Added ability to push_back() dimension strings to ParserItems; and then to query the
ParserItem -> ParserRecord -> ParserKeyword() structure whether it has dimension.
2013-12-09 21:12:27 +01:00
Joakim Hove
2a6fc5973c Removed commented out code + moved micro function from header to cpp file. 2013-12-09 20:33:38 +01:00
Joakim Hove
02a9885727 Pure indentation change. 2013-12-09 20:19:29 +01:00
Joakim Hove
69d82f5d3f Added external testdata to .gitignore 2013-12-09 20:15:09 +01:00
Joakim Hove
ff13036a58 Changed unit system to use more std::shared_ptr instead of instance variables. 2013-12-09 17:42:20 +01:00
Kristian Flikka
c74a86b3f5 Merge pull request #68 from joakim-hove/units
Units
2013-12-09 01:12:33 -08:00
Andreas Lauser
7be1af4bf3 Parser.hpp: make the guardian macro less prone to conflicts
as soon as this class is used with another project, the old macro name
basically screamed for a naming conflict and a _very_ confused user...
2013-12-09 07:55:58 +01:00
Joakim Hove
5bc27e91f2 Added basic system for units - not yet hooked into the Parser items. 2013-12-08 19:26:30 +01:00
Joakim Hove
acff0a4127 Changed "header" to <opm/parser/eclipse/xx/header>. 2013-12-08 19:17:33 +01:00
Kristian Flikka
a750fd422d Added constructor, moved ParserState struct to cpp file 2013-12-06 15:27:05 +01:00
Kristian Flikka
78337c7bda Added a ParserState struct, to encapsulate the temporary state of the parsing process 2013-12-06 14:18:05 +01:00
Kristian Flikka
30f5405961 Merge pull request #64 from joakim-hove/norne-keywords
NORNE keywords
2013-12-06 05:05:11 -08:00
Kristian Flikka
c6e5add467 Merge pull request #65 from joakim-hove/kw-size-unknown
Kw size unknown
2013-12-06 05:04:54 -08:00
Joakim Hove
1ab3b0285e Added many summary keywords for NORNE; many of the Region keywords suddenly aquired a '*'. 2013-12-05 09:35:48 +01:00
Kristian Flikka
718e35607c Removed symbolinc link to statoil set 2013-12-05 08:26:58 +01:00
Joakim Hove
24e233a53c Support for parsing keywords with unknown size. 2013-12-05 08:26:29 +01:00
Joakim Hove
9ccc70b58d Added enum for size of rawkeywords. 2013-12-04 17:21:54 +01:00
Joakim Hove
ed06ebf4d3 Added UNKNOWN enum value in ParserKeywordSize enum throughout. 2013-12-04 15:31:28 +01:00
Kristian Flikka
d007e8400f Added new UNKNOWN for keywordSizeEnum 2013-12-04 14:26:08 +01:00
Kristian Flikka
ce692159c9 Trimming right side of each read line, to avoid line ending problems.
Removed C style parsing of numbers, using boost::lexical_cast instead.
2013-12-03 10:15:22 +01:00
Joakim Hove
c5b53141ba Merge remote-tracking branch 'upstream/master' into norne-keywords 2013-12-02 15:35:34 +01:00
Joakim Hove
20d3cf85a3 Modified VAPPARS keyword. Added 'required' E300 items to WCONPROD. 2013-12-02 15:23:03 +01:00
Joakim Hove
07b1b5dd52 Added keyword NETBALAN to test dataset. 2013-12-02 14:59:40 +01:00
Joakim Hove
29d171d3f6 Added misc keywords PIMULTAB, VAPPARS and ZIPPY2 2013-12-02 14:53:30 +01:00
Joakim Hove
e361b90b2c Added some Wxxx keywords. 2013-12-02 14:52:58 +01:00
Joakim Hove
329b34fdcd Added tracer keywords with wildcard. 2013-12-02 14:52:26 +01:00
Joakim Hove
ff0c6d1055 Changed name of items. 2013-12-02 14:39:40 +01:00
Joakim Hove
3f7a193f77 Fixed o -> O case f..up 2013-12-02 14:39:13 +01:00
Joakim Hove
163e129994 Added many Wxxx keywords from Norne. 2013-12-02 13:47:33 +01:00
Joakim Hove
8b31da3dac Changed some keyword item names. 2013-12-02 13:46:58 +01:00
Kristian Flikka
fa8b9e9aa3 Merge pull request #59 from joakim-hove/wildcard-keywords
Wildcard keywords
2013-12-02 04:24:45 -08:00
Joakim Hove
f1e9230911 Merge remote-tracking branch 'upstream/master' into norne-keywords 2013-12-02 13:21:00 +01:00
Joakim Hove
7619067e7a Merge pull request #61 from flikka/shared-ptr
Removed use of boost::shared_ptr, replaced with std::shared_ptr
2013-12-02 04:19:34 -08:00
Joakim Hove
58663ceee6 Merge pull request #60 from flikka/fix-internal
Changed initialization order in Schedule. Throws exception if time map i...
2013-12-02 04:17:44 -08:00
Kristian Flikka
1d0135da5e Removed use of boost::shared_ptr, replaced with std::shared_ptr 2013-12-02 13:07:01 +01:00
Kristian Flikka
d3c89752e6 Changed initialization order in Schedule. Throws exception if time map is not created when adding group 2013-12-02 11:47:14 +01:00
Joakim Hove
6b5367854a Factored out some common code from validName() and wildCardName(). 2013-12-02 11:19:22 +01:00
Joakim Hove
4bf1adc593 Changed unsigned int -> size_t. 2013-12-02 11:10:53 +01:00
Joakim Hove
679d79dd6f Added many summary related keywords. 2013-12-02 09:31:54 +01:00
Joakim Hove
6021d03548 Removed debug message on stdout 2013-12-02 09:31:19 +01:00
Joakim Hove
5095862298 Added integration test for parsing of TVDP* keywords. 2013-12-01 09:28:45 +01:00
Joakim Hove
abd0905171 Changed parser to support parsing of keywords with wildcard like
"TVDP*". An importtant change is that we now query the parser
canParseKeyword() instead of hasKeyword().
2013-12-01 09:28:14 +01:00
Joakim Hove
390d17aa3e Changed one item name in EQLDIMS table. 2013-12-01 09:26:21 +01:00
Joakim Hove
17ee1cca38 Added simple wildcard (trailing '*') support in ParserKeyword. 2013-12-01 09:25:52 +01:00
Joakim Hove
3abdd6dcaf Merged upstream/master 2013-11-29 16:36:28 +01:00
Joakim Hove
347d890850 Changed EclipseDoctor to strict parsing 2013-11-29 16:32:03 +01:00
Joakim Hove
6dec88fc44 Added some keywords for NORNE 2013-11-29 16:32:02 +01:00
Joakim Hove
0c9de954f2 Merge pull request #57 from flikka/norne-keywords
Changed NSTACK keyword, one too many keyword, added two other
2013-11-29 07:26:33 -08:00
Kristian Flikka
6e3b1007a4 Changed NSTACK keyword, one too many keyword, added two other 2013-11-29 15:42:56 +01:00
Joakim Hove
01b77e88df Changed EclipseDoctor to strict parsing 2013-11-29 08:31:26 +01:00
Joakim Hove
2b04379038 Added some keywords for NORNE 2013-11-28 12:12:07 +01:00
Joakim Hove
e75bb7e968 Changed createTimeStep -> creationTimeStep for readability. 2013-11-27 14:21:23 +01:00
Joakim Hove
db274060e4 Will create and delete Group <-> Well relationships based on the WELSPECS keyword. 2013-11-26 12:48:20 +01:00
Joakim Hove
e8d9159a74 Added createTimeStep to Group constructor to keep track of group creation time 2013-11-25 16:31:44 +01:00
Joakim Hove
ea4f5df5ea Added createStep flag to Well constructor to be able to track well creation time. 2013-11-25 16:25:57 +01:00
Joakim Hove
26edb7735b Added groupName as a DyanmicState<std::string> property of the Well class 2013-11-25 16:06:10 +01:00
Joakim Hove
ffef620df3 Implemted Group with external WellSet class. 2013-11-22 22:35:15 +01:00
Joakim Hove
581ccb21dc Added new WellSet class - just a thin wrapper around std::map 2013-11-22 22:34:44 +01:00
Joakim Hove
5d0870581b Added wells to groups. 2013-11-22 19:10:23 +01:00
Kristian Flikka
0271e5fc03 Merge master into schedule_groups 2013-11-21 13:43:36 +01:00
Kristian Flikka
830050bd49 Merge branch 'master' of github.com:OPM/opm-parser 2013-11-21 11:38:05 +01:00
Kristian Flikka
8a825e5318 Added *.user to ignore pattern 2013-11-21 11:37:42 +01:00
Kristian Flikka
12993a9fbb Made updateTree function void, and removed an unnecessary recursive call 2013-11-21 08:55:24 +01:00
Joakim Hove
064e6d490b Merge remote-tracking branch 'upstream/master' into group-data 2013-11-20 17:39:17 +01:00
Joakim Hove
223383b692 Merge pull request #54 from joakim-hove/comment-after-keyword
Fixed a bug with comments after keywords, right-side trims away dashes a...
2013-11-20 08:18:43 -08:00
Joakim Hove
aed0d7efe9 Added productiondata to Group 2013-11-20 17:09:52 +01:00
Joakim Hove
8f352765b2 Fixed syntax errors in GCONPROD keyword 2013-11-20 17:07:09 +01:00
Kristian Flikka
e2d53f3777 Added forgotten (half-finished) test 2013-11-20 14:59:43 +01:00
Kristian Flikka
9fddf998cf Fixed a bug with comments after keywords, right-side trims away dashes and spaces from the 8 char candidate 2013-11-20 14:35:48 +01:00
Kristian Flikka
2624a86790 Merge from master, fix conflict (injector introduction) 2013-11-20 14:11:17 +01:00
Kristian Flikka
c69beedb30 Added support for re-parenting a node 2013-11-20 13:48:55 +01:00
Joakim Hove
549dfc3c5c Added GCONPROD keyword 2013-11-19 17:20:54 +01:00
Joakim Hove
3170710303 Added several enums - with namespcae container 2013-11-19 17:20:18 +01:00
Joakim Hove
f2aa193a32 Added IntegrationTest of Schedule->Groups->injection properties 2013-11-18 16:06:50 +01:00
Kristian Flikka
de095b5cf9 Added Schedule initialization and basic checks to the internal data test 2013-11-18 15:40:48 +01:00
Kristian Flikka
2648bb350b Added newlines to files 2013-11-18 15:32:14 +01:00
Kristian Flikka
6997561791 Added support for reading groups into GroupTree from WELSPECS keyword. Default root node is FIELD 2013-11-18 15:28:58 +01:00
Joakim Hove
ad43aad3c4 Changed item names in WELSPECS 2013-11-18 14:05:35 +01:00
Joakim Hove
8718027a34 Renamed some items in the GCONINJE keyword 2013-11-18 13:47:28 +01:00
Joakim Hove
176e0af7cc Added m_groups map to the Schedule container. Contains FIELD by default 2013-11-18 13:11:49 +01:00
Joakim Hove
a0acac1b4c Added miscellaneous injection properties to the Group object 2013-11-18 12:37:18 +01:00
Joakim Hove
8ba6fc2ac7 Added group class with basic properties to support GCONINJE keyword 2013-11-17 22:44:54 +01:00
Joakim Hove
a288373177 Added enum GroupInjectionControlEnum 2013-11-17 22:34:40 +01:00
Joakim Hove
3efe37dc37 Added size() property to DynamicState 2013-11-15 15:58:06 +01:00
Joakim Hove
a74375a62f Added CJSON_INCLUDE_DIR to the OPM_PARSER_INCLUDE_DIR variable 2013-11-15 15:28:03 +01:00
Joakim Hove
468a2330f0 Added PhaseEnum:{OIL, GAS, WATER} 2013-11-15 14:11:01 +01:00
Joakim Hove
e23bb8f290 Added cJSON as a not required dependency in the list of opm-parser depencies 2013-11-15 13:03:14 +01:00
Kristian Flikka
a8e3128ef8 Made Schedule handle the GRUPTREE keyword, Added testing to GroupTreeTests.cpp 2013-11-14 16:08:32 +01:00
Kristian Flikka
d3e5b198af Fixed a bug in the getNode recursion, added deep copy and print tree (debugging function) 2013-11-14 16:05:13 +01:00
Kristian Flikka
07827a1751 Fixed an error in GRUPTREE, comma in stead of dot 2013-11-14 16:03:22 +01:00
Kristian Flikka
ed57266f63 Added GroupTree that holds the root node, and supplies functions to add and find nodes 2013-11-14 11:48:37 +01:00
Kristian Flikka
fbb47a26a3 Added keyword GRUPTREE 2013-11-13 15:05:47 +01:00
Kristian Flikka
3863df9734 Added functionality to build a GroupTree (from GRUPTREE). Only the groups, not any wells in the tree. 2013-11-13 10:17:55 +01:00
Joakim Hove
8375a357db Loading WPR / GPR / IR from DeckKeywords + setting Prediction / History mode WCONINJX keywords 2013-11-12 10:02:09 +01:00
Joakim Hove
48f80595b0 Updated / added WCONxxx keywords 2013-11-11 17:12:44 +01:00
Joakim Hove
d6d7f148c5 Added methods to set injection rate, WPR, GPR and maintain injector/producer status 2013-11-11 17:12:44 +01:00
Joakim Hove
0f09746143 Added Schedule code to load Completions - with integrationTest 2013-11-11 10:55:02 +01:00
Joakim Hove
7d015772ee Added completionSet as DynamicState<> property to the Well Object 2013-11-11 10:35:57 +01:00
Joakim Hove
ad3d3adf21 ADded const qualifier to shallowCopy() method 2013-11-11 10:29:37 +01:00
Joakim Hove
bdc788d905 Whitespcae fix 2013-11-11 10:29:37 +01:00
Joakim Hove
011919ef0c Shallow copy now does new to create a heap instance; which should be wrapped by a smart pointer 2013-11-11 10:29:37 +01:00
Joakim Hove
88457973aa Added CompletionSet 2013-11-11 10:29:37 +01:00
Joakim Hove
59bc1d0ddd Renamed sameCell -> sameCoordinate 2013-11-11 10:29:36 +01:00
Joakim Hove
b9b9a984ae Created integrationTest for building a collections of Completions from COMPDAT Record & Keyword 2013-11-11 10:29:36 +01:00
Joakim Hove
69f52542eb Added Completion class for holding one single completion 2013-11-11 10:29:36 +01:00
Joakim Hove
c0aa3c0417 Removed stale commented code 2013-11-11 10:29:36 +01:00
Joakim Hove
bc6e2ee2c6 Added ScheduleEnums file - with CompletionStateEnum 2013-11-11 10:25:58 +01:00
flikka
cf0b1235a4 Merge pull request #47 from flikka/throw-on-too-long-records
Throw on too long records
2013-11-11 01:20:11 -08:00
Kristian Flikka
862d2ee302 Added support for WCONPROD, with use of predictionMode. Fixed a bug in the TSTEP reading in Schedule.cpp 2013-11-08 15:55:11 +01:00
Kristian Flikka
f0def0cdff Added dynamic field inPredictionMode to Well 2013-11-08 09:39:37 +01:00
Kristian Flikka
e02cfe3878 Refactored tests into DefaultValues test and, actual set values test 2013-11-08 09:14:57 +01:00
Kristian Flikka
006ab6d35d Added keywordName and dataFilename to RawRecord. Using these in the ParserRecord to give better error message when throwing on too long RawRecords 2013-11-07 12:32:07 +01:00
Kristian Flikka
e1b957a54e Added an item to GCONINJE, test file has also the Eclipse300 item 2013-11-07 12:31:16 +01:00
Joakim Hove
e5b921fe1c Added simple datafile parser which focuses on the Schedule section 2013-11-05 18:06:51 +01:00
Joakim Hove
df741dfc89 Changed Schedule::init() to load both time related and other keywords in the same main loop 2013-11-05 17:59:54 +01:00
Joakim Hove
ddc24927e4 Allow data to be added after the (currently) last TSTEP 2013-11-05 17:58:19 +01:00
Joakim Hove
ffc5dc3c53 1. Added well collection to Schedule object.
2. Adding wells from Welspecs and setting Oilrate from WCONHIST
2013-11-05 15:25:47 +01:00
Joakim Hove
6d30a6a7fa Added DynamicState template class 2013-11-05 12:57:25 +01:00
Joakim Hove
61b640f00f Added simple Schedule::Well object 2013-11-05 12:55:49 +01:00
Kristian Flikka
3de996acc3 Merged with upstream, fixed BXSAT conflict, joakim-hove updated 2013-11-04 10:22:35 +01:00
Joakim Hove
2ec09d4cf7 Added keywords GCONINJE/RPTRST/WPITAB/WRFTPLT/WTRACER 2013-11-03 22:30:43 +01:00
Joakim Hove
8d313d1e33 Added BOSAT and BGSAT keywords ~ BPR 2013-11-01 22:07:22 +01:00
Kristian Flikka
f4778b8e67 some ignored keywords 2013-11-01 15:17:34 +01:00
Kristian Flikka
e8a33b1e5d Merge remote-tracking branch 'joakim/spe1-missing-keywords' into spe1-integration 2013-11-01 15:11:06 +01:00
Kristian Flikka
e457acda44 New keyword files missing in the SPE1 dataset 2013-11-01 15:10:27 +01:00
Joakim Hove
5252daa460 Added keyword: ROCK 2013-11-01 12:40:03 +01:00
Joakim Hove
c949e4a47b Added keyword: PVDG 2013-11-01 12:33:10 +01:00
Joakim Hove
9d8e07a56e Added keyword: PVTO 2013-11-01 12:14:14 +01:00
Joakim Hove
502d26afef Added keyword: RPTPROPS 2013-11-01 12:11:02 +01:00
Joakim Hove
3d50023041 Added keywords SOLUTION & PRESSURE 2013-11-01 11:56:20 +01:00
Joakim Hove
133791706d Added RS / SGAS / SWAT keywords for initial distributions 2013-11-01 11:53:40 +01:00
Joakim Hove
1a8c1f2098 Added RPTSOL keyword 2013-11-01 11:49:47 +01:00
Joakim Hove
5de0d8799e Added EXCEL and RUNSUM keywords 2013-11-01 10:48:24 +01:00
Joakim Hove
5bb04cdbdd Added WGOR keyword 2013-11-01 10:45:09 +01:00
Joakim Hove
809e0b8b23 Added WBHP keyword 2013-11-01 10:44:23 +01:00
Joakim Hove
4496592f9e Added TUNING keryword 2013-11-01 10:40:25 +01:00
Joakim Hove
bc7f8d9666 Added WCONPROD keyword 2013-11-01 10:38:25 +01:00
Kristian Flikka
33b0bed250 Changed the test-program to include Deck.hpp in stead of Parser.hpp to avoid problem with cJSON.h 2013-10-30 10:27:39 +01:00
Joakim Hove
a30b5aae0d Merge pull request #40 from joakim-hove/time-map
Time map
2013-10-28 02:30:53 -07:00
Joakim Hove
b4bd6a8ed1 Added test for DATES and TSTEP keyword respectively in TimeMap 2013-10-28 10:29:43 +01:00
Joakim Hove
bd289194f3 Merged with upstream/master 2013-10-28 10:12:53 +01:00
Joakim Hove
02c410e9af Merge pull request #39 from rolk/039_src
Extract source location from cache in build tree
2013-10-28 02:06:18 -07:00
Joakim Hove
e1088eee71 Merge remote-tracking branch 'upstream/master' into test-compile-time-polymorphism 2013-10-28 10:02:21 +01:00
Joakim Hove
8b7c27fa17 Merge pull request #37 from rolk/037_virt
Change unintended compile-time polymorphism to dynamic
2013-10-28 02:01:07 -07:00
Joakim Hove
91704558a6 Added test for compile time polymorphism 2013-10-28 10:00:40 +01:00
Joakim Hove
039f6ea4cf Merge pull request #36 from joakim-hove/cmake-package-config
Cmake package config
2013-10-28 01:00:03 -07:00
Joakim Hove
4b94800073 Added some Eclipse project files to .gitignore 2013-10-25 17:34:08 +02:00
Joakim Hove
76a9cbb0b8 Updated test to check a return value 2013-10-25 17:31:48 +02:00
Joakim Hove
77cc1fd03b Added Integration test to build TimeMap from Deck 2013-10-25 17:30:16 +02:00
Joakim Hove
d511d2ee2d Added Schedule class 2013-10-25 17:28:56 +02:00
Joakim Hove
488782d8c5 TimeMap class can now be constructed from an Eclipse DECK 2013-10-25 17:26:37 +02:00
Joakim Hove
51d16d24da Added install to .gitignore 2013-10-25 16:48:57 +02:00
Joakim Hove
14b8759b7e Removed not-used ParserItemTemplate.hpp from install targets 2013-10-24 15:51:38 +02:00
Joakim Hove
1efadb4af2 Merge remote-tracking branch 'upstream/master' into time-map 2013-10-24 15:25:43 +02:00
Roland Kaufmann
e8e8d1c21e Extract source location from cache in build tree
If opm-parser_ROOT is given, this should point to a build tree. The
only way to extract the corresponding source directory is to parse
the build cache located there.
2013-10-24 09:40:36 +02:00
Joakim Hove
53ef54225a Merge remote-tracking branch 'upstream/master' 2013-10-24 09:38:57 +02:00
Joakim Hove
54d94d7634 Parser->addKeyword() will erase first; NOW the ReplaceKeyword works 2013-10-24 09:38:03 +02:00
Joakim Hove
f303c09690 Parser->addKeyword() will erase first; NOW the ReplaceKeyword works 2013-10-24 09:37:14 +02:00
Joakim Hove
29a168ee52 Merge pull request #38 from rolk/038_cmake
Allow directory root to be specified as the rest of the OPM modules
2013-10-24 00:22:33 -07:00
Joakim Hove
113d488242 Merge pull request #33 from rolk/033_bld
Support more build configurations
2013-10-24 00:01:05 -07:00
Roland Kaufmann
940f31295b Test for all the required header directories 2013-10-23 22:40:45 +02:00
Roland Kaufmann
7e9c45b765 Allow package to be specified as required
Although CMake prefers the uppercase variant variables, and the
find_package_handle_standard_args will convert to them for us, the
part that parses REQUIRED and QUIET arguments to find_package still
only uses the package name verbatim (sic).
2013-10-23 22:40:45 +02:00
Roland Kaufmann
bb4fffc227 Don't search relative directories if root is given
The PATHS that are specified is always searched, also if NO_DEFAULT_PATH
is given.
2013-10-23 22:40:45 +02:00
Roland Kaufmann
8ac1062968 Allow lowercase variables for specifying project root 2013-10-23 22:40:45 +02:00
Roland Kaufmann
b1f6e665c1 Search for headers relative to project root
The find module may be called from a CMakeLists.txt in a subdirectory,
and it would start the search from there.
2013-10-23 22:40:45 +02:00
Roland Kaufmann
f8c6bfbaf2 Change unintended compile-time polymorphism to dynamic
equals(ParserIntItem&) has a different signature than equals(ParserItem&),
thus the former method does *not* overload the latter. Virtual just means
then only means that you have created a *new* entry in the v-table. If
you call equals through a pointer/reference to the base class ParserItem,
the defined method in the derived class is not called, and we miss out the
test for the equal default value.

Instead, we should take an argument of the base type and use a dynamic
cast to the derived type. If this downcast fails, then they are not equal;
otherwise we have gotten ourselves a pointer to get the properly typed
default value.

We must use pointers instead of references; if we cast to a reference,
a bad_cast exception is thrown if the expression is not in the proper
type hierarchy.
2013-10-23 20:54:56 +02:00
Joakim Hove
dd0676126e Merge remote-tracking branch 'upstream/master' into time-map 2013-10-23 18:15:43 +02:00
Joakim Hove
f6aa9af881 Added install-headers function + opm-parser-prereqs.cmake 2013-10-23 18:12:35 +02:00
Joakim Hove
987d5c4a71 Changed Findcjson.cmake to use OPM_PARSER_ROOT as prefix - if CJSON_ROOT has not been set 2013-10-23 17:56:35 +02:00
Joakim Hove
0b3a4d64ec Merge branch 'master' into cmake-package-config 2013-10-23 17:23:46 +02:00
Joakim Hove
069cd2b8c9 Merge pull request #35 from rolk/035_cmake
Provide find module for OPM Parser library
2013-10-23 07:48:29 -07:00
Roland Kaufmann
173df1f166 Include standard CMake module to get error handling 2013-10-23 14:34:25 +02:00
Roland Kaufmann
8642f5e253 Include standard CMake module to get error handling 2013-10-23 14:32:40 +02:00
Roland Kaufmann
c698136b51 Define uppercase version of found-variable
It doesn't really matter here because "cjson" is only letters, but as
a general rule we define the uppercase variant ourselves so that CMake
doesn't use its own (bizarre) case rules, and then set the lower case
explicitly afterwards.
2013-10-23 11:37:16 +02:00
Roland Kaufmann
0cbed21e5a Define uppercase variant when testing for existence
CMake will do some uppercasing of its own (defining OPM-PARSER_FOUND)
so it works best if we specify the correct uppercase version and sets
the lowercase afterwards.
2013-10-23 11:35:19 +02:00
Roland Kaufmann
e823803474 Provide find module for OPM Parser library
Searches for headers and objects of the library as well as finding
the prerequisites (Boost and CJSON) necessary to link a program.
2013-10-23 11:12:35 +02:00
Roland Kaufmann
d537acf16f Correct documentation typo 2013-10-23 11:06:13 +02:00
Roland Kaufmann
9f8ac9a963 Set plural form of header dir. var.
Even though we only look for one directory, the convention is to always
have the full set of prerequisites in the plural form.
2013-10-23 11:05:22 +02:00
Roland Kaufmann
47934fd678 Look in lib64/ for x86_64 libs on RHEL(-like) distro 2013-10-23 10:44:35 +02:00
Roland Kaufmann
9d4cd49427 Use math library as a prerequisite (on Linux)
It is needed for pow() and floor() functions.
2013-10-23 10:22:50 +02:00
Roland Kaufmann
2b52adadf2 Search for build tree relative to this project
The CMake script is run in the source tree. We assume a certain
directory layout and that the cjson is available in a sibling
directory of this project. Thus, we can pick up a build tree without
having the library installed.
2013-10-23 10:22:50 +02:00
Roland Kaufmann
9663d187a7 Search for library in proper build directory
The library will end up in the opm/json library in a build tree; we
want to be able to point the CJSON_ROOT variable to the root of the
build tree and have it pick up the libraries from there.
2013-10-23 10:22:50 +02:00
Roland Kaufmann
1b4a71bdfb Raise error if module is required but not found
Otherwise the error will just be silently ignored.
2013-10-23 10:22:49 +02:00
Roland Kaufmann
781ef04a0e Compare size with unsigned int literal
Surprisingly, some compilers (notably GCC 4.6.3) will issue a warning
when comparing a literal which is clearly positive to an unsigned type,
when looking for a suitable instantiation in Boost. This is fixed by
making the literal unsigned too, so there's no doubt.
2013-10-22 23:39:49 +02:00
Roland Kaufmann
0a69727bf7 Add missing header for function used inline in class 2013-10-22 22:38:08 +02:00
Joakim Hove
8cc555c5ac Added basic functionality to assemble a timeMap 2013-10-22 17:11:33 +02:00
Joakim Hove
79aaa900c9 Moved enable_language( C ) to top level CMakeLists.txt 2013-10-22 14:38:16 +02:00
Joakim Hove
2a09a6b2c1 Added (empty) TimeMap class 2013-10-22 14:24:31 +02:00
Joakim Hove
803304d5f8 Deck->keywordContainer will set deckIndex of DeckKeyword when inserting: Have relaxed const properties of DeckKeyword 2013-10-22 11:42:15 +02:00
Joakim Hove
0598e9122a Added deckIndex property to deckKeyword 2013-10-22 11:40:45 +02:00
Joakim Hove
63fb47515b Relaxed internalParseLarge test 2013-10-22 10:48:39 +02:00
Joakim Hove
d5a78e3232 Added function install_headers() which will retain header prefix path 2013-10-21 17:13:37 +02:00
Joakim Hove
2e3caa9be3 Changed include path to cJSON 2013-10-21 17:12:36 +02:00
Joakim Hove
7bbeffc017 Removed CJSON check to top level CMakeLists.txt file 2013-10-21 17:12:01 +02:00
Joakim Hove
f934254f90 Removed ParserItemTemplate.hpp for install list 2013-10-21 07:03:51 +02:00
flikka
6ffa9052ef Merge pull request #32 from joakim-hove/reload-keyword
Added test for replace keyword functionality
2013-10-18 05:48:06 -07:00
Joakim Hove
1cc16de2bd Added test for replace keyword functionality 2013-10-18 10:17:48 +02:00
Kristian Flikka
65e01082d2 Added tests exposed tracking of default usage 2013-10-16 15:07:54 +02:00
Kristian Flikka
13f30cb3ef Removed template for ParserItem for decoding default/repetetive tokens for String and Double 2013-10-16 14:57:01 +02:00
Joakim Hove
0aa416675a ??? 2013-10-16 09:59:32 +02:00
Joakim Hove
2d68ebe94c Merge remote-tracking branch 'upstream/master' into track-default 2013-10-15 14:24:42 +02:00
Joakim Hove
2ac8bc55a5 Merge pull request #30 from joakim-hove/data-with-space
Data with space
2013-10-15 05:23:11 -07:00
Joakim Hove
49ac9f4568 ParserIntItem::scan() implemented with (temporary) specialized code 2013-10-14 21:30:17 +02:00
Joakim Hove
dabfdb922b Added loose function tokenCOntainsStar to StarToken.cpp 2013-10-14 21:27:20 +02:00
Joakim Hove
f38cd79839 Commented out failing DefaultApplied tests 2013-10-14 21:15:57 +02:00
Joakim Hove
9be183cf52 Minor reformat to not confuse comment end marker 2013-10-14 21:14:39 +02:00
Joakim Hove
7ec4be5b47 Including StarTokenTest 2013-10-14 21:13:24 +02:00
Joakim Hove
801e6b9fd1 Added DeckIntItem->push_backMultiple() 2013-10-14 21:12:22 +02:00
Joakim Hove
a7078ba687 Implemented StarToken specializations in cpp file 2013-10-14 21:05:10 +02:00
Joakim Hove
ccae60777d Ensure that StarToken() will throw for missing multiplier 2013-10-14 17:49:07 +02:00
Joakim Hove
aae260c47d Added class StarToken() to treat tokens with a multiplier/default 2013-10-14 16:54:43 +02:00
Joakim Hove
d1f0a9f5f7 Moved some tests around 2013-10-14 14:15:44 +02:00
Joakim Hove
48a0fa39e1 Added DexkXXXItem.push_backDefault() 2013-10-11 16:16:45 +02:00
Joakim Hove
268119e1ce Removed unneceessary includes 2013-10-11 15:38:30 +02:00
Joakim Hove
fb7dc690d1 Added defaultApplied() method to DeckItem - and FAILING test 2013-10-10 13:32:05 +02:00
Joakim Hove
d5b6e84f18 Fixed bug with string items with embedded space - using an ugly template specialization hack 2013-10-09 17:04:08 +02:00
Joakim Hove
2b118a660c Added test for parsing of stringdata with space 2013-10-09 17:01:47 +02:00
Joakim Hove
b63244228d Added Parser::dropKeyword() 2013-10-09 08:22:43 +02:00
Joakim Hove
a8543c29aa Merge branch 'master' into add-keywords 2013-10-09 08:07:37 +02:00
Joakim Hove
fa3cc810d8 Updated GRIDUNIT keyword 2013-10-09 08:07:02 +02:00
Joakim Hove
253d8bec0f Minor minor 2013-10-08 17:03:46 +02:00
Joakim Hove
6dce82c5a5 Added action: THROW_EXCEPTION 2013-10-08 16:54:41 +02:00
Joakim Hove
8e550b7f32 Added warnings in Deck for keywords of type IGNORE_WARNING and unrecognized keywords 2013-10-08 16:19:18 +02:00
Joakim Hove
f3a38425cb Added warning capabilities to the Deck 2013-10-08 16:02:16 +02:00
Joakim Hove
2345835233 Added warning capabilities to the Deck 2013-10-08 15:58:46 +02:00
Joakim Hove
997d53ea99 Merge branch 'store-file-and-line' into keyword-status 2013-10-08 15:28:21 +02:00
Joakim Hove
f0770f47fb Added filename and line nr to RawRecord 2013-10-08 15:23:45 +02:00
Joakim Hove
00c434614a Minor typo 2013-10-08 14:45:58 +02:00
Joakim Hove
f019d40dd4 Parser will inspect keyword->action; only INTERNALIZE are stored 2013-10-08 14:45:41 +02:00
Joakim Hove
b99d5d75cc Removed explicit keyword loading 2013-10-08 14:19:05 +02:00
Joakim Hove
cc21644c9e Added Json parsing of action attribute 2013-10-08 14:13:45 +02:00
Joakim Hove
e6b38c6445 Added action value to ParserKeyword constructor 2013-10-08 13:46:55 +02:00
Joakim Hove
9b96d6dfa5 Added new enum ParserKeywordActionEnum 2013-10-08 11:39:04 +02:00
Joakim Hove
8884f865b3 Updated MAPAXES 2013-10-08 10:35:52 +02:00
Joakim Hove
49a00eb3b0 Added O/ keywords for NORNE 2013-10-08 10:20:18 +02:00
Joakim Hove
819f20bc26 Added N/ keywords for NORNE 2013-10-08 10:16:05 +02:00
Joakim Hove
32ba204570 Added M/ keywords for NORNE 2013-10-08 09:51:20 +02:00
Joakim Hove
cc6d068476 Added G/ keywords required for Norne 2013-10-08 09:34:53 +02:00
Joakim Hove
d430b97533 Merge remote-tracking branch 'kristian/new-norne-keywords' into add-keywords 2013-10-07 09:28:22 +02:00
Kristian Flikka
65de3adf4a Added keyword only F words 2013-10-04 15:06:05 +02:00
Joakim Hove
5204b195c6 Added two files with test data 2013-10-04 13:38:40 +02:00
Kristian Flikka
09e28bf86c E keywords 2013-10-04 13:30:01 +02:00
Kristian Flikka
762fd0bc50 Keywords with D 2013-10-04 08:54:31 +02:00
Kristian Flikka
c87d00ec4d Added C* keywords for controlling mnemonics 2013-10-03 16:15:20 +02:00
Joakim Hove
b3cc1bee53 added missing file 2013-10-03 10:46:05 +02:00
flikka
d166c09af8 Merge pull request #28 from joakim-hove/add-keywords
Mainly added Json config for a list of keywords
2013-10-03 01:18:38 -07:00
Joakim Hove
d9b1cd983c Fixed missing item in GECON keyword 2013-10-01 18:40:52 +02:00
Joakim Hove
effa54df78 Fixed missing item in GECON keyword 2013-10-01 18:40:36 +02:00
Joakim Hove
0e37095a9f Added new keyword GECON 2013-10-01 18:31:07 +02:00
Joakim Hove
cdbbfea89b Added new keyword GECON 2013-10-01 18:30:12 +02:00
Joakim Hove
b4b4a50092 Completed tableCollection implementation - added PVTG based testing 2013-10-01 17:13:40 +02:00
Joakim Hove
97750f851f Explicit cast 0 - > (size_t) 0 2013-10-01 16:36:49 +02:00
Joakim Hove
86e19fb7a9 Minor variable name rename 2013-10-01 16:36:18 +02:00
Joakim Hove
2913b526d7 Added isTableCollection attribute on Parser and Raw keyword - mainly to parse PVTG keyword 2013-10-01 16:35:55 +02:00
Joakim Hove
94250f6e03 Added (default == false) verbose keyword for the parseFile() method 2013-10-01 16:05:01 +02:00
Joakim Hove
b938057dbd Renamed sizeType UNDEFINED -> SLASH_TERMINATED 2013-10-01 15:50:43 +02:00
Joakim Hove
5ea0b8de20 Fixed readFromRawRecord to correctly handle empty records with sizeType == ALL 2013-10-01 15:45:28 +02:00
Joakim Hove
c735bd3121 Added new keywords WCONINJE and WTEST 2013-09-30 17:43:26 +02:00
Joakim Hove
094202a7bb Merge remote-tracking branch 'upstream/master' into add-keywords 2013-09-30 12:19:07 +02:00
Joakim Hove
ff715812c0 isTerminatedRecordString() will inspect the partial input - and not the whole string 2013-09-30 11:13:23 +02:00
Joakim Hove
359aa18142 Added new keywords COMPDAT and WELOPEN 2013-09-30 10:28:26 +02:00
Joakim Hove
7a1d543449 ADded FMTIN and FMTOUT keywords 2013-09-29 19:57:32 +02:00
Joakim Hove
97f3d0d29b Added many new keywords 2013-09-29 18:45:30 +02:00
Joakim Hove
c75b443d02 Added newline 2013-09-29 17:54:15 +02:00
Joakim Hove
c8b6071f8f Added many keyword config files + createDefaultKeywordList will print 2013-09-26 22:49:27 +02:00
Joakim Hove
ff52309c72 Will print a error message and continue when meeting malformed json 2013-09-26 00:05:34 +02:00
Joakim Hove
f1916fe324 Added a list of keywords 2013-09-26 00:04:52 +02:00
Joakim Hove
6cca207a30 Added new keyword DATES 2013-09-25 22:04:56 +02:00
Joakim Hove
72aec8893b Added test for parsing PORO keyword from file 2013-09-22 18:54:14 +02:00
Joakim Hove
4088570085 Added methods const std::vector<T>& DeckKeyword::getTData() which goes all the way through DeckRecord(0)->DeckItem(0) 2013-09-22 18:53:29 +02:00
Joakim Hove
33520fbd9f Added const std::vector<T>& DeckTItem::getTData() 2013-09-22 18:51:41 +02:00
Joakim Hove
383f98b375 Changed data container in DeckXXXItem std::deque -> std::vector 2013-09-22 18:50:18 +02:00
Joakim Hove
f7aa4f09cf Added some keywords 2013-09-22 17:26:27 +02:00
Joakim Hove
d7ca4fee83 Added support for 'data' keywords ~ the PORO and PERMX keywords 2013-09-22 17:23:27 +02:00
Kristian Flikka
297c719a1c Cleanup of some remaining Logger stuff 2013-09-19 10:57:46 +02:00
flikka
0fb31be49b Merge pull request #22 from joakim-hove/cleanup
Removed Logger class
2013-09-19 01:51:04 -07:00
Joakim Hove
111d92b9e6 Removed explicit size_type : SINGLE from all config files 2013-09-18 07:27:50 +02:00
Joakim Hove
0afbcfc6e4 sizeType is default set to SINGLE - and optional in Json config 2013-09-18 07:16:09 +02:00
Joakim Hove
3992a32efc Made sizeType : SINGLE default 2013-09-17 22:27:53 +02:00
Joakim Hove
9986916ca7 Fixing parser tests 2013-09-17 17:45:42 +02:00
Kristian Flikka
687b5aed2f Formatting... 2013-09-16 15:53:56 +02:00
Kristian Flikka
7f1acfe279 Deleted unused file 2013-09-16 15:53:38 +02:00
Joakim Hove
d8dff84cb3 Removed Logger class 2013-09-16 14:36:14 +02:00
Joakim Hove
07a0a831f2 MOved the mkdir generated_source a bit - it still does not work 100% 2013-09-14 22:53:47 +02:00
Joakim Hove
1ff18bb38a Removed constructor with one global JSON config file + addedd optional flag to include all built in keywords 2013-09-14 22:39:43 +02:00
Joakim Hove
3778077422 Assemble all generated cpp source in build/generated-source 2013-09-14 22:29:56 +02:00
Joakim Hove
79a59fc629 Added indent parameter to ParserKeyword::inlineNew() to beautify generated cpp source 2013-09-14 22:14:58 +02:00
Joakim Hove
ccac972d6c Removed - not needed - ParserRecord::inlineNew 2013-09-14 21:46:16 +02:00
Joakim Hove
414feb1132 Added dynamic creation of inline default list of keywords 2013-09-14 21:44:20 +02:00
Joakim Hove
f461ba6f07 Created code to create cpp representation of complete ParserKeyword 2013-09-13 22:23:12 +02:00
Joakim Hove
c04f9728b0 Added temporaryr library target buildParser which is used for executables creating source 2013-09-13 12:50:40 +02:00
Joakim Hove
b36fa7d42c Added inlineNew() method to create ParserRecord 2013-09-13 12:34:38 +02:00
Joakim Hove
414752b78a Fixed quoting of string default arguments 2013-09-13 10:26:56 +02:00
Joakim Hove
c11fdeeb42 Added ParserRecord::equal() method 2013-09-13 10:16:00 +02:00
Joakim Hove
b10952bb4f Added typeid() based test in ParserItem::equal() 2013-09-13 10:15:42 +02:00
Joakim Hove
9bc8090c08 Added parserItem method inlineNew() which will create a cpp source representation of self 2013-09-12 23:50:16 +02:00
Joakim Hove
6d0ed41b29 Added property m_defaultSet to track if the default value has been explicitly set 2013-09-12 12:13:32 +02:00
Joakim Hove
5284b4ff89 Added equal() method for the ParserItem classes 2013-09-12 10:58:44 +02:00
Joakim Hove
0dce7e5aec Cmake if test update 2013-09-12 10:58:21 +02:00
Andreas Lauser
86db9baa6f fix the SparseVector and SparseTable unit tests
also, throw std::logic_error in the OPM_ERROR_IF macro
2013-09-06 13:27:14 +02:00
Andreas Lauser
4e7c5e8e29 convert users of MESSAGE to OPM_MESSAGE 2013-09-05 13:04:38 +02:00
Andreas Lauser
1f7458e136 convert users of the ASSERT and the ASSERT2 macros to standard assert() 2013-09-05 13:04:37 +02:00
Andreas Lauser
d4b4ccbf75 convert users of the ASSERT and the ASSERT2 macros to standard assert() 2013-09-05 13:04:37 +02:00
Andreas Lauser
b48c9df650 convert THROW to OPM_THROW 2013-09-05 13:04:37 +02:00
Andreas Lauser
b9a1d3358b convert THROW to OPM_THROW 2013-09-05 13:04:37 +02:00
Andreas Lauser
c2b8fe9caa include iostream in the files which use std::cerr or std::cout
for some of these files this is needed to make to keep it compiling
after the next patch because the new ErrorMacros.hpp file will no
longer implicitly includes <iostream>. for the remaining files it is
just good style.

While at it, the includes for most of these files have been ordered in
order of decreasing abstraction level.
2013-09-05 13:04:37 +02:00
Joakim Hove
41376779f0 Fixed handling of INCLUDE keyword 2013-09-02 10:08:37 +02:00
Joakim Hove
0580cebb33 Merged with upstream/master 2013-08-29 12:13:47 +02:00
Joakim Hove
71dd19d11c Added cmake machinery to find cjson library; and build bundled version if find_package(cjson) fails. 2013-08-29 12:05:18 +02:00
Joakim Hove
13adec09cc Added some documentation about install of share/keywords 2013-08-28 16:56:24 +02:00
Joakim Hove
de8d819c96 Added SUMMARY and SCHEDULE keywords 2013-08-28 16:51:05 +02:00
Joakim Hove
467846c20d Added install targets in json/CMakeLists.txt 2013-08-28 16:50:30 +02:00
Joakim Hove
785bc1aa1a Added sub level CMakeLists.txt + share/CMakeLists.txt to install keywords 2013-08-28 16:49:48 +02:00
Joakim Hove
85476542ae Added install target for Parser library and headers 2013-08-28 16:48:11 +02:00
Joakim Hove
52b1cbdd2e Added option INCLUDE_STATOIL_TESTS wrapping usage of the Statoil internal test data 2013-08-28 13:50:32 +02:00
Kristian Flikka
e55d52654d Added test to check that getKeyword throws when asked for non-existing keyword 2013-08-27 10:10:12 +02:00
Kristian Flikka
57ca1d0eb6 Added an else clause that throws, should check before getting 2013-08-27 10:06:55 +02:00
Kristian Flikka
1fc3857d06 Bumped boost to filesystem version 3, and changed a single usage of filename(), which has changed from string to path in filesystem v 3 2013-08-27 10:00:36 +02:00
Joakim Hove
10cd93c542 Merge pull request #11 from flikka/handle-truncated-records
Handle truncated records
2013-08-26 07:19:26 -07:00
Kristian Flikka
480d14934b Added test for a case with fully, partial and empty record body, defaults are added 2013-08-26 15:17:52 +02:00
Joakim Hove
e6f3029ee5 Added more documentation 2013-08-25 21:49:28 +02:00
Joakim Hove
1803962001 Added more documentation 2013-08-25 18:27:34 +02:00
Joakim Hove
fb2a7372c2 Removed old doc keywordtypes.txt - added new keywords.txt 2013-08-25 17:28:58 +02:00
Kristian Flikka
0e5593dc9e Removed removed extra layer of scan / scan__ 2013-08-23 15:45:20 +02:00
Kristian Flikka
cdf16c747a Removed the expectedItems concept from the scan functions 2013-08-23 15:39:08 +02:00
Kristian Flikka
64fb9a6cee Removed expectedItems param from readFromRawRecord method in ParserItem 2013-08-23 14:43:17 +02:00
Kristian Flikka
771167c02e Removed ParserXItem's scan with expected elements. Only SINGLE and ALL is now allowed 2013-08-23 14:35:47 +02:00
Kristian Flikka
375332eb99 Added check if rawRecord is empty, then default is used. Added some json data 2013-08-23 14:20:32 +02:00
Kristian Flikka
be882b6b27 Removed commented test 2013-08-23 12:18:38 +02:00
Kristian Flikka
07f1d70d79 Merge branch 'config-from-directory' of github.com:joakim-hove/opm-parser into config-from-directory 2013-08-23 12:04:10 +02:00
Kristian Flikka
1977d311ff Fixed validName method 2013-08-23 11:58:56 +02:00
Kristian Flikka
f42536531a Increased readabiliy 2013-08-23 11:53:03 +02:00
flikka
1fc65d2136 Changed indentation 2013-08-23 11:40:37 +02:00
Kristian Flikka
22e650de2e Removed commented line 2013-08-23 10:37:55 +02:00
Joakim Hove
e865382406 Added (dummy) items for RADFIN4 keyword in testdata 2013-08-23 09:33:01 +02:00
Joakim Hove
e8e9f5bb87 Completed merge 2013-08-23 09:32:44 +02:00
Joakim Hove
33b8581522 Added keywords/ directory 2013-08-23 09:31:26 +02:00
Joakim Hove
b630140316 Merged upstream/master 2013-08-23 09:30:23 +02:00
Joakim Hove
4b728a5196 Added function declaration in .hpp 2013-08-23 00:20:22 +02:00
Joakim Hove
df031007db Added items: to all inline config strings 2013-08-23 00:20:07 +02:00
Joakim Hove
19e42f4ce4 Based WCONHIST parse on KEYWORD directory 2013-08-23 00:19:09 +02:00
Joakim Hove
c05b90f4f9 Added #define symbol KEYWORD_DIRECTORY 2013-08-23 00:17:53 +02:00
Joakim Hove
7e9b817107 Reformatting 2013-08-23 00:16:50 +02:00
Joakim Hove
c01cbcfa71 Modified testdata to have correct number of items 2013-08-23 00:15:56 +02:00
Joakim Hove
d4cd119f43 Added items: to all keywords 2013-08-23 00:15:17 +02:00
Kristian Flikka
0e49eacc98 Removed setUknown from header, forgot in last commit 2013-08-22 15:55:33 +02:00
Kristian Flikka
3deab9cdf8 Changed unknown keyword concept to be a constructor only setting 2013-08-22 15:53:57 +02:00
Kristian Flikka
c218b803bc Changed language 2013-08-22 15:53:26 +02:00
Joakim Hove
e75998666d Updated ParserKeyword::validName() to disregard names with not alphanumeric (c) 2013-08-21 23:15:40 +02:00
Kristian Flikka
8b4d052f9c Added parameter to parse function to indicate if strict (exception throwing) parsing should be performed 2013-08-21 14:54:38 +02:00
Kristian Flikka
e42a7a3a97 Refactoring the main function, added submethod. Removed valgrind uninitialized error 2013-08-21 14:29:46 +02:00
Joakim Hove
dfca913462 Added method to load keyword configurations from directory 2013-08-21 12:50:21 +02:00
Joakim Hove
4202ad027d Added static method ParserKeyword::validName() 2013-08-21 12:43:15 +02:00
Kristian Flikka
3516b7d25c Updated eclipse datafile application with flagging of unrecognized keywords 2013-08-21 11:47:24 +02:00
Kristian Flikka
5f1c2722b5 Now also reading unrecognized keywords, labeled such in DeckKeyword class 2013-08-21 10:41:18 +02:00
Kristian Flikka
c7fa8a2e0a Moved testdata into integration test folder. Added build folder to gitignore 2013-08-21 09:35:38 +02:00
Kristian Flikka
002ab45f77 Removed commented test 2013-08-21 08:51:00 +02:00
Kristian Flikka
89daeea561 Renamed newRawKeyword to createRawKeyword. Minor refactoring 2013-08-21 08:44:46 +02:00
Joakim Hove
9848ef4d25 Updated integrationtest by adding summary keyword to parser 2013-08-21 07:41:06 +02:00
Kristian Flikka
b5dac4b5bd Added function to get keyword from deck based on index. Added looping over all keywords in application. This should have been several commits 2013-08-20 15:51:19 +02:00
Kristian Flikka
13ec4f2b38 Added Applications folder, and an empty eclipsedatadoctor application 2013-08-20 13:24:57 +02:00
Joakim Hove
47d29cc804 Added parser->size() and parser->loadKeywordFromFile() 2013-08-19 22:37:48 +02:00
Joakim Hove
7c30145435 Added testdata with single keyword files 2013-08-19 22:37:24 +02:00
Joakim Hove
75de3033f9 Renamed variables related keyword inferring size from other keyword 2013-08-14 08:43:54 +02:00
Joakim Hove
134e4be5cf Removed references to RawDeck 2013-08-14 08:40:07 +02:00
Joakim Hove
e2fd83e731 Removed cout msg 2013-08-14 08:22:14 +02:00
Joakim Hove
a0a20425f6 Updated tests to reflect that RawDeck has been removed 2013-08-13 14:51:33 +02:00
Joakim Hove
765ade785a Added Deck::size() 2013-08-13 14:49:58 +02:00
Joakim Hove
7786f296d8 Removed RawKeyword::lineContainsData() and RawKeyword::lineTerminatesKeyword() 2013-08-13 14:49:01 +02:00
Joakim Hove
c1ff0a6eb0 Removed RawDeckTests from CMakeLists.txt 2013-08-13 14:47:42 +02:00
Joakim Hove
d5705d131e Removed RawDeck class 2013-08-13 14:46:41 +02:00
Joakim Hove
54b8299897 Changed testdata to exclude invalid keywords 2013-08-13 14:44:59 +02:00
Joakim Hove
b0363d9659 Added keyword defintions to the parser_config 2013-08-13 14:44:38 +02:00
Joakim Hove
5ab04d4b17 Removed old Parser::parse() and replaced with new implementation 2013-08-12 14:39:11 +02:00
Joakim Hove
5c3de27077 1. Implemented support for inferring size from another kewyord - i.e EQLDIMS + EQUIL.
2. Cleaned up the main parser loop considerably; the RawKeyword instance now itself knows whether it is complete or not.
2013-08-11 12:36:16 +02:00
Joakim Hove
4e531778f6 Merge branch 'master' into parse-EQUIL 2013-08-09 09:22:53 +02:00
Joakim Hove
fe070640ad Added test for ParserDoubleItem 2013-08-09 09:12:55 +02:00
Joakim Hove
b190d74df6 Changed typo defaultInt() -> defaultDouble() 2013-08-09 08:49:14 +02:00
Joakim Hove
299eaf0a48 Minor rename 2013-08-06 16:30:48 +02:00
Joakim Hove
c864576424 Added FAILING: IntegrationTest to parse EQUIL 2013-08-06 16:28:48 +02:00
Joakim Hove
946485e2b4 Added parsing support for sizeType OTHER 2013-08-06 16:28:12 +02:00
Joakim Hove
c046fb0bde Added support for keywords getting size from other keywords ~ EQUIL style 2013-08-06 16:26:49 +02:00
Joakim Hove
5dc350c735 Changed single -> SINGLE 2013-08-06 16:25:56 +02:00
Joakim Hove
a214098db3 Added EQUIL and EQUILDIMS to parser config 2013-08-06 14:40:43 +02:00
Joakim Hove
475b607faf Can now parse file with several WCONHIST keywords 2013-08-01 12:50:42 +02:00
Joakim Hove
75954575d5 Changed Deck::getKeyword() to take an additional inde argument 2013-08-01 10:57:25 +02:00
Roland Kaufmann
e38548ebf6 Convert cubic interpolator to use Boost::UnitTest 2013-08-01 10:40:55 +02:00
Roland Kaufmann
e542fd6104 Graduate these tests to unit tests
Although they don't use Boost::UnitTest, they can at least pass, so we
can use them to detect simple compilation and runtime errors, although
we miss the semantic check.

(If you have time, please make them proper unit tests)
2013-08-01 10:40:55 +02:00
Joakim Hove
3bd3c7a306 Can parse one isolated WCONHIST keyword 2013-08-01 10:05:13 +02:00
Joakim Hove
a8d4a22894 Renamed DeckRecord::get() -> DeckRecord::getItem() 2013-08-01 09:52:49 +02:00
Joakim Hove
15c4874ee0 Added parsing support for float (i.e. double) items 2013-08-01 09:31:27 +02:00
Joakim Hove
797125463c Added class wide default double value 2013-08-01 09:31:06 +02:00
Joakim Hove
ab3fb002d6 Added WCONHIST config to parser json config object 2013-08-01 09:30:11 +02:00
Joakim Hove
6d407ba73d Added as_double() acces to JsonObject 2013-08-01 09:26:21 +02:00
Joakim Hove
8bc176d63e Added full(?) Parser configuration from json 2013-07-31 17:58:05 +02:00
Joakim Hove
8dc8781c12 Added ValueType enum 2013-07-31 16:52:24 +02:00
Joakim Hove
7b9206f675 Added Json config to ParserStringItem 2013-07-31 16:24:26 +02:00
Joakim Hove
6c582a4b82 Added JsonConfig constructor to ParserIntItem 2013-07-31 16:15:22 +02:00
Joakim Hove
20a283e5d0 Added 2String and FromString methods to the Enums 2013-07-31 15:48:15 +02:00
Joakim Hove
db60ee2b56 Removed setRecord() method ParserKeyword. Instead ParserRecord is created during ParserKeyword construction 2013-07-31 15:02:00 +02:00
Joakim Hove
b7397ca502 Parser instantiated with json config file 2013-07-31 11:30:52 +02:00
Joakim Hove
b3d9fb51a0 Parser object can be constructed with config file as input argument 2013-07-31 11:30:21 +02:00
Joakim Hove
dd5e0b7b9c Added throw() if JsonObject does not have name: 2013-07-31 11:29:16 +02:00
Joakim Hove
6ecad6b4e8 Improvements to JsonObject 2013-07-31 11:28:07 +02:00
Joakim Hove
17f440d6eb Added more json config files 2013-07-31 11:27:01 +02:00
Joakim Hove
d8a74a1d3d Typo in working directory of tests 2013-07-31 08:30:03 +02:00
Joakim Hove
e0995814f6 More JSON integration in Parser and ParserKeyword 2013-07-30 14:10:07 +02:00
Joakim Hove
269686a2f5 Extended the JsonObject() class 2013-07-30 14:08:42 +02:00
Joakim Hove
66cbb1a5cb Added Boost_LIBARIES to opm-json link target 2013-07-30 14:07:57 +02:00
Joakim Hove
c829bf0b66 Added (const char * inline_json) constructor 2013-07-30 09:21:54 +02:00
Joakim Hove
42e7333392 Added JsonObject as thin wrapper around the cJSON source 2013-07-29 21:55:57 +02:00
Joakim Hove
bf73449736 Added external files for cjson 2013-07-29 21:50:29 +02:00
Júlio Hoffimann
f4244e9382 Remove trailing whitespaces 2013-07-28 08:34:13 -03:00
Joakim Hove
8d6d9fd0a4 Merge pull request #4 from flikka/replace-RawParserKeywords
Replacing the RawParserKeywords with ParserKeyword with size
2013-06-24 06:13:15 -07:00
Kristian Flikka
31b3031c1a Removed class ParserKeywordSize, and accompanying tests. Put info into ParserKeyword. Changed tests to expose same constraints. 2013-06-24 14:08:53 +02:00
Kristian Flikka
881adc2d40 Renamed template variable from intValue to value 2013-06-24 11:15:34 +02:00
Kristian Flikka
573b39b9ba Renamed fixedSize to getFixedSize for consistency 2013-06-24 10:05:51 +02:00
Kristian Flikka
c905a8e65a Merged cmake, was the same.. 2013-06-21 15:37:56 +02:00
Kristian Flikka
951ce6ac4d Changed from using RawParserKeywords to equivalent functionality now in Parser and ParserKeywordSize 2013-06-21 15:34:45 +02:00
Kristian Flikka
50ec3e0244 Changed from using RawParserKeywords to equivalent functionality now in Parser and ParserKeywordSize 2013-06-21 15:34:06 +02:00
Kristian Flikka
01abb91959 Renamed ParserRecordSize to ParserKeywordSize, because it is more consistent with ParserItemSize 2013-06-21 10:23:24 +02:00
Kristian Flikka
be06dee465 Fixed error in CMakeLists, renaming not completed... 2013-06-21 09:51:18 +02:00
Bård Skaflestad
ba2df2d25b Disable build kluge that is no longer pertinent
The <have_boost_redef.hpp> header was introduced (commit 82369f9) as
a work-around for a particular interaction in the Autotools-based
setup of OPM-Core and the Dune core modules.  Notably, Dune's
"Enable" trick for Boost failed on some older Autoconf systems.  Now
that we're using CMake, however, that kluge is no longer needed
because we (OPM-Core) always

  #define HAVE_BOOST 1

i.e., as an explict true/false value.

Therefore, we need no longer include <have_boost_redef.hpp> .  The
header will be removed at a later time.
2013-06-20 23:14:39 +02:00
Bård Skaflestad
78bed975ed Disable build kluge that is no longer pertinent
The <have_boost_redef.hpp> header was introduced (commit 82369f9) as
a work-around for a particular interaction in the Autotools-based
setup of OPM-Core and the Dune core modules.  Notably, Dune's
"Enable" trick for Boost failed on some older Autoconf systems.  Now
that we're using CMake, however, that kluge is no longer needed
because we (OPM-Core) always

  #define HAVE_BOOST 1

i.e., as an explict true/false value.

Therefore, we need no longer include <have_boost_redef.hpp> .  The
header will be removed at a later time.
2013-06-20 23:14:39 +02:00
Kristian Flikka
d79745ce4f Changed some KEYWORD->Keyword instances, search and replace hickup 2013-06-20 15:40:45 +02:00
Kristian Flikka
f1660460dc Replaced all instances of KW with Keyword. We can afford it. 2013-06-20 15:30:37 +02:00
Kristian Flikka
abcde19716 Removed unused import 2013-06-20 14:40:12 +02:00
Kristian Flikka
5fa04e5377 Added/implemented XStringItem for Parser and Deck, with tests. Added integration test for WWCT keyword. Moved DeckItem tests into type-specific files. Removed unused file. 2013-06-20 13:56:11 +02:00
Kristian Flikka
17dde28c49 Expanded ParserTest to test int based record with 1 to many records and items 2013-06-18 14:12:00 +02:00
Kristian Flikka
de1983807d Added single parser test to test raw to deck parsing of int 2013-06-18 13:47:07 +02:00
Kristian Flikka
2cce97f115 Split parser function, to make more modular and testable. Moved integrationtests from ParserTests into Integration tests. 2013-06-18 10:28:30 +02:00
Kristian Flikka
a312360c8e Corrected the label-setting 2013-06-06 14:06:20 +02:00
Kristian Flikka
fbb468342d Finished up the last pieces for a simple BPR keyword vertical. 2013-06-04 14:32:30 +02:00
Kristian Flikka
18db675f71 Added some temporary code to make it build. WIP 2013-06-03 15:58:47 +02:00
Kristian Flikka
b43d95c5a2 Starting to wrap up from the top, added the missing DeckKW, and refactored a bit in some of the Raw classes that returned the internal structure 2013-06-03 15:54:16 +02:00
Joakim Hove
f9ae0680eb Added DeckTests.cpp 2013-06-03 10:25:26 +02:00
Joakim Hove
c596b086c8 Started integration testing 2013-05-30 10:11:12 +02:00
Kristian Flikka
082978fc2e Functionality to read from RawRecord into DeckRecord, based on ParserRecord. 2013-05-27 14:28:23 +02:00
Kristian Flikka
6e20bfda09 Added Deck class (empty), and some integration tests. WIP 2013-05-27 14:27:22 +02:00
Kristian Flikka
7998a84b81 Made the ParserIntItem's scan return DeckItem, and put a virtual scan in ParserItem. The ParserRecord now has a simple, but functioning parse method 2013-05-24 10:09:59 +02:00
Kristian Flikka
7bfe185998 Started working on the flow RawRecord->ParserRecord->DeckRecord. DeckRecord has some containers now. 2013-05-23 12:42:59 +02:00
Joakim Hove
3de7e988b7 Moved template code from header -> include file 2013-05-14 21:27:32 +02:00
Joakim Hove
d313827627 Added simple ParserRecord implementation 2013-05-14 21:26:42 +02:00
Joakim Hove
d69784c59d Added namespace Opm{} to DeckItem 2013-05-14 21:25:24 +02:00
Joakim Hove
6b338d09e7 Added skeleton implementation of DeckRecord 2013-05-14 21:23:34 +02:00
Joakim Hove
17f8ae7428 Added DeckDoubleItem implementation 2013-05-13 17:03:44 +02:00
Joakim Hove
b6c1da8c17 Rewritten scan functionality to the BaseClass and template functions 2013-05-13 16:41:09 +02:00
Joakim Hove
a1cfec5879 Changed ItemSizeEnum: SCALAR -> SINGLE 2013-05-13 16:40:25 +02:00
Joakim Hove
0524ac040f ParserIntItem can handle sizeType == ALL 2013-05-12 21:38:14 +02:00
Joakim Hove
f178691831 Added size() method to the RawRecord class 2013-05-12 21:37:22 +02:00
Joakim Hove
9e1b00ef63 The ParserIntItem::scan() function will push unused values back on the front of the RawRecord. 2013-05-10 13:56:41 +02:00
Joakim Hove
a9cd24f628 Added operator[] and method push_front() to RawDeck 2013-05-10 13:55:00 +02:00
Joakim Hove
f516cc6833 Added default value to Parser. Rewrote the ParserIntItem::scan() method to use homemade C-sscanf obscurity from h..l 2013-05-09 14:18:36 +02:00
Joakim Hove
c963c7d768 Changed to use only enum for ItemSize. FIXED -> SCALAR with value 1 2013-05-09 12:17:00 +02:00
Joakim Hove
6f86bebf78 Removed ParserItemSize class; will just use plain enum 2013-05-09 12:16:15 +02:00
Joakim Hove
7dbc4f0d2b Added size() method on DeckIntItem 2013-05-09 12:14:52 +02:00
Kristian Flikka
a874d667db Added some tests 2013-05-08 15:50:20 +02:00
Kristian Flikka
2a331e1a3a ParserIntItem's scan function now supports ITEM_FIXED parsing 2013-05-08 15:29:58 +02:00
Kristian Flikka
2088c3e96d Simple scan implementation in ParserIntItem added. DeckIntItem now support push_back 2013-05-08 14:31:20 +02:00
Kristian Flikka
2d6e6842d6 Changed ParserItem from template based to a base-inheritance based system. Corresponds to and creates DeckItem objects 2013-05-07 21:55:49 +02:00
Kristian Flikka
b36f000377 Moved tests from one base location, into per-topic folders 2013-05-06 14:46:29 +02:00
Kristian Flikka
63611f68f8 Added header file for ParserRecord class 2013-05-06 14:31:02 +02:00
Kristian Flikka
bf3be4695d Refactoring, prefixing parser setup classes with Parser. 4 space indent. 2013-05-06 12:13:49 +02:00
Joakim Hove
105012ad7e More reorg/merge fixes 2013-05-06 09:54:31 +02:00
Joakim Hove
40e6a35332 ??? 2013-05-06 09:48:29 +02:00
Joakim Hove
60abc2c397 Merged in documentation 2013-05-06 09:44:00 +02:00
Kristian Flikka
f7fdbe96fa Added some comments and documentation 2013-05-05 23:02:26 +02:00
Joakim Hove
be7e6e0cad Added basic ParserRecordItem class 2013-05-03 17:06:53 +02:00
Joakim Hove
558a705b52 Added CMakeLists.txt to Logger/ directory 2013-05-03 15:33:07 +02:00
Joakim Hove
182dd0483b Made separate source lists for RawDeck sources and Parser sources 2013-05-03 15:30:52 +02:00
Joakim Hove
19fa7ab1d1 Moved Logger implementation to subdirectory Logger/ 2013-05-03 15:11:28 +02:00
Andreas Lauser
78bcdf09bf make config.h the first header to be included in any compile unit
this is required for consistency amongst the compile units which are
linked into the same library and seems to be forgotten quite
frequently.
2013-04-10 12:56:14 +02:00
Kristian Flikka
86fe804655 Downgraded BOOST requirement to 1.36, not tested, but should be ok. Tested on 1.45 2013-04-10 10:41:14 +02:00
Kristian Flikka
8b32658e54 Refactoring, more consts, etc. Comments from Joakim 2013-04-08 14:32:17 +02:00
Kristian Flikka
477551c8d7 Split Statoil dependent test in separate file 2013-04-08 10:47:25 +02:00
Kristian Flikka
f89b8362ff Changed to tabsize 2 after discussion with Joakim. I vote for real tabs. 2013-04-08 10:36:14 +02:00
Kristian Flikka
1868615a4a Moved some consts for the Raw classes to a separate file, characters and sizes 2013-04-08 10:31:54 +02:00
Kristian Flikka
76b8df09ad Changed the logic in raw-reading, only adding keyword after it is finished. Simplified special casing for INCLUDE. Reset keyword pointer when keyword finished 2013-04-08 10:07:24 +02:00
Kristian Flikka
c76767b9aa Adding recursive reading of Include files. Fixed a performance bug when appending strings to a record 2013-04-05 16:14:43 +02:00
Kristian Flikka
b200d74c9d Rename variable 2013-04-04 15:57:21 +02:00
Kristian Flikka
041ac87337 Removed unused variable 2013-04-04 15:54:55 +02:00
Kristian Flikka
e6d9007dfb Changed static logger to be initalized and closed explicitly, destructor did not quite do the trick 2013-04-04 15:09:38 +02:00
Kristian Flikka
0d5ce81809 Merge pull request 2 from joakim-hove/master - Added code to add Keywords to parser class 2013-04-04 14:17:12 +02:00
Kristian Flikka
aa8cd7b4ca Added a thin container for knowledge about keywords with fixed number of records. Changed some getter methods to return reference 2013-04-04 13:30:50 +02:00
Kristian Flikka
8a0892b388 Rename file-checking-function 2013-04-04 09:58:54 +02:00
Kristian Flikka
3adb09cb5a Review updates: Keyword can have numbers, comment lines can start with space, data can start at pos 0 on line, must explicitly have end-of-keyword control 2013-04-04 09:56:00 +02:00
Kristian Flikka
14772d8c86 File containing questions or observations that needs to be discussed 2013-04-04 09:25:43 +02:00
Joakim Hove
f3e14aa76b Added Keywords map to Parser 2013-04-03 11:38:06 +02:00
Joakim Hove
57c6946c07 Merged data/ -> RawDeck/ source code reorganisation 2013-04-03 09:27:55 +02:00
Kristian Flikka
d24f487d18 Refactoring for readability. Added a couple of unit tests 2013-04-02 15:42:19 +02:00
Joakim Hove
295b1929ab Added subdirectory Parser/ + added ParserRecordSize as element in ParserKW 2013-04-02 15:19:32 +02:00
Kristian Flikka
2be8700e66 Moved data to RawDeck, added gmon.out to gitignore 2013-04-02 13:39:41 +02:00
Joakim Hove
36053bd91c Added symlink to test-data 2013-04-02 13:05:24 +02:00
Joakim Hove
e860091f30 Merged changes from Kristian 2013-04-02 12:58:12 +02:00
Kristian Flikka
8432334106 Changed working directory of tests to be project source dir. Added symlink to statoil data in testdata folder 2013-04-02 12:34:44 +02:00
Kristian Flikka
7002348e8e Added splitting of record into items in a string vector. Added tests. Must enhance readability of this splitting code before review 2013-03-26 14:31:05 +01:00
Kristian Flikka
4f65285828 Changed more heap and smart pointers 2013-03-26 10:27:48 +01:00
Kristian Flikka
2f7cc609d0 Changed to heap allocation and boost smart pointers 2013-03-26 10:00:06 +01:00
Kristian Flikka
990648e95b More tests, changed logging, and adding record 2013-03-25 17:17:09 +01:00
Atgeirr Flø Rasmussen
b6db8534d8 Whitespace cleanup. 2013-03-23 23:46:05 +01:00
Atgeirr Flø Rasmussen
12ccebf396 Whitespace cleanup. 2013-03-23 23:46:05 +01:00
Atgeirr Flø Rasmussen
4e9e2f0438 Added test for class UniformTableLinear.
Moved from opm-porsol.
2013-03-22 21:39:32 +01:00
Atgeirr Flø Rasmussen
dd8041890f Added test for class NonuniformTableLinear.
Formerly lived in opm-porsol.
2013-03-22 16:24:52 +01:00
Atgeirr Flø Rasmussen
f0fb3756f6 Simplified class NonuniformTableLinear.
Removed the policy control for what to do beyond the domain.
Old behaviour was constant extrapolation, current behaviour
is linear extrapolation. The possibility to choose was never
needed and has beem removed.
2013-03-22 16:22:29 +01:00
Kristian Flikka
ed0d04fcc6 Added classes for holding the raw deck structure 2013-03-22 15:35:40 +01:00
Atgeirr Flø Rasmussen
09253686e8 Finished unification of linear interpolation.
The functions of linInt.hpp are now used everywhere, but:
 - linInt.hpp -> linearInterpolation.hpp (better name)
 - linearInterpolationExtrap() -> linearInterpolation() (extrapolate by default)
2013-03-22 15:33:07 +01:00
Atgeirr Flø Rasmussen
751ba70eff Make all codes use the same linear interpolation routines. 2013-03-22 15:28:16 +01:00
Joakim Hove
05cea003be Added ParserKW skeleton and ParserConst.hpp 2013-03-21 15:37:40 +01:00
Atgeirr Flø Rasmussen
b1c554fe32 Moved MonotCubicInterpolator to Opm namespace.
Also minor doc fix.
2013-03-21 14:57:36 +01:00
Kristian Flikka
e7d1444ad4 Added tests and Record class. Moved BOOST_ROOT into CMakeLists file 2013-03-21 13:18:52 +01:00
Kristian Flikka
aa43fef0e9 Renamed keyword data class, and added test file 2013-03-21 09:27:57 +01:00
Kristian Flikka
9ad7f77107 Changed KeywordRawData to a one-per-keyword object, moved into data folder 2013-03-21 09:02:40 +01:00
Kristian Flikka
ce0990e5ca Fixed a bug when keywords had trailing spaces. Now trimming right side of string. 2013-03-20 17:35:03 +01:00
Kristian Flikka
488d7655f7 Moved files into structure similar to opm-core. Added KeywordRawData class to store 0th pass objects 2013-03-20 16:29:51 +01:00
Kristian Flikka
7d6bba588b Removing gtest, retry... Updated logger with levels 2013-03-18 16:38:14 +01:00
Kristian Flikka
db646dc844 Removed gtest, using boost testing. Throws invalid_argument exception if file not found 2013-03-18 15:59:57 +01:00
Kristian Flikka
e4fad8ea83 Added logging class. Changed bin output, added test DATA file, with 18 keywords. 2013-03-18 13:40:14 +01:00
Kristian Flikka
1fab5c2e1c Added more line by line checks, very much WIP. Failing unit test. 2013-03-15 16:09:24 +01:00
Kristian Flikka
307c09602f Added documentation folder and file that will describe the different types and concepts in the Eclipse data file 2013-03-15 14:50:35 +01:00
Kristian Flikka
ec46baab12 Test file changed 2013-03-14 16:06:14 +01:00
Kristian Flikka
45acb83d32 Refactoring casing and naming 2013-03-14 16:05:35 +01:00
Kristian Flikka
b403377abc Reading some lines 2013-03-14 15:53:36 +01:00
Kristian Flikka
c1696f0ed1 Introduced boost and a failing test 2013-03-14 14:54:53 +01:00
Kristian Flikka
49d5b50cec Added CmakeLists on root level, moving old root content out in this file 2013-03-14 12:38:05 +01:00
Kristian Flikka
bcc234c945 Initial deck and parser classes, and google test with google test src 2013-03-14 12:07:33 +01:00
Joakim Hove
91615ca969 Create README.md 2013-03-14 08:42:45 +01:00
Roland Kaufmann
a23267a62f Restructure tests directory to unit tests
Every program that relies on manual inspection has been moved to a new
(hopefully short-lived) directory called not-unit/; every remaining
file has been given the prefix test_ to indicate that this is the
executable test to be run.
2013-02-11 22:38:01 +01:00
Atgeirr Flø Rasmussen
81ab7b4f2f Changed OpenRS->OPM in copyright notices and #include guards. 2013-01-29 13:17:01 +01:00
Atgeirr Flø Rasmussen
731f984c87 Formatting fixes. 2012-09-03 15:07:03 +02:00
Halvor Møll Nilsen
2a21bf4a75 Introduced posibility to change number of sample points for pvt.
Did change the PVTW calculation so derivatives are exact.
Extended the test functions for pvt and relperm
2012-08-31 17:01:07 +02:00
Atgeirr Flø Rasmussen
a4946eed7a Added class SinglePvtDead, add parameter 'props_use_spline' to simulators.
Recall that the class that used to be called SinglePvtDead has
been renamed to SinglePvtDeadSpline. If 'props_use_spline' is true,
that class is used (this is the default), which makes a monotone
spline that is uniformly, densely sampled. The new class simply
uses linear interpolation in the input tables.
2012-08-27 16:48:21 +02:00
Halvor Møll Nilsen
68c4db8472 Changed to extrapolation outside tables for pormult. Added facetags to the grid structure. Changed default fluid to Linear. 2012-08-14 09:36:19 +02:00
Alf Birger Rustad
c8fea44f4c Merge pull request #4 from bska/master
Document everal low-level OPM-Core interfaces related to mimetic solvers
2012-07-05 07:02:03 -07:00
Andreas Lauser
aa38fc81ff opm-core: make it work nicely with clang 2012-07-05 12:42:49 +02:00
Andreas Lauser
5bc6f36341 opm-core: make it work nicely with clang 2012-07-02 18:52:30 +02:00
Bård Skaflestad
4c22b3dc5f Reference <ErrorMacros.hpp> from canonical location. 2012-06-22 19:35:19 +02:00
Bård Skaflestad
759aea3673 Reference class header from canonical position. 2012-06-22 19:32:18 +02:00
Atgeirr Flø Rasmussen
acdd798225 Comment and indent bracketZero(). 2012-06-04 16:54:41 +02:00
Atgeirr Flø Rasmussen
b43a2e86f5 Whitespace cleanup. 2012-05-25 10:12:54 +02:00
Atgeirr Flø Rasmussen
0d21e0215d Implemented more error policies for regula falsi solver. Use in reorder code.
We have switched to WarnAndContinueOnError instead of ThrowOnError,
to reduce the annoyance factor when suffering from a minor error in
a long simulation run.
2012-05-24 10:21:38 +02:00
Atgeirr Flø Rasmussen
e1cf6f6d12 Policy-based design enables custom error handling in scalar regula falsi. 2012-05-24 10:02:14 +02:00
Atgeirr Flø Rasmussen
292772b140 Reinject UniformTableLinear into utils subnamespace for backwards compatibility. 2012-04-19 14:11:00 +02:00
Atgeirr Flø Rasmussen
ca046f9827 Moved UniformTableLinear and related func out of subnamespace utils. 2012-04-19 11:45:52 +02:00
Atgeirr Flø Rasmussen
a1bf64df3a Added new variant of Regula Falsi solver, which checks an initial guess first. 2012-04-02 13:23:14 +02:00
Atgeirr Flø Rasmussen
19bcab6b36 Suppressed multiple warnings. 2012-03-28 16:39:04 +02:00
Xavier Raynaud
4ffda4a95e Added general linear lapack solver. Updated test for band matrices. 2012-03-23 15:44:32 +01:00
Xavier Raynaud
b7bd56ab6a Added solver for band matrix and a test example. 2012-03-15 16:17:16 +01:00
Xavier Raynaud
0112d0e6c8 decrease tolerance for x1-x0 in falsi. 2012-03-15 16:16:31 +01:00
Xavier Raynaud
bf8f48ddb6 Compute the derivative directly (not using epsilon parameter). 2012-03-15 16:15:32 +01:00
Bård Skaflestad
f9b6a024ee Untabify. 2012-03-01 15:22:26 +01:00
Atgeirr Flø Rasmussen
d2404762fe Added interface and test for lapack tridiagonal solver. 2012-03-01 14:36:10 +01:00
Xavier Raynaud
3e6639968e Decrease tolerance requirement for x1-x0 in modifiedregularFalsi 2012-02-24 17:17:05 +01:00
Atgeirr Flø Rasmussen
aca88ec911 Re-added necessary include files. 2012-02-09 23:14:50 +01:00
Jostein R. Natvig
e54e818639 Remove unnecessary include statement. 2012-01-25 10:44:37 +01:00
Bjørn Spjelkavik
7df33130bc Changed namespace Dune -> namespace Opm. 2012-01-19 13:50:57 +01:00
Bjørn Spjelkavik
43a542ed02 Changed namespace Dune -> namespace Opm. 2012-01-19 13:50:57 +01:00
Atgeirr Flø Rasmussen
6c8917af6b Merged in some black-oil fluid tests. 2011-12-22 10:40:14 +01:00
Atgeirr Flø Rasmussen
65b3515933 Merged in some black-oil fluid tests. 2011-12-22 10:40:14 +01:00
Atgeirr Flø Rasmussen
9e719b6605 Now fluid cpp files compile successfully. 2011-12-21 13:29:15 +01:00
Atgeirr Flø Rasmussen
f475a14f9d Now fluid cpp files compile successfully. 2011-12-21 13:29:15 +01:00
Atgeirr Flø Rasmussen
26254df8c5 Merged in UniformTableLinear.hpp and friends. 2011-12-21 13:22:57 +01:00
Atgeirr Flø Rasmussen
161a6769bf Merged in UniformTableLinear.hpp and friends. 2011-12-21 13:22:57 +01:00
Atgeirr Flø Rasmussen
c3c30cfd25 Merged in blackoil fluid subsystem. 2011-12-21 13:06:23 +01:00
Atgeirr Flø Rasmussen
8a0f862874 Merged in blackoil fluid subsystem. 2011-12-21 13:06:23 +01:00
Atgeirr Flø Rasmussen
5a6b40351f Imported items from dune-cornerpoint/dune/common. 2011-12-19 11:34:50 +01:00
Atgeirr Flø Rasmussen
1bab67b57c Imported items from dune-cornerpoint/dune/common. 2011-12-19 11:34:50 +01:00
Atgeirr Flø Rasmussen
9682593496 Moved code from opmcore/ to opm/core/ 2011-12-12 11:13:54 +01:00
Bård Skaflestad
cac836ff50 Import OPMTransport into OPM core libraries. 2011-12-08 13:35:54 +01:00
Bård Skaflestad
1d087efc3c Import OPMTransport into OPM core libraries. 2011-12-08 13:35:54 +01:00
Bård Skaflestad
6a21bc7ecf Move opmpressure/src into core library directory structure. 2011-12-08 12:52:57 +01:00
Bård Skaflestad
8c3e8b47a2 Merge OPMPressure into OPM core library. Unmodified. 2011-12-08 12:25:56 +01:00
Bård Skaflestad
3fc5221458 Merge OPMPressure into OPM core library. Unmodified. 2011-12-08 12:25:56 +01:00
Bård Skaflestad
63656013cc Delete trailing whitespace. 2011-10-18 20:41:13 +02:00
Halvor M. Nilsen
b42bd08154 Move 'common' directory into 'dune'. 2011-10-07 10:54:25 +02:00
Atgeirr Flø Rasmussen
afc31d3b08 Added output operator for easy dumping of tables. 2011-02-01 12:40:05 +01:00
Atgeirr Flø Rasmussen
5b7052eb11 A large number of additions to start testing compressible tpfa-solver. 2010-11-22 15:00:26 +01:00
Atgeirr Flø Rasmussen
fc06ce232d Added lots of stuff originally from the samcode repository. 2010-11-12 13:18:27 +01:00
Atgeirr Flø Rasmussen
7bae4aa4d3 Implemented FluidMatrixInteractionBlackoil init(), kr() and a test prog. 2010-11-10 13:31:32 +01:00
Atgeirr Flø Rasmussen
b8b9581ae4 Implemented FluidMatrixInteractionBlackoil init(), kr() and a test prog. 2010-11-10 13:31:32 +01:00
Atgeirr Flø Rasmussen
09e234c68c Created a new utility class, UniformTableLinear. 2010-11-08 14:12:10 +01:00
Jostein R. Natvig
7459c5988e Add bare-bones explicit mobility-weighted upwind solver for two-phase
incompressible flow.
2010-11-02 09:10:36 +01:00
Bård Skaflestad
146402119b Move source files to sub-dir 'src'. 2010-10-29 15:08:09 +02:00
Bård Skaflestad
dc58bb8ffc Declare DGETRF and DGETRS for compressible support. 2010-10-28 10:51:59 +02:00
Bård Skaflestad
933fb4229f Use canonical include guards.
Suggested by atgeirr.  Template:

   OPM_<FILENAME>_HEADER_INCLUDED
2010-10-13 18:35:15 +02:00
Atgeirr Flø Rasmussen
e0b68dded2 Made all C headers includeable from C++. 2010-10-12 07:44:02 +00:00
Atgeirr Flø Rasmussen
877ede21eb Added copyright block to all source code files. 2010-10-12 07:25:46 +00:00
Bård Skaflestad
0bf40b266d Add local definition of MAT_SIZE_T, contingent upon preprocessor
symbol 'MATLAB_MEX_FILE' that is automatically defined by MATLAB's
  MEX function.

  Add declarations for factorisation, lin-sys solution, and matrix
  inversion for (symmetric) positive definite full matrices in full
  and packed formats.  Will be used in the coarse-system assembly
  process.
2010-09-02 16:25:29 +00:00
Bård Skaflestad
8dc4adbe51 Move solvers/common solvers/euler and solvers/mimetic to dune-porsol 2010-08-23 09:23:09 +00:00
Bård Skaflestad
2bced196f6 Move solvers/common solvers/euler and solvers/mimetic to dune-porsol 2010-08-23 09:23:09 +00:00
Bård Skaflestad
f4e9a3ed2f Initial implementation of hybrid system infrastructure. Actual
assembly and system solve not currently implemented.  This is untested.
2010-08-03 17:01:33 +00:00
Bård Skaflestad
4cb92b1e16 The LAPACK and BLAS operators do not modify their (char*)
parameters.  Declare these operators as taking (const char*)s.
2010-07-03 11:07:56 +00:00
Bård Skaflestad
a586f5040f Appease the -pedantic -ansi gods. 2010-06-29 15:32:03 +00:00
Bård Skaflestad
11f6693970 For kicks and giggles, add an (untested) C+BLAS/LAPACK
implementation of the 'ip_simple' mimetic inner product.

  Suggested by: jrn.
2010-06-28 22:47:55 +00:00
Bård Skaflestad
0e306b45ef For kicks and giggles, add an (untested) C+BLAS/LAPACK
implementation of the 'ip_simple' mimetic inner product.

  Suggested by: jrn.
2010-06-28 22:47:55 +00:00
Jostein R. Natvig
a3c93003ee Initial checkin of cornerpoint processing code.
Current status
--------------
Given vectors ZCORN, COORD and ACTNUM as well as the Cartesian
dimensions these vectors implicitly refer to, the code is
currently capable of

 * Identify unique points along each pillar
 * Assign point numbers for each point specified in ZCORN
 * Compute face topology, i.e., the corners that define the geometry
   of the faces as well as the cells that are connected through the face.
 * Identify and compute intesections that occur in the processing of
   face topology.

What remains is

 * Handle the face geometry of boundary faces. (simple)
 * Compute point coordinates of the final point list.
 * Put all pieces together in a tidy manner.
2009-06-11 07:33:50 +00:00
1035 changed files with 105799 additions and 2635 deletions

25
.gitignore vendored
View File

@@ -44,3 +44,28 @@ Testing/
# Build directory in source.
build/
gmon.out
log.log
build
install
.cproject
.project
/testdata/statoil
.idea
/Debug/
# Compiled Dynamic libraries
*.so
*.dylib
# Compiled Static libraries
*.lai
*.la
*.a
# Mac OS X debug info
*.dSYM
# emacs directory setting:
.dir-locals.el

View File

@@ -1,39 +0,0 @@
language: cpp
compiler:
- gcc
addons:
apt:
sources:
- boost-latest
- ubuntu-toolchain-r-test
- george-edison55-precise-backports
packages:
- libboost1.55-all-dev
- gcc-4.8
- g++-4.8
- gfortran-4.8
- liblapack-dev
- libgmp3-dev
- libsuitesparse-dev
- libeigen3-dev
- bc
- cmake
- cmake-data
env:
global:
- TRAVIS_CI=1
before_script:
- export CXX="g++-4.8" CC="gcc-4.8" FC="gfortran-4.8"
- cd ..
- opm-common/travis/build-prereqs.sh
- opm-common/travis/clone-opm.sh opm-common
script: opm-common/travis/build-and-test.sh opm-common

View File

@@ -1,9 +1,23 @@
project(opm-common C CXX)
cmake_minimum_required (VERSION 2.8)
option(SIBLING_SEARCH "Search for other modules in sibling directories?" ON)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
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)
# Output implies input
if(ENABLE_ECL_OUTPUT)
set(ENABLE_ECL_INPUT ON)
endif()
# And likewise, no input means no output
if(NOT ENABLE_ECL_INPUT)
set(ENABLE_ECL_OUTPUT OFF)
endif()
# not the same location as most of the other projects; this hook overrides
macro (dir_hook)
endmacro (dir_hook)
@@ -14,12 +28,25 @@ set(OPM_PROJECT_EXTRA_CODE_INSTALLED "set(OPM_MACROS_ROOT ${CMAKE_INSTALL_PREFI
set(OPM_PROJECT_EXTRA_CODE_INTREE "set(OPM_MACROS_ROOT ${OPM_MACROS_ROOT})
list(APPEND CMAKE_MODULE_PATH \${OPM_MACROS_ROOT}/cmake/Modules)")
if(ENABLE_ECL_OUTPUT)
set(OPM_PROJECT_EXTRA_CODE_INSTALLED "${OPM_PROJECT_EXTRA_CODE_INSTALLED}
set(COMPARE_SUMMARY_COMMAND ${CMAKE_INSTALL_PREFIX}/bin${${name}_VER_DIR}/compareSummary)
set(COMPARE_ECL_COMMAND ${CMAKE_INSTALL_PREFIX}/bin${${name}_VER_DIR}/compareECL)")
set(OPM_PROJECT_EXTRA_CODE_INTREE "${OPM_PROJECT_EXTRA_CODE_INTREE}
set(COMPARE_SUMMARY_COMMAND ${PROJECT_BINARY_DIR}/bin/compareSummary)
set(COMPARE_ECL_COMMAND ${PROJECT_BINARY_DIR}/bin/compareECL)")
endif()
# project information is in dune.module. Read this file and set variables.
# we cannot generate dune.module since it is read by dunecontrol before
# the build starts, so it makes sense to keep the data there then.
include (OpmInit)
# Look for the opm-tests repository; if found the variable
# HAVE_OPM_TESTS will be set to true.
include(Findopm-tests)
# list of prerequisites for this particular project; this is in a
# separate file (in cmake/Modules sub-directory) because it is shared
# with the find module
@@ -30,12 +57,50 @@ include (${project}-prereqs)
include (CMakeLists_files.cmake)
macro (config_hook)
if(ENABLE_ECL_INPUT)
if(NOT cjson_FOUND)
list(APPEND EXTRA_INCLUDES ${PROJECT_SOURCE_DIR}/external/cjson)
endif()
# For this project
include_directories(${EXTRA_INCLUDES} ${PROJECT_BINARY_DIR}/include)
# For downstreams
list(APPEND EXTRA_INCLUDES ${PROJECT_BINARY_DIR}/include)
set(OPM_PROJECT_EXTRA_CODE_INTREE "${OPM_PROJECT_EXTRA_CODE_INTREE}
list(APPEND opm-common_INCLUDE_DIRS ${EXTRA_INCLUDES})")
if(ENABLE_ECL_INPUT)
set(OPM_PROJECT_EXTRA_CODE_INTREE "${OPM_PROJECT_EXTRA_CODE_INTREE}
set(HAVE_ECL_INPUT 1)")
set(OPM_PROJECT_EXTRA_CODE_INSTALLED "${OPM_PROJECT_EXTRA_CODE_INSTALLED}
set(HAVE_ECL_INPUT 1)")
endif()
if(ENABLE_ECL_OUTPUT)
set(OPM_PROJECT_EXTRA_CODE_INTREE "${OPM_PROJECT_EXTRA_CODE_INTREE}
set(HAVE_ECL_OUTPUT 1)")
set(OPM_PROJECT_EXTRA_CODE_INSTALLED "${OPM_PROJECT_EXTRA_CODE_INSTALLED}
set(HAVE_ECL_OUTPUT 1)")
endif()
# Configure boost targets for old cmake
include(cmake/Modules/BoostTargets.cmake)
if (HAVE_DYNAMIC_BOOST_TEST)
set_target_properties(Boost::unit_test_framework PROPERTIES INTERFACE_COMPILE_DEFINITIONS BOOST_TEST_DYN_LINK=1)
endif()
endif()
endmacro (config_hook)
macro (prereqs_hook)
endmacro (prereqs_hook)
macro (sources_hook)
if(ENABLE_ECL_INPUT)
# Keyword generation
include(GenerateKeywords.cmake)
# Append generated sources
list(APPEND opm-common_SOURCES ${PROJECT_BINARY_DIR}/ParserKeywords.cpp)
endif()
endmacro (sources_hook)
macro (fortran_hook)
@@ -45,8 +110,17 @@ macro (files_hook)
endmacro (files_hook)
macro (tests_hook)
if(ENABLE_ECL_INPUT)
include(ExtraTests.cmake)
endif()
endmacro (tests_hook)
macro (install_hook)
install(DIRECTORY ${PROJECT_BINARY_DIR}/include/
DESTINATION include
PATTERN *.hpp)
endmacro (install_hook)
# all setup common to the OPM library modules is done here
include (OpmLibMain)

View File

@@ -21,42 +21,269 @@
# the library needs it.
list (APPEND MAIN_SOURCE_FILES
opm/common/data/SimulationDataContainer.cpp
opm/common/OpmLog/CounterLog.cpp
opm/common/OpmLog/EclipsePRTLog.cpp
opm/common/OpmLog/LogBackend.cpp
opm/common/OpmLog/Logger.cpp
opm/common/OpmLog/LogUtil.cpp
opm/common/OpmLog/OpmLog.cpp
opm/common/OpmLog/StreamLog.cpp
opm/common/OpmLog/TimerLog.cpp
src/opm/common/data/SimulationDataContainer.cpp
src/opm/common/OpmLog/CounterLog.cpp
src/opm/common/OpmLog/EclipsePRTLog.cpp
src/opm/common/OpmLog/LogBackend.cpp
src/opm/common/OpmLog/Logger.cpp
src/opm/common/OpmLog/LogUtil.cpp
src/opm/common/OpmLog/OpmLog.cpp
src/opm/common/OpmLog/StreamLog.cpp
src/opm/common/OpmLog/TimerLog.cpp
src/opm/common/utility/numeric/MonotCubicInterpolator.cpp
src/opm/common/utility/parameters/Parameter.cpp
src/opm/common/utility/parameters/ParameterGroup.cpp
src/opm/common/utility/parameters/ParameterTools.cpp
src/opm/common/utility/numeric/calculateCellVol.cpp
)
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/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/EclipseState/AquiferCT.cpp
src/opm/parser/eclipse/EclipseState/Aquancon.cpp
src/opm/parser/eclipse/EclipseState/checkDeck.cpp
src/opm/parser/eclipse/EclipseState/Eclipse3DProperties.cpp
src/opm/parser/eclipse/EclipseState/EclipseConfig.cpp
src/opm/parser/eclipse/EclipseState/EclipseState.cpp
src/opm/parser/eclipse/EclipseState/EndpointScaling.cpp
src/opm/parser/eclipse/EclipseState/Grid/Box.cpp
src/opm/parser/eclipse/EclipseState/Grid/BoxManager.cpp
src/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp
src/opm/parser/eclipse/EclipseState/Grid/FaceDir.cpp
src/opm/parser/eclipse/EclipseState/Grid/FaultCollection.cpp
src/opm/parser/eclipse/EclipseState/Grid/Fault.cpp
src/opm/parser/eclipse/EclipseState/Grid/FaultFace.cpp
src/opm/parser/eclipse/EclipseState/Grid/GridDims.cpp
src/opm/parser/eclipse/EclipseState/Grid/GridProperties.cpp
src/opm/parser/eclipse/EclipseState/Grid/GridProperty.cpp
src/opm/parser/eclipse/EclipseState/Grid/MULTREGTScanner.cpp
src/opm/parser/eclipse/EclipseState/Grid/NNC.cpp
src/opm/parser/eclipse/EclipseState/Grid/PinchMode.cpp
src/opm/parser/eclipse/EclipseState/Grid/SatfuncPropertyInitializers.cpp
src/opm/parser/eclipse/EclipseState/Grid/setKeywordBox.cpp
src/opm/parser/eclipse/EclipseState/Grid/TransMult.cpp
src/opm/parser/eclipse/EclipseState/InitConfig/Equil.cpp
src/opm/parser/eclipse/EclipseState/InitConfig/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/Completion.cpp
src/opm/parser/eclipse/EclipseState/Schedule/CompletionSet.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/MessageLimits.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MSW/Compsegs.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MSW/SegmentSet.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MSW/updatingCompletionsWithSegments.cpp
src/opm/parser/eclipse/EclipseState/Schedule/OilVaporizationProperties.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp
src/opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.cpp
src/opm/parser/eclipse/EclipseState/Schedule/TimeMap.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Tuning.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well.cpp
src/opm/parser/eclipse/EclipseState/Schedule/WellEconProductionLimits.cpp
src/opm/parser/eclipse/EclipseState/Schedule/WellInjectionProperties.cpp
src/opm/parser/eclipse/EclipseState/Schedule/WellPolymerProperties.cpp
src/opm/parser/eclipse/EclipseState/Schedule/WellProductionProperties.cpp
src/opm/parser/eclipse/EclipseState/SimulationConfig/SimulationConfig.cpp
src/opm/parser/eclipse/EclipseState/SimulationConfig/ThresholdPressure.cpp
src/opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.cpp
src/opm/parser/eclipse/EclipseState/Tables/ColumnSchema.cpp
src/opm/parser/eclipse/EclipseState/Tables/JFunc.cpp
src/opm/parser/eclipse/EclipseState/Tables/PvtxTable.cpp
src/opm/parser/eclipse/EclipseState/Tables/SimpleTable.cpp
src/opm/parser/eclipse/EclipseState/Tables/TableColumn.cpp
src/opm/parser/eclipse/EclipseState/Tables/TableContainer.cpp
src/opm/parser/eclipse/EclipseState/Tables/TableIndex.cpp
src/opm/parser/eclipse/EclipseState/Tables/TableManager.cpp
src/opm/parser/eclipse/EclipseState/Tables/TableSchema.cpp
src/opm/parser/eclipse/EclipseState/Tables/Tables.cpp
src/opm/parser/eclipse/EclipseState/UDQConfig.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQExpression.cpp
src/opm/parser/eclipse/EclipseState/Schedule/VFPInjTable.cpp
src/opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.cpp
src/opm/parser/eclipse/Parser/ParseContext.cpp
src/opm/parser/eclipse/Parser/Parser.cpp
src/opm/parser/eclipse/Parser/ParserEnums.cpp
src/opm/parser/eclipse/Parser/ParserItem.cpp
src/opm/parser/eclipse/Parser/ParserKeyword.cpp
src/opm/parser/eclipse/Parser/ParserRecord.cpp
src/opm/parser/eclipse/RawDeck/RawKeyword.cpp
src/opm/parser/eclipse/RawDeck/RawRecord.cpp
src/opm/parser/eclipse/RawDeck/StarToken.cpp
src/opm/parser/eclipse/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(NOT cjson_FOUND)
list(APPEND MAIN_SOURCE_FILES external/cjson/cJSON.c)
endif()
endif()
if(ENABLE_ECL_OUTPUT)
list( APPEND MAIN_SOURCE_FILES
src/opm/test_util/summaryIntegrationTest.cpp
src/opm/test_util/summaryRegressionTest.cpp
src/opm/test_util/summaryComparator.cpp
src/opm/test_util/EclFilesComparator.cpp
src/opm/output/eclipse/EclipseGridInspector.cpp
src/opm/output/eclipse/EclipseIO.cpp
src/opm/output/eclipse/LinearisedOutputTable.cpp
src/opm/output/eclipse/RestartIO.cpp
src/opm/output/eclipse/Summary.cpp
src/opm/output/eclipse/Tables.cpp
src/opm/output/eclipse/RegionCache.cpp
src/opm/output/data/Solution.cpp
)
endif()
list (APPEND TEST_SOURCE_FILES
tests/test_SimulationDataContainer.cpp
tests/test_calculateCellVol.cpp
tests/test_cmp.cpp
tests/test_OpmLog.cpp
tests/test_cubic.cpp
tests/test_messagelimiter.cpp
tests/test_nonuniformtablelinear.cpp
tests/test_OpmLog.cpp
tests/test_param.cpp
tests/test_SimulationDataContainer.cpp
tests/test_sparsevector.cpp
tests/test_uniformtablelinear.cpp
)
if(ENABLE_ECL_INPUT)
list(APPEND TEST_SOURCE_FILES
tests/parser/ADDREGTests.cpp
tests/parser/AquiferCTTests.cpp
tests/parser/AqudimsTests.cpp
tests/parser/AquanconTests.cpp
tests/parser/BoxTests.cpp
tests/parser/ColumnSchemaTests.cpp
tests/parser/CompletionTests.cpp
tests/parser/COMPSEGUnits.cpp
tests/parser/CopyRegTests.cpp
tests/parser/DeckTests.cpp
tests/parser/DynamicStateTests.cpp
tests/parser/DynamicVectorTests.cpp
tests/parser/Eclipse3DPropertiesTests.cpp
tests/parser/EclipseGridTests.cpp
tests/parser/EqualRegTests.cpp
tests/parser/EventTests.cpp
tests/parser/FaceDirTests.cpp
tests/parser/FaultTests.cpp
tests/parser/FunctionalTests.cpp
tests/parser/GeomodifierTests.cpp
tests/parser/GridPropertyTests.cpp
tests/parser/GroupTests.cpp
tests/parser/InitConfigTest.cpp
tests/parser/IOConfigTests.cpp
tests/parser/MessageLimitTests.cpp
tests/parser/MultiRegTests.cpp
tests/parser/MultisegmentWellTests.cpp
tests/parser/MULTREGTScannerTests.cpp
tests/parser/OrderedMapTests.cpp
tests/parser/ParseContextTests.cpp
tests/parser/PORVTests.cpp
tests/parser/RawKeywordTests.cpp
tests/parser/RestartConfigTests.cpp
tests/parser/RunspecTests.cpp
tests/parser/SatfuncPropertyInitializersTests.cpp
tests/parser/ScheduleTests.cpp
tests/parser/SectionTests.cpp
tests/parser/SimpleTableTests.cpp
tests/parser/SimulationConfigTest.cpp
tests/parser/StarTokenTests.cpp
tests/parser/StringTests.cpp
tests/parser/SummaryConfigTests.cpp
tests/parser/TabdimsTests.cpp
tests/parser/TableColumnTests.cpp
tests/parser/TableContainerTests.cpp
tests/parser/TableManagerTests.cpp
tests/parser/TableSchemaTests.cpp
tests/parser/ThresholdPressureTest.cpp
tests/parser/TimeMapTest.cpp
tests/parser/TransMultTests.cpp
tests/parser/TuningTests.cpp
tests/parser/UDQTests.cpp
tests/parser/UnitTests.cpp
tests/parser/ValueTests.cpp
tests/parser/WellSolventTests.cpp
tests/parser/WellTests.cpp)
endif()
if(ENABLE_ECL_OUTPUT)
list (APPEND TEST_SOURCE_FILES
tests/test_compareSummary.cpp
tests/test_EclFilesComparator.cpp
tests/test_EclipseIO.cpp
tests/test_LinearisedOutputTable.cpp
tests/test_Restart.cpp
tests/test_RFT.cpp
tests/test_Summary.cpp
tests/test_Tables.cpp
tests/test_Wells.cpp
tests/test_writenumwells.cpp
tests/test_Solution.cpp
tests/test_regionCache.cpp
)
endif()
list (APPEND TEST_DATA_FILES
)
tests/testdata.param
)
if(ENABLE_ECL_OUTPUT)
list (APPEND TEST_DATA_FILES
tests/FIRST_SIM.DATA
tests/summary_deck.DATA
tests/group_group.DATA
tests/testblackoilstate3.DATA
tests/testrft.DATA
tests/table_deck.DATA
tests/summary_deck_non_constant_porosity.DATA
tests/SUMMARY_EFF_FAC.DATA
)
endif()
list (APPEND EXAMPLE_SOURCE_FILES
)
)
if(ENABLE_ECL_INPUT)
list (APPEND EXAMPLE_SOURCE_FILES
examples/opmi.cpp
)
endif()
if(ENABLE_ECL_OUTPUT)
list(APPEND EXAMPLE_SOURCE_FILES
examples/test_util/compareECL.cpp
examples/test_util/compareSummary.cpp
)
endif()
# programs listed here will not only be compiled, but also marked for
# installation
list (APPEND PROGRAM_SOURCE_FILES
)
)
if(ENABLE_ECL_INPUT)
list (APPEND PROGRAM_SOURCE_FILES
examples/opmi.cpp
)
endif()
if(ENABLE_ECL_OUTPUT)
list(APPEND PROGRAM_SOURCE_FILES
examples/test_util/compareECL.cpp
examples/test_util/compareSummary.cpp
)
endif()
list( APPEND PUBLIC_HEADER_FILES
opm/common/ErrorMacros.hpp
opm/common/Exceptions.hpp
opm/common/ResetLocale.hpp
opm/common/Unused.hpp
opm/common/Valgrind.hpp
opm/common/data/SimulationDataContainer.hpp
opm/common/OpmLog/CounterLog.hpp
opm/common/OpmLog/EclipsePRTLog.hpp
@@ -68,6 +295,193 @@ list( APPEND PUBLIC_HEADER_FILES
opm/common/OpmLog/OpmLog.hpp
opm/common/OpmLog/StreamLog.hpp
opm/common/OpmLog/TimerLog.hpp
opm/common/util/numeric/cmp.hpp
opm/common/utility/numeric/cmp.hpp
opm/common/utility/platform_dependent/disable_warnings.h
opm/common/utility/platform_dependent/reenable_warnings.h)
opm/common/utility/platform_dependent/reenable_warnings.h
opm/common/utility/numeric/blas_lapack.h
opm/common/utility/numeric/buildUniformMonotoneTable.hpp
opm/common/utility/numeric/linearInterpolation.hpp
opm/common/utility/numeric/MonotCubicInterpolator.hpp
opm/common/utility/numeric/NonuniformTableLinear.hpp
opm/common/utility/numeric/RootFinders.hpp
opm/common/utility/numeric/SparseVector.hpp
opm/common/utility/numeric/UniformTableLinear.hpp
opm/common/utility/parameters/ParameterGroup.hpp
opm/common/utility/parameters/ParameterGroup_impl.hpp
opm/common/utility/parameters/Parameter.hpp
opm/common/utility/parameters/ParameterMapItem.hpp
opm/common/utility/parameters/ParameterRequirement.hpp
opm/common/utility/parameters/ParameterStrings.hpp
opm/common/utility/parameters/ParameterTools.hpp
opm/common/utility/numeric/calculateCellVol.hpp
)
if(ENABLE_ECL_INPUT)
list(APPEND PUBLIC_HEADER_FILES
opm/json/JsonObject.hpp
opm/parser/eclipse/Utility/Stringview.hpp
opm/parser/eclipse/Utility/Functional.hpp
opm/parser/eclipse/Utility/Typetools.hpp
opm/parser/eclipse/Utility/String.hpp
opm/parser/eclipse/Generator/KeywordGenerator.hpp
opm/parser/eclipse/Generator/KeywordLoader.hpp
opm/parser/eclipse/Units/UnitSystem.hpp
opm/parser/eclipse/Units/Units.hpp
opm/parser/eclipse/Units/Dimension.hpp
opm/parser/eclipse/Parser/ParserItem.hpp
opm/parser/eclipse/Parser/Parser.hpp
opm/parser/eclipse/Parser/ParserRecord.hpp
opm/parser/eclipse/Parser/ParserKeyword.hpp
opm/parser/eclipse/Parser/InputErrorAction.hpp
opm/parser/eclipse/Parser/ParserEnums.hpp
opm/parser/eclipse/Parser/ParseContext.hpp
opm/parser/eclipse/Parser/ParserConst.hpp
opm/parser/eclipse/EclipseState/InitConfig/InitConfig.hpp
opm/parser/eclipse/EclipseState/InitConfig/Equil.hpp
opm/parser/eclipse/EclipseState/Util/Value.hpp
opm/parser/eclipse/EclipseState/Util/OrderedMap.hpp
opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp
opm/parser/eclipse/EclipseState/Grid/GridDims.hpp
opm/parser/eclipse/EclipseState/Grid/TransMult.hpp
opm/parser/eclipse/EclipseState/Grid/GridProperties.hpp
opm/parser/eclipse/EclipseState/Grid/PinchMode.hpp
opm/parser/eclipse/EclipseState/Grid/MULTREGTScanner.hpp
opm/parser/eclipse/EclipseState/Grid/FaultCollection.hpp
opm/parser/eclipse/EclipseState/Grid/SatfuncPropertyInitializers.hpp
opm/parser/eclipse/EclipseState/Grid/Fault.hpp
opm/parser/eclipse/EclipseState/Grid/Box.hpp
opm/parser/eclipse/EclipseState/Grid/GridProperty.hpp
opm/parser/eclipse/EclipseState/Grid/FaultFace.hpp
opm/parser/eclipse/EclipseState/Grid/NNC.hpp
opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp
opm/parser/eclipse/EclipseState/Grid/BoxManager.hpp
opm/parser/eclipse/EclipseState/Grid/FaceDir.hpp
opm/parser/eclipse/EclipseState/Grid/MinpvMode.hpp
opm/parser/eclipse/EclipseState/Eclipse3DProperties.hpp
opm/parser/eclipse/EclipseState/EndpointScaling.hpp
opm/parser/eclipse/EclipseState/Tables/SimpleTable.hpp
opm/parser/eclipse/EclipseState/Tables/PdvdTable.hpp
opm/parser/eclipse/EclipseState/Tables/TlpmixpaTable.hpp
opm/parser/eclipse/EclipseState/Tables/PvdgTable.hpp
opm/parser/eclipse/EclipseState/Tables/MsfnTable.hpp
opm/parser/eclipse/EclipseState/Tables/GasvisctTable.hpp
opm/parser/eclipse/EclipseState/Tables/Regdims.hpp
opm/parser/eclipse/EclipseState/Tables/Eqldims.hpp
opm/parser/eclipse/EclipseState/Tables/SpecrockTable.hpp
opm/parser/eclipse/EclipseState/Tables/PlydhflfTable.hpp
opm/parser/eclipse/EclipseState/Tables/PlyshlogTable.hpp
opm/parser/eclipse/EclipseState/Tables/RsvdTable.hpp
opm/parser/eclipse/EclipseState/Tables/SpecheatTable.hpp
opm/parser/eclipse/EclipseState/Tables/SgcwmisTable.hpp
opm/parser/eclipse/EclipseState/Tables/Sof2Table.hpp
opm/parser/eclipse/EclipseState/Tables/TableManager.hpp
opm/parser/eclipse/EclipseState/Tables/SwfnTable.hpp
opm/parser/eclipse/EclipseState/Tables/EnptvdTable.hpp
opm/parser/eclipse/EclipseState/Tables/SwofTable.hpp
opm/parser/eclipse/EclipseState/Tables/FlatTable.hpp
opm/parser/eclipse/EclipseState/Tables/Aqudims.hpp
opm/parser/eclipse/EclipseState/Tables/JFunc.hpp
opm/parser/eclipse/EclipseState/Tables/TableIndex.hpp
opm/parser/eclipse/EclipseState/Tables/PvtgTable.hpp
opm/parser/eclipse/EclipseState/Tables/Tabdims.hpp
opm/parser/eclipse/EclipseState/Tables/TableSchema.hpp
opm/parser/eclipse/EclipseState/Tables/RocktabTable.hpp
opm/parser/eclipse/EclipseState/Tables/EnkrvdTable.hpp
opm/parser/eclipse/EclipseState/Tables/PlyrockTable.hpp
opm/parser/eclipse/EclipseState/Tables/PvtxTable.hpp
opm/parser/eclipse/EclipseState/Tables/WatvisctTable.hpp
opm/parser/eclipse/EclipseState/Tables/TableEnums.hpp
opm/parser/eclipse/EclipseState/Tables/RvvdTable.hpp
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/PbvdTable.hpp
opm/parser/eclipse/EclipseState/Tables/SorwmisTable.hpp
opm/parser/eclipse/EclipseState/Tables/PlymaxTable.hpp
opm/parser/eclipse/EclipseState/Tables/PlyviscTable.hpp
opm/parser/eclipse/EclipseState/Tables/TableColumn.hpp
opm/parser/eclipse/EclipseState/Tables/SsfnTable.hpp
opm/parser/eclipse/EclipseState/Tables/PvdoTable.hpp
opm/parser/eclipse/EclipseState/Tables/OilvisctTable.hpp
opm/parser/eclipse/EclipseState/Tables/SgfnTable.hpp
opm/parser/eclipse/EclipseState/Tables/MiscTable.hpp
opm/parser/eclipse/EclipseState/Tables/SgwfnTable.hpp
opm/parser/eclipse/EclipseState/Tables/PvdsTable.hpp
opm/parser/eclipse/EclipseState/Tables/PvtoTable.hpp
opm/parser/eclipse/EclipseState/Tables/ColumnSchema.hpp
opm/parser/eclipse/EclipseState/Tables/PmiscTable.hpp
opm/parser/eclipse/EclipseState/Tables/RtempvdTable.hpp
opm/parser/eclipse/EclipseState/Tables/SlgofTable.hpp
opm/parser/eclipse/EclipseState/Tables/ImptvdTable.hpp
opm/parser/eclipse/EclipseState/Tables/ImkrvdTable.hpp
opm/parser/eclipse/EclipseState/Tables/Sof3Table.hpp
opm/parser/eclipse/EclipseState/Tables/SgofTable.hpp
opm/parser/eclipse/EclipseState/EclipseState.hpp
opm/parser/eclipse/EclipseState/EclipseConfig.hpp
opm/parser/eclipse/EclipseState/Aquancon.hpp
opm/parser/eclipse/EclipseState/AquiferCT.hpp
opm/parser/eclipse/EclipseState/Schedule/TimeMap.hpp
opm/parser/eclipse/EclipseState/Schedule/VFPInjTable.hpp
opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.hpp
opm/parser/eclipse/EclipseState/Schedule/Well.hpp
opm/parser/eclipse/EclipseState/Schedule/WellInjectionProperties.hpp
opm/parser/eclipse/EclipseState/Schedule/DynamicVector.hpp
opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp
opm/parser/eclipse/EclipseState/Schedule/WellEconProductionLimits.hpp
opm/parser/eclipse/EclipseState/Schedule/WellPolymerProperties.hpp
opm/parser/eclipse/EclipseState/Schedule/Tuning.hpp
opm/parser/eclipse/EclipseState/Schedule/Group.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/Completion.hpp
opm/parser/eclipse/EclipseState/Schedule/DynamicState.hpp
opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.hpp
opm/parser/eclipse/EclipseState/Schedule/MSW/SegmentSet.hpp
opm/parser/eclipse/EclipseState/Schedule/MSW/updatingCompletionsWithSegments.hpp
opm/parser/eclipse/EclipseState/Schedule/WellProductionProperties.hpp
opm/parser/eclipse/EclipseState/Schedule/CompletionSet.hpp
opm/parser/eclipse/EclipseState/SimulationConfig/ThresholdPressure.hpp
opm/parser/eclipse/EclipseState/SimulationConfig/SimulationConfig.hpp
opm/parser/eclipse/EclipseState/IOConfig/RestartConfig.hpp
opm/parser/eclipse/EclipseState/IOConfig/IOConfig.hpp
opm/parser/eclipse/EclipseState/checkDeck.hpp
opm/parser/eclipse/EclipseState/Runspec.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ.hpp
opm/parser/eclipse/EclipseState/UDQConfig.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQExpression.hpp
opm/parser/eclipse/Deck/DeckItem.hpp
opm/parser/eclipse/Deck/Deck.hpp
opm/parser/eclipse/Deck/Section.hpp
opm/parser/eclipse/Deck/DeckOutput.hpp
opm/parser/eclipse/Deck/DeckKeyword.hpp
opm/parser/eclipse/Deck/DeckRecord.hpp
opm/parser/eclipse/RawDeck/StarToken.hpp
opm/parser/eclipse/RawDeck/RawEnums.hpp
opm/parser/eclipse/RawDeck/RawRecord.hpp
opm/parser/eclipse/RawDeck/RawKeyword.hpp
opm/parser/eclipse/RawDeck/RawConsts.hpp)
endif()
if(ENABLE_ECL_OUTPUT)
list(APPEND PUBLIC_HEADER_FILES
opm/output/OutputWriter.hpp
opm/output/data/Wells.hpp
opm/output/data/Cells.hpp
opm/test_util/summaryRegressionTest.hpp
opm/test_util/summaryIntegrationTest.hpp
opm/test_util/summaryComparator.hpp
opm/output/eclipse/EclipseGridInspector.hpp
opm/output/eclipse/EclipseIOUtil.hpp
opm/output/eclipse/EclipseIO.hpp
opm/output/eclipse/LinearisedOutputTable.hpp
opm/output/eclipse/RestartIO.hpp
opm/output/eclipse/RestartValue.hpp
opm/output/eclipse/Summary.hpp
opm/output/eclipse/Tables.hpp
opm/output/eclipse/RegionCache.hpp
opm/output/data/Solution.hpp
opm/test_util/EclFilesComparator.hpp
opm/test_util/summaryRegressionTest.hpp
opm/test_util/summaryComparator.hpp)
endif()

108
ExtraTests.cmake Normal file
View File

@@ -0,0 +1,108 @@
# Libs to link tests against
set(TEST_LIBS opmcommon ecl Boost::unit_test_framework)
set(EXTRA_TESTS)
# Generated source, needs to be here
opm_add_test(InlineKeywordTest
EXE_NAME inlinekw
SOURCES ${PROJECT_BINARY_DIR}/inlinekw.cpp
LIBRARIES ${TEST_LIBS})
list(APPEND EXTRA_TESTS inlinekw)
# Extra compile definitions and extra parameters
include(cmake/Modules/CheckCaseSensitiveFileSystem.cmake)
set(_testdir ${PROJECT_SOURCE_DIR}/tests/parser/data)
opm_add_test(LoaderTest
SOURCES tests/parser/KeywordLoaderTests.cpp
src/opm/parser/eclipse/Generator/KeywordLoader.cpp
LIBRARIES ${TEST_LIBS}
TEST_ARGS ${_testdir}/parser/keyword-generator/)
list(APPEND EXTRA_TESTS LoaderTest)
opm_add_test(ParserTests
SOURCES tests/parser/ParserTests.cpp
LIBRARIES ${TEST_LIBS}
TEST_ARGS ${_testdir}/)
list(APPEND EXTRA_TESTS ParserTests)
opm_add_test(ParserIncludeTests
SOURCES tests/parser/ParserIncludeTests.cpp
LIBRARIES ${TEST_LIBS}
TEST_ARGS ${_testdir}/parser/)
target_compile_definitions(ParserIncludeTests PRIVATE
-DHAVE_CASE_SENSITIVE_FILESYSTEM=${HAVE_CASE_SENSITIVE_FILESYSTEM})
list(APPEND EXTRA_TESTS ParserIncludeTests)
opm_add_test(PvtxTableTests
SOURCES tests/parser/PvtxTableTests.cpp
LIBRARIES ${TEST_LIBS}
TEST_ARGS ${_testdir}/integration_tests/)
list(APPEND EXTRA_TESTS PvtxTableTests)
opm_add_test(EclipseStateTests
SOURCES tests/parser/EclipseStateTests.cpp
LIBRARIES ${TEST_LIBS}
TEST_ARGS ${_testdir}/integration_tests/)
list(APPEND EXTRA_TESTS EclipseStateTests)
foreach (test BoxTest
CheckDeckValidity
CompletionsFromDeck
EclipseGridCreateFromDeck
IncludeTest
IntegrationTests
IOConfigIntegrationTest
NNCTests
ParseKEYWORD
ParseDATAWithDefault
Polymer
ResinsightTest
ScheduleCreateFromDeck
TransMultIntegrationTests)
opm_add_test(${test}
SOURCES tests/parser/integration/${test}.cpp
LIBRARIES ${TEST_LIBS}
TEST_ARGS ${_testdir}/integration_tests/)
list(APPEND EXTRA_TESTS ${test})
endforeach ()
# opm-tests dependent tests
if(HAVE_OPM_TESTS)
opm_add_test(parse_write ONLY_COMPILE
SOURCES tests/parser/integration/parse_write.cpp
LIBRARIES ${TEST_LIBS})
list(APPEND EXTRA_TESTS parse_write)
foreach (deck ${OPM_TESTS_ROOT}/norne/NORNE_ATW2013.DATA
${OPM_TESTS_ROOT}/spe1_solvent/SPE1CASE2_SOLVENT.DATA
${OPM_TESTS_ROOT}/spe9_solvent/SPE9_CP_SOLVENT_CO2.DATA
${OPM_TESTS_ROOT}/spe5/SPE5CASE1.DATA
${OPM_TESTS_ROOT}/polymer_simple2D/2D_THREEPHASE_POLY_HETER.DATA
${OPM_TESTS_ROOT}/spe1/SPE1CASE1.DATA
${OPM_TESTS_ROOT}/spe1/SPE1CASE2.DATA
${OPM_TESTS_ROOT}/spe1/SPE1CASE2_FAMII.DATA
${OPM_TESTS_ROOT}/spe1/SPE1CASE2_SLGOF.DATA
${OPM_TESTS_ROOT}/spe3/SPE3CASE1.DATA
${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.DATA
${OPM_TESTS_ROOT}/spe10model1/SPE10_MODEL1.DATA
${OPM_TESTS_ROOT}/spe10model2/SPE10_MODEL2.DATA
${OPM_TESTS_ROOT}/msw_2d_h/2D_H__.DATA )
get_filename_component(test_name ${deck} NAME_WE)
opm_add_test(${test_name} NO_COMPILE
EXE_NAME parse_write
TEST_ARGS ${deck})
endforeach()
set_property(TEST NORNE_ATW2013
PROPERTY ENVIRONMENT "OPM_ERRORS_IGNORE=PARSE_RANDOM_SLASH")
endif()
# JSON tests
opm_add_test(jsonTests
SOURCES tests/json/jsonTests.cpp
LIBRARIES ${TEST_LIBS}
TEST_ARGS ${PROJECT_SOURCE_DIR}/tests/json/example1.json)
list(APPEND EXTRA_TESTS jsonTests)

48
GenerateKeywords.cmake Normal file
View File

@@ -0,0 +1,48 @@
set(genkw_SOURCES src/opm/json/JsonObject.cpp
src/opm/parser/eclipse/Parser/createDefaultKeywordList.cpp
src/opm/parser/eclipse/Deck/Deck.cpp
src/opm/parser/eclipse/Deck/DeckItem.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/Generator/KeywordGenerator.cpp
src/opm/parser/eclipse/Generator/KeywordLoader.cpp
src/opm/parser/eclipse/Parser/ParseContext.cpp
src/opm/parser/eclipse/Parser/ParserEnums.cpp
src/opm/parser/eclipse/Parser/ParserItem.cpp
src/opm/parser/eclipse/Parser/ParserKeyword.cpp
src/opm/parser/eclipse/Parser/ParserRecord.cpp
src/opm/parser/eclipse/RawDeck/RawKeyword.cpp
src/opm/parser/eclipse/RawDeck/RawRecord.cpp
src/opm/parser/eclipse/RawDeck/StarToken.cpp
src/opm/parser/eclipse/Units/Dimension.cpp
src/opm/parser/eclipse/Units/UnitSystem.cpp
src/opm/parser/eclipse/Utility/Stringview.cpp
src/opm/common/OpmLog/OpmLog.cpp
src/opm/common/OpmLog/Logger.cpp
src/opm/common/OpmLog/StreamLog.cpp
src/opm/common/OpmLog/LogBackend.cpp
src/opm/common/OpmLog/LogUtil.cpp
)
if(NOT cjson_FOUND)
list(APPEND genkw_SOURCES external/cjson/cJSON.c)
endif()
add_executable(genkw ${genkw_SOURCES})
target_link_libraries(genkw ecl Boost::regex Boost::filesystem Boost::system)
# Generate keyword list
include(src/opm/parser/eclipse/share/keywords/keyword_list.cmake)
string(REGEX REPLACE "([^;]+)" "${PROJECT_SOURCE_DIR}/src/opm/parser/eclipse/share/keywords/\\1" keyword_files "${keywords}")
configure_file(src/opm/parser/eclipse/keyword_list.argv.in keyword_list.argv)
# Generate keyword source
add_custom_command(
OUTPUT ${PROJECT_BINARY_DIR}/ParserKeywords.cpp ${PROJECT_BINARY_DIR}/inlinekw.cpp
COMMAND genkw keyword_list.argv
${PROJECT_BINARY_DIR}/ParserKeywords.cpp
${PROJECT_BINARY_DIR}/include/
opm/parser/eclipse/Parser/ParserKeywords
${PROJECT_BINARY_DIR}/inlinekw.cpp
DEPENDS genkw ${keyword_files} src/opm/parser/eclipse/share/keywords/keyword_list.cmake
)

View File

@@ -1,3 +1,3 @@
# opm-common ![alt text](https://travis-ci.org/OPM/opm-common.svg?branch=master "TravisCI Build Status")
# opm-common
Contains common components used throughout all of OPM,
in particular CMake modules for the build system.

45
changelog.md Normal file
View File

@@ -0,0 +1,45 @@
# Changelog
A short month-by-month synopsis of change highlights. Most bugfixes won't make
it in here, only the bigger features and interface changes.
# 2016.12
* ZCORN adjustments improved, considers cell-cell relations
* Slightly more robust compilation - won't crash if locales are broken
* Accessing the PVTW table has a richer interface
* FAULTS face direction accepts X+, I+, Y+, J+, Z+ and K+
* WELOPEN can be controlled with completion numbers (last two parameters)
* COMPLUMP is now supported
* Don't crash on aquifer keywords
* GMWSET and FMWSET are expanded properly
* Don't crash on DEBUG
* Read support for COORDSYS, GRUPRIG, LGR, PRORDER, TRACERS, TUNINGDP,
WDFACCOR, WEFAC, and WORKLIM, no longer crashes.
* RS and RV support.
* Support for DENSITY, PVTW, and ROCK tables
* JFUNC is understood and exposed
# 2016.11
* A new class, Runspec, for the RUNSPEC section, has been introduced
* Nodes in the FIELD group are no longer added to the Summary config
* WCONHIST only adds phases present in the deck
* cJSON can now be installed externally
* DeckItem and ParserItem internals refactored
* Build time reduced by only giving necessary source files to the json compiler
* Support for OPERATE, WSEGITER and GCONPROD
* Internal shared_ptrs removed from Schedule and children; interface updated
* Schedule is now copyable with regular C++ copy semantics - no internal refs
* Well head I/J is now time step dependent
* Well reference depth is time step dependent
* Some ZCORN issues fixed
* gas/oil and oil/gas ratio unit fixed for FIELD units
# 2016.10
* Significant improvements in overall parser performance
* shared_ptr has largely been removed from all public interfaces
* JFUNC keyword can be parsed
* Boolean conversions are explicit
* The Units.hpp header from core is moved here, replacing ConversionFactors
* The ConstPtr and Ptr shared pointer aliases are removed
* UnitSystem, Eclipse3DProperties, and OilVaporizationProperties are default
constructible

View File

@@ -0,0 +1,49 @@
# make targets for boost if find module did not do the job
if(NOT TARGET Boost::system)
add_library(Boost::system UNKNOWN IMPORTED)
set_target_properties(Boost::system PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}"
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}"
IMPORTED_LOCATION "${Boost_SYSTEM_LIBRARY}"
IMPORTED_LOCATION_DEBUG "${Boost_SYSTEM_LIBRARY_DEBUG}"
IMPORTED_LOCATION_RELEASE "${Boost_SYSTEM_LIBRARY_RELEASE}"
)
endif()
if(NOT TARGET Boost::filesystem)
add_library(Boost::filesystem UNKNOWN IMPORTED)
set_target_properties(Boost::filesystem PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}"
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}"
INTERFACE_COMPILE_DEFINITIONS BOOST_FILESYSTEM_VERSION=3
INTERFACE_LINK_LIBRARIES "${boost_system}"
IMPORTED_LOCATION "${Boost_FILESYSTEM_LIBRARY}"
IMPORTED_LOCATION_DEBUG "${Boost_FILESYSTEM_LIBRARY_DEBUG}"
IMPORTED_LOCATION_RELEASE "${Boost_FILESYSTEM_LIBRARY_RELEASE}"
)
endif()
if(NOT TARGET Boost::regex)
add_library(Boost::regex UNKNOWN IMPORTED)
set_target_properties(Boost::regex PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}"
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${boost_system}"
IMPORTED_LOCATION "${Boost_REGEX_LIBRARY}"
IMPORTED_LOCATION_DEBUG "${Boost_REGEX_LIBRARY_DEBUG}"
IMPORTED_LOCATION_RELEASE "${Boost_REGEX_LIBRARY_RELEASE}"
)
endif()
if(NOT TARGET Boost::unit_test_framework)
add_library(Boost::unit_test_framework UNKNOWN IMPORTED)
set_target_properties(Boost::unit_test_framework PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}"
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${boost_system}"
IMPORTED_LOCATION "${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}"
IMPORTED_LOCATION_DEBUG "${Boost_UNIT_TEST_FRAMEWORK_LIBRARY_DEBUG}"
IMPORTED_LOCATION_RELEASE "${Boost_UNIT_TEST_FRAMEWORK_LIBRARY_RELEASE}"
)
endif()

View File

@@ -0,0 +1,29 @@
#
# Module to check whether the file system is case sensitive or not
#
# Sets the following variable:
#
# HAVE_CASE_SENSITIVE_FILESYSTEM True if the file system honors the case of files
message(STATUS "Checking whether the file system is case-sensitive")
# create a file containing uppercase characters
file(WRITE "${CMAKE_BINARY_DIR}/UPPER" "Foo")
# check if the all-lowercase file with the same name can be opened
set(FooContents "")
if (EXISTS "${CMAKE_BINARY_DIR}/upper")
file(READ "${CMAKE_BINARY_DIR}/upper" FooContents)
endif()
# remove the file again in order not to have it dangling around...
file(REMOVE "${CMAKE_BINARY_DIR}/UPPER")
# check the contents of the file opened with lower-case. If it is
# empty, the file system is case sensitive.
if ("${FooContents}" STREQUAL "Foo")
message(STATUS "File system is not case-sensitive")
set(HAVE_CASE_SENSITIVE_FILESYSTEM 0)
else()
message(STATUS "File system is case-sensitive")
set(HAVE_CASE_SENSITIVE_FILESYSTEM 1)
endif()

View File

@@ -1,47 +0,0 @@
# - Dunecontrol compatibility
#
# Enables this build to be a part of a dunecontrol chain. The
# DUNE_CHECK_MODULES macro greps the top-level Makefile for the
# presence of the abs_top_srcdir variable (!) and uses that as
# the include directory of a module. Also, the contents are not
# checked so if the variable is not present, it generates an
# invalid command line (-I without argument) which causes the
# autoconf probe to fail. This module patches our Makefile (!!)
# so the necessary string will be there; in itself this string
# has no use for us, it is solemnly to satisfy the M4 scripts.
if (CMAKE_GENERATOR MATCHES "Unix Makefiles")
# we need an up-to-date, patched Makefile. this is always checked when
# the makefile is run, thus the need for a marker file to keep a
# timestamp to see when it was last patched (by us)
# amazingly, nothing depends on the generated Makefile, so this can be
# run whenever in the build without trigging a compile of e.g. config.h
add_custom_target (dune-compat ALL
COMMAND ${CMAKE_COMMAND} -DCMAKE_HOME_DIRECTORY=${CMAKE_HOME_DIRECTORY} -P ${OPM_MACROS_ROOT}/cmake/Scripts/DuneCompat2.cmake
COMMENT "Patching Makefile to be DUNE compatible"
)
endif (CMAKE_GENERATOR MATCHES "Unix Makefiles")
# dunecontrol refuses to use a build tree as module directory unless
# there is a dune.module in it. however, if we are in a sub-dir. of
# the source, we are probably using dunecontrol with a --build-dir
# argument, and won't call dunecontrol from the parent (which is the
# source dir and most likely doesn't contain other projects) anyway,
# i.e. we only copy if we are truly out-of-source
string (LENGTH "${PROJECT_SOURCE_DIR}/" _src_dir_len)
string (LENGTH "${PROJECT_BINARY_DIR}/" _bin_dir_len)
if (_src_dir_len GREATER _bin_dir_len)
set (_not_substring TRUE)
else (_src_dir_len GREATER _bin_dir_len)
string (SUBSTRING "${PROJECT_BINARY_DIR}/" 0 ${_src_dir_len} _proj_prefix)
if ("${PROJECT_SOURCE_DIR}/" STREQUAL "${_proj_prefix}")
set (_not_substring FALSE)
else ("${PROJECT_SOURCE_DIR}/" STREQUAL "${_proj_prefix}")
set (_not_substring TRUE)
endif ("${PROJECT_SOURCE_DIR}/" STREQUAL "${_proj_prefix}")
endif (_src_dir_len GREATER _bin_dir_len)
if (_not_substring)
execute_process (COMMAND
${CMAKE_COMMAND} -E copy_if_different ${PROJECT_SOURCE_DIR}/dune.module ${PROJECT_BINARY_DIR}/dune.module
)
endif (_not_substring)

View File

@@ -170,7 +170,13 @@ mark_as_advanced(SUPERLU_INCLUDE_DIR SUPERLU_LIBRARY)
if(SUPERLU_FOUND)
set(SUPERLU_INCLUDE_DIRS ${SUPERLU_INCLUDE_DIR})
set(SUPERLU_LIBRARIES ${SUPERLU_LIBRARY})
set(SUPERLU_INT_TYPE int)
if(SUPERLU_MIN_VERSION_4_3)
set(HAVE_SLU_DDEFS_H 1)
check_include_files(slu_sdefs.h HAVE_SLU_SDEFS_H)
check_include_files(slu_cdefs.h HAVE_SLU_CDEFS_H)
check_include_files(slu_zdefs.h HAVE_SLU_ZDEFS_H)
endif()
if (SUPERLU_BLAS_LIBRARY)
list(APPEND SUPERLU_LIBRARIES ${SUPERLU_BLAS_LIBRARY})
endif()

View File

@@ -25,6 +25,7 @@ find_opm_package (
"CXX11Features REQUIRED;
dune-common REQUIRED;
dune-geometry REQUIRED;
dune-uggrid;
MPI;
UG
"

View File

@@ -52,7 +52,13 @@ int main (void) {
HAVE_PARMETIS;
HAVE_SUPERLU;
HAVE_UMFPACK;
SUPERLU_INT_TYPE;
HAVE_SLU_CDEFS_H;
HAVE_SLU_DDEFS_H;
HAVE_SLU_SDEFS_H;
HAVE_SLU_ZDEFS_H;
SUPERLU_MIN_VERSION_4_3;
SUPERLU_MIN_VERSION_5;
SUPERLU_POST_2005_VERSION
")
#debug_find_vars ("dune-istl")

View File

@@ -0,0 +1,34 @@
include (OpmPackage)
find_opm_package (
# module name
"dune-uggrid"
# dependencies
# TODO: we should probe for all the HAVE_* values listed below;
# however, we don't actually use them in our implementation, so
"CXX11Features REQUIRED;
dune-common REQUIRED
"
# header to search for
""
# library to search for
"duneuggrid"
# defines to be added to compilations
""
# test program
""
# config variable
"")
#debug_find_vars ("dune-uggrid")
# make version number available in config.h
include (UseDuneVer)
find_dune_version ("dune" "uggrid")
# deactivate search for UG
set(UG_FOUND ${dune-uggrid_FOUND})

View File

@@ -1,42 +0,0 @@
# - Find OPM eWoms module
#
# Defines the following variables:
# ewoms_INCLUDE_DIRS Directory of header files
# ewoms_LIBRARIES Directory of shared object files
# ewoms_DEFINITIONS Defines that must be set to compile
# ewoms_CONFIG_VARS List of defines that should be in config.h
# HAVE_EWOMS Binary value to use in config.h
# Copyright (C) 2012 Uni Research AS
# This code is licensed under The GNU General Public License v3.0
# use the generic find routine
include (ewoms-prereqs)
include (OpmPackage)
find_opm_package (
# module name
"ewoms"
# dependencies
"${ewoms_DEPS}"
# header to search for
"ewoms/common/start.hh"
# library to search for
""
# defines to be added to compilations
""
# test program
"#include <ewoms/common/start.hh>
int main (void) {
return 0;
}
"
# config variables
"${ewoms_CONFIG_VAR}"
)
#include (UseDynamicBoost)
#debug_find_vars ("ewoms")

View File

@@ -1,43 +0,0 @@
# - Find the opm-common module
#
# Defines the following variables:
# opm-common_INCLUDE_DIRS Directory of header files
# opm-common_LIBRARIES Directory of shared object files
# opm-common_DEFINITIONS Defines that must be set to compile
# opm-common_CONFIG_VARS List of defines that should be in config.h
# HAVE_OPM_COMMON Binary value to use in config.h
# Copyright (C) 2013 Uni Research AS
# This code is licensed under The GNU General Public License v3.0
# use the generic find routine
include (opm-common-prereqs)
include (OpmPackage)
find_opm_package (
# module name
"opm-common"
# dependencies
"${opm-common_DEPS}"
# header to search for
"opm/common/utility/platform_dependent/disable_warnings.h"
# library to search for
"opmcommon"
# defines to be added to compilations
""
# test program
"#include <opm/common/utility/platform_dependent/disable_warnings.h>
int main (void) {
return 0;
}
"
# config variables
"${opm-common_CONFIG_VAR}"
)
include (UseDynamicBoost)
#debug_find_vars ("opm-common")

View File

@@ -1,46 +0,0 @@
# - Find OPM core library
#
# Defines the following variables:
# opm-core_INCLUDE_DIRS Directory of header files
# opm-core_LIBRARIES Directory of shared object files
# opm-core_DEFINITIONS Defines that must be set to compile
# opm-core_CONFIG_VARS List of defines that should be in config.h
# HAVE_OPM_CORE Binary value to use in config.h
# Copyright (C) 2012 Uni Research AS
# This code is licensed under The GNU General Public License v3.0
# use the generic find routine
include (opm-core-prereqs)
include (OpmPackage)
find_opm_package (
# module name
"opm-core"
# dependencies
"${opm-core_DEPS}"
# header to search for
"opm/core/wells.h"
# library to search for
"opmcore"
# defines to be added to compilations
""
# test program
"
#include <opm/core/utility/parameters/ParameterGroup.hpp>
int main()
{
Opm::ParameterGroup parameters;
parameters.insertParameter(\"number\", \"7\");
return 0;
}
"
# config variables
"${opm-core_CONFIG_VAR}"
)
include (UseDynamicBoost)
#debug_find_vars ("opm-core")

View File

@@ -1,24 +0,0 @@
# This module searches for the opm-data repository. Since the opm-data
# has no libraries or header files the find implementation is quite
# naive.
#
# If the opm-data repository is found, the following variables are set:
#
# HAVE_OPM_DATA
# OPM_DATA_ROOT
if (OPM_DATA_ROOT)
set( _opm_data_root ${OPM_DATA_ROOT})
else()
set( _opm_data_root "${PROJECT_SOURCE_DIR}/../opm-data")
endif()
if (EXISTS "${_opm_data_root}/norne/NORNE_ATW2013.DATA")
set( HAVE_OPM_DATA True )
set( OPM_DATA_ROOT ${_opm_data_root} )
message(STATUS "Setting OPM_DATA_ROOT: ${OPM_DATA_ROOT}")
else()
set( HAVE_OPM_DATA False )
message(WARNING "opm-data not found - integration tests using opm-data will be skipped.")
endif()

View File

@@ -1,42 +0,0 @@
# - Find OPM corner-point grid library
#
# Defines the following variables:
# opm-grid_INCLUDE_DIRS Directory of header files
# opm-grid_LIBRARIES Directory of shared object files
# opm-grid_DEFINITIONS Defines that must be set to compile
# opm-grid_CONFIG_VARS List of defines that should be in config.h
# HAVE_OPM_GRID Binary value to use in config.h
# Copyright (C) 2013 Uni Research AS
# This code is licensed under The GNU General Public License v3.0
include (opm-grid-prereqs)
include (OpmPackage)
find_opm_package (
# module name
"opm-grid"
# dependencies
"${opm-grid_DEPS}"
# header to search for
"dune/grid/CpGrid.hpp"
# library to search for
"opmgrid"
# defines to be added to compilations
"HAVE_OPM_GRID"
# test program
"#include <dune/grid/CpGrid.hpp>
int main (void) {
Dune::CpGrid g;
return 0;
}
"
# config variables
"${opm-grid_CONFIG_VAR}"
)
#debug_find_vars ("opm-grid")

View File

@@ -1,43 +0,0 @@
# - Find OPM materials library
#
# Defines the following variables:
# opm-material_INCLUDE_DIRS Directory of header files
# opm-material_LIBRARIES Directory of shared object files
# opm-material_DEFINITIONS Defines that must be set to compile
# opm-material_CONFIG_VARS List of defines that should be in config.h
# HAVE_OPM_MATERIAL Binary value to use in config.h
# Copyright (C) 2013 Uni Research AS
# This code is licensed under The GNU General Public License v3.0
# use the generic find routine
include (opm-material-prereqs)
include (OpmPackage)
find_opm_package (
# module name
"opm-material"
# dependencies
"${opm-material_DEPS}"
# header to search for
"opm/material/Constants.hpp"
# library to search for
""
# defines to be added to compilations
""
# test program
"#include <opm/material/Constants.hpp>
int main (void) {
double c = Opm::Constants<double>::c;
return 0;
}
"
# config variables
"${opm-material_CONFIG_VAR}"
)
include (UseDynamicBoost)
#debug_find_vars ("opm-material")

View File

@@ -1,55 +0,0 @@
# - Find OPM output library
#
# Defines the following variables:
# opm-output_INCLUDE_DIRS Directory of header files
# opm-output_LIBRARIES Directory of shared object files
# opm-output_DEFINITIONS Defines that must be set to compile
# opm-output_CONFIG_VARS List of defines that should be in config.h
# HAVE_OPM_OUTPUT Binary value to use in config.h
# Copyright (C) 2012 Uni Research AS
# This code is licensed under The GNU General Public License v3.0
# use the generic find routine
include (opm-output-prereqs)
include (OpmPackage)
find_opm_package (
# module name
"opm-output"
# dependencies
"${opm-output_DEPS}"
# header to search for
"opm/output/OutputWriter.hpp"
# library to search for
"opmoutput"
# defines to be added to compilations
""
# test program
"#include <opm/output/eclipse/Summary.hpp>
int main (void) {
return 0;
}
"
# config variables
"${opm-output_CONFIG_VAR}"
)
include (UseDynamicBoost)
#debug_find_vars ("opm-output")
if(OPM_OUTPUT_FOUND)
get_filename_component(opm-output_PREFIX_DIR ${opm-output_LIBRARY} PATH)
find_program(COMPARE_SUMMARY_COMMAND compareSummary
PATHS ${opm-output_PREFIX_DIR}/../bin
${opm-output_PREFIX_DIR}/../../bin)
find_program(COMPARE_ECL_COMMAND compareECL
PATHS ${opm-output_PREFIX_DIR}/../bin
${opm-output_PREFIX_DIR}/../../bin)
endif()

View File

@@ -1,66 +0,0 @@
# Find the OPM Eclipse input parser.
#
# Set the cache variable OPM_PARSER_ROOT to the install location of the
# library, or OPM_ROOT to the parent directory of the build tree.
#
# If found, it sets these variables:
#
# HAVE_OPM_PARSER Defined if a test program compiled
# OPM_PARSER_INCLUDE_DIRS Header file directories
# OPM_PARSER_LIBRARIES Archives and shared objects
include (FindPackageHandleStandardArgs)
# variables to pass on to other packages
if (FIND_QUIETLY)
set (OPM_PARSER_QUIET "QUIET")
else ()
set (OPM_PARSER_QUIET "")
endif ()
# inherit "suite" root if not specifically set for this library
if ((NOT OPM_PARSER_ROOT) AND OPM_ROOT)
set (OPM_PARSER_ROOT "${OPM_ROOT}/opm-parser")
endif ()
# Detect the build dir suffix or subdirectory
string(REGEX REPLACE "${PROJECT_SOURCE_DIR}/?(.*)" "\\1" BUILD_DIR_SUFFIX "${PROJECT_BINARY_DIR}")
# if a root is specified, then don't search in system directories
# or in relative directories to this one
if (OPM_PARSER_ROOT)
set (_no_default_path "NO_DEFAULT_PATH")
set (_opm_parser_source "")
set (_opm_parser_build "")
else ()
set (_no_default_path "")
set (_opm_parser_source
"${PROJECT_SOURCE_DIR}/../opm-parser")
set (_opm_parser_build
"${PROJECT_BINARY_DIR}/../opm-parser"
"${PROJECT_BINARY_DIR}/../opm-parser${BUILD_DIR_SUFFIX}"
"${PROJECT_BINARY_DIR}/../../opm-parser/${BUILD_DIR_SUFFIX}")
endif ()
find_package(opm-parser CONFIG HINTS ${_opm_parser_build})
if (opm-parser_FOUND)
find_package(ecl REQUIRED)
find_package(Boost 1.44.0
COMPONENTS regex filesystem system date_time
REQUIRED)
set(HAVE_OPM_PARSER 1)
# setting HAVE_ERT is a mega hack here, but some downstreams require it.
# Eventually projets should move on to properly handle dependencies and
# configurations, and Findopm-parser be deprecated
set(HAVE_ERT 1)
set(opm-parser_CONFIG_VARS HAVE_OPM_PARSER HAVE_REGEX HAVE_ERT)
set(opm-parser_LIBRARIES opmparser)
find_package_handle_standard_args(opm-parser
DEFAULT_MSG
opm-parser_LIBRARIES HAVE_OPM_PARSER HAVE_ERT
)
endif ()

View File

@@ -1,44 +0,0 @@
# - Find OPM automatic differentiation library
#
# Defines the following variables:
# opm-simulators_INCLUDE_DIRS Directory of header files
# opm-simulators_LIBRARIES Directory of shared object files
# opm-simulators_DEFINITIONS Defines that must be set to compile
# opm-simulators_CONFIG_VARS List of defines that should be in config.h
# HAVE_OPM_SIMULATORS Binary value to use in config.h
# Copyright (C) 2012 Uni Research AS
# This code is licensed under The GNU General Public License v3.0
# use the generic find routine
include (opm-simulators-prereqs)
include (OpmPackage)
find_opm_package (
# module name
"opm-simulators"
# dependencies
"${opm-simulators_DEPS}"
# header to search for
"opm/autodiff/AutoDiff.hpp"
# library to search for
"opmsimulators"
# defines to be added to compilations
""
# test program
"#include <opm/autodiff/AutoDiff.hpp>
int main (void) {
Opm::AutoDiff<double> x = Opm::AutoDiff<double>::constant(42.);
(void) x;
return 0;
}
"
# config variables
"${opm-simulators_CONFIG_VAR}"
)
include (UseDynamicBoost)
#debug_find_vars ("opm-simulators")

View File

@@ -0,0 +1,27 @@
# This module searches for the opm-tests repository. Since opm-tests
# has no libraries or header files the find implementation is quite
# naive.
#
# If the opm-tests repository is found, the following variables are set:
#
# HAVE_OPM_TESTS
# OPM_TESTS_ROOT
if (OPM_TESTS_ROOT)
set( _opm_tests_root ${OPM_TESTS_ROOT})
else()
set( _opm_tests_root "${PROJECT_SOURCE_DIR}/../opm-tests")
endif()
if (EXISTS "${_opm_tests_root}/norne/NORNE_ATW2013.DATA")
set( HAVE_OPM_DATA True )
set( HAVE_OPM_TESTS True )
set( OPM_TESTS_ROOT ${_opm_tests_root} )
set( OPM_DATA_ROOT ${_opm_tests_root} )
message(STATUS "Setting OPM_TESTS_ROOT: ${OPM_TESTS_ROOT}")
else()
set( HAVE_OPM_TESTS False )
set( HAVE_OPM_DATA False )
message(WARNING "opm-tests not found - integration tests using opm-tests will be skipped.")
endif()

View File

@@ -9,6 +9,7 @@ function (set_aliases)
# are separated by space
set (aliases
"HAVE_UMFPACK HAVE_SUITESPARSE_UMFPACK_H"
"HAVE_SUITESPARSE_UMFPACK HAVE_SUITESPARSE_UMFPACK_H"
"HAVE_DUNE_BOOST HAVE_BOOST"
)
foreach (alias IN LISTS aliases)

View File

@@ -18,6 +18,8 @@ macro (opm_compile opm)
if (SILENCE_CROSSMODULE_WARNINGS)
include_directories("${PROJECT_SOURCE_DIR}")
include_directories (SYSTEM ${${opm}_INCLUDE_DIRS})
set (${opm}_INCLUDE_DIR "${PROJECT_SOURCE_DIR}")
set (${opm}_INCLUDE_DIRS ${${opm}_INCLUDE_DIR} ${${opm}_INCLUDE_DIRS})
else()
set (${opm}_INCLUDE_DIR "${PROJECT_SOURCE_DIR}")
set (${opm}_INCLUDE_DIRS ${${opm}_INCLUDE_DIR} ${${opm}_INCLUDE_DIRS})

View File

@@ -2,8 +2,10 @@
macro (opm_out_dirs)
# put libraries in lib/ (no multi-arch support in build tree)
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
if(MAIN_SOURCE_FILES)
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
endif()
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
set (CMAKE_Fortran_MODULE_DIRECTORY "${PROJECT_BINARY_DIR}/CMakeFiles")
endmacro (opm_out_dirs)

View File

@@ -33,6 +33,7 @@
# )
include (Duplicates)
include (OpmSiblingSearch)
# list of suffixes for all the project variables
set (_opm_proj_vars
@@ -53,13 +54,16 @@ foreach (name IN LISTS _opm_proj_vars)
endif (NOT DEFINED ${CMAKE_PROJECT_NAME}_${name})
endforeach (name)
# these dependencies must always be handled by the find module
# these dependencies needs special treatment
set (_opm_proj_exemptions
dune-common
dune-istl
dune-grid
dune-geometry
opm-parser
dune-uggrid
dune-alugrid
dune-localfunctions
dune-fem
)
# although a DUNE module, it is delivered in the OPM suite
@@ -135,24 +139,68 @@ macro (find_and_append_package_to prefix name)
set (${name}_FOUND FALSE)
set (${NAME}_FOUND FALSE)
else ()
# using config mode is better than using module (aka. find) mode
# because then the package has already done all its probes and
# stored them in the config file for us
if (NOT DEFINED ${name}_FOUND AND NOT DEFINED ${NAME}_FOUND)
if (${name}_DIR)
message (STATUS "Finding package ${name} using config mode")
find_package (${name} ${ARGN} NO_MODULE PATHS ${${name}_DIR} NO_DEFAULT_PATH)
else ()
message (STATUS "Finding package ${name} using module mode")
find_package (${name} ${ARGN})
endif ()
endif ()
if (NOT DEFINED ${name}_FOUND)
set (${name}_FOUND "${${NAME}_FOUND}")
endif ()
if (NOT DEFINED ${NAME}_FOUND)
set (${NAME}_FOUND "${${name}_FOUND}")
endif ()
# using config mode is better than using module (aka. find) mode
# because then the package has already done all its probes and
# stored them in the config file for us
# For dune and opm modules and exempted packages we force module mode.
# For dune and opm it will use config mode underneath.
# We even need to repeat the search for opm-common once as this is done
# in the top most CMakeLists.txt without querying defines, setting dependencies
# and the likes which is only done via opm_find_package
if (NOT DEFINED ${name}_FOUND AND NOT DEFINED ${NAME}_FOUND
OR ("${name}" STREQUAL "opm-common" AND NOT _opm_common_deps_processed))
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)
get_target_property(ecl_LIBRARIES ecl INTERFACE_LINK_LIBRARIES)
get_target_property(ecl_lib ecl LOCATION)
set(ecl_LIBRARIES ecl ${ecl_lib} ${ecl_LIBRARIES})
set(ecl_FOUND 1)
set(HAVE_ERT 1)
endif()
elseif(_${name}_exempted LESS 0 AND NOT _is_opm)
find_package (${name} ${ARGN})
elseif(_${name}_exempted GREATER -1)
find_package (${name} ${ARGN})
else()
if(${name}_DIR)
find_package (${name} ${${prefix}_VERSION_MAJOR}.${${prefix}_VERSION_MINOR} ${ARGN} NO_MODULE PATHS ${${name}_DIR} NO_DEFAULT_PATH)
else()
find_package (${name} ${${prefix}_VERSION_MAJOR}.${${prefix}_VERSION_MINOR} ${ARGN} NO_MODULE)
endif()
include(FindPackageHandleStandardArgs)
if(${name}_FOUND AND ${name}_LIBRARY STREQUAL "")
find_package_handle_standard_args(${name}
REQUIRED_VARS ${name}_INCLUDE_DIRS)
else()
find_package_handle_standard_args(${name}
REQUIRED_VARS ${name}_LIBRARY)
endif()
endif ()
endif ()
if (NOT DEFINED ${name}_FOUND)
set (${name}_FOUND "${${NAME}_FOUND}")
endif ()
if (NOT DEFINED ${NAME}_FOUND)
set (${NAME}_FOUND "${${name}_FOUND}")
endif ()
if("${name}" STREQUAL "opm-common")
set(_opm_common_deps_processed ON)
endif()
endif ()
# the variable "NAME" may be replaced during find_package (as this is

View File

@@ -60,6 +60,9 @@ endmacro ()
OpmInitProjVars ()
OpmInitDirVars ()
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
include(OpmPackage)
# if we are backporting this release to a system which already have an
# earlier version, set this flag to have everything scoped into a directory
# which incorporates the label of the release. this is done by interjecting
@@ -71,3 +74,17 @@ if (USE_VERSIONED_DIR)
else ()
set (${project}_VER_DIR "")
endif ()
# parallel computing must be explicitly enabled
# This needs to be in OpmInit as prereqs is called before OpmLibMain is included.
option (USE_MPI "Use Message Passing Interface for parallel computing" OFF)
if (NOT USE_MPI)
set (CMAKE_DISABLE_FIND_PACKAGE_MPI TRUE)
endif ()
# quadmath must be explicitly enabled
# This needs to be in OpmInit as prereqs is called before OpmLibMain is included.
option (USE_QUADMATH "Use high precision floating point library (slow)" OFF)
if (NOT USE_QUADMATH)
set (CMAKE_DISABLE_FIND_PACKAGE_QuadMath TRUE)
endif ()

View File

@@ -8,7 +8,7 @@
# _TARGET CMake target which builds the library
# _LIBRARY_TYPE Static or shared library
# _DEBUG File containing debug symbols
include (UseMultiArch)
include (GNUInstallDirs)
macro (opm_install opm)
foreach (_hdr IN LISTS ${opm}_HEADERS)
@@ -20,10 +20,16 @@ macro (opm_install opm)
)
endforeach (_hdr)
install (
TARGETS ${${opm}_TARGET}
TARGETS ${${opm}_TARGET} ${${opm}_EXTRA_TARGETS}
EXPORT ${opm}-targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${${opm}_VER_DIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${${opm}_VER_DIR}
)
if(NOT "${${opm}_TARGET}" STREQUAL "")
export(TARGETS ${${opm}_TARGET} ${${opm}_EXTRA_TARGETS}
FILE ${opm}-targets.cmake)
install(EXPORT ${opm}-targets DESTINATION "share/cmake/${opm}")
endif()
# only /usr/lib/debug seems to be searched for debug info; if we have
# write access to that directory (package installation), then default
# to use it; otherwise put the debug files together with the library
@@ -59,6 +65,10 @@ macro (opm_install opm)
# multiarch-aware and will thus put in lib64/ on RHEL and lib/ on Debian
install (
FILES ${PROJECT_SOURCE_DIR}/dune.module
DESTINATION ${LIBDIR_MULTIARCH_UNAWARE}${${opm}_VER_DIR}/dunecontrol/${${opm}_NAME}
DESTINATION lib/${${opm}_VER_DIR}/dunecontrol/${${opm}_NAME}
)
install (
FILES ${PROJECT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}-prereqs.cmake
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/opm/cmake/Modules
)
endmacro (opm_install opm)

View File

@@ -90,12 +90,6 @@ include (UseOptimization)
# dependencies, in case they alter the list of warnings
include (UseWarnings)
# parallel computing must be explicitly enabled
option (USE_MPI "Use Message Passing Interface for parallel computing" OFF)
if (NOT USE_MPI)
set (CMAKE_DISABLE_FIND_PACKAGE_MPI TRUE)
endif (NOT USE_MPI)
# parallel programming
include (UseOpenMP)
find_openmp (${project})
@@ -138,7 +132,7 @@ include (UseDebugSymbols)
include (UseDynamicBoost)
# needed for Debian installation scheme
include (UseMultiArch)
include (GNUInstallDirs)
# Run conditional file hook
files_hook()
@@ -276,10 +270,11 @@ if (COMMAND tests_hook)
endif (COMMAND tests_hook)
# make datafiles necessary for tests available in output directory
if (BUILD_TESTING)
opm_data (tests datafiles "${tests_DIR}")
opm_compile_satellites (${project} tests "" "${tests_REGEXP}")
endif (BUILD_TESTING)
opm_data (tests datafiles "${tests_DIR}")
if(NOT BUILD_TESTING)
set(excl_all EXCLUDE_FROM_ALL)
endif()
opm_compile_satellites (${project} tests "${excl_all}" "${tests_REGEXP}")
# use this target to check local git commits
add_custom_target(check-commits
@@ -293,9 +288,6 @@ add_custom_target(check-commits
include (OpmDoc)
opm_doc (${project} ${doxy_dir})
# provide compatibility with using this build in dunecontrol
include (DuneCompat)
### clean in-source builds ###
include (OpmDistClean)
opm_dist_clean (${project})

View File

@@ -37,9 +37,7 @@
# <http://www.vtk.org/Wiki/CMake:How_To_Find_Libraries>
include (OpmFind)
option (SIBLING_SEARCH "Search sibling directories before system paths" ON)
mark_as_advanced (SIBLING_SEARCH)
include (OpmSiblingSearch)
# append all items from src into dst; both must be *names* of lists
macro (append_found src dst)
@@ -57,8 +55,15 @@ macro (find_opm_package module deps header lib defs prog conf)
string (REPLACE "-" "_" MODULE "${MODULE_UPPER}")
# if someone else has included this test, don't do it again
# one exception is opm-common which is already found in the
# top most CMakeLists.txt but we still need to search for its
# dependencies
if (${MODULE}_FOUND OR ${module}_FOUND)
return ()
if (${module} STREQUAL "opm-common" AND NOT _opm_common_deps_processed)
set(_opm_common_deps_processed ON)
else()
return ()
endif()
endif ()
# variables to pass on to other packages
@@ -73,198 +78,13 @@ macro (find_opm_package module deps header lib defs prog conf)
set (_${module}_required "")
endif (${module}_FIND_REQUIRED)
# see if there is a pkg-config entry for this package, and use those
# settings as a starting point
find_package (PkgConfig)
pkg_check_modules (PkgConf_${module} QUIET ${module})
create_module_dir_var(${module})
# these variables have non-standard names in FindPkgConfig (sic)
set (${module}_DEFINITIONS ${PkgConf_${module}_CFLAGS_OTHER})
set (${module}_LINKER_FLAG ${PkgConf_${module}_LDFLAGS_OTHER})
# This will also set all the needed variables with the exception of
# ${module}_CONFIG_VARS for dune modules.
find_package(${module} ${_${module}_quiet} ${_${module}_required} CONFIG)
# try to figure out whether we are in a subdir build tree, and attempt
# to put the same name as the appropriate build tree for the module
get_filename_component (_build_dir "${CMAKE_CURRENT_BINARY_DIR}" NAME)
# don't bother if we are in a project specific directory already
# (assuming no-one wants to name the build dir after another module!)
if ("${_build_dir}" STREQUAL "${PROJECT_NAME}")
set (_build_dir "")
endif ("${_build_dir}" STREQUAL "${PROJECT_NAME}")
# if the user hasn't specified any location, and it isn't found
# in standard system locations either, then start to wander
# about and look for it in proximity to ourself. Qt Creator likes
# to put the build-directories as siblings to the source trees,
# but with a -build suffix, DUNE likes to have the the build tree
# in a "build-cmake" sub-directory of each module
set(workaround_cmake_bug 0)
if(${module}_DIR})
set(workaround_cmake_bug 1)
endif()
if(${module}_ROOT})
set(workaround_cmake_bug 1)
endif()
if(${MODULE}_ROOT})
set(workaround_cmake_bug 1)
endif()
if (NOT workaround_cmake_bug)
string (TOLOWER "${module}" _module_lower)
set (_guess
"../${module}"
"../${_module_lower}"
)
set (_guess_bin_only
"../${module}-build"
"../${_module_lower}-build"
)
# look in similar dirs for the other module
if (_build_dir)
list (APPEND _guess_bin_only
"../../${module}/${_build_dir}"
"../../${_module_lower}/${_build_dir}"
)
endif (_build_dir)
# generate items that are in the build, not source dir
set (_guess_bin)
foreach (_item IN ITEMS ${_guess} ${_guess_bin_only})
list (APPEND _guess_bin "${PROJECT_BINARY_DIR}/${_item}")
endforeach (_item)
set (_no_system "")
else ()
# start looking at the paths in this order
set (_guess_bin
${${module}_DIR}
${${module}_ROOT}
${${MODULE}_ROOT}
)
# if every package is installed directly in the "suite" directory
# (e.g. /usr) then allow us to back-track one directory from the
# module sub-dir that was added by OpmFind (this happens incidently
# already for the source do to the out-of-source support)
if ("${${MODULE}_ROOT}" MATCHES "/${module}$")
get_filename_component (_suite_parent ${${MODULE}_ROOT} PATH)
list (APPEND _guess_bin
${_suite_parent}
${_suite_parent}/${module}
${_suite_parent}/${module}/${_build_dir}
)
endif ("${${MODULE}_ROOT}" MATCHES "/${module}$")
# when we look for the source, it may be that we have been specified
# a build directory which is a sub-dir of the source, so we look in
# the parent also
set (_guess
${${module}_DIR}
${${module}_ROOT}
${${MODULE}_ROOT}
)
# only add parent directories for those variants that are actually set
# (otherwise, we'll inadvertedly add the root directory (=all))
if (${module}_DIR)
list (APPEND _guess ${${module}_DIR}/..)
endif (${module}_DIR)
if (${module}_ROOT)
list (APPEND _guess ${${module}_ROOT}/..)
endif (${module}_ROOT)
if (${MODULE}_ROOT)
list (APPEND _guess ${${MODULE}_ROOT}/..)
endif (${MODULE}_ROOT)
# don't search the system paths! that would be dangerous; if there
# is a problem in our own specified directory, we don't necessarily
# want an old version that is left in one of the system paths!
set (_no_system "NO_DEFAULT_PATH")
endif ()
# by specifying _guess in the HINTS section, it gets searched before
# the system locations as well. the CMake documentation has a cloudy
# recommendation, but it ends up like this: if NO_DEFAULT_PATH is
# specified, then PATHS is used. Otherwise, it looks in HINTS, then in
# system paths, and the finally in PATHS (!)
if (SIBLING_SEARCH)
set (_guess_hints ${_guess})
set (_guess_hints_bin ${_guess_bin})
else (SIBLING_SEARCH)
set (_guess_hints)
set (_guess_hints_bin)
endif (SIBLING_SEARCH)
# if an include directory is specified directly (e.g. OPM_CORE_INCLUDE_DIR=
# /usr/include/opm-2013.03) then this overrides everything else. Notice that
# this variable uses the fully capitalized version of the name.
if (${MODULE}_INCLUDE_DIR)
set (_guess "${${MODULE}_INCLUDE_DIR}")
set (_no_system_incl "NO_DEFAULT_PATH")
else ()
set (_no_system_incl "${_no_system}")
endif ()
# search for this include and library file to get the installation
# directory of the package; hints are searched before the system locations,
# paths are searched afterwards
find_path (${module}_INCLUDE_DIR
NAMES "${header}"
PATHS ${_guess}
HINTS ${PkgConf_${module}_INCLUDE_DIRS} ${_guess_hints}
PATH_SUFFIXES "include"
${_no_system_incl}
)
# some modules are all in headers
if (NOT "${lib}" STREQUAL "")
if (CMAKE_SIZEOF_VOID_P)
math (EXPR _BITS "8 * ${CMAKE_SIZEOF_VOID_P}")
endif (CMAKE_SIZEOF_VOID_P)
# again, we may directly override the location of the library alone by
# specifying e.g. OPM_CORE_LIB_DIR. notice that this is a *directory*
# and not the name of the library
if (${MODULE}_LIB_DIR)
set (_guess_bin "${${MODULE}_LIB_DIR}")
set (_no_system_lib "NO_DEFAULT_PATH")
else ()
set (_no_system_lib "${_no_system}")
endif ()
# if there is more than one library, then look for all of them, putting
# them in variables with the name of the library appended. however, the
# first entry is assumed to be the "primary" library and will be named
# like the module. thus, with a lib entry of "foo;bar", the first library
# is called ${module}_LIBRARY and the second ${module}_LIBRARY_bar
foreach (_lib IN ITEMS ${lib})
# don't include any suffix if it is the first one
if ("${lib}" MATCHES "^${_lib}")
set (_which)
else ()
set (_which "_${_lib}")
endif ()
find_library (${module}_LIBRARY${_which}
NAMES "${_lib}"
PATHS ${_guess_bin}
HINTS ${PkgConf_${module}_LIBRARY_DIRS} ${_guess_hints_bin}
PATH_SUFFIXES "lib" "lib/Debug" "lib/Release" "lib/.libs" ".libs" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}" "build-cmake/lib"
${_no_system_lib}
)
# debug info if we didn't find the desired library
if (NOT ${module}_LIBRARY${_which})
message (STATUS "Failed to find library \"${_lib}\" for module ${module}")
endif ()
endforeach (_lib)
else (NOT "${lib}" STREQUAL "")
set (${module}_LIBRARY "")
endif (NOT "${lib}" STREQUAL "")
# add dependencies so that our result variables are complete
# list of necessities to build with the software
set (${module}_INCLUDE_DIRS "${${module}_INCLUDE_DIR}")
foreach (_lib IN ITEMS ${lib})
if ("${lib}" MATCHES "^${_lib}")
set (${module}_LIBRARIES "${${module}_LIBRARY}")
else ()
list (APPEND ${module}_LIBRARIES "${${module}_LIBRARY_${_lib}}")
endif ()
endforeach (_lib)
# period because it should be something that evaluates to true
# in find_package_handle_standard_args
set (${module}_ALL_PREREQS ".")
@@ -309,10 +129,10 @@ macro (find_opm_package module deps header lib defs prog conf)
# these defines are used in dune/${module} headers, and should be put
# in config.h when we include those
foreach (_var IN ITEMS ${conf})
# massage the name to remove source code formatting
string (REGEX REPLACE "^[\n\t\ ]+" "" _var "${_var}")
string (REGEX REPLACE "[\n\t\ ]+$" "" _var "${_var}")
list (APPEND ${module}_CONFIG_VARS ${_var})
# massage the name to remove source code formatting
string (REGEX REPLACE "^[\n\t\ ]+" "" _var "${_var}")
string (REGEX REPLACE "[\n\t\ ]+$" "" _var "${_var}")
list (APPEND ${module}_CONFIG_VARS ${_var})
endforeach (_var)
# these are the defines that should be set when compiling
@@ -335,57 +155,77 @@ macro (find_opm_package module deps header lib defs prog conf)
# write status message in the same manner as everyone else
include (FindPackageHandleStandardArgs)
if ("${lib}" STREQUAL "")
set (_lib_var "")
set (_and_lib_var)
else ("${lib}" STREQUAL "")
foreach (_lib IN ITEMS ${lib})
if ("${lib}" MATCHES "^${_lib}")
set (_lib_var "${module}_LIBRARY")
set (_and_lib_var AND ${_lib_var})
else ()
list (APPEND _lib_var "${module}_LIBRARY_${_lib}")
set (_and_lib_var ${_and_lib_var} AND "${module}_LIBRARY_${_lib}")
endif ()
endforeach (_lib)
endif ("${lib}" STREQUAL "")
# if the search is going to fail, then write these variables to
# the console as well as a diagnostics
if ((NOT (${module}_INCLUDE_DIR ${_and_lib_var} AND HAVE_${MODULE}))
AND (_${module}_required OR NOT _${module}_quiet))
if (DEFINED ${module}_DIR)
message (STATUS "${module}_DIR = ${${module}_DIR}")
elseif (DEFINED ${module}_ROOT)
message (STATUS "${module}_ROOT = ${${module}_ROOT}")
elseif (DEFINED ${MODULE}_ROOT)
message (STATUS "${MODULE}_ROOT = ${${MODULE}_ROOT}")
endif (DEFINED ${module}_DIR)
endif ((NOT (${module}_INCLUDE_DIR ${_and_lib_var} AND HAVE_${MODULE}))
AND (_${module}_required OR NOT _${module}_quiet))
if ("${${module}_ALL_PREREQS}" MATCHES "-NOTFOUND")
message (STATUS "${module} prereqs: ${${module}_ALL_PREREQS}")
endif ()
find_package_handle_standard_args (
${module}
DEFAULT_MSG
${module}_INCLUDE_DIR ${_lib_var} HAVE_${MODULE} ${module}_ALL_PREREQS
)
# allow the user to override these from user interface
mark_as_advanced (${module}_INCLUDE_DIR)
mark_as_advanced (${module}_LIBRARY)
${module}
DEFAULT_MSG
${module}_INCLUDE_DIRS ${module}_LIBRARIES ${module}_FOUND ${module}_ALL_PREREQS
)
# some genius that coded the FindPackageHandleStandardArgs figured out
# that the module name should be in uppercase (?!)
set (${module}_FOUND "${${MODULE_UPPER}_FOUND}")
set (${MODULE}_FOUND "${${MODULE_UPPER}_FOUND}")
# This variable is used by UseDuneVer
list(GET ${module}_INCLUDE_DIRS 0 ${module}_INCLUDE_DIR)
# print everything out if we're asked to
if (${module}_DEBUG)
debug_find_vars (${module})
endif (${module}_DEBUG)
endmacro (find_opm_package module deps header lib defs prog conf)
macro (find_package_deps module)
# period because it should be something that evaluates to true
# in find_package_handle_standard_args
set (${module}_ALL_PREREQS ".")
foreach (_dep IN ITEMS ${${module}_DEPS})
separate_arguments (_${module}_args UNIX_COMMAND "${_dep}")
if (_${module}_args)
if(_dep MATCHES "opm-" OR _dep MATCHES "ewoms")
set(deplist ${_dep})
string(STRIP "${_dep}" _dep)
string(REPLACE " " ";" deplist "${_dep}")
list(GET deplist 0 depname)
create_module_dir_var(${depname})
endif()
find_and_append_package_to (${module} ${_${module}_args} ${_${module}_quiet})
list (GET _${module}_args 0 _name_only)
string (TOUPPER "${_name_only}" _NAME_ONLY)
string (REPLACE "-" "_" _NAME_ONLY "${_NAME_ONLY}")
# check manually if it was found if REQUIRED; otherwise poison the
# dependency list which is checked later (so that it will fail)
if (("${_${module}_args}" MATCHES "REQUIRED") AND NOT (${_name_only}_FOUND OR ${_NAME_ONLY}_FOUND))
list (APPEND ${module}_ALL_PREREQS "${_name_only}-NOTFOUND")
endif ()
else ()
message (WARNING "Empty dependency in find module for ${module} (check for trailing semi-colon)")
endif ()
endforeach (_dep)
# tidy the lists before returning them
remove_dup_deps (${module})
# these defines are used in dune/${module} headers, and should be put
# in config.h when we include those
foreach (_var IN ITEMS ${conf})
# massage the name to remove source code formatting
string (REGEX REPLACE "^[\n\t\ ]+" "" _var "${_var}")
string (REGEX REPLACE "[\n\t\ ]+$" "" _var "${_var}")
list (APPEND ${module}_CONFIG_VARS ${_var})
endforeach (_var)
# these are the defines that should be set when compiling
# without config.h
config_cmd_line (${module}_CMD_CONFIG ${module}_CONFIG_VARS)
# This variable is used by UseDuneVer
list(GET ${module}_INCLUDE_DIRS 0 ${module}_INCLUDE_DIR)
# print everything out if we're asked to
if (${module}_DEBUG)
debug_find_vars (${module})
endif (${module}_DEBUG)
endmacro ()
# print all variables defined by the above macro
function (debug_find_vars module)
message (STATUS "${module}_FOUND = ${${module}_FOUND}")
@@ -395,7 +235,7 @@ function (debug_find_vars module)
message (STATUS "${module}_CONFIG_VARS = ${${module}_CONFIG_VARS}")
message (STATUS "${module}_LINKER_FLAGS = ${${module}_LINKER_FLAGS}")
string (TOUPPER ${module} MODULE)
string (REPLACE "-" "_" MODULE ${MODULE})
string (REPLACE "-" "_" MODULE ${MODULE})
message (STATUS "HAVE_${MODULE} = ${HAVE_${MODULE}}")
endfunction (debug_find_vars module)

View File

@@ -56,6 +56,9 @@ function (configure_cmake_file name variant version)
set (opm-project_${suffix} "${${name}_${suffix}}")
endforeach (suffix)
set (opm-project_NAME "${${name}_NAME}")
set (opm-project_NAME_UC "${${name}_NAME}")
string(TOUPPER "${opm-project_NAME}" opm-project_NAME_UC)
string(REPLACE "-" "_" opm-project_NAME_UC "${opm-project_NAME_UC}")
# make the file substitutions
configure_file (
@@ -74,6 +77,7 @@ function (opm_cmake_config name)
# write configuration file to locate library
set(OPM_PROJECT_EXTRA_CODE ${OPM_PROJECT_EXTRA_CODE_INTREE})
set(PREREQ_LOCATION "${PROJECT_SOURCE_DIR}")
configure_cmake_file (${name} "config" "")
configure_cmake_file (${name} "config" "-version")
configure_vars (
@@ -87,10 +91,17 @@ function (opm_cmake_config name)
${template_dir}/opm-project.pc.in
${PROJECT_BINARY_DIR}/${${name}_NAME}.pc
${PROJECT_BINARY_DIR}
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
${PROJECT_SOURCE_DIR}
)
# The next replace will result in bogus entries if install directory is
# a subdirectory of source tree,
# and we have existing entries pointing to that install directory.
# Since they will yield a duplicate in next replace anyways, we filter them out first
# to get avoid those the bogus entries.
string(REPLACE "${CMAKE_INSTALL_PREFIX}/include${${name}_VER_DIR}" "" ${name}_INCLUDE_DIRS "${${name}_INCLUDE_DIRS}")
# replace the build directory with the target directory in the
# variables that contains build paths
string (REPLACE
@@ -111,6 +122,7 @@ function (opm_cmake_config name)
# create a config mode file which targets the install directory instead
# of the build directory (using the same input template)
set(OPM_PROJECT_EXTRA_CODE ${OPM_PROJECT_EXTRA_CODE_INSTALLED})
set(PREREQ_LOCATION "${CMAKE_INSTALL_PREFIX}/share/opm/cmake/Modules")
configure_cmake_file (${name} "install" "")
configure_vars (
FILE CMAKE "${PROJECT_BINARY_DIR}/${${name}_NAME}-install.cmake"
@@ -144,7 +156,7 @@ function (opm_cmake_config name)
if (${name}_TARGET)
set (_pkg_dir ${CMAKE_INSTALL_LIBDIR})
else ()
set (_pkg_dir ${LIBDIR_MULTIARCH_UNAWARE})
set (_pkg_dir lib)
endif ()
install (
FILES ${PROJECT_BINARY_DIR}/${${name}_NAME}-install.pc

View File

@@ -65,6 +65,11 @@ macro (opm_compile_satellites opm satellite excl_all test_regexp)
set_target_properties (${_sat_NAME} PROPERTIES
LINK_FLAGS "${${opm}_LINKER_FLAGS_STR}"
)
if(HAVE_DYNAMIC_BOOST_TEST AND NOT (${opm} STREQUAL "opm-parser" AND NOT BUILD_SHARED_LIBS))
set_target_properties (${_sat_NAME} PROPERTIES
COMPILE_DEFINITIONS BOOST_TEST_DYN_LINK
)
endif()
# are we building a test? luckily, the testing framework doesn't
# require anything else, so we don't have to figure out where it
# should go in the library list
@@ -82,11 +87,14 @@ macro (opm_compile_satellites opm satellite excl_all test_regexp)
# 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}")
endif ("${_sat_NAME}" MATCHES "${_regexp}")
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
@@ -139,7 +147,7 @@ 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 ${dirname}
COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/${dirname}
)
# if ever huge test datafiles are necessary, then change this
@@ -267,7 +275,7 @@ macro(opm_add_test TestName)
# the libraries to link against
if (NOT CURTEST_LIBRARIES)
SET(CURTEST_LIBRARIES "${${CMAKE_PROJECT_NAME}_LIBRARIES}")
SET(CURTEST_LIBRARIES "${${project}_LIBRARIES}")
endif()
# determine if the test should be completely ignored, i.e., the
@@ -289,6 +297,9 @@ macro(opm_add_test TestName)
add_executable("${CURTEST_EXE_NAME}" ${CURTEST_EXCLUDE_FROM_ALL} ${CURTEST_SOURCES})
target_link_libraries (${CURTEST_EXE_NAME} ${CURTEST_LIBRARIES})
if(TARGET ${project}_prepare)
add_dependencies("${CURTEST_EXE_NAME}" ${project}_prepare)
endif()
if(CURTEST_DEPENDS)
add_dependencies("${CURTEST_EXE_NAME}" ${CURTEST_DEPENDS})
endif()
@@ -303,11 +314,9 @@ macro(opm_add_test TestName)
if(CURTEST_DEPENDS)
add_dependencies("${CURTEST_EXE_NAME}" ${CURTEST_DEPENDS})
endif()
if(NOT TARGET test-suite)
add_custom_target(test-suite)
if(TARGET ${project}_prepare)
add_dependencies("${CURTEST_EXE_NAME}" ${project}_prepare)
endif()
add_dependencies(test-suite "${CURTEST_EXE_NAME}")
endif()
# figure out how the test should be run. if a test driver script
@@ -337,6 +346,13 @@ macro(opm_add_test TestName)
endif()
endif()
if (NOT CURTEST_NO_COMPILE)
if(NOT TARGET test-suite)
add_custom_target(test-suite)
endif()
add_dependencies(test-suite "${CURTEST_EXE_NAME}")
endif()
else() # test is skipped
# the following causes the test to appear as 'skipped' in the

View File

@@ -0,0 +1,36 @@
option (SIBLING_SEARCH "Search sibling directories before system paths" ON)
mark_as_advanced (SIBLING_SEARCH)
macro(create_module_dir_var module)
if(SIBLING_SEARCH AND NOT ${module}_DIR)
# guess the sibling dir
get_filename_component(_leaf_dir_name ${PROJECT_BINARY_DIR} NAME)
get_filename_component(_parent_full_dir ${PROJECT_BINARY_DIR} DIRECTORY)
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()
if(IS_DIRECTORY ${_modules_dir}/${_clone_dir}/${_leaf_dir_name})
set(${module}_DIR ${_modules_dir}/${_clone_dir}/${_leaf_dir_name})
else()
string(REPLACE ${PROJECT_NAME} ${_clone_dir} _module_leaf ${_leaf_dir_name})
if(NOT _leaf_dir_name STREQUAL _module_leaf
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})
# All modules are in a common build dir
set(${module}_DIR "${_parent_full_dir}/${_clone_dir}")
endif()
endif()
endif()
if(${module}_DIR AND NOT IS_DIRECTORY ${${module}_DIR})
message(WARNING "Value ${${module}_DIR} passed to variable"
" ${module}_DIR is not a directory")
endif()
endmacro()

View File

@@ -50,7 +50,7 @@ macro(opm_static_add_dependencies target)
endmacro()
include(ExternalProject)
include(UseMultiArch)
include(GNUInstallDirs)
# Defaults to building master
if(NOT OPM_BENCHMARK_VERSION)

View File

@@ -14,139 +14,19 @@
# Add these variables to ${project}_CONFIG_IMPL_VARS in CMakeLists.txt
# if you need these in the code.
include (UseMultiArch)
function (find_dune_version suite module)
# the _ROOT variable may or may not be set, but the include
# variable should always be; get the prefix from the header path
# if we have a multilib installation where the package maintainer
# have installed it in e.g. /usr/include/dune-2.2/dune/istl, then
# stash this extra indirection and add it back later in lib/
set (_inc_path "${${suite}-${module}_INCLUDE_DIR}")
file (TO_CMAKE_PATH _inc_path "${_inc_path}")
set (_multilib_regexp "(.*)/include(/${suite}[^/]+)?")
if (_inc_path MATCHES "${_multilib_regexp}")
set (_orig_inc "${_inc_path}")
string (REGEX REPLACE "${_multilib_regexp}" "\\1" _inc_path "${_orig_inc}")
# only get the second group if it is really there (there is
# probably a better way to do this in CMake)
if ("${_inc_path}/include" STREQUAL "${_orig_inc}")
set (_multilib "")
else ()
string (REGEX REPLACE "${_multilib_regexp}" "\\2" _multilib "${_orig_inc}")
endif ()
else ()
set (_multilib "")
endif ()
# some modules does not have a library, use the directory of the
# header files to find what would be the library dir.
# note that when we refer to a build tree, then the libraries always
# go into lib/, but we don't care about that because in that case,
# dune.module isn't in the lib/ directory anyway but must be retrieved
# from the source. hence, we only have to worry about the library
# directory of a system installation here.
if (NOT ${suite}-${module}_LIBRARY)
# this suffix is gotten from UseMultiArch.cmake
set (_lib_path "${_inc_path}/${CMAKE_INSTALL_LIBDIR}")
else ()
get_filename_component (_lib_path "${${suite}-${module}_LIBRARY}" PATH)
endif ()
# if we have a source tree, dune.module is available there
set (_dune_mod "${_inc_path}/dune.module")
if (NOT EXISTS "${_dune_mod}")
set (_last_dune_mod_src "${_dune_mod}")
set (_dune_mod "")
endif ()
if (NOT _dune_mod)
# look for the build tree; if we found the library, then the
# dune.module file should be in a sub-directory
get_filename_component (_immediate "${_lib_path}" NAME)
if ("${_immediate}" STREQUAL ".libs")
# remove autotools internal path
get_filename_component (_lib_path "${_lib_path}" PATH)
endif ()
get_filename_component (_immediate "${_lib_path}" NAME)
if ("${_immediate}" STREQUAL "${CMAKE_LIBRARY_ARCHITECTURE}")
# remove multi-arch part of the library path to get parent
get_filename_component (_lib_path "${_lib_path}" PATH)
endif ()
get_filename_component (_immediate "${_lib_path}" NAME)
if (("${_immediate}" STREQUAL "${CMAKE_INSTALL_LIBDIR}")
OR ("${_immediate}" STREQUAL "lib")
OR ("${_immediate}" STREQUAL "${LIBDIR_MULTIARCH_UNAWARE}"))
# remove library part of the path; this also undo the suffix
# we added if we used the library as a standin
get_filename_component (_lib_path "${_lib_path}" PATH)
endif ()
# from this point on, _lib_path does not contain an architecture-
# specific component anymore; dune.module is always put in straight
# noarch lib/ since it does not contain any paths to binaries
set (_suffix "${_multilib}/dunecontrol/${suite}-${module}/dune.module")
set (_dune_mod "${_lib_path}/${LIBDIR_MULTIARCH_UNAWARE}${_suffix}")
if (NOT EXISTS "${_dune_mod}")
set (_last_dune_mod_bld "${_dune_mod}")
# one more try, if we have a private install, then it doesn't use
# e.g. lib64 but always lib (!)
if ("${LIBDIR_MULTIARCH_UNAWARE}" STREQUAL "lib")
set (_dune_mod "")
else ()
set (_dune_mod "${_lib_path}/lib${_suffix}")
if (NOT EXISTS "${_dune_mod}")
set (_last_dune_mod_pri "${_dune_mod}")
# use the name itself as a flag for whether it was found or not
set (_dune_mod "")
endif ()
endif ()
endif ()
endif ()
# if it is not available, it may make havoc having empty defines in the source
# code later, so we bail out early
if (NOT _dune_mod)
if (${suite}-${module}_FOUND)
set (_searched_paths "\"${_last_dune_mod_src}\"")
if (NOT ("${_last_dune_mod_bld}" STREQUAL ""))
set (_searched_paths "either ${_searched_paths} or \"${_last_dune_mod_bld}\"")
endif ()
if (NOT ("${_last_dune_mod_pri}" STREQUAL ""))
set (_searched_paths "${_searched_paths} or \"${_last_dune_mod_pri}\"")
endif ()
message (FATAL_ERROR "Failed to locate dune.module for ${suite}-${module} (looking for ${_searched_paths})")
else ()
return ()
endif ()
endif ()
# parse the file for the Version: field
set (_ver_regexp "[ ]*Version:[ ]*([0-9]+)\\.([0-9]+)(.*)")
file (STRINGS "${_dune_mod}" _ver_field REGEX "${_ver_regexp}")
string (REGEX REPLACE "${_ver_regexp}" "\\1" _major "${_ver_field}")
string (REGEX REPLACE "${_ver_regexp}" "\\2" _minor "${_ver_field}")
string (REGEX REPLACE "${_ver_regexp}" "\\3" _revision "${_ver_field}")
# revision may or may not be there
set (_rev_regexp "\\.([0-9]+).*")
if (_revision MATCHES "${_rev_regexp}")
string (REGEX REPLACE "${_rev_regexp}" "\\1" _revision "${_revision}")
else ()
set (_revision "0")
endif ()
# CMake's find_package will set <package>_VERSION_(MAJOR|MINOR|REVISION)
# we simply rely on that.
# generate variable for what we have found
string (TOUPPER "${suite}" _SUITE)
string (TOUPPER "${module}" _MODULE)
string (REPLACE "-" "_" _MODULE "${_MODULE}")
if ((NOT DEFINED ${_SUITE}_${_MODULE}_VERSION_MAJOR) AND
(NOT DEFINED ${_SUITE}_${_MODULE}_VERSION_MINOR) AND
(NOT DEFINED ${_SUITE}_${_MODULE}_VERSION_REVISION))
set (${_SUITE}_${_MODULE}_VERSION_MAJOR "${_major}" PARENT_SCOPE)
set (${_SUITE}_${_MODULE}_VERSION_MINOR "${_minor}" PARENT_SCOPE)
set (${_SUITE}_${_MODULE}_VERSION_REVISION "${_revision}" PARENT_SCOPE)
endif ()
set (${_SUITE}_${_MODULE}_VERSION_MAJOR "${${suite}-${module}_VERSION_MAJOR}" PARENT_SCOPE)
set (${_SUITE}_${_MODULE}_VERSION_MINOR "${${suite}-${module}_VERSION_MINOR}" PARENT_SCOPE)
set (${_SUITE}_${_MODULE}_VERSION_REVISION "${${suite}-${module}_VERSION_PATCH}" PARENT_SCOPE)
# print the version number we detected in the configuration log
message (STATUS "Version ${_major}.${_minor}.${_revision} of ${suite}-${module} from ${_dune_mod}")
if( ${suite}-${module}_FOUND )
# print the version number we detected in the configuration log
message (STATUS "Version ${${suite}-${module}_VERSION_MAJOR}.${${suite}-${module}_VERSION_MINOR}.${${suite}-${module}_VERSION_PATCH} of ${suite}-${module} from ${${suite}-${module}_DIR}")
endif()
endfunction (find_dune_version suite module)

View File

@@ -1,35 +0,0 @@
# - Multiarch support in object code library directories
#
# This module sets the following variable
# CMAKE_INSTALL_LIBDIR to lib, lib64 or lib/x86_64-linux-gnu
# depending on the platform; use this path
# for platform-specific binaries.
#
# Note that it will override the results of GNUInstallDirs if included after
# that module.
# default if we need to put something in the library directory for a
# component that is *not* multiarch-aware
set (LIBDIR_MULTIARCH_UNAWARE "lib")
# Fedora uses lib64/ for 64-bit systems, Debian uses lib/x86_64-linux-gnu
if ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
# Debian or Ubuntu?
if (EXISTS "/etc/debian_version")
set (_libdir_def "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
else (EXISTS "/etc/debian_version")
# 64-bit system?
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
set (_libdir_def "lib64")
set (LIBDIR_MULTIARCH_UNAWARE "${_libdir_def}")
else (CMAKE_SIZEOF_VOID_P EQUAL 8)
set (_libdir_def "lib")
endif (CMAKE_SIZEOF_VOID_P EQUAL 8)
endif (EXISTS "/etc/debian_version")
else ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
set (_libdir_def "lib")
endif ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
# let the user override if somewhere else is desirable
set (CMAKE_INSTALL_LIBDIR "${_libdir_def}" CACHE PATH "Object code libraries")
mark_as_advanced (CMAKE_INSTALL_LIBDIR)

View File

@@ -44,7 +44,11 @@ if (CXX_COMPAT_GCC)
add_options (ALL_LANGUAGES "${_prof_DEBUG}" ${_opt_dbg} "-DDEBUG")
# use these options for release builds - full optimization
add_options (ALL_LANGUAGES "${_prof_RELEASE}" ${_opt_rel} "-DNDEBUG" ${_opt_flags})
add_options (ALL_LANGUAGES "${_prof_RELEASE}" ${_opt_rel} ${_opt_flags})
option(WITH_NDEBUG "Disable asserts in release mode" ON)
if(WITH_NDEBUG)
add_options (ALL_LANGUAGES "${_prof_RELEASE}" -DNDEBUG)
endif()
else ()
# default information from system

View File

@@ -1,45 +0,0 @@
# -*- mode: cmake; tab-width: 2; indent-tabs-mode: t; truncate-lines: t; compile-command: "cmake -Wdev" -*-
# vim: set filetype=cmake autoindent tabstop=2 shiftwidth=2 noexpandtab softtabstop=2 nowrap:
# this avoids an annoying deprecation warning on DUNE 2.4 (which we
# are not interested in anyway)
set(DUNE_AVOID_CAPABILITIES_IS_PARALLEL_DEPRECATION_WARNING 1)
# defines that must be present in config.h for our headers
set (ewoms_CONFIG_VAR
HAVE_QUAD
HAVE_VALGRIND
HAVE_DUNE_COMMON
HAVE_DUNE_GEOMETRY
HAVE_DUNE_GRID
HAVE_DUNE_LOCALFUNCTIONS
HAVE_DUNE_ISTL
HAVE_DUNE_ALUGRID
HAVE_DUNE_FEM
DUNE_AVOID_CAPABILITIES_IS_PARALLEL_DEPRECATION_WARNING
)
# dependencies
set (ewoms_DEPS
# compile with C++0x/11 support if available
"CXX11Features REQUIRED"
# DUNE prerequisites
"dune-common REQUIRED"
"dune-geometry REQUIRED"
"dune-grid REQUIRED"
"dune-istl REQUIRED"
"opm-common REQUIRED"
"opm-material REQUIRED"
"dune-localfunctions"
"dune-alugrid"
"dune-fem"
"opm-parser"
"opm-grid"
"opm-core"
# librt (on some systems necessary for clock_gettime())
"librt REQUIRED"
# valgrind client requests
"Valgrind"
# quadruple precision floating point calculations
"Quadmath"
)

View File

@@ -1,19 +0,0 @@
# -*- mode: cmake; tab-width: 2; indent-tabs-mode: t; truncate-lines: t; compile-command: "cmake -Wdev" -*-
# vim: set filetype=cmake autoindent tabstop=2 shiftwidth=2 noexpandtab softtabstop=2 nowrap:
# defines that must be present in config.h for our headers
set (opm-benchmarks_CONFIG_VAR
)
# dependencies
set (opm-benchmarks_DEPS
# compile with C++0x/11 support if available
"CXX11Features REQUIRED"
# various runtime library enhancements
"Boost 1.44.0
COMPONENTS date_time filesystem system unit_test_framework REQUIRED"
# OPM dependency
"opm-common"
"opm-core REQUIRED"
"opm-upscaling REQUIRED"
)

View File

@@ -1,50 +0,0 @@
# -*- mode: cmake; tab-width: 2; indent-tabs-mode: t; truncate-lines: t; compile-command: "cmake -Wdev" -*-
# vim: set filetype=cmake autoindent tabstop=2 shiftwidth=2 noexpandtab softtabstop=2 nowrap:
# defines that must be present in config.h for our headers
set (opm-core_CONFIG_VAR
HAVE_ERT
HAVE_SUITESPARSE_UMFPACK_H
HAVE_DUNE_ISTL
HAVE_MPI
HAVE_PETSC
DUNE_ISTL_VERSION_MAJOR
DUNE_ISTL_VERSION_MINOR
DUNE_ISTL_VERSION_REVISION
)
# dependencies
set (opm-core_DEPS
# compile with C99 support if available
"C99"
# compile with C++0x/11 support if available
"CXX11Features REQUIRED"
# various runtime library enhancements
"Boost 1.44.0
COMPONENTS date_time filesystem system unit_test_framework REQUIRED"
# matrix library
"BLAS REQUIRED"
"LAPACK REQUIRED"
# Tim Davis' SuiteSparse archive
"SuiteSparse COMPONENTS umfpack"
# solver
"SuperLU"
# Ensembles-based Reservoir Tools (ERT)
"ecl REQUIRED"
# Look for MPI support
"MPI"
# PETSc numerical backend
"PETSc"
# DUNE dependency
"dune-common"
"dune-istl"
"opm-common REQUIRED"
# Parser library for ECL-type simulation models
"opm-parser REQUIRED"
# the code which implements the material laws
"opm-material REQUIRED"
# the code which implements the output routines
"opm-output REQUIRED"
# the code which implements grids
"opm-grid REQUIRED"
)

View File

@@ -1,21 +0,0 @@
# -*- mode: cmake; tab-width: 2; indent-tabs-mode: t; truncate-lines: t; compile-command: "cmake -Wdev" -*-
# vim: set filetype=cmake autoindent tabstop=2 shiftwidth=2 noexpandtab softtabstop=2 nowrap:
# defines that must be present in config.h for our headers
set (opm-flowdiagnostics-applications_CONFIG_VAR
)
# dependencies
set (opm-flowdiagnostics-applications_DEPS
# compile with C99 support if available
"C99"
# compile with C++0x/11 support if available
"CXX11Features REQUIRED"
"Boost 1.44.0
COMPONENTS filesystem regex system unit_test_framework REQUIRED"
"ERT REQUIRED"
# prerequisite OPM modules
"opm-common REQUIRED;
opm-flowdiagnostics REQUIRED;
opm-core REQUIRED"
)

View File

@@ -1,18 +0,0 @@
# -*- mode: cmake; tab-width: 2; indent-tabs-mode: t; truncate-lines: t; compile-command: "cmake -Wdev" -*-
# vim: set filetype=cmake autoindent tabstop=2 shiftwidth=2 noexpandtab softtabstop=2 nowrap:
# defines that must be present in config.h for our headers
set (opm-flowdiagnostics_CONFIG_VAR
)
# dependencies
set (opm-flowdiagnostics_DEPS
# compile with C99 support if available
"C99"
# compile with C++0x/11 support if available
"CXX11Features REQUIRED"
"Boost 1.44.0
COMPONENTS unit_test_framework REQUIRED"
# prerequisite OPM modules
"opm-common REQUIRED"
)

View File

@@ -1,33 +0,0 @@
# -*- mode: cmake; tab-width: 2; indent-tabs-mode: t; truncate-lines: t; compile-command: "cmake -Wdev" -*-
# vim: set filetype=cmake autoindent tabstop=2 shiftwidth=2 noexpandtab softtabstop=2 nowrap:
# defines that must be present in config.h for our headers
set (opm-grid_CONFIG_VAR
DUNE_GRID_VERSION_MAJOR
DUNE_GRID_VERSION_MINOR
DUNE_GRID_VERSION_REVISION
DUNE_COMMON_VERSION_MAJOR
DUNE_COMMON_VERSION_MINOR
DUNE_COMMON_VERSION_REVISION
HAVE_DUNE_ISTL
HAVE_MPI
HAVE_ZOLTAN
)
# dependencies
set (opm-grid_DEPS
# compile with C99 support if available
"C99"
# compile with C++0x/11 support if available
"CXX11Features"
# various runtime library enhancements
"Boost 1.44.0
COMPONENTS date_time filesystem system unit_test_framework REQUIRED"
"MPI"
"dune-common"
"dune-grid REQUIRED"
"dune-istl"
"opm-common REQUIRED"
"opm-parser REQUIRED"
"ZOLTAN"
)

View File

@@ -1,25 +0,0 @@
# -*- mode: cmake; tab-width: 2; indent-tabs-mode: t; truncate-lines: t; compile-command: "cmake -Wdev" -*-
# vim: set filetype=cmake autoindent tabstop=2 shiftwidth=2 noexpandtab softtabstop=2 nowrap:
# defines that must be present in config.h for our headers
set (opm-material_CONFIG_VAR
HAVE_MPI
HAVE_TYPE_TRAITS
HAVE_VALGRIND
HAVE_FINAL
)
# dependencies
set (opm-material_DEPS
# compile with C99 support if available
"C99"
# compile with C++0x/11 support if available
"CXX11Features REQUIRED"
# prerequisite OPM modules
"opm-parser"
"opm-common REQUIRED"
# DUNE dependency
"dune-common REQUIRED"
# valgrind client requests
"Valgrind"
)

View File

@@ -1,24 +0,0 @@
# -*- mode: cmake; tab-width: 2; indent-tabs-mode: t; truncate-lines: t; compile-command: "cmake -Wdev" -*-
# vim: set filetype=cmake autoindent tabstop=2 shiftwidth=2 noexpandtab softtabstop=2 nowrap:
# defines that must be present in config.h for our headers
set (opm-output_CONFIG_VAR
HAVE_ERT
)
# dependencies
set (opm-output_DEPS
# compile with C99 support if available
"C99"
# compile with C++0x/11 support if available
"CXX11Features REQUIRED"
# various runtime library enhancements
"Boost 1.44.0
COMPONENTS unit_test_framework REQUIRED"
# Ensembles-based Reservoir Tools (ERT)
"ecl REQUIRED"
# Look for MPI support
"opm-common REQUIRED"
# Parser library for ECL-type simulation models
"opm-parser REQUIRED"
)

View File

@@ -1,36 +0,0 @@
# -*- mode: cmake; tab-width: 2; indent-tabs-mode: t; truncate-lines: t; compile-command: "cmake -Wdev" -*-
# vim: set filetype=cmake autoindent tabstop=2 shiftwidth=2 noexpandtab softtabstop=2 nowrap:
# defines that must be present in config.h for our headers
set (opm-simulators_CONFIG_VAR
HAVE_OPM_GRID
HAVE_PTHREAD
HAVE_EWOMS
DUNE_ISTL_VERSION_MAJOR
DUNE_ISTL_VERSION_MINOR
DUNE_ISTL_VERSION_REVISION
)
# dependencies
set (opm-simulators_DEPS
# Compile with C99 support if available
"C99"
# Compile with C++0x/11 support if available
"CXX11Features"
# Various runtime library enhancements
"Boost 1.44.0
COMPONENTS date_time filesystem system unit_test_framework REQUIRED"
# DUNE prerequisites
"dune-common REQUIRED;
dune-istl REQUIRED"
"ERTPython"
# OPM dependency
"opm-common REQUIRED;
opm-parser REQUIRED;
opm-grid REQUIRED;
opm-core REQUIRED;
opm-output REQUIRED;
ewoms REQUIRED"
# Eigen
"Eigen3 3.2.0"
)

View File

@@ -1,32 +0,0 @@
# -*- mode: cmake; tab-width: 2; indent-tabs-mode: t; truncate-lines: t; compile-command: "cmake -Wdev" -*-
# vim: set filetype=cmake autoindent tabstop=2 shiftwidth=2 noexpandtab softtabstop=2 nowrap:
# defines that must be present in config.h for our headers
set (opm-upscaling_CONFIG_VAR
HAVE_SUPERLU
)
# dependencies
set (opm-upscaling_DEPS
# compile with C99 support if available
"C99"
# compile with C++0x/11 support if available
"CXX11Features"
# various runtime library enhancements
"Boost 1.44.0
COMPONENTS date_time filesystem system iostreams unit_test_framework REQUIRED"
# matrix library
"BLAS REQUIRED"
"LAPACK REQUIRED"
# solver
"SuperLU"
# DUNE dependency
"dune-common REQUIRED;
dune-istl REQUIRED;
dune-geometry REQUIRED;
dune-grid REQUIRED;
opm-common REQUIRED;
opm-grid REQUIRED;
opm-core REQUIRED;
opm-output REQUIRED"
)

View File

@@ -1,553 +0,0 @@
#!/bin/bash
# where is the source tree located by default relative to here
srcdir=$(dirname "$(dirname "$(dirname "$0")")")
# display help text
usage () {
cat <<EOF
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[/usr/local]. Note: set DESTDIR=PATH when doing
\`make install' to install to a different sysroot.
Optional Features:
--disable-FEATURE do not include FEATURE
--disable-gxx11check do not try flag -std=c++11 to enable C++11 features
--enable-shared build a shared library [default=yes]
--enable-static build a static library [default=no]. Note: only one
of the options shared and static may be built.
--enable-debug build a non-optimized version of the library
[default=no]
--disable-runpath do not use RUNPATH in installed library [default=yes]
--enable-lto use whole program optimization [default=no]
--enable-strip-debug separate the executable code and the debugging symbols [default=no]
--disable-tests do not compile and enable unit tests [default=yes]
--disable-examples do not compile example programs [default=yes]
--disable-pch do not use precompiled headers (if buggy compiler)
--disable-silent-rules print every compilation statement as executed
--enable-system-debug put .debug files in global GDB debug dir
[default=yes if prefix=/usr, no otherwise]
--enable-parallel process in parallel using MPI [default=no]
--enable-openmp activate experimental support for OpenMP
--disable-option-checking ignore unrecognized --enable/--with options
--enable-underscoring assume Fortran routines have _ suffix [default=no]
--enable-ninja use Ninja build generator [default=no]
(automatically implies --enable-underscoring)
--config-cache Reuse build configuration cache from a previous run
Optional Packages:
--with-ug=PATH use the UG libraries from a specified location
--with-alugrid=PATH use the ALUGrid library from a specified location
--with-metis=PATH use the METIS graph partitioning library from a specified location
--with-boost=PATH use Boost library from a specified location
--with-dune=PATH specify parent of all DUNE modules not specified
--with-dune-MODULE=PATH use given DUNE module from a specified location
--with-opm=PATH specify parent of all OPM modules not specified
--with-opm-MODULE=PATH use given OPM module from a specified location
--with-superlu=PATH user defined path to SuperLU library
--with-umfpack=PATH use UMFPACK/SuiteSparse from a specified location
--with-ert=PATH Use ERT libraries
--with-zoltan=PATH Use ZOLTAN libraries
--with-tinyxml=PATH use TinyXML library from a specified location
(Note: if not found, then a bundled library will
be used)
--with-cmake=PROGRAM use this program instead of \`cmake' to configure
--with-buildname=TEXT description passed to the CDash configuration
--with-site=TEXT site passed to the CDash configuration
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
LIBS libraries to pass to the linker, e.g. -l<library>
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
CPP C preprocessor
CXX C++ compiler command
CXXFLAGS C++ compiler flags
CXXCPP C++ preprocessor
F77 Fortran 77 compiler command
FFLAGS Fortran 77 compiler flags
FC Fortran compiler command
FCFLAGS Fortran compiler flags
CMAKE_COMMAND Executable used to run cmake scripts
Use these variables to override the choices made by \`configure' or to help
it to find libraries and programs with nonstandard names/locations.
EOF
}
# report an error regarding the arguments
invalid_arg () {
cat <<EOF
configure: error: unrecognized option: \`$1'
Try \`$0 --help' for more information
EOF
}
# notify the user that this argument is not known
unknown_arg () {
cat <<EOF
configure: warning: unrecognized option: \`$1'
EOF
}
# warn only if option checking is enabled
invalid_opt () {
if [ "${option_check}" = "yes" ]; then
unknown_arg "$@"
fi
}
# default values
prefix=/usr/local
#c_compiler=" -DCMAKE_C_COMPILER=cc"
c_compiler=
c_opts=
#cxx_compiler=" -DCMAKE_CXX_COMPILER=c++"
cxx_compiler=
cxx_opts=
#fort_compiler=" -DCMAKE_Fortran_COMPILER=fc"
fort_compiler=
fort_opts=
#buildtype=" -DCMAKE_BUILD_TYPE=Debug"
buildtype=
#pch_use=" -DPRECOMPILE_HEADERS:BOOL=ON"
pch_use=
#use_openmp=" -DUSE_OPENMP=OFF"
use_openmp=
use_mpi=
#silent_rules=" -DCMAKE_VERBOSE_MAKEFILE=OFF"
silent_rules=
#debug_loc=" -DSYSTEM_DEBUG=OFF"
debug_loc=
#use_lto=" -DWHOLE_PROG_OPTIM=OFF"
use_lto=
#strip_debug=" -DSTRIP_DEBUGGING_SYMBOLS=OFF"
strip_debug=
#use_runpath=" -DUSE_RUNPATH=OFF"
use_runpath=
#use_tests=" -DBUILD_TESTING=ON"
use_tests=
#use_samples=" -DBUILD_EXAMPLES=ON"
use_samples=
#use_ninja="-G\"Unix Makefiles\" "
use_ninja=
#use_underscoring=" -DUSE_UNDERSCORING=OFF"
use_underscoring=
# boost_root=""
boost_root=
boost_libdir=
boost_opts=
# configuration that is passed on to CTest/CDash
buildname=
site=
# if set, this prevents the previous CMake cache from being deleted
config_cache=
# default is to warn for unknown options, but this can be disabled
option_check=yes
# this variable will get feature options
FEATURES=
# this array will get all variable assignments from command-line
VARS=()
# command that launches cmake; look for 2.8 if available
if [ "${CMAKE_COMMAND}" = "" ]; then
if [ -x "$(command -v cmake28)" ]; then
CMAKE_COMMAND=cmake28
else
CMAKE_COMMAND=cmake
fi
fi
# helper routine
uppercase () {
echo "$@" | tr "a-z-" "A-Z_"
}
for OPT in "$@"; do
case "$OPT" in
--*)
OPTARG=${OPT#--}
# OPTARG now contains everything after double dashes
case "${OPTARG}" in
config-cache|cache-file=*)
# prevent the previous CMake cache from being deleted. The
# second option is only here for Dune/autotools compatibility
config_cache="1"
;;
src-dir=*)
# allow the user to use these build macros for another
# project (so source-dir is not relative to us)
srcdir=${OPTARG#*=}
;;
prefix=*)
# remove prefix consisting of everything up to equal sign
prefix=${OPTARG#*=}
;;
help)
usage
exit 0
;;
with-*)
# get the name of the package; everything before equal sign
pkgname=${OPTARG%=*}
pkgname=${pkgname#with-}
# get the location of the package; everyhing after equal sign
test -n "${OPTARG#with-${pkgname}}" && pkgloc=${OPTARG#*=} || pkgloc=""
# the parameter to this option is an executable program, so
# skip the directory test in that case. if we match any of
# these special options, then stop further processing (the
# argument is not a directory anyway)
case "${pkgname}" in
cmake)
CMAKE_COMMAND="${pkgloc}"
continue
;;
buildname)
buildname=" -DBUILDNAME=\"${pkgloc}\""
continue
;;
site)
site=" -DSITE=\"${pkgloc}\""
continue
;;
esac
# tilde expansion; quote safely before running eval on it
eval pkgloc=$(printf "%q" "${pkgloc}")
# expand to full path since CMake changes to source directory (!)
# this also normalize the path name wrt. not having a trailing slash
test -d "${pkgloc}" && pkgloc=$(sh -c "cd \"${pkgloc}\"; pwd")
# special aliases
case "${pkgname}" in
umfpack)
pkgname="SuiteSparse"
;;
tinyxml)
pkgname="TinyXML"
;;
esac
# packages need different suffix for their root (sic)
case "${pkgname}" in
pch)
pch_use=" -DPRECOMPILE_HEADERS:BOOL=ON"
rootvar=""
;;
mpi |\
mpi-prefix)
# specifying path implies use of package
use_mpi=" -DUSE_MPI=ON"
# only set prefix if specified, i.e. setting doubles as flag
test -n "${pkgloc}" && rootvar="_MPI_PREFIX_PATH" || rootvar=""
;;
boost)
# special handling of this package, see further below
boost_root="${pkgloc}"
rootvar=""
;;
boost-libdir)
boost_libdir="${pkgloc}"
rootvar=""
;;
alugrid |\
eigen3 |\
ert |\
metis |\
superlu |\
SuiteSparse |\
TinyXML |\
ug |\
opm |\
opm-* |\
dune |\
dune-* |\
zoltan |\
zlib)
rootvar="$(uppercase ${pkgname})_ROOT"
rootvar="${rootvar/-/_}"
;;
*)
invalid_opt --with-${pkgname}
rootvar=""
;;
esac
# add this to the list of existing features
test -n "${rootvar}" && \
FEATURES="${FEATURES} \"-D${rootvar}=${pkgloc}\""
;;
without-* | \
disable-*)
# get the name of the package
pkgname=$OPTARG
pkgname=${pkgname#disable-}
pkgname=${pkgname#without-}
# casing is of course different
case "${pkgname}" in
option-checking)
option_check=no
# special flag: don't disable any particular package
pkgname=""
;;
debug)
buildtype=" -DCMAKE_BUILD_TYPE=Release"
# special flag: don't disable any particular package
pkgname=""
;;
pch)
pch_use=" -DPRECOMPILE_HEADERS:BOOL=OFF"
pkgname=""
;;
runpath)
use_runpath=" -DUSE_RUNPATH=OFF"
pkgname=""
;;
silent-rules)
silent_rules=" -DCMAKE_VERBOSE_MAKEFILE=ON"
pkgname=""
;;
system-debug)
debug_loc=" -DSYSTEM_DEBUG=OFF"
pkgname=""
;;
wpo |\
lto )
use_lto=" -DWHOLE_PROG_OPTIM=OFF"
pkgname=""
;;
strip-debug )
strip_debug=" -DSTRIP_DEBUGGING_SYMBOLS=OFF"
pkgname=""
;;
openmp)
use_openmp=" -DUSE_OPENMP=OFF"
pkgname=""
;;
mpi | \
parallel)
use_mpi=" -DUSE_MPI=OFF"
pkgname=""
;;
tests)
use_tests=" -DBUILD_TESTING=OFF"
pkgname=""
;;
examples)
use_samples=" -DBUILD_EXAMPLES=OFF"
pkgname=""
;;
ninja)
# just for symmetry with the --enable-ninja option
use_ninja=""
pkgname=""
;;
ert |\
superlu)
pkgname="$(uppercase ${pkgname})"
;;
openmp)
pkgname="OpenMP"
;;
gxx11check)
pkgname="CXX11Features"
;;
umfpack)
pkgname="SuiteSparse"
;;
tinyxml)
pkgname="TinyXML"
;;
*)
invalid_opt --disable-${pkgname}
pkgname=""
;;
esac
# only disable packages if the flag refers to a proper one
test -n "${pkgname}" && \
FEATURES="${FEATURES} -DCMAKE_DISABLE_FIND_PACKAGE_${pkgname}=TRUE"
;;
enable-*)
# what kind of library are we building; shared or static?
kind=${OPTARG#enable-}
case "${kind}" in
system-debug)
debug_loc=" -DSYSTEM_DEBUG=ON"
# special flag; don't set shared/static
shared=""
;;
openmp)
use_openmp=" -DUSE_OPENMP=ON"
# special flag; don't set shared/static
shared=""
;;
mpi | \
parallel)
use_mpi=" -DUSE_MPI=ON"
# special flag; don't set shared/static
shared=""
;;
debug)
buildtype=" -DCMAKE_BUILD_TYPE=Debug"
shared=""
;;
pch)
pch_use=" -DPRECOMPILE_HEADERS:BOOL=ON"
shared=""
;;
runpath)
use_runpath=" -DUSE_RUNPATH=ON"
shared=""
;;
lto)
use_lto=" -DWHOLE_PROG_OPTIM=ON"
shared=""
;;
strip-debug )
strip_debug=" -DSTRIP_DEBUGGING_SYMBOLS=ON"
pkgname=""
;;
tests)
use_tests=" -DBUILD_TESTING=ON"
pkgname=""
;;
examples)
use_samples=" -DBUILD_EXAMPLES=ON"
pkgname=""
;;
underscoring)
use_underscoring=" -DUSE_UNDERSCORING=ON"
pkgname=""
;;
ninja)
# Ninja doesn't support using the Fortran compiler, so
# we'll have to resort to making this assumption
use_underscoring=" -DUSE_UNDERSCORING=ON"
use_ninja="-GNinja "
pkgname=""
;;
# this flag is just for compatibility with the deprecation
# flag in DUNE, so we can build without warnings
fieldvector-size-is-method)
shared=""
;;
shared)
shared="ON"
;;
static)
shared="OFF"
;;
*)
invalid_opt "--enable-${kind}"
shared=""
;;
esac
test -n "${shared}" && \
FEATURES="${FEATURES} -DBUILD_SHARED_LIBS:BOOL=${shared}"
# once we have added this, reset so we don't add again for next opt
shared=""
;;
*)
# remove everything *after* the equal sign
arg=${OPTARG%=*}
invalid_arg "--$arg"
exit 1
;;
esac
;;
[A-Za-z0-9_]*=*)
# collect for further processing later
VARS+=("$OPT")
;;
*)
invalid_arg "$OPT"
exit 1
;;
esac
done
# remove all arguments processed by getopts
shift $((OPTIND-1))
# special handling of Boost: if --with-boost-libdir has been used,
# then the --with-boost turns into specifying the header directory
# and not the search root. this mirrors the functionality in the
# Autotools ax_boost_base.m4. necessary because FindBoost in CMake
# uses two different variables if you want to specify them separately
if [ -n "${boost_libdir}" ]; then
boost_opts=" -DBOOST_LIBRARYDIR=\"${boost_libdir}\""
if [ -n "${boost_root}" ]; then
boost_opts="${boost_opts} -DBOOST_INCLUDEDIR=\"${boost_root}\""
fi
else
if [ -n "${boost_root}" ]; then
boost_opts=" -DBOOST_ROOT=\"${boost_root}\""
else
boost_opts=""
fi
fi
# notice the usage of a quoted array: each element will be returned
# even with spaces.
for a in "${VARS[@]}"; do
case "$a" in
ACLOCAL_*=*)
# remove Autotools-specific variables.
;;
CC=*)
# special processing for compiler options
a=${a#CC=}
[ -x "$(command -v "$a")" ] && a=$(command -v "$a")
c_compiler=" -DCMAKE_C_COMPILER=\"${a/\"/\\\"}\""
;;
CXX=*)
a=${a#CXX=}
[ -x "$(command -v "$a")" ] && a=$(command -v "$a")
cxx_compiler=" -DCMAKE_CXX_COMPILER=\"${a/\"/\\\"}\""
;;
CFLAGS=*)
a=${a#CFLAGS=}
c_opts=" -DCMAKE_BUILD_TYPE=Custom -DCMAKE_C_FLAGS=\"${a/\"/\\\"}\""
;;
CXXFLAGS=*)
a=${a#CXXFLAGS=}
cxx_opts=" -DCMAKE_BUILD_TYPE=Custom -DCMAKE_CXX_FLAGS=\"${a/\"/\\\"}\""
;;
FC=*)
a=${a#FC=}
[ -x "$(command -v "$a")" ] && a=$(command -v "$a")
fort_compiler=" -DCMAKE_Fortran_COMPILER=\"${a/\"/\\\"}\""
;;
FFLAGS=*)
a=${a#FFLAGS=}
fort_opts=" -DCMAKE_BUILD_TYPE=Custom -DCMAKE_Fortran_FLAGS=\"${a/\"/\\\"}\""
;;
*)
ENVVARS="$ENVVARS \"${a/\"/\\\"}\""
;;
esac
done
# only wrap in env command if any variable were actually passed
[ -n "${ENVVARS}" ] && ENVVARS="env ${ENVVARS} "
# delete the previous 'CMakeFiles' directory. this prevents an endless
# loop if variables that require a full regeneration of the cache are
# set (most notably 'CXX' and 'CXX_FLAGS').
# For more details, see http://www.cmake.org/Bug/view.php?id=14119
if test "$config_cache" = ""; then
echo "--- deleting previous CMake files ---"
rm -rf CMakeFiles
rm -f CMakeCache.txt
elif test "$c_compiler$c_opts$cxx_compiler$cxx_opts$fort_compiler$fort_opts" != ""; then
echo "--- WARNING '--config-cache' option specified but a compiler was set"
echo "--- from the command line. This may lead to an infinite loop!"
fi
# pass everything on to CMake
CMDLINE="${ENVVARS}${CMAKE_COMMAND} \"${srcdir}\" ${use_ninja}\"-DCMAKE_INSTALL_PREFIX=$prefix\" -DSIBLING_SEARCH=OFF${buildtype}${pch_use}${silent_rules}${debug_loc}${use_openmp}${use_mpi}${use_lto}${strip_debug}${use_runpath}${use_tests}${use_samples}${use_underscoring}${c_compiler}${c_opts}${cxx_compiler}${cxx_opts}${fort_compiler}${fort_opts}${boost_opts}${buildname}${site} ${FEATURES}"
echo --- calling CMake ---
echo "${CMDLINE}"
eval exec "${CMDLINE}"

View File

@@ -19,51 +19,59 @@
# <http://www.vtk.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file>
# propagate these properties from one build system to the other
set (@opm-project_NAME@_VERSION "@opm-project_VERSION@")
set (@opm-project_NAME@_DEFINITIONS "@opm-project_DEFINITIONS@")
set (@opm-project_NAME@_INCLUDE_DIRS "@opm-project_INCLUDE_DIRS@")
set (@opm-project_NAME@_LIBRARY_DIRS "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@")
set (@opm-project_NAME@_LINKER_FLAGS "@opm-project_LINKER_FLAGS@")
set (@opm-project_NAME@_CONFIG_VARS "@opm-project_CONFIG_VARS@")
# Prevent multiple inclusions
if(NOT @opm-project_NAME@_FOUND)
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" @PREREQ_LOCATION@)
include(@opm-project_NAME@-prereqs)
# propagate these properties from one build system to the other
set (@opm-project_NAME@_VERSION "@opm-project_VERSION@")
set (@opm-project_NAME@_DEFINITIONS "@opm-project_DEFINITIONS@")
set (@opm-project_NAME@_INCLUDE_DIRS "@opm-project_INCLUDE_DIRS@")
set (@opm-project_NAME@_LIBRARY_DIRS "@opm-project_LIBRARY_DIRS@" "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@")
set (@opm-project_NAME@_LINKER_FLAGS "@opm-project_LINKER_FLAGS@")
set (@opm-project_NAME@_CONFIG_VARS "@opm-project_CONFIG_VARS@")
set (HAVE_@opm-project_NAME_UC@ 1)
# libraries come from the build tree where this file was generated
set (@opm-project_NAME@_LIBRARY "@opm-project_LIBRARY@")
set (@opm-project_NAME@_LIBRARIES ${@opm-project_NAME@_LIBRARY} "@opm-project_LIBRARIES@")
mark_as_advanced (@opm-project_NAME@_LIBRARY)
# libraries come from the build tree where this file was generated
set (@opm-project_NAME@_LIBRARY "@opm-project_LIBRARY@")
set (@opm-project_NAME@_LIBRARIES ${@opm-project_NAME@_LIBRARY} "@opm-project_LIBRARIES@")
mark_as_advanced (@opm-project_NAME@_LIBRARY)
# not all projects have targets; conditionally add this part
if (NOT "@opm-project_TARGET@" STREQUAL "")
# add the library as a target, so that other things in the project including
# this file may depend on it and get rebuild if this library changes.
add_library (@opm-project_TARGET@ UNKNOWN IMPORTED)
set_property (TARGET @opm-project_TARGET@ PROPERTY IMPORTED_LOCATION "${@opm-project_NAME@_LIBRARY}")
endif (NOT "@opm-project_TARGET@" STREQUAL "")
# not all projects have targets; conditionally add this part
if (NOT "@opm-project_TARGET@" STREQUAL "")
# add the library as a target, so that other things in the project including
# this file may depend on it and get rebuild if this library changes.
if(NOT TARGET @opm-project_TARGET@)
get_filename_component(_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
include("${_dir}/@opm-project_NAME@-targets.cmake")
endif()
endif (NOT "@opm-project_TARGET@" STREQUAL "")
# ensure that we build with support for C++11 to preserve ABI
string (REPLACE "@CXX_STD0X_FLAGS@" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string (REPLACE "@CXX_STDLIB_FLAGS@" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string (STRIP "${CMAKE_CXX_FLAGS}" CMAKE_CXX_FLAGS)
set (CMAKE_CXX_FLAGS "@CXX_STD0X_FLAGS@@CXX_SPACE@@CXX_STDLIB_FLAGS@ ${CMAKE_CXX_FLAGS}")
# same as above, but for C99
string (REPLACE "@C_STD99_FLAGS@" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
string (STRIP "${CMAKE_C_FLAGS}" CMAKE_C_FLAGS)
set (CMAKE_C_FLAG "@C_STD99_FLAGS@ ${CMAKE_C_FLAGS}")
# build with OpenMP if that was found
if (NOT "@OpenMP_C_FLAGS@" STREQUAL "")
string (REPLACE "@OpenMP_C_FLAGS@" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
string (STRIP "${CMAKE_C_FLAGS}" CMAKE_C_FLAGS)
set (CMAKE_C_FLAG "@OpenMP_C_FLAGS@ ${CMAKE_C_FLAGS}")
endif (NOT "@OpenMP_C_FLAGS@" STREQUAL "")
if (NOT "@OpenMP_CXX_FLAGS@" STREQUAL "")
string (REPLACE "@OpenMP_CXX_FLAGS@" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
# ensure that we build with support for C++11 to preserve ABI
string (REPLACE "@CXX_STD0X_FLAGS@" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string (REPLACE "@CXX_STDLIB_FLAGS@" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string (STRIP "${CMAKE_CXX_FLAGS}" CMAKE_CXX_FLAGS)
set (CMAKE_C_FLAG "@OpenMP_CXX_FLAGS@ ${CMAKE_CXX_FLAGS}")
endif (NOT "@OpenMP_CXX_FLAGS@" STREQUAL "")
set (CMAKE_CXX_FLAGS "@CXX_STD0X_FLAGS@@CXX_SPACE@@CXX_STDLIB_FLAGS@ ${CMAKE_CXX_FLAGS}")
# this is the contents of config.h as far as our probes can tell:
# same as above, but for C99
string (REPLACE "@C_STD99_FLAGS@" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
string (STRIP "${CMAKE_C_FLAGS}" CMAKE_C_FLAGS)
set (CMAKE_C_FLAG "@C_STD99_FLAGS@ ${CMAKE_C_FLAGS}")
# extra code
@OPM_PROJECT_EXTRA_CODE@
# build with OpenMP if that was found
if (NOT "@OpenMP_C_FLAGS@" STREQUAL "")
string (REPLACE "@OpenMP_C_FLAGS@" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
string (STRIP "${CMAKE_C_FLAGS}" CMAKE_C_FLAGS)
set (CMAKE_C_FLAG "@OpenMP_C_FLAGS@ ${CMAKE_C_FLAGS}")
endif (NOT "@OpenMP_C_FLAGS@" STREQUAL "")
if (NOT "@OpenMP_CXX_FLAGS@" STREQUAL "")
string (REPLACE "@OpenMP_CXX_FLAGS@" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string (STRIP "${CMAKE_CXX_FLAGS}" CMAKE_CXX_FLAGS)
set (CMAKE_C_FLAG "@OpenMP_CXX_FLAGS@ ${CMAKE_CXX_FLAGS}")
endif (NOT "@OpenMP_CXX_FLAGS@" STREQUAL "")
# this is the contents of config.h as far as our probes can tell:
# extra code
@OPM_PROJECT_EXTRA_CODE@
endif()

42
configure vendored
View File

@@ -1,42 +0,0 @@
#!/bin/sh
# this file is supposed to be located in the source directory
src_dir=$(dirname $0)
# scan the arguments and set this if build macros could be specified
mod_dir=
for OPT in "$@"; do
case "$OPT" in
--with-opm-common=*)
# remove everything before equal sign and assign the rest
mod_dir=${OPT#*=}
# tilde expansion; note that doing eval may have side effects
mod_dir=$(eval echo $mod_dir)
# absolute path
[ -d "$mod_dir" ] && mod_dir=$(cd $mod_dir ; pwd)
;;
esac
done
# special work around the fact that dunecontrol does not specify
# --with-$MODULE for the module it attempts to build
ADDITIONAL_PARAMS=""
if test -z "$mod_dir"; then
ADDITIONAL_PARAMS="--with-opm-common=\"$(pwd)\""
fi
# if it isn't specified, the look around in other known places
conf_file=cmake/Scripts/configure
if [ -z "$mod_dir" ]; then
if [ -r "$src_dir/$conf_file" ]; then
mod_dir="$src_dir"
fi
fi
# terminate with error message here if the module directory is not found
if [ ! -r "$mod_dir/$conf_file" ]; then
echo Build macros not located in \"$mod_dir\", use --with-opm-common= to specify! 1>&2
exit 1
fi
# forward to the corresponding script in the cmake/Scripts/ directory
exec "$mod_dir/$conf_file" --src-dir="$src_dir" "$@" $ADDITIONAL_PARAMS

2
debian/changelog vendored
View File

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

4
debian/control vendored
View File

@@ -4,7 +4,9 @@ Maintainer: Arne Morten Kvarving <arne.morten.kvarving@sintef.no>
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
ghostscript, libboost-system-dev, libboost-test-dev,
libecl-dev, libboost-regex-dev, libboost-filesystem-dev,
zlib1g-dev
Standards-Version: 3.9.2
Section: libs
Homepage: http://opm-project.org

336
docs/keywords.txt Normal file
View File

@@ -0,0 +1,336 @@
Keywords is the most important aspect of the ECLIPSE datafile
parser.
1. The structure of a keyword
-----------------------------
A keyword is the fundamental unit when parsing. Keywords are added to
the parser by schema definitions. The schema definition of the keywords
are given as Json files under the opm/share/keywords directory. Json
can be thought of as a lean alternative to XML, you will find it described
here: http://www.json.org/
As part of the build process these keyword definitions are compiled
to ParserKeyword instances.
1.1 Starting a keyword
----------------------
The keywords are defined as follows:
1. The keyword should start in column 0; everything beyond character
8 is ignored.
2. The keyword should start with a alphabet character, subsequent
characters should be alphanumeric or in the set [-,_,+].
3. We think ECLIPSE is case insensitive.
This is cehcked by the static method:
ParserKeyword::validDeckName(). An important part of the parsing of
keywords is to detect when the keyword specification is complete. For
most keywords we can detect that either by a terminating '/' or the
keywords have a predefined size, but for some odd keywords we can not
reliably detect the end-of-keyword condition and instead we terminate
keyword1 when we find a string which corresponds to the start of a new
keyword. Examples of such oddball keywords include: VFPPROD and
VFPINJ.
1.2 Records
-----------
The data content of a keyword comes as a collection of
records. Records are a collection of 'data', terminated by a '/'. Here
are three examples of records:
'METRES' /
1 'OFF' 100 '*' 24.0 /
0.26 0.27 0.26 0.78
0.82 0.66 0.27 0.78
0.76 0.56 0.23 0.67 /
From these examples we see that:
1. One record can contain a mix of integer, float and string values.
2. Records typically correspond to one line in the data-file, but
that is purely convention; the records can be sprinkled with
newlines.
3. Each record is terminated with a '/'
1.3 How many records in a keyword
---------------------------------
One of the first structural elements which must be configured into the
the parser keywords is the number of records in the different
keywords, this is closely related to how the keyboard is
terminated. Here comes some typical examples of keywords:
GRID
WCONHIST
... /
... /
... /
/
---\
EQLDIMS |
.... / |
|
EQUIL |
.... / |
.... / |
---/
VFPPROD
A .. /
B... /
.... /
.... /
PVGO
/
/
In the list above here the GRID keyword has zero records, i.e. no data
at all. The WCONHIST keyword has three records of data, the EQLDIMS
keyword has one record, the EQUIL keyword has two records and finally
the VFPPROD keyword has four records. The number of records, or how to
infer it, must be configured with the "size" attribute in the JSON
configuration. When it comes to the number of records and termination
we currently have five different categories:
1. Keywords with a fixed number of records. Both the GRID keyword
and the EQLDIMS keyword have a fixed number of records, zero and
one respectively. These keywords are therefor not explicitly
terminated in any way, and the "size" attribute has the numerical
explicitly:
{"name" : "EQLDIMS" , "size" : 1 , ....}
{"name" : "GRID" , "size" : 0, .... }
2. Keywords with a variable number of records like the
WCONHIST. Becase the number of records is not known in advance
this keyword must be explicitly terminated with a '/'. This is
the most common configuration and for keywords of this type it is
not necessary to specify a size attribute at all:
{"name" : "WCONHIST" , .... }
3. Keywords where the number of records is inferred from the content
of another keyword; this is the case with EQUIL which reads the
number of records from the xxx item of the EQLDIMS keyword. Since
the number of records is known in advance (indirectly through the
EQLDIMS keyword) the EQUIL keyword is not explicitly terminated
with a '/'. In the json file this is specified with the "size"
attribute being an object containing the name and item of keyword
which should be consulted to infer the size; so for the EQUIL
keyword the size attribute looks like:
{"name" : "EQUIL" ,
"size" : {"keyword" : "EQLDIMS" , "item" : "NTEQUL"} , ...
When parsing the EQUIL keyword the parser will consult the
already parsed content of the 'EQLDIMS' keyword (i.e. a
DeckKeyword instance) and get the numerical value of the 'NTEQUL'
item.
4. For some keywords the number of records should be calculated
run-time based based on the content of the first records in the
keyword - this at least applies to VFPPROD and VFPINJ. Since the
size of the keyword is deterministic - given the first few
records - the keyword is not slash terminated.
To infer the number of records in the keyword based on an
internal calculation is not supported, hence for these keywords
size is given as unkown, and the keywords are terminated when the
next valid keyword is found:
{"name" : "VFPPROD" , "size" : "UNKNOWN", ....
5. Tables PVTG and PVTO: The two tables PVTG and PVTO are special
cased. The special casing should probably be removed, and the
"size" : "UNKNOWN" could be used for these two keyword.
1.4 The content of a record: items
----------------------------------
A record consist of one or several items. An item can consist of one
or several values from the record, for items with more than one value
it is not possible to specify the exact number of values - the item
will just consume the remaining values in the input stream. An item
has a name, a data type and optionally a default value. For instance
the WCONHIST keyword has the the following items specification:
"items":
[{"name" : "WELL" , "value_type" : "STRING"},
{"name" : "STATUS" , "value_type" : "STRING" , "default" : "OPEN"},
{"name" : "CMODE" , "value_type" : "STRING"},
{"name" : "ORAT" , "value_type" : "DOUBLE", "default" : 0.0, "dimension" : "LiquidSurfaceVolume/Time"},
{"name" : "WRAT" , "value_type" : "DOUBLE" , "default" : 0.0, "dimension" : "LiquidSurfaceVolume/Time"},
{"name" : "GRAT" , "value_type" : "DOUBLE" , "default" : 0.0, "dimension" : "GasSurfaceVolume/Time"},
{"name" : "VFPTable" , "value_type" : "INT" , "default" : 0.0 , "comment":"The default is a state variable"},
{"name" : "Lift" , "value_type" : "DOUBLE" , "default" : 0.0 , "comment":"The default is a state variable"},
{"name" : "THP" , "value_type" : "DOUBLE" , "default" : 0.0 , "dimension" : "Pressure"},
{"name" : "BHP" , "value_type" : "DOUBLE" , "default" : 0.0 ,"dimension" : "Pressure"},
{"name" : "NGLRAT" , "value_type" : "DOUBLE" , "default" : 0.0 ,"dimension" : "LiquidSurfaceVolume/Time"}]}
Here we can see the following:
1. The items can be of types string, integer and float, the type is
specified with the "value_type" attribute which must equal
"STRING", "DOUBLE" or "INT".
2. You can optionally specify a default value, see the discussion of
the parsing workflow below for the treatment of defaults.
3. For items of type double you can specify a dimension, see XXXX for
the available dimensions. For quantities with a dimension the
parser will convert to SI units, and the DeckDoubleItem class has
a getSIDouble() and getRawDouble() method.
Items consuming the rest of the record
--------------------------------------
Most of the items will consume exactly one value from the input deck,
but it is also possible that the last item consumes the remaining
items in the input deck, these typically correspond to table keywords
or lists of memnonics. In the input deck the PVTG keyword will
typically appear like this:
PVTG
200 0.15 0.15 10
0.20 0.20 12
0.25 0.20 15 /
250 0.05 0.05 20
0.15 0.10 40 /
...
In the manual this is described as two tables with three columns, one
with three rows and one with two rows. The leading values of 200 and
250 are the pressure values where the two tables apply. The visual
formatting in the deck, and also the written desciption in the manual,
strongly hints at a table structure - however from a parsing point of
view this corresponds to just two records of different length. Both
records start with a pressure value, and then follows 3n consecutive
values. The item configuration of PVTG looks like this:
"items" : [
{"name":"GAS_PRESSURE", "value_type" : "DOUBLE", "dimension":"Pressure" },
{"name":"DATA", "size_type" : "ALL" , "value_type":"DOUBLE" ,
"dimension" : ["OilDissolutionFactor","OilDissolutionFactor","Viscosity"]}
]
I.e. first we consume one value from the input deck and assign it to
the GAS_PRESSURE item, then the DATA item has "size_type" : "ALL" -
meaning that this item will consume the the rest of the values in the
input record. Also observe that for the "DATA" item the dimension is a
vector of three elements, when converting to SI the dimension applied
to element i is given as:
dim[i] = dimension[i % 3]
In addition to tables the grid property keywords use items which
consume the rest of the record. For instance the PORO keyword will
typcially look like this in the input deck:
PORO
0.14 0.15 0.0 0.10
0.16 0.25 0.1 0.11
0.14 0.15 0.0 0.09
...
0.21 0.07 0.1 0.13
/
From a parsing point of view this is one single record; which contains
one item consuming all of the values in the input deck. In the
configuration this could have been configured as:
"items" : [{"name" : "DATA",
"value_type" : "DOUBLE" ,
"size_type" : "ALL" ,
"default" : 0 ,
"dimension" : "1"}]
However, since keywords containing large data arrays, like e.g. COORD
and PERMX are quite common a shortcut has been created for such
keywords, for instance the PORO keyword is configures as:
{"name" : "PORO" , "sections" : ["GRID"],
"data" : {"value_type" : "DOUBLE" , "default" : 0 , "dimension":"1"}}
i.e. the "data" attribute is used as shorthand to configure a keyword
with one record and one item which consumes all the data of the input
deck.
Multirecord keyword configuration
---------------------------------
Units and dimensions
--------------------
The values given in the input dataset are generally dimensionfull, and
before the simulator can start we must convert to internal SI values
based on the unit system used in the input deck. In the input deck the
different physical quantities are generally expressed with
per-quantity units. The unit system is *not* based on selecting a unit
for the fundamental dimensions length, mass and time and then deriving
composite units based on the dimension of the composite quantity. As a
consequence the list of dimensions supported by the parser is long,
and growing. The current list can be found in the source file:
opm/parser/eclipse/Units/UnitSystem.cpp
Default values
--------------
Classes:
--------
The library contains classes along two dimensions:
+----------------+ +----------------+ +----------------+
| Parser | | RawDeck | | Deck |
+----------------+ +----------------+ +----------------+
+----------------+ +----------------+ +----------------+
| ParserKeyword | | Rawkeyword | | DeckKeyword |
+----------------+ +----------------+ +----------------+
+----------------+ +----------------+ +----------------+
| ParserRecord | | RawRecord | | DeckRecord |
+----------------+ +----------------+ +----------------+
+----------------+ +----------------+
| ParserItem | | DeckItem |
+----------------+ +----------------+

View File

@@ -5,8 +5,9 @@
Module: opm-common
Description: Open Porous Media Initiative shared infrastructure
Version: 2017.10-pre
Label: 2017.10-pre
Version: 2018.04-rc1
Label: 2018.04-rc1
Maintainer: opm@opm-project.org
MaintainerName: OPM community
Url: http://opm-project.org
Depends: dune-common

50
examples/opmi.cpp Normal file
View File

@@ -0,0 +1,50 @@
/*
Copyright 2013 Statoil ASA.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#include <iostream>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
inline void loadDeck( const char * deck_file) {
Opm::ParseContext parseContext;
Opm::Parser parser;
std::cout << "Loading deck: " << deck_file << " ..... "; std::cout.flush();
auto deck = parser.parseFile(deck_file, parseContext);
std::cout << "parse complete - creating EclipseState .... "; std::cout.flush();
Opm::EclipseState state( deck, parseContext );
Opm::Schedule schedule( deck, state.getInputGrid(), state.get3DProperties(), state.runspec().phases(), parseContext);
Opm::SummaryConfig summary( deck, schedule, state.getTableManager( ), parseContext );
std::cout << "complete." << std::endl;
}
int main(int argc, char** argv) {
for (int iarg = 1; iarg < argc; iarg++)
loadDeck( argv[iarg] );
}

View File

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

View File

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

247
external/cjson/README vendored Normal file
View File

@@ -0,0 +1,247 @@
/*
Copyright (c) 2009 Dave Gamble
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
Welcome to cJSON.
cJSON aims to be the dumbest possible parser that you can get your job done with.
It's a single file of C, and a single header file.
JSON is described best here: http://www.json.org/
It's like XML, but fat-free. You use it to move data around, store things, or just
generally represent your program's state.
First up, how do I build?
Add cJSON.c to your project, and put cJSON.h somewhere in the header search path.
For example, to build the test app:
gcc cJSON.c test.c -o test -lm
./test
As a library, cJSON exists to take away as much legwork as it can, but not get in your way.
As a point of pragmatism (i.e. ignoring the truth), I'm going to say that you can use it
in one of two modes: Auto and Manual. Let's have a quick run-through.
I lifted some JSON from this page: http://www.json.org/fatfree.html
That page inspired me to write cJSON, which is a parser that tries to share the same
philosophy as JSON itself. Simple, dumb, out of the way.
Some JSON:
{
"name": "Jack (\"Bee\") Nimble",
"format": {
"type": "rect",
"width": 1920,
"height": 1080,
"interlace": false,
"frame rate": 24
}
}
Assume that you got this from a file, a webserver, or magic JSON elves, whatever,
you have a char * to it. Everything is a cJSON struct.
Get it parsed:
cJSON *root = cJSON_Parse(my_json_string);
This is an object. We're in C. We don't have objects. But we do have structs.
What's the framerate?
cJSON *format = cJSON_GetObjectItem(root,"format");
int framerate = cJSON_GetObjectItem(format,"frame rate")->valueint;
Want to change the framerate?
cJSON_GetObjectItem(format,"frame rate")->valueint=25;
Back to disk?
char *rendered=cJSON_Print(root);
Finished? Delete the root (this takes care of everything else).
cJSON_Delete(root);
That's AUTO mode. If you're going to use Auto mode, you really ought to check pointers
before you dereference them. If you want to see how you'd build this struct in code?
cJSON *root,*fmt;
root=cJSON_CreateObject();
cJSON_AddItemToObject(root, "name", cJSON_CreateString("Jack (\"Bee\") Nimble"));
cJSON_AddItemToObject(root, "format", fmt=cJSON_CreateObject());
cJSON_AddStringToObject(fmt,"type", "rect");
cJSON_AddNumberToObject(fmt,"width", 1920);
cJSON_AddNumberToObject(fmt,"height", 1080);
cJSON_AddFalseToObject (fmt,"interlace");
cJSON_AddNumberToObject(fmt,"frame rate", 24);
Hopefully we can agree that's not a lot of code? There's no overhead, no unnecessary setup.
Look at test.c for a bunch of nice examples, mostly all ripped off the json.org site, and
a few from elsewhere.
What about manual mode? First up you need some detail.
Let's cover how the cJSON objects represent the JSON data.
cJSON doesn't distinguish arrays from objects in handling; just type.
Each cJSON has, potentially, a child, siblings, value, a name.
The root object has: Object Type and a Child
The Child has name "name", with value "Jack ("Bee") Nimble", and a sibling:
Sibling has type Object, name "format", and a child.
That child has type String, name "type", value "rect", and a sibling:
Sibling has type Number, name "width", value 1920, and a sibling:
Sibling has type Number, name "height", value 1080, and a sibling:
Sibling hs type False, name "interlace", and a sibling:
Sibling has type Number, name "frame rate", value 24
Here's the structure:
typedef struct cJSON {
struct cJSON *next,*prev;
struct cJSON *child;
int type;
char *valuestring;
int valueint;
double valuedouble;
char *string;
} cJSON;
By default all values are 0 unless set by virtue of being meaningful.
next/prev is a doubly linked list of siblings. next takes you to your sibling,
prev takes you back from your sibling to you.
Only objects and arrays have a "child", and it's the head of the doubly linked list.
A "child" entry will have prev==0, but next potentially points on. The last sibling has next=0.
The type expresses Null/True/False/Number/String/Array/Object, all of which are #defined in
cJSON.h
A Number has valueint and valuedouble. If you're expecting an int, read valueint, if not read
valuedouble.
Any entry which is in the linked list which is the child of an object will have a "string"
which is the "name" of the entry. When I said "name" in the above example, that's "string".
"string" is the JSON name for the 'variable name' if you will.
Now you can trivially walk the lists, recursively, and parse as you please.
You can invoke cJSON_Parse to get cJSON to parse for you, and then you can take
the root object, and traverse the structure (which is, formally, an N-tree),
and tokenise as you please. If you wanted to build a callback style parser, this is how
you'd do it (just an example, since these things are very specific):
void parse_and_callback(cJSON *item,const char *prefix)
{
while (item)
{
char *newprefix=malloc(strlen(prefix)+strlen(item->name)+2);
sprintf(newprefix,"%s/%s",prefix,item->name);
int dorecurse=callback(newprefix, item->type, item);
if (item->child && dorecurse) parse_and_callback(item->child,newprefix);
item=item->next;
free(newprefix);
}
}
The prefix process will build you a separated list, to simplify your callback handling.
The 'dorecurse' flag would let the callback decide to handle sub-arrays on it's own, or
let you invoke it per-item. For the item above, your callback might look like this:
int callback(const char *name,int type,cJSON *item)
{
if (!strcmp(name,"name")) { /* populate name */ }
else if (!strcmp(name,"format/type") { /* handle "rect" */ }
else if (!strcmp(name,"format/width") { /* 800 */ }
else if (!strcmp(name,"format/height") { /* 600 */ }
else if (!strcmp(name,"format/interlace") { /* false */ }
else if (!strcmp(name,"format/frame rate") { /* 24 */ }
return 1;
}
Alternatively, you might like to parse iteratively.
You'd use:
void parse_object(cJSON *item)
{
int i; for (i=0;i<cJSON_GetArraySize(item);i++)
{
cJSON *subitem=cJSON_GetArrayItem(item,i);
// handle subitem.
}
}
Or, for PROPER manual mode:
void parse_object(cJSON *item)
{
cJSON *subitem=item->child;
while (subitem)
{
// handle subitem
if (subitem->child) parse_object(subitem->child);
subitem=subitem->next;
}
}
Of course, this should look familiar, since this is just a stripped-down version
of the callback-parser.
This should cover most uses you'll find for parsing. The rest should be possible
to infer.. and if in doubt, read the source! There's not a lot of it! ;)
In terms of constructing JSON data, the example code above is the right way to do it.
You can, of course, hand your sub-objects to other functions to populate.
Also, if you find a use for it, you can manually build the objects.
For instance, suppose you wanted to build an array of objects?
cJSON *objects[24];
cJSON *Create_array_of_anything(cJSON **items,int num)
{
int i;cJSON *prev, *root=cJSON_CreateArray();
for (i=0;i<24;i++)
{
if (!i) root->child=objects[i];
else prev->next=objects[i], objects[i]->prev=prev;
prev=objects[i];
}
return root;
}
and simply: Create_array_of_anything(objects,24);
cJSON doesn't make any assumptions about what order you create things in.
You can attach the objects, as above, and later add children to each
of those objects.
As soon as you call cJSON_Print, it renders the structure to text.
The test.c code shows how to handle a bunch of typical cases. If you uncomment
the code, it'll load, parse and print a bunch of test files, also from json.org,
which are more complex than I'd care to try and stash into a const char array[].
Enjoy cJSON!
- Dave Gamble, Aug 2009

4
external/cjson/README.opm vendored Normal file
View File

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

569
external/cjson/cJSON.c vendored Normal file
View File

@@ -0,0 +1,569 @@
/*
Copyright (c) 2009 Dave Gamble
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/* cJSON */
/* JSON parser in C. */
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <float.h>
#include <limits.h>
#include <ctype.h>
#include "cJSON.h"
static const char *ep;
const char *cJSON_GetErrorPtr(void) {return ep;}
static int cJSON_strcasecmp(const char *s1,const char *s2)
{
if (!s1) return (s1==s2)?0:1;if (!s2) return 1;
for(; tolower(*s1) == tolower(*s2); ++s1, ++s2) if(*s1 == 0) return 0;
return tolower(*(const unsigned char *)s1) - tolower(*(const unsigned char *)s2);
}
static void *(*cJSON_malloc)(size_t sz) = malloc;
static void (*cJSON_free)(void *ptr) = free;
static char* cJSON_strdup(const char* str)
{
size_t len;
char* copy;
len = strlen(str) + 1;
if (!(copy = (char*)cJSON_malloc(len))) return 0;
memcpy(copy,str,len);
return copy;
}
void cJSON_InitHooks(cJSON_Hooks* hooks)
{
if (!hooks) { /* Reset hooks */
cJSON_malloc = malloc;
cJSON_free = free;
return;
}
cJSON_malloc = (hooks->malloc_fn)?hooks->malloc_fn:malloc;
cJSON_free = (hooks->free_fn)?hooks->free_fn:free;
}
/* Internal constructor. */
static cJSON *cJSON_New_Item(void)
{
cJSON* node = (cJSON*)cJSON_malloc(sizeof(cJSON));
if (node) memset(node,0,sizeof(cJSON));
return node;
}
/* Delete a cJSON structure. */
void cJSON_Delete(cJSON *c)
{
cJSON *next;
while (c)
{
next=c->next;
if (!(c->type&cJSON_IsReference) && c->child) cJSON_Delete(c->child);
if (!(c->type&cJSON_IsReference) && c->valuestring) cJSON_free(c->valuestring);
if (c->string) cJSON_free(c->string);
cJSON_free(c);
c=next;
}
}
/* Parse the input text to generate a number, and populate the result into item. */
static const char *parse_number(cJSON *item,const char *num)
{
double n=0,sign=1,scale=0;int subscale=0,signsubscale=1;
/* Could use sscanf for this? */
if (*num=='-') sign=-1,num++; /* Has sign? */
if (*num=='0') num++; /* is zero */
if (*num>='1' && *num<='9') do n=(n*10.0)+(*num++ -'0'); while (*num>='0' && *num<='9'); /* Number? */
if (*num=='.' && num[1]>='0' && num[1]<='9') {num++; do n=(n*10.0)+(*num++ -'0'),scale--; while (*num>='0' && *num<='9');} /* Fractional part? */
if (*num=='e' || *num=='E') /* Exponent? */
{ num++;if (*num=='+') num++; else if (*num=='-') signsubscale=-1,num++; /* With sign? */
while (*num>='0' && *num<='9') subscale=(subscale*10)+(*num++ - '0'); /* Number? */
}
n=sign*n*pow(10.0,(scale+subscale*signsubscale)); /* number = +/- number.fraction * 10^+/- exponent */
item->valuedouble=n;
item->valueint=(int)n;
item->type=cJSON_Number;
return num;
}
/* Render the number nicely from the given item into a string. */
static char *print_number(cJSON *item)
{
char *str;
double d=item->valuedouble;
if (fabs(((double)item->valueint)-d)<=DBL_EPSILON && d<=INT_MAX && d>=INT_MIN)
{
str=(char*)cJSON_malloc(21); /* 2^64+1 can be represented in 21 chars. */
if (str) sprintf(str,"%d",item->valueint);
}
else
{
str=(char*)cJSON_malloc(64); /* This is a nice tradeoff. */
if (str)
{
if (fabs(floor(d)-d)<=DBL_EPSILON && fabs(d)<1.0e60)sprintf(str,"%.0f",d);
else if (fabs(d)<1.0e-6 || fabs(d)>1.0e9) sprintf(str,"%e",d);
else sprintf(str,"%f",d);
}
}
return str;
}
/* Parse the input text into an unescaped cstring, and populate item. */
static const unsigned char firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };
static const char *parse_string(cJSON *item,const char *str)
{
const char *ptr=str+1;char *ptr2;char *out;int len=0;unsigned uc,uc2;
if (*str!='\"') {ep=str;return 0;} /* not a string! */
while (*ptr!='\"' && *ptr && ++len) if (*ptr++ == '\\') ptr++; /* Skip escaped quotes. */
out=(char*)cJSON_malloc(len+1); /* This is how long we need for the string, roughly. */
if (!out) return 0;
ptr=str+1;ptr2=out;
while (*ptr!='\"' && *ptr)
{
if (*ptr!='\\') *ptr2++=*ptr++;
else
{
ptr++;
switch (*ptr)
{
case 'b': *ptr2++='\b'; break;
case 'f': *ptr2++='\f'; break;
case 'n': *ptr2++='\n'; break;
case 'r': *ptr2++='\r'; break;
case 't': *ptr2++='\t'; break;
case 'u': /* transcode utf16 to utf8. */
sscanf(ptr+1,"%4x",&uc);ptr+=4; /* get the unicode char. */
if ((uc>=0xDC00 && uc<=0xDFFF) || uc==0) break; /* check for invalid. */
if (uc>=0xD800 && uc<=0xDBFF) /* UTF16 surrogate pairs. */
{
if (ptr[1]!='\\' || ptr[2]!='u') break; /* missing second-half of surrogate. */
sscanf(ptr+3,"%4x",&uc2);ptr+=6;
if (uc2<0xDC00 || uc2>0xDFFF) break; /* invalid second-half of surrogate. */
uc=0x10000 + (((uc&0x3FF)<<10) | (uc2&0x3FF));
}
len=4;if (uc<0x80) len=1;else if (uc<0x800) len=2;else if (uc<0x10000) len=3; ptr2+=len;
switch (len) {
case 4: *--ptr2 =((uc | 0x80) & 0xBF); uc >>= 6;
case 3: *--ptr2 =((uc | 0x80) & 0xBF); uc >>= 6;
case 2: *--ptr2 =((uc | 0x80) & 0xBF); uc >>= 6;
case 1: *--ptr2 =(uc | firstByteMark[len]);
}
ptr2+=len;
break;
default: *ptr2++=*ptr; break;
}
ptr++;
}
}
*ptr2=0;
if (*ptr=='\"') ptr++;
item->valuestring=out;
item->type=cJSON_String;
return ptr;
}
/* Render the cstring provided to an escaped version that can be printed. */
static char *print_string_ptr(const char *str)
{
const char *ptr;char *ptr2,*out;int len=0;unsigned char token;
if (!str) return cJSON_strdup("");
ptr=str;while ((token=*ptr) && ++len) {if (strchr("\"\\\b\f\n\r\t",token)) len++; else if (token<32) len+=5;ptr++;}
out=(char*)cJSON_malloc(len+3);
if (!out) return 0;
ptr2=out;ptr=str;
*ptr2++='\"';
while (*ptr)
{
if ((unsigned char)*ptr>31 && *ptr!='\"' && *ptr!='\\') *ptr2++=*ptr++;
else
{
*ptr2++='\\';
switch (token=*ptr++)
{
case '\\': *ptr2++='\\'; break;
case '\"': *ptr2++='\"'; break;
case '\b': *ptr2++='b'; break;
case '\f': *ptr2++='f'; break;
case '\n': *ptr2++='n'; break;
case '\r': *ptr2++='r'; break;
case '\t': *ptr2++='t'; break;
default: sprintf(ptr2,"u%04x",token);ptr2+=5; break; /* escape and print */
}
}
}
*ptr2++='\"';*ptr2++=0;
return out;
}
/* Invote print_string_ptr (which is useful) on an item. */
static char *print_string(cJSON *item) {return print_string_ptr(item->valuestring);}
/* Predeclare these prototypes. */
static const char *parse_value(cJSON *item,const char *value);
static char *print_value(cJSON *item,int depth,int fmt);
static const char *parse_array(cJSON *item,const char *value);
static char *print_array(cJSON *item,int depth,int fmt);
static const char *parse_object(cJSON *item,const char *value);
static char *print_object(cJSON *item,int depth,int fmt);
/* Utility to jump whitespace and cr/lf */
static const char *skip(const char *in) {while (in && *in && (unsigned char)*in<=32) in++; return in;}
/* Parse an object - create a new root, and populate. */
cJSON *cJSON_ParseWithOpts(const char *value,const char **return_parse_end,int require_null_terminated)
{
const char *end=0;
cJSON *c=cJSON_New_Item();
ep=0;
if (!c) return 0; /* memory fail */
end=parse_value(c,skip(value));
if (!end) {cJSON_Delete(c);return 0;} /* parse failure. ep is set. */
/* if we require null-terminated JSON without appended garbage, skip and then check for a null terminator */
if (require_null_terminated) {end=skip(end);if (*end) {cJSON_Delete(c);ep=end;return 0;}}
if (return_parse_end) *return_parse_end=end;
return c;
}
/* Default options for cJSON_Parse */
cJSON *cJSON_Parse(const char *value) {return cJSON_ParseWithOpts(value,0,0);}
/* Render a cJSON item/entity/structure to text. */
char *cJSON_Print(cJSON *item) {return print_value(item,0,1);}
char *cJSON_PrintUnformatted(cJSON *item) {return print_value(item,0,0);}
/* Parser core - when encountering text, process appropriately. */
static const char *parse_value(cJSON *item,const char *value)
{
if (!value) return 0; /* Fail on null. */
if (!strncmp(value,"null",4)) { item->type=cJSON_NULL; return value+4; }
if (!strncmp(value,"false",5)) { item->type=cJSON_False; return value+5; }
if (!strncmp(value,"true",4)) { item->type=cJSON_True; item->valueint=1; return value+4; }
if (*value=='\"') { return parse_string(item,value); }
if (*value=='-' || (*value>='0' && *value<='9')) { return parse_number(item,value); }
if (*value=='[') { return parse_array(item,value); }
if (*value=='{') { return parse_object(item,value); }
ep=value;return 0; /* failure. */
}
/* Render a value to text. */
static char *print_value(cJSON *item,int depth,int fmt)
{
char *out=0;
if (!item) return 0;
switch ((item->type)&255)
{
case cJSON_NULL: out=cJSON_strdup("null"); break;
case cJSON_False: out=cJSON_strdup("false");break;
case cJSON_True: out=cJSON_strdup("true"); break;
case cJSON_Number: out=print_number(item);break;
case cJSON_String: out=print_string(item);break;
case cJSON_Array: out=print_array(item,depth,fmt);break;
case cJSON_Object: out=print_object(item,depth,fmt);break;
}
return out;
}
/* Build an array from input text. */
static const char *parse_array(cJSON *item,const char *value)
{
cJSON *child;
if (*value!='[') {ep=value;return 0;} /* not an array! */
item->type=cJSON_Array;
value=skip(value+1);
if (*value==']') return value+1; /* empty array. */
item->child=child=cJSON_New_Item();
if (!item->child) return 0; /* memory fail */
value=skip(parse_value(child,skip(value))); /* skip any spacing, get the value. */
if (!value) return 0;
while (*value==',')
{
cJSON *new_item;
if (!(new_item=cJSON_New_Item())) return 0; /* memory fail */
child->next=new_item;new_item->prev=child;child=new_item;
value=skip(parse_value(child,skip(value+1)));
if (!value) return 0; /* memory fail */
}
if (*value==']') return value+1; /* end of array */
ep=value;return 0; /* malformed. */
}
/* Render an array to text */
static char *print_array(cJSON *item,int depth,int fmt)
{
char **entries;
char *out=0,*ptr,*ret;int len=5;
cJSON *child=item->child;
int numentries=0,i=0,fail=0;
/* How many entries in the array? */
while (child) numentries++,child=child->next;
/* Explicitly handle numentries==0 */
if (!numentries)
{
out=(char*)cJSON_malloc(3);
if (out) strcpy(out,"[]");
return out;
}
/* Allocate an array to hold the values for each */
entries=(char**)cJSON_malloc(numentries*sizeof(char*));
if (!entries) return 0;
memset(entries,0,numentries*sizeof(char*));
/* Retrieve all the results: */
child=item->child;
while (child && !fail)
{
ret=print_value(child,depth+1,fmt);
entries[i++]=ret;
if (ret) len+=strlen(ret)+2+(fmt?1:0); else fail=1;
child=child->next;
}
/* If we didn't fail, try to malloc the output string */
if (!fail) out=(char*)cJSON_malloc(len);
/* If that fails, we fail. */
if (!out) fail=1;
/* Handle failure. */
if (fail)
{
for (i=0;i<numentries;i++) if (entries[i]) cJSON_free(entries[i]);
cJSON_free(entries);
return 0;
}
/* Compose the output array. */
*out='[';
ptr=out+1;*ptr=0;
for (i=0;i<numentries;i++)
{
strcpy(ptr,entries[i]);ptr+=strlen(entries[i]);
if (i!=numentries-1) {*ptr++=',';if(fmt)*ptr++=' ';*ptr=0;}
cJSON_free(entries[i]);
}
cJSON_free(entries);
*ptr++=']';*ptr++=0;
return out;
}
/* Build an object from the text. */
static const char *parse_object(cJSON *item,const char *value)
{
cJSON *child;
if (*value!='{') {ep=value;return 0;} /* not an object! */
item->type=cJSON_Object;
value=skip(value+1);
if (*value=='}') return value+1; /* empty array. */
item->child=child=cJSON_New_Item();
if (!item->child) return 0;
value=skip(parse_string(child,skip(value)));
if (!value) return 0;
child->string=child->valuestring;child->valuestring=0;
if (*value!=':') {ep=value;return 0;} /* fail! */
value=skip(parse_value(child,skip(value+1))); /* skip any spacing, get the value. */
if (!value) return 0;
while (*value==',')
{
cJSON *new_item;
if (!(new_item=cJSON_New_Item())) return 0; /* memory fail */
child->next=new_item;new_item->prev=child;child=new_item;
value=skip(parse_string(child,skip(value+1)));
if (!value) return 0;
child->string=child->valuestring;child->valuestring=0;
if (*value!=':') {ep=value;return 0;} /* fail! */
value=skip(parse_value(child,skip(value+1))); /* skip any spacing, get the value. */
if (!value) return 0;
}
if (*value=='}') return value+1; /* end of array */
ep=value;return 0; /* malformed. */
}
/* Render an object to text. */
static char *print_object(cJSON *item,int depth,int fmt)
{
char **entries=0,**names=0;
char *out=0,*ptr,*ret,*str;int len=7,i=0,j;
cJSON *child=item->child;
int numentries=0,fail=0;
/* Count the number of entries. */
while (child) numentries++,child=child->next;
/* Explicitly handle empty object case */
if (!numentries)
{
out=(char*)cJSON_malloc(fmt?depth+3:3);
if (!out) return 0;
ptr=out;*ptr++='{';
if (fmt) {*ptr++='\n';for (i=0;i<depth-1;i++) *ptr++='\t';}
*ptr++='}';*ptr++=0;
return out;
}
/* Allocate space for the names and the objects */
entries=(char**)cJSON_malloc(numentries*sizeof(char*));
if (!entries) return 0;
names=(char**)cJSON_malloc(numentries*sizeof(char*));
if (!names) {cJSON_free(entries);return 0;}
memset(entries,0,sizeof(char*)*numentries);
memset(names,0,sizeof(char*)*numentries);
/* Collect all the results into our arrays: */
child=item->child;depth++;if (fmt) len+=depth;
while (child)
{
names[i]=str=print_string_ptr(child->string);
entries[i++]=ret=print_value(child,depth,fmt);
if (str && ret) len+=strlen(ret)+strlen(str)+2+(fmt?2+depth:0); else fail=1;
child=child->next;
}
/* Try to allocate the output string */
if (!fail) out=(char*)cJSON_malloc(len);
if (!out) fail=1;
/* Handle failure */
if (fail)
{
for (i=0;i<numentries;i++) {if (names[i]) cJSON_free(names[i]);if (entries[i]) cJSON_free(entries[i]);}
cJSON_free(names);cJSON_free(entries);
return 0;
}
/* Compose the output: */
*out='{';ptr=out+1;if (fmt)*ptr++='\n';*ptr=0;
for (i=0;i<numentries;i++)
{
if (fmt) for (j=0;j<depth;j++) *ptr++='\t';
strcpy(ptr,names[i]);ptr+=strlen(names[i]);
*ptr++=':';if (fmt) *ptr++='\t';
strcpy(ptr,entries[i]);ptr+=strlen(entries[i]);
if (i!=numentries-1) *ptr++=',';
if (fmt) *ptr++='\n';*ptr=0;
cJSON_free(names[i]);cJSON_free(entries[i]);
}
cJSON_free(names);cJSON_free(entries);
if (fmt) for (i=0;i<depth-1;i++) *ptr++='\t';
*ptr++='}';*ptr++=0;
return out;
}
/* Get Array size/item / object item. */
int cJSON_GetArraySize(cJSON *array) {cJSON *c=array->child;int i=0;while(c)i++,c=c->next;return i;}
cJSON *cJSON_GetArrayItem(cJSON *array,int item) {cJSON *c=array->child; while (c && item>0) item--,c=c->next; return c;}
cJSON *cJSON_GetObjectItem(cJSON *object,const char *string) {cJSON *c=object->child; while (c && cJSON_strcasecmp(c->string,string)) c=c->next; return c;}
/* Utility for array list handling. */
static void suffix_object(cJSON *prev,cJSON *item) {prev->next=item;item->prev=prev;}
/* Utility for handling references. */
static cJSON *create_reference(cJSON *item) {cJSON *ref=cJSON_New_Item();if (!ref) return 0;memcpy(ref,item,sizeof(cJSON));ref->string=0;ref->type|=cJSON_IsReference;ref->next=ref->prev=0;return ref;}
/* Add item to array/object. */
void cJSON_AddItemToArray(cJSON *array, cJSON *item) {cJSON *c=array->child;if (!item) return; if (!c) {array->child=item;} else {while (c && c->next) c=c->next; suffix_object(c,item);}}
void cJSON_AddItemToObject(cJSON *object,const char *string,cJSON *item) {if (!item) return; if (item->string) cJSON_free(item->string);item->string=cJSON_strdup(string);cJSON_AddItemToArray(object,item);}
void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item) {cJSON_AddItemToArray(array,create_reference(item));}
void cJSON_AddItemReferenceToObject(cJSON *object,const char *string,cJSON *item) {cJSON_AddItemToObject(object,string,create_reference(item));}
cJSON *cJSON_DetachItemFromArray(cJSON *array,int which) {cJSON *c=array->child;while (c && which>0) c=c->next,which--;if (!c) return 0;
if (c->prev) c->prev->next=c->next;if (c->next) c->next->prev=c->prev;if (c==array->child) array->child=c->next;c->prev=c->next=0;return c;}
void cJSON_DeleteItemFromArray(cJSON *array,int which) {cJSON_Delete(cJSON_DetachItemFromArray(array,which));}
cJSON *cJSON_DetachItemFromObject(cJSON *object,const char *string) {int i=0;cJSON *c=object->child;while (c && cJSON_strcasecmp(c->string,string)) i++,c=c->next;if (c) return cJSON_DetachItemFromArray(object,i);return 0;}
void cJSON_DeleteItemFromObject(cJSON *object,const char *string) {cJSON_Delete(cJSON_DetachItemFromObject(object,string));}
/* Replace array/object items with new ones. */
void cJSON_ReplaceItemInArray(cJSON *array,int which,cJSON *newitem) {cJSON *c=array->child;while (c && which>0) c=c->next,which--;if (!c) return;
newitem->next=c->next;newitem->prev=c->prev;if (newitem->next) newitem->next->prev=newitem;
if (c==array->child) array->child=newitem; else newitem->prev->next=newitem;c->next=c->prev=0;cJSON_Delete(c);}
void cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem){int i=0;cJSON *c=object->child;while(c && cJSON_strcasecmp(c->string,string))i++,c=c->next;if(c){newitem->string=cJSON_strdup(string);cJSON_ReplaceItemInArray(object,i,newitem);}}
/* Create basic types: */
cJSON *cJSON_CreateNull(void) {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_NULL;return item;}
cJSON *cJSON_CreateTrue(void) {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_True;return item;}
cJSON *cJSON_CreateFalse(void) {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_False;return item;}
cJSON *cJSON_CreateBool(int b) {cJSON *item=cJSON_New_Item();if(item)item->type=b?cJSON_True:cJSON_False;return item;}
cJSON *cJSON_CreateNumber(double num) {cJSON *item=cJSON_New_Item();if(item){item->type=cJSON_Number;item->valuedouble=num;item->valueint=(int)num;}return item;}
cJSON *cJSON_CreateString(const char *string) {cJSON *item=cJSON_New_Item();if(item){item->type=cJSON_String;item->valuestring=cJSON_strdup(string);}return item;}
cJSON *cJSON_CreateArray(void) {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_Array;return item;}
cJSON *cJSON_CreateObject(void) {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_Object;return item;}
/* Create Arrays: */
cJSON *cJSON_CreateIntArray(int *numbers,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;a && i<count;i++){n=cJSON_CreateNumber(numbers[i]);if(!i)a->child=n;else suffix_object(p,n);p=n;}return a;}
cJSON *cJSON_CreateFloatArray(float *numbers,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;a && i<count;i++){n=cJSON_CreateNumber(numbers[i]);if(!i)a->child=n;else suffix_object(p,n);p=n;}return a;}
cJSON *cJSON_CreateDoubleArray(double *numbers,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;a && i<count;i++){n=cJSON_CreateNumber(numbers[i]);if(!i)a->child=n;else suffix_object(p,n);p=n;}return a;}
cJSON *cJSON_CreateStringArray(const char **strings,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;a && i<count;i++){n=cJSON_CreateString(strings[i]);if(!i)a->child=n;else suffix_object(p,n);p=n;}return a;}
/* Duplication */
cJSON *cJSON_Duplicate(cJSON *item,int recurse)
{
cJSON *newitem,*cptr,*nptr=0,*newchild;
/* Bail on bad ptr */
if (!item) return 0;
/* Create new item */
newitem=cJSON_New_Item();
if (!newitem) return 0;
/* Copy over all vars */
newitem->type=item->type&(~cJSON_IsReference),newitem->valueint=item->valueint,newitem->valuedouble=item->valuedouble;
if (item->valuestring) {newitem->valuestring=cJSON_strdup(item->valuestring); if (!newitem->valuestring) {cJSON_Delete(newitem);return 0;}}
if (item->string) {newitem->string=cJSON_strdup(item->string); if (!newitem->string) {cJSON_Delete(newitem);return 0;}}
/* If non-recursive, then we're done! */
if (!recurse) return newitem;
/* Walk the ->next chain for the child. */
cptr=item->child;
while (cptr)
{
newchild=cJSON_Duplicate(cptr,1); /* Duplicate (with recurse) each item in the ->next chain */
if (!newchild) {cJSON_Delete(newitem);return 0;}
if (nptr) {nptr->next=newchild,newchild->prev=nptr;nptr=newchild;} /* If newitem->child already set, then crosswire ->prev and ->next and move on */
else {newitem->child=newchild;nptr=newchild;} /* Set newitem->child and move to it */
cptr=cptr->next;
}
return newitem;
}

143
external/cjson/cJSON.h vendored Normal file
View File

@@ -0,0 +1,143 @@
/*
Copyright (c) 2009 Dave Gamble
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef cJSON__h
#define cJSON__h
#include <stdlib.h>
#ifdef __cplusplus
extern "C"
{
#endif
/* cJSON Types: */
#define cJSON_False 0
#define cJSON_True 1
#define cJSON_NULL 2
#define cJSON_Number 3
#define cJSON_String 4
#define cJSON_Array 5
#define cJSON_Object 6
#define cJSON_IsReference 256
/* The cJSON structure: */
typedef struct cJSON {
struct cJSON *next,*prev; /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */
struct cJSON *child; /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */
int type; /* The type of the item, as above. */
char *valuestring; /* The item's string, if type==cJSON_String */
int valueint; /* The item's number, if type==cJSON_Number */
double valuedouble; /* The item's number, if type==cJSON_Number */
char *string; /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */
} cJSON;
typedef struct cJSON_Hooks {
void *(*malloc_fn)(size_t sz);
void (*free_fn)(void *ptr);
} cJSON_Hooks;
/* Supply malloc, realloc and free functions to cJSON */
extern void cJSON_InitHooks(cJSON_Hooks* hooks);
/* Supply a block of JSON, and this returns a cJSON object you can interrogate. Call cJSON_Delete when finished. */
extern cJSON *cJSON_Parse(const char *value);
/* Render a cJSON entity to text for transfer/storage. Free the char* when finished. */
extern char *cJSON_Print(cJSON *item);
/* Render a cJSON entity to text for transfer/storage without any formatting. Free the char* when finished. */
extern char *cJSON_PrintUnformatted(cJSON *item);
/* Delete a cJSON entity and all subentities. */
extern void cJSON_Delete(cJSON *c);
/* Returns the number of items in an array (or object). */
extern int cJSON_GetArraySize(cJSON *array);
/* Retrieve item number "item" from array "array". Returns NULL if unsuccessful. */
extern cJSON *cJSON_GetArrayItem(cJSON *array,int item);
/* Get item "string" from object. Case insensitive. */
extern cJSON *cJSON_GetObjectItem(cJSON *object,const char *string);
/* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */
extern const char *cJSON_GetErrorPtr(void);
/* These calls create a cJSON item of the appropriate type. */
extern cJSON *cJSON_CreateNull(void);
extern cJSON *cJSON_CreateTrue(void);
extern cJSON *cJSON_CreateFalse(void);
extern cJSON *cJSON_CreateBool(int b);
extern cJSON *cJSON_CreateNumber(double num);
extern cJSON *cJSON_CreateString(const char *string);
extern cJSON *cJSON_CreateArray(void);
extern cJSON *cJSON_CreateObject(void);
/* These utilities create an Array of count items. */
extern cJSON *cJSON_CreateIntArray(int *numbers,int count);
extern cJSON *cJSON_CreateFloatArray(float *numbers,int count);
extern cJSON *cJSON_CreateDoubleArray(double *numbers,int count);
extern cJSON *cJSON_CreateStringArray(const char **strings,int count);
/* Append item to the specified array/object. */
extern void cJSON_AddItemToArray(cJSON *array, cJSON *item);
extern void cJSON_AddItemToObject(cJSON *object,const char *string,cJSON *item);
/* Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON. */
extern void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item);
extern void cJSON_AddItemReferenceToObject(cJSON *object,const char *string,cJSON *item);
/* Remove/Detatch items from Arrays/Objects. */
extern cJSON *cJSON_DetachItemFromArray(cJSON *array,int which);
extern void cJSON_DeleteItemFromArray(cJSON *array,int which);
extern cJSON *cJSON_DetachItemFromObject(cJSON *object,const char *string);
extern void cJSON_DeleteItemFromObject(cJSON *object,const char *string);
/* Update array items. */
extern void cJSON_ReplaceItemInArray(cJSON *array,int which,cJSON *newitem);
extern void cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem);
/* Duplicate a cJSON item */
extern cJSON *cJSON_Duplicate(cJSON *item,int recurse);
/* Duplicate will create a new, identical cJSON item to the one you pass, in new memory that will
need to be released. With recurse!=0, it will duplicate any children connected to the item.
The item->next and ->prev pointers are always zero on return from Duplicate. */
/* ParseWithOpts allows you to require (and check) that the JSON is null terminated, and to retrieve the pointer to the final byte parsed. */
extern cJSON *cJSON_ParseWithOpts(const char *value,const char **return_parse_end,int require_null_terminated);
/* Macros for creating things quickly. */
#define cJSON_AddNullToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateNull())
#define cJSON_AddTrueToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateTrue())
#define cJSON_AddFalseToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateFalse())
#define cJSON_AddBoolToObject(object,name,b) cJSON_AddItemToObject(object, name, cJSON_CreateBool(b))
#define cJSON_AddNumberToObject(object,name,n) cJSON_AddItemToObject(object, name, cJSON_CreateNumber(n))
#define cJSON_AddStringToObject(object,name,s) cJSON_AddItemToObject(object, name, cJSON_CreateString(s))
/* When assigning an integer value, it needs to be propagated to valuedouble too. */
#define cJSON_SetIntValue(object,val) ((object)?(object)->valueint=(object)->valuedouble=(val):(val))
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -36,7 +36,7 @@ function parseRevisions {
declare -a BTYPES_ARRAY
for btype in $BTYPES
do
BTYPES_ARRAY=($BTYPES_ARRAY $btype)
BTYPES_ARRAY=(${BTYPES_ARRAY[*]} $btype)
done
TOOLCHAIN_ARRAY=($CMAKE_TOOLCHAIN_FILES)
for index in ${!BTYPES_ARRAY[*]}
@@ -132,6 +132,7 @@ function clone_module {
fi
git fetch --depth 1 origin $2:branch_to_build
git checkout branch_to_build
git log HEAD -1 | cat
test $? -eq 0 || exit 1
popd
}
@@ -172,17 +173,12 @@ function build_upstreams {
# Uses pre-filled arrays downstreams, and associativ array downstreamRev
# which holds the default revisions to use for downstreams
function build_downstreams {
pushd .
cd $WORKSPACE/$configuration/build-$1
cmake --build . --target install
popd
egrep_cmd="xml_grep --wrap testsuites --cond testsuite $WORKSPACE/$configuration/build-$1/testoutput.xml"
for downstream in ${downstreams[*]}
do
echo "Building downstream $downstream=${downstreamRev[$downstream]} configuration=$configuration"
# Build downstream and execute installation
clone_and_build_module $downstream "-DCMAKE_PREFIX_PATH=$WORKSPACE/$configuration/install -DCMAKE_INSTALL_PREFIX=$WORKSPACE/$configuration/install -DOPM_DATA_ROOT=$OPM_DATA_ROOT" ${downstreamRev[$downstream]} $WORKSPACE/$configuration 1
clone_and_build_module $downstream "-DCMAKE_PREFIX_PATH=$WORKSPACE/$configuration/install -DCMAKE_INSTALL_PREFIX=$WORKSPACE/$configuration/install -DOPM_TESTS_ROOT=$OPM_TESTS_ROOT" ${downstreamRev[$downstream]} $WORKSPACE/$configuration 1
test $? -eq 0 || exit 1
# Installation for downstream
@@ -219,7 +215,9 @@ function build_module_full {
mkdir -p $configuration/build-$1
cd $configuration/build-$1
echo "Building main module $1=$sha1 configuration=$configuration"
build_module "-DCMAKE_INSTALL_PREFIX=$WORKSPACE/$configuration/install -DOPM_DATA_ROOT=$OPM_DATA_ROOT" 1 $WORKSPACE
build_module "-DCMAKE_INSTALL_PREFIX=$WORKSPACE/$configuration/install -DOPM_TESTS_ROOT=$OPM_TESTS_ROOT" 1 $WORKSPACE
test $? -eq 0 || exit 1
cmake --build . --target install
test $? -eq 0 || exit 1
popd

View File

@@ -6,26 +6,24 @@ source `dirname $0`/build-opm-module.sh
mkdir deps
ln -sf $WORKSPACE deps/opm-common
declare -a upstreams
upstreams=(libecl)
declare -A upstreamRev
upstreamRev[libecl]=master
# Downstreams and revisions
declare -a downstreams
downstreams=(libecl
opm-parser
opm-output
opm-material
downstreams=(opm-material
opm-grid
opm-core
ewoms
opm-simulators
opm-upscaling
)
declare -A downstreamRev
downstreamRev[libecl]=master
downstreamRev[opm-parser]=master
downstreamRev[opm-material]=master
downstreamRev[opm-core]=master
downstreamRev[opm-grid]=master
downstreamRev[opm-output]=master
downstreamRev[ewoms]=master
downstreamRev[opm-simulators]=master
downstreamRev[opm-upscaling]=master
@@ -33,10 +31,7 @@ downstreamRev[opm-upscaling]=master
parseRevisions
printHeader opm-common
# Setup opm-data if necessary
if grep -q "with downstreams" <<< $ghprbCommentBody
then
source $WORKSPACE/deps/opm-common/jenkins/setup-opm-data.sh
fi
# Setup opm-data
source $WORKSPACE/deps/opm-common/jenkins/setup-opm-tests.sh
build_module_full opm-common

View File

@@ -1,29 +0,0 @@
#!/bin/bash
# Predefined by environment
if test -z "$OPM_DATA_ROOT"
then
OPM_DATA_REVISION="master"
if grep -q "opm-data=" <<< $ghprbCommentBody
then
OPM_DATA_REVISION=pull/`echo $ghprbCommentBody | sed -r 's/.*opm-data=([0-9]+).*/\1/g'`/merge
fi
# Not specified in trigger, use shared copy
if [[ "$OPM_DATA_REVISION" = "master" ]] && [[ ! "$OPM_DATA_ROOT_PREDEFINED" = "" ]]
then
if ! test -d $WORKSPACE/deps/opm-data
then
cp $OPM_DATA_ROOT_PREDEFINED $WORKSPACE/deps/opm-data -R
fi
else
# Specified in trigger, download it
source $WORKSPACE/deps/opm-common/jenkins/build-opm-module.sh
clone_module opm-data $OPM_DATA_REVISION
fi
else
if ! test -d $WORKSPACE/deps/opm-data
then
cp $OPM_DATA_ROOT $WORKSPACE/deps/opm-data -R
fi
fi
OPM_DATA_ROOT=$WORKSPACE/deps/opm-data

29
jenkins/setup-opm-tests.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/bash
# Predefined by environment
if test -z "$OPM_TESTS_ROOT"
then
OPM_TESTS_REVISION="master"
if grep -q "opm-tests=" <<< $ghprbCommentBody
then
OPM_TESTS_REVISION=pull/`echo $ghprbCommentBody | sed -r 's/.*opm-tests=([0-9]+).*/\1/g'`/merge
fi
# Not specified in trigger, use shared copy
if [[ "$OPM_TESTS_REVISION" = "master" ]] && [[ ! "$OPM_TESTS_ROOT_PREDEFINED" = "" ]]
then
if ! test -d $WORKSPACE/deps/opm-tests
then
cp $OPM_TESTS_ROOT_PREDEFINED $WORKSPACE/deps/opm-tests -R
fi
else
# Specified in trigger, download it
source $WORKSPACE/deps/opm-common/jenkins/build-opm-module.sh
clone_module opm-tests $OPM_TESTS_REVISION
fi
else
if ! test -d $WORKSPACE/deps/opm-tests
then
cp $OPM_TESTS_ROOT $WORKSPACE/deps/opm-tests -R
fi
fi
OPM_TESTS_ROOT=$WORKSPACE/deps/opm-tests

View File

@@ -1,58 +0,0 @@
#!/bin/bash
MAIN_REPO=$1 # The repo the update was triggered from
source $WORKSPACE/deps/opm-common/jenkins/build-opm-module.sh
declare -a upstreams # Everything is considered an upstream to aid code reuse
upstreams=(libecl
opm-common
opm-parser
opm-output
opm-material
opm-grid
opm-core
ewoms
opm-simulators
opm-upscaling
)
declare -A upstreamRev
upstreamRev[libecl]=master
upstreamRev[opm-common]=master
upstreamRev[opm-parser]=master
upstreamRev[opm-material]=master
upstreamRev[opm-core]=master
upstreamRev[opm-grid]=master
upstreamRev[opm-output]=master
upstreamRev[ewoms]=master
upstreamRev[opm-simulators]=master
upstreamRev[opm-upscaling]=master
# Setup revision tables
parseRevisions
upstreamRev[$MAIN_REPO]=$sha1
# Create branch name
BRANCH_NAME="update"
for repo in ${upstreams[*]}
do
if [ "${upstreamRev[$repo]}" != "master" ]
then
rev=${upstreamRev[$repo]}
prnumber=${rev//[!0-9]/}
BRANCH_NAME="${BRANCH_NAME}_${repo}_$prnumber"
test -n "$REASON" && REASON+=" "
REASON+="https://github.com/OPM/$repo/pull/$prnumber\n"
fi
done
# Do the commit
export REASON
export BRANCH_NAME
$WORKSPACE/deps/opm-simulators/tests/update_reference_data.sh $OPM_DATA_ROOT
# Finally open the pull request
cd $OPM_DATA_ROOT
git remote add jenkins4opm git@github.com:jenkins4opm/opm-data
git-open-pull -u jenkins4opm --base-account OPM --base-repo opm-data -r /tmp/cmsg $BRANCH_NAME

87
jenkins/update-opm-tests.sh Executable file
View File

@@ -0,0 +1,87 @@
#!/bin/bash
MAIN_REPO=$1 # The repo the update was triggered from
source $WORKSPACE/deps/opm-common/jenkins/build-opm-module.sh
declare -a upstreams # Everything is considered an upstream to aid code reuse
upstreams=(libecl
opm-common
opm-material
opm-grid
ewoms
opm-simulators
opm-upscaling
)
declare -A upstreamRev
upstreamRev[libecl]=master
upstreamRev[opm-common]=master
upstreamRev[opm-material]=master
upstreamRev[opm-grid]=master
upstreamRev[ewoms]=master
upstreamRev[opm-simulators]=master
upstreamRev[opm-upscaling]=master
# Setup revision tables
parseRevisions
upstreamRev[$MAIN_REPO]=$sha1
# Create branch name
BRANCH_NAME="update"
for repo in ${upstreams[*]}
do
if [ "${upstreamRev[$repo]}" != "master" ]
then
rev=${upstreamRev[$repo]}
prnumber=${rev//[!0-9]/}
BRANCH_NAME="${BRANCH_NAME}_${repo}_$prnumber"
test -n "$REASON" && REASON+=" "
REASON+="https://github.com/OPM/$repo/pull/$prnumber\n"
fi
done
# Do the commit
export REASON
export BRANCH_NAME
$WORKSPACE/deps/opm-simulators/tests/update_reference_data.sh $OPM_TESTS_ROOT
# Finally open the pull request
cd $OPM_TESTS_ROOT
git remote add jenkins4opm git@github.com:jenkins4opm/opm-tests
# Do some cleaning of old remote branches
# Easier code with git 2.7+
#BRANCHES=`git branch --sort=committerdate -r | grep jenkins4opm`
#NBRANCHES=`git branch --sort=committerdate -r | grep jenkins4opm | wc -l`
git fetch jenkins4opm # Sadly necessary with older git
BRANCHES=`git for-each-ref --sort=committerdate refs/remotes/jenkins4opm/ --format='%(refname:short)'`
NBRANCHES=`git for-each-ref --sort=committerdate refs/remotes/jenkins4opm/ --format='%(refname:short)' | wc -l`
if test $NBRANCHES -gt 30
then
for BRANCH in $BRANCHES
do
BNAME=`echo $BRANCH | cut -f1 -d '/' --complement`
if [ "$BNAME" != "HEAD" ]
then
git push jenkins4opm :$BNAME
fi
NBRANCHES=$((NBRANCHES-1))
if test $NBRANCHES -lt 30
then
break
fi
done
fi
if [ -n "`echo $BRANCHES | tr ' ' '\n' | grep ^jenkins4opm/$BRANCH_NAME$`" ]
then
GH_TOKEN=`git config --get gitOpenPull.Token`
REV=${upstreamRev[$MAIN_REPO]}
PRNUMBER=${rev//[!0-9]/}
DATA_PR=`curl -X GET https://api.github.com/repos/OPM/opm-tests/pulls?head=jenkins4opm:$BRANCH_NAME | grep '"number":' | awk -F ':' '{print $2}' | sed -e 's/,//' -e 's/ //'`
git push -u jenkins4opm $BRANCH_NAME -f
curl -d "{ \"body\": \"Existing PR https://github.com/OPM/opm-data/pull/$DATA_PR was updated\" }" -X POST https://api.github.com/repos/OPM/$MAIN_REPO/issues/$PRNUMBER/comments?access_token=$GH_TOKEN
else
git-open-pull -u jenkins4opm --base-account OPM --base-repo opm-tests -r /tmp/cmsg $BRANCH_NAME
fi

View File

@@ -11,7 +11,17 @@ set (opm-common_DEPS
"C99"
# compile with C++0x/11 support if available
"CXX11Features REQUIRED"
# various runtime library enhancements
"Boost 1.44.0
COMPONENTS system unit_test_framework REQUIRED"
)
if(ENABLE_ECL_INPUT)
list(APPEND opm-common_DEPS
"ecl REQUIRED"
# various runtime library enhancements
"Boost 1.44.0
COMPONENTS system filesystem unit_test_framework regex REQUIRED")
else()
list(APPEND opm-common_DEPS
# various runtime library enhancements
"Boost 1.44.0
COMPONENTS system unit_test_framework REQUIRED")
endif()

View File

@@ -53,7 +53,8 @@ namespace Opm
/// to obtain that behaviour.
explicit MessageLimiter(const int tag_limit)
: tag_limit_(tag_limit < 0 ? NoLimit : tag_limit),
category_limits_({{Log::MessageType::Note, NoLimit},
category_limits_({{Log::MessageType::Debug, NoLimit},
{Log::MessageType::Note, NoLimit},
{Log::MessageType::Info, NoLimit},
{Log::MessageType::Warning, NoLimit},
{Log::MessageType::Error, NoLimit},
@@ -68,7 +69,8 @@ namespace Opm
{
// Must ensure NoLimit for categories that are not
// explicitly specified in the input.
for (auto category : { Log::MessageType::Note,
for (auto category : { Log::MessageType::Debug,
Log::MessageType::Note,
Log::MessageType::Info,
Log::MessageType::Warning,
Log::MessageType::Error,

View File

@@ -1,62 +0,0 @@
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*
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/>.
*/
/*!
* \file
* \brief Provides a free function to reset the localization settings
*
* Under some circumstances, some environments seem to set a locale which they do not
* install. In turn this leads to std::runtime_errror being thrown by some parts of Boost
* (for some versions) which causes unsolicited program aborts.
*
* This issue asside, it looks pretty weird if the e.g. the number format is inconsistent
* with the language used by rest of the simulation.
*/
#ifndef OPM_RESET_LOCALE_HH
#define OPM_RESET_LOCALE_HH
#include <stdlib.h>
namespace Opm {
inline void resetLocale()
{
#ifndef WIN32
// this probably only works for POSIX compatible operating systems. for all others,
// unsetting a few environment variables should not hurt, though.
unsetenv("LC_ALL");
unsetenv("LANG");
unsetenv("LANGUAGE");
unsetenv("LC_ADDRESS");
unsetenv("LC_COLLATE");
unsetenv("LC_CTYPE");
unsetenv("LC_IDENTIFICATION");
unsetenv("LC_MEASUREMENT");
unsetenv("LC_MESSAGES");
unsetenv("LC_MONETARY");
unsetenv("LC_NAME");
unsetenv("LC_NUMERIC");
unsetenv("LC_PAPER");
unsetenv("LC_TELEPHONE");
unsetenv("LC_TIME");
#endif // !WIN32
}
} // namespace Opm
#endif

View File

@@ -1,311 +0,0 @@
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*
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 2 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/>.
Consult the COPYING file in the top-level source directory of this
module for the precise wording of the license and the list of
copyright holders.
*/
/*!
* \file
* \brief Some templates to wrap the valgrind client request macros
*/
#ifndef OPM_VALGRIND_HPP
#define OPM_VALGRIND_HPP
#include <opm/common/Unused.hpp>
#if HAVE_VALGRIND
#include <valgrind/memcheck.h>
#endif
#if HAVE_VALGRIND
#define OPM_VALGRIND_OPTIM_UNUSED OPM_OPTIM_UNUSED
#else
#define OPM_VALGRIND_OPTIM_UNUSED OPM_UNUSED
#endif
namespace Opm {
namespace Valgrind {
/*!
* \ingroup Valgrind
* \brief Returns whether the program is running under Valgrind or not.
*/
inline bool IsRunning()
{
#if !defined NDEBUG && HAVE_VALGRIND
return RUNNING_ON_VALGRIND;
#else
return false;
#endif
}
/*!
* \ingroup Valgrind
* \brief Make valgrind complain if any of the memory occupied by an object
* is undefined.
*
* Please note that this does not check whether the destinations of an
* object's pointers or references are defined. Also, for performance
* reasons the compiler might insert "padding bytes" between within
* the objects which leads to false positives.
*
* Example:
*
* \code
* int i;
* Valgrind::CheckDefined(i); // Valgrind complains!
* \endcode
*
* \tparam T The type of the object which ought to be checked
*
* \param value the object which valgrind should check
*
* \return true iff there are no undefined bytes in the memory
* occupied by the object.
*/
template <class T>
inline bool CheckDefined(const T& value OPM_VALGRIND_OPTIM_UNUSED)
{
#if !defined NDEBUG && HAVE_VALGRIND
auto tmp = VALGRIND_CHECK_MEM_IS_DEFINED(&value, sizeof(T));
return tmp == 0;
#else
return true;
#endif
}
/*!
* \ingroup Valgrind
* \brief Make valgrind complain if any of the memory occupied by an object
* is not addressable.
*
* Example:
*
* \code
* int* i = NULL;
* Valgrind::CheckAddressable(*i); // Valgrind complains!
* \endcode
*
* \tparam T The type of the object which ought to be checked
*
* \param value the object which valgrind should check
*
* \return true iff there are no unadressable bytes in the memory
* occupied by the object.
*/
template <class T>
inline bool CheckAddressable(const T& value OPM_VALGRIND_OPTIM_UNUSED)
{
#if !defined NDEBUG && HAVE_VALGRIND
auto tmp = VALGRIND_CHECK_MEM_IS_ADDRESSABLE(&value, sizeof(T));
return tmp == 0;
#else
return true;
#endif
}
/*!
* \ingroup Valgrind
* \brief Make valgrind complain if any of the the memory occupied
* by a C-style array objects is undefined.
*
* Please note that this does not check whether the destinations of an
* object's pointers or references are defined. Also, for performance
* reasons the compiler might insert "padding bytes" between within
* the objects which leads to false positives.
*
* Example:
*
* \code
* int i[2];
* Valgrind::CheckDefined(i, 2); // Valgrind complains!
* \endcode
*
* \tparam T The type of the object which ought to be checked
*
* \param value Pointer to the first object of the array.
* \param size The size of the array in number of objects
*
* \return true iff there are no undefined bytes in the memory
* occupied by the array.
*/
template <class T>
inline bool CheckDefined(const T* value OPM_VALGRIND_OPTIM_UNUSED, int size OPM_VALGRIND_OPTIM_UNUSED)
{
#if !defined NDEBUG && HAVE_VALGRIND
auto tmp = VALGRIND_CHECK_MEM_IS_DEFINED(value, size*sizeof(T));
return tmp == 0;
#else
return true;
#endif
}
/*!
* \ingroup Valgrind
* \brief Make the memory on which an object resides undefined in
* valgrind runs.
*
* Example:
*
* \code
* int i = 0;
* Valgrind::SetUndefined(i);
* Valgrind::CheckDefined(i); // Valgrind complains!
* \endcode
*
* \tparam T The type of the object which ought to be set to undefined
*
* \param value The object which's memory valgrind should be told is undefined
*/
template <class T>
inline void SetUndefined(const T &value OPM_VALGRIND_OPTIM_UNUSED)
{
#if !defined NDEBUG && HAVE_VALGRIND
VALGRIND_MAKE_MEM_UNDEFINED(&value, sizeof(T));
#endif
}
/*!
* \ingroup Valgrind
* \brief Make the memory on which an array of object resides
* undefined in valgrind runs.
*
* Example:
*
* \code
* int i[3] = {0, 1, 3};
* Valgrind::SetUndefined(&i[1], 2);
* Valgrind::CheckDefined(i, 3); // Valgrind complains!
* \endcode
*
* \tparam T The type of the object which ought to be set to undefined
*
* \param value Pointer to the first object of the array.
* \param size The size of the array in number of objects
*/
template <class T>
inline void SetUndefined(const T* value OPM_VALGRIND_OPTIM_UNUSED, int size OPM_VALGRIND_OPTIM_UNUSED)
{
#if !defined NDEBUG && HAVE_VALGRIND
VALGRIND_MAKE_MEM_UNDEFINED(value, size*sizeof(T));
#endif
}
/*!
* \ingroup Valgrind
* \brief Make the memory on which an object resides defined.
*
* Example:
*
* \code
* int i;
* Valgrind::SetDefined(i);
* Valgrind::CheckDefined(i); // Valgrind does not complain!
* \endcode
*
* \tparam T The type of the object which valgrind should consider as defined
*
* \param value The object which's memory valgrind should consider as defined
*/
template <class T>
inline void SetDefined(const T& value OPM_VALGRIND_OPTIM_UNUSED)
{
#if !defined NDEBUG && HAVE_VALGRIND
VALGRIND_MAKE_MEM_DEFINED(&value, sizeof(T));
#endif
}
/*!
* \ingroup Valgrind
* \brief Make the memory on which a C-style array of objects resides
* defined.
*
* Example:
*
* \code
* int i[3];
* Valgrind::SetDefined(i, 3);
* Valgrind::CheckDefined(i, 3); // Valgrind does not complain!
* \endcode
*
* \tparam T The type of the object which valgrind should consider as defined
*
* \param value Pointer to the first object of the array.
* \param n The size of the array in number of objects
*/
template <class T>
inline void SetDefined(const T *value OPM_VALGRIND_OPTIM_UNUSED, int n OPM_VALGRIND_OPTIM_UNUSED)
{
#if !defined NDEBUG && HAVE_VALGRIND
VALGRIND_MAKE_MEM_DEFINED(value, n*sizeof(T));
#endif
}
/*!
* \ingroup Valgrind
* \brief Make valgrind complain if an object's memory is accessed.
*
* Example:
*
* \code
* int i = 1;
* Valgrind::SetNoAccess(i);
* int j = i; // Valgrind complains!
* \endcode
*
* \tparam T The type of the object which valgrind should complain if accessed
*
* \param value The object which's memory valgrind should complain if accessed
*/
template <class T>
inline void SetNoAccess(const T &value OPM_VALGRIND_OPTIM_UNUSED)
{
#if !defined NDEBUG && HAVE_VALGRIND
VALGRIND_MAKE_MEM_NOACCESS(&value, sizeof(T));
#endif
}
/*!
* \ingroup Valgrind
* \brief Make valgrind complain if the memory of a C-style array of
* objects is accessed.
*
* Example:
*
* \code
* int i[3] = {0, 1, 2};
* Valgrind::SetNoAccess(i, 2);
* int j = i[1]; // Valgrind complains!
* \endcode
*
* \param value Pointer to the first object of the array.
* \param size The size of the array in number of objects
*/
template <class T>
inline void SetNoAccess(const T *value OPM_VALGRIND_OPTIM_UNUSED, int size OPM_VALGRIND_OPTIM_UNUSED)
{
#if !defined NDEBUG && HAVE_VALGRIND
VALGRIND_MAKE_MEM_NOACCESS(value, size*sizeof(T));
#endif
}
}} // namespace Valgrind, Opm
#endif

View File

@@ -0,0 +1,583 @@
/* -*-C++-*- */
#ifndef _MONOTCUBICINTERPOLATOR_H
#define _MONOTCUBICINTERPOLATOR_H
#include <vector>
#include <map>
#include <string>
/*
MonotCubicInterpolator
Copyright (C) 2006 Statoil ASA
This program 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 2
of the License, or (at your option) any later version.
This program 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 this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
namespace Opm
{
/**
Class to represent a one-dimensional function f with single-valued
argument x. The function is represented by a table of function
values. Interpolation between table values is cubic and monotonicity
preserving if input values are monotonous.
Outside x_min and x_max, the class will extrapolate using the
constant f(x_min) or f(x_max).
Extra functionality:
- Can return (x_1+x_2)/2 where x_1 and x_2 are such that
abs(f(x_1) - f(x_2)) is maximized. This is used to determine where
one should calculate a new value for increased accuracy in the
current function
Monotonicity preserving cubic interpolation algorithm is taken
from Fritsch and Carlson, "Monotone piecewise cubic interpolation",
SIAM J. Numer. Anal. 17, 238--246, no. 2,
$Id$
Algorithm also described here:
http://en.wikipedia.org/wiki/Monotone_cubic_interpolation
@author Håvard Berland <havb (at) statoil.com>, December 2006
@brief Represents one dimensional function f with single valued argument x that can be interpolated using monotone cubic interpolation
*/
class MonotCubicInterpolator {
public:
/**
@param datafilename A datafile with the x values and the corresponding f(x) values
Accepts a filename as input and parses this file for
two-column floating point data, interpreting the data as
representing function values x and f(x).
Ignores all lines not conforming to \<whitespace\>\<float\>\<whitespace\>\<float\>\<whatever\>\<newline\>
*/
explicit MonotCubicInterpolator(const std::string & datafilename)
{
if (!read(datafilename)) {
throw("Unable to constuct MonotCubicInterpolator from file.") ;
} ;
}
/**
@param datafilename A datafile with the x values and the corresponding f(x) values
Accepts a filename as input and parses this file for
two-column floating point data, interpreting the data as
representing function values x and f(x).
Ignores all lines not conforming to \<whitespace\>\<float\>\<whitespace\>\<float\>\<whatever\>\<newline\>
All commas in the file will be treated as spaces when parsing.
*/
explicit MonotCubicInterpolator(const char* datafilename)
{
if (!read(std::string(datafilename))) {
throw("Unable to constuct MonotCubicInterpolator from file.") ;
} ;
}
/**
@param datafilename data file
@param XColumn x values
@param fColumn f values
Accepts a filename as input, and parses the chosen columns in
that file.
*/
MonotCubicInterpolator(const char* datafilename, int xColumn, int fColumn)
{
if (!read(std::string(datafilename),xColumn,fColumn)) {
throw("Unable to constuct MonotCubicInterpolator from file.") ;
} ;
}
/**
@param datafilename data file
@param XColumn x values
@param fColumn f values
Accepts a filename as input, and parses the chosen columns in
that file.
*/
MonotCubicInterpolator(const std::string & datafilename, int xColumn, int fColumn)
{
if (!read(datafilename,xColumn,fColumn)) {
throw("Unable to constuct MonotCubicInterpolator from file.") ;
} ;
}
/**
@param x vector of x values
@param f vector of corresponding f values
Accepts two equal-length vectors as input for constructing
the interpolation object. First vector is the x-values, the
second vector is the function values
*/
MonotCubicInterpolator(const std::vector<double> & x ,
const std::vector<double> & f);
/**
No input, an empty function object is created.
This object must be treated with care until
populated.
*/
MonotCubicInterpolator() { }
/**
@param datafilename A datafile with the x values and the corresponding f(x) values
Accepts a filename as input and parses this file for
two-column floating point data, interpreting the data as
representing function values x and f(x).
returns true on success
All commas in file will be treated as spaces when parsing
Ignores all lines not conforming to \<whitespace\>\<float\>\<whitespace\>\<float\>\<whatever\>\<newline\>
*/
bool read(const std::string & datafilename) {
return read(datafilename,1,2) ;
}
/**
@param datafilename data file
@param XColumn x values
@param fColumn f values
Accepts a filename as input, and parses the chosen columns in
that file.
*/
bool read(const std::string & datafilename, int xColumn, int fColumn) ;
/**
@param x x value
Returns f(x) for given x (input). Interpolates (monotone cubic
or linearly) if necessary.
Extrapolates using the constants f(x_min) or f(x_max) if
input x is outside (x_min, x_max)
@return f(x) for a given x
*/
double operator () (double x) const { return evaluate(x) ; }
/**
@param x x value
Returns f(x) for given x (input). Interpolates (monotone cubic
or linearly) if necessary.
Extrapolates using the constants f(x_min) or f(x_max) if
input x is outside (x_min, x_max)
@return f(x) for a given x
*/
double evaluate(double x) const;
/**
@param x x value
@param errorestimate_output
Returns f(x) and an error estimate for given x (input).
Interpolates (linearly) if necessary.
Throws an exception if extrapolation would be necessary for
evaluation. We do not want to do extrapolation (yet).
The error estimate for x1 < x < x2 is
(x2 - x1)^2/8 * f''(x) where f''(x) is evaluated using
the stencil (1 -2 1) using either (x0, x1, x2) or (x1, x2, x3);
Throws an exception if the table contains only two x-values.
NOT IMPLEMENTED YET!
*/
double evaluate(double x, double & errorestimate_output ) const ;
/**
Minimum x-value, returns both x and f in a pair.
@return minimum x value
@return f(minimum x value)
*/
std::pair<double,double> getMinimumX() const {
// Easy since the data is sorted on x:
return *data.begin();
}
/**
Maximum x-value, returns both x and f in a pair.
@return maximum x value
@return f(maximum x value)
*/
std::pair<double,double> getMaximumX() const {
// Easy since the data is sorted on x:
return *data.rbegin();
}
/**
Maximum f-value, returns both x and f in a pair.
@return x value corresponding to maximum f value
@return maximum f value
*/
std::pair<double,double> getMaximumF() const ;
/**
Minimum f-value, returns both x and f in a pair
@return x value corresponding to minimal f value
@return minimum f value
*/
std::pair<double,double> getMinimumF() const ;
/**
Provide a copy of the x-data as a vector
Unspecified order, but corresponds to get_fVector.
@return x values as a vector
*/
std::vector<double> get_xVector() const ;
/**
Provide a copy of tghe function data as a vector
Unspecified order, but corresponds to get_xVector
@return f values as a vector
*/
std::vector<double> get_fVector() const ;
/**
@param factor Scaling constant
Scale all the function value data by a constant
*/
void scaleData(double factor);
/**
Determines if the current function-value-data is strictly
monotone. This is a utility function for outsiders if they want
to invert the data for example.
@return True if f(x) is strictly monotone, else False
*/
bool isStrictlyMonotone() {
/* Use cached value if it can be trusted */
if (strictlyMonotoneCached) {
return strictlyMonotone;
}
else {
computeInternalFunctionData();
return strictlyMonotone;
}
}
/**
Determines if the current function-value-data is monotone.
@return True if f(x) is monotone, else False
*/
bool isMonotone() const {
if (monotoneCached) {
return monotone;
}
else {
computeInternalFunctionData();
return monotone;
}
}
/**
Determines if the current function-value-data is strictly
increasing. This is a utility function for outsiders if they want
to invert the data for example.
@return True if f(x) is strictly increasing, else False
*/
bool isStrictlyIncreasing() {
/* Use cached value if it can be trusted */
if (strictlyMonotoneCached) {
return (strictlyMonotone && strictlyIncreasing);
}
else {
computeInternalFunctionData();
return (strictlyMonotone && strictlyIncreasing);
}
}
/**
Determines if the current function-value-data is monotone and increasing.
@return True if f(x) is monotone and increasing, else False
*/
bool isMonotoneIncreasing() const {
if (monotoneCached) {
return (monotone && increasing);
}
else {
computeInternalFunctionData();
return (monotone && increasing);
}
}
/**
Determines if the current function-value-data is strictly
decreasing. This is a utility function for outsiders if they want
to invert the data for example.
@return True if f(x) is strictly decreasing, else False
*/
bool isStrictlyDecreasing() {
/* Use cached value if it can be trusted */
if (strictlyMonotoneCached) {
return (strictlyMonotone && strictlyDecreasing);
}
else {
computeInternalFunctionData();
return (strictlyMonotone && strictlyDecreasing);
}
}
/**
Determines if the current function-value-data is monotone and decreasing
@return True if f(x) is monotone and decreasing, else False
*/
bool isMonotoneDecreasing() const {
if (monotoneCached) {
return (monotone && decreasing);
}
else {
computeInternalFunctionData();
return (monotone && decreasing);
}
}
/**
@param newx New x point
@param newf New f(x) point
Adds a new datapoint to the function.
This causes all the derivatives at all points of the functions
to be recomputed and then adjusted for monotone cubic
interpolation. If this function ever enters a critical part of
any code, the locality of the algorithm for monotone adjustment
must be exploited.
*/
void addPair(double newx, double newf);
/**
Returns an x-value that is believed to yield the best
improvement in global accuracy for the interpolation if
computed.
Searches for the largest jump in f-values, and returns a x
value being the average of the two x-values representing the
f-value-jump.
@return New x value beleived to yield the best improvement in global accuracy
@return Maximal difference
*/
std::pair<double,double> getMissingX() const;
/**
Constructs a string containing the data in a table
@return a string containing the data in a table
*/
std::string toString() const;
/**
@return Number of datapoint pairs in this object
*/
int getSize() const {
return data.size();
}
/**
Checks if the function curve is flat at the endpoints, chop off
endpoint data points if that is the case.
The notion of "flat" is determined by the input parameter "epsilon"
Values whose difference are less than epsilon are regarded as equal.
This is implemented to be able to obtain a strictly monotone
curve from a data set that is strictly monotone except at the
endpoints.
Example:
The data points
(1,3), (2,3), (3,4), (4,5), (5,5), (6,5)
will become
(2,3), (3,4), (4,5)
Assumes at least 3 datapoints. If less than three, this function is a noop.
*/
void chopFlatEndpoints(const double);
/**
Wrapper function for chopFlatEndpoints(const double)
providing a default epsilon parameter
*/
void chopFlatEndpoints() {
chopFlatEndpoints(1e-14);
}
/**
If function is monotone, but not strictly monotone,
this function will remove datapoints from intervals
with zero derivative so that the curve become
strictly monotone.
Example
The data points
(1,2), (2,3), (3,4), (4,4), (5,5), (6,6)
will become
(1,2), (2,3), (3,4), (5,5), (6,6)
Assumes at least two datapoints, if one or zero datapoint, this is a noop.
*/
void shrinkFlatAreas(const double);
/**
Wrapper function for shrinkFlatAreas(const double)
providing a default epsilon parameter
*/
void shrinkFlatAreas() {
shrinkFlatAreas(1e-14);
}
private:
// Data structure to store x- and f-values
std::map<double, double> data;
// Data structure to store x- and d-values
mutable std::map<double, double> ddata;
// Storage containers for precomputed interpolation data
// std::vector<double> dvalues; // derivatives in Hermite interpolation.
// Flag to determine whether the boolean strictlyMonotone can be
// trusted.
mutable bool strictlyMonotoneCached;
mutable bool monotoneCached; /* only monotone, not stricly montone */
mutable bool strictlyMonotone;
mutable bool monotone;
// if strictlyMonotone is true (and can be trusted), the two next are meaningful
mutable bool strictlyDecreasing;
mutable bool strictlyIncreasing;
mutable bool decreasing;
mutable bool increasing;
/* Hermite basis functions, t \in [0,1] ,
notation from:
http://en.wikipedia.org/w/index.php?title=Cubic_Hermite_spline&oldid=84495502
*/
double H00(double t) const {
return 2*t*t*t - 3*t*t + 1;
}
double H10(double t) const {
return t*t*t - 2*t*t + t;
}
double H01(double t) const {
return -2*t*t*t + 3*t*t;
}
double H11(double t) const {
return t*t*t - t*t;
}
void computeInternalFunctionData() const ;
/**
Computes initial derivative values using centered (second order) difference
for internal datapoints, and one-sided derivative for endpoints
The internal datastructure map<double,double> ddata is populated by this method.
*/
void computeSimpleDerivatives() const ;
/**
Adjusts the derivative values (ddata) so that we can guarantee that
the resulting piecewise Hermite polymial is monotone. This is
done according to the algorithm of Fritsch and Carlsson 1980,
see Section 4, especially the two last lines.
*/
void adjustDerivativesForMonotoneness() const ;
/**
Checks if the coefficient alpha and beta is in
the region that guarantees monotoneness of the
derivative values they represent
See Fritsch and Carlson 1980, Lemma 2,
alternatively Step 5 in Wikipedia's article
on Monotone cubic interpolation.
*/
bool isMonotoneCoeff(double alpha, double beta) const {
if ((alpha*alpha + beta*beta) <= 9) {
return true;
} else {
return false;
}
}
};
} // namespace Opm
#endif

View File

@@ -0,0 +1,208 @@
/*
Copyright 2009, 2010, 2011, 2012 SINTEF ICT, Applied Mathematics.
Copyright 2009, 2010, 2011, 2012 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_NONUNIFORMTABLELINEAR_HEADER_INCLUDED
#define OPM_NONUNIFORMTABLELINEAR_HEADER_INCLUDED
#include <cmath>
#include <exception>
#include <vector>
#include <utility>
#include <opm/common/ErrorMacros.hpp>
#include <opm/common/utility/numeric/linearInterpolation.hpp>
namespace Opm
{
/// @brief This class uses linear interpolation to compute the value
/// (and its derivative) of a function f sampled at possibly
/// nonuniform points. If values outside the domain are sought,
/// values will be extrapolated linearly.
/// @tparam T the range type of the function (should be an algebraic ring type)
template<typename T>
class NonuniformTableLinear
{
public:
/// @brief Default constructor.
NonuniformTableLinear();
/// @brief Construct from vectors of x and y values.
/// @param x_values vector of domain values
/// @param y_values vector of corresponding range values.
template<class XContainer, class YContainer>
NonuniformTableLinear(const XContainer& x_values,
const YContainer& y_values);
/// @brief Get the domain.
/// @return the domain as a pair of doubles.
std::pair<double, double> domain();
/// @brief Rescale the domain.
/// @param new_domain the new domain as a pair of doubles.
void rescaleDomain(std::pair<double, double> new_domain);
/// @brief Evaluate the value at x.
/// @param x a domain value
/// @return f(x)
double operator()(const double x) const;
/// @brief Evaluate the derivative at x.
/// @param x a domain value
/// @return f'(x)
double derivative(const double x) const;
/// @brief Evaluate the inverse at y. Requires T to be a double.
/// @param y a range value
/// @return f^{-1}(y)
double inverse(const double y) const;
/// @brief Equality operator.
/// @param other another NonuniformTableLinear.
/// @return true if they are represented exactly alike.
bool operator==(const NonuniformTableLinear& other) const;
protected:
std::vector<double> x_values_;
std::vector<T> y_values_;
mutable std::vector<T> x_values_reversed_;
mutable std::vector<T> y_values_reversed_;
};
// A utility function
/// @brief Detect if a sequence is nondecreasing.
/// @tparam FI a forward iterator whose value type has operator< defined.
/// @param beg start of sequence
/// @param end one-beyond-end of sequence
/// @return false if there exists two consecutive values (v1, v2) in the sequence
/// for which v2 < v1, else returns true.
template <typename FI>
bool isNondecreasing(const FI beg, const FI end)
{
if (beg == end) return true;
FI it = beg;
++it;
FI prev = beg;
for (; it != end; ++it, ++prev) {
if (*it < *prev) {
return false;
}
}
return true;
}
// Member implementations.
template<typename T>
inline
NonuniformTableLinear<T>
::NonuniformTableLinear()
{
}
template<typename T>
template<class XContainer, class YContainer>
inline
NonuniformTableLinear<T>
::NonuniformTableLinear(const XContainer& x_column,
const YContainer& y_column)
: x_values_( x_column.begin() , x_column.end()),
y_values_( y_column.begin() , y_column.end())
{
assert(isNondecreasing(x_values_.begin(), x_values_.end()));
}
template<typename T>
inline std::pair<double, double>
NonuniformTableLinear<T>
::domain()
{
return std::make_pair(x_values_[0], x_values_.back());
}
template<typename T>
inline void
NonuniformTableLinear<T>
::rescaleDomain(std::pair<double, double> new_domain)
{
const double a = x_values_[0];
const double b = x_values_.back();
const double c = new_domain.first;
const double d = new_domain.second;
// x in [a, b] -> x in [c, d]
for (int i = 0; i < int(x_values_.size()); ++i) {
x_values_[i] = (x_values_[i] - a)*(d - c)/(b - a) + c;
}
}
template<typename T>
inline double
NonuniformTableLinear<T>
::operator()(const double x) const
{
return Opm::linearInterpolation(x_values_, y_values_, x);
}
template<typename T>
inline double
NonuniformTableLinear<T>
::derivative(const double x) const
{
return Opm::linearInterpolationDerivative(x_values_, y_values_, x);
}
template<typename T>
inline double
NonuniformTableLinear<T>
::inverse(const double y) const
{
if (y_values_.front() < y_values_.back()) {
return Opm::linearInterpolation(y_values_, x_values_, y);
} else {
if (y_values_reversed_.empty()) {
y_values_reversed_ = y_values_;
std::reverse(y_values_reversed_.begin(), y_values_reversed_.end());
assert(isNondecreasing(y_values_reversed_.begin(), y_values_reversed_.end()));
x_values_reversed_ = x_values_;
std::reverse(x_values_reversed_.begin(), x_values_reversed_.end());
}
return Opm::linearInterpolation(y_values_reversed_, x_values_reversed_, y);
}
}
template<typename T>
inline bool
NonuniformTableLinear<T>
::operator==(const NonuniformTableLinear<T>& other) const
{
return x_values_ == other.x_values_
&& y_values_ == other.y_values_;
}
} // namespace Opm
#endif // OPM_NONUNIFORMTABLELINEAR_HEADER_INCLUDED

View File

@@ -0,0 +1,340 @@
//===========================================================================
//
// File: RootFinders.hpp
//
// Created: Thu May 6 19:59:42 2010
//
// Author(s): Atgeirr F Rasmussen <atgeirr@sintef.no>
// Jostein R Natvig <jostein.r.natvig@sintef.no>
//
// $Date$
//
// $Revision$
//
//===========================================================================
/*
Copyright 2010 SINTEF ICT, Applied Mathematics.
Copyright 2010 Statoil ASA.
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_ROOTFINDERS_HEADER
#define OPM_ROOTFINDERS_HEADER
#include <opm/common/ErrorMacros.hpp>
#include <algorithm>
#include <limits>
#include <cmath>
#include <iostream>
namespace Opm
{
struct ThrowOnError
{
static double handleBracketingFailure(const double x0, const double x1, const double f0, const double f1)
{
OPM_THROW(std::runtime_error, "Error in parameters, zero not bracketed: [a, b] = ["
<< x0 << ", " << x1 << "] f(a) = " << f0 << " f(b) = " << f1);
return -1e100; // Never reached.
}
static double handleTooManyIterations(const double x0, const double x1, const int maxiter)
{
OPM_THROW(std::runtime_error, "Maximum number of iterations exceeded: " << maxiter << "\n"
<< "Current interval is [" << std::min(x0, x1) << ", "
<< std::max(x0, x1) << "]");
return -1e100; // Never reached.
}
};
struct WarnAndContinueOnError
{
static double handleBracketingFailure(const double x0, const double x1, const double f0, const double f1)
{
OPM_REPORT;
std::cerr << "Error in parameters, zero not bracketed: [a, b] = ["
<< x0 << ", " << x1 << "] f(a) = " << f0 << " f(b) = " << f1
<< "";
return std::fabs(f0) < std::fabs(f1) ? x0 : x1;
}
static double handleTooManyIterations(const double x0, const double x1, const int maxiter)
{
OPM_REPORT;
std::cerr << "Maximum number of iterations exceeded: " << maxiter
<< ", current interval is [" << std::min(x0, x1) << ", "
<< std::max(x0, x1) << "]";
return 0.5*(x0 + x1);
}
};
struct ContinueOnError
{
static double handleBracketingFailure(const double x0, const double x1, const double f0, const double f1)
{
return std::fabs(f0) < std::fabs(f1) ? x0 : x1;
}
static double handleTooManyIterations(const double x0, const double x1, const int /*maxiter*/)
{
return 0.5*(x0 + x1);
}
};
template <class ErrorPolicy = ThrowOnError>
class RegulaFalsi
{
public:
/// Implements a modified regula falsi method as described in
/// "Improved algorithms of Illinois-type for the numerical
/// solution of nonlinear equations"
/// by J. A. Ford.
/// Current variant is the 'Pegasus' method.
template <class Functor>
inline static double solve(const Functor& f,
const double a,
const double b,
const int max_iter,
const double tolerance,
int& iterations_used)
{
using namespace std;
const double macheps = numeric_limits<double>::epsilon();
const double eps = tolerance + macheps*max(max(fabs(a), fabs(b)), 1.0);
double x0 = a;
double x1 = b;
double f0 = f(x0);
const double epsF = tolerance + macheps*max(fabs(f0), 1.0);
if (fabs(f0) < epsF) {
return x0;
}
double f1 = f(x1);
if (fabs(f1) < epsF) {
return x1;
}
if (f0*f1 > 0.0) {
return ErrorPolicy::handleBracketingFailure(a, b, f0, f1);
}
iterations_used = 0;
// In every iteraton, x1 is the last point computed,
// and x0 is the last point computed that makes it a bracket.
while (fabs(x1 - x0) >= 1e-9*eps) {
double xnew = regulaFalsiStep(x0, x1, f0, f1);
double fnew = f(xnew);
// cout << "xnew = " << xnew << " fnew = " << fnew << endl;
++iterations_used;
if (iterations_used > max_iter) {
return ErrorPolicy::handleTooManyIterations(x0, x1, max_iter);
}
if (fabs(fnew) < epsF) {
return xnew;
}
// Now we must check which point we must replace.
if ((fnew > 0.0) == (f0 > 0.0)) {
// We must replace x0.
x0 = x1;
f0 = f1;
} else {
// We must replace x1, this is the case where
// the modification to regula falsi kicks in,
// by modifying f0.
// 1. The classic Illinois method
// const double gamma = 0.5;
// @afr: The next two methods do not work??!!?
// 2. The method called 'Method 3' in the paper.
// const double phi0 = f1/f0;
// const double phi1 = fnew/f1;
// const double gamma = 1.0 - phi1/(1.0 - phi0);
// 3. The method called 'Method 4' in the paper.
// const double phi0 = f1/f0;
// const double phi1 = fnew/f1;
// const double gamma = 1.0 - phi0 - phi1;
// cout << "phi0 = " << phi0 <<" phi1 = " << phi1 <<
// " gamma = " << gamma << endl;
// 4. The 'Pegasus' method
const double gamma = f1/(f1 + fnew);
f0 *= gamma;
}
x1 = xnew;
f1 = fnew;
}
return 0.5*(x0 + x1);
}
/// Implements a modified regula falsi method as described in
/// "Improved algorithms of Illinois-type for the numerical
/// solution of nonlinear equations"
/// by J. A. Ford.
/// Current variant is the 'Pegasus' method.
/// This version takes an extra parameter for the initial guess.
template <class Functor>
inline static double solve(const Functor& f,
const double initial_guess,
const double a,
const double b,
const int max_iter,
const double tolerance,
int& iterations_used)
{
using namespace std;
const double macheps = numeric_limits<double>::epsilon();
const double eps = tolerance + macheps*max(max(fabs(a), fabs(b)), 1.0);
double f_initial = f(initial_guess);
const double epsF = tolerance + macheps*max(fabs(f_initial), 1.0);
if (fabs(f_initial) < epsF) {
return initial_guess;
}
double x0 = a;
double x1 = b;
double f0 = f_initial;
double f1 = f_initial;
if (x0 != initial_guess) {
f0 = f(x0);
if (fabs(f0) < epsF) {
return x0;
}
}
if (x1 != initial_guess) {
f1 = f(x1);
if (fabs(f1) < epsF) {
return x1;
}
}
if (f0*f_initial < 0.0) {
x1 = initial_guess;
f1 = f_initial;
} else {
x0 = initial_guess;
f0 = f_initial;
}
if (f0*f1 > 0.0) {
return ErrorPolicy::handleBracketingFailure(a, b, f0, f1);
}
iterations_used = 0;
// In every iteraton, x1 is the last point computed,
// and x0 is the last point computed that makes it a bracket.
while (fabs(x1 - x0) >= 1e-9*eps) {
double xnew = regulaFalsiStep(x0, x1, f0, f1);
double fnew = f(xnew);
// cout << "xnew = " << xnew << " fnew = " << fnew << endl;
++iterations_used;
if (iterations_used > max_iter) {
return ErrorPolicy::handleTooManyIterations(x0, x1, max_iter);
}
if (fabs(fnew) < epsF) {
return xnew;
}
// Now we must check which point we must replace.
if ((fnew > 0.0) == (f0 > 0.0)) {
// We must replace x0.
x0 = x1;
f0 = f1;
} else {
// We must replace x1, this is the case where
// the modification to regula falsi kicks in,
// by modifying f0.
// 1. The classic Illinois method
// const double gamma = 0.5;
// @afr: The next two methods do not work??!!?
// 2. The method called 'Method 3' in the paper.
// const double phi0 = f1/f0;
// const double phi1 = fnew/f1;
// const double gamma = 1.0 - phi1/(1.0 - phi0);
// 3. The method called 'Method 4' in the paper.
// const double phi0 = f1/f0;
// const double phi1 = fnew/f1;
// const double gamma = 1.0 - phi0 - phi1;
// cout << "phi0 = " << phi0 <<" phi1 = " << phi1 <<
// " gamma = " << gamma << endl;
// 4. The 'Pegasus' method
const double gamma = f1/(f1 + fnew);
f0 *= gamma;
}
x1 = xnew;
f1 = fnew;
}
return 0.5*(x0 + x1);
}
private:
inline static double regulaFalsiStep(const double a,
const double b,
const double fa,
const double fb)
{
assert(fa*fb < 0.0);
return (b*fa - a*fb)/(fa - fb);
}
};
/// Attempts to find an interval bracketing a zero by successive
/// enlargement of search interval.
template <class Functor>
inline void bracketZero(const Functor& f,
const double x0,
const double dx,
double& a,
double& b)
{
const int max_iters = 100;
double f0 = f(x0);
double cur_dx = dx;
int i = 0;
for (; i < max_iters; ++i) {
double x = x0 + cur_dx;
double f_new = f(x);
if (f0*f_new <= 0.0) {
break;
}
cur_dx = -2.0*cur_dx;
}
if (i == max_iters) {
OPM_THROW(std::runtime_error, "Could not bracket zero in " << max_iters << "iterations.");
}
if (cur_dx < 0.0) {
a = x0 + cur_dx;
b = i < 2 ? x0 : x0 + 0.25*cur_dx;
} else {
a = i < 2 ? x0 : x0 + 0.25*cur_dx;
b = x0 + cur_dx;
}
}
} // namespace Opm
#endif // OPM_ROOTFINDERS_HEADER

View File

@@ -0,0 +1,198 @@
//===========================================================================
//
// File: SparseVector.hpp
//
// Created: Mon Jun 29 15:28:59 2009
//
// Author(s): Atgeirr F Rasmussen <atgeirr@sintef.no>
// B<>rd Skaflestad <bard.skaflestad@sintef.no>
//
// $Date$
//
// $Revision$
//
//===========================================================================
/*
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
Copyright 2009, 2010 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_SPARSEVECTOR_HEADER
#define OPM_SPARSEVECTOR_HEADER
#include <vector>
#include <numeric>
#include <algorithm>
#include <opm/common/ErrorMacros.hpp>
namespace Opm
{
/// A SparseVector stores a vector with possibly many empty elements
/// as efficiently as possible.
/// It is supposed to behave similarly to a standard vector, but since
/// direct indexing is a O(log n) operation instead of O(1), we do not
/// supply it as operator[].
template <typename T>
class SparseVector
{
public:
/// Default constructor. Yields an empty SparseVector.
SparseVector()
: size_(0), default_elem_()
{
}
/// Constructs a SparseVector with a given size, but no nonzero
/// elements.
explicit SparseVector(int sz)
: size_(sz), default_elem_()
{
}
/// A constructor taking all the element data for the vector and their indices.
/// \param data_beg The start of the element data.
/// \param data_end One-beyond-end of the element data.
/// \param rowsize_beg The start of the index data.
/// \param rowsize_end One beyond the end of the index data.
template <typename DataIter, typename IntegerIter>
SparseVector(int sz,
DataIter data_beg, DataIter data_end,
IntegerIter index_beg, IntegerIter index_end)
: size_(sz), data_(data_beg, data_end), indices_(index_beg, index_end),
default_elem_()
{
#ifndef NDEBUG
OPM_ERROR_IF(sz < 0, "The size of a SparseVector must be non-negative");
OPM_ERROR_IF(indices_.size() != data_.size(), "The number of indices of a SparseVector must equal to the number of entries");
int last_index = -1;
int num_ind = indices_.size();
for (int i = 0; i < num_ind; ++i) {
int index = indices_[i];
if (index <= last_index || index >= sz) {
OPM_THROW(std::logic_error, "Error in SparseVector construction, index is nonincreasing or out of range.");
}
last_index = index;
}
#endif
}
/// Appends an element to the vector. Note that this function does not
/// increase the size() of the vector, it just adds another nonzero element.
/// Elements must be added in index order.
void addElement(const T& elem, int index)
{
assert(indices_.empty() || index > indices_.back());
assert(index < size_);
data_.push_back(elem);
indices_.push_back(index);
}
/// \return true if the vector has size 0.
bool empty() const
{
return size_ == 0;
}
/// Returns the size of the vector.
/// Recall that most or all of the vector may be default/zero.
int size() const
{
return size_;
}
/// Returns the number of nonzero data elements.
int nonzeroSize() const
{
return data_.size();
}
/// Makes the vector empty().
void clear()
{
data_.clear();
indices_.clear();
size_ = 0;
}
/// Equality.
bool operator==(const SparseVector& other) const
{
return size_ == other.size_ && data_ == other.data_ && indices_ == other.indices_;
}
/// O(log n) element access.
/// \param index the proper vector index
/// \return the element with the given index, or the default element if no element in
/// the vector has the given index.
const T& element(int index) const
{
#ifndef NDEBUG
OPM_ERROR_IF(index < 0, "The index of a SparseVector must be non-negative (is " << index << ")");
OPM_ERROR_IF(index >= size_, "The index of a SparseVector must be smaller than the maximum value (is " << index << ", max value: " << size_ <<")");
#endif
std::vector<int>::const_iterator lb = std::lower_bound(indices_.begin(), indices_.end(), index);
if (lb != indices_.end() && *lb == index) {
return data_[lb - indices_.begin()];
} else {
return default_elem_;
}
}
/// O(1) element access.
/// \param nzindex an index counting only nonzero elements.
/// \return the nzindex'th nonzero element.
const T& nonzeroElement(int nzindex) const
{
#ifndef NDEBUG
OPM_ERROR_IF(nzindex < 0, "The index of a SparseVector must be non-negative (is " << nzindex << ")");
OPM_ERROR_IF(nzindex >= nonzeroSize(), "The index of a SparseVector must be smaller than the maximum value (is " << nzindex << ", max value: " << nonzeroSize() <<")");
#endif
return data_[nzindex];
}
/// O(1) index access.
/// \param nzindex an index counting only nonzero elements.
/// \return the index of the nzindex'th nonzero element.
int nonzeroIndex(int nzindex) const
{
assert(nzindex >= 0);
assert(nzindex < nonzeroSize());
return indices_[nzindex];
}
private:
// The vectors data_ and indices_ are always the same size.
// The indices are supposed to be stored in increasing order,
// to be unique, and to be in [0, size_ - 1].
// default_elem_ is returned when a default element is requested.
int size_;
std::vector<T> data_;
std::vector<int> indices_;
T default_elem_;
};
} // namespace Opm
#endif // OPM_SPARSEVECTOR_HEADER

View File

@@ -0,0 +1,268 @@
/*
Copyright 2010 SINTEF ICT, Applied Mathematics.
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_UNIFORMTABLELINEAR_HEADER_INCLUDED
#define OPM_UNIFORMTABLELINEAR_HEADER_INCLUDED
#include <cmath>
#include <exception>
#include <vector>
#include <utility>
#include <iostream>
#include <opm/common/ErrorMacros.hpp>
namespace Opm {
/// @brief This class uses linear interpolation to compute the value
/// (and its derivative) of a function f sampled at uniform points.
/// @tparam T the range type of the function (should be an algebraic ring type)
template<typename T>
class UniformTableLinear
{
public:
/// @brief Default constructor.
UniformTableLinear();
/// @brief Construct from vector of y-values.
/// @param xmin the x value corresponding to the first y value.
/// @param xmax the x value corresponding to the last y value.
/// @param y_values vector of range values.
UniformTableLinear(double xmin,
double xmax,
const std::vector<T>& y_values);
/// @brief Construct from array of y-values.
/// @param xmin the x value corresponding to the first y value.
/// @param xmax the x value corresponding to the last y value.
/// @param y_values array of range values.
/// @param num_y_values the number of values in y_values.
UniformTableLinear(double xmin,
double xmax,
const T* y_values,
int num_y_values);
/// @brief Get the domain.
/// @return the domain as a pair of doubles.
std::pair<double, double> domain();
/// @brief Rescale the domain.
/// @param new_domain the new domain as a pair of doubles.
void rescaleDomain(std::pair<double, double> new_domain);
/// @brief Evaluate the value at x.
/// @param x a domain value
/// @return f(x)
double operator()(const double x) const;
/// @brief Evaluate the derivative at x.
/// @param x a domain value
/// @return f'(x)
double derivative(const double x) const;
/// @brief Equality operator.
/// @param other another UniformTableLinear.
/// @return true if they are represented exactly alike.
bool operator==(const UniformTableLinear& other) const;
/// @brief Policies for how to behave when trying to evaluate outside the domain.
enum RangePolicy {Throw = 0, ClosestValue = 1, Extrapolate = 2};
/// @brief Sets the behavioural policy for evaluation to the left of the domain.
/// @param rp the policy
void setLeftPolicy(RangePolicy rp);
/// @brief Sets the behavioural policy for evaluation to the right of the domain.
/// @param rp the policy
void setRightPolicy(RangePolicy rp);
protected:
double xmin_;
double xmax_;
double xdelta_;
std::vector<T> y_values_;
RangePolicy left_;
RangePolicy right_;
template <typename U>
friend std::ostream& operator<<(std::ostream& os, const UniformTableLinear<U>& t);
};
// Member implementations.
template<typename T>
inline
UniformTableLinear<T>
::UniformTableLinear()
: left_(ClosestValue), right_(ClosestValue)
{
}
template<typename T>
inline
UniformTableLinear<T>
::UniformTableLinear(double xmin,
double xmax,
const std::vector<T>& y_values)
: xmin_(xmin), xmax_(xmax), y_values_(y_values),
left_(ClosestValue), right_(ClosestValue)
{
assert(xmax > xmin);
assert(y_values.size() > 1);
xdelta_ = (xmax - xmin)/(y_values.size() - 1);
}
template<typename T>
inline
UniformTableLinear<T>
::UniformTableLinear(double xmin,
double xmax,
const T* y_values,
int num_y_values)
: xmin_(xmin), xmax_(xmax),
y_values_(y_values, y_values + num_y_values),
left_(ClosestValue), right_(ClosestValue)
{
assert(xmax > xmin);
assert(y_values_.size() > 1);
xdelta_ = (xmax - xmin)/(y_values_.size() - 1);
}
template<typename T>
inline std::pair<double, double>
UniformTableLinear<T>
::domain()
{
return std::make_pair(xmin_, xmax_);
}
template<typename T>
inline void
UniformTableLinear<T>
::rescaleDomain(std::pair<double, double> new_domain)
{
xmin_ = new_domain.first;
xmax_ = new_domain.second;
xdelta_ = (xmax_ - xmin_)/(y_values_.size() - 1);
}
template<typename T>
inline double
UniformTableLinear<T>
::operator()(const double xparam) const
{
// Implements ClosestValue policy.
double x = std::min(xparam, xmax_);
x = std::max(x, xmin_);
// Lookup is easy since we are uniform in x.
double pos = (x - xmin_)/xdelta_;
double posi = std::floor(pos);
int left = int(posi);
if (left == int(y_values_.size()) - 1) {
// We are at xmax_
return y_values_.back();
}
double w = pos - posi;
return (1.0 - w)*y_values_[left] + w*y_values_[left + 1];
}
template<typename T>
inline double
UniformTableLinear<T>
::derivative(const double xparam) const
{
// Implements derivative consistent
// with ClosestValue policy for function
double value;
if (xparam > xmax_ || xparam < xmin_) {
value = 0.0;
} else {
double x = std::min(xparam, xmax_);
x = std::max(x, xmin_);
// Lookup is easy since we are uniform in x.
double pos = (x - xmin_)/xdelta_;
double posi = std::floor(pos);
int left = int(posi);
if (left == int(y_values_.size()) - 1) {
// We are at xmax_
--left;
}
value = (y_values_[left + 1] - y_values_[left])/xdelta_;
}
return value;
}
template<typename T>
inline bool
UniformTableLinear<T>
::operator==(const UniformTableLinear<T>& other) const
{
return xmin_ == other.xmin_
&& xdelta_ == other.xdelta_
&& y_values_ == other.y_values_
&& left_ == other.left_
&& right_ == other.right_;
}
template<typename T>
inline void
UniformTableLinear<T>
::setLeftPolicy(RangePolicy rp)
{
if (rp != ClosestValue) {
OPM_THROW(std::runtime_error, "Only ClosestValue RangePolicy implemented.");
}
left_ = rp;
}
template<typename T>
inline void
UniformTableLinear<T>
::setRightPolicy(RangePolicy rp)
{
if (rp != ClosestValue) {
OPM_THROW(std::runtime_error, "Only ClosestValue RangePolicy implemented.");
}
right_ = rp;
}
template <typename T>
inline std::ostream& operator<<(std::ostream& os, const UniformTableLinear<T>& t)
{
int n = t.y_values_.size();
for (int i = 0; i < n; ++i) {
double f = double(i)/double(n - 1);
os << (1.0 - f)*t.xmin_ + f*t.xmax_
<< " " << t.y_values_[i] << '\n';
}
return os;
}
namespace utils
{
using Opm::UniformTableLinear;
}
} // namespace Opm
#endif // OPM_UNIFORMTABLELINEAR_HEADER_INCLUDED

View File

@@ -0,0 +1,148 @@
/*
Copyright 2010 SINTEF ICT, Applied Mathematics.
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_BLAS_LAPACK_HEADER_INCLUDED
#define OPM_BLAS_LAPACK_HEADER_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
#if defined(MATLAB_MEX_FILE) && MATLAB_MEX_FILE
#include <mex.h>
#undef MAT_SIZE_T
#define MAT_SIZE_T mwSignedIndex
#endif
#ifndef MAT_SIZE_T
#define MAT_SIZE_T int
#endif
/* C <- a1*op(A)*op(B) + a2*C where op(X) in {X, X.'} */
void dgemm_(const char *transA , const char *transB ,
const MAT_SIZE_T* m, const MAT_SIZE_T* n , const MAT_SIZE_T* k ,
const double* a1, const double* A , const MAT_SIZE_T* ldA,
const double* B, const MAT_SIZE_T* ldB,
const double* a2, double* C , const MAT_SIZE_T* ldC);
/* C <- a1*A*A' + a2*C *or* C <- a1*A'*A + a2*C */
void dsyrk_(const char *uplo, const char *trans,
const MAT_SIZE_T *n , const MAT_SIZE_T *k ,
const double *a1 , const double *A , const MAT_SIZE_T *ldA,
const double *a2 , double *C , const MAT_SIZE_T *ldC);
void dgeqrf_(const MAT_SIZE_T *m , const MAT_SIZE_T *n ,
double *A , const MAT_SIZE_T *ld ,
double *tau , double *work,
const MAT_SIZE_T *lwork, MAT_SIZE_T *info);
void dorgqr_(const MAT_SIZE_T *m , const MAT_SIZE_T *n , const MAT_SIZE_T *k ,
double *A , const MAT_SIZE_T *ld , const double *tau,
double *work, const MAT_SIZE_T *lwork, MAT_SIZE_T *info);
/* A <- LU(A) */
void dgetrf_(const MAT_SIZE_T *m , const MAT_SIZE_T *n ,
double *A , const MAT_SIZE_T *ld,
MAT_SIZE_T *ipiv, MAT_SIZE_T *info);
/* B <- A \ B, when A is LU(A) from dgetrf() */
void dgetrs_(const char *trans, const MAT_SIZE_T *n,
const MAT_SIZE_T *nrhs ,
const double *A , const MAT_SIZE_T *lda,
const MAT_SIZE_T *ipiv , double *B,
const MAT_SIZE_T *ldb , MAT_SIZE_T *info);
/* B <- A \ B, tridiagonal A with bands DL, D, DU */
void dgtsv_(const MAT_SIZE_T *n ,
const MAT_SIZE_T *nrhs ,
double *DL ,
double *D ,
double *DU ,
double *B ,
const MAT_SIZE_T *ldb ,
MAT_SIZE_T *info);
/* B <- A \ B, band matrix A stored in AB with kl subdiagonals, ku superdiagonals */
void dgbsv_(const MAT_SIZE_T *n ,
const MAT_SIZE_T *kl ,
const MAT_SIZE_T *ku ,
const MAT_SIZE_T *nrhs ,
double *AB ,
const MAT_SIZE_T *ldab ,
MAT_SIZE_T *ipiv ,
double *B ,
const MAT_SIZE_T *ldb ,
MAT_SIZE_T *info);
/* B <- A \ B, general solver */
void dgesv_(const MAT_SIZE_T *n,
const MAT_SIZE_T *nrhs ,
double *A ,
const MAT_SIZE_T *lda ,
MAT_SIZE_T *piv ,
double *B ,
const MAT_SIZE_T *ldb ,
MAT_SIZE_T *info);
/* A <- chol(A) */
void dpotrf_(const char *uplo, const MAT_SIZE_T *n,
double *A , const MAT_SIZE_T *lda,
MAT_SIZE_T *info);
/* B <- (A \ (A' \ B)), when A=DPOTRF(A_orig) */
void dpotrs_(const char *uplo, const MAT_SIZE_T *n , const MAT_SIZE_T *nrhs,
double *A , const MAT_SIZE_T *lda,
double *B , const MAT_SIZE_T *ldb, MAT_SIZE_T *info);
/* A <- chol(A), packed format. */
void dpptrf_(const char *uplo, const MAT_SIZE_T *n,
double *Ap , MAT_SIZE_T *info);
/* A <- (A \ (A' \ eye(n)) when A=DPPTRF(A_orig) (packed format). */
void dpptri_(const char *uplo, const MAT_SIZE_T *n,
double *Ap , MAT_SIZE_T *info);
/* y <- a1*op(A)*x + a2*y */
void dgemv_(const char *trans,
const MAT_SIZE_T *m , const MAT_SIZE_T *n,
const double *a1 , const double *A, const MAT_SIZE_T *ldA ,
const double *x, const MAT_SIZE_T *incX,
const double *a2 , double *y, const MAT_SIZE_T *incY);
/* y <- a*x + y */
void daxpy_(const MAT_SIZE_T *n, const double *a,
const double *x, const MAT_SIZE_T *incx,
double *y, const MAT_SIZE_T *incy);
/* s <- x' * y */
double ddot_(const MAT_SIZE_T *n, const double *x, const MAT_SIZE_T *incx,
const double *y, const MAT_SIZE_T *incy);
#ifdef __cplusplus
}
#endif
#endif /* OPM_BLAS_LAPACK_HEADER_INCLUDED */

View File

@@ -0,0 +1,50 @@
/*
Copyright 2010 SINTEF ICT, Applied Mathematics.
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_BUILDUNIFORMMONOTONETABLE_HEADER_INCLUDED
#define OPM_BUILDUNIFORMMONOTONETABLE_HEADER_INCLUDED
#include <opm/core/utility/MonotCubicInterpolator.hpp>
#include <opm/core/utility/UniformTableLinear.hpp>
namespace Opm {
template <typename T>
void buildUniformMonotoneTable(const std::vector<double>& xv,
const std::vector<T>& yv,
const int samples,
UniformTableLinear<T>& table)
{
MonotCubicInterpolator interp(xv, yv);
std::vector<T> uniform_yv(samples);
double xmin = xv[0];
double xmax = xv.back();
for (int i = 0; i < samples; ++i) {
double w = double(i)/double(samples - 1);
double x = (1.0 - w)*xmin + w*xmax;
uniform_yv[i] = interp(x);
}
table = UniformTableLinear<T>(xmin, xmax, uniform_yv);
}
} // namespace Opm
#endif // OPM_BUILDUNIFORMMONOTONETABLE_HEADER_INCLUDED

View File

@@ -0,0 +1,24 @@
/*
Copyright 2018 Statoil ASA.
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 <math.h>
double calculateCellVol(const std::vector<double>& X, const std::vector<double>& Y, const std::vector<double>& Z);

View File

@@ -0,0 +1,107 @@
/*
Copyright 2009, 2010, 2013 SINTEF ICT, Applied Mathematics.
Copyright 2009, 2010 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_LINEARINTERPOLATION_HEADER_INCLUDED
#define OPM_LINEARINTERPOLATION_HEADER_INCLUDED
#include <vector>
#include <algorithm>
namespace Opm
{
inline int tableIndex(const std::vector<double>& table, double x)
{
// Returns an index in an ordered table such that x is between
// table[j] and table[j+1]. If x is out of range, first or last
// interval is returned; Binary search.
int n = table.size() - 1;
if (n < 2) {
return 0;
}
int jl = 0;
int ju = n;
bool ascend = (table[n] > table[0]);
while (ju - jl > 1) {
int jm = (ju + jl)/2; // Compute a midpoint
if ( (x >= table[jm]) == ascend) {
jl = jm; // Replace lower limit
} else {
ju = jm; // Replace upper limit
}
}
return jl;
}
inline double linearInterpolationDerivative(const std::vector<double>& xv,
const std::vector<double>& yv, double x)
{
// Extrapolates if x is outside xv
int ix1 = tableIndex(xv, x);
int ix2 = ix1 + 1;
return (yv[ix2] - yv[ix1])/(xv[ix2] - xv[ix1]);
}
inline double linearInterpolation(const std::vector<double>& xv,
const std::vector<double>& yv, double x)
{
// Extrapolates if x is outside xv
int ix1 = tableIndex(xv, x);
int ix2 = ix1 + 1;
return (yv[ix2] - yv[ix1])/(xv[ix2] - xv[ix1])*(x - xv[ix1]) + yv[ix1];
}
inline double linearInterpolationNoExtrapolation(const std::vector<double>& xv,
const std::vector<double>& yv, double x)
{
// Return end values if x is outside xv
if (x < xv.front()) {
return yv.front();
}
if (x > xv.back()) {
return yv.back();
}
int ix1 = tableIndex(xv, x);
int ix2 = ix1 + 1;
return (yv[ix2] - yv[ix1])/(xv[ix2] - xv[ix1])*(x - xv[ix1]) + yv[ix1];
}
inline double linearInterpolation(const std::vector<double>& xv,
const std::vector<double>& yv,
double x, int& ix1)
{
// Extrapolates if x is outside xv
ix1 = tableIndex(xv, x);
int ix2 = ix1 + 1;
return (yv[ix2] - yv[ix1])/(xv[ix2] - xv[ix1])*(x - xv[ix1]) + yv[ix1];
}
} // namespace Opm
#endif // OPM_LINEARINTERPOLATION_HEADER_INCLUDED

View File

@@ -0,0 +1,215 @@
//===========================================================================
//
// File: Parameter.hpp
//
// Created: Tue Jun 2 16:00:21 2009
//
// Author(s): B<>rd Skaflestad <bard.skaflestad@sintef.no>
// Atgeirr F Rasmussen <atgeirr@sintef.no>
//
// $Date$
//
// $Revision$
//
//===========================================================================
/*
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
Copyright 2009, 2010 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_PARAMETER_HEADER
#define OPM_PARAMETER_HEADER
#include <string>
#include <sstream>
#include <opm/common/utility/parameters/ParameterMapItem.hpp>
#include <opm/common/utility/parameters/ParameterStrings.hpp>
namespace Opm {
/// @brief
/// @todo Doc me!
class Parameter : public ParameterMapItem {
public:
/// @brief
/// @todo Doc me!
virtual ~Parameter() {}
/// @brief
/// @todo Doc me!
/// @return
virtual std::string getTag() const {return ID_xmltag__param;}
/// @brief
/// @todo Doc me!
/// @param
Parameter(const std::string& value, const std::string& type)
: value_(value), type_(type) {}
/// @brief
/// @todo Doc me!
/// @return
std::string getValue() const {return value_;}
/// @brief
/// @todo Doc me!
/// @return
std::string getType() const {return type_;}
private:
std::string value_;
std::string type_;
};
/// @brief
/// @todo Doc me!
/// @param
/// @return
std::string correct_parameter_tag(const ParameterMapItem& item);
std::string correct_type(const Parameter& parameter,
const std::string& type);
/// @brief
/// @todo Doc me!
/// @tparam
/// @param
/// @return
template<>
struct ParameterMapItemTrait<int> {
static int convert(const ParameterMapItem& item,
std::string& conversion_error,
const bool)
{
conversion_error = correct_parameter_tag(item);
if (conversion_error != "") {
return 0;
}
const Parameter& parameter = dynamic_cast<const Parameter&>(item);
conversion_error = correct_type(parameter, ID_param_type__int);
if (conversion_error != "") {
return 0;
}
std::stringstream stream;
stream << parameter.getValue();
int value;
stream >> value;
if (stream.fail()) {
conversion_error = "Conversion to '" +
ID_param_type__int +
"' failed. Data was '" +
parameter.getValue() + "'.\n";
return 0;
}
return value;
}
static std::string type() {return ID_param_type__int;}
};
/// @brief
/// @todo Doc me!
/// @tparam
/// @param
/// @return
template<>
struct ParameterMapItemTrait<double> {
static double convert(const ParameterMapItem& item,
std::string& conversion_error,
const bool)
{
conversion_error = correct_parameter_tag(item);
if (conversion_error != "") {
return 0.0;
}
const Parameter& parameter = dynamic_cast<const Parameter&>(item);
conversion_error = correct_type(parameter, ID_param_type__float);
if (conversion_error != "") {
return 0.0;
}
std::stringstream stream;
stream << parameter.getValue();
double value;
stream >> value;
if (stream.fail()) {
conversion_error = "Conversion to '" +
ID_param_type__float +
"' failed. Data was '" +
parameter.getValue() + "'.\n";
return 0.0;
}
return value;
}
static std::string type() {return ID_param_type__float;}
};
/// @brief
/// @todo Doc me!
/// @tparam
/// @param
/// @return
template<>
struct ParameterMapItemTrait<bool> {
static bool convert(const ParameterMapItem& item,
std::string& conversion_error,
const bool)
{
conversion_error = correct_parameter_tag(item);
if (conversion_error != "") {
return false;
}
const Parameter& parameter = dynamic_cast<const Parameter&>(item);
conversion_error = correct_type(parameter, ID_param_type__bool);
if (conversion_error != "") {
return false;
}
if (parameter.getValue() == ID_true) {
return true;
} else if (parameter.getValue() == ID_false) {
return false;
} else {
conversion_error = "Conversion failed. Data was '" +
parameter.getValue() +
"', but should be one of '" +
ID_true + "' or '" + ID_false + "'.\n";
return false;
}
}
static std::string type() {return ID_param_type__bool;}
};
/// @brief
/// @todo Doc me!
/// @tparam
/// @param
/// @return
template<>
struct ParameterMapItemTrait<std::string> {
static std::string convert(const ParameterMapItem& item,
std::string& conversion_error,
const bool)
{
conversion_error = correct_parameter_tag(item);
if (conversion_error != "") {
return "";
}
const Parameter& parameter = dynamic_cast<const Parameter&>(item);
conversion_error = correct_type(parameter, ID_param_type__string);
if (conversion_error != "") {
return "";
}
return parameter.getValue();
}
static std::string type() {return ID_param_type__string;}
};
} // namespace Opm
#endif // OPM_PARAMETER_HPP

View File

@@ -0,0 +1,272 @@
//===========================================================================
//
// File: ParameterGroup.hpp
//
// Created: Tue Jun 2 19:11:11 2009
//
// Author(s): B<>rd Skaflestad <bard.skaflestad@sintef.no>
// Atgeirr F Rasmussen <atgeirr@sintef.no>
//
// $Date$
//
// $Revision$
//
//===========================================================================
/*
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
Copyright 2009, 2010 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_PARAMETERGROUP_HEADER
#define OPM_PARAMETERGROUP_HEADER
#include <exception>
#include <map>
#include <string>
#include <vector>
#include <memory>
#include <opm/common/utility/parameters/ParameterMapItem.hpp>
#include <opm/common/utility/parameters/ParameterRequirement.hpp>
namespace Opm {
/// ParameterGroup is a class that is used to provide run-time parameters.
/// The standard use of the class is to call create it with the
/// (int argc, char** argv) constructor (where the arguments are those
/// given by main). This parses the command line, where each token
/// either
/// A) specifies a parameter (by a "param=value" token).
/// B) specifies a param file to be read (by a "filename.param" token).
/// After the tokens are parsed they are stored in a tree structure
/// in the ParameterGroup object; it is worth mentioning that parameters
/// are inherited in this tree structure. Thus, if ``grid\_prefix'' is
/// given a value in the root node, this value will be visible in all
/// parts of the tree (unless the parameter is overwritten in a subtree).
/// Applications using this ParameterGroup objects will usually write out
/// a message for each node in the three that is used by the application;
/// this is one way to determine valid parameters.
///
/// Parameters specified as "param=value" on the command line
///
/// To specify a parameter on the command line, you must know where in the tree the
/// parameter resides. The syntax for specifying parameters on the command line given
/// an application called ``simulator'' is
/// simulator param1=value grp/param2=value
// for parameter ``param1'' lying at the root and ``param2'' in the group
/// ``grp''. If the same parameters are specified multiple times on the command
/// line, only the last will be used. Thus an application named ``simulator'' run with
/// the following command
/// simulator param=value1 param=value2
/// will use value2 as the value of ``param''.
///
/// param files
///
/// A param file consists of multiple lienes, where each line consists of "param=value".
/// This syntax is identical to the one for parameters specified on the command line.
class ParameterGroup : public ParameterMapItem {
public:
struct NotFoundException : public std::exception {};
struct WrongTypeException : public std::exception {};
struct ConversionFailedException : public std::exception {};
template<typename T>
struct RequirementFailedException : public std::exception {};
ParameterGroup();
ParameterGroup(const std::string& path, const ParameterGroup* parent,
const bool enable_output);
// From ParameterMapItem
virtual ~ParameterGroup();
virtual std::string getTag() const;
/// \brief A constructor typically used to initialize a
/// ParameterGroup from command-line arguments.
///
/// It is required that argv[0] is the program name, while if
/// 0 < i < argc, then argv[i] is either
/// the name of a parameter file or parametername=value.
///
/// \param argc is the number of command-line arguments,
/// including the name of the executable.
/// \param argv is an array of char*, each of which is a
/// command line argument.
/// \param verify_syntax If true (default), then it is an error to
/// pass arguments that cannot be handled by the ParameterGroup,
/// or an empty argument list. If false, such arguments are stored
/// and can be retrieved later with unhandledArguments().
/// \param enable_output Whether to enable output or not.
template <typename StringArray>
ParameterGroup(int argc, StringArray argv, const bool verify_syntax = true,
const bool enabled_output=true);
/// \brief This method checks if there is something with name
/// \p name in the parameter gropup.
///
/// \param name is the name of the parameter.
/// \return true if \p name is the name of something in the parameter
/// group, false otherwise.
bool has(const std::string& name) const;
/// \brief This method is used to read a parameter from the
/// parameter group.
///
/// NOTE: If the reading of the parameter fails, then this method
/// throws an appropriate exception.
///
/// \param name is the name of the parameter in question.
/// \return The value associated with then name in this parameter
/// group.
template<typename T>
T get(const std::string& name) const;
template<typename T, class Requirement>
T get(const std::string& name, const Requirement&) const;
/// \brief This method is used to read a parameter from the
/// parameter group.
///
/// NOTE: If the reading of the parameter fails, then either
/// a) this method returns \p default_value if there
/// was no parameter with name \p name in
/// the parameter group
/// or
/// b) this method throws an appropriate exception.
///
/// \param name is the name of the parameter in question.
/// \param default_value the default value of the parameter in
/// question.
/// \return The value associated with this name in this parameter
/// group.
template<typename T>
T getDefault(const std::string& name,
const T& default_value) const;
template<typename T, class Requirement>
T getDefault(const std::string& name,
const T& default_value,
const Requirement& r) const;
/// \brief This method returns the parameter group given by name,
/// i.e. it is an alias of get<ParameterGroup>().
///
/// \param name is the name of the parameter group sought.
/// \return the parameter group sought.
ParameterGroup getGroup(const std::string& name) const;
/// \brief Disables the output from get, getDefault and getGroup.
/// By default, such output is enabled.
void disableOutput();
/// \brief Enables the output from get, getDefault and getGroup.
/// By default, such output is enabled.
void enableOutput();
/// \brief Returs true if and only if output from get, getDefault
/// and getGroup is enabled.
///
/// \return true if and only if output from get, getDefault and
/// getGroup is enabled.
bool isOutputEnabled() const;
/// \brief Reads the contents of the param file specified by
/// param_filename into this ParameterGroup.
///
/// NOTE: A param file contains lines on the form 'a/b/c=d'.
// The '/' separates ParameterGroups and Parameters
/// (e.g. c is a Parameter in the ParameterGroup b,
/// and b is a ParameterGroup in the ParameterGroup a)
/// while '=' separates the name from the value (e.g. the
/// value of the parameter c above will be d).
/// NOTE: A param file does not store any type information about
/// its values.
///
/// \param param_filename is the name of a param file.
void readParam(const std::string& param_filename);
/// \brief Writes this ParameterGroup into a param file
/// specified by param_filename.
///
/// \param param_filename is the name of a param file.
void writeParam(const std::string& param_filename) const;
/// \brief Writes this ParameterGroup to a stream.
///
/// \param stream is the stream to write to.
void writeParamToStream(std::ostream& stream) const;
/// vki param interface - deprecated
template<typename T>
void get(const char* name, T& value, const T& default_value) const {
value = this->getDefault<T>(name, default_value);
}
/// vki param interface - deprecated
template<typename T>
void get(const char* name, T& value) const {
value = this->get<T>(name);
}
/// \brief Return true if any parameters are unused.
bool anyUnused() const;
/// \brief Shows which parameters which are used or unused.
void displayUsage(bool used_params = false) const;
/// \brief Returns the path of the parameter group.
std::string path() const;
/// Insert a new item into the group.
void insert(const std::string& name,
const std::shared_ptr<ParameterMapItem>& data);
/// Insert a new parameter item into the group.
void insertParameter(const std::string& name, const std::string& value);
/// Unhandled arguments from command line parsing.
const std::vector<std::string>& unhandledArguments() const;
private:
typedef std::shared_ptr<ParameterMapItem> data_type;
typedef std::pair<std::string, data_type> pair_type;
typedef std::map<std::string, data_type> map_type;
std::string path_;
map_type map_;
const ParameterGroup* parent_;
bool output_is_enabled_;
std::vector<std::string> unhandled_arguments_;
template<typename T, class Requirement>
T translate(const pair_type& data, const Requirement& chk) const;
template <typename StringArray>
void parseCommandLineArguments(int argc, StringArray argv, bool verify_syntax);
void recursiveSetIsOutputEnabled(bool output_is_enabled);
// helper routines to do textual I/O
template <typename T>
static std::string to_string(const T& val);
static std::pair<std::string, std::string>
filename_split(const std::string& filename);
};
} // namespace Opm
#include <opm/common/utility/parameters/ParameterGroup_impl.hpp>
#endif // OPM_PARAMETERGROUP_HEADER

View File

@@ -0,0 +1,311 @@
//===========================================================================
//
// File: ParameterGroup_impl.hpp
//
// Created: Tue Jun 2 19:06:46 2009
//
// Author(s): B<>rd Skaflestad <bard.skaflestad@sintef.no>
// Atgeirr F Rasmussen <atgeirr@sintef.no>
//
// $Date$
//
// $Revision$
//
//===========================================================================
/*
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
Copyright 2009, 2010 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_PARAMETERGROUP_IMPL_HEADER
#define OPM_PARAMETERGROUP_IMPL_HEADER
#include <iostream>
#include <string>
#include <stdexcept>
#include <opm/common/utility/parameters/ParameterGroup.hpp>
#include <opm/common/utility/parameters/ParameterStrings.hpp>
#include <opm/common/utility/parameters/ParameterTools.hpp>
#include <opm/common/utility/parameters/Parameter.hpp>
#include <opm/common/ErrorMacros.hpp>
#include <opm/common/OpmLog/OpmLog.hpp>
namespace Opm {
template<>
struct ParameterMapItemTrait<ParameterGroup> {
static ParameterGroup
convert(const ParameterMapItem& item,
std::string& conversion_error,
bool enable_output)
{
std::string tag = item.getTag();
if (tag != ID_xmltag__param_grp) {
conversion_error = "The XML tag was '" + tag +
"' but should be '" +
ID_xmltag__param_grp + "'.\n";
return ParameterGroup("", 0, enable_output);
}
conversion_error = "";
const ParameterGroup& pg = dynamic_cast<const ParameterGroup&>(item);
return pg;
}
static std::string type() {return "ParameterGroup";}
};
template <typename T>
inline std::string
ParameterGroup::to_string(const T& val)
{
std::ostringstream os;
os << val;
return os.str();
}
template <>
inline std::string
ParameterGroup::to_string(const bool& b) {
if (b) {
return ID_true;
} else {
return ID_false;
}
}
template <>
inline std::string
ParameterGroup::to_string(const ParameterGroup&)
{
return std::string("<parameter group>");
}
inline std::pair<std::string, std::string>
ParameterGroup::filename_split(const std::string& filename)
{
int fpos = filename.rfind('.');
std::string name = filename.substr(0, fpos);
std::string type = filename.substr(fpos+1);
return std::make_pair(name, type);
}
template <typename StringArray>
ParameterGroup::ParameterGroup(int argc, StringArray argv, bool verify_syntax,
const bool enable_output)
: path_(ID_path_root), parent_(0), output_is_enabled_(enable_output)
{
if (verify_syntax && (argc < 2)) {
std::cerr << "Usage: " << argv[0] << " "
<< "[paramfilename1.param] "
<< "[paramfilename2.param] "
<< "[overridden_arg1=value1] "
<< "[overridden_arg2=value2] "
<< "[...]" << std::endl;
exit(EXIT_FAILURE);
}
this->parseCommandLineArguments(argc, argv, verify_syntax);
}
template <typename StringArray>
void ParameterGroup::parseCommandLineArguments(int argc, StringArray argv, bool verify_syntax)
{
std::vector<std::string> files;
std::vector<std::pair<std::string, std::string> > assignments;
for (int i = 1; i < argc; ++i) {
std::string arg(argv[i]);
int fpos = arg.find(ID_delimiter_assignment);
if (fpos == int(std::string::npos)) {
std::string filename = arg.substr(0, fpos);
files.push_back(filename);
continue;
}
int pos = fpos + ID_delimiter_assignment.size();
int spos = arg.find(ID_delimiter_assignment, pos);
if (spos == int(std::string::npos)) {
std::string name = arg.substr(0, fpos);
std::string value = arg.substr(pos, spos);
assignments.push_back(std::make_pair(name, value));
continue;
}
OpmLog::warning("Too many assignements (' "
+ ID_delimiter_assignment
+ "') detected in argument " + to_string(i));
}
for (int i = 0; i < int(files.size()); ++i) {
std::pair<std::string, std::string> file_type = filename_split(files[i]);
if (file_type.second == "param") {
this->readParam(files[i]);
} else {
if (verify_syntax) {
std::cerr << "ERROR: Input '" << files[i] << "' is not a valid name for a parameter file.\n";
std::cerr << " Valid filename extensions are 'param'.\n";
OPM_THROW(std::runtime_error, "ParameterGroup cannot handle argument: " << files[i]);
} else {
unhandled_arguments_.push_back(files[i]);
}
}
}
for (int i = 0; i < int(assignments.size()); ++i) {
this->insertParameter(assignments[i].first, assignments[i].second);
}
}
template<typename T>
inline T ParameterGroup::get(const std::string& name) const
{
return this->get<T>(name, ParameterRequirementNone());
}
template<typename T, class Requirement>
inline T ParameterGroup::get(const std::string& name,
const Requirement& r) const
{
setUsed();
std::pair<std::string, std::string> name_path = splitParam(name);
map_type::const_iterator it = map_.find(name_path.first);
if (it == map_.end()) {
if (parent_ != 0) {
// If we have a parent, ask it instead.
if (output_is_enabled_) {
OpmLog::warning(name + "not found at " + path() + ID_delimiter_path + ", asking parent.");
}
return parent_->get<T>(name, r);
} else {
// We are at the top, name has not been found.
std::cerr << "ERROR: The group '"
<< this->path()
<< "' does not contain an element named '"
<< name
<< "'.\n";
throw NotFoundException();
}
}
if (name_path.second == "") {
T val = this->translate<T>(*it, r);
it->second->setUsed();
if (output_is_enabled_) {
OpmLog::debug(name + " found at " + path() + ID_delimiter_path + ", value is " + to_string(val));
}
return val;
} else {
ParameterGroup& pg = dynamic_cast<ParameterGroup&>(*(*it).second);
pg.setUsed();
return pg.get<T>(name_path.second, r);
}
}
template<typename T>
inline T ParameterGroup::getDefault(const std::string& name,
const T& default_value) const
{
return this->getDefault<T>(name, default_value, ParameterRequirementNone());
}
template<typename T, class Requirement>
inline T ParameterGroup::getDefault(const std::string& name,
const T& default_value,
const Requirement& r) const
{
setUsed();
std::pair<std::string, std::string> name_path = splitParam(name);
map_type::const_iterator it = map_.find(name_path.first);
if (it == map_.end()) {
if (parent_ != 0) {
// If we have a parent, ask it instead.
if (output_is_enabled_) {
OpmLog::warning(name + " not found at " + path() + ID_delimiter_path + ", asking parent.");
}
return parent_->getDefault<T>(name, default_value, r);
} else {
// We check the requirement for the default value
std::string requirement_result = r(default_value);
if (requirement_result != "") {
std::cerr << "ERROR: The default value for the "
<< " element named '"
<< name
<< "' in the group '"
<< this->path()
<< "' failed to meet a requirenemt.\n";
std::cerr << "The requirement enforcer returned the following message:\n"
<< requirement_result
<< "\n";
throw RequirementFailedException<Requirement>();
}
}
if (output_is_enabled_) {
OpmLog::debug(name + " not found. Using default value '" + to_string(default_value) + "'.");
}
return default_value;
}
if (name_path.second == "") {
T val = this->translate<T>(*it, r);
it->second->setUsed();
if (output_is_enabled_) {
OpmLog::debug(name + " found at " + path() + ID_delimiter_path
+ ", value is '" + to_string(val) + "'.");
}
return val;
} else {
ParameterGroup& pg = dynamic_cast<ParameterGroup&>(*(*it).second);
pg.setUsed();
return pg.getDefault<T>(name_path.second, default_value, r);
}
}
template<typename T, class Requirement>
inline T ParameterGroup::translate(const pair_type& named_data,
const Requirement& chk) const
{
const std::string& name = named_data.first;
const data_type data = named_data.second;
std::string conversion_error;
T value = ParameterMapItemTrait<T>::convert(*data, conversion_error,
output_is_enabled_);
if (conversion_error != "") {
std::cerr << "ERROR: Failed to convert the element named '"
<< name
<< "' in the group '"
<< this->path()
<< "' to the type '"
<< ParameterMapItemTrait<T>::type()
<< "'.\n";
std::cerr << "The conversion routine returned the following message:\n"
<< conversion_error
<< "\n";
throw WrongTypeException();
}
std::string requirement_result = chk(value);
if (requirement_result != "") {
std::cerr << "ERROR: The element named '"
<< name
<< "' in the group '"
<< this->path()
<< "' of type '"
<< ParameterMapItemTrait<T>::type()
<< "' failed to meet a requirenemt.\n";
std::cerr << "The requirement enforcer returned the following message:\n"
<< requirement_result
<< "\n";
throw RequirementFailedException<Requirement>();
}
return value;
}
} // namespace Opm
#endif // OPM_PARAMETERGROUP_IMPL_HEADER

View File

@@ -0,0 +1,71 @@
//===========================================================================
//
// File: ParameterMapItem.hpp
//
// Created: Tue Jun 2 19:05:54 2009
//
// Author(s): B<>rd Skaflestad <bard.skaflestad@sintef.no>
// Atgeirr F Rasmussen <atgeirr@sintef.no>
//
// $Date$
//
// $Revision$
//
//===========================================================================
/*
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
Copyright 2009, 2010 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_PARAMETERMAPITEM_HEADER
#define OPM_PARAMETERMAPITEM_HEADER
#include <string>
namespace Opm {
/// The parameter handlig system is structured as a tree,
/// where each node inhertis from ParameterMapItem.
///
/// The abstract virtual function getTag() is used to determine
/// which derived class the node actually is.
struct ParameterMapItem {
/// Default constructor
ParameterMapItem() : used_(false) {}
/// Destructor
virtual ~ParameterMapItem() {}
/// \brief This function returns a string describing
/// the ParameterMapItem.
virtual std::string getTag() const = 0;
void setUsed() const { used_ = true; }
bool used() const { return used_; }
private:
mutable bool used_;
};
template<typename T>
struct ParameterMapItemTrait {
static T convert(const ParameterMapItem&,
std::string& conversion_error);
static std::string type();
};
} // namespace Opm
#endif // OPM_PARAMETERMAPITEM_HEADER

View File

@@ -0,0 +1,241 @@
//===========================================================================
//
// File: ParameterRequirement.hpp
//
// Created: Tue Jun 2 19:05:02 2009
//
// Author(s): B<>rd Skaflestad <bard.skaflestad@sintef.no>
// Atgeirr F Rasmussen <atgeirr@sintef.no>
//
// $Date$
//
// $Revision$
//
//===========================================================================
/*
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
Copyright 2009, 2010 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_PARAMETERREQUIREMENT_HEADER
#define OPM_PARAMETERREQUIREMENT_HEADER
#include <algorithm>
#include <cassert>
#include <sstream>
#include <string>
#include <vector>
namespace Opm {
/// @brief
/// @todo Doc me!
/// @tparam
/// @param
/// @return
struct ParameterRequirementNone {
template<typename T>
std::string operator()(const T&) const {
return "";
}
};
/// @brief
/// @todo Doc me!
/// @param
/// @return
struct ParameterRequirementProbability {
std::string operator()(double x) const {
if ( (x < 0.0) || (x > 1.0) ) {
std::ostringstream stream;
stream << "The value '" << x
<< "' is not in the interval [0, 1].";
return stream.str();
} else {
return "";
}
}
};
/// @brief
/// @todo Doc me!
/// @tparam
/// @param
/// @return
struct ParameterRequirementPositive {
template<typename T>
std::string operator()(const T& x) const {
if (x > 0) {
return "";
} else {
std::ostringstream stream;
stream << "The value '" << x << "' is not positive.";
return stream.str();
}
}
};
/// @brief
/// @todo Doc me!
/// @tparam
/// @param
/// @return
struct ParameterRequirementNegative {
template<typename T>
std::string operator()(const T& x) const {
if (x < 0) {
return "";
} else {
std::ostringstream stream;
stream << "The value '" << x << "' is not negative.";
return stream.str();
}
}
};
/// @brief
/// @todo Doc me!
/// @tparam
/// @param
/// @return
struct ParameterRequirementNonPositive {
template<typename T>
std::string operator()(const T& x) const {
if (x > 0) {
std::ostringstream stream;
stream << "The value '" << x << "' is positive.";
return stream.str();
} else {
return "";
}
}
};
/// @brief
/// @todo Doc me!
/// @tparam
/// @param
/// @return
struct ParameterRequirementNonNegative {
template<typename T>
std::string operator()(const T& x) const {
if (x < 0) {
std::ostringstream stream;
stream << "The value '" << x << "' is negative.";
return stream.str();
} else {
return "";
}
}
};
/// @brief
/// @todo Doc me!
/// @tparam
/// @param
/// @return
struct ParameterRequirementNonZero {
template<typename T>
std::string operator()(const T& x) const {
if (x != 0) {
return "";
} else {
return "The value was zero.";
}
}
};
/// @brief
/// @todo Doc me!
/// @param
/// @return
struct ParameterRequirementNonEmpty {
std::string operator()(const std::string& x) const {
if (x != "") {
return "The string was empty.";
} else {
return "";
}
}
};
/// @brief
/// @todo Doc me!
/// @tparam
/// @param
/// @return
template<class Requirement1, class Requirement2>
struct ParameterRequirementAnd {
ParameterRequirementAnd(const Requirement1& r1, const Requirement2& r2) :
r1_(r1), r2_(r2) { }
template<typename T>
std::string operator()(const T& t) const {
std::string e1 = r1_(t);
std::string e2 = r2_(t);
if (e1 == "") {
return e2;
} else if (e2 == "") {
return e1;
} else {
return e1 + " AND " + e2;
}
}
private:
const Requirement1 r1_;
const Requirement2 r2_;
};
/// @brief
/// @todo Doc me!
/// @param
struct ParameterRequirementMemberOf {
explicit ParameterRequirementMemberOf(const std::vector<std::string>& elements)
: elements_(elements) {
assert(elements_.size() > 0);
}
/// @brief
/// @todo Doc me!
/// @param
/// @return
std::string operator()(const std::string& x) const {
if (std::find(elements_.begin(), elements_.end(), x) == elements_.end()) {
if (elements_.size() == 1) {
return "The string '" + x + "' is not '" + elements_[0] + "'.";
}
std::ostringstream stream;
stream << "The string '" << x << "' is not among '";
for (int i = 0; i < int(elements_.size()) - 2; ++i) {
stream << elements_[i] << "', '";
}
stream << elements_[elements_.size() - 2]
<< "' and '"
<< elements_[elements_.size() - 1]
<< "'.";
return stream.str();
} else {
return "";
}
}
private:
const std::vector<std::string> elements_;
};
} // namespace Opm
#endif // OPM_PARAMETERREQUIREMENT_HEADER

View File

@@ -0,0 +1,63 @@
//===========================================================================
//
// File: ParameterStrings.hpp
//
// Created: Tue Jun 2 19:04:15 2009
//
// Author(s): B<>rd Skaflestad <bard.skaflestad@sintef.no>
// Atgeirr F Rasmussen <atgeirr@sintef.no>
//
// $Date$
//
// $Revision$
//
//===========================================================================
/*
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
Copyright 2009, 2010 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_PARAMETERSTRINGS_HEADER
#define OPM_PARAMETERSTRINGS_HEADER
#include <string>
namespace Opm {
const std::string ID_true = "true";
const std::string ID_false = "false";
const std::string ID_xmltag__param_grp = "ParameterGroup";
const std::string ID_xmltag__param = "Parameter";
const std::string ID_param_type__bool = "bool";
const std::string ID_param_type__int = "int";
const std::string ID_param_type__float = "double";
const std::string ID_param_type__string = "string";
const std::string ID_param_type__file = "file";
const std::string ID_param_type__cmdline = "cmdline";
//
const std::string ID_path_root = "";
const std::string ID_delimiter_path = "/";
const std::string ID_comment = "//";
const std::string ID_delimiter_assignment = "=";
} // namespace Opm
#endif // OPM_PARAMETERSTRINGS_HEADER

View File

@@ -0,0 +1,46 @@
//===========================================================================
//
// File: ParameterTools.hpp
//
// Created: Tue Jun 2 19:02:19 2009
//
// Author(s): B<>rd Skaflestad <bard.skaflestad@sintef.no>
// Atgeirr F Rasmussen <atgeirr@sintef.no>
//
// $Date$
//
// $Revision$
//
//===========================================================================
/*
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
Copyright 2009, 2010 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_PARAMETERTOOLS_HEADER
#define OPM_PARAMETERTOOLS_HEADER
#include <string>
#include <utility>
namespace Opm {
std::pair<std::string, std::string> splitParam(const std::string& name);
} // namespace Opm
#endif // OPM_PARAMETERTOOLS_HEADER

70
opm/json/JsonObject.hpp Normal file
View File

@@ -0,0 +1,70 @@
/*
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 JSON_OBJECT_HPP
#define JSON_OBJECT_HPP
#include <string>
#include <boost/filesystem/path.hpp>
struct cJSON;
namespace Json {
class JsonObject {
public:
explicit JsonObject(const boost::filesystem::path& jsonFile );
explicit JsonObject(const std::string& inline_json);
explicit JsonObject(const char * inline_json);
explicit JsonObject(cJSON * root);
~JsonObject();
bool has_item(const std::string& key) const;
JsonObject get_array_item( size_t index ) const;
JsonObject get_item(const std::string& key) const;
std::string to_string() const;
std::string get_string(const std::string& key) const;
std::string as_string() const;
bool is_string( ) const;
bool is_number( ) const;
int get_int(const std::string& key) const;
int as_int() const;
double get_double(const std::string& key) const;
double as_double() const;
bool is_array( ) const;
bool is_object( ) const;
size_t size() const;
private:
JsonObject get_scalar_object(const std::string& key) const;
void initialize(const std::string& inline_json);
cJSON * root;
bool owner;
};
}
#endif

103
opm/output/OutputWriter.hpp Normal file
View File

@@ -0,0 +1,103 @@
/*
Copyright (c) 2013 Uni Research AS
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_OUTPUT_WRITER_HPP
#define OPM_OUTPUT_WRITER_HPP
#include <opm/parser/eclipse/EclipseState/Grid/NNC.hpp>
#include <opm/output/Cells.hpp>
#include <opm/output/Wells.hpp>
struct UnstructuredGrid;
namespace Opm {
// forward declaration
class EclipseState;
namespace parameter { class ParameterGroup; }
class WellState;
struct PhaseUsage;
/*!
* Interface for writing non-compositional (blackoil, two-phase) simulation
* state to files.
*
* Use the create() function to setup a chain of writer based on the
* configuration values, e.g.
*
* \example
* \code{.cpp}
* ParameterGroup params (argc, argv, false);
* auto parser = std::make_shared <const Deck> (
* params.get <string> ("deck_filename"));
*
* std::unique_ptr <OutputWriter> writer =
* OutputWriter::create (params, parser);
*
* // before the first timestep
* writer->writeInit( current_posix_time, time_since_epoch_at_start );
*
* // after each timestep
* writer->writeTimeStep
*
* \endcode
*/
class OutputWriter {
public:
/// Allow derived classes to be used in the unique_ptr that is returned
/// from the create() method. (Every class that should be delete'd should
/// have a proper constructor, and if the base class isn't virtual then
/// the compiler won't call the right one when the unique_ptr goes out of
/// scope).
virtual ~OutputWriter () { }
/**
* Write the static data (grid, PVT curves, etc) to disk.
*
* This routine should be called before the first timestep (i.e. when
* timer.currentStepNum () == 0)
*/
virtual void writeInit( const NNC& nnc ) = 0;
/*!
* \brief Write a blackoil reservoir state to disk for later inspection with
* visualization tools like ResInsight
*
* \param[in] report_step The current report step
* \param[in] current_posix_time Seconds elapsed since epoch
* \param[in] seconds_elapsed Seconds elapsed since simulation start
* \param[in] reservoirState The thermodynamic state of the reservoir
* \param[in] wells Well data
*
* This routine should be called after the timestep has been advanced,
* i.e. timer.currentStepNum () > 0.
*/
virtual void writeTimeStep( int report_step,
time_t current_posix_time,
double seconds_elapsed,
data::Solution reservoirState,
data::Wells,
bool isSubstep) = 0;
};
} // namespace Opm
#endif /* OPM_OUTPUT_WRITER_HPP */

77
opm/output/data/Cells.hpp Normal file
View File

@@ -0,0 +1,77 @@
/*
Copyright 2016 Statoil ASA.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_OUTPUT_CELLS_HPP
#define OPM_OUTPUT_CELLS_HPP
#include <map>
#include <vector>
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
namespace Opm {
namespace data {
/*
The 3D data which are saved to file are assembled in one large
container. In the container the data is tagged with an element
from the TargetType enum which indicates why they they have been
added to the container - and where they are headed.
RESTART_SOLUTION : Fields which represent primary variables, and
are reqired for restart. Typically pressure and
suturation. WIll end up in the SOLUTION section of the restart
file.
RESTART_AUXILIARY : Fields with extra information, not required
for restart. Examples of this include fluid in place values or
evaluations of relative permeability. Will end up in the
restart file.
SUMMARY : Fields which are added only to serve as input data for
calculations of summary results. The Summary implementation can
use data with any tag value, but if it is tagged as SUMMARY it
will not be output anywhere else.
INIT : Fields which should go to the INIT file.
*/
enum class TargetType {
RESTART_SOLUTION,
RESTART_AUXILIARY,
SUMMARY,
INIT,
};
/**
* Small struct that keeps track of data for output to restart/summary files.
*/
struct CellData {
UnitSystem::measure dim; //< Dimension of the data to write
std::vector<double> data; //< The actual data itself
TargetType target;
};
}
}
#endif //OPM_OUTPUT_CELLS_HPP

View File

@@ -0,0 +1,65 @@
/*
Copyright 2016 Statoil ASA.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_OUTPUT_DATA_SOLUTION_HPP
#define OPM_OUTPUT_DATA_SOLUTION_HPP
#include <string>
#include <map>
#include <opm/output/data/Cells.hpp>
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
namespace Opm {
namespace data {
class Solution : public std::map< std::string, data::CellData > {
using Base = std::map< std::string, data::CellData >;
public:
Solution() = default;
explicit Solution( bool si );
using Base::map;
using Base::insert;
bool has( const std::string& ) const;
/*
* Get the data field of the struct matching the requested key. Will
* throw std::out_of_range if they key does not exist.
*/
std::vector< double >& data(const std::string& );
const std::vector< double >& data(const std::string& ) const;
std::pair< iterator, bool > insert( std::string name,
UnitSystem::measure,
std::vector< double >,
TargetType );
void convertToSI( const UnitSystem& );
void convertFromSI( const UnitSystem& );
private:
bool si = true;
};
}
}
#endif

361
opm/output/data/Wells.hpp Normal file
View File

@@ -0,0 +1,361 @@
/*
Copyright 2016 Statoil ASA.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_OUTPUT_WELLS_HPP
#define OPM_OUTPUT_WELLS_HPP
#include <initializer_list>
#include <map>
#include <algorithm>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <vector>
namespace Opm {
namespace data {
class Rates {
/* Methods are defined inline for performance, as the actual *work* done
* is trivial, but somewhat frequent (typically once per time step per
* completion per well).
*
* To add a new rate type, add an entry in the enum with the correct
* shift, and if needed, increase the size type. Add a member variable
* and a new case in get_ref.
*/
public:
Rates() = default;
enum class opt : uint32_t {
wat = (1 << 0),
oil = (1 << 1),
gas = (1 << 2),
polymer = (1 << 3),
solvent = (1 << 4),
energy = (1 << 5),
dissolved_gas = (1 << 6),
vaporized_oil = (1 << 7),
reservoir_water = (1 << 8),
reservoir_oil = (1 << 9),
reservoir_gas = (1 << 10),
};
using enum_size = std::underlying_type< opt >::type;
/// Query if a value is set.
inline bool has( opt ) const;
/// Read the value indicated by m. Throws an exception if
/// if the requested value is unset.
inline double get( opt m ) const;
/// Read the value indicated by m. Returns a default value if
/// the requested value is unset.
inline double get( opt m, double default_value ) const;
/// Set the value specified by m. Throws an exception if multiple
/// values are requested. Returns a self-reference to support
/// chaining.
inline Rates& set( opt m, double value );
/// true if any option is set; false otherwise
inline bool any() const noexcept;
template <class MessageBufferType>
void write(MessageBufferType& buffer) const;
template <class MessageBufferType>
void read(MessageBufferType& buffer);
private:
double& get_ref( opt );
const double& get_ref( opt ) const;
opt mask = static_cast< opt >( 0 );
double wat = 0.0;
double oil = 0.0;
double gas = 0.0;
double polymer = 0.0;
double solvent = 0.0;
double energy = 0.0;
double dissolved_gas = 0.0;
double vaporized_oil = 0.0;
double reservoir_water = 0.0;
double reservoir_oil = 0.0;
double reservoir_gas = 0.0;
};
struct Completion {
using global_index = size_t;
static const constexpr int restart_size = 2;
global_index index;
Rates rates;
double pressure;
double reservoir_rate;
double cell_pressure;
double cell_saturation_water;
double cell_saturation_gas;
template <class MessageBufferType>
void write(MessageBufferType& buffer) const;
template <class MessageBufferType>
void read(MessageBufferType& buffer);
};
struct Well {
Rates rates;
double bhp;
double thp;
double temperature;
int control;
std::vector< Completion > completions;
inline bool flowing() const noexcept;
template <class MessageBufferType>
void write(MessageBufferType& buffer) const;
template <class MessageBufferType>
void read(MessageBufferType& buffer);
};
class WellRates : public std::map<std::string , Well> {
public:
double get(const std::string& well_name , Rates::opt m) const {
const auto& well = this->find( well_name );
if( well == this->end() ) return 0.0;
return well->second.rates.get( m, 0.0 );
}
double get(const std::string& well_name , Completion::global_index completion_grid_index, Rates::opt m) const {
const auto& witr = this->find( well_name );
if( witr == this->end() ) return 0.0;
const auto& well = witr->second;
const auto& completion = std::find_if( well.completions.begin() ,
well.completions.end() ,
[=]( const Completion& c ) {
return c.index == completion_grid_index; });
if( completion == well.completions.end() )
return 0.0;
return completion->rates.get( m, 0.0 );
}
template <class MessageBufferType>
void write(MessageBufferType& buffer) const {
unsigned int size = this->size();
buffer.write(size);
for (const auto& witr : *this) {
const std::string& name = witr.first;
buffer.write(name);
const Well& well = witr.second;
well.write(buffer);
}
}
template <class MessageBufferType>
void read(MessageBufferType& buffer) {
unsigned int size;
buffer.read(size);
for (size_t i = 0; i < size; ++i) {
std::string name;
buffer.read(name);
Well well;
well.read(buffer);
this->emplace(name, well);
}
}
};
using Wells = WellRates;
/* IMPLEMENTATIONS */
inline bool Rates::has( opt m ) const {
const auto mand = static_cast< enum_size >( this->mask )
& static_cast< enum_size >( m );
return static_cast< opt >( mand ) == m;
}
inline double Rates::get( opt m ) const {
if( !this->has( m ) )
throw std::invalid_argument( "Uninitialized value." );
return this->get_ref( m );
}
inline double Rates::get( opt m, double default_value ) const {
if( !this->has( m ) ) return default_value;
return this->get_ref( m );
}
inline Rates& Rates::set( opt m, double value ) {
this->get_ref( m ) = value;
/* mask |= m */
this->mask = static_cast< opt >(
static_cast< enum_size >( this->mask ) |
static_cast< enum_size >( m )
);
return *this;
}
/*
* To avoid error-prone and repetitve work when extending rates with new
* values, the get+set methods use this helper get_ref to determine what
* member to manipulate. To add a new option, just add another case
* corresponding to the enum entry in Rates to this function.
*
* This is an implementation detail and understanding this has no
* significant impact on correct use of the class.
*/
inline const double& Rates::get_ref( opt m ) const {
switch( m ) {
case opt::wat: return this->wat;
case opt::oil: return this->oil;
case opt::gas: return this->gas;
case opt::polymer: return this->polymer;
case opt::solvent: return this->solvent;
case opt::energy: return this->energy;
case opt::dissolved_gas: return this->dissolved_gas;
case opt::vaporized_oil: return this->vaporized_oil;
case opt::reservoir_water: return this->reservoir_water;
case opt::reservoir_oil: return this->reservoir_oil;
case opt::reservoir_gas: return this->reservoir_gas;
}
throw std::invalid_argument(
"Unknown value type '"
+ std::to_string( static_cast< enum_size >( m ) )
+ "'" );
}
inline double& Rates::get_ref( opt m ) {
return const_cast< double& >(
static_cast< const Rates* >( this )->get_ref( m )
);
}
inline bool Rates::any() const noexcept {
return static_cast< enum_size >( this->mask ) != 0;
}
inline bool Well::flowing() const noexcept {
return this->rates.any();
}
template <class MessageBufferType>
void Rates::write(MessageBufferType& buffer) const {
buffer.write(this->mask);
buffer.write(this->wat);
buffer.write(this->oil);
buffer.write(this->gas);
buffer.write(this->polymer);
buffer.write(this->solvent);
buffer.write(this->energy);
buffer.write(this->dissolved_gas);
buffer.write(this->vaporized_oil);
buffer.write(this->reservoir_water);
buffer.write(this->reservoir_oil);
buffer.write(this->reservoir_gas);
}
template <class MessageBufferType>
void Completion::write(MessageBufferType& buffer) const {
buffer.write(this->index);
this->rates.write(buffer);
buffer.write(this->pressure);
buffer.write(this->reservoir_rate);
buffer.write(this->cell_pressure);
buffer.write(this->cell_saturation_water);
buffer.write(this->cell_saturation_gas);
}
template <class MessageBufferType>
void Well::write(MessageBufferType& buffer) const {
this->rates.write(buffer);
buffer.write(this->bhp);
buffer.write(this->thp);
buffer.write(this->temperature);
buffer.write(this->control);
unsigned int size = this->completions.size();
buffer.write(size);
for (const Completion& comp : this->completions)
comp.write(buffer);
}
template <class MessageBufferType>
void Rates::read(MessageBufferType& buffer) {
buffer.read(this->mask);
buffer.read(this->wat);
buffer.read(this->oil);
buffer.read(this->gas);
buffer.read(this->polymer);
buffer.read(this->solvent);
buffer.read(this->energy);
buffer.read(this->dissolved_gas);
buffer.read(this->vaporized_oil);
buffer.read(this->reservoir_water);
buffer.read(this->reservoir_oil);
buffer.read(this->reservoir_gas);
}
template <class MessageBufferType>
void Completion::read(MessageBufferType& buffer) {
buffer.read(this->index);
this->rates.read(buffer);
buffer.read(this->pressure);
buffer.read(this->reservoir_rate);
buffer.read(this->cell_pressure);
buffer.read(this->cell_saturation_water);
buffer.read(this->cell_saturation_gas);
}
template <class MessageBufferType>
void Well::read(MessageBufferType& buffer) {
this->rates.read(buffer);
buffer.read(this->bhp);
buffer.read(this->thp);
buffer.read(this->temperature);
buffer.read(this->control);
unsigned int size = 0.0; //this->completions.size();
buffer.read(size);
this->completions.resize(size);
for (size_t i = 0; i < size; ++i)
{
auto& comp = this->completions[ i ];
comp.read(buffer);
}
}
}
}
#endif //OPM_OUTPUT_WELLS_HPP

View File

@@ -0,0 +1,103 @@
//===========================================================================
//
// File: EclipseGridInspector.h
//
// Created: Mon Jun 2 09:46:08 2008
//
// Author: Atgeirr F Rasmussen <atgeirr@sintef.no>
//
// $Date$
//
// Revision: $Id: EclipseGridInspector.h,v 1.2 2008/08/18 14:16:12 atgeirr Exp $
//
//===========================================================================
/*
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
Copyright 2009, 2010 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_ECLIPSEGRIDINSPECTOR_HEADER
#define OPM_ECLIPSEGRIDINSPECTOR_HEADER
#include <vector>
#include <array>
#include <opm/parser/eclipse/Deck/Deck.hpp>
namespace Opm
{
/**
@brief A class for inspecting the contents of an eclipse file.
Given an Eclipse deck, this class may be used to answer certain
queries about its contents.
@author Atgeirr F. Rasmussen <atgeirr@sintef.no>
@date 2008/06/02 09:46:08
*/
class EclipseGridInspector
{
public:
/// Constructor taking a parser as argument.
/// The parser must already have read an Eclipse file.
explicit EclipseGridInspector(Opm::Deck);
/// Assuming that the pillars are vertical, compute the
/// volume of the cell given by logical coordinates (i, j, k).
double cellVolumeVerticalPillars(int i, int j, int k) const;
/// Assuming that the pillars are vertical, compute the
/// volume of the cell given by the cell index
double cellVolumeVerticalPillars(int cell_idx) const;
/// Compute the average dip in x- and y-direction of the
/// cell tops and bottoms relative to the xy-plane
std::pair<double,double> cellDips(int i, int j, int k) const;
std::pair<double,double> cellDips(int cell_idx) const;
// Convert global cell index to logical ijk-coordinates
std::array<int, 3> cellIdxToLogicalCoords(int cell_idx) const;
/// Returns a vector with the outer limits of grid (in the grid's unit).
/// The vector contains [xmin, xmax, ymin, ymax, zmin, zmax], as
/// read from COORDS and ZCORN
std::array<double, 6> getGridLimits() const;
/// Returns the extent of the logical cartesian grid
/// as number of cells in the (i, j, k) directions.
std::array<int, 3> gridSize() const;
/// Returns the eight z-values associated with a given cell.
/// The ordering is such that i runs fastest. That is, with
/// L = low and H = high:
/// {LLL, HLL, LHL, HHL, LLH, HLH, LHH, HHH }.
std::array<double, 8> cellZvals(int i, int j, int k) const;
private:
Opm::Deck deck_;
int logical_gridsize_[3];
void init_();
void checkLogicalCoords(int i, int j, int k) const;
};
} // namespace Opm
#endif // OPM_ECLIPSEGRIDINSPECTOR_HEADER

View File

@@ -0,0 +1,238 @@
/*
Copyright (c) 2013 Andreas Lauser
Copyright (c) 2013 Uni Research AS
Copyright (c) 2014 IRIS AS
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_ECLIPSE_WRITER_HPP
#define OPM_ECLIPSE_WRITER_HPP
#include <map>
#include <string>
#include <vector>
#include <array>
#include <memory>
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/NNC.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>
namespace Opm {
class EclipseState;
class SummaryConfig;
class Schedule;
/*!
* \brief A class to write the reservoir state and the well state of a
* blackoil simulation to disk using the Eclipse binary format.
*/
class EclipseIO {
public:
/*!
* \brief Sets the common attributes required to write eclipse
* binary files using ERT.
*/
EclipseIO( const EclipseState& es,
EclipseGrid grid,
const Schedule& schedule,
const SummaryConfig& summary_config);
/** \brief Output static properties in EGRID and INIT file.
*
* Write the static eclipse data (grid, PVT curves, etc) to disk,
* and set up additional initial properties. There are no specific
* keywords to configure the output to the INIT files, it seems
* like the algorithm is: "All available keywords are written to
* INIT file". For the current code the algorithm is as such:
*
*
* 1. 3D properties which can be simply calculated in the output
* layer are unconditionally written to disk, that currently
* includes the DX, DY, DZ and DEPTH keyword.
*
* 2. All integer propeerties from the deck are written
* unconditionally, that typically includes the MULTNUM, PVTNUM,
* SATNUM and so on. Observe that the keywords PVTNUM, SATNUM,
* EQLNUM and FIPNUM are autocreated in the output layer, so
* they will be on disk even if they are not explicitly included
* in the deck.
*
* 3. The PORV keyword will *always* be present in the INIT file,
* and that keyword will have nx*ny*nz elements; all other 3D
* properties will only have nactive elements.
*
* 4. For floating point 3D keywords from the deck - like PORO and
* PERMX there is a *hardcoded* list in the writeINIFile( )
* implementation of which keywords to output - if they are
* available.
*
* 5. The container simProps contains additional 3D floating point
* properties which have been calculated by the simulator, this
* typically includes the transmissibilities TRANX, TRANY and
* TRANZ but could in principle be anye floating point
* property.
*
* If you want the FOE keyword in the summary output the
* simProps container must contain the initial OIP field.
*
* In addition:
*
* - The NNC argument is distributed between the EGRID and INIT
* files.
*
* - PVT curves are written unconditionally, saturation functions
* are not yet written to disk.
*/
void writeInitial( data::Solution simProps = data::Solution(), std::map<std::string, std::vector<int> > int_data = {}, const NNC& nnc = NNC());
/**
* \brief Overwrite the initial OIP values.
*
* These are also written when we call writeInitial if the simProps
* contains them. If not these are assumed to zero and the simulator
* can update them with this methods.
* \param simProps The properties containing at least OIP.
*/
void overwriteInitialOIP( const data::Solution& simProps );
/*!
* \brief Write a reservoir state and summary information to disk.
*
*
* The reservoir state can be inspected with visualization tools like
* ResInsight.
*
* The summary information can then be visualized using tools from
* ERT or ECLIPSE. Note that calling this method is only
* meaningful after the first time step has been completed.
*
* The optional simProps vector contains fields which have been
* calculated by the simulator and are written to the restart
* file. Examples of such fields would be the relative
* permeabilities KRO, KRW and KRG and fluxes. The keywords which
* can be added here are represented with mnenonics in the RPTRST
* keyword.
*
* The extra_restart argument is an optional aergument which can
* be used to store arbitrary double vectors in the restart
* file. The following rules apply for the extra data:
*
* 1. There is no size constraints.
*
* 2. The keys must be unqiue across the SOlution container, and
* also built in default keys like 'INTEHEAD'.
*
* 3. There is no unit conversion applied - the vectors are
* written to disk verbatim.
*
* If the optional argument write_double is sent in as true the
* fields in the solution container will be written in double
* precision. OPM can load and restart from files with double
* precision keywords, but this is non-standard, and other third
* party applications might choke on those.
*
* The misc_summary_values argument is used to pass pass various
* summary values which are of type 'ECL_SMSPEC_MISC_VAR' to the
* summary writer. The ability to pass miscellanous values to the
* summary writer is not very flexible:
*
* 1. The keyword must be an already well defined ECLIPSE keyword
* like e.g. one of the performance related keywords.
*
* 2. The keyword must have been requested in the SUMMARY section
* of the input deck.
*
* 3. The dimension of the keyword must have specified in the
* hardcoded static map misc_units in Summary.cpp.
*/
void writeTimeStep( int report_step,
bool isSubstep,
double seconds_elapsed,
data::Solution,
data::Wells,
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 std::map<std::string, std::vector<double>>& extra_restart = {},
bool write_double = false);
/*
Will load solution data and wellstate from the restart
file. This method will consult the IOConfig object to get
filename and report step to restart from.
The map keys should be a map of keyword names and their
corresponding dimension object, i.e. to load the state from a
simple two phase simulation you would pass:
keys = {{"PRESSURE" , UnitSystem::measure::pressure},
{"SWAT" , UnitSystem::measure::identity }}
For a three phase black oil simulation you would add pairs for
SGAS, RS and RV. If you ask for keys which are not found in the
restart file an exception will be raised, the happens if the
size of a vector is wrong.
The function will consult the InitConfig object in the
EclipseState object to determine which file and report step to
load.
The return value is of type 'data::Solution', which is the same
container type which is used by the EclipseIO, but observe
that the dim and target elements carry no information:
- The returned double data has been converted to SI.
. The target is unconditionally set to 'RESTART_SOLUTION'
The extra_keys argument can be used to request additional
kewyords from the restart value. The extra vectors will be
stored in the 'extra' field of the RestartValue return
value. These values must have been added to the restart file
previosuly with the extra argument to the writeTimeStep()
method. If the bool value in the map is true the value is
required, and the output layer will throw an exception if it is
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::map<std::string, RestartKey>& keys, const std::map<std::string, bool>& extra_keys = {}) const;
EclipseIO( const EclipseIO& ) = delete;
~EclipseIO();
private:
class Impl;
std::unique_ptr< Impl > impl;
};
} // namespace Opm
#endif // OPM_ECLIPSE_WRITER_HPP

View File

@@ -0,0 +1,35 @@
#ifndef ECLIPSE_IO_UTIL_HPP
#define ECLIPSE_IO_UTIL_HPP
#include <vector>
#include <string>
#include <iostream>
namespace Opm
{
namespace EclipseIOUtil
{
template <typename T>
void addToStripedData(const std::vector<T>& data, std::vector<T>& result, size_t offset, size_t stride) {
int dataindex = 0;
for (size_t index = offset; index < result.size(); index += stride) {
result[index] = data[dataindex];
++dataindex;
}
}
template <typename T>
void extractFromStripedData(const std::vector<T>& data, std::vector<T>& result, size_t offset, size_t stride) {
for (size_t index = offset; index < data.size(); index += stride) {
result.push_back(data[index]);
}
}
} //namespace EclipseIOUtil
} //namespace Opm
#endif //ECLIPSE_IO_UTIL_HPP

View File

@@ -0,0 +1,168 @@
/*
Copyright 2017 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 LINEARISED_OUTPUT_TABLE_HPP_INCLUDED
#define LINEARISED_OUTPUT_TABLE_HPP_INCLUDED
#include <cstddef>
#include <vector>
namespace Opm {
/// Manage tables of column data, possibly with sub-tables, all with
/// equal number of rows (i.e., with padding), and possibly with
/// multiple tables pertaining to multiple subsets (i.e., cell regions).
///
/// Mainly intended for use with the output facility for tabular data.
class LinearisedOutputTable
{
public:
/// Constructor.
///
/// \param[in] numTables Number of tables managed by internal
/// buffer. Typically corresponds to maximum value of a region
/// ID vector such as SATNUM, IMBNUM, or PVTNUM.
///
/// \param[in] numPrimary Number of primary look-up keys for the
/// tabular data managed by the internal buffer. Mostly relevant
/// (i.e., greater than one) for miscible oil ("PVTO") or
/// miscible gas ("PVTG") tables and typically corresponds to the
/// number of Rs/Rv entries from the TABDIMS keyword.
///
/// \param[in] numRows Number of rows in each sub-table
/// corresponding to a single primary look-up key. Typically the
/// number of nodes (e.g., NSSFUN or NPPVT) of the corresponding
/// input keyword.
///
/// \param[in] numCols Number of columns in each sub-table (and main
/// table). Typically 5.
LinearisedOutputTable(const std::size_t numTables,
const std::size_t numPrimary,
const std::size_t numRows,
const std::size_t numCols);
/// Retrieve iterator to start of \c numRows (contiguous) column
/// elements of a particular sub-table of a particular main table.
///
/// \param[in] tableID Numeric ID of main table for which to
/// retrieve a column. Must be strictly less than \c numTables
/// constructor argument.
///
/// \param[in] primID Numeric ID of primary look-up key (sub-table)
/// for which to retrieve a column. Must be strictly less than
/// \c numPrimary constructor argument.
///
/// \param[in] colID Numeric ID of column to be retrieved from
/// particular sub-table of particular main table. Must be
/// strictly less than \c numCols constructor argument.
///
/// \return Iterator to start of contiguous column elements.
std::vector<double>::iterator
column(const std::size_t tableID,
const std::size_t primID,
const std::size_t colID);
/// Read-only access to internal data buffer.
///
/// Mostly to support outputting all table data to external storage.
const std::vector<double>& getData() const;
/// Destructive access to internal data buffer.
///
/// Mostly to support outputting all table data to external storage.
///
/// \return \code std::move() \endcode of the internal data buffer.
std::vector<double> getDataDestructively();
private:
/// Internal buffer for tabular data.
std::vector<double> data;
/// Number of tables managed by \c data.
std::size_t numTables;
/// Number of primary look-up keys/sub-tables in \c data_.
std::size_t numPrimary;
/// Number of rows per sub-table in \c data_.
std::size_t numRows;
};
/// Apply piecewise linear differentiation (i.e., compute slopes) on a
/// set of dependent variables in a linearised output table.
///
namespace DifferentiateOutputTable {
/// Columnar data differentantiation table request.
///
/// Refers to the sub-table with a specific primary ID within a
/// specific table of a \c LinearisedOutputTable.
struct Descriptor {
/// Table ID--usually corresponds to the region ID of a
/// tabulated function pertaining to a specific region of a
/// simulation model.
std::size_t tableID{ 0 };
/// Primary ID--nontrivial (\c != 0) only for miscible PVT
/// tables for oil or gas in which case this entry refers to a
/// particular dissolved gas-oil ratio (Rs) or gas pressure
/// (Pg) node.
std::size_t primID{ 0 };
/// Number of active rows in this subtable.
std::size_t numActRows{ 0 };
};
/// Apply piecewise linear differentiation (i.e., compute slopes) on
/// a set of dependent variables in a linearised output table.
///
/// Assumes that the independent variable is stored in the first
/// column (column ID zero).
///
/// \param[in] numDependent Number of dependent variables. Usually
/// one or two. Dependent variables are assumed to be stored in
/// columns one through \p numDependent.
///
/// \param[in] desc Columnar data differentantiation table request.
/// Must refer to a particular sub-table of the linearised output
/// table.
///
/// \param[in,out] table Linearised output table. On input, column
/// zero contains the independent variable in each of \code
/// numActRows.size() \endcode sub-tables and columns one through
/// \p numDependent contain the dependent variables. On output,
/// columns \code numDependent + 1 \endcode through \code 2 *
/// numDependent \endcode contain the slopes of the dependent
/// variables.
///
/// In partcular, column \code numDependent + j \endcode for
/// \code j = 1..numDependent \endcode contains the derivatives
/// of column \c j with respect to column zero. We define the
/// slopes as
/// \code
/// s(i,j) = (c(i + 1, j) - c(i,j)) / (c(i + 1, 0) - c(i,0))
/// \endcode
/// for all \code i = 0 .. numActRows[k] - 2 \endcode (in table
/// \p k).
void calcSlopes(const std::size_t numDependent,
const Descriptor& desc,
LinearisedOutputTable& table);
} // DifferentiateOutputTable
} // Opm
#endif // LINEARISED_OUTPUT_TABLE_HPP_INCLUDED

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