Opm::ECLRestartData Class Reference

#include <ECLResultData.hpp>

Public Member Functions

 ECLRestartData ()=delete
 Default constructor disabled. More...
 
 ECLRestartData (boost::filesystem::path rstrt)
 
 ECLRestartData (std::shared_ptr< ecl_file_type > rstrt)
 
 ECLRestartData (const ECLRestartData &rhs)
 
 ECLRestartData (ECLRestartData &&rhs)
 
ECLRestartDataoperator= (const ECLRestartData &rhs)
 
ECLRestartDataoperator= (ECLRestartData &&rhs)
 
 ~ECLRestartData ()
 Destructor. More...
 
bool selectReportStep (const int step) const
 
bool haveKeywordData (const std::string &vector, const std::string &gridID="") const
 
template<typename T >
std::vector< T > keywordData (const std::string &vector, const std::string &gridID="") const
 

Detailed Description

Representation of an ECLIPSE Restart result-set.

This class is aware of the internal structure of ECLIPSE restart files and may restrict its operation to a single report step. The class furthermore knows about sub-blocks corresponding to main or local grids within a report step and queries only those objects that pertain to a single grid at a time.

Note: The client must select a view of the result-set before accessing any vectors within the set.

Constructor & Destructor Documentation

◆ ECLRestartData() [1/5]

Opm::ECLRestartData::ECLRestartData ( )
delete

Default constructor disabled.

◆ ECLRestartData() [2/5]

Opm::ECLRestartData::ECLRestartData ( boost::filesystem::path  rstrt)
explicit

Constructor.

Owning semantics.

Parameters
[in]rstrtName or prefix of ECL result data.

◆ ECLRestartData() [3/5]

Opm::ECLRestartData::ECLRestartData ( std::shared_ptr< ecl_file_type rstrt)
explicit

Constructor

Shared ownership of result set.

Parameters
[in]rstrtECL restart result set.

◆ ECLRestartData() [4/5]

Opm::ECLRestartData::ECLRestartData ( const ECLRestartData rhs)

Copy constructor.

Parameters
[in]rhsObject from which to construct new instance.

◆ ECLRestartData() [5/5]

Opm::ECLRestartData::ECLRestartData ( ECLRestartData &&  rhs)

Move constructor.

Parameters
[in,out]rhsObject from which to construct new instance. Its internal implementation will be subsumed into the new object.

◆ ~ECLRestartData()

Opm::ECLRestartData::~ECLRestartData ( )

Destructor.

Member Function Documentation

◆ haveKeywordData()

bool Opm::ECLRestartData::haveKeywordData ( const std::string vector,
const std::string gridID = "" 
) const

Query current result-set view for availability of particular named result vector in particular enumerated grid.

Parameters
[in]vectorNamed result vector for which to query data availability.
[in]gridIDIdentity of specific grid for which to query data availability. Empty for the main grid.
Returns
Whether or not keyword data for the named result vector is available in the specific grid.

Referenced by example::simulationTime().

◆ keywordData()

template<typename T >
std::vector< T > Opm::ECLRestartData::keywordData ( const std::string vector,
const std::string gridID = "" 
) const

Retrieve current result-set view's data values for particular named result vector in particular enumerated grid.

Will fail (throw an exception of type std::invalid_argument) unless the requested keyword data is available in the specific grid in the current active view.

Template Parameters
TElement type of return value. The underlying keyword data will be converted to this type if needed and possible. Note that some type combinations do not make sense. It is, for instance, not possible to retrieve keyword values of an underlying arithmetic type in the form of a
std::vector<std::string>
. Similarly, we cannot access underlying character data through elements of an arithmetic type (e.g.,
std::vector<double>
.)
Parameters
[in]vectorNamed result vector for which to retrieve keyword data.
[in]gridIDIdentity of specific grid for which to retrieve keyword data. Empty for the main grid.
Returns
Keyword data values. Empty if type conversion fails.

Referenced by example::simulationTime().

◆ operator=() [1/2]

ECLRestartData & Opm::ECLRestartData::operator= ( const ECLRestartData rhs)

Assignment operator.

Parameters
[in]rhsObject from which to assign new values to current instance.
Returns
*this
.

◆ operator=() [2/2]

ECLRestartData & Opm::ECLRestartData::operator= ( ECLRestartData &&  rhs)

Move assignment operator.

Parameters
[in,out]Objectfrom which to assign new instance values. Its internal implementation will be subsumed into this instance.
Returns
*this
.

◆ selectReportStep()

bool Opm::ECLRestartData::selectReportStep ( const int  step) const

Select a result-set view that corresponds to a single report step.

This is needed when working with dynamic restart data. If constructed from a unified restart file, this function will check that the requested step is available in the file. If constructed from a non-unified restart file, no such check is performed.

Parameters
[in]stepReport step number.
Returns
Whether or not selecting the report step succeeded. The typical failure case is the report step not being available in the result-set.

The documentation for this class was generated from the following file: