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