16 #ifndef dealii__block_matrix_array_h 17 #define dealii__block_matrix_array_h 19 #include <deal.II/base/config.h> 20 #include <deal.II/base/subscriptor.h> 21 #include <deal.II/base/table.h> 23 #include <deal.II/lac/pointer_matrix.h> 24 #include <deal.II/lac/vector_memory.h> 25 #include <deal.II/lac/block_vector.h> 33 DEAL_II_NAMESPACE_OPEN
113 template <
typename number =
double,
typename BlockVectorType=BlockVector<number> >
157 template <
typename MatrixType>
158 void enter (
const MatrixType &matrix,
159 const unsigned int row,
160 const unsigned int col,
161 const number prefix = 1.,
162 const bool transpose =
false);
182 void vmult (BlockVectorType &dst,
183 const BlockVectorType &src)
const;
189 const BlockVectorType &src)
const;
194 void Tvmult (BlockVectorType &dst,
195 const BlockVectorType &src)
const;
201 const BlockVectorType &src)
const;
208 const BlockVectorType &v)
const;
255 template <
class StreamType>
275 template<
typename MatrixType>
396 template <
typename number =
double,
typename BlockVectorType = BlockVector<number> >
428 template <
typename MatrixType>
438 void vmult (BlockVectorType &dst,
439 const BlockVectorType &src)
const;
445 const BlockVectorType &src)
const;
450 void Tvmult (BlockVectorType &dst,
451 const BlockVectorType &src)
const;
457 const BlockVectorType &src)
const;
488 <<
"No diagonal entry was added for block " << arg1);
496 <<
"Inverse diagonal entries may not be added in block " 504 void do_row (BlockVectorType &dst,
505 size_type row_num)
const;
517 template <
typename number,
typename BlockVectorType>
518 template <
typename MatrixType>
521 (
const MatrixType &m,
530 transpose (transpose),
531 matrix (new_pointer_matrix_base(m, typename BlockVectorType::BlockType(), typeid(*this).name()))
536 template <
typename number,
typename BlockVectorType>
537 template <
typename MatrixType>
548 entries.push_back(
Entry(matrix, row, col, prefix, transpose));
552 template <
typename number,
typename BlockVectorType>
553 template <
class StreamType>
558 out <<
"\\begin{array}{" 564 typedef std::map<const PointerMatrixBase<typename BlockVectorType::BlockType > *, std::string> NameMap;
565 NameMap matrix_names;
567 typename std::vector<Entry>::const_iterator m =
entries.begin();
568 typename std::vector<Entry>::const_iterator end =
entries.end();
571 for (; m != end ; ++m)
573 if (matrix_names.find(m->matrix) == matrix_names.end())
575 std::pair<typename NameMap::iterator, bool> x =
579 std::ostringstream stream;
580 stream << matrix_number++;
582 x.first->second += stream.str();
585 std::ostringstream stream;
587 if (array(m->row, m->col) !=
"" && m->prefix >= 0)
590 stream << m->prefix <<
'x';
591 stream << matrix_names.find(m->matrix)->second;
596 array(m->row, m->col) += stream.str();
601 out <<
'\t' << array(i,j);
605 out <<
"\\\\" << std::endl;
612 out <<
"\\end{array}" << std::endl;
615 template <
typename number,
typename BlockVectorType>
616 template <
typename MatrixType>
632 DEAL_II_NAMESPACE_CLOSE
std::vector< Entry > entries
number matrix_norm_square(const BlockVectorType &u) const
types::global_dof_index size_type
void vmult(BlockVectorType &dst, const BlockVectorType &src) const
void vmult_add(BlockVectorType &dst, const BlockVectorType &src) const
unsigned int n_block_cols() const
#define DeclException1(Exception1, type1, outsequence)
void initialize(const unsigned int n_block_rows, const unsigned int n_block_cols)
unsigned int global_dof_index
#define Assert(cond, exc)
unsigned int n_block_rows() const
void print_latex(StreamType &out) const
void Tvmult(BlockVectorType &dst, const BlockVectorType &src) const
Entry(const MatrixType &matrix, size_type row, size_type col, number prefix, bool transpose)
void reinit(const unsigned int n_block_rows, const unsigned int n_block_cols)
void enter(const MatrixType &matrix, const size_type row, const size_type col, const number prefix=1., const bool transpose=false)
types::global_dof_index size_type
void Tvmult_add(BlockVectorType &dst, const BlockVectorType &src) const
PointerMatrixBase< typename BlockVectorType::BlockType > * matrix
number matrix_scalar_product(const BlockVectorType &u, const BlockVectorType &v) const
void enter(const MatrixType &matrix, const unsigned int row, const unsigned int col, const number prefix=1., const bool transpose=false)