16 #ifndef dealii_precondition_block_h 17 #define dealii_precondition_block_h 20 #include <deal.II/base/config.h> 21 #include <deal.II/base/exceptions.h> 22 #include <deal.II/base/subscriptor.h> 23 #include <deal.II/base/smartpointer.h> 24 #include <deal.II/lac/precondition_block_base.h> 28 DEAL_II_NAMESPACE_OPEN
80 template <
typename MatrixType,
typename inverse_type =
typename MatrixType::value_type>
89 typedef typename MatrixType::value_type
number;
264 template <
typename number2>
266 const Vector<number2> &prev,
267 const Vector<number2> &src,
268 const bool transpose_diagonal)
const;
281 template <
typename number2>
283 const Vector<number2> &prev,
284 const Vector<number2> &src,
285 const bool transpose_diagonal)
const;
310 <<
"The blocksize " << arg1
311 <<
" and the size of the matrix " << arg2
312 <<
" do not match.");
366 template <
typename MatrixType,
typename inverse_type =
typename MatrixType::value_type>
374 typedef typename MatrixType::value_type
number;
414 inverse_type
value()
const;
516 template <
typename number2>
517 void vmult (Vector<number2> &,
const Vector<number2> &)
const;
522 template <
typename number2>
523 void Tvmult (Vector<number2> &,
const Vector<number2> &)
const;
531 template <
typename number2>
532 void vmult_add (Vector<number2> &,
const Vector<number2> &)
const;
537 template <
typename number2>
538 void Tvmult_add (Vector<number2> &,
const Vector<number2> &)
const;
543 template <
typename number2>
544 void step (Vector<number2> &dst,
const Vector<number2> &rhs)
const;
549 template <
typename number2>
550 void Tstep (Vector<number2> &dst,
const Vector<number2> &rhs)
const;
580 template <
typename number2>
582 const Vector<number2> &,
585 friend class Accessor;
626 template <
typename MatrixType,
typename inverse_type =
typename MatrixType::value_type>
644 typedef typename MatrixType::value_type
number;
670 template <
typename number2>
671 void vmult (Vector<number2> &,
const Vector<number2> &)
const;
683 template <
typename number2>
684 void vmult_add (Vector<number2> &,
const Vector<number2> &)
const;
694 template <
typename number2>
695 void Tvmult (Vector<number2> &,
const Vector<number2> &)
const;
707 template <
typename number2>
708 void Tvmult_add (Vector<number2> &,
const Vector<number2> &)
const;
713 template <
typename number2>
714 void step (Vector<number2> &dst,
const Vector<number2> &rhs)
const;
719 template <
typename number2>
720 void Tstep (Vector<number2> &dst,
const Vector<number2> &rhs)
const;
737 template <
typename number2>
738 void forward (Vector<number2> &,
739 const Vector<number2> &,
740 const bool transpose_diagonal,
741 const bool adding)
const;
752 template <
typename number2>
754 const Vector<number2> &,
755 const bool transpose_diagonal,
756 const bool adding)
const;
781 template <
typename MatrixType,
typename inverse_type =
typename MatrixType::value_type>
794 typedef typename MatrixType::value_type
number;
830 template <
typename number2>
831 void vmult (Vector<number2> &,
const Vector<number2> &)
const;
836 template <
typename number2>
837 void Tvmult (Vector<number2> &,
const Vector<number2> &)
const;
842 template <
typename number2>
843 void step (Vector<number2> &dst,
const Vector<number2> &rhs)
const;
848 template <
typename number2>
849 void Tstep (Vector<number2> &dst,
const Vector<number2> &rhs)
const;
857 template <
typename MatrixType,
typename inverse_type>
867 template <
typename MatrixType,
typename inverse_type>
874 const unsigned int nb = i/bs;
891 template <
typename MatrixType,
typename inverse_type>
898 b_iterator(&
matrix->inverse(0), 0, 0),
899 b_end(&
matrix->inverse(0), 0, 0)
901 bs =
matrix->block_size();
906 if (a_block ==
matrix->size())
911 b_iterator =
matrix->inverse(a_block).begin(r);
912 b_end =
matrix->inverse(a_block).end();
919 template <
typename MatrixType,
typename inverse_type>
931 template <
typename MatrixType,
typename inverse_type>
939 return bs * a_block + b_iterator->column();
943 template <
typename MatrixType,
typename inverse_type>
951 return b_iterator->value();
955 template <
typename MatrixType,
typename inverse_type>
965 template <
typename MatrixType,
typename inverse_type>
987 template <
typename MatrixType,
typename inverse_type>
996 template <
typename MatrixType,
typename inverse_type>
1005 template <
typename MatrixType,
typename inverse_type>
1011 if (accessor.a_block == accessor.matrix->size() &&
1012 accessor.a_block == other.accessor.a_block)
1015 if (accessor.a_block != other.accessor.a_block)
1018 return (accessor.row() == other.accessor.row() &&
1019 accessor.column() == other.accessor.column());
1023 template <
typename MatrixType,
typename inverse_type>
1029 return ! (*
this == other);
1033 template <
typename MatrixType,
typename inverse_type>
1037 operator < (
const const_iterator &other)
const 1039 return (accessor.row() < other.accessor.row() ||
1040 (accessor.row() == other.accessor.row() &&
1041 accessor.column() < other.accessor.column()));
1045 template <
typename MatrixType,
typename inverse_type>
1050 return const_iterator(
this, 0);
1054 template <
typename MatrixType,
typename inverse_type>
1063 template <
typename MatrixType,
typename inverse_type>
1070 return const_iterator(
this, r);
1075 template <
typename MatrixType,
typename inverse_type>
1082 return const_iterator(
this, r+1);
1087 DEAL_II_NAMESPACE_CLOSE
FullMatrix< inverse_type >::const_iterator b_end
std::size_t memory_consumption() const
types::global_dof_index size_type
types::global_dof_index size_type
void set_permutation(const std::vector< size_type > &permutation, const std::vector< size_type > &inverse_permutation)
const_iterator & operator++()
void Tvmult_add(Vector< number2 > &, const Vector< number2 > &) const
inverse_type value() const
#define DeclException2(Exception2, type1, type2, outsequence)
Contents is actually a matrix.
FullMatrix< inverse_type >::const_iterator b_iterator
void Tstep(Vector< number2 > &dst, const Vector< number2 > &rhs) const
AdditionalData(const size_type block_size, const double relaxation=1., const bool invert_diagonal=true, const bool same_diagonal=false)
static ::ExceptionBase & ExcWrongBlockSize(int arg1, int arg2)
void step(Vector< number2 > &dst, const Vector< number2 > &rhs) const
const Accessor * operator->() const
void Tvmult(Vector< number2 > &, const Vector< number2 > &) const
const_iterator end() const
Accessor(const PreconditionBlockJacobi< MatrixType, inverse_type > *matrix, const size_type row)
void backward_step(Vector< number2 > &dst, const Vector< number2 > &prev, const Vector< number2 > &src, const bool transpose_diagonal) const
types::global_dof_index size_type
void initialize(const MatrixType &A, const AdditionalData parameters)
static ::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
void Tvmult_add(Vector< number2 > &, const Vector< number2 > &) const
~PreconditionBlock()=default
std::vector< size_type > inverse_permutation
const_iterator(const PreconditionBlockJacobi< MatrixType, inverse_type > *matrix, const size_type row)
size_type block_size() const
MatrixType::value_type number
static ::ExceptionBase & ExcInverseMatricesAlreadyExist()
void step(Vector< number2 > &dst, const Vector< number2 > &rhs) const
bool operator!=(const const_iterator &) const
bool operator==(const const_iterator &) const
unsigned int global_dof_index
types::global_dof_index size_type
#define Assert(cond, exc)
value_type el(size_type i, size_type j) const
bool store_diagonals() const
void vmult(Vector< number2 > &, const Vector< number2 > &) const
void Tvmult(Vector< number2 > &, const Vector< number2 > &) const
void vmult_add(Vector< number2 > &, const Vector< number2 > &) const
#define DeclException0(Exception0)
MatrixType::value_type number
PreconditionBlockBase< inverse_type >::Inversion inversion
void vmult_add(Vector< number2 > &, const Vector< number2 > &) const
const_iterator begin() const
PreconditionBlock(bool store_diagonals=false)
void forward_step(Vector< number2 > &dst, const Vector< number2 > &prev, const Vector< number2 > &src, const bool transpose_diagonal) const
void Tvmult(Vector< number2 > &, const Vector< number2 > &) const
static ::ExceptionBase & ExcIteratorPastEnd()
void do_vmult(Vector< number2 > &, const Vector< number2 > &, bool adding) const
void backward(Vector< number2 > &, const Vector< number2 > &, const bool transpose_diagonal, const bool adding) const
void vmult(Vector< number2 > &, const Vector< number2 > &) const
types::global_dof_index size_type
MatrixType::value_type number
void Tstep(Vector< number2 > &dst, const Vector< number2 > &rhs) const
std::vector< size_type > permutation
void vmult(Vector< number2 > &, const Vector< number2 > &) const
void Tstep(Vector< number2 > &dst, const Vector< number2 > &rhs) const
void step(Vector< number2 > &dst, const Vector< number2 > &rhs) const
const Accessor & operator*() const
unsigned int size() const
void invert_permuted_diagblocks()
const PreconditionBlockJacobi< MatrixType, inverse_type > * matrix
void forward(Vector< number2 > &, const Vector< number2 > &, const bool transpose_diagonal, const bool adding) const
SmartPointer< const MatrixType, PreconditionBlock< MatrixType, inverse_type > > A
bool operator<(const const_iterator &) const
MatrixType::value_type number