KASKADE 7 development version
|
Class for multigrid stacks. More...
#include <prolongation.hh>
Class for multigrid stacks.
This provides the storage of and access to prolongations and projected Galerkin matrices, but leaves the construction of these to derived classes.
Definition at line 747 of file prolongation.hh.
Public Member Functions | |
MultiGridStack (std::vector< Prolongation > &&ps, std::vector< NumaBCRSMatrix< Entry, Index > > &&as) | |
Constructor. More... | |
MultiGridStack (std::vector< Prolongation > &&ps, NumaBCRSMatrix< Entry, Index > &&A, bool onlyLowerTriangle) | |
Constructor. More... | |
MultiGridStack (MultiGridStack &&other)=default | |
int | levels () const |
The number of grid levels. More... | |
Prolongation const & | p (int level) const |
Returns the prolongation from given level to next higher one. More... | |
NumaBCRSMatrix< Entry, Index > const & | a (int level) const |
Returns the projected Galerkin matrix on the given level. More... | |
NumaBCRSMatrix< Entry, Index > & | coarseGridMatrix () |
Returns the projected Galerkin matrix on the coarsest level. More... | |
void | report (std::ostream &out) const |
Related Functions | |
(Note that these are not member functions.) | |
template<class Prolongation , class Entry , class Index > | |
MultiGridStack< Prolongation, Entry, Index > | makeMultiGridStack (std::vector< Prolongation > &&ps, NumaBCRSMatrix< Entry, Index > &&A, bool onlyLowerTriangle) |
Convenience routine for creating multigrid stacks. More... | |
|
inline |
Constructor.
This takes both a stack of prolongations and a matching stack of projected.
ps | a stack of prolongations |
as | a stack of stiffness matrices. as.size()==ps.size()+1 has to hold. |
Usually, it holds that \( A_i = P_i^T A_{i+1} P_i \), i.e. as[0] contains the coarse grid matrix.
Definition at line 760 of file prolongation.hh.
|
inline |
Constructor.
This takes a stack of prolongations and creates the stack of projected Galerkin matrices from the given fine grid matrix. Most useful for geometric multigrid, where the prolongations are defined solely in terms of the grid.
Definition at line 774 of file prolongation.hh.
|
default |
|
inline |
Returns the projected Galerkin matrix on the given level.
level | precondition 0 <= level < levels() |
For level==0, the returned matrix can be in an undefined state if it has been modified previously via the non-const coarseGridMatrix() reference.
Definition at line 819 of file prolongation.hh.
Referenced by Kaskade::MultiGridStack< Prolongation, Entry, Index >::report().
|
inline |
Returns the projected Galerkin matrix on the coarsest level.
This is explicitly a mutable reference, such that the coarse grid matrix can be moved from. This is useful, as in the multigrid, the coarsest level matrix is not referenced (the coarse grid preconditioner has its own copy, maybe obtained by moving from here...):
Definition at line 835 of file prolongation.hh.
|
inline |
The number of grid levels.
Definition at line 796 of file prolongation.hh.
Referenced by Kaskade::MultiGridStack< Prolongation, Entry, Index >::a(), and Kaskade::MultiGridStack< Prolongation, Entry, Index >::p().
|
inline |
Returns the prolongation from given level to next higher one.
level | precondition 0 <= level < levels()-1 |
Definition at line 805 of file prolongation.hh.
Referenced by Kaskade::MultiGridStack< Prolongation, Entry, Index >::report().
|
inline |
Definition at line 840 of file prolongation.hh.
Referenced by Kaskade::operator<<().