Thyra::AztecOOLinearOpWithSolve Class Reference
[AztecOO to Thyra Linear Solver Adapter Code]

Concrete LinearOpWithSolveBase subclass implemented using AztecOO. More...

#include <Thyra_AztecOOLinearOpWithSolve.hpp>

Inheritance diagram for Thyra::AztecOOLinearOpWithSolve:

Inheritance graph
[legend]
List of all members.

Constructors/initializers/accessors

typedef ::Teuchos::DummyDummyClass fwdDefaultMaxIterationsDummyDummyClass_t
typedef ::Teuchos::DummyDummyClass fwdDefaultTolDummyDummyClass_t
typedef ::Teuchos::DummyDummyClass adjDefaultMaxIterationsDummyDummyClass_t
typedef ::Teuchos::DummyDummyClass adjDefaultTolDummyDummyClass_t
typedef ::Teuchos::DummyDummyClass outputEveryRhsDummyDummyClass_t
 AztecOOLinearOpWithSolve (const int fwdDefaultMaxIterations=400, const double fwdDefaultTol=1e-6, const int adjDefaultMaxIterations=400, const double adjDefaultTol=1e-6, const bool outputEveryRhs=false)
 Construct uninitialized but with default option values.
void fwdDefaultMaxIterations (const int &fwdDefaultMaxIterations)
 The default maximum number of iterations for forward solves.
const int & fwdDefaultMaxIterations () const
void fwdDefaultTol (const double &fwdDefaultTol)
 The default solution tolerance on the residual for forward solves.
const double & fwdDefaultTol () const
void adjDefaultMaxIterations (const int &adjDefaultMaxIterations)
 The default maximum number of iterations for adjoint solves.
const int & adjDefaultMaxIterations () const
void adjDefaultTol (const double &adjDefaultTol)
 The default solution tolerance on the residual for adjoint solves.
const double & adjDefaultTol () const
void outputEveryRhs (const bool &outputEveryRhs)
 Determine if output for every RHS will be printed or not.
const bool & outputEveryRhs () const
void initialize (const Teuchos::RefCountPtr< const LinearOpBase< double > > &fwdOp, const Teuchos::RefCountPtr< const LinearOpSourceBase< double > > &fwdOpSrc, const Teuchos::RefCountPtr< const PreconditionerBase< double > > &prec, const bool isExternalPrec, const Teuchos::RefCountPtr< const LinearOpSourceBase< double > > &approxFwdOpSrc, const Teuchos::RefCountPtr< AztecOO > &aztecFwdSolver, const bool allowInexactFwdSolve=false, const Teuchos::RefCountPtr< AztecOO > &aztecAdjSolver=Teuchos::null, const bool allowInexactAdjSolve=false, const double aztecSolverScalar=1.0)
 Sets up this object.
Teuchos::RefCountPtr< const
LinearOpSourceBase< double > > 
extract_fwdOpSrc ()
 Extract the forward LinearOpBase<double> object so that it can be modified.
Teuchos::RefCountPtr< const
PreconditionerBase< double > > 
extract_prec ()
 Extract the preconditioner.
bool isExternalPrec () const
 Determine if the preconditioner was external or not.
Teuchos::RefCountPtr< const
LinearOpSourceBase< double > > 
extract_approxFwdOpSrc ()
 Extract the approximate forward LinearOpBase<double> object used to build the preconditioner.
void uninitialize (Teuchos::RefCountPtr< const LinearOpBase< double > > *fwdOp=NULL, Teuchos::RefCountPtr< const LinearOpSourceBase< double > > *fwdOpSrc=NULL, Teuchos::RefCountPtr< const PreconditionerBase< double > > *prec=NULL, bool *isExternalPrec=NULL, Teuchos::RefCountPtr< const LinearOpSourceBase< double > > *approxFwdOpSrc=NULL, Teuchos::RefCountPtr< AztecOO > *aztecFwdSolver=NULL, bool *allowInexactFwdSolve=NULL, Teuchos::RefCountPtr< AztecOO > *aztecAdjSolver=NULL, bool *allowInexactAdjSolve=NULL, double *aztecSolverScalar=NULL)
 Uninitialize.

Overridden from LinearOpBase

Teuchos::RefCountPtr< const
VectorSpaceBase< double > > 
range () const
 .
