dune-grid  2.5.0
gridenums.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_GRIDENUMS_HH
4 #define DUNE_GRIDENUMS_HH
5 
6 #include <iostream>
7 
8 #include <dune/common/exceptions.hh>
9 
10 namespace Dune {
11 
34  };
35 
44  inline std::string PartitionName(PartitionType type)
45  {
46  switch(type) {
47  case InteriorEntity :
48  return "interior";
49  case BorderEntity :
50  return "border";
51  case OverlapEntity :
52  return "overlap";
53  case FrontEntity :
54  return "front";
55  case GhostEntity :
56  return "ghost";
57  default :
58  DUNE_THROW(NotImplemented, "name of unknown partition type requested");
59  }
60  }
61 
63 
70  inline std::ostream &operator<< ( std::ostream &out, const PartitionType &type )
71  {
72  return out << PartitionName( type );
73  }
74 
75 
90  };
91 
92 
94 
101  inline std::ostream &operator<< ( std::ostream &out, const InterfaceType &type )
102  {
103  switch( type )
104  {
106  return out << "interior-border / interior-border interface";
107 
109  return out << "interior-border / all interface";
110 
112  return out << "overlap / overlap-front interface";
113 
114  case Overlap_All_Interface :
115  return out << "overlap / all interface";
116 
117  case All_All_Interface :
118  return out << "all / all interface";
119 
120  default :
121  return out << "unknown interface";
122  }
123  }
124 
125 
141  };
142 
143 
145 
152  inline std::ostream &operator<< ( std::ostream &out, const PartitionIteratorType &type )
153  {
154  static std::string name[ 6 ] = { "interior partition", "interior-border partition", "overlap partition",
155  "overlap-front partition", "all partition", "ghost partition" };
156  return out << name[ type ];
157  }
158 
159 
171  };
172 
178 }
179 #endif
only interior entities
Definition: gridenums.hh:135
all entities lying in the overlap zone
Definition: gridenums.hh:31
ghost entities
Definition: gridenums.hh:33
send overlap, receive all entities
Definition: gridenums.hh:88
std::ostream & operator<<(std::ostream &out, const PartitionType &type)
write a PartitionType to a stream
Definition: gridenums.hh:70
PartitionType
Attributes used in the generic overlap model.
Definition: gridenums.hh:28
PartitionIteratorType
Parameter to be used for the parallel level- and leaf iterators.
Definition: gridenums.hh:134
CommunicationDirection
Define a type for communication direction parameter.
Definition: gridenums.hh:168
on boundary between interior and overlap
Definition: gridenums.hh:30
send all and receive all entities
Definition: gridenums.hh:89
send/receive interior and border entities
Definition: gridenums.hh:85
reverse communication direction
Definition: gridenums.hh:170
interior, border, overlap and front entities
Definition: gridenums.hh:138
send interior and border, receive all entities
Definition: gridenums.hh:86
interior and border entities
Definition: gridenums.hh:136
interior, border, and overlap entities
Definition: gridenums.hh:137
all entities
Definition: gridenums.hh:139
on boundary between overlap and ghost
Definition: gridenums.hh:32
communicate as given in InterfaceType
Definition: gridenums.hh:169
Include standard header files.
Definition: agrid.hh:59
only ghost entities
Definition: gridenums.hh:140
all interior entities
Definition: gridenums.hh:29
send overlap, receive overlap and front entities
Definition: gridenums.hh:87
InterfaceType
Parameter to be used for the communication functions.
Definition: gridenums.hh:84
std::string PartitionName(PartitionType type)
Provide names for the partition types.
Definition: gridenums.hh:44