My Project
Schedule.hpp
1 /*
2  Copyright 2013 Statoil ASA.
3 
4  This file is part of the Open Porous Media project (OPM).
5 
6  OPM is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  OPM is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with OPM. If not, see <http://www.gnu.org/licenses/>.
18 */
19 #ifndef SCHEDULE_HPP
20 #define SCHEDULE_HPP
21 
22 #include <cstddef>
23 #include <map>
24 #include <memory>
25 #include <optional>
26 #include <ostream>
27 #include <string>
28 #include <unordered_map>
29 #include <unordered_set>
30 #include <utility>
31 #include <vector>
32 
33 #include <time.h>
34 
35 #include <opm/input/eclipse/EclipseState/Runspec.hpp>
36 #include <opm/input/eclipse/Schedule/GasLiftOpt.hpp>
37 #include <opm/input/eclipse/Schedule/Group/Group.hpp>
38 #include <opm/input/eclipse/Schedule/Group/GTNode.hpp>
39 #include <opm/input/eclipse/Schedule/Group/GuideRateConfig.hpp>
40 #include <opm/input/eclipse/Schedule/MessageLimits.hpp>
41 #include <opm/input/eclipse/Schedule/Network/ExtNetwork.hpp>
42 #include <opm/input/eclipse/Schedule/RPTConfig.hpp>
43 #include <opm/input/eclipse/Schedule/ScheduleDeck.hpp>
44 #include <opm/input/eclipse/Schedule/ScheduleState.hpp>
45 #include <opm/input/eclipse/Schedule/Well/PAvg.hpp>
46 #include <opm/input/eclipse/Schedule/Well/Well.hpp>
47 #include <opm/input/eclipse/Schedule/Well/WellTestConfig.hpp>
48 #include <opm/input/eclipse/Schedule/Well/WellMatcher.hpp>
49 #include <opm/input/eclipse/Schedule/WriteRestartFileEvents.hpp>
50 #include <opm/input/eclipse/Schedule/CompletedCells.hpp>
51 #include <opm/input/eclipse/Schedule/ScheduleDeck.hpp>
52 #include <opm/input/eclipse/Schedule/ScheduleState.hpp>
53 #include <opm/input/eclipse/Schedule/RPTConfig.hpp>
54 #include <opm/input/eclipse/Schedule/Action/SimulatorUpdate.hpp>
55 #include <opm/input/eclipse/Schedule/Action/WGNames.hpp>
56 #include <opm/input/eclipse/Parser/ParseContext.hpp>
57 
58 #include <opm/input/eclipse/Python/Python.hpp>
59 
60 #include <opm/input/eclipse/Units/UnitSystem.hpp>
61 
62 namespace Opm
63 {
64  class ActiveGridCells;
65  class Deck;
66  class DeckKeyword;
67  class DeckRecord;
68  class EclipseState;
69  class FieldPropsManager;
70  class ParseContext;
71  class SCHEDULESection;
72  class SummaryState;
73  class ErrorGuard;
74  class UDQConfig;
75 
76  namespace RestartIO { struct RstState; }
77 
78 
79  struct ScheduleStatic {
80  std::shared_ptr<const Python> m_python_handle;
81  std::string m_input_path;
82  ScheduleRestartInfo rst_info;
83  MessageLimits m_deck_message_limits;
84  UnitSystem m_unit_system;
85  Runspec m_runspec;
86  RSTConfig rst_config;
87  std::optional<int> output_interval;
88  double sumthin{-1.0};
89  bool rptonly{false};
90  bool gaslift_opt_active{false};
91 
92  ScheduleStatic() = default;
93 
94  explicit ScheduleStatic(std::shared_ptr<const Python> python_handle) :
95  m_python_handle(python_handle)
96  {}
97 
98  ScheduleStatic(std::shared_ptr<const Python> python_handle,
99  const ScheduleRestartInfo& restart_info,
100  const Deck& deck,
101  const Runspec& runspec,
102  const std::optional<int>& output_interval_,
103  const ParseContext& parseContext,
104  ErrorGuard& errors);
105 
106  template<class Serializer>
107  void serializeOp(Serializer& serializer)
108  {
109  m_deck_message_limits.serializeOp(serializer);
110  this->rst_info.serializeOp(serializer);
111  m_runspec.serializeOp(serializer);
112  m_unit_system.serializeOp(serializer);
113  serializer(this->m_input_path);
114  rst_info.serializeOp(serializer);
115  rst_config.serializeOp(serializer);
116  serializer(this->output_interval);
117  serializer(this->gaslift_opt_active);
118  }
119 
120 
121  static ScheduleStatic serializeObject() {
122  auto python = std::make_shared<Python>(Python::Enable::OFF);
123  ScheduleStatic st(python);
124  st.m_deck_message_limits = MessageLimits::serializeObject();
125  st.m_runspec = Runspec::serializeObject();
126  st.m_unit_system = UnitSystem::newFIELD();
127  st.m_input_path = "Some/funny/path";
128  st.rst_config = RSTConfig::serializeObject();
129  st.rst_info = ScheduleRestartInfo::serializeObject();
130  return st;
131  }
132 
133  bool operator==(const ScheduleStatic& other) const {
134  return this->m_input_path == other.m_input_path &&
135  this->m_deck_message_limits == other.m_deck_message_limits &&
136  this->m_unit_system == other.m_unit_system &&
137  this->rst_config == other.rst_config &&
138  this->rst_info == other.rst_info &&
139  this->gaslift_opt_active == other.gaslift_opt_active &&
140  this->m_runspec == other.m_runspec;
141  }
142  };
143 
144 
145  class Schedule {
146  public:
147  Schedule() = default;
148  explicit Schedule(std::shared_ptr<const Python> python_handle);
149  Schedule(const Deck& deck,
150  const EclipseGrid& grid,
151  const FieldPropsManager& fp,
152  const Runspec &runspec,
153  const ParseContext& parseContext,
154  ErrorGuard& errors,
155  std::shared_ptr<const Python> python,
156  const std::optional<int>& output_interval = {},
157  const RestartIO::RstState* rst = nullptr,
158  const TracerConfig* tracer_config = nullptr);
159 
160  template<typename T>
161  Schedule(const Deck& deck,
162  const EclipseGrid& grid,
163  const FieldPropsManager& fp,
164  const Runspec &runspec,
165  const ParseContext& parseContext,
166  T&& errors,
167  std::shared_ptr<const Python> python,
168  const std::optional<int>& output_interval = {},
169  const RestartIO::RstState* rst = nullptr,
170  const TracerConfig* tracer_config = nullptr);
171 
172  Schedule(const Deck& deck,
173  const EclipseGrid& grid,
174  const FieldPropsManager& fp,
175  const Runspec &runspec,
176  std::shared_ptr<const Python> python,
177  const std::optional<int>& output_interval = {},
178  const RestartIO::RstState* rst = nullptr,
179  const TracerConfig* tracer_config = nullptr);
180 
181  Schedule(const Deck& deck,
182  const EclipseState& es,
183  const ParseContext& parseContext,
184  ErrorGuard& errors,
185  std::shared_ptr<const Python> python,
186  const std::optional<int>& output_interval = {},
187  const RestartIO::RstState* rst = nullptr);
188 
189  template <typename T>
190  Schedule(const Deck& deck,
191  const EclipseState& es,
192  const ParseContext& parseContext,
193  T&& errors,
194  std::shared_ptr<const Python> python,
195  const std::optional<int>& output_interval = {},
196  const RestartIO::RstState* rst = nullptr);
197 
198  Schedule(const Deck& deck,
199  const EclipseState& es,
200  std::shared_ptr<const Python> python,
201  const std::optional<int>& output_interval = {},
202  const RestartIO::RstState* rst = nullptr);
203 
204  // The constructor *without* the Python arg should really only be used from Python itself
205  Schedule(const Deck& deck,
206  const EclipseState& es,
207  const std::optional<int>& output_interval = {},
208  const RestartIO::RstState* rst = nullptr);
209 
210  static Schedule serializeObject();
211 
212  /*
213  * If the input deck does not specify a start time, Eclipse's 1. Jan
214  * 1983 is defaulted
215  */
216  time_t getStartTime() const;
217  time_t posixStartTime() const;
218  time_t posixEndTime() const;
219  time_t simTime(std::size_t timeStep) const;
220  double seconds(std::size_t timeStep) const;
221  double stepLength(std::size_t timeStep) const;
222  std::optional<int> exitStatus() const;
223  const UnitSystem& getUnits() const { return this->m_static.m_unit_system; }
224  const Runspec& runspec() const { return this->m_static.m_runspec; }
225 
226  std::size_t numWells() const;
227  std::size_t numWells(std::size_t timestep) const;
228  bool hasWell(const std::string& wellName) const;
229  bool hasWell(const std::string& wellName, std::size_t timeStep) const;
230 
231  WellMatcher wellMatcher(std::size_t report_step) const;
232  std::vector<std::string> wellNames(const std::string& pattern, std::size_t timeStep, const std::vector<std::string>& matching_wells = {}) const;
233  std::vector<std::string> wellNames(const std::string& pattern) const;
234  std::vector<std::string> wellNames(std::size_t timeStep) const;
235  std::vector<std::string> wellNames() const;
236 
237  bool hasGroup(const std::string& groupName, std::size_t timeStep) const;
238  std::vector<std::string> groupNames(const std::string& pattern, std::size_t timeStep) const;
239  std::vector<std::string> groupNames(std::size_t timeStep) const;
240  std::vector<std::string> groupNames(const std::string& pattern) const;
241  std::vector<std::string> groupNames() const;
242  /*
243  The restart_groups function returns a vector of groups pointers which
244  is organized as follows:
245 
246  1. The number of elements is WELLDIMS::MAXGROUPS + 1
247  2. The elements are sorted according to group.insert_index().
248  3. If there are less than WELLDIMS::MAXGROUPS nullptr is used.
249  4. The very last element corresponds to the FIELD group.
250  */
251  std::vector<const Group*> restart_groups(std::size_t timeStep) const;
252 
253  std::vector<std::string> changed_wells(std::size_t reportStep) const;
254  const Well& getWell(std::size_t well_index, std::size_t timeStep) const;
255  const Well& getWell(const std::string& wellName, std::size_t timeStep) const;
256  const Well& getWellatEnd(const std::string& well_name) const;
257  std::vector<Well> getWells(std::size_t timeStep) const;
258  std::vector<Well> getWellsatEnd() const;
259  void shut_well(const std::string& well_name, std::size_t report_step);
260  void stop_well(const std::string& well_name, std::size_t report_step);
261  void open_well(const std::string& well_name, std::size_t report_step);
262  void applyWellProdIndexScaling(const std::string& well_name, const std::size_t reportStep, const double scalingFactor);
263 
264  std::vector<const Group*> getChildGroups2(const std::string& group_name, std::size_t timeStep) const;
265  std::vector<Well> getChildWells2(const std::string& group_name, std::size_t timeStep) const;
266  Well::ProducerCMode getGlobalWhistctlMmode(std::size_t timestep) const;
267 
268  const UDQConfig& getUDQConfig(std::size_t timeStep) const;
269  void evalAction(const SummaryState& summary_state, std::size_t timeStep);
270 
271  GTNode groupTree(std::size_t report_step) const;
272  GTNode groupTree(const std::string& root_node, std::size_t report_step) const;
273  const Group& getGroup(const std::string& groupName, std::size_t timeStep) const;
274 
275  std::optional<std::size_t> first_RFT() const;
276  /*
277  Will remove all completions which are connected to cell which is not
278  active. Will scan through all wells and all timesteps.
279  */
280  void filterConnections(const ActiveGridCells& grid);
281  std::size_t size() const;
282 
283  bool write_rst_file(std::size_t report_step) const;
284  const std::map< std::string, int >& rst_keywords( size_t timestep ) const;
285 
286  /*
287  The applyAction() is invoked from the simulator *after* an ACTIONX has
288  evaluated to true. The return value is a small structure with
289  'information' which the simulator should take into account when
290  updating internal datastructures after the ACTIONX keywords have been
291  applied.
292  */
293  SimulatorUpdate applyAction(std::size_t reportStep, const Action::ActionX& action, const std::vector<std::string>& matching_wells, const std::unordered_map<std::string, double>& wellpi);
294  /*
295  The runPyAction() will run the Python script in a PYACTION keyword. In
296  the case of Schedule updates the recommended way of doing that from
297  PYACTION is to invoke a "normal" ACTIONX keyword internally from the
298  Python code. he return value from runPyAction() comes from such a
299  internal ACTIONX.
300  */
301  SimulatorUpdate runPyAction(std::size_t reportStep, const Action::PyAction& pyaction, Action::State& action_state, EclipseState& ecl_state, SummaryState& summary_state);
302 
303 
304  const GasLiftOpt& glo(std::size_t report_step) const;
305 
306  bool operator==(const Schedule& data) const;
307  std::shared_ptr<const Python> python() const;
308 
309 
310  const ScheduleState& back() const;
311  const ScheduleState& operator[](std::size_t index) const;
312  std::vector<ScheduleState>::const_iterator begin() const;
313  std::vector<ScheduleState>::const_iterator end() const;
314  void create_next(const time_point& start_time, const std::optional<time_point>& end_time);
315  void create_next(const ScheduleBlock& block);
316  void create_first(const time_point& start_time, const std::optional<time_point>& end_time);
317 
318 
319  /*
320  The cmp() function compares two schedule instances in a context aware
321  manner. Floating point numbers are compared with a tolerance. The
322  purpose of this comparison function is to implement regression tests
323  for the schedule instances created by loading a restart file.
324  */
325  static bool cmp(const Schedule& sched1, const Schedule& sched2, std::size_t report_step);
326  void applyKeywords(std::vector<DeckKeyword*>& keywords, std::size_t timeStep);
327 
328  template<class Serializer>
329  void serializeOp(Serializer& serializer)
330  {
331  m_sched_deck.serializeOp(serializer);
332  serializer.vector(snapshots);
333  m_static.serializeOp(serializer);
334  restart_output.serializeOp(serializer);
335  this->completed_cells.serializeOp(serializer);
336  this->action_wgnames.serializeOp(serializer);
337 
338  pack_unpack<PAvg, Serializer>(serializer);
339  pack_unpack<WellTestConfig, Serializer>(serializer);
340  pack_unpack<GConSale, Serializer>(serializer);
341  pack_unpack<GConSump, Serializer>(serializer);
342  pack_unpack<WListManager, Serializer>(serializer);
343  pack_unpack<Network::ExtNetwork, Serializer>(serializer);
344  pack_unpack<Network::Balance, Serializer>(serializer);
345  pack_unpack<RPTConfig, Serializer>(serializer);
346  pack_unpack<Action::Actions, Serializer>(serializer);
347  pack_unpack<UDQActive, Serializer>(serializer);
348  pack_unpack<UDQConfig, Serializer>(serializer);
349  pack_unpack<NameOrder, Serializer>(serializer);
350  pack_unpack<GroupOrder, Serializer>(serializer);
351  pack_unpack<GuideRateConfig, Serializer>(serializer);
352  pack_unpack<GasLiftOpt, Serializer>(serializer);
353  pack_unpack<RFTConfig, Serializer>(serializer);
354  pack_unpack<RSTConfig, Serializer>(serializer);
355 
356  pack_unpack_map<int, VFPProdTable, Serializer>(serializer);
357  pack_unpack_map<int, VFPInjTable, Serializer>(serializer);
358  pack_unpack_map<std::string, Group, Serializer>(serializer);
359  pack_unpack_map<std::string, Well, Serializer>(serializer);
360  }
361 
362  template <typename T, class Serializer>
363  void pack_unpack(Serializer& serializer) {
364  std::vector<T> value_list;
365  std::vector<std::size_t> index_list;
366 
367  if (serializer.isSerializing())
368  pack_state<T>(value_list, index_list);
369 
370  serializer.vector(value_list);
371  serializer.template vector<std::size_t, false>(index_list);
372 
373  if (!serializer.isSerializing())
374  unpack_state<T>(value_list, index_list);
375  }
376 
377  template <typename T>
378  std::vector<std::pair<std::size_t, T>> unique() const {
379  std::vector<std::pair<std::size_t, T>> values;
380  for (std::size_t index = 0; index < this->snapshots.size(); index++) {
381  const auto& member = this->snapshots[index].get<T>();
382  const auto& value = member.get();
383  if (values.empty() || !(value == values.back().second))
384  values.push_back( std::make_pair(index, value));
385  }
386  return values;
387  }
388 
389 
390  template <typename T>
391  void pack_state(std::vector<T>& value_list, std::vector<std::size_t>& index_list) const {
392  auto unique_values = this->unique<T>();
393  for (auto& [index, value] : unique_values) {
394  value_list.push_back( std::move(value) );
395  index_list.push_back( index );
396  }
397  }
398 
399 
400  template <typename T>
401  void unpack_state(const std::vector<T>& value_list, const std::vector<std::size_t>& index_list) {
402  std::size_t unique_index = 0;
403  while (unique_index < value_list.size()) {
404  const auto& value = value_list[unique_index];
405  const auto& first_index = index_list[unique_index];
406  auto last_index = this->snapshots.size();
407  if (unique_index < (value_list.size() - 1))
408  last_index = index_list[unique_index + 1];
409 
410  auto& target_state = this->snapshots[first_index];
411  target_state.get<T>().update( std::move(value) );
412  for (std::size_t index=first_index + 1; index < last_index; index++)
413  this->snapshots[index].get<T>().update( target_state.get<T>() );
414 
415  unique_index++;
416  }
417  }
418 
419 
420  template <typename K, typename T, class Serializer>
421  void pack_unpack_map(Serializer& serializer) {
422  std::vector<T> value_list;
423  std::vector<std::size_t> index_list;
424 
425  if (serializer.isSerializing())
426  pack_map<K,T>(value_list, index_list);
427 
428  serializer.vector(value_list);
429  serializer(index_list);
430 
431  if (!serializer.isSerializing())
432  unpack_map<K,T>(value_list, index_list);
433  }
434 
435 
436  template <typename K, typename T>
437  void pack_map(std::vector<T>& value_list,
438  std::vector<std::size_t>& index_list) {
439 
440  const auto& last_map = this->snapshots.back().get_map<K,T>();
441  std::vector<K> key_list{ last_map.keys() };
442  std::unordered_map<K,T> current_value;
443 
444  for (std::size_t index = 0; index < this->snapshots.size(); index++) {
445  auto& state = this->snapshots[index];
446  const auto& current_map = state.template get_map<K,T>();
447  for (const auto& key : key_list) {
448  auto& value = current_map.get_ptr(key);
449  if (value) {
450  auto it = current_value.find(key);
451  if (it == current_value.end() || !(*value == it->second)) {
452  value_list.push_back( *value );
453  index_list.push_back( index );
454 
455  current_value[key] = *value;
456  }
457  }
458  }
459  }
460  }
461 
462 
463  template <typename K, typename T>
464  void unpack_map(const std::vector<T>& value_list,
465  const std::vector<std::size_t>& index_list) {
466 
467  std::unordered_map<K, std::vector<std::pair<std::size_t, T>>> storage;
468  for (std::size_t storage_index = 0; storage_index < value_list.size(); storage_index++) {
469  const auto& value = value_list[storage_index];
470  const auto& time_index = index_list[storage_index];
471 
472  storage[ value.name() ].emplace_back( time_index, value );
473  }
474 
475  for (const auto& [key, values] : storage) {
476  for (std::size_t unique_index = 0; unique_index < values.size(); unique_index++) {
477  const auto& [time_index, value] = values[unique_index];
478  auto last_index = this->snapshots.size();
479  if (unique_index < (values.size() - 1))
480  last_index = values[unique_index + 1].first;
481 
482  auto& map_value = this->snapshots[time_index].template get_map<K,T>();
483  map_value.update(std::move(value));
484 
485  for (std::size_t index=time_index + 1; index < last_index; index++) {
486  auto& forward_map = this->snapshots[index].template get_map<K,T>();
487  forward_map.update( key, map_value );
488  }
489  }
490  }
491  }
492 
493  friend std::ostream& operator<<(std::ostream& os, const Schedule& sched);
494  void dump_deck(std::ostream& os) const;
495 
496  private:
497  struct HandlerContext {
498  const ScheduleBlock& block;
499  const DeckKeyword& keyword;
500  const std::size_t currentStep;
501  const std::vector<std::string>& matching_wells;
502  const bool actionx_mode;
503  const ParseContext& parseContext;
504  ErrorGuard& errors;
505  SimulatorUpdate * sim_update;
506  const std::unordered_map<std::string, double> * target_wellpi;
507  const ScheduleGrid& grid;
508 
509  HandlerContext(const ScheduleBlock& block_,
510  const DeckKeyword& keyword_,
511  const ScheduleGrid& grid_,
512  const std::size_t currentStep_,
513  const std::vector<std::string>& matching_wells_,
514  bool actionx_mode_,
515  const ParseContext& parseContext_,
516  ErrorGuard& errors_,
517  SimulatorUpdate * sim_update_,
518  const std::unordered_map<std::string, double> * target_wellpi_)
519  : block(block_)
520  , keyword(keyword_)
521  , currentStep(currentStep_)
522  , matching_wells(matching_wells_)
523  , actionx_mode(actionx_mode_)
524  , parseContext(parseContext_)
525  , errors(errors_)
526  , sim_update(sim_update_)
527  , target_wellpi(target_wellpi_)
528  , grid(grid_)
529  {}
530 
531  void affected_well(const std::string& well_name) {
532  if (this->sim_update)
533  this->sim_update->affected_wells.insert(well_name);
534  }
535 
536  };
537 
538  ScheduleStatic m_static;
539  ScheduleDeck m_sched_deck;
540  Action::WGNames action_wgnames;
541  std::optional<int> exit_status;
542  std::vector<ScheduleState> snapshots;
543  WriteRestartFileEvents restart_output;
544  CompletedCells completed_cells;
545 
546  void load_rst(const RestartIO::RstState& rst,
547  const TracerConfig& tracer_config,
548  const ScheduleGrid& grid,
549  const FieldPropsManager& fp);
550  void addWell(Well well);
551  void addWell(const std::string& wellName,
552  const std::string& group,
553  int headI,
554  int headJ,
555  Phase preferredPhase,
556  const std::optional<double>& refDepth,
557  double drainageRadius,
558  bool allowCrossFlow,
559  bool automaticShutIn,
560  int pvt_table,
561  Well::GasInflowEquation gas_inflow,
562  std::size_t timeStep,
563  Connection::Order wellConnectionOrder);
564  bool updateWPAVE(const std::string& wname, std::size_t report_step, const PAvg& pavg);
565 
566  void updateGuideRateModel(const GuideRateModel& new_model, std::size_t report_step);
567  GTNode groupTree(const std::string& root_node, std::size_t report_step, std::size_t level, const std::optional<std::string>& parent_name) const;
568  bool checkGroups(const ParseContext& parseContext, ErrorGuard& errors);
569  bool updateWellStatus( const std::string& well, std::size_t reportStep, Well::Status status, std::optional<KeywordLocation> = {});
570  void addWellToGroup( const std::string& group_name, const std::string& well_name , std::size_t timeStep);
571  void iterateScheduleSection(std::size_t load_start,
572  std::size_t load_end,
573  const ParseContext& parseContext,
574  ErrorGuard& errors,
575  const ScheduleGrid& grid,
576  const std::unordered_map<std::string, double> * target_wellpi,
577  const std::string& prefix);
578  void addACTIONX(const Action::ActionX& action);
579  void addGroupToGroup( const std::string& parent_group, const std::string& child_group);
580  void addGroup(const std::string& groupName , std::size_t timeStep);
581  void addGroup(Group group);
582  void addGroup(const RestartIO::RstGroup& rst_group, std::size_t timeStep);
583  void addWell(const std::string& wellName, const DeckRecord& record, std::size_t timeStep, Connection::Order connection_order);
584  void checkIfAllConnectionsIsShut(std::size_t currentStep);
585  void end_report(std::size_t report_step);
586  void handleKeyword(std::size_t currentStep,
587  const ScheduleBlock& block,
588  const DeckKeyword& keyword,
589  const ParseContext& parseContext, ErrorGuard& errors,
590  const ScheduleGrid& grid,
591  const std::vector<std::string>& matching_wells,
592  bool runtime,
593  SimulatorUpdate * sim_update,
594  const std::unordered_map<std::string, double> * target_wellpi);
595 
596  void prefetch_cell_properties(const ScheduleGrid& grid, const DeckKeyword& keyword);
597  void store_wgnames(const DeckKeyword& keyword);
598  std::vector<std::string> wellNames(const std::string& pattern, const HandlerContext& context);
599  std::vector<std::string> wellNames(const std::string& pattern, std::size_t timeStep, const std::vector<std::string>& matching_wells, InputError::Action error_action, ErrorGuard& errors, const KeywordLocation& location) const;
600  void invalidNamePattern( const std::string& namePattern, const HandlerContext& context) const;
601  static std::string formatDate(std::time_t t);
602  std::string simulationDays(std::size_t currentStep) const;
603 
604  bool must_write_rst_file(std::size_t report_step) const;
605 
606  void applyEXIT(const DeckKeyword&, std::size_t currentStep);
607  SimulatorUpdate applyAction(std::size_t reportStep, const std::string& action_name, const std::vector<std::string>& matching_wells);
608 
624  bool handleNormalKeyword(HandlerContext& handlerContext);
625 
626  // Keyword Handlers
627  void handlePYACTION(const DeckKeyword&);
628  void handleWELPIRuntime(HandlerContext&);
629 
630  // Normal keyword handlers -- in KeywordHandlers.cpp
631 
632  void handleBRANPROP (HandlerContext&);
633  void handleCOMPDAT (HandlerContext&);
634  void handleCOMPLUMP (HandlerContext&);
635  void handleCOMPORD (HandlerContext&);
636  void handleCOMPSEGS (HandlerContext&);
637  void handleDRSDT (HandlerContext&);
638  void handleDRSDTCON (HandlerContext&);
639  void handleDRSDTR (HandlerContext&);
640  void handleDRVDT (HandlerContext&);
641  void handleDRVDTR (HandlerContext&);
642  void handleEXIT (HandlerContext&);
643  void handleGCONINJE (HandlerContext&);
644  void handleGCONPROD (HandlerContext&);
645  void handleGCONSALE (HandlerContext&);
646  void handleGCONSUMP (HandlerContext&);
647  void handleGEFAC (HandlerContext&);
648  void handleGEOKeyword(HandlerContext&);
649  void handleGLIFTOPT (HandlerContext&);
650  void handleGPMAINT (HandlerContext&);
651  void handleGRUPNET (HandlerContext&);
652  void handleGRUPTREE (HandlerContext&);
653  void handleGUIDERAT (HandlerContext&);
654  void handleLIFTOPT (HandlerContext&);
655  void handleLINCOM (HandlerContext&);
656  void handleMESSAGES (HandlerContext&);
657  void handleMXUNSUPP (HandlerContext&);
658  void handleNETBALAN (HandlerContext&);
659  void handleNEXTSTEP (HandlerContext&);
660  void handleNODEPROP (HandlerContext&);
661  void handleNUPCOL (HandlerContext&);
662  void handleRPTONLY (HandlerContext&);
663  void handleRPTONLYO (HandlerContext&);
664  void handleRPTRST (HandlerContext&);
665  void handleRPTSCHED (HandlerContext&);
666  void handleTUNING (HandlerContext&);
667  void handleSAVE (HandlerContext&);
668  void handleSUMTHIN (HandlerContext&);
669  void handleUDQ (HandlerContext&);
670  void handleVAPPARS (HandlerContext&);
671  void handleVFPINJ (HandlerContext&);
672  void handleVFPPROD (HandlerContext&);
673  void handleWCONHIST (HandlerContext&);
674  void handleWCONINJE (HandlerContext&);
675  void handleWCONINJH (HandlerContext&);
676  void handleWCONPROD (HandlerContext&);
677  void handleWECON (HandlerContext&);
678  void handleWEFAC (HandlerContext&);
679  void handleWELOPEN (HandlerContext&);
680  void handleWELPI (HandlerContext&);
681  void handleWELSEGS (HandlerContext&);
682  void handleWELSPECS (HandlerContext&);
683  void handleWELTARG (HandlerContext&);
684  void handleWFOAM (HandlerContext&);
685  void handleWGRUPCON (HandlerContext&);
686  void handleWHISTCTL (HandlerContext&);
687  void handleWINJTEMP (HandlerContext&);
688  void handleWLIFTOPT (HandlerContext&);
689  void handleWLIST (HandlerContext&);
690  void handleWMICP (HandlerContext&);
691  void handleWPAVE (HandlerContext&);
692  void handleWPAVEDEP (HandlerContext&);
693  void handleWVFPEXP (HandlerContext&);
694  void handleWWPAVE (HandlerContext&);
695  void handleWPIMULT (HandlerContext&);
696  void handleWPMITAB (HandlerContext&);
697  void handleWPOLYMER (HandlerContext&);
698  void handleWRFT (HandlerContext&);
699  void handleWRFTPLT (HandlerContext&);
700  void handleWSALT (HandlerContext&);
701  void handleWSEGITER (HandlerContext&);
702  void handleWSEGSICD (HandlerContext&);
703  void handleWSEGAICD (HandlerContext&);
704  void handleWSEGVALV (HandlerContext&);
705  void handleWSKPTAB (HandlerContext&);
706  void handleWSOLVENT (HandlerContext&);
707  void handleWTEMP (HandlerContext&);
708  void handleWTEST (HandlerContext&);
709  void handleWTMULT (HandlerContext&);
710  void handleWTRACER (HandlerContext&);
711  };
712 }
713 
714 #endif
Definition: ActionX.hpp:74
Definition: PyAction.hpp:41
Definition: State.hpp:40
Definition: WGNames.hpp:29
Simple class capturing active cells of a grid.
Definition: ActiveGridCells.hpp:35
Definition: CompletedCells.hpp:28
Definition: DeckKeyword.hpp:36
Definition: DeckRecord.hpp:32
Definition: Deck.hpp:63
About cell information and dimension: The actual grid information is held in a pointer to an ERT ecl_...
Definition: EclipseGrid.hpp:54
Definition: EclipseState.hpp:55
Definition: ErrorGuard.hpp:29
Definition: FieldPropsManager.hpp:38
Definition: GTNode.hpp:31
Definition: GasLiftOpt.hpp:30
Definition: Group.hpp:44
Definition: GuideRateModel.hpp:29
Definition: KeywordLocation.hpp:27
Definition: MessageLimits.hpp:28
Definition: PAvg.hpp:28
Definition: ParseContext.hpp:88
Definition: RSTConfig.hpp:196
Definition: Runspec.hpp:439
Definition: ScheduleDeck.hpp:55
Definition: ScheduleDeck.hpp:125
Definition: ScheduleGrid.hpp:29
Definition: ScheduleState.hpp:81
Definition: Schedule.hpp:145
Definition: Serializer.hpp:38
Definition: SummaryState.hpp:69
Definition: TracerConfig.hpp:31
Definition: UDQConfig.hpp:51
Definition: UnitSystem.hpp:34
Definition: WellMatcher.hpp:32
Definition: Well.hpp:78
Definition: WriteRestartFileEvents.hpp:31
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29
Definition: group.hpp:33
Definition: state.hpp:51
Definition: ScheduleDeck.hpp:93
Definition: Schedule.hpp:79
Definition: SimulatorUpdate.hpp:35