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.
ScheduleState & | state ()
| Returns a reference to current state.
const ScheduleStatic & | static_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::WGNames & | action_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 ScheduleBlock & | block
const DeckKeyword & | keyword
const std::size_t | currentStep
const Action::Result::MatchingEntities & | matches
const bool | action_mode
const ParseContext & | parseContext
ErrorGuard & | errors
std::unordered_map< std::string, double > & | wpimult_global_factor
const ScheduleGrid & | grid

## 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

  schedule | Schedule 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] | pattern | Group 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] | pattern | Well 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

  pattern | Pattern to match
  allowEmpty | If 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