My Project
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
40namespace Opm {
41 template< typename > class GridProperty;
42 class Fault;
43 class FaultCollection;
44 class DeckKeyword;
46 class Deck;
47
48 class TransMult {
49
50 public:
51 TransMult() = default;
52 TransMult(const GridDims& dims, const Deck& deck, const FieldPropsManager& fp);
53
54 static TransMult serializationTestObject();
55
56 double getMultiplier(size_t globalIndex, FaceDir::DirEnum faceDir) const;
57 double getMultiplier(size_t i , size_t j , size_t k, FaceDir::DirEnum faceDir) const;
58 double getRegionMultiplier( size_t globalCellIndex1, size_t globalCellIndex2, FaceDir::DirEnum faceDir) const;
59 void applyMULT(const std::vector<double>& srcMultProp, FaceDir::DirEnum faceDir);
60 void applyMULTFLT(const FaultCollection& faults);
61 void applyMULTFLT(const Fault& fault);
62
63 bool operator==(const TransMult& data) const;
64
65 template<class Serializer>
66 void serializeOp(Serializer& serializer)
67 {
68 serializer(m_nx);
69 serializer(m_ny);
70 serializer(m_nz);
71 serializer(m_trans);
72 serializer(m_names);
73 serializer(m_multregtScanner);
74 }
75
76 private:
77 size_t getGlobalIndex(size_t i , size_t j , size_t k) const;
78 void assertIJK(size_t i , size_t j , size_t k) const;
79 double getMultiplier__(size_t globalIndex , FaceDir::DirEnum faceDir) const;
80 bool hasDirectionProperty(FaceDir::DirEnum faceDir) const;
81 std::vector<double>& getDirectionProperty(FaceDir::DirEnum faceDir);
82
83 size_t m_nx = 0, m_ny = 0, m_nz = 0;
84 std::map<FaceDir::DirEnum , std::vector<double> > m_trans;
85 std::map<FaceDir::DirEnum , std::string> m_names;
86 MULTREGTScanner m_multregtScanner;
87 };
88
89}
90
91#endif // OPM_PARSER_TRANSMULT_HPP
Definition: DeckKeyword.hpp:36
Definition: Deck.hpp:49
Definition: FaultCollection.hpp:35
Definition: Fault.hpp:33
Definition: FieldPropsManager.hpp:41
Definition: GridDims.hpp:31
Definition: TransMult.hpp:41
Definition: MULTREGTScanner.hpp:84
Class for (de-)serializing.
Definition: Serializer.hpp:84
Definition: TransMult.hpp:48
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30