My Project
Loading...
Searching...
No Matches
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/*
16Copyright 2013 Dr. Blatt - HPC-Simulation-Software & Service
17Copyright 2013 Statoil ASA.
18
19This file is part of The Open Porous Media project (OPM).
20
21OPM is free software: you can redistribute it and/or modify
22it under the terms of the GNU General Public License as published by
23the Free Software Foundation, either version 3 of the License, or
24(at your option) any later version.
25
26OPM is distributed in the hope that it will be useful,
27but WITHOUT ANY WARRANTY; without even the implied warranty of
28MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29GNU General Public License for more details.
30
31You should have received a copy of the GNU General Public License
32along 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
41namespace Dune
42{
43namespace cpgrid
44{
45class CpGridData;
46template<int> class Entity;
47template<int> class EntityRep;
48
50{
51public:
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
72private:
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
Struct that hods all the data needed to represent a Cpgrid.
Definition CpGridData.hpp:138
Represents an entity of a given codim, with positive or negative orientation.
Definition EntityRep.hpp:99
Definition Entity.hpp:71
Definition PartitionTypeIndicator.hpp:50
PartitionTypeIndicator(const CpGridData &data)
Constructor.
Definition PartitionTypeIndicator.hpp:54
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:10