Commit Graph

1707 Commits

Author SHA1 Message Date
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
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
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
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
8b12fda9c3 Remove unused FloatItem classes
ParserItemFloat and DeckItemFloat is never used within the project.
2016-02-03 12:22:41 +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
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
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