MueLu Version of the Day
Loading...
Searching...
No Matches
MueLu::Constraint< Scalar, LocalOrdinal, GlobalOrdinal, Node > Class Template Reference

Constraint space information for the potential prolongator. More...

#include <MueLu_Constraint_decl.hpp>

Inheritance diagram for MueLu::Constraint< Scalar, LocalOrdinal, GlobalOrdinal, Node >:
MueLu::BaseClass MueLu::VerboseObject MueLu::Describable

Public Types

using MagnitudeType = typename Teuchos::ScalarTraits< Scalar >::magnitudeType
 

Apply methods.

RCP< MultiVector > B_
 
RCP< MultiVector > Bc_
 
RCP< MultiVector > X_
 Overlapped coarse nullspace.
 
RCP< const CrsGraph > Ppattern_
 Nonzero sparsity pattern.
 
ArrayRCP< Teuchos::SerialDenseMatrix< LO, SC > > XXtInv_
 Array storing \((Q_i Q_i^H)^{-1}\).
 
void Apply (const Matrix &P, Matrix &Projected) const
 Apply constraint.
 
RCP< const CrsGraph > GetPattern () const
 

Setup methods.

void Setup (const RCP< MultiVector > &B, const RCP< MultiVector > &Bc, RCP< const CrsGraph > Ppattern)
 
MagnitudeType ResidualNorm (const RCP< const Matrix > P) const
 

Additional Inherited Members

- Public Member Functions inherited from MueLu::BaseClass
virtual ~BaseClass ()
 Destructor.
 
- Public Member Functions inherited from MueLu::VerboseObject
 VerboseObject ()
 
virtual ~VerboseObject ()
 Destructor.
 
VerbLevel GetVerbLevel () const
 Get the verbosity level.
 
void SetVerbLevel (const VerbLevel verbLevel)
 Set the verbosity level of this object.
 
int GetProcRankVerbose () const
 Get proc rank used for printing. Do not use this information for any other purpose.
 
int SetProcRankVerbose (int procRank) const
 Set proc rank used for printing.
 
bool IsPrint (MsgType type, int thisProcRankOnly=-1) const
 Find out whether we need to print out information for a specific message type.
 
Teuchos::FancyOStream & GetOStream (MsgType type, int thisProcRankOnly=0) const
 Get an output stream for outputting the input message type.
 
Teuchos::FancyOStream & GetBlackHole () const
 
- Public Member Functions inherited from MueLu::Describable
virtual ~Describable ()
 Destructor.
 
virtual void describe (Teuchos::FancyOStream &out_arg, const VerbLevel verbLevel=Default) const
 
virtual std::string description () const
 Return a simple one-line description of this object.
 
void describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
 Print the object with some verbosity level to an FancyOStream object.
 
virtual std::string ShortClassName () const
 Return the class name of the object, without template parameters and without namespace.
 
- Static Public Member Functions inherited from MueLu::VerboseObject
static void SetDefaultVerbLevel (const VerbLevel defaultVerbLevel)
 Set the default (global) verbosity level.
 
static VerbLevel GetDefaultVerbLevel ()
 Get the default (global) verbosity level.
 
static void SetMueLuOStream (const Teuchos::RCP< Teuchos::FancyOStream > &mueluOStream)
 
static void SetMueLuOFileStream (const std::string &filename)
 
static Teuchos::RCP< Teuchos::FancyOStream > GetMueLuOStream ()
 

Detailed Description

template<class Scalar = DefaultScalar, class LocalOrdinal = DefaultLocalOrdinal, class GlobalOrdinal = DefaultGlobalOrdinal, class Node = DefaultNode>
class MueLu::Constraint< Scalar, LocalOrdinal, GlobalOrdinal, Node >

Constraint space information for the potential prolongator.

This class implements an idea of the constrained space. In energy minimization, constrained space is used simultaneously with the iterative method to construct the final prolongator. The space has two different constraints.

Nonzero pattern constraint

Nonzero pattern constraint means that the final prolongator must have the provided nonzero pattern. This is achieved on each step of the iterative method by restricting the graph of the temporary prolongator to the desired pattern. It is implemented in the Apply function.

Note
We do not update the graph of the provided temporary prolongator as this is a very expensive procedure. Rather, we extract its values and replace some of the values of the matrix with the correct graph.

Coarse space approximation constraint