Teuchos::RefCountPtr< const
VectorSpaceBase< double > > 
domain () const
 .
Teuchos::RefCountPtr< const
LinearOpBase< double > > 
clone () const
 .

Overridden from Teuchos::Describable

std::string description () const
 
void describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
 

Overridden from SingleScalarLinearOpBase

bool opSupported (ETransp M_trans) const
 

Overridden from SingleRhsLinearOpBase

void apply (const ETransp M_trans, const VectorBase< double > &x, VectorBase< double > *y, const double alpha, const double beta) const
 

Overridden from SingleScalarLinearOpWithSolveBase

bool solveSupportsTrans (ETransp M_trans) const
 
bool solveSupportsSolveMeasureType (ETransp M_trans, const SolveMeasureType &solveMeasureType) const
 
void solve (const ETransp M_trans, const MultiVectorBase< double > &B, MultiVectorBase< double > *X, const int numBlocks, const BlockSolveCriteria< double > blockSolveCriteria[], SolveStatus< double > blockSolveStatus[]) const
 

Detailed Description

Concrete LinearOpWithSolveBase subclass implemented using AztecOO.

This subclass is designed to be very flexible and handle a number of different use cases. It supports forward and optionally adjoint (transpose) solves. I can support inexact solves based on a relative residual norm tolerance or just allow for a default (i.e. tight) linear solve tolerance.

This subclass is not designed to be used directly by users but instead by subclasses of LinearOpWithSolveFactoryBase. One standard implementation that is fairly flexible (and will be make more flexible in the future) is AztecOOLinearOpWithSolveFactory.

This subclass allows for user-defined preconditioners or for built-in aztec preconditioners.

ToDo: Finish documentation!


Member Typedef Documentation

typedef ::Teuchos::DummyDummyClass Thyra::AztecOOLinearOpWithSolve::fwdDefaultMaxIterationsDummyDummyClass_t
 

typedef ::Teuchos::DummyDummyClass Thyra::AztecOOLinearOpWithSolve::fwdDefaultTolDummyDummyClass_t
 

typedef ::Teuchos::DummyDummyClass Thyra::AztecOOLinearOpWithSolve::adjDefaultMaxIterationsDummyDummyClass_t
 

typedef ::Teuchos::DummyDummyClass Thyra::AztecOOLinearOpWithSolve::adjDefaultTolDummyDummyClass_t
 

typedef ::Teuchos::DummyDummyClass Thyra::AztecOOLinearOpWithSolve::outputEveryRhsDummyDummyClass_t
 


Constructor & Destructor Documentation

Thyra::AztecOOLinearOpWithSolve::AztecOOLinearOpWithSolve const int  fwdDefaultMaxIterations = 400,
const double  fwdDefaultTol = 1e-6,
const int  adjDefaultMaxIterations = 400,
const double  adjDefaultTol = 1e-6,
const bool  outputEveryRhs = false
 

Construct uninitialized but with default option values.

Note, these defaults where taken from NOX::EpetraNew::LinearSystemAztecOO::applyJacobianInverse(...) on 2005/08/15.


Member Function Documentation

void Thyra::AztecOOLinearOpWithSolve::fwdDefaultMaxIterations const int &  fwdDefaultMaxIterations  )  [inline]
 

The default maximum number of iterations for forward solves.

const int& Thyra::AztecOOLinearOpWithSolve::fwdDefaultMaxIterations  )  const [inline]
 

void Thyra::AztecOOLinearOpWithSolve::fwdDefaultTol const double &  fwdDefaultTol  )  [inline]
 

The default solution tolerance on the residual for forward solves.

const double& Thyra::AztecOOLinearOpWithSolve::fwdDefaultTol  )  const [inline]
 

void Thyra::AztecOOLinearOpWithSolve::adjDefaultMaxIterations const int &  adjDefaultMaxIterations  )  [inline]
 

The default maximum number of iterations for adjoint solves.

const int& Thyra::AztecOOLinearOpWithSolve::adjDefaultMaxIterations  )  const [inline]
 

void Thyra::AztecOOLinearOpWithSolve::adjDefaultTol const double &  adjDefaultTol  )  [inline]
 

The default solution tolerance on the residual for adjoint solves.

