My Project
Loading...
Searching...
No Matches
Keywords.hpp
1/*
2 Copyright 2020 Equinor AS.
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#ifndef OPM_KEYWORDS_HPP
21#define OPM_KEYWORDS_HPP
22
23#include <optional>
24#include <string>
25
26namespace Opm {
27namespace Fieldprops {
28namespace keywords {
29
30template <typename T>
32 std::optional<std::string> unit = std::nullopt;
33 std::optional<T> scalar_init = std::nullopt;
34 bool multiplier = false;
35 bool top = false;
36 bool global = false;
37
38 bool operator==(const keyword_info& other) const {
39 return this->unit == other.unit &&
40 this->scalar_init == other.scalar_init &&
41 this->multiplier == other.multiplier &&
42 this->top == other.top &&
43 this->global == other.global;
44 }
45
46
47 keyword_info<T>& init(T init_value) {
48 this->scalar_init = init_value;
49 return *this;
50 }
51
52 keyword_info<T>& unit_string(const std::string& unit_string) {
53 this->unit = unit_string;
54 return *this;
55 }
56
57 keyword_info<T>& distribute_top(bool dtop) {
58 this->top = dtop;
59 return *this;
60 }
61
62 keyword_info<T>& mult(bool m) {
63 this->multiplier = m;
64 return *this;
65 }
66
67 keyword_info<T>& global_kw(bool g) {
68 this->global = g;
69 return *this;
70 }
71};
72
73} // end namespace Keywords
74} // end namespace Fieldprops
75} //end namespace Opm
76
77#endif //OPM_KEYWORDS_HPP
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30
Definition Keywords.hpp:31