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