UDQContext.hpp
Go to the documentation of this file.
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 <vector>
25#include <string>
26#include <unordered_map>
27
28
30
31namespace Opm {
32 class SummaryState;
33 class UDQFunctionTable;
34
36 public:
37 UDQContext(const UDQFunctionTable& udqft, const SummaryState& summary_state);
38 double get(const std::string& key) const;
39 bool has_well_var(const std::string& well, const std::string& var) const;
40 double get_well_var(const std::string& well, const std::string& var) const;
41 bool has_group_var(const std::string& group, const std::string& var) const;
42 double get_group_var(const std::string& group, const std::string& var) const;
43 void add(const std::string& key, double value);
45 std::vector<std::string> wells() const;
46 std::vector<std::string> groups() const;
47 private:
48 const UDQFunctionTable& udqft;
49 const SummaryState& summary_state;
50 std::unordered_map<std::string, double> values;
51 };
52}
53
54
55
56#endif
const char *const string
Definition: cJSON.h:170
Definition: SummaryState.hpp:65
Definition: UDQContext.hpp:35
double get_group_var(const std::string &group, const std::string &var) const
double get(const std::string &key) const
const UDQFunctionTable & function_table() const
std::vector< std::string > groups() const
bool has_well_var(const std::string &well, const std::string &var) const
UDQContext(const UDQFunctionTable &udqft, const SummaryState &summary_state)
double get_well_var(const std::string &well, const std::string &var) const
bool has_group_var(const std::string &group, const std::string &var) const
void add(const std::string &key, double value)
std::vector< std::string > wells() const
Definition: UDQFunctionTable.hpp:31
Definition: A.hpp:4
T value(details::expression_node< T > *n)
Definition: exprtk.hpp:12955