WelopenWrapper.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014 by Andreas Lauser
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 #ifndef OPM_PARSER_WELOPEN_WRAPPER_HPP
20 #define OPM_PARSER_WELOPEN_WRAPPER_HPP
21 
23 
24 #include <vector>
25 #include <algorithm>
26 
27 namespace Opm {
29  public:
35  : m_keyword(keyword)
36  {
37  }
38 
42  int numWells() const
43  { return m_keyword->size(); }
44 
48  std::string wellName(int wellIdx) const
49  { return m_keyword->getRecord(wellIdx)->getItem(0)->getString(0); }
50 
63  std::string wellStatus(int wellIdx) const
64  { return m_keyword->getRecord(wellIdx)->getItem(1)->getString(0); }
65 
69  int coordinateI(int wellIdx) const
70  { return m_keyword->getRecord(wellIdx)->getItem(2)->getInt(0); }
71 
75  int coordinateJ(int wellIdx) const
76  { return m_keyword->getRecord(wellIdx)->getItem(3)->getInt(0); }
77 
81  int coordinateK(int wellIdx) const
82  { return m_keyword->getRecord(wellIdx)->getItem(4)->getInt(0); }
83 
88  int firstCompletionNumber(int wellIdx) const
89  { return m_keyword->getRecord(wellIdx)->getItem(5)->getInt(0); }
90 
95  int lastCompletionNumber(int wellIdx) const
96  { return m_keyword->getRecord(wellIdx)->getItem(6)->getInt(0); }
97 
98  private:
99  Opm::DeckKeywordConstPtr m_keyword;
100  };
101 }
102 
103 #endif // OPM_PARSER_WELOPEN_WRAPPER_HPP
104 
int coordinateJ(int wellIdx) const
Return the J-coordinate of the connection grid block.
Definition: WelopenWrapper.hpp:75
Definition: Deck.hpp:29
std::shared_ptr< const DeckKeyword > DeckKeywordConstPtr
Definition: DeckKeyword.hpp:71
int coordinateI(int wellIdx) const
Return the I-coordinate of the connection grid block.
Definition: WelopenWrapper.hpp:69
WelopenWrapper(Opm::DeckKeywordConstPtr keyword)
A wrapper class to provide convenient access to the data of the 'WELOPEN' keyword.
Definition: WelopenWrapper.hpp:34
int lastCompletionNumber(int wellIdx) const
Return the index of the last well completion for which this data applies.
Definition: WelopenWrapper.hpp:95
std::string wellName(int wellIdx) const
Return the human-readable name of the well with a given index.
Definition: WelopenWrapper.hpp:48
int firstCompletionNumber(int wellIdx) const
Return the index of the first well completion for which this data applies.
Definition: WelopenWrapper.hpp:88
int coordinateK(int wellIdx) const
Return the K-coordinate of the connection grid block.
Definition: WelopenWrapper.hpp:81
Definition: WelopenWrapper.hpp:28
int numWells() const
Return the number of injection wells.
Definition: WelopenWrapper.hpp:42
std::string wellStatus(int wellIdx) const
Return whether a well is open or closed.
Definition: WelopenWrapper.hpp:63