My Project
Loading...
Searching...
No Matches
BoxManager.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
20#ifndef BOXMANAGER_HPP_
21#define BOXMANAGER_HPP_
22
23#include <opm/input/eclipse/EclipseState/Grid/Box.hpp>
24#include <opm/input/eclipse/EclipseState/Grid/GridDims.hpp>
25
26#include <memory>
27#include <vector>
28
29/*
30 This class implements a simple book keeping system for the current
31 input box. In general there are three different input boxes which
32 are relevant:
33
34 1. The global box give by the complete dimensions of the grid.
35
36 2. The input box given explicitly by the BOX keyword. That BOX will
37 apply to all following FIELD properties, and it will continue
38 to apply until either:
39
40 - ENDBOX
41 - A new BOX
42 - End of current section
43
44 is encountered.
45
46 3. Some keywords allow for a Box which applies only to the elements
47 of that keyword.
48
49*/
50
51
52namespace Opm {
53
55 {
56 public:
57 explicit BoxManager(const GridDims& gridDims,
58 Box::IsActive isActive,
59 Box::ActiveIdx activeIdx);
60
61 void setInputBox( int i1,int i2 , int j1 , int j2 , int k1 , int k2);
62 void setKeywordBox( int i1,int i2 , int j1 , int j2 , int k1 , int k2);
63
64 void endSection();
65 void endInputBox();
66 void endKeyword();
67
68 const Box& getActiveBox() const;
69 const std::vector<Box::cell_index>& index_list() const;
70
71 private:
72 GridDims gridDims_{};
73 Box::IsActive isActive_{};
74 Box::ActiveIdx activeIdx_{};
75
76 std::unique_ptr<Box> m_globalBox;
77 std::unique_ptr<Box> m_inputBox;
78 std::unique_ptr<Box> m_keywordBox;
79
80 std::unique_ptr<Box>
81 makeBox(const int i1, const int i2,
82 const int j1, const int j2,
83 const int k1, const int k2) const;
84 };
85}
86
87
88#endif // BOXMANAGER_HPP_
Definition BoxManager.hpp:55
Definition Box.hpp:37
Definition GridDims.hpp:31
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30