25#ifndef DUMUX_VERTEX_HANDLES_HH
26#define DUMUX_VERTEX_HANDLES_HH
28#include <dune/grid/common/datahandleif.hh>
38template <
class FieldType,
class Container,
class VertexMapper>
40 :
public Dune::CommDataHandleIF< VertexHandleSum<FieldType, Container, VertexMapper>,
45 const VertexMapper &mapper)
47 , container_(container)
63 template<
class EntityType>
64 size_t size (
const EntityType &e)
const
70 template<
class MessageBufferImp,
class EntityType>
71 void gather(MessageBufferImp &buff,
const EntityType &e)
const
73 int vIdx = mapper_.index(e);
74 buff.write(container_[vIdx]);
77 template<
class MessageBufferImp,
class EntityType>
78 void scatter(MessageBufferImp &buff,
const EntityType &e,
size_t n)
80 int vIdx = mapper_.index(e);
84 container_[vIdx] += tmp;
88 const VertexMapper &mapper_;
89 Container &container_;
96template <
class FieldType,
class Container,
class VertexMapper>
98 :
public Dune::CommDataHandleIF< VertexHandleMax<FieldType, Container, VertexMapper>,
103 const VertexMapper &mapper)
105 , container_(container)
121 template<
class EntityType>
122 size_t size (
const EntityType &e)
const
128 template<
class MessageBufferImp,
class EntityType>
129 void gather(MessageBufferImp &buff,
const EntityType &e)
const
131 int vIdx = mapper_.index(e);
132 buff.write(container_[vIdx]);
135 template<
class MessageBufferImp,
class EntityType>
136 void scatter(MessageBufferImp &buff,
const EntityType &e,
size_t n)
138 int vIdx = mapper_.index(e);
143 container_[vIdx] = max(container_[vIdx], tmp);
147 const VertexMapper &mapper_;
148 Container &container_;
156template <
class FieldType,
class Container,
class VertexMapper>
158 :
public Dune::CommDataHandleIF< VertexHandleMin<FieldType, Container, VertexMapper>,
163 const VertexMapper &mapper)
165 , container_(container)
181 template<
class EntityType>
182 size_t size (
const EntityType &e)
const
188 template<
class MessageBufferImp,
class EntityType>
189 void gather(MessageBufferImp &buff,
const EntityType &e)
const
191 int vIdx = mapper_.index(e);
192 buff.write(container_[vIdx]);
195 template<
class MessageBufferImp,
class EntityType>
196 void scatter(MessageBufferImp &buff,
const EntityType &e,
size_t n)
198 int vIdx = mapper_.index(e);
202 container_[vIdx] = min(container_[vIdx], tmp);
206 const VertexMapper &mapper_;
207 Container &container_;
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
Data handle for parallel communication which sums up all values are attached to vertices.
Definition: vertexhandles.hh:42
size_t size(const EntityType &e) const
Definition: vertexhandles.hh:64
void scatter(MessageBufferImp &buff, const EntityType &e, size_t n)
Definition: vertexhandles.hh:78
bool contains(int dim, int codim) const
Definition: vertexhandles.hh:50
VertexHandleSum(Container &container, const VertexMapper &mapper)
Definition: vertexhandles.hh:44
void gather(MessageBufferImp &buff, const EntityType &e) const
Definition: vertexhandles.hh:71
bool fixedsize(int dim, int codim) const
Definition: vertexhandles.hh:56
Data handle for parallel communication which takes the maximum of all values that are attached to ver...
Definition: vertexhandles.hh:100
VertexHandleMax(Container &container, const VertexMapper &mapper)
Definition: vertexhandles.hh:102
size_t size(const EntityType &e) const
Definition: vertexhandles.hh:122
void gather(MessageBufferImp &buff, const EntityType &e) const
Definition: vertexhandles.hh:129
void scatter(MessageBufferImp &buff, const EntityType &e, size_t n)
Definition: vertexhandles.hh:136
bool fixedsize(int dim, int codim) const
Definition: vertexhandles.hh:114
bool contains(int dim, int codim) const
Definition: vertexhandles.hh:108
Provides data handle for parallel communication which takes the minimum of all values that are attach...
Definition: vertexhandles.hh:160
void gather(MessageBufferImp &buff, const EntityType &e) const
Definition: vertexhandles.hh:189
size_t size(const EntityType &e) const
Definition: vertexhandles.hh:182
void scatter(MessageBufferImp &buff, const EntityType &e, size_t n)
Definition: vertexhandles.hh:196
bool contains(int dim, int codim) const
Definition: vertexhandles.hh:168
VertexHandleMin(Container &container, const VertexMapper &mapper)
Definition: vertexhandles.hh:162
bool fixedsize(int dim, int codim) const
Definition: vertexhandles.hh:174