Commit Graph

600 Commits

Author SHA1 Message Date
Andreas Lauser
0ed659de10 add a wrapper for records of the WELSPECS keyword 2014-01-15 12:52:12 +01:00
Andreas Lauser
6bf3e3ef8d add unit test for SGOF 2014-01-15 12:52:12 +01:00
Andreas Lauser
024774b605 add wrapper class for the START keyword 2014-01-15 12:52:12 +01:00
Andreas Lauser
34e39d2f31 add utility class for the 'TSTEP' keyword 2014-01-15 12:52:12 +01:00
Andreas Lauser
7a3755926b Units: add 'Timestep' dimension
the motivation for this is the 'TSTEP' eclipse keyword.

the reason why this dimension is not simply called 'Time' is that in
eclipse, different keywords might use different units, e.g. one
keyword could use seconds, another could use years while a third uses
days. As an added bonus, the used time units may be different for
different scales but identical in others (e.g., for one keyword times
might be specified in 'days' for the metric as well as for the
labscale, but in 'days' and 'hours' for another second keyword.)
2014-01-15 12:52:12 +01:00
Andreas Lauser
d261fcfe98 also constify the getSIDoubleData() method in DeckKeyword
in the item and in the record it already was marked as const, the
DeckKeyword class was forgotten during that excercise.
2014-01-15 12:52:12 +01:00
Andreas Lauser
079aa1417b move the SimpleMultiRecordTable class into its own files. 2014-01-15 12:52:12 +01:00
Andreas Lauser
8c83f0d8c1 remove the emacs and vim modelines
as it was decided that having editor-specific stuff in files is not
wanted in OPM. for emacs, a .dir-locals.el file is added to the
module's root directory which should have the same effect.
2014-01-15 12:52:12 +01:00
Andreas Lauser
6f721581bd add utility classes for some common keywords
the idea is to create a lightweight wrapper objects around
DeckKeywords which allow more convenient and more readable access to
the data. E.g. instead of

  std::vector outerColumnNames{"RV", "P", "BG", "MUG"};
  std::vector innerColumnNames{"P", "BG", "MUG"};
  Opm::FullTable pvtgTable(deck->getKeyword("PVTG"),
                           outerColumnNames, innerColumnNames);
  pvtgTable->getOuterTable()->getColumn(1);

one now better uses

  Opm::PvtgTable pvtgTable(deck->getKeyword("PVTG"));
  pvtgTable->getOuterTable()->getPressureColumn();

the idea for the other keywords is similar.
2014-01-15 12:52:12 +01:00
Andreas Lauser
d96b69c9ea add support for full-fledged tables 2014-01-15 12:52:12 +01:00
Andreas Lauser
3a3336028a add class for simple tables
This is intended for keywords like SWOF which currently is a big
vector of doubles but one needs to use the data in a column oriented
way.

This class is intended to be used like this:

Opm::DeckKeywordConstPtr swofKeyword = newParserDeck->getKeyword("SWOF");
Opm::SimpleTable swofTable(swofKeyword,
                           /*columns=*/std::vector<std::string>{"SW", "KRW", "KROW", "PCOW"},
                           /*recordIdx=*/table_num);
const std::vector<double>& sw = swofTable.getColumn(0);
// ...

what might be useful is to move the column names into the JSON
description of the keywords, but I could not find a way to go back to
the parser from the deck/keyword. maybe this is not even desireable as
decks might also be created by other means...

Also, a multi-record variant of the class is available. That one is
intended for keywords like PVTO where the first few items of each
record form a table (in the case of PVTO: Rs, pressure, Bo, and
viscosity for staturated oil) and the next entries constitute another
table (in the case of PVTO: pressure, Bo and viscosity for
undersaturated oil with the same RS factor as the first entry).

