17 #ifndef __deal2__relaxation_block_templates_h 18 #define __deal2__relaxation_block_templates_h 20 #include <deal.II/lac/relaxation_block.h> 21 #include <deal.II/lac/full_matrix.h> 22 #include <deal.II/lac/vector_memory.h> 26 template <
class MATRIX,
typename inverse_type>
29 const double relaxation,
30 const bool invert_diagonal,
31 const bool same_diagonal)
33 relaxation(relaxation),
34 invert_diagonal(invert_diagonal),
35 same_diagonal(same_diagonal),
41 template <
class MATRIX,
typename inverse_type>
46 std::size_t result =
sizeof(*this)
48 for (
unsigned int i=0; i<
order.size(); ++i)
54 template <
class MATRIX,
typename inverse_type>
62 relaxation(relaxation),
63 invert_diagonal(invert_diagonal),
64 same_diagonal(same_diagonal),
72 template <
class MATRIX,
typename inverse_type>
95 template <
class MATRIX,
typename inverse_type>
105 template <
class MATRIX,
typename inverse_type>
129 for (
size_type row_cell=0; row_cell<bs; ++row_cell, ++row)
132 for (
typename MATRIX::const_iterator entry = M.begin(row->
column());
133 entry != M.end(row->
column()); ++entry)
135 const size_type column = entry->column();
138 M_cell(row_cell, col_cell) = entry->value();
173 template <
class MATRIX,
typename inverse_type>
174 template <
typename number2>
181 const bool backward)
const 189 const unsigned int n_permutations = (permutation_empty)
193 if (!permutation_empty)
197 for (
unsigned int perm=0; perm<n_permutations; ++perm)
199 for (
unsigned int bi=0; bi<n_blocks; ++bi)
201 const unsigned int raw_block = backward ? (n_blocks - bi - 1) : bi;
202 const unsigned int block = permutation_empty
214 for (
size_type row_cell=0; row_cell<bs; ++row_cell, ++row)
216 b_cell(row_cell) = src(row->
column());
217 for (
typename MATRIX::const_iterator entry = M.begin(row->
column());
218 entry != M.end(row->
column()); ++entry)
219 b_cell(row_cell) -= entry->value() * prev(entry->column());
224 for (
unsigned int i=0; i<x_cell.
size(); ++i)
231 for (
size_type row_cell=0; row_cell<bs; ++row_cell, ++row)
240 template <
class MATRIX,
typename inverse_type>
241 template <
typename number2>
248 aux->reinit(dst,
false);
250 this->
do_step(dst, *aux, src,
false);
254 template <
class MATRIX,
typename inverse_type>
255 template <
typename number2>
262 aux->reinit(dst,
false);
264 this->
do_step(dst, *aux, src,
true);
270 template <
class MATRIX,
typename inverse_type>
271 template <
typename number2>
276 this->
do_step(dst, dst, src,
false);
280 template <
class MATRIX,
typename inverse_type>
281 template <
typename number2>
286 this->
do_step(dst, dst, src,
true);
292 template <
class MATRIX,
typename inverse_type>
293 template <
typename number2>
298 this->
do_step(dst, dst, src,
false);
299 this->
do_step(dst, dst, src,
true);
303 template <
class MATRIX,
typename inverse_type>
304 template <
typename number2>
309 this->
do_step(dst, dst, src,
true);
310 this->
do_step(dst, dst, src,
false);
315 DEAL_II_NAMESPACE_CLOSE
const types::global_dof_index invalid_size_type
SparsityPattern block_list
void reinit(const TableIndices< N > &new_size, const bool fast=false)
#define AssertDimension(dim1, dim2)
std::size_t memory_consumption() const
SmartPointer< const MATRIX, RelaxationBlock< MATRIX, inverse_type > > A
bool store_diagonals() const
void Tstep(Vector< number2 > &dst, const Vector< number2 > &rhs) const
unsigned int size() const
void invert(const FullMatrix< number2 > &M)
bool is_finite(const double x)
void inverses_computed(bool are_they)
std::vector< std::vector< unsigned int > > order
FullMatrix< inverse_type > & inverse(size_type i)
virtual void reinit(const size_type N, const bool fast=false)
#define Assert(cond, exc)
std::size_t memory_consumption(const T &t)
SmartPointer< const AdditionalData, RelaxationBlock< MATRIX, inverse_type > > additional_data
void Tstep(Vector< number2 > &dst, const Vector< number2 > &rhs) const
void reinit(unsigned int nblocks, size_type blocksize, bool compress, Inversion method=gauss_jordan)
void step(Vector< number2 > &dst, const Vector< number2 > &rhs) const
void create_sparsity_pattern(SparsityPattern &sparsity, size_type n) const
void compute_inverse_svd(const double threshold=0.)
std::size_t memory_consumption() const
::ExceptionBase & ExcNumberNotFinite()
void initialize(const MATRIX &A, const AdditionalData ¶meters)
void do_step(Vector< number2 > &dst, const Vector< number2 > &prev, const Vector< number2 > &src, const bool backward) const
PreconditionBlockBase< inverse_type >::Inversion inversion
void reinit(const unsigned int size1, const unsigned int size2, const bool fast=false)
AdditionalData(const double relaxation=1., const bool invert_diagonal=true, const bool same_diagonal=false)
LAPACKFullMatrix< inverse_type > & inverse_svd(size_type i)
Householder< inverse_type > & inverse_householder(size_type i)
::ExceptionBase & ExcNotImplemented()
void initialize(const FullMatrix< number2 > &)
void step(Vector< number2 > &dst, const Vector< number2 > &rhs) const
void Tstep(Vector< number2 > &dst, const Vector< number2 > &rhs) const
void step(Vector< number2 > &dst, const Vector< number2 > &rhs) const
FullMatrix< inverse_type > & diagonal(size_type i)
types::global_dof_index size_type
void inverse_vmult(size_type i, Vector< number2 > &dst, const Vector< number2 > &src) const