opm-common
TransMult.hpp
1 /*
2  Copyright 2014 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 
29 #ifndef OPM_PARSER_TRANSMULT_HPP
30 #define OPM_PARSER_TRANSMULT_HPP
31 
32 
33 #include <cstddef>
34 #include <map>
35 #include <memory>
36 
37 #include <opm/input/eclipse/EclipseState/Grid/FaceDir.hpp>
38 #include <opm/input/eclipse/EclipseState/Grid/MULTREGTScanner.hpp>
39 
40 namespace Opm {
41  namespace data {
42  class Solution;
43  }
44 
45  template< typename > class GridProperty;
46  class Fault;
47  class FaultCollection;
48  class DeckKeyword;
49  class FieldPropsManager;
50  class Deck;
51 
52  class TransMult {
53 
54  public:
55  TransMult() = default;
56  TransMult(const GridDims& dims, const Deck& deck, const FieldPropsManager& fp);
57 
58  static TransMult serializationTestObject();
59 
60  double getMultiplier(size_t globalIndex, FaceDir::DirEnum faceDir) const;
61  double getMultiplier(size_t i , size_t j , size_t k, FaceDir::DirEnum faceDir) const;
62  double getRegionMultiplier( size_t globalCellIndex1, size_t globalCellIndex2, FaceDir::DirEnum faceDir) const;
63  double getRegionMultiplierNNC(std::size_t globalCellIndex1, std::size_t globalCellIndex2) const;
64  void applyMULT(const std::vector<double>& srcMultProp, FaceDir::DirEnum faceDir);
65  void applyMULTFLT(const FaultCollection& faults);
66  void applyMULTFLT(const Fault& fault);
67  void applyNumericalAquifer(const std::vector<std::size_t>& aquifer_cells);
68 
74  data::Solution convertToSimProps(std::size_t active_cells,
75  bool include_all_multminus) const;
76 
77  bool operator==(const TransMult& data) const;
78 
79  template<class Serializer>
80  void serializeOp(Serializer& serializer)
81  {
82  serializer(m_nx);
83  serializer(m_ny);
84  serializer(m_nz);
85  serializer(m_trans);
86  serializer(m_names);
87  serializer(m_multregtScanner);
88  }
89 
90  private:
91  size_t getGlobalIndex(size_t i , size_t j , size_t k) const;
92  void assertIJK(size_t i , size_t j , size_t k) const;
93  double getMultiplier__(size_t globalIndex , FaceDir::DirEnum faceDir) const;
94  bool hasDirectionProperty(FaceDir::DirEnum faceDir) const;
95  std::vector<double>& getDirectionProperty(FaceDir::DirEnum faceDir);
96 
97  size_t m_nx = 0, m_ny = 0, m_nz = 0;
98  std::map<FaceDir::DirEnum , std::vector<double> > m_trans;
99  std::map<FaceDir::DirEnum , std::string> m_names;
100  MULTREGTScanner m_multregtScanner;
101  };
102 
103 }
104 
105 #endif // OPM_PARSER_TRANSMULT_HPP
Definition: MULTREGTScanner.hpp:89
Definition: Solution.hpp:34
Definition: TransMult.hpp:45
data::Solution convertToSimProps(std::size_t active_cells, bool include_all_multminus) const
Creates a solution object with all multipliers for output.
Definition: TransMult.cpp:170
Definition: FieldPropsManager.hpp:42
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Definition: TransMult.hpp:52
Definition: Fault.hpp:33
Definition: GridDims.hpp:30
Definition: FaultCollection.hpp:35
Definition: Deck.hpp:46
Class for (de-)serializing.
Definition: Serializer.hpp:94
Definition: DeckKeyword.hpp:36