Commit Graph

932 Commits

Author SHA1 Message Date
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
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
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
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
chflo
cc2b7f5f50 Support GRUP controlmode in wellProductionProperties if well is available for group control 2016-01-25 10:47:22 +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
d59b34bcb5 Added copy constructor for TableIndex. 2016-01-17 16:37:31 +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
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
chflo
2ab9a8acdf OPM-252: Added VAPOIL, DISGAS to SimulationConfig 2015-12-15 13:50:54 +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