4#ifndef DUNE_FUFEM_HDF5_FROMBUFFER_HH
5#define DUNE_FUFEM_HDF5_FROMBUFFER_HH
13template <
int k,
typename ctype,
typename T>
18 assert(buffer.
size() == entrySize);
19 assert(dimensions[2] == k);
20 data.setSize(dimensions[0], dimensions[1]);
22 auto it = buffer.
begin();
23 for (
auto &&row : data)
24 for (
auto &&localVector : row) {
25 auto const nextIt = it + k;
26 std::copy(it, nextIt, localVector.begin());
29 assert(it == buffer.
end());
32template <
int k,
typename ctype,
typename T>
37 assert(dimensions[1] == k);
38 data.resize(dimensions[0]);
40 auto it = buffer.
begin();
41 for (
auto &&localVector : data) {
42 auto const nextIt = it + k;
43 std::copy(it, nextIt, localVector.begin());
46 assert(it == buffer.
end());
49template <
typename ctype,
typename T>
52 assert(buffer.
size() == dimensions[0]);
53 data.resize(dimensions[0]);
55 auto it = buffer.
begin();
56 for (
auto &&localVector : data)
57 localVector[0] = *(it++);
60template <
typename ctype,
typename T>
63 assert(buffer.
size() == dimensions[0]);
68template <
typename ctype,
typename T>
71 assert(buffer.
size() == 1);
void fromBuffer(std::vector< ctype > const &buffer, std::array< T, 3 > dimensions, Dune::Matrix< Dune::FieldVector< ctype, k > > &data)
Definition frombuffer.hh:14