Reference documentation for deal.II version 8.4.2
mg_base.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1999 - 2016 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE at
12 // the top level of the deal.II distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii__mg_base_h
17 #define dealii__mg_base_h
18 
19 /*
20  * This file contains MGLevelObject and some abstract base classes
21  * used by Multigrid.
22  */
23 
24 #include <deal.II/base/config.h>
25 #include <deal.II/base/subscriptor.h>
26 #include <deal.II/base/smartpointer.h>
27 #include <deal.II/lac/vector.h>
28 
29 
30 DEAL_II_NAMESPACE_OPEN
31 
32 template <typename> class MGLevelObject;
33 
36 
37 
48 template <typename VectorType>
49 class MGMatrixBase : public Subscriptor
50 {
51 public:
52  /*
53  * Virtual destructor.
54  */
55  virtual ~MGMatrixBase();
56 
60  virtual void vmult (const unsigned int level,
61  VectorType &dst,
62  const VectorType &src) const = 0;
63 
67  virtual void vmult_add (const unsigned int level,
68  VectorType &dst,
69  const VectorType &src) const = 0;
70 
74  virtual void Tvmult (const unsigned int level,
75  VectorType &dst,
76  const VectorType &src) const = 0;
77 
81  virtual void Tvmult_add (const unsigned int level,
82  VectorType &dst,
83  const VectorType &src) const = 0;
84 };
85 
86 
94 template <typename VectorType>
96 {
97 public:
101  virtual ~MGCoarseGridBase ();
102 
106  virtual void operator() (const unsigned int level,
107  VectorType &dst,
108  const VectorType &src) const = 0;
109 };
110 
111 
159 template <typename VectorType>
161 {
162 public:
166  virtual ~MGTransferBase();
167 
178  virtual void prolongate (const unsigned int to_level,
179  VectorType &dst,
180  const VectorType &src) const = 0;
181 
197  virtual void restrict_and_add (const unsigned int from_level,
198  VectorType &dst,
199  const VectorType &src) const = 0;
200 };
201 
202 
203 
210 template <typename VectorType>
212 {
213 public:
217  virtual ~MGSmootherBase();
221  virtual void clear() = 0;
222 
226  virtual void smooth (const unsigned int level,
227  VectorType &u,
228  const VectorType &rhs) const = 0;
229 };
230 
233 DEAL_II_NAMESPACE_CLOSE
234 
235 #endif
virtual void Tvmult(const unsigned int level, VectorType &dst, const VectorType &src) const =0
virtual void vmult(const unsigned int level, VectorType &dst, const VectorType &src) const =0
virtual void vmult_add(const unsigned int level, VectorType &dst, const VectorType &src) const =0
virtual void Tvmult_add(const unsigned int level, VectorType &dst, const VectorType &src) const =0