opm-grid
Toggle main menu visibility
Loading...
Searching...
No Matches
entitypointer.hh
1
// -*- mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2
// vi: set et ts=2 sw=2 sts=2:
3
#ifndef DUNE_POLYHEDRALGRID_ENTITYPOINTER_HH
4
#define DUNE_POLYHEDRALGRID_ENTITYPOINTER_HH
5
6
//- dune-grid includes
7
#include <dune/grid/common/grid.hh>
8
9
//- dune-metagrid includes
10
#include <opm/grid/polyhedralgrid/declaration.hh>
11
12
namespace
Dune
13
{
14
// PolyhedralGridEntityPointer
15
// -------------------
16
17
template
<
int
codim,
class
Gr
id
>
18
class
PolyhedralGridEntityPointer
19
{
20
typedef
PolyhedralGridEntityPointer< codim, Grid > This;
21
22
protected
:
23
typedef
typename
Grid::Traits Traits;
24
25
public
:
27
static
const
int
dimension
= Grid::dimension;
29
static
const
int
codimension
= codim;
30
32
typedef
typename
Traits::template Codim< codimension >::Entity
Entity
;
33
34
protected
:
35
typedef
typename
Traits::ExtraData ExtraData;
36
37
typedef
typename
Traits::template Codim< codimension > :: EntityImpl EntityImpl;
38
39
public
:
40
explicit
PolyhedralGridEntityPointer ( ExtraData data )
41
: entity_( EntityImpl( data ) )
42
{}
43
44
explicit
PolyhedralGridEntityPointer
(
const
EntityImpl &entity )
45
: entity_( EntityImpl( entity ) )
46
{}
47
48
PolyhedralGridEntityPointer (
const
This &other )
49
: entity_( EntityImpl( other.entityImpl() ) )
50
{}
51
52
const
This &operator= (
const
This &other )
53
{
54
entityImpl() = other.entityImpl();
55
return
*
this
;
56
}
57
59
bool
equals
(
const
This &other )
const
60
{
61
return
entityImpl().equals( other.entityImpl() );
62
}
63
65
Entity
&
dereference
()
const
66
{
67
return
entity_;
68
}
69
70
operator
const
Entity
& ()
const
{
return
entity_; }
71
operator
Entity
& () {
return
entity_; }
72
74
int
level
()
const
{
return
entity_.level(); }
75
76
protected
:
77
EntityImpl &entityImpl ()
const
78
{
79
return
entity_.impl();
80
}
81
82
ExtraData data ()
const
{
return
entityImpl().data(); }
83
84
protected
:
85
mutable
Entity
entity_;
86
};
87
88
}
// namespace Dune
89
90
#endif
// #ifndef DUNE_POLYHEDRALGRID_ENTITYPOINTER_HH
Dune::PolyhedralGridEntityPointer
Definition
entitypointer.hh:19
Dune::PolyhedralGridEntityPointer::equals
bool equals(const This &other) const
check for equality
Definition
entitypointer.hh:59
Dune::PolyhedralGridEntityPointer::level
int level() const
obtain level
Definition
entitypointer.hh:74
Dune::PolyhedralGridEntityPointer::codimension
static const int codimension
world dimension
Definition
entitypointer.hh:29
Dune::PolyhedralGridEntityPointer::dereference
Entity & dereference() const
dereference entity
Definition
entitypointer.hh:65
Dune::PolyhedralGridEntityPointer::Entity
Traits::template Codim< codimension >::Entity Entity
type of entity
Definition
entitypointer.hh:32
Dune::PolyhedralGridEntityPointer::dimension
static const int dimension
grid dimension
Definition
entitypointer.hh:27
Dune
The namespace Dune is the main namespace for all Dune code.
Definition
CartesianIndexMapper.hpp:10
opm
grid
polyhedralgrid
entitypointer.hh
Generated by
1.17.0