opm-common
Loading...
Searching...
No Matches
Opm::FieldProps Class Reference

Classes

struct  MultregpRecord
struct  FieldDataManager
 Wrapper type for field properties. More...

Public Types

enum class  GetStatus { OK = 1 , INVALID_DATA = 2 , MISSING_KEYWORD = 3 , NOT_SUPPPORTED_KEYWORD = 4 }
 Property array existence status. More...
enum  TryGetFlags : unsigned int { AllowUnsupported = (1u << 0) , MustExist = (1u << 1) }
 Options to restrict or relax a try_get() request. More...
using ScalarOperation = Fieldprops::ScalarOperation

Public Member Functions

 FieldProps (const Deck &deck, const Phases &phases, EclipseGrid &grid, const TableManager &table_arg, const std::size_t ncomps)
 Normal constructor for FieldProps.
 FieldProps (const Deck &deck, const EclipseGrid &grid)
 Special case constructor used to process ACTNUM only.
void reset_actnum (const std::vector< int > &actnum)
void prune_global_for_schedule_run ()
void apply_numerical_aquifers (const NumericalAquifers &numerical_aquifers)
const std::string & default_region () const
std::vector< int > actnum ()
const std::vector< int > & actnumRaw () const
template<typename T>
bool has (const std::string &keyword) const
template<typename T>
std::vector< std::string > keys () const
template<typename T>
FieldDataManager< T > try_get (const std::string &keyword, const unsigned int flags=0u)
 Request read-only property array from internal cache.
template<typename T>
const std::vector< T > & get (const std::string &keyword)
template<typename T>
std::vector< T > get_global (const std::string &keyword)
template<typename T>
std::vector< T > get_copy (const std::string &keyword, bool global)
template<typename T>
std::vector< bool > defaulted (const std::string &keyword)
template<typename T>
std::vector< T > global_copy (const std::vector< T > &data, const std::optional< T > &default_value) const
void handle_schedule_keywords (const std::vector< DeckKeyword > &keywords)
bool tran_active (const std::string &keyword) const
void apply_tran (const std::string &keyword, std::vector< double > &data)
void apply_tranz_global (const std::vector< size_t > &indices, std::vector< double > &data) const
bool operator== (const FieldProps &other) const
const std::unordered_map< std::string, Fieldprops::TranCalculator > & getTran () const
std::vector< std::string > fip_regions () const
void deleteMINPVV ()
void set_active_indices (const std::vector< int > &indices)
template<>
Fieldprops::FieldData< double > & init_get (const std::string &keyword_name, const Fieldprops::keywords::keyword_info< double > &kw_info, const bool multiplier_in_edit)
template<>
Fieldprops::FieldData< double > & init_get (const std::string &keyword, const bool allow_unsupported)
template<>
Fieldprops::FieldData< int > & init_get (const std::string &keyword, const Fieldprops::keywords::keyword_info< int > &kw_info, const bool)
template<>
Fieldprops::FieldData< int > & init_get (const std::string &keyword, bool)
template<>
bool has (const std::string &keyword_name) const
template<>
bool has (const std::string &keyword) const
template<>
std::vector< std::string > keys () const
template<>
std::vector< std::string > keys () const

Static Public Member Functions

template<typename T>
static bool supported (const std::string &keyword)
static bool rst_cmp (const FieldProps &full_arg, const FieldProps &rst_arg)
template<>
bool supported (const std::string &keyword)
template<>
bool supported (const std::string &keyword)

Public Attributes

std::size_t active_size
std::size_t global_size

Member Enumeration Documentation

◆ GetStatus

enum class Opm::FieldProps::GetStatus
strong

Property array existence status.

Enumerator
OK 

Property exists and its property data is fully defined.

INVALID_DATA 

Property array has not been fully initialised.

At least one data element is uninitialised or has an empty default.

Will throw an exception of type

std::runtime_error

in FieldDataManager::verify_status().

MISSING_KEYWORD 

Property has not yet been defined in the input file.

Will throw an exception of type

std::out_of_range

in FieldDataManager::verify_status().

NOT_SUPPPORTED_KEYWORD 

Named property is not known to the internal handling mechanism.

Might for instance be because the client code requested a property of type int, but the name is only known as property of type double, or because there was a misprint in the property name.

Will throw an exception of type

std::logic_error

in FieldDataManager::verify_status().

◆ TryGetFlags

enum Opm::FieldProps::TryGetFlags : unsigned int

Options to restrict or relax a try_get() request.

For instance, the source array of a COPY operation must exist and be fully defined, whereas the target array need not be either. On the other hand, certain use cases might want to look up property names of an unsupported keyword type–e.g., transmissibility keywords among the integer properties–and those requests should specify the AllowUnsupported flag.

Note: We would ideally use strong enums (i.e., "enum class") for this, but those don't mesh very well with bitwise operations.

Enumerator
AllowUnsupported 

Whether or not to permit looking up property names of unmatching types.

MustExist 

Whether or not the property must already exist.

Member Function Documentation

◆ try_get()

template<typename T>
FieldDataManager< T > Opm::FieldProps::try_get ( const std::string & keyword,
const unsigned int flags = 0u )
inline

Request read-only property array from internal cache.

Will create property array if permitted and possible.

Template Parameters
TProperty element type. Typically double or int.
Parameters
[in]keywordProperty name
[in]flagsOptions to limit or relax request processing. Treated as a bitwise mask of TryGetFlags.
Returns
Access structure for requested property array.

The documentation for this class was generated from the following files:
  • opm/input/eclipse/EclipseState/Grid/FieldProps.hpp
  • opm/input/eclipse/EclipseState/Grid/FieldProps.cpp