opm-grid
PartitionTypeIndicator.hpp
1 //===========================================================================
2 //
3 // File: PartitionTypeIndicator.hpp
4 //
5 // Created: Oct 20 2013
6 //
7 // Author(s): Markus Blatt <markus@dr-blatt.de>
8 //
9 // $Date$
10 //
11 // $Revision$
12 //
13 //===========================================================================
14 
15 /*
16 Copyright 2013 Dr. Blatt - HPC-Simulation-Software & Service
17 Copyright 2013 Statoil ASA.
18 
19 This file is part of The Open Porous Media project (OPM).
20 
21 OPM is free software: you can redistribute it and/or modify
22 it under the terms of the GNU General Public License as published by
23 the Free Software Foundation, either version 3 of the License, or
24 (at your option) any later version.
25 
26 OPM is distributed in the hope that it will be useful,
27 but WITHOUT ANY WARRANTY; without even the implied warranty of
28 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 GNU General Public License for more details.
30 
31 You should have received a copy of the GNU General Public License
32 along with OPM. If not, see <http://www.gnu.org/licenses/>.
33 */
34 
35 #ifndef OPM_PARTITIONTYPEINDICATOR_HEADER
36 #define OPM_PARTITIONTYPEINDICATOR_HEADER
37 
38 #include<vector>
39 #include <dune/grid/common/gridenums.hh>
40 
41 namespace Dune
42 {
43 namespace cpgrid
44 {
45 class CpGridData;
46 template<int> class Entity;
47 template<int> class EntityRep;
48 
50 {
51 public:
54  explicit PartitionTypeIndicator(const CpGridData& data)
55  : grid_data_(&data)
56  {}
62  PartitionType getPartitionType(const Entity<0>& cell_entity) const;
66  PartitionType getPartitionType(const EntityRep<1>& face_entity) const;
70  PartitionType getPartitionType(const EntityRep<3>& point_entity) const;
71 
72 private:
76  PartitionType getFacePartitionType(int i) const;
77 
81  PartitionType getPointPartitionType(int i) const;
82 
84  const CpGridData* grid_data_;
89  std::vector<char> cell_indicator_;
94  std::vector<char> point_indicator_;
95  friend class CpGridData;
96  friend class FacePartitionTypeIterator;
97 };
98 } // end namespace Dune
99 } // end namespace cpgrid
100 
101 #endif
PartitionType getPartitionType(const Entity< 0 > &cell_entity) const
Get the partition type of a cell.
Definition: PartitionTypeIndicator.cpp:12
The namespace Dune is the main namespace for all Dune code.
Definition: CartesianIndexMapper.hpp:9
Struct that hods all the data needed to represent a Cpgrid.
Definition: CpGridData.hpp:117
Definition: PartitionTypeIndicator.hpp:49
PartitionTypeIndicator(const CpGridData &data)
Constructor.
Definition: PartitionTypeIndicator.hpp:54
Represents an entity of a given codim, with positive or negative orientation.
Definition: CpGridData.hpp:96