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