Commit Graph

5792 Commits

Author SHA1 Message Date
Bård Skaflestad
cb106240bf
Merge pull request #794 from joakim-hove/summary-state-totals
Correctly detect totals in SummaryState
2019-06-03 14:17:34 +02:00
Joakim Hove
89c8cb886b Correctly detect totals in SummaryState 2019-06-03 12:42:51 +02:00
Bård Skaflestad
9aee2bee71
Merge pull request #668 from joakim-hove/udq-fieldset
UDQ field and group variables
2019-06-03 12:01:37 +02:00
Bård Skaflestad
0757bd97cf
Merge pull request #791 from bska/restart-output-code-reformat
Restart Output Code Reformatting
2019-05-29 11:07:17 +02:00
Bård Skaflestad
add1a96d99 Restart Well Data: Restore Indentation
Whitespace only.
2019-05-29 09:28:40 +02:00
Bård Skaflestad
8eda3aaa15 Restart::save(): Prune 'sim_step' Where Possible
Enabled by commit 94b16025.
2019-05-29 09:12:58 +02:00
Joakim Hove
32a1c3b5da
Merge pull request #762 from joakim-hove/well-controls
Well controls
2019-05-29 06:46:47 +02:00
Arne Morten Kvarving
7ec2ee9bff
Merge pull request #789 from akva2/fix_filesystem_generic
fixed: avoid usage of boost::filesystem::path::generic()
2019-05-28 09:11:37 +02:00
Arne Morten Kvarving
c9d1c50986 fixed: avoid usage of boost::filesystem::path::generic()
this is not supported in older version of boost::filesystem.
furthermore, it was always an experimental feature and
and has been deprecated in newer versions.

generic_string is available in all versions, so use that.
2019-05-28 06:28:57 +02:00
Joakim Hove
48c363dafa
Merge pull request #783 from bska/add-restart-io-operations
Add Restart I/O Operations to New ECLIPSE I/O Classes
2019-05-27 23:06:54 +02:00
Bård Skaflestad
a2ec7d7f6d OutputStream::Restart: Pull File Creation Into Constructor
Then we don't have to store copies of the 'formatted' and 'unified'
flags, and are also able to remove the 'prepareStep()' function.  We
will reintroduce these features if we decide to add support for
keeping the output stream open between separate restart output
requests (i.e., between calls to EclipseIO::writeTimeStep()).
2019-05-27 21:00:52 +02:00
Bård Skaflestad
df1a011b78 Redo Public Interface of OutputStream::Restart
In particular, make the stream() function into a private detail of
the implementation and add an overload set for outputting keyword
data and messages to the underlying output stream.  Update unit test
accordingly.

Suggested by: Atgeirr F. Rasmussen
2019-05-27 21:00:52 +02:00
Bård Skaflestad
992d3b0ce5 Restart Output: Add File Management Facility
This commit introduces a new class,

    Opm::ecl::OutputStream::Restart

that handles the details of opening restart output streams (all
combinations of formatted/unformatted and unified/separate), as well
as correctly positioning the stream 'put' indicator if we're opening
an existing unified restart file.  In most cases, this will be a
simple append operation (std::ios_base::app), but there are some
subtleties that require more precise control.  The new class is
befriended by EclOutput and ERst in order to access private member
functions and data members of these classes.  That is needed in
order to handle file resize operations since some of the requisite
information is only available in those two classes.

We use Boost.Filesystem to implement file resize, as if by POSIX
function ::truncate(), and also to simplify filename generation.
These calls can be switched to std::filesystem once the project
requires C++17.

Intended use of the Restart class is

    Restart rst(resultSet, formatted, unified);
    rst.prepareStep(17);  // Report step/SEQNUM 17.

    rst.write("INTEHEAD", ihead);
    // ...

The 'prepareStep' operation opens the file stream (if needed) and
also outputs a SEQNUM record in the case of a unified output stream.
Moreover, the 'resultSet' is a pair of output directory and case's
base name (e.g., "./mpi.np4/2019.05.14.01" and "NORNE_ATW2013") and
the formatted/unified flags are bools wrapped in structures.

The Restart class is intended to take over the role of the
'filename' string parameter of RestartIO::save().

Add a set of unit tests to demontrate usage and abilities of class
Restart.
2019-05-27 21:00:52 +02:00
Bård Skaflestad
c71f57f635 Ecl Output: Add Support for Opening File in Specific Mode
This commit extends the EclOutput constructor to support letting the
client specify a particular open mode.  This in turn prepares using
EclOutput as the basis for a restart file writer.  Passing
mode=openmode::out is the common case for a new restart file, while
mode=openmode::app is the common case for an existing restart file.
2019-05-27 21:00:52 +02:00
Bård Skaflestad
2580a273f4 Ecl Output: Add Support for Generating Messages
Specifically, add a member function

    EclOutput::message(const std::string&)

that outputs the string as an 'eclArrType::MESS'.  This is in order
to support outputting 'STARTSOL' and 'ENDSOL' demarcations in a
restart file.
2019-05-27 21:00:52 +02:00
Bård Skaflestad
b9aeeab005 ERst: Support Retrieving File Position of Particular SEQNUM
This commit introduces a new member function,

    ERst::restartStepWritePosition(seqnum)

that translates a SEQNUM ID into a std::streampos object pointing to
the start of the data for that SEQNUM ID.  Return std::streampos(-1)
if the sequence number exceeds all known sequence numbers in this
restart set.

The member function is private because it is supposed to be called
only by the class itself and a select set of class friends.
2019-05-27 21:00:52 +02:00
Bård Skaflestad
0dfe6ce7da Ecl File: Add Method to Convert Linear Array Index to File Position
This commit introduces a new member function

    EclFile::seekPosition(arrayIndex)

that retrieves the file (seek) position of the start of the header
of the arrayIndex-th keyword.  The expected use case for this is
seeking to the start of a particular SEQNUM value in a unified
restart file.  If the array index exceeds all supported index
values, then we return the position of the file's EOF mark (captured
as the last item in the EclFile constructor).

The member function is protected to be accessible in derived classes
and by friends of derived classes.
2019-05-27 21:00:52 +02:00
Joakim Hove
2682eef9b3
Merge pull request #788 from joakim-hove/remove-welltest
Removed well testing from Schedule constructor
2019-05-27 20:13:45 +02:00
Joakim Hove
8189dd8c9f
Merge pull request #785 from joakim-hove/summary-state-num
Add size() and num_wells() methods to SummaryState
2019-05-27 20:13:35 +02:00
Joakim Hove
5c65299c0a Add size() and num_wells() methods to SummaryState 2019-05-27 17:56:27 +02:00
Joakim Hove
35a70310c6 Removed well testing from Schedule constructor 2019-05-27 17:47:55 +02:00
Joakim Hove
54af290cc0 Extend UDQ eval code
With this commit the code to evaluate UDQ values has been extended/refactored in
many ways:

 - There is an increased awarenwss of variable type, i.e. a well related UDQ
   versus a field related UDQ. The variable type flows through the AST, and it
   is verified that the expression to evaluate and the target variable are of
   compatible types.

 - Have added support for UDQ field variables and UDQ group variables.

 - The UDQSet type and the UDQDefine::eval() have been refactored to multiplex
   on all the UDQ types, and the specialized UDQWellSet has been removed.
