opm-common
FIPConfig.hpp
1 /*
2  Copyright 2023 SINTEF Digital
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_FIP_CONFIG_HPP
21 #define OPM_FIP_CONFIG_HPP
22 
23 #include <bitset>
24 
25 namespace Opm {
26 
27 class Deck;
28 class DeckKeyword;
29 class RPTConfig;
30 
32 class FIPConfig {
33 public:
35  enum class OutputField {
36  FIELD = 0,
37  FIPNUM = 1,
38  FIP = 2,
39  FOAM_FIELD = 3,
40  FOAM_REGION = 4,
41  POLYMER_FIELD = 5,
42  POLYMER_REGION = 6,
43  RESV = 7,
44  SOLVENT_FIELD = 8,
45  SOLVENT_REGION = 9,
46  TEMPERATURE_FIELD = 10,
47  TEMPERATURE_REGION = 11,
48  SURF_FIELD = 12,
49  SURF_REGION = 13,
50  TRACER_FIELD = 14,
51  TRACER_REGION = 15,
52  VE = 16,
53  NUM_FIP_REPORT = 17,
54  };
55 
57  FIPConfig() = default;
58 
60  explicit FIPConfig(const Deck& deck);
61 
63  explicit FIPConfig(const DeckKeyword& keyword);
64 
66  explicit FIPConfig(const RPTConfig& rptConfig);
67 
70 
72  template<class Serializer>
73  void serializeOp(Serializer& serializer)
74  {
75  serializer(m_flags);
76  }
77 
79  bool output(OutputField field) const;
80 
82  bool operator==(const FIPConfig& rhs) const;
83 
84 private:
86  void parseRPT(const RPTConfig& rptConfig);
87 
89  std::bitset<static_cast<int>(OutputField::NUM_FIP_REPORT)> m_flags = {};
90 };
91 
92 } //namespace Opm
93 
94 #endif
bool operator==(const FIPConfig &rhs) const
Comparison operator.
Definition: FIPConfig.cpp:108
Number of configuration flags.
VE (oil, water, gas) zone report.
OutputField
Enumeration of FIP report outputs.
Definition: FIPConfig.hpp:35
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Class holding FIP configuration from RPTSOL/RPTSCHED keyword.
Definition: FIPConfig.hpp:32
void serializeOp(Serializer &serializer)
(De-)serialization handler.
Definition: FIPConfig.hpp:73
Configuration manager for RPTSCHED and RPTSOL keywords.
Definition: RPTConfig.hpp:39
static FIPConfig serializationTestObject()
Returns a test object used for serialization tests.
Definition: FIPConfig.cpp:93
FIPConfig()=default
Default constructor.
Definition: Deck.hpp:46
Class for (de-)serializing.
Definition: Serializer.hpp:94
bool output(OutputField field) const
Query if FIP output is enabled for a given field.
Definition: FIPConfig.cpp:103
Definition: DeckKeyword.hpp:36