opm-common
DirectionalMaterialLawParams.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2022 Equinor 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 */
24 #ifndef OPM_DIRECTIONAL_MATERIAL_LAW_PARAMS_HH
25 #define OPM_DIRECTIONAL_MATERIAL_LAW_PARAMS_HH
26 
27 #include <cstddef>
28 #include <stdexcept>
29 #include <vector>
30 
31 namespace Opm {
32 
33 template <class MaterialLawParams>
35  using vector_type = std::vector<MaterialLawParams>;
37  : materialLawParamsX_{}
38  , materialLawParamsY_{}
39  , materialLawParamsZ_{}
40  {}
41 
42  explicit DirectionalMaterialLawParams(std::size_t size)
43  : materialLawParamsX_(size)
44  , materialLawParamsY_(size)
45  , materialLawParamsZ_(size)
46  {}
47 
48  vector_type& getArray(int index)
49  {
50  switch(index) {
51  case 0:
52  return materialLawParamsX_;
53  case 1:
54  return materialLawParamsY_;
55  case 2:
56  return materialLawParamsZ_;
57  default:
58  throw std::runtime_error("Unexpected mobility array index");
59  }
60  }
61 
62  vector_type materialLawParamsX_;
63  vector_type materialLawParamsY_;
64  vector_type materialLawParamsZ_;
65 };
66 
67 } // namespace Opm
68 
69 #endif
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Definition: DirectionalMaterialLawParams.hpp:34