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

Concrete LinearOpWithSolveBase subclass in terms of AztecOO. More...

#include <Thyra_AztecOOLinearOpWithSolve.hpp>

Inheritance diagram for Thyra::AztecOOLinearOpWithSolve:

[legend]
List of all members.

Constructors/initializers/accessors

 AztecOOLinearOpWithSolve (const int fwdDefaultMaxIterations=400, const double fwdDefaultTol=1e-6, const int adjDefaultMaxIterations=400, const double adjDefaultTol=1e-6)
 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 initialize (const Teuchos::RefCountPtr< const LinearOpBase< double > > &fwdOp, const Teuchos::RefCountPtr< const LinearOpBase< double > > &precOp, const EPreconditionerInputType precOpType, 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
LinearOpBase< double > > 
extract_fwdOp ()
 Extract the forward LinearOpBase<double> object so that it can be modified.
Teuchos::RefCountPtr< const
LinearOpBase< double > > 
extract_precOp ()
 Extract the original preconditioner.
EPreconditionerInputType extract_precOpType ()
 Extract the original preconditioner type.
void uninitialize (Teuchos::RefCountPtr< const LinearOpBase< double > > *fwdOp=NULL, Teuchos::RefCountPtr< const LinearOpBase< double > > *precOp=NULL, EPreconditionerInputType *precOpType=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
 

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 solveSupportsSolveTolType (ETransp M_trans, ESolveTolType solveTolType) const
 
int defaultSolveMaxIterations (ETransp M_trans, ESolveTolType solveTolType) const
 

Overridden from SingleRhsLinearOpWithSolveBase

SolveStatus< double > solve (const ETransp M_trans, const VectorBase< double > &b, VectorBase< double > *x, const SolveCriteria< double > *solveCriteria) const
 

Detailed Description

Concrete LinearOpWithSolveBase subclass in terms of 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 residual norm tolerance or just allow for a default (i.e. tight) linear solve tolerance. Currently, this subclass does not support inexact solves by specifying a tolerance on the estimate of the solution error and it is unlikely that this subclass with ever support this mode.

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!

Definition at line 63 of file Thyra_AztecOOLinearOpWithSolve.hpp.


Constructor & Destructor Documentation

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

Construct uninitialized but with default option values.

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

Definition at line 60 of file Thyra_AztecOOLinearOpWithSolve.cpp.


Member Function Documentation

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

The default maximum number of iterations for forward solves.

Definition at line 86 of file Thyra_AztecOOLinearOpWithSolve.hpp.

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

Definition at line 86 of file Thyra_AztecOOLinearOpWithSolve.hpp.

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

The default solution tolerance on the residual for forward solves.

Definition at line 88 of file Thyra_AztecOOLinearOpWithSolve.hpp.

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

Definition at line 88 of file Thyra_AztecOOLinearOpWithSolve.hpp.

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

The default maximum number of iterations for adjoint solves.

Definition at line 90 of file Thyra_AztecOOLinearOpWithSolve.hpp.

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

Definition at line 90 of file Thyra_AztecOOLinearOpWithSolve.hpp.

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

The default solution tolerance on the residual for adjoint solves.

Definition at line 92 of file Thyra_AztecOOLinearOpWithSolve.hpp.

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

Definition at line 92 of file Thyra_AztecOOLinearOpWithSolve.hpp.

void Thyra::AztecOOLinearOpWithSolve::initialize const Teuchos::RefCountPtr< const LinearOpBase< double > > &  fwdOp,
const Teuchos::RefCountPtr< const LinearOpBase< double > > &  precOp,
const EPreconditionerInputType  precOpType,
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. This also should be the exact same object that is passed in through a LinearOpWithSolveFactoryBase interface.
precOp [in] The original abstract preconditioner object that was passed through the PreconditionedLinearOpWithSolveFactoryBase interface. This object is not used for anything and can be set as precOp.get()==NULL.
precOpType [in] The original argument passed through the PreconditionedLinearOpWithSolveFactoryBase interface. This value is not used for anything can be set to any value the client desires.
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
  • 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],SOLVE_TOL_REL_RESIDUAL_NORM) == allowInexactFwdSolve
  • this->solveSupportsSolveTolType([NOTRANS,CONJ],SOLVE_TOL_REL_ERR_NORM) == false
  • this->solveSupportsSolveTolType([TRANS,CONJTRANS],SOLVE_TOL_REL_RESIDUAL_NORM) == (aztecAdjSolver.get()!=NULL&&allowInexactAdjSolve)
  • this->solveSupportsSolveTolType([TRANS,CONJTRANS],SOLVE_TOL_REL_ERR_NORM) == false

