13#ifndef dealii_block_indices_h
14#define dealii_block_indices_h
109 reinit(
const std::vector<size_type> &block_sizes);
166 std::pair<unsigned int, size_type>
239 const unsigned int n = bi.size();
243 s << bi.block_size(0);
245 for (
unsigned int i = 1; i < n; ++i)
246 s <<
' ' << bi.block_size(i);
247 s <<
"]->" << bi.total_size();
271 n_blocks =
static_cast<unsigned int>(block_sizes.size());
290 , start_indices(n_blocks + 1)
299 : n_blocks(static_cast<unsigned
int>(block_sizes.
size()))
300 , start_indices(block_sizes.
size() + 1)
308 : n_blocks(b.n_blocks)
309 , start_indices(std::move(b.start_indices))
312 b.start_indices = std::vector<size_type>(1, 0);
326inline std::pair<unsigned int, BlockIndices::size_type>
333 const auto it = std::prev(
381 std::string result =
"[" + std::to_string(
n_blocks) +
"->";
382 for (
unsigned int i = 0; i <
n_blocks; ++i)
388 result +=
"|" + std::to_string(
total_size()) +
']';
416 start_indices = std::move(b.start_indices);
417 n_blocks = b.n_blocks;
419 b.start_indices = std::vector<size_type>(1, 0);
445 std::swap(n_blocks, b.n_blocks);
446 std::swap(start_indices, b.start_indices);
std::string to_string() const
void swap(BlockIndices &u, BlockIndices &v) noexcept
types::global_dof_index size_type
BlockIndices(const BlockIndices &)=default
size_type block_size(const unsigned int i) const
void push_back(const size_type size)
BlockIndices & operator=(const BlockIndices &b)
void swap(BlockIndices &b) noexcept
size_type total_size() const
void reinit(const unsigned int n_blocks, const size_type n_elements_per_block)
std::vector< size_type > start_indices
bool operator==(const BlockIndices &b) const
unsigned int size() const
size_type local_to_global(const unsigned int block, const size_type index) const
size_type block_start(const unsigned int i) const
std::size_t memory_consumption() const
std::pair< unsigned int, size_type > global_to_local(const size_type i) const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
unsigned int global_dof_index