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

Public Member Functions

 HandlerContext (Schedule &schedule, const ScheduleBlock &block_, const DeckKeyword &keyword_, const ScheduleGrid &grid_, const std::size_t currentStep_, const Action::Result::MatchingEntities &matches_, bool action_mode_, const ParseContext &parseContext_, ErrorGuard &errors_, SimulatorUpdate *sim_update_, const std::unordered_map< std::string, double > *target_wellpi_, std::unordered_map< std::string, double > &wpimult_global_factor_, WelSegsSet *welsegs_wells_, std::set< std::string > *compsegs_wells_)
void affected_well (const std::string &well_name)
 Mark that a well has changed.
void welpi_well (const std::string &well_name)
 Mark that a well is affected by WELPI.
void record_tran_change ()
 Mark that transmissibilities must be recalculated.
void record_well_structure_change ()
 Mark that well structure has changed.
ScheduleStatestate ()
 Returns a reference to current state.
const ScheduleStaticstatic_schedule () const
 Returns a const-ref to the static schedule.
void welsegs_handled (const std::string &well_name)
 Mark that the well occured in a WELSEGS keyword.
void compsegs_handled (const std::string &well_name)
 Mark that the well occured in a COMPSEGS keyword.
void setExitCode (int code)
 Set exit code.
bool updateWellStatus (const std::string &well, WellStatus status, const std::optional< KeywordLocation > &location={})
 Update status of a well.
WellStatus getWellStatus (const std::string &well) const
 Get status of a well.
void addGroup (const std::string &groupName)
 Adds a group to the schedule.
void addGroupToGroup (const std::string &parent_group, const std::string &child_group)
 Adds a group to a group.
void welspecsCreateNewWell (const DeckRecord &record, const std::string &wellName, const std::string &groupName)
 Create a new Well from a WELSPECS record.
void welspecsUpdateExistingWells (const DeckRecord &record, const std::vector< std::string > &wellNames, const std::string &groupName)
 Update one or more existing wells from a WELSPECS record.
double getWellPI (const std::string &well_name) const
 Obtain PI for a well.
double elapsed_seconds () const
 Returns elapsed time since simulation start in seconds.
void invalidNamePattern (const std::string &namePattern) const
 Adds parse error for an invalid name pattern.
const Action::WGNamesaction_wgnames () const
 Obtain action well group names.
std::vector< std::string > groupNames (const std::string &pattern) const
 Obtain well group names from a pattern.
bool hasWell (const std::string &pattern) const
 Whether or not any existing well matches a name pattern.
bool hasGroup (const std::string &pattern) const
 Whether or not any existing group matches a name pattern.
std::vector< std::string > wellNames (const std::string &pattern) const
 Obtain well names from a pattern.
std::vector< std::string > wellNames (const std::string &pattern, bool allowEmpty) const
 Obtain well names from a pattern.

Public Attributes

const ScheduleBlockblock
const DeckKeywordkeyword
const std::size_t currentStep
const Action::Result::MatchingEntitiesmatches
const bool action_mode
const ParseContextparseContext
ErrorGuarderrors
std::unordered_map< std::string, double > & wpimult_global_factor
const ScheduleGridgrid

Constructor & Destructor Documentation

◆ HandlerContext()

Opm::HandlerContext::HandlerContext ( Schedule & schedule,
const ScheduleBlock & block_,
const DeckKeyword & keyword_,
const ScheduleGrid & grid_,
const std::size_t currentStep_,
const Action::Result::MatchingEntities & matches_,
bool action_mode_,
const ParseContext & parseContext_,
ErrorGuard & errors_,
SimulatorUpdate * sim_update_,
const std::unordered_map< std::string, double > * target_wellpi_,
std::unordered_map< std::string, double > & wpimult_global_factor_,
WelSegsSet * welsegs_wells_,
std::set< std::string > * compsegs_wells_ )
inline
Parameters
scheduleSchedule to initialize
block_Block in schedule to use
keyword_Keyword to use
grid_Grid schedule to use
currentStep_Current report step
matches_Matching entities
action_mode_True if we are parsing an ACTION
parseContext_Context for the parser
errors_Error handler to use
sim_update_Simulator update structure to use
target_wellpi_Well production indices to target
wpimult_global_factor_Global well production index multipliers
welsegs_wells_All wells with a WELSEGS entry for checks.
compsegs_wells_All wells with a COMPSEGS entry for checks.

Member Function Documentation

◆ hasGroup()

bool Opm::HandlerContext::hasGroup ( const std::string & pattern) const

Whether or not any existing group matches a name pattern.

Parameters
[in]patternGroup name or group name root.
Returns
Whether or not any existing group matches pattern.

◆ hasWell()

bool Opm::HandlerContext::hasWell ( const std::string & pattern) const

Whether or not any existing well matches a name pattern.

If the pattern is a well list or a well list template, then the predicate will check if any well lists matching the pattern exists and, if so, whether the corresponding well list is non-empty.

Parameters
[in]patternWell name, well name template, well list, or well list template.
Returns
Whether or not any existing well matches pattern.

◆ wellNames() [1/2]

std::vector< std::string > Opm::HandlerContext::wellNames ( const std::string & pattern) const

Obtain well names from a pattern.

Throws if no wells match the pattern and pattern is not a WLIST.

◆ wellNames() [2/2]

std::vector< std::string > Opm::HandlerContext::wellNames ( const std::string & pattern,
bool allowEmpty ) const

Obtain well names from a pattern.

Parameters
patternPattern to match
allowEmptyIf true do not throw if no wells match the pattern

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