ActionHandler.hpp
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
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 2 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 Consult the COPYING file in the top-level source directory of this
20 module for the precise wording of the license and the list of
21 copyright holders.
22*/
23
24#ifndef OPM_ACTION_HANDLER_HPP
25#define OPM_ACTION_HANDLER_HPP
26
28
29#include <functional>
30#include <string>
31#include <unordered_map>
32#include <vector>
33
34namespace Opm {
35
36namespace Action {
37class ActionX;
38class State;
39}
40
41template<class Scalar> class BlackoilWellModelGeneric;
42class EclipseState;
43class Schedule;
44struct SimulatorUpdate;
45class SummaryState;
46class UDQState;
47
50{
51public:
53 using TransFunc = std::function<void(bool)>;
54
55 ActionHandler(EclipseState& ecl_state,
56 Schedule& schedule,
57 Action::State& actionState,
58 SummaryState& summaryState,
61
62 void applyActions(int reportStep,
63 double sim_time,
64 const TransFunc& updateTrans);
65
67 void evalUDQAssignments(const unsigned episodeIdx,
68 UDQState& udq_state);
69
70 private:
71 /*
72 This function is run after applyAction has been completed in the Schedule
73 implementation. The sim_update argument should have members & flags for
74 the simulator properties which need to be updated. This functionality is
75 probably not complete.
76 */
77 void applySimulatorUpdate(int report_step,
78 const SimulatorUpdate& sim_update,
79 bool& commit_wellstate,
80 const TransFunc& updateTrans);
81
82 std::unordered_map<std::string, double>
83 fetchWellPI(int reportStep,
84 const Action::ActionX& action,
85 const std::vector<std::string>& matching_wells) const;
86
87 EclipseState& ecl_state_;
88 Schedule& schedule_;
89 Action::State& actionState_;
90 SummaryState& summaryState_;
93};
94
95} // namespace Opm
96
97#endif // OPM_ACTION_HANDLER_HPP
Class handling Action support in simulator.
Definition: ActionHandler.hpp:50
void applyActions(int reportStep, double sim_time, const TransFunc &updateTrans)
void evalUDQAssignments(const unsigned episodeIdx, UDQState &udq_state)
Evaluates UDQ assign statements.
std::function< void(bool)> TransFunc
Function handle to update transmissiblities.
Definition: ActionHandler.hpp:53
ActionHandler(EclipseState &ecl_state, Schedule &schedule, Action::State &actionState, SummaryState &summaryState, BlackoilWellModelGeneric< double > &wellModel, Parallel::Communication comm)
Class for handling the blackoil well model.
Definition: BlackoilWellModelGeneric.hpp:83
Dune::Communication< MPIComm > Communication
Definition: ParallelCommunication.hpp:30
Definition: BlackoilPhases.hpp:27