Dune Core Modules (2.10.0)

entitycommhelper.hh
1// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file LICENSE.md in module root
2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
4// vi: set et ts=4 sw=2 sts=2:
5#ifndef DUNE_ENTITYCOMMHELPER_HH
6#define DUNE_ENTITYCOMMHELPER_HH
7
8#include <dune/grid/common/gridenums.hh>
9
10namespace Dune
11{
12
13 template< InterfaceType iftype >
14 struct EntityCommHelper;
15
16
17 template<>
18 struct EntityCommHelper< InteriorBorder_InteriorBorder_Interface >
19 {
20 static bool send ( const PartitionType p )
21 {
22 //return (p == InteriorEntity) || (p == BorderEntity);
23 return (p == BorderEntity);
24 }
25
26 static bool receive ( const PartitionType p )
27 {
28 //return (p == InteriorEntity) || (p == BorderEntity);
29 return (p == BorderEntity);
30 }
31 };
32
33
34 template<>
35 struct EntityCommHelper< InteriorBorder_All_Interface >
36 {
37 static bool send ( const PartitionType p )
38 {
39 return (p == InteriorEntity) || (p == BorderEntity);
40 }
41
42 static bool receive ( const PartitionType p )
43 {
44 //return true;
45 return (p != InteriorEntity);
46 }
47 };
48
49
50 template<>
51 struct EntityCommHelper< Overlap_OverlapFront_Interface >
52 {
53 static bool send ( const PartitionType p )
54 {
55 //return (p == InteriorEntity) || (p == BorderEntity) || (p == OverlapEntity);
56 return (p != FrontEntity) && (p != GhostEntity);
57 }
58
59 static bool receive ( const PartitionType p )
60 {
61 //return (p == InteriorEntity) || (p == BorderEntity) || (p == OverlapEntity) || (p == FrontEntity);
62 return (p != GhostEntity);
63 }
64 };
65
66
67 template<>
68 struct EntityCommHelper< Overlap_All_Interface >
69 {
70 static bool send ( const PartitionType p )
71 {
72 //return (p == InteriorEntity) || (p == BorderEntity) || (p == OverlapEntity);
73 return (p != FrontEntity) && (p != GhostEntity);
74 }
75
76 static bool receive ([[maybe_unused]] const PartitionType p)
77 {
78 return true;
79 }
80 };
81
82
83 template<>
84 struct EntityCommHelper< All_All_Interface >
85 {
86 static bool send ([[maybe_unused]] const PartitionType p)
87 {
88 return true;
89 }
90
91 static bool receive ([[maybe_unused]] const PartitionType p)
92 {
93 return true;
94 }
95 };
96
97} // namespace Dune
98
99#endif // #ifndef DUNE_ENTITYCOMMHELPER_HH
PartitionType
Attributes used in the generic overlap model.
Definition: gridenums.hh:30
@ FrontEntity
on boundary between overlap and ghost
Definition: gridenums.hh:34
@ InteriorEntity
all interior entities
Definition: gridenums.hh:31
@ GhostEntity
ghost entities
Definition: gridenums.hh:35
@ BorderEntity
on boundary between interior and overlap
Definition: gridenums.hh:32
@ InteriorBorder_All_Interface
send interior and border, receive all entities
Definition: gridenums.hh:88
@ All_All_Interface
send all and receive all entities
Definition: gridenums.hh:91
@ Overlap_All_Interface
send overlap, receive all entities
Definition: gridenums.hh:90
@ Overlap_OverlapFront_Interface
send overlap, receive overlap and front entities
Definition: gridenums.hh:89
@ InteriorBorder_InteriorBorder_Interface
send/receive interior and border entities
Definition: gridenums.hh:87
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 28, 23:30, 2024)