opm-common
TLMixpar.hpp
1 /*
2  Copyright (C) 2020 Statoil 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 #ifndef TLMIXPAR_HPP
21 #define TLMIXPAR_HPP
22 
23 #include <cstddef>
24 #include <vector>
25 
26 namespace Opm {
27 class Deck;
28 
30 {
31  double viscosity_parameter{};
32  double density_parameter{};
33 
34  TLMixRecord() = default;
35  TLMixRecord(double v, double d) :
36  viscosity_parameter(v),
37  density_parameter(d)
38  {}
39 
40  bool operator==(const TLMixRecord& other) const {
41  return this->viscosity_parameter == other.viscosity_parameter &&
42  this->density_parameter == other.density_parameter;
43  }
44 
45  template<class Serializer>
46  void serializeOp(Serializer& serializer)
47  {
48  serializer(viscosity_parameter);
49  serializer(density_parameter);
50  }
51 };
52 
53 class TLMixpar
54 {
55 public:
56  TLMixpar() = default;
57  explicit TLMixpar(const Deck& deck);
58  static TLMixpar serializationTestObject();
59  std::size_t size() const;
60  bool empty() const;
61  const TLMixRecord& operator[](const std::size_t index) const;
62 
63  bool operator==(const TLMixpar& other) const {
64  return this->data == other.data;
65  }
66 
67  template<class Serializer>
68  void serializeOp(Serializer& serializer)
69  {
70  serializer(data);
71  }
72 
73 private:
74  std::vector<TLMixRecord> data;
75 };
76 
77 }
78 
79 #endif
Definition: TLMixpar.hpp:29
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Definition: TLMixpar.hpp:53
Definition: Deck.hpp:46
Class for (de-)serializing.
Definition: Serializer.hpp:94