Commit Graph

2245 Commits

Author SHA1 Message Date
Jørgen Kvalsvik
bdce26480a createRawKeyword return on unmet preconditions
Changes the control flow of Parser::createRawKeyword to return on
failing to meet preconditions, rather than if-else block. Reduces
indentation and concurrent code paths.
2016-05-03 09:15:23 +02:00
Jørgen Kvalsvik
1330bfc681 parseState use return over break for control flow
Makes the actual effects of the various condtions more clear by
emphasising the return of the function rather than some possible action
after the loop.
2016-05-03 09:15:23 +02:00
Jørgen Kvalsvik
28f297f854 Reduce indentation in parseState
Restructures the per-iteration check of whether or not to continue
parsing to happen first and be an early-break, instead of this flow
being handled by if-else.
2016-05-03 09:15:23 +02:00
Jørgen Kvalsvik
86a5a89429 ParseState early abort over if-else
A small syntactic change that reduces indentation by a level. Checks the
preconditions first and throws if they aren't met (i.e. stream is
broken).
2016-05-03 09:15:23 +02:00
Jørgen Kvalsvik
033223720a trim_right replaced by trim
Augment trim_right with the dual trim_left and their composition trim
which strips all spaces from either side before the RawKeyword stage
starts.
2016-05-03 09:15:23 +02:00
Jørgen Kvalsvik
4b4d2c02c0 Reimplementation of stripComments
The implementation has been rewritten to use iterators and renamed for
internal use. The public static function still exists for testability
and easy verification, but should be considered an internal part of the
parser.
2016-05-03 09:15:22 +02:00
Jørgen Kvalsvik
bfb7f6ec0c RawRecord internals use ranges over string methods
Rewrites the internal string mainpulation functions of RawRecord to use
std::algorithm and ranges over string methods.
2016-05-03 09:15:22 +02:00
Kjell W. Kongsvik
db7958d439 Return type -> const & 2016-05-02 10:13:28 +02:00
Kjell W. Kongsvik
34dbf826de Support explicit setting of BaseName
Needed when reading deck from string and trying to write to disk.
If this is not set there is no baseName to base the file name on.
2016-04-29 16:04:16 +02:00
Atgeirr Flø Rasmussen
28d6237749 Silence warning in brace-init of std::array. 2016-04-29 13:45:26 +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
bedd431b10 Use path of input as default output path
Custom output path can be set explicitly using IOConfig::setOutputDir(path)
2016-04-29 11:24:48 +02:00
Joakim Hove
bc000899c8 Merge pull request #777 from joakim-hove/ignore-skiprest
Ignore skiprest
2016-04-28 22:20:44 +02:00
Kjell W. Kongsvik
65277fcc9f Removed getDeckFileName as the usage of it in EclipseWriter is not needed
Remove in opm-output
2016-04-28 16:19:56 +02:00
Joakim Hove
c8a059db67 Added NUMRES keyword. 2016-04-28 16:04:23 +02:00
Joakim Hove
d32b409c27 Added Eclipse3DProperties PRESSURE, SGAS & SWAT. 2016-04-28 16:03:29 +02:00
Joakim Hove
25ef8781c9 Added ability to set restart parameters. 2016-04-28 16:03:29 +02:00
Joakim Hove
6d0d0280bc Merge pull request #781 from joakim-hove/deck-use-warning
Emit compiler warning when including Deck.hpp
2016-04-28 15:42:09 +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
79ab818c3a Default output dir is current active directory
Optionally specify using IOCondig::setOutputDir()
2016-04-28 13:45:09 +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
Kjell W. Kongsvik
1640ad0826 Removed meaningless "path" paramater in tests
This parameter will be used in a more meaningful way
2016-04-28 13:45:08 +02:00
Kjell W. Kongsvik
206e16fba5 Added fields to IOConfig so parameters can be removed from EclipseWriter
std::string     m_deck_filename;
bool            m_output_enabled;
std::string     m_output_dir;
2016-04-28 13:45:08 +02:00
Joakim Hove
54579155a1 Merge pull request #782 from jokva/grid-properties-std-function
Refactor GridPropertyInitializers to use std::function
2016-04-28 09:02:25 +02:00
Pål Grønås Drange
e1ab313cb7 Added method getIJK in EclipseGrid 2016-04-27 12:55:14 +02:00
Jørgen Kvalsvik
e7bdb796da Replace boost::lexical_cast with std::to_string 2016-04-27 11:51:45 +02:00
Jørgen Kvalsvik
eb1182da27 Moved temp init into GridProperty
The GridPropertyInitializers files now really only held the temperature
initialisation function, and has been merged into GridProperty.
2016-04-27 11:51:45 +02:00
Jørgen Kvalsvik
0889c8c286 Bind parameters individually to init/post hooks
With the inflexible GridProperty*Function replaced with std::function,
bind parameters individually to each property, indicating exactly what
dependencies any function has.
2016-04-27 11:51:45 +02:00
Jørgen Kvalsvik
5f22a99a96 Replace Grid*Function with std::function
Replaces the home-grown capturing function object with std::function.
Using the library provided std::function enables creating the objects
via std::bind, enabling non-uniform signatures and relieves us of a
maintenance burden.
2016-04-27 11:51:45 +02:00
Joakim Hove
22c766acf8 Merge pull request #779 from jokva/group-get-wells-method
Adds Group::getWells method
2016-04-27 11:30:29 +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
Jørgen Kvalsvik
20b5b63f72 Adds Group::getWells method
Add support for querying what wells are in a given group at a certain
time step.
2016-04-26 10:40:42 +02:00
Joakim Hove
37381af2d6 Merge pull request #772 from qilicun/remove-OpmLog
Remove OpmLog usages in Parser folder.
2016-04-26 07:51:30 +02:00
Joakim Hove
fb8c39a8c4 Using compile time constants. 2016-04-25 15:37:46 +02:00
Joakim Hove
d097f95601 Will ignore SKIPREST keyword. 2016-04-25 15:37:46 +02:00
Jørgen Kvalsvik
2d1075efcb Check argument length in string_view == char*
Not doing this opens up for undefined behaviour when char* is shorter
than view.
2016-04-25 15:20:27 +02:00
Jørgen Kvalsvik
92f7ed163c Use swap for addParserKeyword over move-assign
Using move assign triggered some invalid read/write during
construction/destruction.
2016-04-25 14:51:02 +02:00
Jørgen Kvalsvik
ee4e447e92 Rename Summary to SummaryConfig
This object turns out to be the actual configuration object, not a
mediator state to obtain a configuration. It is therefore renamed to
reflect intent and behaviour.
2016-04-25 11:45:39 +02:00
Liu Ming
59c6569a78 Make mutable MessageContainer member, recover the const qualifier for deck. 2016-04-25 16:25:15 +08:00
Jørgen Kvalsvik
0a5c7c85f8 Fix off-by-one error in satfuncinit.
Reported by Bård Skaflestad in
https://github.com/OPM/opm-parser/issues/774.
2016-04-25 08:37:48 +02:00
Liu Ming
5720192314 remove log from cmake files. 2016-04-25 10:04:40 +08:00
Liu Ming
960e362c66 delete opmlog fro python directory. 2016-04-25 09:48:22 +08:00
Liu Ming
9ad0219603 use MessageContainer to logging. 2016-04-22 18:41:34 +08:00
Liu Ming
a4640b55bc use MessageContainer instead of OpmLog. 2016-04-22 16:51:35 +08:00
Liu Ming
52af33c7e0 remove const constrain for Deck. 2016-04-22 16:51:04 +08:00
Liu Ming
180ff7336a remove unused OpmLog headers. 2016-04-22 16:30:07 +08:00
Liu Ming
c42cfafc90 Merge remote-tracking branch 'remotes/opm/master' into MessageContainer-sub-class
Conflicts:
	opm/parser/eclipse/EclipseState/EclipseState.cpp
	opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp
2016-04-22 14:53:16 +08:00
Liu Ming
b17e11a9ad collect all the messages in intGridProperties and doubleGridProperties. 2016-04-22 14:42:24 +08:00
Atgeirr Flø Rasmussen
1c4e4bd3da Silence some shadowing warnings. 2016-04-21 09:32:25 +02:00
Atgeirr Flø Rasmussen
9e0635d62a Bugfix: actually check the passed-in properties. 2016-04-21 09:30:00 +02:00