DUNE PDELab (git)

gridenums.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_GRID_COMMON_GRIDENUMS_HH
6#define DUNE_GRID_COMMON_GRIDENUMS_HH
7
8#include <iostream>
9
11
12namespace Dune {
13
36 };
37
46 inline std::string PartitionName(PartitionType type)
47 {
48 switch(type) {
49 case InteriorEntity :
50 return "interior";
51 case BorderEntity :
52 return "border";
53 case OverlapEntity :
54 return "overlap";
55 case FrontEntity :
56 return "front";
57 case GhostEntity :
58 return "ghost";
59 default :
60 DUNE_THROW(NotImplemented, "name of unknown partition type requested");
61 }
62 }
63
65
72 inline std::ostream &operator<< ( std::ostream &out, const PartitionType &type )
73 {
74 return out << PartitionName( type );
75 }
76
77
92 };
93
94
96
103 inline std::ostream &operator<< ( std::ostream &out, const InterfaceType &type )
104 {
105 switch( type )
106 {
108 return out << "interior-border / interior-border interface";
109
111 return out << "interior-border / all interface";
112
114 return out << "overlap / overlap-front interface";
115
117 return out << "overlap / all interface";
118
119 case All_All_Interface :
120 return out << "all / all interface";
121
122 default :
123 return out << "unknown interface";
124 }
125 }
126
127
143 };
144
145
147
154 inline std::ostream &operator<< ( std::ostream &out, const PartitionIteratorType &type )
155 {
156 static std::string name[ 6 ] = { "interior partition", "interior-border partition", "overlap partition",
157 "overlap-front partition", "all partition", "ghost partition" };
158 return out << name[ type ];
159 }
160
161
173 };
174
180}
181#endif
Default exception for dummy implementations.
Definition: exceptions.hh:263
A few common exception classes.
#define DUNE_THROW(E, m)
Definition: exceptions.hh:218
std::string PartitionName(PartitionType type)
Provide names for the partition types.
Definition: gridenums.hh:46
PartitionIteratorType
Parameter to be used for the parallel level- and leaf iterators.
Definition: gridenums.hh:136
PartitionType
Attributes used in the generic overlap model.
Definition: gridenums.hh:30
CommunicationDirection
Define a type for communication direction parameter.
Definition: gridenums.hh:170
InterfaceType
Parameter to be used for the communication functions.
Definition: gridenums.hh:86
@ All_Partition
all entities
Definition: gridenums.hh:141
@ OverlapFront_Partition
interior, border, overlap and front entities
Definition: gridenums.hh:140
@ Interior_Partition
only interior entities
Definition: gridenums.hh:137
@ InteriorBorder_Partition
interior and border entities
Definition: gridenums.hh:138
@ Overlap_Partition
interior, border, and overlap entities
Definition: gridenums.hh:139
@ Ghost_Partition
only ghost entities
Definition: gridenums.hh:142
@ 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
@ OverlapEntity
all entities lying in the overlap zone
Definition: gridenums.hh:33
@ BackwardCommunication
reverse communication direction
Definition: gridenums.hh:172
@ ForwardCommunication
communicate as given in InterfaceType
Definition: gridenums.hh:171
@ 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 (Nov 12, 23:30, 2024)