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;
233 value_type
el(size_type i,
264 template <
typename number2>
268 const bool transpose_diagonal)
const;
281 template <
typename number2>
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;
399 const size_type row);
404 size_type row()
const;
409 size_type column()
const;
414 inverse_type value()
const;
453 const size_type row);
473 const Accessor *operator-> ()
const;
522 template <
typename number2>
528 template <
typename number2>
537 template <
typename number2>
543 template <
typename number2>
549 template <
typename number2>
555 template <
typename number2>
586 template <
typename number2>
632 template<
typename MatrixType,
typename inverse_type =
typename MatrixType::value_type>
650 typedef typename MatrixType::value_type
number;
679 template <
typename number2>
692 template <
typename number2>
703 template <
typename number2>
716 template <
typename number2>
722 template <
typename number2>
728 template <
typename number2>
746 template <
typename number2>
749 const bool transpose_diagonal,
750 const bool adding)
const;
761 template <
typename number2>
764 const bool transpose_diagonal,
765 const bool adding)
const;
790 template<
typename MatrixType,
typename inverse_type =
typename MatrixType::value_type>
803 typedef typename MatrixType::value_type
number;
840 template <
typename number2>
846 template <
typename number2>
852 template <
typename number2>
858 template <
typename number2>
867 template<
typename MatrixType,
typename inverse_type>
877 template<
typename MatrixType,
typename inverse_type>
884 const unsigned int nb = i/bs;
901 template<
typename MatrixType,
typename inverse_type>
908 b_iterator(&matrix->
inverse(0), 0, 0),
909 b_end(&matrix->
inverse(0), 0, 0)
916 if (a_block == matrix->
size())
929 template<
typename MatrixType,
typename inverse_type>
937 return bs * a_block + b_iterator->row();
941 template<
typename MatrixType,
typename inverse_type>
949 return bs * a_block + b_iterator->column();
953 template<
typename MatrixType,
typename inverse_type>
961 return b_iterator->value();
965 template<
typename MatrixType,
typename inverse_type>
971 accessor(matrix, row)
975 template<
typename MatrixType,
typename inverse_type>
982 ++accessor.b_iterator;
983 if (accessor.b_iterator == accessor.b_end)
987 if (accessor.a_block < accessor.matrix->size())
989 accessor.b_iterator = accessor.matrix->inverse(accessor.a_block).begin();
990 accessor.b_end = accessor.matrix->inverse(accessor.a_block).end();
997 template<
typename MatrixType,
typename inverse_type>
1006 template<
typename MatrixType,
typename inverse_type>
1015 template<
typename MatrixType,
typename inverse_type>
1021 if (accessor.a_block == accessor.matrix->size() &&
1022 accessor.a_block == other.accessor.a_block)
1025 if (accessor.a_block != other.accessor.a_block)
1028 return (accessor.row() == other.accessor.row() &&
1029 accessor.column() == other.accessor.column());
1033 template<
typename MatrixType,
typename inverse_type>
1039 return ! (*
this == other);
1043 template<
typename MatrixType,
typename inverse_type>
1047 operator < (
const const_iterator &other)
const 1049 return (accessor.row() < other.accessor.row() ||
1050 (accessor.row() == other.accessor.row() &&
1051 accessor.column() < other.accessor.column()));
1055 template<
typename MatrixType,
typename inverse_type>
1060 return const_iterator(
this, 0);
1064 template<
typename MatrixType,
typename inverse_type>
1073 template<
typename MatrixType,
typename inverse_type>
1080 return const_iterator(
this, r);
1085 template<
typename MatrixType,
typename inverse_type>
1092 return const_iterator(
this, r+1);
1097 DEAL_II_NAMESPACE_CLOSE
FullMatrix< inverse_type >::const_iterator b_end
std::size_t memory_consumption() const
void forward_step(Vector< number2 > &dst, const Vector< number2 > &prev, const Vector< number2 > &src, const bool transpose_diagonal) const
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 set_permutation(const std::vector< size_type > &permutation, const std::vector< size_type > &inverse_permutation)
const_iterator & operator++()
#define DeclException2(Exception2, type1, type2, outsequence)
FullMatrix< inverse_type >::const_iterator b_iterator
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)
bool store_diagonals() const
const Accessor & operator*() const
unsigned int size() const
value_type el(size_type i, size_type j) const
bool operator!=(const const_iterator &) const
Accessor(const PreconditionBlockJacobi< MatrixType, inverse_type > *matrix, const size_type row)
types::global_dof_index size_type
void initialize(const MatrixType &A, const AdditionalData parameters)
bool operator==(const const_iterator &) const
static::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
std::vector< size_type > inverse_permutation
const_iterator(const PreconditionBlockJacobi< MatrixType, inverse_type > *matrix, const size_type row)
MatrixType::value_type number
static::ExceptionBase & ExcInverseMatricesAlreadyExist()
FullMatrix< inverse_type > & inverse(size_type i)
bool operator<(const const_iterator &) const
unsigned int global_dof_index
types::global_dof_index size_type
#define Assert(cond, exc)
#define DeclException0(Exception0)
MatrixType::value_type number
const_iterator begin() const
PreconditionBlockBase< inverse_type >::Inversion inversion
PreconditionBlock(bool store_diagonals=false)
const_iterator begin() const
static::ExceptionBase & ExcIteratorPastEnd()
inverse_type value() const
types::global_dof_index size_type
MatrixType::value_type number
std::vector< size_type > permutation
const_iterator end() const
void invert_permuted_diagblocks()
const PreconditionBlockJacobi< MatrixType, inverse_type > * matrix
const_iterator end() const
size_type block_size() const
const Accessor * operator->() const
SmartPointer< const MatrixType, PreconditionBlock< MatrixType, inverse_type > > A
MatrixType::value_type number