19 #ifndef HANDLER_CONTEXT_HPP 20 #define HANDLER_CONTEXT_HPP 22 #include <opm/common/OpmLog/KeywordLocation.hpp> 24 #include <opm/input/eclipse/Schedule/Action/ActionResult.hpp> 31 #include <unordered_map> 47 struct ScheduleStatic;
48 struct SimulatorUpdate;
49 enum class WellStatus : std::uint8_t;
76 const std::size_t currentStep_,
82 const std::unordered_map<std::string, double>* target_wellpi_,
83 std::unordered_map<std::string, double>& wpimult_global_factor_,
85 std::set<std::string>* compsegs_wells_,
86 std::set<std::string>* comptraj_wells_)
89 , currentStep(currentStep_)
91 , action_mode(action_mode_)
92 , parseContext(parseContext_)
94 , wpimult_global_factor(wpimult_global_factor_)
96 , target_wellpi(target_wellpi_)
97 , welsegs_wells(welsegs_wells_)
98 , compsegs_wells(compsegs_wells_)
99 , comptraj_wells(comptraj_wells_)
100 , sim_update(sim_update_)
101 , schedule_(schedule)
105 void affected_well(
const std::string& well_name);
108 void welpi_well(
const std::string& well_name);
111 void record_tran_change();
114 void record_well_structure_change();
123 void welsegs_handled(
const std::string& well_name);
126 void compsegs_handled(
const std::string& well_name);
129 void comptraj_handled(
const std::string& well_name);
132 void setExitCode(
int code);
135 bool updateWellStatus(
const std::string& well,
137 const std::optional<KeywordLocation>& location = {});
140 WellStatus getWellStatus(
const std::string& well)
const;
143 void addGroup(
const std::string& groupName);
145 void addGroupToGroup(
const std::string& parent_group,
146 const std::string& child_group);
149 void welspecsCreateNewWell(
const DeckRecord& record,
150 const std::string& wellName,
151 const std::string& groupName);
154 void welspecsUpdateExistingWells(
const DeckRecord& record,
155 const std::vector<std::string>& wellNames,
156 const std::string& groupName);
159 double getWellPI(
const std::string& well_name)
const;
162 double elapsed_seconds()
const;
165 void invalidNamePattern(
const std::string& namePattern)
const;
168 const Action::WGNames& action_wgnames()
const;
171 std::vector<std::string> groupNames(
const std::string& pattern)
const;
183 bool hasWell(
const std::string& pattern)
const;
190 bool hasGroup(
const std::string& pattern)
const;
194 std::vector<std::string>
195 wellNames(
const std::string& pattern)
const;
200 std::vector<std::string>
201 wellNames(
const std::string& pattern,
bool allowEmpty)
const;
203 const ScheduleBlock& block;
204 const DeckKeyword& keyword;
205 const std::size_t currentStep;
206 const Action::Result::MatchingEntities& matches;
207 const bool action_mode;
208 const ParseContext& parseContext;
210 std::unordered_map<std::string, double>& wpimult_global_factor;
211 const ScheduleGrid& grid;
214 const std::unordered_map<std::string, double>* target_wellpi{
nullptr};
215 WelSegsSet* welsegs_wells{
nullptr};
216 std::set<std::string>* compsegs_wells{
nullptr};
217 std::set<std::string>* comptraj_wells{
nullptr};
218 SimulatorUpdate* sim_update{
nullptr};
224 #endif // HANDLER_CONTEXT_HPP Definition: Python.hpp:35
Container of matching entities.
Definition: ActionResult.hpp:172
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_, std::set< std::string > *comptraj_wells_)
Definition: HandlerContext.hpp:72
This struct is used to communicate back from the Schedule::applyAction() what needs to be updated in ...
Definition: SimulatorUpdate.hpp:32
Definition: Schedule.hpp:100
Definition: ScheduleBlock.hpp:51
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Collection of intersected cells and associate properties for all simulation grids, i.e., the main grid and all LGRs in the simulation run.
Definition: ScheduleGrid.hpp:49
Initial state of Schedule object created from information in SOLUTION section.
Definition: ScheduleStatic.hpp:47
Control parser behaviour in failure conditions.
Definition: ParseContext.hpp:114
Definition: ScheduleState.hpp:106
Definition: WelSegsSet.hpp:33
Definition: HandlerContext.hpp:54
Definition: DeckKeyword.hpp:36
Definition: ErrorGuard.hpp:30