const double& Thyra::AztecOOLinearOpWithSolve::adjDefaultTol  )  const [inline]
 

void Thyra::AztecOOLinearOpWithSolve::outputEveryRhs const bool &  outputEveryRhs  )  [inline]
 

Determine if output for every RHS will be printed or not.

const bool& Thyra::AztecOOLinearOpWithSolve::outputEveryRhs  )  const [inline]
 

void Thyra::AztecOOLinearOpWithSolve::initialize const Teuchos::RefCountPtr< const LinearOpBase< double > > &  fwdOp,
const Teuchos::RefCountPtr< const LinearOpSourceBase< double > > &  fwdOpSrc,
const Teuchos::RefCountPtr< const PreconditionerBase< double > > &  prec,
const bool  isExternalPrec,
const Teuchos::RefCountPtr< const LinearOpSourceBase< double > > &  approxFwdOpSrc,
const Teuchos::RefCountPtr< AztecOO > &  aztecFwdSolver,
const bool  allowInexactFwdSolve = false,
const Teuchos::RefCountPtr< AztecOO > &  aztecAdjSolver = Teuchos::null,
const bool  allowInexactAdjSolve = false,
const double  aztecSolverScalar = 1.0
 

Sets up this object.

Parameters:
fwdOp [in] The forward operator object that defines this objects LinearOpBase interface. interface.
fwdOpSrc [in] The source for the forward operator object fwdOp. This also should be the exact same object that is passed in through a LinearOpWithSolveFactoryBase interface.
prec [in] The original abstract preconditioner object that was passed through the LinearOpWithSolveFactoryBase interface. This object is not used for anything and can be set as prec==Teuchos::null.
isExternalPrec [in] True if the precondition was created externally from the LinearOpWithSolveFactoryBase object, false otherwise.
approxFwdOpSrc [in] The source for the original abstract approximate forward operator object that was passed through the LinearOpWithSolveFactoryBase interface. This object is not used for anything and can be set as approxFwdOpSrc==Teuchos::null.
aztecFwdSolver [in] The AztecOO object used to perform forward solves. This object must be be ready to call aztecFwdSolver->SetRHS() and aztecFwdSolver->SetLHS() and then call aztecFwdSolver->Solve().
allowInexactFwdSolve [in] Determines if this->solveSupportsSolveTolType(NOTRANS,SOLVE_TOL_REL_RESIDUAL_NORM) returns true or not. With the current design, an inexact forward solve can not be supported if there is left scaling or a left preconditioner aggregated with *aztecFwdOp.
aztecAdjSolver [in] The AztecOO object used to perform adjoint solves. This object must be be ready to call aztecAdjSolver->SetRHS() and aztecAdjSolver->SetLHS() and then call aztecAdjSolver->Solve().
allowInexactAdjSolve [in] Determines if this->solveSupportsSolveTolType(TRANS,SOLVE_TOL_REL_RESIDUAL_NORM) returns true or not. With the current design, an inexact forward solve can not be supported if there is left scaling or a left preconditioner aggregated with *aztecFwdOp.
linearSystemTransformer [in] This is a transformation object that is called to pre-preprocess the linear problem before a forward and adjoint linear solver and post-process the linear problem after forward and adjoint linear solve. This abstract object is used to deal with scaling and aggregated preconditioners. It is what makes this implementation fairly flexible.
Preconditions:
  • fwdOp.get()!=NULL
  • fwdOpSrc.get()!=NULL
  • fwdFwdSolver.get()!=NULL

Postconditions:

  • this->range() == fwdOp->range()
  • this->domain() == fwdOp->domain()
  • this->opSupports(M_trans) == opSupports(*fwdOp,M_trans)
  • this->solveSupportsTrans(M_trans) == (aztecAdjSolver.get()!=NULL)
  • this->solveSupportsSolveTolType([NOTRANS,CONJ], SolveMeasureType(SOLVE_MEASURE_NORM_RESIDUAL,SOLVE_MESURE_NORM_RHS)) == allowInexactFwdSolve
  • this->solveSupportsSolveTolType([TRANS,CONJTRANS], SolveMeasureType(SOLVE_MEASURE_NORM_RESIDUAL,SOLVE_MESURE_NORM_RHS)) == (aztecAdjSolver.get()!=NULL&&allowInexactAdjSolve)

