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.
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.
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.)
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.
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.
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.
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.
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.
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.
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).
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.
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.
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).
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.
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
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.
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.
- 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.