ML_Epetra::MatrixFreePreconditioner Class Reference

MatrixFreePreconditioner: a class to define preconditioners for Epetra_Operator's. More...

#include <ml_MatrixFreePreconditioner.h>

Collaboration diagram for ML_Epetra::MatrixFreePreconditioner:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 MatrixFreePreconditioner (const Epetra_Operator &Operator, const Epetra_CrsGraph &Graph, Epetra_MultiVector &NullSpace, const Epetra_Vector &PointDiagonal, Teuchos::ParameterList &List)
 Constructor.
virtual ~MatrixFreePreconditioner ()
 destructor
int SetUseTranspose (bool UseTranspose)
 Sets the use of the transpose of the operator (NOT SUPPORTED).
int Apply (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 Applies the operator to a std::vector (NOT SUPPORTED).
int ApplyInverse (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 Applies the preconditioner to std::vector X, returns the result in Y.
double NormInf () const
 Returns the infinite norm of the operator (NOT SUPPORTED).
const char * Label () const
 Returns the label of this operator.
bool UseTranspose () const
 Returns true if the tranpose of the operator is considerd (NOT SUPPORTED).
bool HasNormInf () const
 Returns false.
const Epetra_Comm & Comm () const
 Returns a reference to the communicator object.
const Epetra_Map & OperatorDomainMap () const
 Returns the domain map of the operator.
const Epetra_Map & OperatorRangeMap () const
 Returns the range map of the operator.
const Epetra_RowMatrix & C () const
 Returns the coarser-level operator as an Epetra_RowMatrix.
const MultiLevelPreconditionerMLP () const
const Epetra_CrsMatrix & R () const
 Returns the restriction operator as an Epetra_CrsMatrix.
ML_Comm * Comm_ML ()
 Returns the ML communicator of this object.
int MyPID () const
 Returns the PID of the calling processor.
int NumProc () const
 Returns the number of processors in the communicator.
bool IsComputed () const
 Returns true if the preconditioner has been successfully computed.
double TotalCPUTime () const
 Returns the total CPU time spent in this class.
bool CheckSPD (const Epetra_Operator &Op, const bool UseApply=true, const int NumChecks=1, const int NumVectors=1) const

Private Member Functions

int ApplyPreSmoother (Epetra_MultiVector &X) const
 Applies the pre-smoother (using zero starting solution).
int ApplyPostSmoother (Epetra_MultiVector &X, const Epetra_MultiVector &Y, Epetra_MultiVector &tmp) const
 Applies the post-smoother (using non-zero starting solution).
int ApplyJacobi (Epetra_MultiVector &X, const double omega) const
 Applies one sweep of Jacobi to std::vector X.
int ApplyJacobi (Epetra_MultiVector &X, const Epetra_MultiVector &B, const double omega, Epetra_MultiVector &tmp) const
 Applies one sweep of Jacobi to std::vector X, using X as starting solution.
int ApplyBlockJacobi (Epetra_MultiVector &X, const double omega) const
 Applies one sweep of block Jacobi to std::vector X.
int ApplyBlockJacobi (Epetra_MultiVector &X, const Epetra_MultiVector &B, const double omega, Epetra_MultiVector &tmp) const
 Applies one sweep of block Jacobi to std::vector X, using X as starting solution.
int ApplyInvBlockDiag (const double alpha, Epetra_MultiVector &X, const double gamma, const Epetra_MultiVector &B) const
void ResetStartTime () const
void AddAndResetStartTime (const std::string &Label, const int print=false) const
void PrintTimings () const

Private Attributes

bool verbose_
 Toggles output level.
ML_Comm * Comm_ML_
 Communicator for ML.
const Epetra_Comm & Comm_
 Communicator object for Epetra.
std::string Label_
 Label of this object.
bool IsComputed_
 Set to true if the preconditioner has been successfully computed.
int PrecType_
 Type of preconditioner (additive or hybrid).
int SmootherType_
 Type of smoother (Jacobi, block Jacobi, or Chebyshev).
double omega_
 Damping parameter for Jacobi.
Teuchos::ParameterList List_
 List containing all the parameters.
const Epetra_Operator & Operator_
 Fine-level operator.
Teuchos::RefCountPtr
< Epetra_Vector > 
InvPointDiagonal_
 Inverse of the point diagonal of the operator.
std::vector< double > InvBlockDiag_
 Inverse of the diagonal of Operator_ as provided by the user.
Teuchos::RefCountPtr
< Ifpack_Chebyshev > 
PreSmoother_
 Presmoother.
Teuchos::RefCountPtr
< Ifpack_Chebyshev > 
PostSmoother_
 Presmoother.
Teuchos::RefCountPtr
< Epetra_CrsMatrix > 
R_
 Restriction from fine to coarse.
Teuchos::RefCountPtr
< Epetra_RowMatrix > 
C_
 Coarser-level operator as an Epetra_RowMatrix (wrapper for C_ML_).
ML_OperatorC_ML_
 Coarser-level operator as an ML_Operator.
Teuchos::RefCountPtr
< MultiLevelPreconditioner
MLP_
 Preconditioner that approximates the inverse of C_.
int NumPDEEqns_
 Number of PDE equations.
int NumMyBlockRows_
Teuchos::RefCountPtr< Epetra_Time > Time_
 Time object.
std::map< std::string, double > TimeTable
int Coarsen (ML_Operator *A, ML_Aggregate **aggr, ML_Operator **P, ML_Operator **R, ML_Operator **C, int NumPDEEqns=1, int NullSpaceDim=1, double *NullSpace=NULL)
 Performs coarsening for a given operator A.
int GetBlockDiagonal (const Epetra_CrsGraph &Graph, std::string DiagonalColoringType)
 Probes for the block diagonal of the given operator.
int Compute (const Epetra_CrsGraph &Graph, Epetra_MultiVector &NullSpace)
 Computes the preconditioner.


Detailed Description

This file requires ML to be configured with the following options:

The following options are suggested:

This class does not support Maxwell problems. It has been tested on symmetric problems; however it can in principle be used with non-symmetric problems as well.

Author:
Marzio Sala, ETHZ/D-INFK

Constructor & Destructor Documentation

ML_Epetra::MatrixFreePreconditioner::MatrixFreePreconditioner ( const Epetra_Operator &  Operator,
const Epetra_CrsGraph &  Graph,
Epetra_MultiVector &  NullSpace,
const Epetra_Vector &  PointDiagonal,
Teuchos::ParameterList &  List 
)

virtual ML_Epetra::MatrixFreePreconditioner::~MatrixFreePreconditioner (  )  [virtual]


Member Function Documentation

void ML_Epetra::MatrixFreePreconditioner::AddAndResetStartTime ( const std::string &  Label,
const int  print = false 
) const [inline, private]

int ML_Epetra::MatrixFreePreconditioner::Apply ( const Epetra_MultiVector &  X,
Epetra_MultiVector &  Y 
) const

int ML_Epetra::MatrixFreePreconditioner::ApplyBlockJacobi ( Epetra_MultiVector &  X,
const Epetra_MultiVector &  B,
const double  omega,
Epetra_MultiVector &  tmp 
) const [private]

int ML_Epetra::MatrixFreePreconditioner::ApplyBlockJacobi ( Epetra_MultiVector &  X,
const double  omega 
) const [private]

int ML_Epetra::MatrixFreePreconditioner::ApplyInvBlockDiag ( const double  alpha,
Epetra_MultiVector &  X,
const double  gamma,
const Epetra_MultiVector &  B 
) const [private]

int ML_Epetra::MatrixFreePreconditioner::ApplyInverse ( const Epetra_MultiVector &  X,
Epetra_MultiVector &  Y 
) const

int ML_Epetra::MatrixFreePreconditioner::ApplyJacobi ( Epetra_MultiVector &  X,
const Epetra_MultiVector &  B,
const double  omega,
Epetra_MultiVector &  tmp 
) const [private]

int ML_Epetra::MatrixFreePreconditioner::ApplyJacobi ( Epetra_MultiVector &  X,
const double  omega 
) const [private]

int ML_Epetra::MatrixFreePreconditioner::ApplyPostSmoother ( Epetra_MultiVector &  X,
const Epetra_MultiVector &  Y,
Epetra_MultiVector &  tmp 
) const [private]

int ML_Epetra::MatrixFreePreconditioner::ApplyPreSmoother ( Epetra_MultiVector &  X  )  const [private]

const Epetra_RowMatrix& ML_Epetra::MatrixFreePreconditioner::C (  )  const [inline]

bool ML_Epetra::MatrixFreePreconditioner::CheckSPD ( const Epetra_Operator &  Op,
const bool  UseApply = true,
const int  NumChecks = 1,
const int  NumVectors = 1 
) const

int ML_Epetra::MatrixFreePreconditioner::Coarsen ( ML_Operator A,
ML_Aggregate **  aggr,
ML_Operator **  P,
ML_Operator **  R,
ML_Operator **  C,
int  NumPDEEqns = 1,
int  NullSpaceDim = 1,
double *  NullSpace = NULL 
)

const Epetra_Comm& ML_Epetra::MatrixFreePreconditioner::Comm (  )  const [inline]

ML_Comm* ML_Epetra::MatrixFreePreconditioner::Comm_ML (  )  [inline]

int ML_Epetra::MatrixFreePreconditioner::Compute ( const Epetra_CrsGraph &  Graph,
Epetra_MultiVector &  NullSpace 
) [private]

int ML_Epetra::MatrixFreePreconditioner::GetBlockDiagonal ( const Epetra_CrsGraph &  Graph,
std::string  DiagonalColoringType 
)

bool ML_Epetra::MatrixFreePreconditioner::HasNormInf (  )  const [inline]

bool ML_Epetra::MatrixFreePreconditioner::IsComputed (  )  const [inline]

const char* ML_Epetra::MatrixFreePreconditioner::Label (  )  const [inline]

const MultiLevelPreconditioner& ML_Epetra::MatrixFreePreconditioner::MLP (  )  const [inline]

int ML_Epetra::MatrixFreePreconditioner::MyPID (  )  const [inline]

double ML_Epetra::MatrixFreePreconditioner::NormInf (  )  const [inline]

int ML_Epetra::MatrixFreePreconditioner::NumProc (  )  const [inline]

const Epetra_Map& ML_Epetra::MatrixFreePreconditioner::OperatorDomainMap (  )  const [inline]

const Epetra_Map& ML_Epetra::MatrixFreePreconditioner::OperatorRangeMap (  )  const [inline]

void ML_Epetra::MatrixFreePreconditioner::PrintTimings (  )  const [inline, private]

const Epetra_CrsMatrix& ML_Epetra::MatrixFreePreconditioner::R (  )  const [inline]

void ML_Epetra::MatrixFreePreconditioner::ResetStartTime (  )  const [inline, private]

int ML_Epetra::MatrixFreePreconditioner::SetUseTranspose ( bool  UseTranspose  ) 

double ML_Epetra::MatrixFreePreconditioner::TotalCPUTime (  )  const

bool ML_Epetra::MatrixFreePreconditioner::UseTranspose (  )  const [inline]


Member Data Documentation

Teuchos::RefCountPtr<Epetra_RowMatrix> ML_Epetra::MatrixFreePreconditioner::C_ [private]

const Epetra_Comm& ML_Epetra::MatrixFreePreconditioner::Comm_ [private]

Teuchos::RefCountPtr<Epetra_Vector> ML_Epetra::MatrixFreePreconditioner::InvPointDiagonal_ [private]

Teuchos::ParameterList ML_Epetra::MatrixFreePreconditioner::List_ [private]

const Epetra_Operator& ML_Epetra::MatrixFreePreconditioner::Operator_ [private]

Teuchos::RefCountPtr<Ifpack_Chebyshev> ML_Epetra::MatrixFreePreconditioner::PostSmoother_ [private]

Teuchos::RefCountPtr<Ifpack_Chebyshev> ML_Epetra::MatrixFreePreconditioner::PreSmoother_ [private]

Teuchos::RefCountPtr<Epetra_CrsMatrix> ML_Epetra::MatrixFreePreconditioner::R_ [private]

Teuchos::RefCountPtr<Epetra_Time> ML_Epetra::MatrixFreePreconditioner::Time_ [mutable, private]

std::map<std::string, double> ML_Epetra::MatrixFreePreconditioner::TimeTable [mutable, private]


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