ToDo: Finish documentation!

Teuchos::RefCountPtr< const LinearOpSourceBase< double > > Thyra::AztecOOLinearOpWithSolve::extract_fwdOpSrc  ) 
 

Extract the forward LinearOpBase<double> object so that it can be modified.

Teuchos::RefCountPtr< const PreconditionerBase< double > > Thyra::AztecOOLinearOpWithSolve::extract_prec  ) 
 

Extract the preconditioner.

bool Thyra::AztecOOLinearOpWithSolve::isExternalPrec  )  const
 

Determine if the preconditioner was external or not.

Teuchos::RefCountPtr< const LinearOpSourceBase< double > > Thyra::AztecOOLinearOpWithSolve::extract_approxFwdOpSrc  ) 
 

Extract the approximate forward LinearOpBase<double> object used to build the preconditioner.

void Thyra::AztecOOLinearOpWithSolve::uninitialize Teuchos::RefCountPtr< const LinearOpBase< double > > *  fwdOp = NULL,
Teuchos::RefCountPtr< const LinearOpSourceBase< double > > *  fwdOpSrc = NULL,
Teuchos::RefCountPtr< const PreconditionerBase< double > > *  prec = NULL,
bool *  isExternalPrec = NULL,
Teuchos::RefCountPtr< const LinearOpSourceBase< double > > *  approxFwdOpSrc = NULL,
Teuchos::RefCountPtr< AztecOO > *  aztecFwdSolver = NULL,
bool *  allowInexactFwdSolve = NULL,
Teuchos::RefCountPtr< AztecOO > *  aztecAdjSolver = NULL,
bool *  allowInexactAdjSolve = NULL,
double *  aztecSolverScalar = NULL
 

Uninitialize.

Teuchos::RefCountPtr< const VectorSpaceBase< double > > Thyra::AztecOOLinearOpWithSolve::range  )  const
 

.

Teuchos::RefCountPtr< const VectorSpaceBase< double > > Thyra::AztecOOLinearOpWithSolve::domain  )  const
 

.

Teuchos::RefCountPtr< const LinearOpBase< double > > Thyra::AztecOOLinearOpWithSolve::clone  )  const
 

.

std::string Thyra::AztecOOLinearOpWithSolve::description  )  const
 

Reimplemented from Thyra::LinearOpDefaultBase< Scalar >.

void Thyra::AztecOOLinearOpWithSolve::describe Teuchos::FancyOStream out,
const Teuchos::EVerbosityLevel  verbLevel
const
 

Reimplemented from Thyra::LinearOpDefaultBase< Scalar >.

bool Thyra::AztecOOLinearOpWithSolve::opSupported ETransp  M_trans  )  const [protected, virtual]
 

Implements Thyra::SingleScalarLinearOpBase< Scalar >.

void Thyra::AztecOOLinearOpWithSolve::apply const ETransp  M_trans,
const VectorBase< double > &  x,
VectorBase< double > *  y,
const double  alpha,
const double  beta
const [protected, virtual]
 

Implements Thyra::SingleRhsLinearOpBase< double >.

bool Thyra::AztecOOLinearOpWithSolve::solveSupportsTrans ETransp  M_trans  )  const [protected, virtual]
 

Implements Thyra::SingleScalarLinearOpWithSolveBase< double >.

bool Thyra::AztecOOLinearOpWithSolve::solveSupportsSolveMeasureType ETransp  M_trans,
const SolveMeasureType solveMeasureType
const [protected, virtual]
 

Implements Thyra::SingleScalarLinearOpWithSolveBase< double >.

void Thyra::AztecOOLinearOpWithSolve::solve const ETransp  M_trans,
const MultiVectorBase< double > &  B,
MultiVectorBase< double > *  X,
const int  numBlocks,
const BlockSolveCriteria< double >  blockSolveCriteria[],
SolveStatus< double >  blockSolveStatus[]
const [protected, virtual]
 

Implements Thyra::SingleScalarLinearOpWithSolveBase< double >.


The documentation for this class was generated from the following files:
Generated on Sun May 20 12:51:22 2007 for Aztecoo/Thyra Linear Solver Adapter Software by doxygen 1.3.9.1