Commit Graph

219 Commits

Author SHA1 Message Date
Joakim Hove
18a22d8f68 Merge pull request #463 from joakim-hove/restart-cwd
Restart cwd
2018-08-10 11:26:33 +02:00
Joakim Hove
bb2e5e0370 Add precision property to DeckOutput class - default = 10 2018-08-07 18:44:05 +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
Joakim Hove
1f646711d4 Added DeckXXX::equal( ) method. 2017-08-30 16:57:22 +02:00
Joakim Hove
da55685b62 Added simple DeckOutput class for output. 2017-08-30 16:57:21 +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
e884b0664c Redesign cmake
Tune the makefile according to new principles, which adds a few bells
and whistles and for clarity.

Synopsis:

* The dependency on opm-common is completely gone. This is reflected in
  travis and appveyor as well. No non-kitware cmake modules are used.
* Directories are flattened, quite a bit - source code is located in the
  lib/ directory if it belongs to opm-parser, and external/ if third
  party.
* The sibling build feature is implemented through cmake's
  export(PACKAGE) rather than implicitly looking through source files.
* Targets explicitly set required public and private include
  directories, compile options and definitions, which cmake will handle
  and propagate
* opm-parser-config.cmake for downstream users is now provided.
* Dependencies are set up using targets. In the future, when cmake 3.x+
  can be used, these should be either targets from newer Find modules,
  or interface libraries.
* Fewer system specific assumptions are coded in, instead we assume
  cmake or users set up system specific details.
* All module wide configuration and looking up libraries is handled in
  the root makefile - all sub directories only set up libraries and
  compile options for the module in question.
* Targets are defined and links handled transitively because cmake now
  is told about them. ${module_LIBRARIES} variables are gone.

This is largely guided by the principles outlined in
https://rix0r.nl/blog/2015/08/13/cmake-guide/

Most source files are just moved - if they have some content change then
it's nothing more than include fixes or similar in order to make them
compile.
2017-06-01 15:29:23 +02:00
Jørgen Kvalsvik
70e7b02043 DeckItem.push_back overload for size = 1
DeckItem.push_back using insert for 1 element turns out to be very
expensive and caused a performance degredation.
2016-11-15 15:33:27 +01:00
Jørgen Kvalsvik
a22196546a ParserItem no longer requires heap alloc
Redesign of ParserItem so that its sum type nature no longer mandates
indirection, but rather a tag check on all operations. Because of this,
ParserRecords can now store ParserItems directly, and iterators are no
longer iterators to pointers, but behave like normal vector iterators.
2016-11-07 12:24:38 +01:00
Jørgen Kvalsvik
fdb772e075 DeckItem without internal inheritance.
Replaces the internal inheritance + unique_ptr scheme to a flat sum type
similar scheme that uses a tag to determine which operations are legal,
rather than using the indirection itself as a tag.
2016-11-07 12:24:38 +01:00
Jørgen Kvalsvik
bf057f157c Deck units no longer unique 2016-10-19 20:38:28 +02:00
Jørgen Kvalsvik
37c04328ca Remove shared_ptr typedefs 2016-10-19 20:38:28 +02:00
Jørgen Kvalsvik
f2e509f59f UnitSystem named constructors with automatic storage 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
c893a92aa6 Make Dimension+UnitSystem no longer use shared_ptr 2016-10-19 20:38:27 +02:00
Arne Morten Kvarving
6433059067 changed: rename function getType
typeof is a semi-reserved symbol in gcc (gcc extension to get typeid)
2016-10-17 10:48:29 +02:00
Jørgen Kvalsvik
f413e5441f Hoist loop variable.
Profiling indicates the size-check isn't hoisted properly. In this case,
manually hoising the loop invariant doesn't negatively impact clarity
nor give any more noise, and slightly improves performance.
2016-08-08 09:40:20 +02:00
Jørgen Kvalsvik
d7ac7ee9b8 Remove SCHEDULE as a special section
SCHEDULESection with its special implementation is a remnant of older
design and largely unnecessary now. The implementation also relied on
shared_ptr for efficiency and was not really used at all.

SCHEDULESection now is no longer special, and uses the same
implementation as SUMMARY, RUNSPEC etc. The one thing that separated it,
looking up keywords within a timestep, was only used once and this
computation has been inlined in the function.
2016-08-05 15:28:29 +02:00
Jørgen Kvalsvik
99570ff72e Add all records to Deck at once
Rather than doing add-item-check-duplicates per DeckItem added to a
record, construct all the items at once, then pass them in full to the
DeckRecord object. The DeckRecord object still check for duplicate
names, but with lower complexity and cost.
2016-08-05 10:45:31 +02:00
Jørgen Kvalsvik
29604ac2af Fix warnings in DeckRecord 2016-07-13 23:39:29 +02:00
Jørgen Kvalsvik
aff1908529 Fix warnings in DeckItem 2016-07-13 23:39:29 +02:00
Jørgen Kvalsvik
2f0f7201eb Fix warnings in Deck 2016-07-13 23:39:29 +02:00
Jørgen Kvalsvik
3696b750cd Remove opm-common dependency
Severs the code dependency on opm-commmon. There was no actual
functional dependency here, with the exception of some enable/disable
warning headers. To properly make opm-parser a stand-alone module the
usage of these headers have been removed and the dependency on
opm-common is gone.
2016-07-08 15:53:40 +02:00
Jørgen Kvalsvik
44cd4868f8 Syntactic cleanup
Fixup of some messy constructors.
2016-07-05 08:22:13 +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
Liu Ming
cb74ccf589 adapt API changes in ParseContext. 2016-05-14 09:15:27 +02:00
Pål Grønås Drange
3124c9569c Throw now contains name() of deckKeyword 2016-05-10 14:45:35 +02:00
Jørgen Kvalsvik
63fd998e2a Allow Section objects to be empty
Preserves expect Deck-like behaviour by allowing empty sections.
2016-05-09 15:09:43 +02:00
Jørgen Kvalsvik
60c20f8057 Explicitly store loop invariants in assertSIData
Profiling shows that gcc isn't recognising these as loop invariants, so
we help it a little bit by explicitly storing them.
2016-05-03 09:16:28 +02:00
Jørgen Kvalsvik
8a4eb5279c Splitting records with string_view; test updates
The splitting of RawRecords into individual symbols uses string_view.
Also updates tests since RawRecord now assumes that the record string it
receives is complete and does *not* contain the terminating slash.
2016-05-03 09:16:28 +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
52af33c7e0 remove const constrain for Deck. 2016-04-22 16:51:04 +08:00
Liu Ming
7946d0175f remove unused OpmLog headers. 2016-04-13 11:59:29 +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
f8bab0e703 DeckItemT::SIdata mutable modifier
Replaces const_cast in favour of mutable keyword in order to avoid
undefined behaviour under some conditions.
2016-04-06 15:09:32 +02: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
0da5cadc75 RawRecords auto store, strings moved to RawRecord
The accumulated strings are moved into RawRecords, which reduces
execution time (rough measurements indicates 4-8%). To facilitate this,
RawRecords are stored directly in the vector in favour of via
shared_ptrs.
2016-03-22 08:58:48 +01:00
Jørgen Kvalsvik
e64d9f82a4 DeckItem tag explicit instead of vtable lookup
dynamic_cast turns out to be rather slow, and it is faster to look up an
explicit tag instead.
2016-03-22 08:58:48 +01:00
chflo
f2ed1ba7ea Moved OpmLog from opm-parser to opm-common 2016-03-21 22:07:49 +01:00