Commit Graph

953 Commits

Author SHA1 Message Date
Joakim Hove
0b316092c8 Added missing include. 2016-04-12 13:56:31 +02:00
Liu Ming
4eb2208e63 remove shared_ptr 2016-04-12 09:01:33 +08:00
Liu Ming
ed92c70efd Add MessageContainer to EclipseState. 2016-04-11 10:44:39 +08: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
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
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
Joakim Hove
d1652ef6ba Allow 'WAT' when parsing type string in WCONINJE. 2016-03-22 10:32:00 +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
25acd89325 rename the last files. 2016-03-17 08:42:46 +08:00
Liu Ming
a4a449538d rename ParseMode as ParseContext in EclipseState folder. 2016-03-16 17:15:09 +08:00
Joakim Hove
53471d2329 PLYVISC: INCREASING instead of STRIVLY_INCREASING. 2016-03-15 14:11:42 +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
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
Atgeirr Flø Rasmussen
b026c55c3b Honor the ACTNUM keyword also for cartesian grids. 2016-03-01 14:40:36 +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
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
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
2518d08aa1 Add missing include directives. 2016-02-29 10:10:14 +01:00
Joakim Hove
1c32ef5562 Merge pull request #682 from jokva/summary
Internalise SUMMARY section
2016-02-22 14:30:07 +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
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
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
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
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
551e65eca4 Internalize MESSAGES keyword. 2016-02-04 15:14:32 +01:00
Joakim Hove
ff1802ebb7 Reformatted test adding. 2016-02-04 15:13:40 +01:00
Joakim Hove
31c69e6702 Using unique_ptr in EclipseGrid. 2016-02-03 16:18:31 +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