DenT.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2020 by Equinor
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#ifndef OPM_PARSER_DENT_HPP
20#define OPM_PARSER_DENT_HPP
21
22#include <cstddef>
23#include <vector>
24
25namespace Opm {
26
27 class DeckKeyword;
28 class DeckRecord;
29
30 class DenT {
31 public:
32
33 struct entry {
34 double T0;
35 double C1;
36 double C2;
37
38 entry() = default;
39 entry(double T0_, double C1_, double C2_);
40 explicit entry(const DeckRecord& record);
41 bool operator==(const entry& other) const;
42
43 template<class Serializer>
44 void serializeOp(Serializer& serializer)
45 {
46 serializer(T0);
47 serializer(C1);
48 serializer(C2);
49 }
50 };
51
52 DenT() = default;
53 explicit DenT(const DeckKeyword& keyword);
54
56
57 const entry& operator[](const std::size_t index) const;
58 bool operator==(const DenT& other) const;
59 std::size_t size() const;
60
61 template<class Serializer>
62 void serializeOp(Serializer& serializer)
63 {
64 serializer.vector(m_records);
65 }
66
67 private:
68 std::vector<entry> m_records;
69 };
70}
71
72#endif
int index
Definition: cJSON.h:168
Definition: DeckKeyword.hpp:38
Definition: DeckRecord.hpp:32
Definition: DenT.hpp:30
const entry & operator[](const std::size_t index) const
static DenT serializeObject()
std::size_t size() const
bool operator==(const DenT &other) const
DenT(const DeckKeyword &keyword)
DenT()=default
void serializeOp(Serializer &serializer)
Definition: DenT.hpp:62
Definition: Serializer.hpp:38
UDAKeyword keyword(UDAControl control)
Definition: A.hpp:4
Definition: DenT.hpp:33
double C2
Definition: DenT.hpp:36
entry(const DeckRecord &record)
bool operator==(const entry &other) const
double C1
Definition: DenT.hpp:35
void serializeOp(Serializer &serializer)
Definition: DenT.hpp:44
double T0
Definition: DenT.hpp:34
entry(double T0_, double C1_, double C2_)