31 #include <dune/grid/common/datahandleif.hh> 46 template<
class Gr
idView,
class Vector>
48 :
public Dune::CommDataHandleIF<VectorVectorDataHandle<GridView,Vector>,
49 std::decay_t<decltype(std::declval<Vector>()[0][0])>>
54 using DataType = std::decay_t<decltype(std::declval<Vector>()[0][0])>;
60 : data_(data), gridView_(gridView)
63 bool contains(
int ,
int codim)
const 68 bool fixedSize(
int ,
int )
const 73 template<
class EntityType>
74 std::size_t size(
const EntityType )
const 80 template<
class BufferType,
class EntityType>
81 void gather(BufferType& buffer,
const EntityType& e)
const 83 for(
const auto& vec: data_)
85 buffer.write(vec[gridView_.indexSet().index(e)]);
89 template<
class BufferType,
class EntityType>
90 void scatter(BufferType& buffer,
const EntityType& e,
91 [[maybe_unused]] std::size_t n)
93 assert(n == data_.size());
96 buffer.read(vec[gridView_.indexSet().index(e)]);
101 const GridView& gridView_;
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: blackoilbioeffectsmodules.hh:45
VectorVectorDataHandle(Vector &data, const GridView &gridView)
Constructor.
Definition: VectorVectorDataHandle.hpp:59
std::decay_t< decltype(std::declval< Vector >()[0][0])> DataType
the data type we send
Definition: VectorVectorDataHandle.hpp:54
A data handle sending multiple data store in vectors attached to cells.
Definition: VectorVectorDataHandle.hpp:47