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