16 #ifndef dealii__block_sparse_matrix_ez_h 17 #define dealii__block_sparse_matrix_ez_h 22 #include <deal.II/base/config.h> 23 #include <deal.II/base/exceptions.h> 24 #include <deal.II/base/subscriptor.h> 25 #include <deal.II/base/table.h> 26 #include <deal.II/base/smartpointer.h> 27 #include <deal.II/lac/block_indices.h> 28 #include <deal.II/lac/sparse_matrix_ez.h> 30 DEAL_II_NAMESPACE_OPEN
51 template<
typename Number>
70 const unsigned int block_cols);
122 block (
const unsigned int row,
123 const unsigned int column);
131 block (
const unsigned int row,
132 const unsigned int column)
const;
208 template <typename somenumber>
217 template <typename somenumber>
225 template <typename somenumber>
234 template <typename somenumber>
244 template <class StreamType>
270 template <typename Number>
280 template <
typename Number>
290 template <
typename Number>
300 template <
typename Number>
310 template <
typename Number>
314 const unsigned int column)
319 return blocks[row][column];
324 template <
typename Number>
328 const unsigned int column)
const 333 return blocks[row][column];
338 template <
typename Number>
348 template <
typename Number>
358 template <
typename Number>
368 const std::pair<size_type,size_type>
371 block(row_index.first,col_index.first).set (row_index.second,
378 template <
typename Number>
388 const std::pair<unsigned int,size_type>
391 block(row_index.first,col_index.first).add (row_index.second,
397 template <
typename Number>
398 template <
typename somenumber>
418 template <
typename Number>
419 template <
typename somenumber>
439 template <
typename Number>
440 template <
typename somenumber>
461 template <
typename Number>
462 template <
typename somenumber>
480 template <
typename number>
481 template <
class StreamType>
489 std::vector<size_type> used_by_line_total;
494 std::vector<size_type> used_by_line;
499 used_by_line.clear();
500 out <<
"block:\t" << i <<
'\t' << j << std::endl;
501 block(i,j).compute_statistics (used, allocated, reserved,
504 out <<
"used:" << used << std::endl
505 <<
"allocated:" << allocated << std::endl
506 <<
"reserved:" << reserved << std::endl;
509 allocated_total += allocated;
510 reserved_total += reserved;
514 used_by_line_total.resize(used_by_line.size());
515 for (
size_type i=0; i< used_by_line.size(); ++i)
516 if (used_by_line[i] != 0)
518 out <<
"row-entries\t" << i
519 <<
"\trows\t" << used_by_line[i]
521 used_by_line_total[i] += used_by_line[i];
525 out <<
"Total" << std::endl
526 <<
"used:" << used_total << std::endl
527 <<
"allocated:" << allocated_total << std::endl
528 <<
"reserved:" << reserved_total << std::endl;
529 for (
size_type i=0; i< used_by_line_total.size(); ++i)
530 if (used_by_line_total[i] != 0)
532 out <<
"row-entries\t" << i
533 <<
"\trows\t" << used_by_line_total[i]
539 DEAL_II_NAMESPACE_CLOSE
541 #endif //dealii__block_sparse_matrix_ez_h size_type n_rows() const 1
void Tvmult_add(BlockVector< somenumber > &dst, const BlockVector< somenumber > &src) const
types::global_dof_index size_type
Table< 2, SparseMatrixEZ< Number > > blocks
SparseMatrixEZ< Number > & block(const unsigned int row, const unsigned int column)
static ::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
size_type total_size() const
void add(const size_type i, const size_type j, const Number value)
unsigned int n_block_cols() const
size_type n_cols() const 1
unsigned int global_dof_index
void vmult(BlockVector< somenumber > &dst, const BlockVector< somenumber > &src) const
#define Assert(cond, exc)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
void reinit(const unsigned int n_block_rows, const unsigned int n_block_cols)
void set(const size_type i, const size_type j, const Number value)
unsigned int n_blocks() const
void Tvmult(BlockVector< somenumber > &dst, const BlockVector< somenumber > &src) const
BlockIndices column_indices
BlockSparseMatrixEZ & operator=(const BlockSparseMatrixEZ< Number > &)
void print_statistics(StreamType &s, bool full=false)
void vmult_add(BlockVector< somenumber > &dst, const BlockVector< somenumber > &src) const
unsigned int size() const
BlockType & block(const unsigned int i)
std::pair< unsigned int, size_type > global_to_local(const size_type i) const
#define AssertIsFinite(number)
unsigned int n_block_rows() const