Class documentation of Concepts

Loading...
Searching...
No Matches

#include <belosSolver.hh>

Inheritance diagram for concepts::BelosSolver< T >:
concepts::VecOperator< T > concepts::Operator< F > concepts::OutputOperator

Public Types

typedef Tpetra::MultiVector< T, intMV
 
typedef Tpetra::Operator< T > OP
 
typedef Tpetra::CrsMatrix< T, int, intCRSmat
 
typedef BelosLinProb< T, MV, OP > LP
 
typedef Belos::SolverManager< T, MV, OP > solverManager
 
typedef Realtype< T >::type r_type
 Real type of data type.
 
typedef Cmplxtype< T >::type c_type
 Real type of data type.
 
typedeftype
 Type of data, e.g. matrix entries.
 

Public Member Functions

 BelosSolver (concepts::SparseMatrix< T > &sparse, Teuchos::RCP< const Teuchos::Comm< int > > comm)
 Constructor for the root thread.
 
 BelosSolver (Teuchos::RCP< const Teuchos::Comm< int > > comm)
 Constructor for other threads wich don't know the concets::SparseMatrix.
 
virtual void operator() ()
 Solving operator for other the non-root threads.
 
virtual void operator() (const Vector< T > &fncY, Vector< T > &fncX)
 
void setSolverParam (Teuchos::RCP< Teuchos::ParameterList > param)
 
void setSolverParam (int maxIter, int maxRestarts, double tol=1e-10, int blockSize=1, int outFreq=1)
 
Teuchos::RCP< Teuchos::ParameterList > getSolverParam ()
 Get solver parameter list.
 
void setPrecParam (Teuchos::RCP< Teuchos::ParameterList > param)
 
void setPrecParam (double fill, double tol=1e-5, int absTresh=0, int relTresh=1, double relax=0)
 
Teuchos::RCP< Teuchos::ParameterList > getPrecParam ()
 Gets the parameter list for the preconditioner.
 
void setSolverManager (Teuchos::RCP< solverManager > manager)
 
Teuchos::RCP< solverManager > getSolverManager ()
 
Teuchos::RCP< LPgetLinearProblem ()
 
void setSolverType (std::string type)
 
std::string getSolverType ()
 Getter for the solver type.
 
void setPrecType (std::string type)
 
std::string getPrecType ()
 
void prepare ()
 Builds the Preconditioner and the solver (sets prepare to true)
 
virtual void operator() (const Function< r_type > &fncY, Function< T > &fncX)
 
virtual void operator() (const Function< c_type > &fncY, Function< c_type > &fncX)
 
virtual void operator() (const Vector< r_type > &fncY, Vector< T > &fncX)
 
virtual void operator() (const Vector< c_type > &fncY, Vector< c_type > &fncX)
 
void operator() (const Matrix< r_type > &mX, Matrix< T > &mY)
 Application method to real matrices. Calls function apply()
 
void operator() (const Matrix< c_type > &mX, Matrix< c_type > &mY)
 Application method to complex matrices. Calls apply_()
 
virtual void operator() (const Function< r_type > &fncY, Function< F > &fncX)
 
virtual const uint dimX () const
 
virtual const uint dimY () const
 
virtual void show_messages ()
 

Protected Member Functions

virtual std::ostream & info (std::ostream &os) const
 Returns information in an output stream.
 

Protected Attributes

uint dimX_
 Dimension of image space and the source space.
 
uint dimY_
 

Detailed Description

template<class T>
class concepts::BelosSolver< T >

Concepts interface to Trilinos Belos solver with different ifpack2 preconditioners and different iterative solvers.

Author
Holger Brandsmeier, ETHZ, 2011
Christian Heier, TUB, 2012

Definition at line 32 of file belosSolver.hh.

Member Typedef Documentation

◆ c_type

typedef Cmplxtype<T >::type concepts::VecOperator< T >::c_type
inherited

Real type of data type.

Definition at line 120 of file compositions.hh.

◆ CRSmat

template<class T >
typedef Tpetra::CrsMatrix<T, int, int> concepts::BelosSolver< T >::CRSmat

Definition at line 38 of file belosSolver.hh.

◆ LP

template<class T >
typedef BelosLinProb<T, MV, OP> concepts::BelosSolver< T >::LP

Definition at line 39 of file belosSolver.hh.

◆ MV

template<class T >
typedef Tpetra::MultiVector<T, int> concepts::BelosSolver< T >::MV

Definition at line 36 of file belosSolver.hh.

◆ OP

template<class T >
typedef Tpetra::Operator<T> concepts::BelosSolver< T >::OP

Definition at line 37 of file belosSolver.hh.

◆ r_type

typedef Realtype<T >::type concepts::VecOperator< T >::r_type
inherited

Real type of data type.

Definition at line 118 of file compositions.hh.

◆ solverManager

template<class T >
typedef Belos::SolverManager<T, MV, OP> concepts::BelosSolver< T >::solverManager

Definition at line 40 of file belosSolver.hh.

◆ type

template<class F >
typedef F concepts::Operator< F >::type
inherited

Type of data, e.g. matrix entries.

Definition at line 45 of file compositions.hh.