Generally, the coarse space constraint is presented by some matrix (X or Q) (see, for instance, the article by Mandel, Brezina and Vanek '99. It is well known that this matrix can be permuted to have a block diagonal form, where each block corresponds to a row in the prolongator. Specifically, let P be the prolongator, and Q be the constraint matrix. Then the constraint is generally written as \(Q P = B,\) where B is the fine nullspace multivector. Q is a block diagonal matrix, \(Q = diag(Q_1, ..., Q_n)\), where n is the number of rows in P. Each block Q_i is of size NSDim x nnz_i, where NSDim is the number of fine nullspace vectors, and nnz_i is the number of nonzero elements in the i-th row of P.

To constrain the potential prolongator (with correct sparsity pattern, i.e. after the application of the nonzero pattern constraint), one updates its values as

        \f[P = P - Q^H(QQ^H)^{-1}QP.\f]

Because of the block diagonal form of Q, this can be done row-by-row.

Note
For efficiency reasons, we store

\[(QQ^H)^{-1}\]

in the XXtInv_ array. These matrices are dense, but have small size (NSDim x NSDim).

Definition at line 69 of file MueLu_Constraint_decl.hpp.

Member Typedef Documentation

◆ MagnitudeType

template<class Scalar = DefaultScalar, class LocalOrdinal = DefaultLocalOrdinal, class GlobalOrdinal = DefaultGlobalOrdinal, class Node = DefaultNode>
using MueLu::Constraint< Scalar, LocalOrdinal, GlobalOrdinal, Node >::MagnitudeType = typename Teuchos::ScalarTraits<Scalar>::magnitudeType

Definition at line 78 of file MueLu_Constraint_decl.hpp.

Member Function Documentation

◆ Setup()

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
void Constraint::Setup ( const RCP< MultiVector > &  B,
const RCP< MultiVector > &  Bc,
RCP< const CrsGraph >  Ppattern 
)

Setup constraint.

Parameters
B– Fine nullspace vectors
Bc– Coarse nullspace vectors
Ppattern– Nonzero sparsity pattern for the prolongator

Definition at line 33 of file MueLu_Constraint_def.hpp.

◆ ResidualNorm()

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::ScalarTraits< Scalar >::magnitudeType Constraint::ResidualNorm ( const RCP< const Matrix >  P) const

Definition at line 103 of file MueLu_Constraint_def.hpp.

◆ Apply()

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
void Constraint::Apply ( const Matrix &  P,
Matrix &  Projected 
) const

Apply constraint.

Note
We assume that the graph of Projected is the same as Ppattern_

Definition at line 120 of file MueLu_Constraint_def.hpp.

◆ GetPattern()

template<class Scalar = DefaultScalar, class LocalOrdinal = DefaultLocalOrdinal, class GlobalOrdinal = DefaultGlobalOrdinal, class Node = DefaultNode>
RCP< const CrsGraph > MueLu::Constraint< Scalar, LocalOrdinal, GlobalOrdinal, Node >::GetPattern ( ) const
inline

Definition at line 102 of file MueLu_Constraint_decl.hpp.

Member Data Documentation

◆ B_

template<class Scalar = DefaultScalar, class LocalOrdinal = DefaultLocalOrdinal, class GlobalOrdinal = DefaultGlobalOrdinal, class Node = DefaultNode>
RCP<MultiVector> MueLu::Constraint< Scalar, LocalOrdinal, GlobalOrdinal, Node >::B_
private

Definition at line 107 of file MueLu_Constraint_decl.hpp.

◆ Bc_

template<class Scalar = DefaultScalar, class LocalOrdinal = DefaultLocalOrdinal, class GlobalOrdinal = DefaultGlobalOrdinal, class Node = DefaultNode>
RCP<MultiVector> MueLu::Constraint< Scalar, LocalOrdinal, GlobalOrdinal, Node >::Bc_
private

Definition at line 108 of file MueLu_Constraint_decl.hpp.

◆ X_

template<class Scalar = DefaultScalar, class LocalOrdinal = DefaultLocalOrdinal, class GlobalOrdinal = DefaultGlobalOrdinal, class Node = DefaultNode>
RCP<MultiVector> MueLu::Constraint< Scalar, LocalOrdinal, GlobalOrdinal, Node >::X_
private

Overlapped coarse nullspace.

Definition at line 109 of file MueLu_Constraint_decl.hpp.

◆ Ppattern_

template<class Scalar = DefaultScalar, class LocalOrdinal = DefaultLocalOrdinal, class GlobalOrdinal = DefaultGlobalOrdinal, class Node = DefaultNode>
RCP<const CrsGraph> MueLu::Constraint< Scalar, LocalOrdinal, GlobalOrdinal, Node >::Ppattern_
private

Nonzero sparsity pattern.

Definition at line 110 of file MueLu_Constraint_decl.hpp.

◆ XXtInv_

template<class Scalar = DefaultScalar, class LocalOrdinal = DefaultLocalOrdinal, class GlobalOrdinal = DefaultGlobalOrdinal, class Node = DefaultNode>
ArrayRCP<Teuchos::SerialDenseMatrix<LO, SC> > MueLu::Constraint< Scalar, LocalOrdinal, GlobalOrdinal, Node >::XXtInv_
private

Array storing \((Q_i Q_i^H)^{-1}\).

Definition at line 111 of file MueLu_Constraint_decl.hpp.


The documentation for this class was generated from the following files: