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;
534 template <
typename number2>
541 template <
typename number2>
551 template <
typename number2>
558 template <
typename number2>
565 template <
typename number2>
572 template <
typename number2>
608 template <
typename number2>
651template <
typename MatrixType,
652 typename inverse_type =
typename MatrixType::value_type>
671 using number =
typename MatrixType::value_type;
697 template <
typename number2>
711 template <
typename number2>
723 template <
typename number2>
737 template <
typename number2>
744 template <
typename number2>
751 template <
typename number2>
770 template <
typename number2>
774 const bool transpose_diagonal,
775 const bool adding)
const;
786 template <
typename number2>
790 const bool transpose_diagonal,
791 const bool adding)
const;
814template <
typename MatrixType,
815 typename inverse_type =
typename MatrixType::value_type>
829 using number =
typename MatrixType::value_type;
865 template <
typename number2>
872 template <
typename number2>
879 template <
typename number2>
886 template <
typename number2>
896template <
typename MatrixType,
typename inverse_type>
906template <
typename MatrixType,
typename inverse_type>
911 const unsigned int nb = i / bs;
918 if (jb + nb * bs != j)
928template <
typename MatrixType,
typename inverse_type>
936 , b_iterator(&
matrix->inverse(0), 0, 0)
937 , b_end(&
matrix->inverse(0), 0, 0)
941 if (a_block ==
matrix->size())
946 b_iterator =
matrix->inverse(a_block).begin(r);
947 b_end =
matrix->inverse(a_block).end();
953template <
typename MatrixType,
typename inverse_type>
956 inverse_type>::const_iterator::Accessor::row()
const
960 return bs * a_block + b_iterator->row();
964template <
typename MatrixType,
typename inverse_type>
967 inverse_type>::const_iterator::Accessor::column()
const
971 return bs * a_block + b_iterator->column();
975template <
typename MatrixType,
typename inverse_type>
978 inverse_type>::const_iterator::Accessor::value()
const
982 return b_iterator->value();
986template <
typename MatrixType,
typename inverse_type>
995template <
typename MatrixType,
typename inverse_type>
1003 ++accessor.b_iterator;
1004 if (accessor.b_iterator == accessor.b_end)
1008 if (accessor.a_block < accessor.matrix->size())
1010 accessor.b_iterator =
1011 accessor.matrix->inverse(accessor.a_block).begin();
1012 accessor.b_end = accessor.matrix->inverse(accessor.a_block).end();
1019template <
typename MatrixType,
typename inverse_type>
1021 const_iterator::Accessor &
1029template <
typename MatrixType,
typename inverse_type>
1031 const_iterator::Accessor *
1039template <
typename MatrixType,
typename inverse_type>
1044 if (accessor.a_block == accessor.matrix->size() &&
1045 accessor.a_block == other.accessor.a_block)
1048 if (accessor.a_block != other.accessor.a_block)
1051 return (accessor.row() == other.accessor.row() &&
1052 accessor.column() == other.accessor.column());
1056template <
typename MatrixType,
typename inverse_type>
1061 return !(*
this == other);
1065template <
typename MatrixType,
typename inverse_type>
1068operator<(
const const_iterator &other)
const
1070 return (accessor.row() < other.accessor.row() ||
1071 (accessor.row() == other.accessor.row() &&
1072 accessor.column() < other.accessor.column()));
1076template <
typename MatrixType,
typename inverse_type>
1085template <
typename MatrixType,
typename inverse_type>
1094template <
typename MatrixType,
typename inverse_type>
1106template <
typename MatrixType,
typename inverse_type>
void log_statistics() const
Householder< typename MatrixType::value_type > & inverse_householder(size_type i)
unsigned int size() const
FullMatrix< typename MatrixType::value_type > & inverse(size_type i)
bool store_diagonals() const
LAPACKFullMatrix< typename MatrixType::value_type > & 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
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