Constructor & Destructor Documentation

◆ BelosSolver() [1/2]

template<class T >
concepts::BelosSolver< T >::BelosSolver ( concepts::SparseMatrix< T > &  sparse,
Teuchos::RCP< const Teuchos::Comm< int > >  comm 
)

Constructor for the root thread.

Definition at line 257 of file belosSolver.hh.

◆ BelosSolver() [2/2]

template<class T >
concepts::BelosSolver< T >::BelosSolver ( Teuchos::RCP< const Teuchos::Comm< int > >  comm)

Constructor for other threads wich don't know the concets::SparseMatrix.

Definition at line 267 of file belosSolver.hh.

◆ ~BelosSolver()

template<class T >
virtual concepts::BelosSolver< T >::~BelosSolver ( )
inlinevirtual

Definition at line 48 of file belosSolver.hh.

Member Function Documentation

◆ dimX()

template<class F >
virtual const uint concepts::Operator< F >::dimX ( ) const
inlinevirtualinherited

Returns the size of the image space of the operator (number of rows of the corresponding matrix)

Examples
hpFEM2d-simple.cc, hpFEM2d.cc, and matfileTutorial.cc.

Definition at line 93 of file compositions.hh.

◆ dimY()

template<class F >
virtual const uint concepts::Operator< F >::dimY ( ) const
inlinevirtualinherited

Returns the size of the source space of the operator (number of columns of the corresponding matrix)

Examples
matfileTutorial.cc.

Definition at line 98 of file compositions.hh.

◆ getLinearProblem()

template<class T >
Teuchos::RCP< LP > concepts::BelosSolver< T >::getLinearProblem ( )
inline

Definition at line 153 of file belosSolver.hh.

◆ getPrecParam()

template<class T >
Teuchos::RCP< Teuchos::ParameterList > concepts::BelosSolver< T >::getPrecParam ( )
inline

Gets the parameter list for the preconditioner.

Definition at line 131 of file belosSolver.hh.

◆ getPrecType()

template<class T >
std::string concepts::BelosSolver< T >::getPrecType ( )
inline

Definition at line 188 of file belosSolver.hh.

◆ getSolverManager()

template<class T >
Teuchos::RCP< solverManager > concepts::BelosSolver< T >::getSolverManager ( )
inline

Gets the solver via solver manager

Definition at line 148 of file belosSolver.hh.

◆ getSolverParam()

template<class T >
Teuchos::RCP< Teuchos::ParameterList > concepts::BelosSolver< T >::getSolverParam ( )
inline

Get solver parameter list.

Definition at line 98 of file belosSolver.hh.

◆ getSolverType()

template<class T >
std::string concepts::BelosSolver< T >::getSolverType ( )
inline

Getter for the solver type.

Definition at line 169 of file belosSolver.hh.

◆ info()

template<class T >
virtual std::ostream & concepts::BelosSolver< T >::info ( std::ostream &  os) const
protectedvirtual

Returns information in an output stream.

Reimplemented from concepts::VecOperator< T >.

◆ operator()() [1/6]

template<class T >
virtual void concepts::BelosSolver< T >::operator() ( )
inlinevirtual

Solving operator for other the non-root threads.

Reimplemented from concepts::Operator< F >.

Definition at line 53 of file belosSolver.hh.

◆ operator()() [2/6]

virtual void concepts::VecOperator< T >::operator() ( const Function< c_type > &  fncY,
Function< c_type > &  fncX 
)
virtualinherited

Application operator for complex function fncY.

Computes fncX = A(fncY) where A is this operator. fncX becomes complex.

In derived classes its enough to implement the operator() for complex Operator's. If a real counterpart is not implemented, the function fncY is splitted into real and imaginary part and the application operator for real functions is called for each. Then the result is combined.

If in a derived class the operator() for complex Operator's is not implemented, a exception is thrown from here.

Reimplemented from concepts::Operator< F >.

◆ operator()() [3/6]

template<class F >
virtual void concepts::Operator< F >::operator() ( const Function< r_type > &  fncY,
Function< F > &  fncX 
)
virtualinherited

Application operator for real function fncY.

Computes fncX = A(fncY) where A is this operator.

fncX becomes the type of the operator, for real data it becomes real, for complex data it becomes complex.

In derived classes its enough to implement the operator() for real Operator's. If a complex counterpart is not implemented, the function fncY is transformed to a complex function and then the application operator for complex functions is called.

If in a derived class the operator() for real Operator's is not implemented, a exception is thrown from here.

Reimplemented in aglowav::C2W< F >, aglowav2::C2W< F >, aglowav::W2C< F >, aglowav2::W2C< F >, aglowav::C2_tl2< F >, aglowav::C2tl2< F >, aglowav::CGt2< F >, aglowav::ComposeN< F >, aglowav2::Operator00< F >, bem::D< F >, bem::D_1< F >, concepts::TrivExtendRestrict< F >, sparseqr::GivensRotations< F >, vectorial::BlockOperator< F >, concepts::TrivExtendRestrict< Real >, sparseqr::GivensRotations< Real >, concepts::AfterIteration< F >, concepts::Compose< F, H >, concepts::DDSolver< F, G >, concepts::Multiple< F >, concepts::LiCoI< F >, concepts::LiCo< F >, concepts::DenseMatrix< F >, concepts::DiagonalMatrix< F >, concepts::Permutation< F >, concepts::Matrix< F >, concepts::Matrix< F::type >, and concepts::DiagonalSolver< F >.

