RegionCache.hpp
1 /*
2  Copyright 2016 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 OPM_REGION_CACHE_HPP
21 #define OPM_REGION_CACHE_HPP
22 
23 #include <vector>
24 
25 namespace Opm {
26  class EclipseState;
27  class EclipseGrid;
28 
29 namespace out {
30  class RegionCache {
31  public:
32  RegionCache() = default;
33  RegionCache(const EclipseState& state, const EclipseGrid& grid);
34  const std::vector<size_t>& cells( int region_id ) const;
35  const std::vector<std::pair<std::string,size_t>>& completions( int region_id ) const;
36 
37  private:
38  std::vector<size_t> cells_empty;
39  std::vector<std::pair<std::string,size_t>> completions_empty;
40 
41  std::map<int , std::vector<size_t> > cell_map;
42  std::map<int , std::vector<std::pair<std::string,size_t>>> completion_map;
43  };
44 }
45 }
46 
47 #endif
Definition: Cells.hpp:28
Definition: RegionCache.hpp:30