17 #ifndef __deal2__block_sparse_matrix_ez_h 18 #define __deal2__block_sparse_matrix_ez_h 23 #include <deal.II/base/config.h> 25 #include <deal.II/base/subscriptor.h> 26 #include <deal.II/base/table.h> 27 #include <deal.II/base/smartpointer.h> 28 #include <deal.II/lac/block_indices.h> 29 #include <deal.II/lac/sparse_matrix_ez.h> 51 template<
typename Number>
75 const unsigned int block_cols);
157 block (
const unsigned int row,
158 const unsigned int column);
167 block (
const unsigned int row,
168 const unsigned int column)
const;
202 size_type
n_rows ()
const;
212 size_type
n_cols ()
const;
220 size_type
m ()
const;
228 size_type
n ()
const;
239 void set (
const size_type i,
252 void add (
const size_type i,
const size_type j,
261 template <
typename somenumber>
273 template <
typename somenumber>
283 template <
typename somenumber>
295 template <
typename somenumber>
309 template <
class STREAM>
339 template <
typename Number>
349 template <
typename Number>
359 template <
typename Number>
369 template <
typename Number>
379 template <
typename Number>
383 const unsigned int column)
388 return blocks[row][column];
393 template <
typename Number>
397 const unsigned int column)
const 402 return blocks[row][column];
407 template <
typename Number>
417 template <
typename Number>
427 template <
typename Number>
437 const std::pair<size_type,size_type>
440 block(row_index.first,col_index.first).set (row_index.second,
447 template <
typename Number>
457 const std::pair<unsigned int,size_type>
460 block(row_index.first,col_index.first).add (row_index.second,
466 template <
typename Number>
467 template <
typename somenumber>
487 template <
typename Number>
488 template <
typename somenumber>
508 template <
typename Number>
509 template <
typename somenumber>
530 template <
typename Number>
531 template <
typename somenumber>
549 template <
typename number>
550 template <
class STREAM>
558 std::vector<size_type> used_by_line_total;
563 std::vector<size_type> used_by_line;
568 used_by_line.clear();
569 out <<
"block:\t" << i <<
'\t' << j << std::endl;
570 block(i,j).compute_statistics (used, allocated, reserved,
573 out <<
"used:" << used << std::endl
574 <<
"allocated:" << allocated << std::endl
575 <<
"reserved:" << reserved << std::endl;
578 allocated_total += allocated;
579 reserved_total += reserved;
583 used_by_line_total.resize(used_by_line.size());
584 for (
size_type i=0; i< used_by_line.size(); ++i)
585 if (used_by_line[i] != 0)
587 out <<
"row-entries\t" << i
588 <<
"\trows\t" << used_by_line[i]
590 used_by_line_total[i] += used_by_line[i];
594 out <<
"Total" << std::endl
595 <<
"used:" << used_total << std::endl
596 <<
"allocated:" << allocated_total << std::endl
597 <<
"reserved:" << reserved_total << std::endl;
598 for (
size_type i=0; i< used_by_line_total.size(); ++i)
599 if (used_by_line_total[i] != 0)
601 out <<
"row-entries\t" << i
602 <<
"\trows\t" << used_by_line_total[i]
608 DEAL_II_NAMESPACE_CLOSE
610 #endif //__deal2__block_sparse_matrix_ez_h
types::global_dof_index size_type
Auxiliary class aiding in the handling of block structures like in BlockVector or FESystem...
Table< 2, SparseMatrixEZ< Number > > blocks
void vmult(BlockVector< somenumber > &dst, const BlockVector< somenumber > &src) const
SparseMatrixEZ< Number > & block(const unsigned int row, const unsigned int column)
unsigned int n_blocks() const
void Tvmult_add(BlockVector< somenumber > &dst, const BlockVector< somenumber > &src) const
bool is_finite(const double x)
unsigned int n_block_rows() const
void add(const size_type i, const size_type j, const Number value)
unsigned int n_block_cols() const
unsigned int global_dof_index
void Tvmult(BlockVector< somenumber > &dst, const BlockVector< somenumber > &src) const
#define Assert(cond, exc)
size_type total_size() const
::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
void vmult_add(BlockVector< somenumber > &dst, const BlockVector< somenumber > &src) const
std::pair< unsigned int, size_type > global_to_local(const size_type i) const
void set(const size_type i, const size_type j, const Number value)
::ExceptionBase & ExcNumberNotFinite()
BlockIndices column_indices
BlockSparseMatrixEZ & operator=(const BlockSparseMatrixEZ< Number > &)
void print_statistics(STREAM &s, bool full=false)
unsigned int size() const
::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
void reinit(const unsigned int n_block_rows, const unsigned int n_block_cols)
BlockType & block(const unsigned int i)