◆ operator()() [4/6]

virtual void concepts::VecOperator< T >::operator() ( const Vector< c_type > &  fncY,
Vector< c_type > &  fncX 
)
virtualinherited

Application operator for complex function fncY.

Computes fncX = A(fncY) where A is this operator. fncX becomes complex.

In derived classes its enough to implement the operator() for complex Operator's. If a real counterpart is not implemented, the vector fncY is splitted into real and imaginary part and the application operator for real vectors is called for each. Then the result is combined

If in a derived class the operator() for complex Operator's i not implemented, a exception is thrown from here.

◆ operator()() [5/6]

virtual void concepts::VecOperator< T >::operator() ( const Vector< r_type > &  fncY,
Vector< T > &  fncX 
)
virtualinherited

Application operator for real vector fncY.

Computes fncX = A(fncY) where A is this operator.

Type of fncX becomes that of the operator, for real data it becomes real, for complex data it becomes complex.

In derived classes its enough to implement the operator() for real Operator's. If a complex counterpart is not implemented, the vector fncY is transformed to a complex vector and then the application for complex vectors is called.

If in a derived class the operator() for real Operator's is not implemented, a exception is thrown from here.

◆ operator()() [6/6]

template<class T >
virtual void concepts::BelosSolver< T >::operator() ( const Vector< T > &  fncY,
Vector< T > &  fncX 
)
inlinevirtual

Solving operator for the root thread

Parameters
fncYthe right hand side
thesolution vector

Definition at line 62 of file belosSolver.hh.

◆ prepare()

template<class T >
void concepts::BelosSolver< T >::prepare ( )
inline

Builds the Preconditioner and the solver (sets prepare to true)

Definition at line 194 of file belosSolver.hh.

◆ setPrecParam() [1/2]

template<class T >
void concepts::BelosSolver< T >::setPrecParam ( double  fill,
double  tol = 1e-5,
int  absTresh = 0,
int  relTresh = 1,
double  relax = 0 
)
inline

Set preconditoner parameter list via values

Parameters
fillwidth of the bandmatrix used for preconditioning
toltolerance for the preconditioner

Definition at line 116 of file belosSolver.hh.

◆ setPrecParam() [2/2]

template<class T >
void concepts::BelosSolver< T >::setPrecParam ( Teuchos::RCP< Teuchos::ParameterList >  param)
inline

Set preconditioner parameter list via Teuchos::parameter list

Parameters
paramParameterlist that contains the parameter for the preconditioner

Definition at line 106 of file belosSolver.hh.

◆ setPrecType()

template<class T >
void concepts::BelosSolver< T >::setPrecType ( std::string  type)
inline

Sets the preconditioner Type to one of the followings

  • "DIAGONAL"
  • "RELAXATION"
  • "CHEBYSHEV"
  • "ILUT"
  • "RILUK"

Definition at line 182 of file belosSolver.hh.

◆ setSolverManager()

template<class T >
void concepts::BelosSolver< T >::setSolverManager ( Teuchos::RCP< solverManager >  manager)
inline

Sets the solver via solver manager

Definition at line 139 of file belosSolver.hh.

◆ setSolverParam() [1/2]

template<class T >
void concepts::BelosSolver< T >::setSolverParam ( int  maxIter,
int  maxRestarts,
double  tol = 1e-10,
int  blockSize = 1,
int  outFreq = 1 
)
inline

Set Solver parameter list via values

Parameters
maxItermaximal number of iterations
maxRestartsmaximal number of restarts
toltolerence for the residuum

Definition at line 80 of file belosSolver.hh.

◆ setSolverParam() [2/2]

template<class T >
void concepts::BelosSolver< T >::setSolverParam ( Teuchos::RCP< Teuchos::ParameterList >  param)
inline

Set Solver parameter list via Teuchos::parameter list

Parameters
paramParameterlist that contains the parameters for the solver

Definition at line 70 of file belosSolver.hh.

◆ setSolverType()

template<class T >
void concepts::BelosSolver< T >::setSolverType ( std::string  type)
inline

Sets the solver type to one of the followings

  • "GMRES"
  • "BLOCKCG"
  • "PSEUDOCG"

Definition at line 163 of file belosSolver.hh.

◆ show_messages()

template<class F >
virtual void concepts::Operator< F >::show_messages ( )
inlinevirtualinherited

Reimplemented in concepts::MumpsOverlap< F >.

Definition at line 100 of file compositions.hh.

Member Data Documentation

◆ dimX_

template<class F >
uint concepts::Operator< F >::dimX_
protectedinherited

Dimension of image space and the source space.

Definition at line 104 of file compositions.hh.

◆ dimY_

template<class F >
uint concepts::Operator< F >::dimY_
protectedinherited

Definition at line 104 of file compositions.hh.


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