The second kind of tables can be constructed using the item-based
variant of SimpleTable.
2014-01-15 12:52:12 +01:00
Andreas Lauser
234625758c add dimensions to PVTG 2014-01-15 12:52:12 +01:00
Andreas Lauser
5fd51021d9 fix JSON of the PVTO keyword
the magic word is "num_tables" and not "size". with the latter it only
parses the first record of the keyword. Stupid me!
2014-01-15 12:52:12 +01:00
Andreas Lauser
9a09fa29af rename Parser::parse to Parser::parseFile and add Parser::parseData
Parser::parseData is quite useful for unit tests to prevent them
spilling files to everything. Also, what was formerly
Parser::parseFile has been renamed to Parser::parseStream and slightly
modified to not be specific for std::ifstream.
2014-01-10 14:51:56 +01:00
Joakim Hove
11f3ab1cb5 Merge pull request #85 from AtleH/KeywordDescriber
First attempt for the KeywordDescriber
2014-01-10 05:37:34 -08:00
Atle Haugan
53edd3bdc7 Renamed EclipseDataDoctor[.cpp] to opm-eclkwtest 2014-01-10 14:02:15 +01:00
Atle Haugan
5a34966a75 Renamed KeywordDescriber to opm-eclkw 2014-01-10 11:15:00 +01:00
Atle Haugan
ddd4563f97 Renamed from 'help' to 'description' for ParserKeyword and ParserItem 2014-01-10 10:57:35 +01:00
Atle Haugan
308cfda3c5 Improved some type usage based on code review feedback 2014-01-10 08:53:19 +01:00
Atle Haugan
3271156f9d First pull request candidate with help support 2014-01-09 13:33:32 +01:00
Atle Haugan
d3d6dc2c90 Added unit tests for ParserKeyword.help() 2014-01-09 08:42:27 +01:00
Atle Haugan
d837b688e6 Code cleanup in KeywordDescriber.cpp 2014-01-09 08:31:09 +01:00
Kristian Flikka
ab49cba392 Fixed erroneous include statement path 2014-01-08 16:03:19 +01:00
Kristian Flikka
fd99df1213 Added missing include statements 2014-01-08 15:59:38 +01:00
Atle Haugan
09135500d6 Improved output layout somewhat + refactored some code 2014-01-08 15:22:14 +01:00
Atle Haugan
c9cda9916f Code improvements based on code review feedback 2014-01-08 15:03:16 +01:00
Atle Haugan
6709523843 Removed even more green code 2014-01-08 11:20:31 +01:00
Atle Haugan
f9d06da6db Removed even more green code 2014-01-08 11:16:30 +01:00
Atle Haugan
e3f752f38b Removed some green code 2014-01-08 11:12:52 +01:00
Atle Haugan
64f7f31f46 Added output from hasDimensions() 2014-01-08 10:49:22 +01:00
Atle Haugan
0c5f7bf731 Added output for items 2014-01-08 10:49:22 +01:00
Atle Haugan
25eb08aa52 After code review with Kristian and Joakim 2014-01-08 10:49:21 +01:00
Atle Haugan
73dfc77aab Some more adjustments 2014-01-08 10:49:20 +01:00
Atle Haugan
a18cf41553 Some cleanup and refactoring 2014-01-08 10:49:20 +01:00
Atle Haugan
67ab48eee0 First running version of the KeyWordDescriber class. Some cleanup and refactoring required. 2014-01-08 10:49:20 +01:00
Atle Haugan
72545992e1 First running version of the KeyWordDescriber class. Some cleanup and refactoring required. 2014-01-08 10:49:20 +01:00
Atle Haugan (ITV DIS RD)
8f94b29547 Added KeywordDescriber.cpp 2014-01-08 10:49:19 +01:00
Joakim Hove
09f70a2205 Added std::set<enum PhaseEnum> to keep track of phases present to the EclipseState. 2014-01-07 17:52:20 +01:00
Joakim Hove
b90830ea79 Added class EclipseState which currently holds a Schedule instance. 2014-01-07 17:39:07 +01:00
Andreas Lauser
a88b47750e fix more (hopefully all) conversion factors
also, correct the dimension of the Rv item of the PVDG keyword which
is 1/Rs. Finally, the conversion factor for stock tank barrels to m^3
was off by a factor of 1000. (I suppose that liters instead of m^3
were assumed to be the SI unit in this case.)
2013-12-22 11:03:26 +01:00
Andreas Lauser
d1f224fd79 Units: fix thinko
milli means division by 1000 not multiplication...

this makes SPE1 converge nicely with opm-parser in autodiff!
2013-12-21 16:56:04 +01:00
Andreas Lauser
472b16b42a units: fix typo
Raito -> Ratio
2013-12-21 16:53:28 +01:00
Kristian Flikka
9f4d5c11ab Merge pull request #80 from joakim-hove/tablecollection-with-items
Tablecollection with items
2013-12-20 04:31:48 -08:00
Andreas Lauser
a1ae9ff6b5 add a few 'explicit' statements
this allows to constructs like

ParserIntItem("NRPVT");

which IMHO is more readable than the previous way, i.e.,

ParserIntItem(std::string("NRPVT"));
2013-12-19 15:39:47 +01:00
Andreas Lauser
e5066ae495 make the getSIDouble*() methods const
the fact that data is lazily converted to SI units should not be
relevant for the caller. This requires to decorate the array for SI
units in the DoubleItem as mutable, though...
2013-12-19 15:39:28 +01:00
Joakim Hove
c78c6d3e96 Merge remote-tracking branch 'upstream/master' into tablecollection-with-items 2013-12-19 13:56:54 +01:00
Joakim Hove
ae2260aa43 Table collection keywords PVTO and PVTG now have individual items: settings. 2013-12-19 13:54:51 +01:00
Andreas Lauser
3ae1890276 add dimensions to the PVTO keyword 2013-12-18 18:23:50 +01:00
Andreas Lauser
02afdf89da add dimensions to the SGOF keyword 2013-12-18 16:51:46 +01:00
Andreas Lauser
b7a67685c9 add dimensions for the PVDG table 2013-12-18 16:37:30 +01:00