31 #include <dune/grid/common/datahandleif.hh>
45 template<
class Gr
idView,
class Vector>
47 :
public Dune::CommDataHandleIF<VectorVectorDataHandle<GridView,Vector>,
48 std::decay_t<decltype(Vector()[0][0])>>
53 using DataType = std::decay_t<decltype(Vector()[0][0])>;
59 : data_(data), gridView_(gridView)
62 bool contains(
int ,
int codim)
const
67 #if DUNE_VERSION_LT(DUNE_GRID, 2, 8)
68 bool fixedsize(
int ,
int )
const
74 bool fixedSize(
int ,
int )
const
79 template<
class EntityType>
80 std::size_t size(
const EntityType )
const
86 template<
class BufferType,
class EntityType>
87 void gather(BufferType& buffer,
const EntityType& e)
const
89 for(
const auto& vec: data_)
91 buffer.write(vec[gridView_.indexSet().index(e)]);
95 template<
class BufferType,
class EntityType>
96 void scatter(BufferType& buffer,
const EntityType& e,
97 [[maybe_unused]] std::size_t n)
99 assert(n == data_.size());
100 for(
auto& vec: data_)
102 buffer.read(vec[gridView_.indexSet().index(e)]);
107 const GridView& gridView_;
A data handle sending multiple data store in vectors attached to cells.
Definition: VectorVectorDataHandle.hpp:49
std::decay_t< decltype(Vector()[0][0])> DataType
the data type we send
Definition: VectorVectorDataHandle.hpp:53
VectorVectorDataHandle(Vector &data, const GridView &gridView)
Constructor.
Definition: VectorVectorDataHandle.hpp:58
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: BlackoilPhases.hpp:27