16#ifndef dealii_precondition_block_h
17#define dealii_precondition_block_h
80template <
typename MatrixType,
81 typename inverse_type =
typename MatrixType::value_type>
89 using number =
typename MatrixType::value_type;
272 template <
typename number2>
277 const bool transpose_diagonal)
const;
290 template <
typename number2>
295 const bool transpose_diagonal)
const;
323 <<
"The blocksize " << arg1 <<
" and the size of the matrix "
324 << arg2 <<
" do not match.");
376template <
typename MatrixType,
377 typename inverse_type =
typename MatrixType::value_type>
386 using number =
typename MatrixType::value_type;
536 template <
typename number2>
543 template <
typename number2>
553 template <
typename number2>
560 template <
typename number2>
567 template <
typename number2>
574 template <
typename number2>
610 template <
typename number2>
653template <
typename MatrixType,
654 typename inverse_type =
typename MatrixType::value_type>
673 using number =
typename MatrixType::value_type;
699 template <
typename number2>
713 template <
typename number2>
725 template <
typename number2>
739 template <
typename number2>
746 template <
typename number2>
753 template <
typename number2>
772 template <
typename number2>
776 const bool transpose_diagonal,
777 const bool adding)
const;
788 template <
typename number2>
792 const bool transpose_diagonal,
793 const bool adding)
const;
816template <
typename MatrixType,
817 typename inverse_type =
typename MatrixType::value_type>
831 using number =
typename MatrixType::value_type;
867 template <
typename number2>
874 template <
typename number2>
881 template <
typename number2>
888 template <
typename number2>
898template <
typename MatrixType,
typename inverse_type>
908template <
typename MatrixType,
typename inverse_type>
913 const unsigned int nb = i / bs;
920 if (jb + nb * bs != j)
930template <
typename MatrixType,
typename inverse_type>
938 , b_iterator(&
matrix->inverse(0), 0, 0)
939 , b_end(&
matrix->inverse(0), 0, 0)
943 if (a_block ==
matrix->size())
948 b_iterator =
matrix->inverse(a_block).begin(r);
949 b_end =
matrix->inverse(a_block).end();
955template <
typename MatrixType,
typename inverse_type>
958 inverse_type>::const_iterator::Accessor::row()
const
962 return bs * a_block + b_iterator->row();
966template <
typename MatrixType,
typename inverse_type>
969 inverse_type>::const_iterator::Accessor::column()
const
973 return bs * a_block + b_iterator->column();
977template <
typename MatrixType,
typename inverse_type>
980 inverse_type>::const_iterator::Accessor::value()
const
984 return b_iterator->value();
988template <
typename MatrixType,
typename inverse_type>
997template <
typename MatrixType,
typename inverse_type>
999 inverse_type>::const_iterator &
1020template <
typename MatrixType,
typename inverse_type>
1022 const_iterator::Accessor &
1030template <
typename MatrixType,
typename inverse_type>
1032 const_iterator::Accessor *
1034 inverse_type>::const_iterator::operator->()
const
1040template <
typename MatrixType,
typename inverse_type>
1043 const const_iterator &other)
const
1045 if (accessor.a_block == accessor.matrix->size() &&
1046 accessor.a_block == other.accessor.a_block)
1049 if (accessor.a_block != other.accessor.a_block)
1052 return (accessor.row() == other.accessor.row() &&
1053 accessor.column() == other.accessor.column());
1057template <
typename MatrixType,
typename inverse_type>
1060 const const_iterator &other)
const
1062 return !(*
this == other);
1066template <
typename MatrixType,
typename inverse_type>
1069 const const_iterator &other)
const
1071 return (accessor.row() < other.accessor.row() ||
1072 (accessor.row() == other.accessor.row() &&
1073 accessor.column() < other.accessor.column()));
1077template <
typename MatrixType,
typename inverse_type>
1086template <
typename MatrixType,
typename inverse_type>
1095template <
typename MatrixType,
typename inverse_type>
1107template <
typename MatrixType,
typename inverse_type>
typename Table< 2, number >::const_iterator const_iterator
iterator begin(const size_type r)
iterator end(const size_type r)
void log_statistics() const
Householder< number > & inverse_householder(size_type i)
unsigned int size() const
FullMatrix< number > & inverse(size_type i)
bool store_diagonals() const
LAPACKFullMatrix< number > & inverse_svd(size_type i)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define DeclException0(Exception0)
void vmult(Vector< number2 > &, const Vector< number2 > &) const
void vmult(Vector< number2 > &, const Vector< number2 > &) const
SmartPointer< const MatrixType, PreconditionBlock< MatrixType, inverse_type > > A
PreconditionBlockSOR(bool store)
bool operator!=(const const_iterator &) const
void vmult_add(Vector< number2 > &, const Vector< number2 > &) const
void step(Vector< number2 > &dst, const Vector< number2 > &rhs) const
void vmult_add(Vector< number2 > &, const Vector< number2 > &) const
const PreconditionBlockJacobi< MatrixType, inverse_type > * matrix
const_iterator begin(const size_type r) const
const_iterator end() const
void step(Vector< number2 > &dst, const Vector< number2 > &rhs) const
void vmult(Vector< number2 > &, const Vector< number2 > &) const
typename MatrixType::value_type number
const_iterator(const PreconditionBlockJacobi< MatrixType, inverse_type > *matrix, const size_type row)
typename MatrixType::value_type number
void step(Vector< number2 > &dst, const Vector< number2 > &rhs) const
static ::ExceptionBase & ExcInverseMatricesAlreadyExist()
FullMatrix< inverse_type >::const_iterator b_end
AdditionalData(const size_type block_size, const double relaxation=1., const bool invert_diagonal=true, const bool same_diagonal=false)
void Tstep(Vector< number2 > &dst, const Vector< number2 > &rhs) const
void forward(Vector< number2 > &, const Vector< number2 > &, const bool transpose_diagonal, const bool adding) const
#define Assert(cond, exc)
FullMatrix< inverse_type >::const_iterator b_iterator
void Tstep(Vector< number2 > &dst, const Vector< number2 > &rhs) const
static ::ExceptionBase & ExcIteratorPastEnd()
void Tvmult(Vector< number2 > &, const Vector< number2 > &) const
void backward(Vector< number2 > &, const Vector< number2 > &, const bool transpose_diagonal, const bool adding) const
#define DeclException2(Exception2, type1, type2, outsequence)
std::vector< size_type > inverse_permutation
void do_vmult(Vector< number2 > &, const Vector< number2 > &, bool adding) const
void Tvmult_add(Vector< number2 > &, const Vector< number2 > &) const
typename MatrixType::value_type number
static ::ExceptionBase & ExcWrongBlockSize(int arg1, int arg2)
types::global_dof_index size_type
const_iterator begin() const
#define AssertIndexRange(index, range)
void Tvmult(Vector< number2 > &, const Vector< number2 > &) const
void Tvmult(Vector< number2 > &, const Vector< number2 > &) const
const_iterator & operator++()
Accessor(const PreconditionBlockJacobi< MatrixType, inverse_type > *matrix, const size_type row)
const_iterator end(const size_type r) const
friend class const_iterator
bool operator==(const const_iterator &) const
bool operator<(const const_iterator &) const
std::vector< size_type > permutation
PreconditionBlockBase< inverse_type >::Inversion inversion
const Accessor & operator*() const
void Tstep(Vector< number2 > &dst, const Vector< number2 > &rhs) const
void Tvmult_add(Vector< number2 > &, const Vector< number2 > &) const
types::global_dof_index size_type
const Accessor * operator->() const
inverse_type value() const
PreconditionBlock(bool store_diagonals=false)
~PreconditionBlock() override=default
value_type el(size_type i, size_type j) const
void forward_step(Vector< number2 > &dst, const Vector< number2 > &prev, const Vector< number2 > &src, const bool transpose_diagonal) const
void initialize(const MatrixType &A, const AdditionalData parameters)
types::global_dof_index size_type
void invert_permuted_diagblocks()
void backward_step(Vector< number2 > &dst, const Vector< number2 > &prev, const Vector< number2 > &src, const bool transpose_diagonal) const
std::size_t memory_consumption() const
void set_permutation(const std::vector< size_type > &permutation, const std::vector< size_type > &inverse_permutation)
size_type block_size() const
typename MatrixType::value_type number
void initialize(const MatrixType &A, const std::vector< size_type > &permutation, const std::vector< size_type > &inverse_permutation, const AdditionalData parameters)
@ matrix
Contents is actually a matrix.
types::global_dof_index size_type
unsigned int global_dof_index