17 #include <deal.II/lac/block_matrix_array.h> 18 #include <deal.II/lac/block_vector.h> 19 #include <deal.II/lac/petsc_block_vector.h> 20 #include <deal.II/lac/trilinos_parallel_block_vector.h> 21 #include <deal.II/lac/vector.h> 23 DEAL_II_NAMESPACE_OPEN
26 template <
typename number,
typename BlockVectorType>
40 template <
typename number,
typename BlockVectorType>
48 template <
typename number,
typename BlockVectorType>
56 template <
typename number,
typename BlockVectorType>
65 template <
typename number,
typename BlockVectorType>
77 template <
typename number,
typename BlockVectorType>
90 template <
typename number,
typename BlockVectorType>
98 template <
typename number,
typename BlockVectorType>
101 BlockVectorType & dst,
102 const BlockVectorType &src)
const 112 typename BlockVectorType::BlockType &aux = *p_aux;
114 typename std::vector<Entry>::const_iterator m =
entries.begin();
115 typename std::vector<Entry>::const_iterator end =
entries.end();
117 for (; m != end; ++m)
119 aux.reinit(dst.block(m->row));
121 m->matrix->Tvmult(aux, src.block(m->col));
123 m->matrix->vmult(aux, src.block(m->col));
124 dst.block(m->row).add(m->prefix, aux);
130 template <
typename number,
typename BlockVectorType>
133 BlockVectorType & dst,
134 const BlockVectorType &src)
const 142 template <
typename number,
typename BlockVectorType>
145 BlockVectorType & dst,
146 const BlockVectorType &src)
const 154 typename std::vector<Entry>::const_iterator m =
entries.begin();
155 typename std::vector<Entry>::const_iterator end =
entries.end();
159 typename BlockVectorType::BlockType &aux = *p_aux;
161 for (; m != end; ++m)
163 aux.reinit(dst.block(m->col));
165 m->matrix->vmult(aux, src.block(m->row));
167 m->matrix->Tvmult(aux, src.block(m->row));
168 dst.block(m->col).add(m->prefix, aux);
174 template <
typename number,
typename BlockVectorType>
177 BlockVectorType & dst,
178 const BlockVectorType &src)
const 186 template <
typename number,
typename BlockVectorType>
189 const BlockVectorType &u,
190 const BlockVectorType &v)
const 200 typename BlockVectorType::BlockType &aux = *p_aux;
202 typename std::vector<Entry>::const_iterator m;
203 typename std::vector<Entry>::const_iterator end =
entries.end();
209 aux.reinit(u.block(i));
210 for (m =
entries.begin(); m != end; ++m)
215 m->matrix->Tvmult_add(aux, v.block(m->col));
217 m->matrix->vmult(aux, v.block(m->col));
219 result += u.block(i) * aux;
227 template <
typename number,
typename BlockVectorType>
230 const BlockVectorType &u)
const 237 template <
typename number,
typename BlockVectorType>
246 template <
typename number,
typename BlockVectorType>
257 template <
typename number,
typename BlockVectorType>
264 template <
typename number,
typename BlockVectorType>
272 template <
typename number,
typename BlockVectorType>
280 template <
typename number,
typename BlockVectorType>
283 BlockVectorType &dst,
287 typename std::vector<
290 typename std::vector<
293 std::vector<
typename std::vector<
299 typename BlockVectorType::BlockType &aux = *p_aux;
301 aux.reinit(dst.block(row_num),
true);
305 for (; m != end; ++m)
320 diagonals.push_back(m);
325 m->matrix->Tvmult(aux, dst.block(j));
327 m->matrix->vmult(aux, dst.block(j));
328 dst.block(i).add(-1.0 * m->prefix, aux);
336 if (diagonals.size() == 1)
339 diagonals[0]->matrix->Tvmult(aux, dst.block(row_num));
341 diagonals[0]->matrix->vmult(aux, dst.block(row_num));
342 dst.block(row_num).equ(diagonals[0]->prefix, aux);
347 for (
size_type i = 0; i < diagonals.size(); ++i)
355 m->matrix->Tvmult_add(aux, dst.block(row_num));
357 m->matrix->vmult_add(aux, dst.block(row_num));
360 dst.block(row_num) = aux;
366 template <
typename number,
typename BlockVectorType>
369 BlockVectorType & dst,
370 const BlockVectorType &src)
const 385 template <
typename number,
typename BlockVectorType>
388 BlockVectorType & dst,
389 const BlockVectorType &src)
const 410 template <
typename number,
typename BlockVectorType>
414 const BlockVectorType &)
const 420 template <
typename number,
typename BlockVectorType>
424 const BlockVectorType &)
const 434 #ifdef DEAL_II_WITH_TRILINOS 440 TrilinosWrappers::MPI::BlockVector>;
443 #ifdef DEAL_II_WITH_PETSC 444 # ifdef PETSC_USE_COMPLEX 448 PETScWrappers::MPI::BlockVector>;
450 PETScWrappers::MPI::BlockVector>;
452 PETScWrappers::MPI::BlockVector>;
457 PETScWrappers::MPI::BlockVector>;
459 PETScWrappers::MPI::BlockVector>;
463 DEAL_II_NAMESPACE_CLOSE
void vmult(BlockVectorType &dst, const BlockVectorType &src) const
number matrix_scalar_product(const BlockVectorType &u, const BlockVectorType &v) const
unsigned int n_block_cols() const
std::vector< Entry > entries
void Tvmult_add(BlockVectorType &dst, const BlockVectorType &src) const
void Tvmult(BlockVectorType &dst, const BlockVectorType &src) const
PointerMatrixBase< typename BlockVectorType::BlockType > * matrix
void vmult_add(BlockVectorType &dst, const BlockVectorType &src) const
types::global_dof_index size_type
void initialize(const unsigned int n_block_rows, const unsigned int n_block_cols)
#define Assert(cond, exc)
static::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
void do_row(BlockVectorType &dst, size_type row_num) const
void vmult_add(BlockVectorType &dst, const BlockVectorType &src) const
unsigned int n_block_rows() const
SymmetricTensor< rank_, dim, Number > transpose(const SymmetricTensor< rank_, dim, Number > &t)
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)
BlockTrianglePrecondition()
void vmult(BlockVectorType &dst, const BlockVectorType &src) const
number matrix_norm_square(const BlockVectorType &u) const
static::ExceptionBase & ExcNoDiagonal(size_type arg1)
static::ExceptionBase & ExcNotImplemented()
void Tvmult(BlockVectorType &dst, const BlockVectorType &src) const
void reinit(const unsigned int n_block_rows)
void Tvmult_add(BlockVectorType &dst, const BlockVectorType &src) const