opm-common
EndpointScaling.hpp
1 /*
2  Copyright 2017 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 it under the terms
7  of the GNU General Public License as published by the Free Software
8  Foundation, either version 3 of the License, or (at your option) any later
9  version.
10 
11  OPM is distributed in the hope that it will be useful, but WITHOUT ANY
12  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13  A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License along with
16  OPM. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef OPM_ENDPOINTSCALING_HPP
20 #define OPM_ENDPOINTSCALING_HPP
21 
22 #include <bitset>
23 
24 namespace Opm {
25 class Deck;
26 
27 
29  public:
30  EndpointScaling() noexcept = default;
31  explicit EndpointScaling( const Deck& );
32 
33  static EndpointScaling serializationTestObject();
34 
35  /* true if endpoint scaling is enabled, otherwise false */
36  operator bool() const noexcept;
37 
38  bool directional() const noexcept;
39  bool nondirectional() const noexcept;
40  bool reversible() const noexcept;
41  bool irreversible() const noexcept;
42  bool twopoint() const noexcept;
43  bool threepoint() const noexcept;
44 
45  bool operator==(const EndpointScaling& data) const;
46 
47  template<class Serializer>
48  void serializeOp(Serializer& serializer)
49  {
50  serializer(options);
51  }
52 
53  private:
54  enum class option {
55  any = 0,
56  directional = 1,
57  reversible = 2,
58  threepoint = 3,
59  };
60 
61  using ue = std::underlying_type< option >::type;
62  std::bitset< 4 > options;
63 };
64 }
65 
66 #endif
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Definition: Deck.hpp:46
Definition: EndpointScaling.hpp:28
Class for (de-)serializing.
Definition: Serializer.hpp:94