2019-05-27 16:43:22 +02:00
Joakim Hove
c8b0988191 Add size() and num_wells() methods to SummaryState 2019-05-27 16:43:22 +02:00
Joakim Hove
e6b8e53d0a
Merge pull request #786 from joakim-hove/summarystate-group-var
Add group awareness to SummaryState
2019-05-27 16:43:00 +02:00
Joakim Hove
779a2b8d89 Add group awareness to SummaryState 2019-05-27 14:38:13 +02:00
Joakim Hove
0c23aafc34
Merge pull request #784 from joakim-hove/UDQ-test-only-one
UDQ error test - use correct well variablec
2019-05-27 12:32:01 +02:00
Joakim Hove
4439882402 UDQ error test - use correct well variablec 2019-05-27 09:44:14 +02:00
Joakim Hove
8e87ffc7da
Merge pull request #781 from akva2/janitoring
Remove unused variables and reduce scope
2019-05-24 15:44:48 +02:00
Joakim Hove
418241137c Rebase fixup 2019-05-24 15:31:27 +02:00
Joakim Hove
01db100439 WellProductionProperties and WellInjectionProperties are private 2019-05-24 15:31:27 +02:00
Joakim Hove
e3d9ef07eb Temporarily reverted UDA -> double in keyword def. 2019-05-24 15:31:27 +02:00
Joakim Hove
51aee6e8cb Add structs InjectionControls and ProductionControls 2019-05-24 15:31:27 +02:00
Joakim Hove
73667596fc Add some testing 2019-05-24 15:31:27 +02:00
Arne Morten Kvarving
9dacc42c8a reduce scope of variables 2019-05-24 14:31:26 +02:00
Arne Morten Kvarving
8fdb08b0ad remove unused variables 2019-05-24 14:31:21 +02:00
Joakim Hove
0942e2dce1
Merge pull request #720 from GitPaean/throw_for_problem_in_compsegs
throw when end distance not bigger than start distance in COMPSEGS
2019-05-24 13:34:45 +02:00
Kai Bao
01c0820d4c addressing reviewing comments from PR#720
and adding more tests
2019-05-24 10:19:50 +02:00
Kai Bao
d11d26a2f1 adding test WrongDistanceCOMPSEGS 2019-05-24 10:19:50 +02:00
Kai Bao
584defebe0 ParseContext is used to handle the exceptions when parsing COMPSEGS 2019-05-24 10:19:50 +02:00
Kai Bao
43c5d3509a throw when end distance not bigger than start distance in COMPSEGS 2019-05-24 10:19:50 +02:00
Joakim Hove
1caf9ecff0
Merge pull request #761 from joakim-hove/sunbeam
Sunbeam import
2019-05-24 09:44:12 +02:00
Bård Skaflestad
51c805d280
Merge pull request #763 from bska/import-eclio-into-common
Import New ECLIPSE I/O Classes Into Main OPM Common Library
2019-05-23 15:07:30 +02:00
Bård Skaflestad
eb24f72e5e Ecl Output: Consume Facilities from 'std' Namespace
No functional changes.
2019-05-23 10:23:02 +02:00
Bård Skaflestad
e654915069 Move ECLIPSE I/O Into Main OPM Common Library
This makes the facility usable for the restart read/write code.

Specifically, import the I/O classes into namespace Opm::ecl, and
place the files in physical location opm/io/eclipse, and move the
test utilities to new top-level directory 'test_util/'.  While here,
discontinue the 'testutil' static library since most of its features
are now available in the main 'opmcommon' library.  This does entail
compiling a few of the test_util/ CPP files multiple times, and
adding the objects to each executable independently.
2019-05-23 10:23:01 +02:00
Joakim Hove
464bc4b795
Merge pull request #731 from joakim-hove/remove-old-well
Remove old well
2019-05-22 23:15:58 +02:00
Joakim Hove
94b160258e Remove old well implementation 2019-05-22 21:44:50 +02:00
Bård Skaflestad
1d31de03c7
Merge pull request #765 from tskille/compareECL
update of compareECL, failes test if output file present for reference
2019-05-22 13:32:10 +02:00
Joakim Hove
ad9cc20258
Merge pull request #779 from joakim-hove/new-keywords
New keywords
2019-05-22 11:52:47 +02:00
Joakim Hove
c0ccd06250 Add keyword GCONSALE 2019-05-22 07:13:57 +02:00
Joakim Hove
eb2c0b7441 Add keyword BRANPROP 2019-05-22 07:13:57 +02:00