ToDo: Finish documentation!

Definition at line 76 of file Thyra_AztecOOLinearOpWithSolve.cpp.

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

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

Postconditions:

  • return.get() is the same as this->get_fwdOp().get() before call.
  • this->get_fwdOp().get()==NULL

Definition at line 102 of file Thyra_AztecOOLinearOpWithSolve.cpp.

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

Extract the original preconditioner.

Postconditions:

  • return.get() is the same as this->get_precOp().get() before call.
  • this->get_precOp().get()==NULL

Definition at line 110 of file Thyra_AztecOOLinearOpWithSolve.cpp.

EPreconditionerInputType Thyra::AztecOOLinearOpWithSolve::extract_precOpType  ) 
 

Extract the original preconditioner type.

Definition at line 118 of file Thyra_AztecOOLinearOpWithSolve.cpp.

void Thyra::AztecOOLinearOpWithSolve::uninitialize Teuchos::RefCountPtr< const LinearOpBase< double > > *  fwdOp = NULL,
Teuchos::RefCountPtr< const LinearOpBase< double > > *  precOp = NULL,
EPreconditionerInputType precOpType = NULL,
Teuchos::RefCountPtr< AztecOO > *  aztecFwdSolver = NULL,
bool *  allowInexactFwdSolve = NULL,
Teuchos::RefCountPtr< AztecOO > *  aztecAdjSolver = NULL,
bool *  allowInexactAdjSolve = NULL,
double *  aztecSolverScalar = NULL
 

Uninitialize.

Definition at line 123 of file Thyra_AztecOOLinearOpWithSolve.cpp.

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

.

Definition at line 154 of file Thyra_AztecOOLinearOpWithSolve.cpp.

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

.

Definition at line 160 of file Thyra_AztecOOLinearOpWithSolve.cpp.

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

.

Definition at line 166 of file Thyra_AztecOOLinearOpWithSolve.cpp.

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

Definition at line 173 of file Thyra_AztecOOLinearOpWithSolve.cpp.

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

Implements Thyra::SingleScalarLinearOpBase< Scalar >.

Definition at line 191 of file Thyra_AztecOOLinearOpWithSolve.cpp.

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

Definition at line 198 of file Thyra_AztecOOLinearOpWithSolve.cpp.

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

Implements Thyra::SingleScalarLinearOpWithSolveBase< Scalar >.

Definition at line 211 of file Thyra_AztecOOLinearOpWithSolve.cpp.

bool Thyra::AztecOOLinearOpWithSolve::solveSupportsSolveTolType ETransp  M_trans,
ESolveTolType  solveTolType
const [protected, virtual]
 

Implements Thyra::SingleScalarLinearOpWithSolveBase< Scalar >.

Definition at line 217 of file Thyra_AztecOOLinearOpWithSolve.cpp.

int Thyra::AztecOOLinearOpWithSolve::defaultSolveMaxIterations ETransp  M_trans,
ESolveTolType  solveTolType
const [protected]
 

Reimplemented from Thyra::SingleScalarLinearOpWithSolveBase< Scalar >.

Definition at line 226 of file Thyra_AztecOOLinearOpWithSolve.cpp.

SolveStatus< double > Thyra::AztecOOLinearOpWithSolve::solve const ETransp  M_trans,
const VectorBase< double > &  b,
VectorBase< double > *  x,
const SolveCriteria< double > *  solveCriteria
const [protected, virtual]
 

Implements Thyra::SingleRhsLinearOpWithSolveBase< double >.

Definition at line 234 of file Thyra_AztecOOLinearOpWithSolve.cpp.


The documentation for this class was generated from the following files:
Generated on Thu Sep 18 12:38:53 2008 for Aztecoo/Thyra Linear Solver Adapter Software by doxygen 1.3.9.1