My Project
UDQContext.hpp
1/*
2 Copyright 2019 Equinor 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
20
21#ifndef UDQ_CONTEXT_HPP
22#define UDQ_CONTEXT_HPP
23
24#include <optional>
25#include <string>
26#include <unordered_map>
27#include <vector>
28
29
30#include <opm/input/eclipse/Schedule/UDQ/UDQParams.hpp>
31
32namespace Opm {
33
34 class SummaryState;
35 class UDQFunctionTable;
36 class UDQSet;
37 class UDQState;
38 class WellMatcher;
39
40 class UDQContext {
41 public:
42 UDQContext(const UDQFunctionTable& udqft, const WellMatcher& wm, SummaryState& summary_state, UDQState& udq_state);
43 std::optional<double> get(const std::string& key) const;
44 std::optional<double> get_well_var(const std::string& well, const std::string& var) const;
45 std::optional<double> get_group_var(const std::string& group, const std::string& var) const;
46 void add(const std::string& key, double value);
47 void update_assign(std::size_t report_step, const std::string& keyword, const UDQSet& udq_result);
48 void update_define(std::size_t report_step, const std::string& keyword, const UDQSet& udq_result);
49 const UDQFunctionTable& function_table() const;
50 std::vector<std::string> wells() const;
51 std::vector<std::string> wells(const std::string& pattern) const;
52 std::vector<std::string> groups() const;
53 private:
54 const UDQFunctionTable& udqft;
55 const WellMatcher& well_matcher;
56 SummaryState& summary_state;
57 UDQState& udq_state;
58 //std::unordered_map<std::string, UDQSet> udq_results;
59 std::unordered_map<std::string, double> values;
60 };
61}
62
63
64
65#endif
Definition: SummaryState.hpp:68
Definition: UDQContext.hpp:40
Definition: UDQFunctionTable.hpp:32
Definition: UDQSet.hpp:182
Definition: UDQState.hpp:38
Definition: WellMatcher.hpp:32
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30