Commit Graph

2311 Commits

Author SHA1 Message Date
jokva
c6bd9e70fd Merge pull request #751 from pgdr/kill-es-gridprop
Introduce Eclipse3DProperties
2016-04-13 10:59:45 +02:00
Joakim Hove
9c6a120414 Merge pull request #757 from qilicun/append-messagecontainer
Add appendMessages() function.
2016-04-13 09:57:27 +02:00
Liu Ming
c782068baf add size() function. 2016-04-13 15:07:12 +08:00
Liu Ming
0954e5349c delete blank line. 2016-04-13 14:15:28 +08:00
Liu Ming
920c2cb87f some improvements. 2016-04-13 14:04:41 +08:00
Liu Ming
72dd934c71 add test for appendMessages function. 2016-04-13 14:04:21 +08:00
Joakim Hove
63be9532aa Merge pull request #756 from qilicun/cleanup-header
remove unused OpmLog headers.
2016-04-13 07:38:06 +02:00
Liu Ming
9ca9c8ce1d Add appendMessages() function. 2016-04-13 12:06:37 +08:00
Liu Ming
7946d0175f remove unused OpmLog headers. 2016-04-13 11:59:29 +08:00
Pål Grønås Drange
7cffdb0ecf Renamed to get3DProperties() 2016-04-12 14:42:35 +02:00
Pål Grønås Drange
21f94c0606 TableManager and Deck are now used as references, hid GridProperties
* Added keyword "OPERNUM" to supported keywords in Eclipse3DProperties
* Updated tests to use Eclipse3DProperties API instead of GridProperties
* Moved init sequence of title into constructor
* ThresholdPressure and SimulationConfig now tasks Deck ref instead of shared_ptr
* Removed obsolete test and unused tests that tested gridProperties
* Refactor use of TableManager.  Is now a reference.
* Added non-const GridProperties.getKeyword(size_t i)
2016-04-12 14:42:34 +02:00
Pål Grønås Drange
3680dfcb97 Substantial edits to Eclipse3DProperties and ptr's
* moved region-property from EclipseState to Eclipse3DProperties
* moved initGridopts from EclipseState to Eclipse3DProperties
* made several Eclipse3DProperties methods private
* removed obsolete tests
* replaced log with throw internally in private method---is domain_error
* removed typedef in SatFuncPropertyInitializers
* postprocessors take raw pointers, not shared_ptr---these will be phased out
* fixed return reference instead of copy several places
** gridProperties<T> in Eclipse3DProperties are now references, not shared_ptr
** Eclipse3DProperties takes const Deck&, not shared_ptr
** EclipseGrid and Section are references
2016-04-12 14:42:34 +02:00
Pål Grønås Drange
e48b64c41d Substantial edits to Eclipse3DProperties
* Removed all references to state, need to fix initPORV
* Made TransMult return raw pointer const GridProperty over shared pointer.
* Moved getDirectionProperty and hasDirectionProperty out of API
** Removed tests as these methods are no longer public
* Moved grid properties stuff to new class
* Removed use of deck in SatfuncInitializers, moved to TableManager
* Removed shared_ptr for several members of EclipseState and 3DProperties
* Moved region-property from EclipseState to Eclipse3DProperties
* Moved initGridopts from EclipseState to Eclipse3DProperties
* Made several Eclipse3DProperties methods private
* Postprocessors take raw pointers, not shared_ptr---these will be phased out
* Fixed return reference instead of copy several places
** GridProperties<T> in Eclipse3DProperties are now references, not shared_ptr
** Eclipse3DProperties takes const Deck&, not shared_ptr
* Removed obsolete tests
2016-04-12 14:42:18 +02:00
Joakim Hove
49a1c17eb8 Removed signed / unsigned comparison warning. 2016-04-12 13:59:02 +02:00
Joakim Hove
0b316092c8 Added missing include. 2016-04-12 13:56:31 +02:00
Joakim Hove
bf9cd5699c Merge pull request #752 from qilicun/use-message-container
Add MessageContainer to EclipseState and Deck.
2016-04-12 10:13:13 +02:00
Liu Ming
4eb2208e63 remove shared_ptr 2016-04-12 09:01:33 +08:00
jokva
30880b7757 Merge pull request #735 from jepebe/clang_support
Added clang support to Travis CI
2016-04-11 11:50:10 +02:00
Liu Ming
0dcb776940 Add MessageContainer to Deck. 2016-04-11 11:15:39 +08:00
Liu Ming
ed92c70efd Add MessageContainer to EclipseState. 2016-04-11 10:44:39 +08:00
Joakim Hove
0d0fc43e50 Merge pull request #750 from jokva/remove-possible-undefined-const-cast
Remove possible undefined const cast
2016-04-08 12:52:38 +02:00
Joakim Hove
4d84da2b9d Merge pull request #748 from jokva/message-container-internal-detail
Remove MessageContainer from ParseContext + storage type change
2016-04-06 17:15:06 +02: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
0d24ac2d4a Store Location::lineno as size_t
By storing it as size_t we explicitly disallow negative line numbers,
and keep 0 as an error/empty/undefined location.

