Commit Graph

64 Commits

Author SHA1 Message Date
Atgeirr Flø Rasmussen
395bb1ca90 Add move constructor for Deck. 2021-05-11 08:10:18 +02:00
Arne Morten Kvarving
78a6854214 fixed: initialize iterators after deserialization 2020-04-20 13:19:55 +02:00
Arne Morten Kvarving
e3bd1e6723 add static method to return a test object for serialization
this allows killing the constructors taking member values
2020-03-23 10:58:15 +01:00
Joakim Hove
6e5cd6c371 Add templated method Deck::count() 2020-03-20 16:59:50 +01:00
Arne Morten Kvarving
ea45dcb01a remove accessors in Deck added for external serialization 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
461e24209d add serialization template to Deck 2020-03-19 09:34:12 +01:00
Arne Morten Kvarving
fb75bcd4e2 changed: use std::filesystem instead of boost::filesystem
since we still support g++-7, where filesystem is marked experimental,
we introduce a wrapper header and expose the namespace to use
as Opm::filesystem.

for gcc we unconditionally link with libstdc++fs in the python bindings.
the setup.py stuff links as c code, not c++ code, so it is not
automatically added on any gcc version. this might prove unportable
later.
2020-02-13 12:34:19 +01:00
Arne Morten Kvarving
b0f262374e make Deck constructible from variables
also make it default constructible, add accessors
assignment operator and equality operator
2020-01-03 08:30:42 +01:00
Joakim Hove
697545cf54 Use dimensions from ParserKeyword 2019-10-16 21:03:02 +02:00
Joakim Hove
233f55c4e2 Update the Deck unitsystem using select method instead of mutable ref. 2019-10-16 21:03:02 +02:00
Joakim Hove
3d94bc6baf Simplify Deck constructors 2019-10-16 21:03:02 +02:00
Joakim Hove
3070bf4a31 Change DeckKeyword constructor
The DeckKeyword::DeckKeyword(const std::string&) constructor has been removed
and the DeckKeyword now requires a ParserKeyword pointer in the constructor.
2019-09-16 00:47:34 +02:00
Joakim Hove
fd36bf88fb Add function Deck::makeDeckPath() 2018-10-18 10:47:37 +02:00
Joakim Hove
18a22d8f68 Merge pull request #463 from joakim-hove/restart-cwd
Restart cwd
2018-08-10 11:26:33 +02:00
Arne Morten Kvarving
3c88335852 changed: delete assignment operator in Deck class 2018-08-01 13:37:21 +02:00
Joakim Hove
64e5d123a2 Deck will internalize path to datafile 2018-07-19 08:20:04 +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
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
Joakim Hove
1050b8cba9 Added operator<< suppport for Deckxxx 2017-08-30 16:57:23 +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
18f15e7432 mark constructors as explicit 2017-06-09 17:38:42 +02:00
Jørgen Kvalsvik
bf057f157c Deck units no longer unique 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
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
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
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
b3b8cebeff Simplified deck filename handling. Only set filename if successfully opened 2016-04-28 15:42:07 +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
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
Liu Ming
59c6569a78 Make mutable MessageContainer member, recover the const qualifier for deck. 2016-04-25 16:25:15 +08:00
Liu Ming
4eb2208e63 remove shared_ptr 2016-04-12 09:01:33 +08:00
Liu Ming
0dcb776940 Add MessageContainer to Deck. 2016-04-11 11:15: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
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
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
Atgeirr Flø Rasmussen
e1301fa32e Add missing #include directives. 2016-02-14 23:38:24 +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
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
ab40d500c6 Initialize unit system for Section objects. 2015-08-05 22:02:11 +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
Joakim Hove
fd87b22f7d Added methods to Deck::getKeyword<T>() 2015-06-08 11:29:19 +02:00
Joakim Hove
725fb4fba5 Removed commented out code 2015-05-05 19:22:10 +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
b924f6cd02 DeckKeyword is immutable. 2014-12-09 11:56:05 +01:00
Andreas Lauser
ff90fe71c0 replace the deck-internal logging system by ParserLog 2014-10-07 15:39:14 +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
Joakim Hove
d0bfaaece1 Added unitSystems to Deck. 2013-12-14 10:23:56 +01:00