All Classes Namespaces Files Functions Variables Typedefs Enumerator Pages
BlackoilModelEnums.hpp
1 /*
2  Copyright 2015 SINTEF ICT, Applied Mathematics.
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_BLACKOILMODELENUMS_HEADER_INCLUDED
21 #define OPM_BLACKOILMODELENUMS_HEADER_INCLUDED
22 
23 #include <opm/core/props/BlackoilPhases.hpp>
24 
25 #include <array>
26 #include <vector>
27 
28 namespace Opm
29 {
30 
31  constexpr const auto Water = BlackoilPhases::Aqua;
32  constexpr const auto Oil = BlackoilPhases::Liquid;
33  constexpr const auto Gas = BlackoilPhases::Vapour;
34  constexpr const auto MaxNumPhases = BlackoilPhases::MaxNumPhases;
35 
36  enum PrimalVariables {
37  Sg = 0,
38  RS = 1,
39  RV = 2
40  };
41 
42  enum CanonicalVariablePositions {
43  Pressure = 0,
44  Sw = 1,
45  Xvar = 2,
46  Qs = 3,
47  Bhp = 4,
48  Next // For extension.
49  };
50 
51  struct FIPDataEnums {
52 
53  enum FipId {
54  FIP_AQUA = Opm::Water,
55  FIP_LIQUID = Opm::Oil,
56  FIP_VAPOUR = Opm::Gas,
57  FIP_DISSOLVED_GAS = 3,
58  FIP_VAPORIZED_OIL = 4,
59  FIP_PV = 5, //< Pore volume
60  FIP_WEIGHTED_PRESSURE = 6
61  };
62 
63  static const int fipValues = FIP_WEIGHTED_PRESSURE + 1 ;
64  };
65 
66  class FIPData : public FIPDataEnums
67  {
68  public:
69  typedef std::vector<double> VectorType;
70 
71  using FIPDataEnums :: FipId;
72  using FIPDataEnums :: fipValues ;
73  std::array< VectorType, fipValues> fip;
74 
75  // default constructor
76  FIPData() {}
77 
78  // initialize from array of Eigen vectors (or std::vectors)
79  template <class V>
80  explicit FIPData( const std::array< V, fipValues>& otherFip )
81  {
82  // copy fip vector from V to std::vector
83  for( int i=0; i<fipValues; ++i ) {
84  fip[ i ] = VectorType(otherFip[ i ].data(), otherFip[ i ].data() + otherFip[ i ].size() );
85  }
86  }
87  };
88 
89 } // namespace Opm
90 
91 #endif // OPM_BLACKOILMODELENUMS_HEADER_INCLUDED
Definition: BlackoilModelEnums.hpp:66
Definition: BlackoilModelEnums.hpp:51