A small problem with this is that MessageContainer.error and friends
still accept negative numbers (often without warning) via size_t
implicit conversion and wrap-around.
2016-04-06 11:41:22 +02:00
Jørgen Kvalsvik
3efa5fb90c ParseContext::handleError returns messagetypë́
For more transactional behaviour and to support MessageContainer in
favour of opm-log, this method now returns an enum describing how the
error should be handled, rather than throwing or no-oping. Throwing is
preserved if ParseContext is configured to do so.
2016-04-06 10:39:06 +02:00
Jørgen Kvalsvik
f3bef79562 MessageContainer::const_iterator bound
While the implementation is a simple alias to
std::vector<Message>::const_iterator, it enablese generic lookup of the
iterator type at compile time, and enables us to effortlessly change the
underlying implementation later.
2016-04-06 10:38:19 +02:00
Jørgen Kvalsvik
eb610453b4 MessageContainer::add support
Some phenomenons can be configured as error, warning or debug output,
and is not necessarily known in advanced by the entity adding a message.
To facilite adding a message with runtime-defined warning level, the add
method is supported.
2016-04-06 10:38:18 +02:00
Jørgen Kvalsvik
6c8487ea07 Message::location uses automatic members
By supporting operator bool() we get the same existence checking
capabilities as the unique_ptr implementations, without the hurdles of
non-copyability and manual heap allocation.
2016-04-06 10:38:13 +02:00
Joakim Hove
df751de42c Merge pull request #745 from joakim-hove/opmi
Opmi
2016-04-05 07:58:53 +02:00
Joakim Hove
e30054625a Merge pull request #746 from joakim-hove/keywords-polymer
Keywords: EDITNNC( new ) AQUCON (fixed)
2016-04-04 20:12:11 +02:00
Joakim Hove
74828204c2 Merge pull request #744 from joakim-hove/update-python-bind
Using bound Python prototype.
2016-04-04 20:11:38 +02:00
Joakim Hove
bdb1313f41 RawKeyword getRecord( int ) -> getFirstRecord()
The general loop through all raw records should be based on the iterator
interface of the RawKeyword, but to resolve INCLUDE statements we have
implemented a special case method to get the first record.
2016-04-04 16:21:52 +02:00
Jean-Paul Balabanian
4c48c1eeb0 Added clang support to Travis CI 2016-04-04 12:42:42 +02:00
Jørgen Kvalsvik
427baebe58 MessageContainer include guard corrected 2016-04-04 11:52:20 +02:00
Joakim Hove
51ce94cd62 Use range based for when iterating over RawRecords 2016-04-03 22:01:13 +02:00
Joakim Hove
e57d61468d Added non const record iterators to RawKeyword. 2016-04-03 22:00:30 +02:00
Joakim Hove
3548150c62 Added keyword EDITNNC 2016-04-02 22:52:56 +02:00
Joakim Hove
934ae26799 Fixed keyword AQUCON. 2016-04-02 22:52:55 +02:00
Joakim Hove
328a0ab27d Renamed OpmLoadDeck -> opmi
Have renamed the OpmLoadDeck test program to the working name opmi - Opm
Inspector. Currently the opmi executable will only load a deck and
create a EclipseState instance, but the plan is to extend this
executable to be a general Eclipse deck inspector, e.g.

   opmi --wells CASE.DATA

Could the list the wells and so on.
2016-04-02 21:44:11 +02:00
Joakim Hove
c848b4a24e Removed unused/unmainted "applications". 2016-04-02 21:39:19 +02:00
Joakim Hove
85f6cd1781 Using bound Python prototype. 2016-04-02 21:35:54 +02:00
Joakim Hove
d604262355 Merge pull request #742 from chflo/parser_support_symlink
Parser support symlink
2016-04-01 19:14:55 +02:00
chflo
82bef27b8f Support symlink 2016-04-01 15:36:38 +02:00
chflo
8ee79e7be6 Support symlinks: Added test 2016-04-01 14:28:26 +02:00
chflo
b8e803162b Support symlinks: Added testdata 2016-04-01 14:28:26 +02:00
Jørgen Kvalsvik
8e4e9b15d8 ReadValueToken correctly parses numbers
Changes the implementation of numbers parsing from std::atoi/f to
std::strtod/l. These support setting the optional end-of-string pointer
which are used to determine if a parsing was successful or not. This has
the nice side effect of *greatly* simplifying the logic, at the expense
of some C-style details.

Tests added to verify that the different edge cases are handled
properly.
2016-04-01 10:13:37 +02:00
Joakim Hove
63bfb550ff Merge pull request #737 from jokva/raw-keyword-record-std-list
RawKeyword iterator support and correct RawRecord management
2016-03-30 13:27:53 +02:00
Jørgen Kvalsvik
046afdd3be RawKeyword iterator support
Since RawRecords now has automatic storage, managed by std::list,
offering iterators is feasible. The random access
RawKeyword::getRecord's real use was accessing the records in order,
which now is handled via iterators.
2016-03-30 12:47:33 +02:00
Jørgen Kvalsvik
83ae276d67 Fix string_view iterator invalidation bug
By changing the underlying storage of RawKeyword to std::list, we ensure
that the RawRecords aren't reallocated and moved, preserving the
validity of string_view's. This changes the access complexity of
RawRecord from O(1) to O(n).
2016-03-30 12:31:00 +02:00