dune-grid
2.3.1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
dune
grid
utility
entitycommhelper.hh
Go to the documentation of this file.
1
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2
// vi: set et ts=4 sw=2 sts=2:
3
#ifndef DUNE_ENTITYCOMMHELPER_HH
4
#define DUNE_ENTITYCOMMHELPER_HH
5
6
#include <
dune/grid/common/gridenums.hh
>
7
#include <dune/common/unused.hh>
8
9
namespace
Dune
10
{
11
12
template
< InterfaceType iftype >
13
struct
EntityCommHelper;
14
15
16
template
<>
17
struct
EntityCommHelper<
InteriorBorder_InteriorBorder_Interface
>
18
{
19
static
bool
send (
const
PartitionType
p )
20
{
21
//return (p == InteriorEntity) || (p == BorderEntity);
22
return
(p ==
BorderEntity
);
23
}
24
25
static
bool
receive (
const
PartitionType
p )
26
{
27
//return (p == InteriorEntity) || (p == BorderEntity);
28
return
(p ==
BorderEntity
);
29
}
30
};
31
32
33
template
<>
34
struct
EntityCommHelper<
InteriorBorder_All_Interface
>
35
{
36
static
bool
send (
const
PartitionType
p )
37
{
38
return
(p ==
InteriorEntity
) || (p ==
BorderEntity
);
39
}
40
41
static
bool
receive (
const
PartitionType
p )
42
{
43
//return true;
44
return
(p !=
InteriorEntity
);
45
}
46
};
47
48
49
template
<>
50
struct
EntityCommHelper<
Overlap_OverlapFront_Interface
>
51
{
52
static
bool
send (
const
PartitionType
p )
53
{
54
//return (p == InteriorEntity) || (p == BorderEntity) || (p == OverlapEntity);
55
return
(p !=
FrontEntity
) && (p !=
GhostEntity
);
56
}
57
58
static
bool
receive (
const
PartitionType
p )
59
{
60
//return (p == InteriorEntity) || (p == BorderEntity) || (p == OverlapEntity) || (p == FrontEntity);
61
return
(p !=
GhostEntity
);
62
}
63
};
64
65
66
template
<>
67
struct
EntityCommHelper<
Overlap_All_Interface
>
68
{
69
static
bool
send (
const
PartitionType
p )
70
{
71
//return (p == InteriorEntity) || (p == BorderEntity) || (p == OverlapEntity);
72
return
(p !=
FrontEntity
) && (p !=
GhostEntity
);
73
}
74
75
static
bool
receive (
const
PartitionType
p )
76
{
77
DUNE_UNUSED_PARAMETER(p);
78
return
true
;
79
}
80
};
81
82
83
template
<>
84
struct
EntityCommHelper<
All_All_Interface
>
85
{
86
static
bool
send (
const
PartitionType
p )
87
{
88
DUNE_UNUSED_PARAMETER(p);
89
return
true
;
90
}
91
92
static
bool
receive (
const
PartitionType
p )
93
{
94
DUNE_UNUSED_PARAMETER(p);
95
return
true
;
96
}
97
};
98
99
}
// namespace Dune
100
101
#endif // #ifndef DUNE_ENTITYCOMMHELPER_HH
Generated on Mon Nov 24 2014 21:02:49 for dune-grid by
1.8.1.2