Reference documentation for deal.II version 8.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
relaxation_block.h
1 // ---------------------------------------------------------------------
2 // @f$Id: relaxation_block.h 30036 2013-07-18 16:55:32Z maier @f$
3 //
4 // Copyright (C) 2010 - 2013 by the deal.II authors
5 //
6 // This file is part of the deal.II library.
7 //
8 // The deal.II library is free software; you can use it, redistribute
9 // it, and/or modify it under the terms of the GNU Lesser General
10 // Public License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 // The full text of the license can be found in the file LICENSE at
13 // the top level of the deal.II distribution.
14 //
15 // ---------------------------------------------------------------------
16 
17 #ifndef __deal2__relaxation_block_h
18 #define __deal2__relaxation_block_h
19 
20 #include <deal.II/base/subscriptor.h>
21 #include <deal.II/base/smartpointer.h>
22 #include <deal.II/lac/vector.h>
23 #include <deal.II/lac/precondition_block_base.h>
24 #include <deal.II/lac/block_list.h>
25 
26 #include <vector>
27 #include <set>
28 
29 DEAL_II_NAMESPACE_OPEN
30 
55 template <class MATRIX, typename inverse_type=typename MATRIX::value_type>
57  protected PreconditionBlockBase<inverse_type>
58 {
59 private:
63  typedef typename MATRIX::value_type number;
64 
69 
70 public:
75 
79  class AdditionalData : public Subscriptor
80  {
81  public:
85  AdditionalData (const double relaxation = 1.,
86  const bool invert_diagonal = true,
87  const bool same_diagonal = false);
88 
97  const double relaxation = 1.,
98  const bool invert_diagonal = true,
99  const bool same_diagonal = false) DEAL_II_DEPRECATED;
100 
101 
106 
110  double relaxation;
111 
116 
125 
132  double threshold;
133 
155  std::vector<std::vector<unsigned int> > order;
159  std::size_t memory_consumption() const;
160  };
161 
170  void initialize (const MATRIX &A,
171  const AdditionalData &parameters);
172 
178  void clear();
179 
183  bool empty () const;
184 
190  size_type j) const;
191 
207  void invert_diagblocks();
208 
209 protected:
218  template <typename number2>
219  void do_step (
220  Vector<number2> &dst,
221  const Vector<number2> &prev,
222  const Vector<number2> &src,
223  const bool backward) const;
232 
237 };
238 
239 
256 template<class MATRIX, typename inverse_type = typename MATRIX::value_type>
257 class RelaxationBlockJacobi : public virtual Subscriptor,
258  protected RelaxationBlock<MATRIX, inverse_type>
259 {
260 public:
264 // RelaxationBlockJacobi();
265 
269  typedef typename MATRIX::value_type number;
270 
275 
281 
286 
311  template <typename number2>
312  void step (Vector<number2> &dst, const Vector<number2> &rhs) const;
313 
317  template <typename number2>
318  void Tstep (Vector<number2> &dst, const Vector<number2> &rhs) const;
319 
323  std::size_t memory_consumption() const;
324 };
325 
326 
342 template<class MATRIX, typename inverse_type = typename MATRIX::value_type>
343 class RelaxationBlockSOR : public virtual Subscriptor,
344  protected RelaxationBlock<MATRIX, inverse_type>
345 {
346 public:
350 // RelaxationBlockSOR();
351 
355  typedef typename MATRIX::value_type number;
356 
361 
367 
372 
397  template <typename number2>
398  void step (Vector<number2> &dst, const Vector<number2> &rhs) const;
399 
403  template <typename number2>
404  void Tstep (Vector<number2> &dst, const Vector<number2> &rhs) const;
405 };
406 
407 
424 template<class MATRIX, typename inverse_type = typename MATRIX::value_type>
425 class RelaxationBlockSSOR : public virtual Subscriptor,
426  protected RelaxationBlock<MATRIX, inverse_type>
427 {
428 public:
432  typedef typename MATRIX::value_type number;
433 
438 
443 
448 
453 
474  template <typename number2>
475  void step (Vector<number2> &dst, const Vector<number2> &rhs) const;
476 
480  template <typename number2>
481  void Tstep (Vector<number2> &dst, const Vector<number2> &rhs) const;
482 };
483 
484 
485 DEAL_II_NAMESPACE_CLOSE
486 
487 #endif
SmartPointer< const MATRIX, RelaxationBlock< MATRIX, inverse_type > > A
MATRIX::value_type number
void Tstep(Vector< number2 > &dst, const Vector< number2 > &rhs) const
std::vector< std::vector< unsigned int > > order
unsigned int global_dof_index
Definition: types.h:100
SmartPointer< const AdditionalData, RelaxationBlock< MATRIX, inverse_type > > additional_data
void Tstep(Vector< number2 > &dst, const Vector< number2 > &rhs) const
MATRIX::value_type number
BlockCompressedSparsityPattern CompressedBlockSparsityPattern DEAL_II_DEPRECATED
void step(Vector< number2 > &dst, const Vector< number2 > &rhs) const
MATRIX::value_type number
bool empty() const
MATRIX::value_type number
AdditionalData(const double relaxation=1., const bool invert_diagonal=true, const bool same_diagonal=false)
void initialize(const MATRIX &A, const AdditionalData &parameters)
void do_step(Vector< number2 > &dst, const Vector< number2 > &prev, const Vector< number2 > &src, const bool backward) const
PreconditionBlockBase< inverse_type >::Inversion inversion
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
value_type el(size_type i, size_type j) const
types::global_dof_index size_type
std::size_t memory_consumption() const
inverse_type value_type