17 #ifndef __deal2__precondition_block_h
18 #define __deal2__precondition_block_h
21 #include <deal.II/base/config.h>
23 #include <deal.II/base/subscriptor.h>
24 #include <deal.II/base/smartpointer.h>
25 #include <deal.II/lac/precondition_block_base.h>
31 template<
class MATRIX,
typename inverse_type>
86 template<
class MATRIX,
typename inverse_type =
typename MATRIX::value_type>
95 typedef typename MATRIX::value_type
number;
296 value_type
el(size_type i,
345 template <
typename number2>
350 const bool transpose_diagonal)
const;
369 template <
typename number2>
374 const bool transpose_diagonal)
const;
411 << " and the
size of the matrix " << arg2
412 << " do not match.");
476 template<class MATRIX, typename
inverse_type = typename MATRIX::value_type>
484 typedef typename MATRIX::value_type
number;
511 const size_type row);
518 size_type row()
const;
525 size_type column()
const;
530 inverse_type value()
const;
571 const size_type row);
591 const Accessor *operator-> ()
const;
657 template <
typename number2>
663 template <
typename number2>
677 template <
typename number2>
684 template <
typename number2>
691 template <
typename number2>
698 template <
typename number2>
733 template <
typename number2>
738 friend class Accessor;
780 template<
class MATRIX,
typename inverse_type =
typename MATRIX::value_type>
798 typedef typename MATRIX::value_type
number;
833 template <
typename number2>
853 template <
typename number2>
870 template <
typename number2>
890 template <
typename number2>
897 template <
typename number2>
904 template <
typename number2>
927 template <
typename number2>
930 const bool transpose_diagonal,
931 const bool adding)
const;
946 template <
typename number2>
949 const bool transpose_diagonal,
950 const bool adding)
const;
973 template<
class MATRIX,
typename inverse_type =
typename MATRIX::value_type>
986 typedef typename MATRIX::value_type
number;
1029 template <
typename number2>
1035 template <
typename number2>
1042 template <
typename number2>
1049 template <
typename number2>
1058 template<
class MATRIX,
typename inverse_type>
1068 template<
class MATRIX,
typename inverse_type>
1072 return this->
size();
1076 template<
class MATRIX,
typename inverse_type>
1083 const unsigned int nb = i/bs;
1087 const size_type ib = i % bs;
1088 const size_type jb = j % bs;
1090 if (jb + nb*bs != j)
1100 template<
class MATRIX,
typename inverse_type>
1104 const size_type row)
1107 b_iterator(&matrix->
inverse(0), 0, 0),
1108 b_end(&matrix->
inverse(0), 0, 0)
1115 if (a_block == matrix->
size())
1118 const size_type r = row % bs;
1128 template<
class MATRIX,
typename inverse_type>
1140 template<
class MATRIX,
typename inverse_type>
1148 return bs * a_block + b_iterator->column();
1152 template<
class MATRIX,
typename inverse_type>
1160 return b_iterator->value();
1164 template<
class MATRIX,
typename inverse_type>
1168 const size_type row)
1174 template<
class MATRIX,
typename inverse_type>
1196 template<
class MATRIX,
typename inverse_type>
1205 template<
class MATRIX,
typename inverse_type>
1214 template<
class MATRIX,
typename inverse_type>
1220 if (accessor.a_block == accessor.matrix->size() &&
1221 accessor.a_block == other.accessor.a_block)
1224 if (accessor.a_block != other.accessor.a_block)
1227 return (accessor.row() == other.accessor.row() &&
1228 accessor.column() == other.accessor.column());
1232 template<
class MATRIX,
typename inverse_type>
1238 return ! (*
this == other);
1242 template<
class MATRIX,
typename inverse_type>
1246 operator < (
const const_iterator &other)
const
1248 return (accessor.row() < other.accessor.row() ||
1249 (accessor.row() == other.accessor.row() &&
1250 accessor.column() < other.accessor.column()));
1254 template<
class MATRIX,
typename inverse_type>
1259 return const_iterator(
this, 0);
1263 template<
class MATRIX,
typename inverse_type>
1272 template<
class MATRIX,
typename inverse_type>
1276 const size_type r)
const
1279 return const_iterator(
this, r);
1284 template<
class MATRIX,
typename inverse_type>
1288 const size_type r)
const
1291 return const_iterator(
this, r+1);
1296 DEAL_II_NAMESPACE_CLOSE
types::global_dof_index size_type
FullMatrix< inverse_type >::const_iterator b_end
types::global_dof_index size_type
unsigned int n_blocks() const DEAL_II_DEPRECATED
void backward_step(Vector< number2 > &dst, const Vector< number2 > &prev, const Vector< number2 > &src, const bool transpose_diagonal) const
bool operator<(const const_iterator &) const
bool store_diagonals() const
bool operator==(const const_iterator &) const
unsigned int size() const
types::global_dof_index size_type
MATRIX::value_type number
AdditionalData(const size_type block_size, const double relaxation=1., const bool invert_diagonal=true, const bool same_diagonal=false)
const_iterator end() const
std::vector< size_type > inverse_permutation
void initialize(const MATRIX &A, const AdditionalData parameters)
MATRIX::value_type number
const_iterator begin() const
void forward_step(Vector< number2 > &dst, const Vector< number2 > &prev, const Vector< number2 > &src, const bool transpose_diagonal) const
std::size_t memory_consumption() const
FullMatrix< inverse_type > & inverse(size_type i)
MATRIX::value_type number
unsigned int global_dof_index
const Accessor * operator->() const
#define Assert(cond, exc)
const PreconditionBlockJacobi< MATRIX, inverse_type > * matrix
DeclException0(ExcInverseMatricesAlreadyExist)
Accessor(const PreconditionBlockJacobi< MATRIX, inverse_type > *matrix, const size_type row)
void invert_permuted_diagblocks(const std::vector< size_type > &permutation, const std::vector< size_type > &inverse_permutation)
::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
const Accessor & operator*() const
const_iterator(const PreconditionBlockJacobi< MATRIX, inverse_type > *matrix, const size_type row)
const_iterator & operator++()
BlockCompressedSparsityPattern CompressedBlockSparsityPattern DEAL_II_DEPRECATED
MATRIX::value_type number
const_iterator begin() const
void set_permutation(const std::vector< size_type > &permutation, const std::vector< size_type > &inverse_permutation)
const_iterator end() const
PreconditionBlockBase< inverse_type >::Inversion inversion
::ExceptionBase & ExcIteratorPastEnd()
DeclException2(ExcWrongBlockSize, int, int,<< "The blocksize "<< arg1<< " and the size of the matrix "<< arg2<< " do not match.")
std::vector< size_type > permutation
PreconditionBlock(bool store_diagonals=false)
value_type el(size_type i, size_type j) const
FullMatrix< inverse_type >::const_iterator b_iterator
inverse_type value() const
bool operator!=(const const_iterator &) const
SmartPointer< const MATRIX, PreconditionBlock< MATRIX, inverse_type > > A
types::global_dof_index size_type
size_type block_size() const