BoxManager.hpp
Go to the documentation of this file.
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 
21 #ifndef BOXMANAGER_HPP_
22 #define BOXMANAGER_HPP_
23 
24 #include <vector>
25 #include <memory>
26 
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 
52 namespace Opm {
53 
54  class BoxManager {
55  public:
56  BoxManager(int nx , int ny , int nz);
57 
58  void setInputBox( int i1,int i2 , int j1 , int j2 , int k1 , int k2);
59  void setKeywordBox( int i1,int i2 , int j1 , int j2 , int k1 , int k2);
60 
61  void endSection();
62  void endInputBox();
63  void endKeyword();
64 
65  std::shared_ptr<const Box> getActiveBox() const;
66  std::shared_ptr<const Box> getGlobalBox() const;
67  std::shared_ptr<const Box> getInputBox() const;
68  std::shared_ptr<const Box> getKeywordBox() const;
69 
70  private:
71  std::shared_ptr<const Box> m_globalBox;
72  std::shared_ptr<const Box> m_inputBox;
73  std::shared_ptr<const Box> m_keywordBox;
74  };
75 }
76 
77 
78 #endif
std::shared_ptr< const Box > getKeywordBox() const
BoxManager(int nx, int ny, int nz)
Definition: Deck.hpp:29
void setInputBox(int i1, int i2, int j1, int j2, int k1, int k2)
std::shared_ptr< const Box > getGlobalBox() const
std::shared_ptr< const Box > getActiveBox() const
std::shared_ptr< const Box > getInputBox() const
void setKeywordBox(int i1, int i2, int j1, int j2, int k1, int k2)
Definition: BoxManager.hpp:54