27 #ifndef EWOMS_GRID_COMM_HANDLES_HH
28 #define EWOMS_GRID_COMM_HANDLES_HH
30 #include <dune/grid/common/datahandleif.hh>
31 #include <dune/common/version.hh>
39 template <
class FieldType,
class Container,
class EntityMapper,
int commCodim>
41 :
public Dune::CommDataHandleIF<GridCommHandleSum<FieldType, Container,
42 EntityMapper, commCodim>,
47 : mapper_(mapper), container_(container)
54 return codim == commCodim;
64 template <
class EntityType>
65 size_t size(
const EntityType &e)
const
71 template <
class MessageBufferImp,
class EntityType>
72 void gather(MessageBufferImp &buff,
const EntityType &e)
const
74 #if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
75 int dofIdx = mapper_.index(e);
77 int dofIdx = mapper_.map(e);
79 buff.write(container_[dofIdx]);
82 template <
class MessageBufferImp,
class EntityType>
83 void scatter(MessageBufferImp &buff,
const EntityType &e,
size_t n)
85 #if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
86 int dofIdx = mapper_.index(e);
88 int dofIdx = mapper_.map(e);
93 container_[dofIdx] += tmp;
97 const EntityMapper &mapper_;
98 Container &container_;
106 template <
class FieldType,
class Container,
class EntityMapper,
int commCodim>
108 :
public Dune::CommDataHandleIF<GridCommHandleGhostSync<FieldType, Container,
109 EntityMapper, commCodim>,
114 : mapper_(mapper), container_(container)
122 return codim == commCodim;
132 template <
class EntityType>
133 size_t size(
const EntityType &e)
const
139 template <
class MessageBufferImp,
class EntityType>
140 void gather(MessageBufferImp &buff,
const EntityType &e)
const
142 #if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
143 int dofIdx = mapper_.index(e);
145 int dofIdx = mapper_.map(e);
147 buff.write(container_[dofIdx]);
150 template <
class MessageBufferImp,
class EntityType>
151 void scatter(MessageBufferImp &buff,
const EntityType &e,
size_t n)
153 #if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
154 int dofIdx = mapper_.index(e);
156 int dofIdx = mapper_.map(e);
158 buff.read(container_[dofIdx]);
162 const EntityMapper &mapper_;
163 Container &container_;
170 template <
class FieldType,
class Container,
class EntityMapper,
int commCodim>
172 :
public Dune::CommDataHandleIF<GridCommHandleMax<FieldType, Container,
173 EntityMapper, commCodim>,
178 : mapper_(mapper), container_(container)
185 return codim == commCodim;
195 template <
class EntityType>
196 size_t size(
const EntityType &e)
const
202 template <
class MessageBufferImp,
class EntityType>
203 void gather(MessageBufferImp &buff,
const EntityType &e)
const
205 #if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
206 int dofIdx = mapper_.index(e);
208 int dofIdx = mapper_.map(e);
210 buff.write(container_[dofIdx]);
213 template <
class MessageBufferImp,
class EntityType>
214 void scatter(MessageBufferImp &buff,
const EntityType &e,
size_t n)
216 #if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
217 int dofIdx = mapper_.index(e);
219 int dofIdx = mapper_.map(e);
223 container_[dofIdx] = std::max(container_[dofIdx], tmp);
227 const EntityMapper &mapper_;
228 Container &container_;
235 template <
class FieldType,
class Container,
class EntityMapper,
int commCodim>
237 :
public Dune::CommDataHandleIF<GridCommHandleMin<FieldType, Container,
238 EntityMapper, commCodim>,
243 : mapper_(mapper), container_(container)
250 return codim == commCodim;
260 template <
class EntityType>
261 size_t size(
const EntityType &e)
const
267 template <
class MessageBufferImp,
class EntityType>
268 void gather(MessageBufferImp &buff,
const EntityType &e)
const
270 #if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
271 int dofIdx = mapper_.index(e);
273 int dofIdx = mapper_.map(e);
275 buff.write(container_[dofIdx]);
278 template <
class MessageBufferImp,
class EntityType>
279 void scatter(MessageBufferImp &buff,
const EntityType &e,
size_t n)
281 #if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
282 int dofIdx = mapper_.index(e);
284 int dofIdx = mapper_.map(e);
288 container_[dofIdx] = std::min(container_[dofIdx], tmp);
292 const EntityMapper &mapper_;
293 Container &container_;
void gather(MessageBufferImp &buff, const EntityType &e) const
Definition: gridcommhandles.hh:140
GridCommHandleSum(Container &container, const EntityMapper &mapper)
Definition: gridcommhandles.hh:46
void gather(MessageBufferImp &buff, const EntityType &e) const
Definition: gridcommhandles.hh:268
void gather(MessageBufferImp &buff, const EntityType &e) const
Definition: gridcommhandles.hh:72
Data handle for parallel communication which can be used to set the values values of ghost and overla...
Definition: gridcommhandles.hh:107
GridCommHandleGhostSync(Container &container, const EntityMapper &mapper)
Definition: gridcommhandles.hh:113
void gather(MessageBufferImp &buff, const EntityType &e) const
Definition: gridcommhandles.hh:203
Provides data handle for parallel communication which takes the minimum of all values that are attach...
Definition: gridcommhandles.hh:236
size_t size(const EntityType &e) const
Definition: gridcommhandles.hh:261
bool fixedsize(int dim, int codim) const
Definition: gridcommhandles.hh:57
void scatter(MessageBufferImp &buff, const EntityType &e, size_t n)
Definition: gridcommhandles.hh:151
Definition: baseauxiliarymodule.hh:35
bool fixedsize(int dim, int codim) const
Definition: gridcommhandles.hh:188
size_t size(const EntityType &e) const
Definition: gridcommhandles.hh:65
void scatter(MessageBufferImp &buff, const EntityType &e, size_t n)
Definition: gridcommhandles.hh:83
GridCommHandleMax(Container &container, const EntityMapper &mapper)
Definition: gridcommhandles.hh:177
Data handle for parallel communication which takes the maximum of all values that are attached to DOF...
Definition: gridcommhandles.hh:171
GridCommHandleMin(Container &container, const EntityMapper &mapper)
Definition: gridcommhandles.hh:242
void scatter(MessageBufferImp &buff, const EntityType &e, size_t n)
Definition: gridcommhandles.hh:214
bool contains(int dim, int codim) const
Definition: gridcommhandles.hh:246
size_t size(const EntityType &e) const
Definition: gridcommhandles.hh:196
bool fixedsize(int dim, int codim) const
Definition: gridcommhandles.hh:253
size_t size(const EntityType &e) const
Definition: gridcommhandles.hh:133
void scatter(MessageBufferImp &buff, const EntityType &e, size_t n)
Definition: gridcommhandles.hh:279
bool contains(int dim, int codim) const
Definition: gridcommhandles.hh:118
Data handle for parallel communication which sums up all values are attached to DOFs.
Definition: gridcommhandles.hh:40
bool contains(int dim, int codim) const
Definition: gridcommhandles.hh:181
bool contains(int dim, int codim) const
Definition: gridcommhandles.hh:50
bool fixedsize(int dim, int codim) const
Definition: gridcommhandles.hh:125