#include <NOX_Epetra_LinearSystem_AztecOO.H>
Public Member Functions | |
LinearSystemAztecOO (Teuchos::ParameterList &printingParams, Teuchos::ParameterList &linearSolverParams, const Teuchos::RCP< NOX::Epetra::Interface::Required > &iReq, const NOX::Epetra::Vector &cloneVector, const Teuchos::RCP< NOX::Epetra::Scaling > scalingObject=Teuchos::null) | |
Constructor with no Operators. | |
LinearSystemAztecOO (Teuchos::ParameterList &printingParams, Teuchos::ParameterList &linearSolverParams, const Teuchos::RCP< NOX::Epetra::Interface::Required > &iReq, const Teuchos::RCP< NOX::Epetra::Interface::Jacobian > &iJac, const Teuchos::RCP< Epetra_Operator > &J, const NOX::Epetra::Vector &cloneVector, const Teuchos::RCP< NOX::Epetra::Scaling > scalingObject=Teuchos::null) | |
Constructor with a user supplied Jacobian Operator only. | |
LinearSystemAztecOO (Teuchos::ParameterList &printingParams, Teuchos::ParameterList &linearSolverParams, const Teuchos::RCP< NOX::Epetra::Interface::Required > &i, const Teuchos::RCP< NOX::Epetra::Interface::Preconditioner > &iPrec, const Teuchos::RCP< Epetra_Operator > &M, const NOX::Epetra::Vector &cloneVector, const Teuchos::RCP< NOX::Epetra::Scaling > scalingObject=Teuchos::null) | |
Constructor with a user supplied Preconditioner Operator only. | |
LinearSystemAztecOO (Teuchos::ParameterList &printingParams, Teuchos::ParameterList &linearSolverParams, const Teuchos::RCP< NOX::Epetra::Interface::Jacobian > &iJac, const Teuchos::RCP< Epetra_Operator > &J, const Teuchos::RCP< NOX::Epetra::Interface::Preconditioner > &iPrec, const Teuchos::RCP< Epetra_Operator > &M, const NOX::Epetra::Vector &cloneVector, const Teuchos::RCP< NOX::Epetra::Scaling > scalingObject=Teuchos::null) | |
virtual | ~LinearSystemAztecOO () |
Destructor. | |
virtual bool | applyJacobian (const NOX::Epetra::Vector &input, NOX::Epetra::Vector &result) const |
Applies Jacobian to the given input vector and puts the answer in the result. | |
virtual bool | applyJacobianTranspose (const NOX::Epetra::Vector &input, NOX::Epetra::Vector &result) const |
Applies Jacobian-Transpose to the given input vector and puts the answer in the result. | |
virtual bool | applyJacobianInverse (Teuchos::ParameterList &linearSolverParams, const NOX::Epetra::Vector &input, NOX::Epetra::Vector &result) |
Applies the inverse of the Jacobian matrix to the given input vector and puts the answer in result. | |
virtual bool | applyRightPreconditioning (bool useTranspose, Teuchos::ParameterList &linearSolverParams, const NOX::Epetra::Vector &input, NOX::Epetra::Vector &result) const |
Apply right preconditiong to the given input vector. | |
virtual bool | createPreconditioner (const NOX::Epetra::Vector &x, Teuchos::ParameterList &linearSolverParams, bool recomputeGraph) const |
Explicitly constructs a preconditioner based on the solution vector x and the parameter list p. | |
virtual bool | destroyPreconditioner () const |
Deletes all objects associated with the chosen preconditioner. This is called during linear solves and when the solution vector changes to reset the preconditioner. | |
virtual bool | recomputePreconditioner (const NOX::Epetra::Vector &x, Teuchos::ParameterList &linearSolverParams) const |
Recalculates the preconditioner using an already allocated graph. | |
virtual PreconditionerReusePolicyType | getPreconditionerPolicy (bool advanceReuseCounter=true) |
Evaluates the preconditioner policy at the current state. | |
virtual void | reset (Teuchos::ParameterList &linearSolverParams) |
Reset the linear solver parameters. | |
virtual Teuchos::RCP < NOX::Epetra::Scaling > | getScaling () |
Get the scaling object. | |
void | resetScaling (const Teuchos::RCP< NOX::Epetra::Scaling > &s) |
Sets the diagonal scaling vector(s) used in scaling the linear system. See NOX::Epetra::Scaling for details on how to specify scaling of the linear system. | |
virtual bool | computeJacobian (const NOX::Epetra::Vector &x) |
Compute the Jacobian. | |
virtual Teuchos::RCP< const NOX::Epetra::Interface::Jacobian > | getJacobianInterface () const |
NOX::Interface::Jacobian accessor. | |
virtual Teuchos::RCP< const NOX::Epetra::Interface::Preconditioner > | getPrecInterface () const |
NOX::Interface::Preconditioiner accessor. | |
virtual bool | isPreconditionerConstructed () const |
Indicates whether a preconditioner has been constructed. | |
virtual bool | hasPreconditioner () const |
Indicates whether the linear system has a preconditioner. | |
virtual Teuchos::RCP< const Epetra_Operator > | getJacobianOperator () const |
Jacobian Epetra_Operator accessor. | |
virtual Teuchos::RCP < Epetra_Operator > | getJacobianOperator () |
Jacobian Epetra_Operator accessor. | |
virtual Teuchos::RCP< const Epetra_Operator > | getPrecOperator () const |
Preconditioner Epetra_Operator accessor (only the base matrix if using an internal preconditioner - aztecoo or ifpack). | |
virtual Teuchos::RCP< const Epetra_Operator > | getGeneratedPrecOperator () const |
Return preconditioner operator generated and stored in AztecOO. | |
virtual Teuchos::RCP < Epetra_Operator > | getGeneratedPrecOperator () |
Return preconditioner operator generated and stored in AztecOO. | |
double | getTimeCreatePreconditioner () const |
Returns the total time (sec.) spent in createPreconditioner(). | |
double | getTimeApplyJacobianInverse () const |
Returns the total time (sec.) spent in applyJacobianInverse(). | |
virtual void | setJacobianOperatorForSolve (const Teuchos::RCP< const Epetra_Operator > &solveJacOp) |
Set Jacobian operator for solve. | |
virtual void | setPrecOperatorForSolve (const Teuchos::RCP< const Epetra_Operator > &solvePrecOp) |
Set preconditioner operator for solve. | |
Protected Types | |
enum | OperatorType { EpetraOperator, EpetraRowMatrix, EpetraVbrMatrix, EpetraCrsMatrix } |
List of types of epetra objects that can be used for the Jacobian and/or Preconditioner. More... | |
enum | PreconditionerMatrixSourceType { UseJacobian, SeparateMatrix } |
Source of the RowMatrix if using an AztecOO native preconditioner. More... | |
enum | PreconditionerType { None_, AztecOO_, Ifpack_, NewIfpack_, ML_, UserDefined_ } |
Protected Member Functions | |
virtual void | setAztecOptions (Teuchos::ParameterList &lsParams, AztecOO &aztec) const |
Parse the parameter list and set the corresponding options in the AztecOO solver onject. | |
virtual bool | createJacobianOperator (Teuchos::ParameterList &printParams, Teuchos::ParameterList &lsParams, const Teuchos::RCP< NOX::Epetra::Interface::Required > &iReq, const NOX::Epetra::Vector &cloneVector) |
Creates an internally owned Epetra_Operator for the Jacobian. | |
virtual bool | createPrecOperator (Teuchos::ParameterList &printParams, Teuchos::ParameterList &lsParams, const Teuchos::RCP< NOX::Epetra::Interface::Required > &iReq, const NOX::Epetra::Vector &cloneVector) |
Creates an internally owned Epetra_Operator for the Preconditioner. | |
virtual bool | checkPreconditionerValidity () |
Checks to make sure that the supplied operators are valid for the requested preconditioning options set in the parameter list. | |
virtual bool | createIfpackPreconditioner (Teuchos::ParameterList &p) const |
Allocates the objects required for using ifpack preconditioners (NOX::Epetra::Group::ifpackGraph and NOX::Epetra::Group::ifpackPreconditioner). This is called from NOX::Epetra::Group::computePreconditioner(). | |
virtual bool | createNewIfpackPreconditioner (Teuchos::ParameterList &p) const |
Allocates the objects required for using the new version of ifpack preconditioners via the Ifpack Create factory. This is called from NOX::Epetra::Group::computePreconditioner(). | |
virtual OperatorType | getOperatorType (const Epetra_Operator &o) |
Deletes the AztecOO solver object. This is called when the solution vector for the group is changed. The preconditioner is no longer valid so the solver and preconditioner are destroyed by a call to this method. | |
virtual void | setAztecOOJacobian () const |
Sets the epetra Jacobian operator in the AztecOO object. | |
virtual void | setAztecOOPreconditioner () const |
Sets the epetra Preconditioner operator in the AztecOO object. | |
virtual void | throwError (const string &functionName, const string &errorMsg) const |
virtual void | precError (int error_code, const std::string &nox_function, const std::string &prec_type, const std::string &prec_function) const |
Prints a warning for ifpack preconditioner failures (error_code != 0). | |
Protected Attributes | |
NOX::Utils | utils |
Printing Utilities object. | |
Teuchos::RCP < NOX::Epetra::Interface::Jacobian > | jacInterfacePtr |
Reference to the user supplied Jacobian interface functions. | |
OperatorType | jacType |
Type of operator for the Jacobian. | |
Teuchos::RCP< Epetra_Operator > | jacPtr |
Pointer to the Jacobian operator. | |
Teuchos::RCP < NOX::Epetra::Interface::Preconditioner > | precInterfacePtr |
Reference to the user supplied preconditioner interface functions. | |
OperatorType | precType |
Type of operator for the preconditioner. | |
Teuchos::RCP< Epetra_Operator > | precPtr |
Pointer to the preconditioner operator. | |
PreconditionerMatrixSourceType | precMatrixSource |
PreconditionerType | precAlgorithm |
Teuchos::RCP< AztecOO > | aztecSolverPtr |
Aztec solver object. | |
Teuchos::RCP< Ifpack_IlukGraph > | ifpackGraphPtr |
Stores the ifpack graph. Mutable since the applyRightPreconditioner() is a const method. | |
Teuchos::RCP< Ifpack_CrsRiluk > | ifpackPreconditionerPtr |
Stores the ifpack preconditioner. Mutable since the applyRightPreconditioner() is a const method. | |
Teuchos::RCP < Ifpack_Preconditioner > | newIfpackPreconditionerPtr |
Stores the new ifpack preconditioner. Mutable since the applyRightPreconditioner() is a const method. | |
Teuchos::RCP < NOX::Epetra::Scaling > | scaling |
Scaling object supplied by the user. | |
Teuchos::RCP< NOX::Epetra::Vector > | tmpVectorPtr |
An extra temporary vector, only allocated if needed. | |
double | conditionNumberEstimate |
bool | isPrecConstructed |
True if the preconditioner has been computed. | |
bool | outputSolveDetails |
If set to true, solver information is printed to the "Output" sublist of the "Linear Solver" list. | |
bool | zeroInitialGuess |
Zero out the initial guess for linear solves performed through applyJacobianInverse calls (i.e. zero out the result vector before the linear solve). | |
bool | manualScaling |
Stores the parameter "Compute Scaling Manually". | |
PreconditionerReusePolicyType | precReusePolicy |
Policy for how to handle the preconditioner between nonlineaer iterations. | |
int | precQueryCounter |
Counter for number of times called since reset or construction. | |
int | maxAgeOfPrec |
Parameter to determine whether or not to recompute Preconditioner. | |
Epetra_Time | timer |
Epetra_Time object. | |
double | timeCreatePreconditioner |
Total time spent in createPreconditioner (sec.). | |
double | timeApplyJacbianInverse |
Total time spent in applyJacobianInverse (sec.). | |
Teuchos::RCP< Epetra_Operator > | solvePrecOpPtr |
Preconditioner operator that will be used in solves. | |
bool | throwErrorOnPrecFailure |
If true, any preconditioner error will cause a throw instead of a warning. |
This solver provides the linear algebra services provided through the AztecOO parallel iterative linear solver.
The NOX::Epetra::LinearSystemAztecOO object provides a flexible and efficient way to interface an Epetra based application code to the Aztec linear solver. This class handles construction of both the preconditioners and AztecOO solver. All options are determined through parameter lists and the basic constructors.
Constructing a Linear System
There are four different constructors that can be used. The difference between constructors is based on whether the user supplies a Jacobian, a preconditioner, neither or both.
If a Jacobian is not supplied then this object can create an internally constructed Jacobian based on a Finite Difference or Matrif-Free object. The user can specify which type of object to use by setting the parameter "Jacobian Operator" in the parameter list. The choices are "Matrix-Free" or "Finite Difference".
The user can supply their own preconditioner as an Epetra_Operator, or they can supply their own matrix (an Epetra_RowMatrix derived object) that can be used by one of the internal preconditioner libraries (currently aztecoo or ifpack). If they supply their own preconditioner the object must implement the Epetra_Operator::ApplyInverse method. This is the method called during the linear solve to introduce preconditoning into aztecoo. If the user supplies a matrix to be used with an internal preconditioner, it must be derived from the Epetra_RowMatrix class and must implement all functionality in the Epetra_RowMatrix. If a Preconditioner is not supplied, then this object can create an internal preconditioner matrix by finite differencing or it can use the Jacobian operator if the Jacobian derives from the Epetra_RowMatrix class. The user can specify which type of object to use by setting the parameter "Preconditioner Operator" in the parameter list. The choices are "Use Jacobian" or "Finite Difference".
The Jacobian and preconditioner each require an interface to update the state of the operator with respect to the solution vector and any other parameters. There are three interfaces that can be implemented, NOX::Epetra::Interface::Required, NOX::Epetra::Interface::Jacobian, and NOX::Epetra::Interface::Preconditioner.
NOX::Epetra::Interface::Required supplies the computeF() function so codes can tell NOX what the nonlinear equations are. This is the minimum requirement to run nox through the epetra interface. LinearSolverAztecOO requires this in some constructors so that if a Jacobian or preconditoner is not supplied, it will use computeF from the Required interface to estimate the Jacobian or preconditioner via finite differences or directional derivatives.
NOX::Epetra::Interface::Jacobian is used for updating a user supplied Jacobian opertor with respect to the solution vector and any other parameters. It is required only in constructors in which a user supplies a Jacobian operator.
NOX::Epetra::Interface::Preconditioner is used for updating a user supplied preconditioner opertor/matrix with respect to the solution vector and any other parameters. It is required only in constructors in which a user supplies a preconditioner operator.
"Linear Solver" sublist parameters
A Teuchos::ParameterList called linearSolverParams is required in the various constructors and during some method calls such as applyJacobianInverse() and applyRightPreconditioning(). Typically, this list is the "Linear Solver" sublist found in the nox parameter list. The following parameters can be set in the linear solver sublist and are vaild for the NOX::Epetra::LinearSolverAztecOO object:
"Output" sublist
The parameter list passed in during calls to ApplyJacobianInverse() will have an "Output" sublist created that contains the following parameters if the flag "Output Solver Details" is set to true:
Definition at line 312 of file NOX_Epetra_LinearSystem_AztecOO.H.
enum NOX::Epetra::LinearSystemAztecOO::OperatorType [protected] |
List of types of epetra objects that can be used for the Jacobian and/or Preconditioner.
EpetraOperator | An Epetra_Operator derived object. |
EpetraRowMatrix | An Epetra_RowMatrix derived object. |
EpetraVbrMatrix | An Epetra_VbrMatrix object. |
EpetraCrsMatrix | An Epetra_CrsMatrix object. |
Definition at line 317 of file NOX_Epetra_LinearSystem_AztecOO.H.
enum NOX::Epetra::LinearSystemAztecOO::PreconditionerMatrixSourceType [protected] |
Source of the RowMatrix if using an AztecOO native preconditioner.
Definition at line 601 of file NOX_Epetra_LinearSystem_AztecOO.H.
NOX::Epetra::LinearSystemAztecOO::LinearSystemAztecOO | ( | Teuchos::ParameterList & | printingParams, | |
Teuchos::ParameterList & | linearSolverParams, | |||
const Teuchos::RCP< NOX::Epetra::Interface::Required > & | iReq, | |||
const NOX::Epetra::Vector & | cloneVector, | |||
const Teuchos::RCP< NOX::Epetra::Scaling > | scalingObject = Teuchos::null | |||
) |
Constructor with no Operators.
Jacobian Operator will be constructed internally based on the parameter "Jacobian Operator". Defaults to using a NOX::Epetra::MatrixFree object.
Definition at line 91 of file NOX_Epetra_LinearSystem_AztecOO.C.
References aztecSolverPtr, createJacobianOperator(), createPrecOperator(), reset(), and tmpVectorPtr.
NOX::Epetra::LinearSystemAztecOO::LinearSystemAztecOO | ( | Teuchos::ParameterList & | printingParams, | |
Teuchos::ParameterList & | linearSolverParams, | |||
const Teuchos::RCP< NOX::Epetra::Interface::Required > & | iReq, | |||
const Teuchos::RCP< NOX::Epetra::Interface::Jacobian > & | iJac, | |||
const Teuchos::RCP< Epetra_Operator > & | J, | |||
const NOX::Epetra::Vector & | cloneVector, | |||
const Teuchos::RCP< NOX::Epetra::Scaling > | scalingObject = Teuchos::null | |||
) |
Constructor with a user supplied Jacobian Operator only.
Either there is no preconditioning or the preconditioner will be used/created internally. The Jacobian (if derived from an Epetra_RowMatrix class can be used with an internal preconditioner. See the parameter key "Preconditioner Operator" for more details.
Definition at line 123 of file NOX_Epetra_LinearSystem_AztecOO.C.
References aztecSolverPtr, createPrecOperator(), getOperatorType(), jacPtr, jacType, reset(), and tmpVectorPtr.
NOX::Epetra::LinearSystemAztecOO::LinearSystemAztecOO | ( | Teuchos::ParameterList & | printingParams, | |
Teuchos::ParameterList & | linearSolverParams, | |||
const Teuchos::RCP< NOX::Epetra::Interface::Required > & | i, | |||
const Teuchos::RCP< NOX::Epetra::Interface::Preconditioner > & | iPrec, | |||
const Teuchos::RCP< Epetra_Operator > & | M, | |||
const NOX::Epetra::Vector & | cloneVector, | |||
const Teuchos::RCP< NOX::Epetra::Scaling > | scalingObject = Teuchos::null | |||
) |
Constructor with a user supplied Preconditioner Operator only.
Jacobian operator will be constructed internally based on the parameter "Jacobian Operator" in the parameter list. See the parameter key "Jacobian Operator" for more details. Defaults to using a NOX::Epetra::MatrixFree object.
Definition at line 160 of file NOX_Epetra_LinearSystem_AztecOO.C.
References aztecSolverPtr, createJacobianOperator(), getOperatorType(), precPtr, precType, reset(), and tmpVectorPtr.
NOX::Epetra::LinearSystemAztecOO::LinearSystemAztecOO | ( | Teuchos::ParameterList & | printingParams, | |
Teuchos::ParameterList & | linearSolverParams, | |||
const Teuchos::RCP< NOX::Epetra::Interface::Jacobian > & | iJac, | |||
const Teuchos::RCP< Epetra_Operator > & | J, | |||
const Teuchos::RCP< NOX::Epetra::Interface::Preconditioner > & | iPrec, | |||
const Teuchos::RCP< Epetra_Operator > & | M, | |||
const NOX::Epetra::Vector & | cloneVector, | |||
const Teuchos::RCP< NOX::Epetra::Scaling > | scalingObject = Teuchos::null | |||
) |
Constructor with user supplied separate objects for the Jacobian (J) and Preconditioner (M). linearSolverParams is the "Linear Solver" sublist of parameter list.
Definition at line 197 of file NOX_Epetra_LinearSystem_AztecOO.C.
References aztecSolverPtr, getOperatorType(), jacPtr, jacType, precPtr, precType, reset(), and tmpVectorPtr.
NOX::Epetra::LinearSystemAztecOO::~LinearSystemAztecOO | ( | ) | [virtual] |
Destructor.
Definition at line 235 of file NOX_Epetra_LinearSystem_AztecOO.C.
References destroyPreconditioner().
bool NOX::Epetra::LinearSystemAztecOO::applyJacobian | ( | const NOX::Epetra::Vector & | input, | |
NOX::Epetra::Vector & | result | |||
) | const [virtual] |
Applies Jacobian to the given input vector and puts the answer in the result.
Computes
where is the Jacobian,
is the input vector, and
is the result vector. Returns true if successful.
Implements NOX::Epetra::LinearSystem.
Definition at line 545 of file NOX_Epetra_LinearSystem_AztecOO.C.
References NOX::Epetra::Vector::getEpetraVector(), and jacPtr.
bool NOX::Epetra::LinearSystemAztecOO::applyJacobianTranspose | ( | const NOX::Epetra::Vector & | input, | |
NOX::Epetra::Vector & | result | |||
) | const [virtual] |
Applies Jacobian-Transpose to the given input vector and puts the answer in the result.
Computes
where is the Jacobian,
is the input vector, and
is the result vector. Returns true if successful.
Implements NOX::Epetra::LinearSystem.
Definition at line 556 of file NOX_Epetra_LinearSystem_AztecOO.C.
References NOX::Epetra::Vector::getEpetraVector(), and jacPtr.
bool NOX::Epetra::LinearSystemAztecOO::applyJacobianInverse | ( | Teuchos::ParameterList & | params, | |
const NOX::Epetra::Vector & | input, | |||
NOX::Epetra::Vector & | result | |||
) | [virtual] |
Applies the inverse of the Jacobian matrix to the given input vector and puts the answer in result.
Computes
where is the Jacobian,
is the input vector, and
is the result vector.
The parameter list contains the linear solver options.
Implements NOX::Epetra::LinearSystem.
Definition at line 570 of file NOX_Epetra_LinearSystem_AztecOO.C.
References applyRightPreconditioning(), aztecSolverPtr, NOX::Utils::Details, NOX::Epetra::Vector::getEpetraVector(), NOX::Epetra::Vector::init(), isPrecConstructed, NOX::Utils::isPrintType(), jacPtr, manualScaling, NOX::Utils::out(), outputSolveDetails, precReusePolicy, NOX::Epetra::LinearSystem::PRPT_REUSE, scaling, setAztecOOJacobian(), setAztecOOPreconditioner(), timeApplyJacbianInverse, timer, utils, and zeroInitialGuess.
bool NOX::Epetra::LinearSystemAztecOO::applyRightPreconditioning | ( | bool | useTranspose, | |
Teuchos::ParameterList & | params, | |||
const NOX::Epetra::Vector & | input, | |||
NOX::Epetra::Vector & | result | |||
) | const [virtual] |
Apply right preconditiong to the given input vector.
Let be a right preconditioner for the Jacobian
; in other words,
is a matrix such that
Compute
where is the input vector and
is the result vector.
If useTranspose is true, then the transpose of the preconditioner is applied:
The transpose preconditioner is currently only required for Tensor methods.
The parameter list contains the linear solver options.
Implements NOX::Epetra::LinearSystem.
Definition at line 728 of file NOX_Epetra_LinearSystem_AztecOO.C.
References aztecSolverPtr, NOX::Epetra::Vector::getEpetraVector(), ifpackPreconditionerPtr, isPrecConstructed, NOX::Utils::isPrintType(), newIfpackPreconditionerPtr, NOX::Utils::out(), precPtr, throwErrorOnPrecFailure, tmpVectorPtr, utils, and NOX::Utils::Warning.
Referenced by applyJacobianInverse().
bool NOX::Epetra::LinearSystemAztecOO::createPreconditioner | ( | const NOX::Epetra::Vector & | x, | |
Teuchos::ParameterList & | p, | |||
bool | recomputeGraph | |||
) | const [virtual] |
Explicitly constructs a preconditioner based on the solution vector x and the parameter list p.
The user has the option of recomputing the graph when a new preconditioner is created. The NOX::Epetra::Group controls the isValid flag for the preconditioner and will control when to call this.
Implements NOX::Epetra::LinearSystem.
Definition at line 858 of file NOX_Epetra_LinearSystem_AztecOO.C.
References aztecSolverPtr, createIfpackPreconditioner(), createNewIfpackPreconditioner(), NOX::Epetra::Vector::getEpetraVector(), ifpackPreconditionerPtr, isPrecConstructed, NOX::Utils::isPrintType(), jacPtr, NOX::Utils::LinearSolverDetails, manualScaling, newIfpackPreconditionerPtr, NOX::Utils::out(), precInterfacePtr, precPtr, scaling, setAztecOOJacobian(), solvePrecOpPtr, timeCreatePreconditioner, timer, tmpVectorPtr, and utils.
bool NOX::Epetra::LinearSystemAztecOO::destroyPreconditioner | ( | ) | const [virtual] |
Deletes all objects associated with the chosen preconditioner. This is called during linear solves and when the solution vector changes to reset the preconditioner.
Implements NOX::Epetra::LinearSystem.
Definition at line 1296 of file NOX_Epetra_LinearSystem_AztecOO.C.
References aztecSolverPtr, ifpackGraphPtr, ifpackPreconditionerPtr, isPrecConstructed, NOX::Utils::isPrintType(), NOX::Utils::LinearSolverDetails, newIfpackPreconditionerPtr, NOX::Utils::out(), solvePrecOpPtr, and utils.
Referenced by reset(), and ~LinearSystemAztecOO().
bool NOX::Epetra::LinearSystemAztecOO::recomputePreconditioner | ( | const NOX::Epetra::Vector & | x, | |
Teuchos::ParameterList & | linearSolverParams | |||
) | const [virtual] |
Recalculates the preconditioner using an already allocated graph.
Use this to compute a new preconditioner while using the same graph for the preconditioner. This avoids deleting and reallocating the memory required for the preconditioner and results in a big speed-up for large-scale jobs.
Implements NOX::Epetra::LinearSystem.
Definition at line 1235 of file NOX_Epetra_LinearSystem_AztecOO.C.
References NOX::Epetra::Vector::getEpetraVector(), NOX::Utils::isPrintType(), NOX::Utils::LinearSolverDetails, newIfpackPreconditionerPtr, NOX::Utils::out(), precError(), precInterfacePtr, precPtr, and utils.
NOX::Epetra::LinearSystem::PreconditionerReusePolicyType NOX::Epetra::LinearSystemAztecOO::getPreconditionerPolicy | ( | bool | advanceReuseCounter = true |
) | [virtual] |
Evaluates the preconditioner policy at the current state.
NOTE: This can change values between nonlienar iterations. It is not a static value.
Implements NOX::Epetra::LinearSystem.
Definition at line 1454 of file NOX_Epetra_LinearSystem_AztecOO.C.
References NOX::Utils::Details, isPrecConstructed, NOX::Utils::isPrintType(), maxAgeOfPrec, NOX::Utils::out(), precQueryCounter, precReusePolicy, NOX::Epetra::LinearSystem::PRPT_REBUILD, NOX::Epetra::LinearSystem::PRPT_RECOMPUTE, NOX::Epetra::LinearSystem::PRPT_REUSE, and utils.
void NOX::Epetra::LinearSystemAztecOO::reset | ( | Teuchos::ParameterList & | linearSolverParams | ) | [virtual] |
Reset the linear solver parameters.
Definition at line 242 of file NOX_Epetra_LinearSystem_AztecOO.C.
References aztecSolverPtr, checkPreconditionerValidity(), destroyPreconditioner(), manualScaling, maxAgeOfPrec, outputSolveDetails, precQueryCounter, precReusePolicy, NOX::Epetra::LinearSystem::PRPT_REBUILD, NOX::Epetra::LinearSystem::PRPT_RECOMPUTE, NOX::Epetra::LinearSystem::PRPT_REUSE, setAztecOptions(), throwErrorOnPrecFailure, and zeroInitialGuess.
Referenced by LinearSystemAztecOO().
Teuchos::RCP< NOX::Epetra::Scaling > NOX::Epetra::LinearSystemAztecOO::getScaling | ( | ) | [virtual] |
Get the scaling object.
Implements NOX::Epetra::LinearSystem.
Definition at line 1364 of file NOX_Epetra_LinearSystem_AztecOO.C.
References scaling.
void NOX::Epetra::LinearSystemAztecOO::resetScaling | ( | const Teuchos::RCP< NOX::Epetra::Scaling > & | s | ) | [virtual] |
Sets the diagonal scaling vector(s) used in scaling the linear system. See NOX::Epetra::Scaling for details on how to specify scaling of the linear system.
Implements NOX::Epetra::LinearSystem.
Definition at line 1371 of file NOX_Epetra_LinearSystem_AztecOO.C.
References scaling.
bool NOX::Epetra::LinearSystemAztecOO::computeJacobian | ( | const NOX::Epetra::Vector & | x | ) | [virtual] |
Compute the Jacobian.
Implements NOX::Epetra::LinearSystem.
Definition at line 1355 of file NOX_Epetra_LinearSystem_AztecOO.C.
References NOX::Epetra::Vector::getEpetraVector(), jacInterfacePtr, and jacPtr.
Teuchos::RCP< const NOX::Epetra::Interface::Jacobian > NOX::Epetra::LinearSystemAztecOO::getJacobianInterface | ( | ) | const [virtual] |
NOX::Interface::Jacobian accessor.
Definition at line 1390 of file NOX_Epetra_LinearSystem_AztecOO.C.
References jacInterfacePtr.
Teuchos::RCP< const NOX::Epetra::Interface::Preconditioner > NOX::Epetra::LinearSystemAztecOO::getPrecInterface | ( | ) | const [virtual] |
NOX::Interface::Preconditioiner accessor.
Definition at line 1397 of file NOX_Epetra_LinearSystem_AztecOO.C.
References precInterfacePtr.
bool NOX::Epetra::LinearSystemAztecOO::isPreconditionerConstructed | ( | ) | const [virtual] |
Indicates whether a preconditioner has been constructed.
Implements NOX::Epetra::LinearSystem.
Definition at line 1411 of file NOX_Epetra_LinearSystem_AztecOO.C.
References isPrecConstructed.
bool NOX::Epetra::LinearSystemAztecOO::hasPreconditioner | ( | ) | const [virtual] |
Indicates whether the linear system has a preconditioner.
Implements NOX::Epetra::LinearSystem.
Definition at line 1404 of file NOX_Epetra_LinearSystem_AztecOO.C.
Teuchos::RCP< const Epetra_Operator > NOX::Epetra::LinearSystemAztecOO::getJacobianOperator | ( | ) | const [virtual] |
Jacobian Epetra_Operator accessor.
Implements NOX::Epetra::LinearSystem.
Definition at line 1418 of file NOX_Epetra_LinearSystem_AztecOO.C.
References jacPtr.
Teuchos::RCP< Epetra_Operator > NOX::Epetra::LinearSystemAztecOO::getJacobianOperator | ( | ) | [virtual] |
Jacobian Epetra_Operator accessor.
Implements NOX::Epetra::LinearSystem.
Definition at line 1425 of file NOX_Epetra_LinearSystem_AztecOO.C.
References jacPtr.
Teuchos::RCP< const Epetra_Operator > NOX::Epetra::LinearSystemAztecOO::getPrecOperator | ( | ) | const [virtual] |
Preconditioner Epetra_Operator accessor (only the base matrix if using an internal preconditioner - aztecoo or ifpack).
Definition at line 1432 of file NOX_Epetra_LinearSystem_AztecOO.C.
References precPtr.
Teuchos::RCP< const Epetra_Operator > NOX::Epetra::LinearSystemAztecOO::getGeneratedPrecOperator | ( | ) | const [virtual] |
Return preconditioner operator generated and stored in AztecOO.
Note: This should only be called if hasPreconditioner() returns true.
Implements NOX::Epetra::LinearSystem.
Definition at line 1439 of file NOX_Epetra_LinearSystem_AztecOO.C.
References solvePrecOpPtr.
Teuchos::RCP< Epetra_Operator > NOX::Epetra::LinearSystemAztecOO::getGeneratedPrecOperator | ( | ) | [virtual] |
Return preconditioner operator generated and stored in AztecOO.
Implements NOX::Epetra::LinearSystem.
Definition at line 1446 of file NOX_Epetra_LinearSystem_AztecOO.C.
References solvePrecOpPtr.
double NOX::Epetra::LinearSystemAztecOO::getTimeCreatePreconditioner | ( | ) | const |
Returns the total time (sec.) spent in createPreconditioner().
Definition at line 1521 of file NOX_Epetra_LinearSystem_AztecOO.C.
References timeCreatePreconditioner.
double NOX::Epetra::LinearSystemAztecOO::getTimeApplyJacobianInverse | ( | ) | const |
Returns the total time (sec.) spent in applyJacobianInverse().
Definition at line 1528 of file NOX_Epetra_LinearSystem_AztecOO.C.
References timeApplyJacbianInverse.
void NOX::Epetra::LinearSystemAztecOO::setJacobianOperatorForSolve | ( | const Teuchos::RCP< const Epetra_Operator > & | solveJacOp | ) | [virtual] |
Set Jacobian operator for solve.
Implements NOX::Epetra::LinearSystem.
Definition at line 1535 of file NOX_Epetra_LinearSystem_AztecOO.C.
References getOperatorType(), jacPtr, jacType, and setAztecOOJacobian().
void NOX::Epetra::LinearSystemAztecOO::setPrecOperatorForSolve | ( | const Teuchos::RCP< const Epetra_Operator > & | solvePrecOp | ) | [virtual] |
Set preconditioner operator for solve.
Note: This should only be called if hasPreconditioner() returns true.
Implements NOX::Epetra::LinearSystem.
Definition at line 1545 of file NOX_Epetra_LinearSystem_AztecOO.C.
References setAztecOOPreconditioner(), and solvePrecOpPtr.
void NOX::Epetra::LinearSystemAztecOO::setAztecOptions | ( | Teuchos::ParameterList & | lsParams, | |
AztecOO & | aztec | |||
) | const [protected, virtual] |
Parse the parameter list and set the corresponding options in the AztecOO solver onject.
Definition at line 338 of file NOX_Epetra_LinearSystem_AztecOO.C.
References NOX::Utils::Debug, NOX::Utils::isPrintType(), NOX::Utils::LinearSolverDetails, NOX::Utils::out(), NOX::Utils::perr(), NOX::Utils::pout(), and utils.
Referenced by reset().
bool NOX::Epetra::LinearSystemAztecOO::createJacobianOperator | ( | Teuchos::ParameterList & | printParams, | |
Teuchos::ParameterList & | lsParams, | |||
const Teuchos::RCP< NOX::Epetra::Interface::Required > & | iReq, | |||
const NOX::Epetra::Vector & | cloneVector | |||
) | [protected, virtual] |
Creates an internally owned Epetra_Operator for the Jacobian.
Definition at line 485 of file NOX_Epetra_LinearSystem_AztecOO.C.
References EpetraOperator, EpetraRowMatrix, jacInterfacePtr, jacPtr, and jacType.
Referenced by LinearSystemAztecOO().
bool NOX::Epetra::LinearSystemAztecOO::createPrecOperator | ( | Teuchos::ParameterList & | printParams, | |
Teuchos::ParameterList & | lsParams, | |||
const Teuchos::RCP< NOX::Epetra::Interface::Required > & | iReq, | |||
const NOX::Epetra::Vector & | cloneVector | |||
) | [protected, virtual] |
Creates an internally owned Epetra_Operator for the Preconditioner.
Definition at line 515 of file NOX_Epetra_LinearSystem_AztecOO.C.
References EpetraRowMatrix, jacType, precInterfacePtr, precPtr, and precType.
Referenced by LinearSystemAztecOO().
bool NOX::Epetra::LinearSystemAztecOO::checkPreconditionerValidity | ( | ) | [protected, virtual] |
Checks to make sure that the supplied operators are valid for the requested preconditioning options set in the parameter list.
Definition at line 824 of file NOX_Epetra_LinearSystem_AztecOO.C.
References EpetraCrsMatrix, EpetraRowMatrix, EpetraVbrMatrix, precPtr, and precType.
Referenced by reset().
bool NOX::Epetra::LinearSystemAztecOO::createIfpackPreconditioner | ( | Teuchos::ParameterList & | p | ) | const [protected, virtual] |
Allocates the objects required for using ifpack preconditioners (NOX::Epetra::Group::ifpackGraph and NOX::Epetra::Group::ifpackPreconditioner). This is called from NOX::Epetra::Group::computePreconditioner().
Definition at line 979 of file NOX_Epetra_LinearSystem_AztecOO.C.
References NOX::Utils::Debug, NOX::Utils::Details, EpetraCrsMatrix, EpetraRowMatrix, EpetraVbrMatrix, NOX::Epetra::FiniteDifference::getUnderlyingMatrix(), ifpackGraphPtr, ifpackPreconditionerPtr, NOX::Utils::isPrintType(), jacPtr, NOX::Utils::out(), precError(), precPtr, precType, NOX::Utils::sciformat(), and utils.
Referenced by createPreconditioner().
bool NOX::Epetra::LinearSystemAztecOO::createNewIfpackPreconditioner | ( | Teuchos::ParameterList & | p | ) | const [protected, virtual] |
Allocates the objects required for using the new version of ifpack preconditioners via the Ifpack Create factory. This is called from NOX::Epetra::Group::computePreconditioner().
Definition at line 1122 of file NOX_Epetra_LinearSystem_AztecOO.C.
References NOX::Utils::Debug, EpetraCrsMatrix, EpetraRowMatrix, EpetraVbrMatrix, NOX::Utils::isPrintType(), jacPtr, newIfpackPreconditionerPtr, NOX::Utils::out(), precError(), precPtr, precType, and utils.
Referenced by createPreconditioner().
NOX::Epetra::LinearSystemAztecOO::OperatorType NOX::Epetra::LinearSystemAztecOO::getOperatorType | ( | const Epetra_Operator & | o | ) | [protected, virtual] |
Deletes the AztecOO solver object. This is called when the solution vector for the group is changed. The preconditioner is no longer valid so the solver and preconditioner are destroyed by a call to this method.
Returns the type of operator that is passed into the group constructors.
Uses dynamic casting to identify the underlying object type.
Definition at line 1326 of file NOX_Epetra_LinearSystem_AztecOO.C.
References EpetraCrsMatrix, EpetraOperator, EpetraRowMatrix, and EpetraVbrMatrix.
Referenced by LinearSystemAztecOO(), and setJacobianOperatorForSolve().
void NOX::Epetra::LinearSystemAztecOO::setAztecOOJacobian | ( | ) | const [protected, virtual] |
Sets the epetra Jacobian operator in the AztecOO object.
Makes a call to SetUserMatrix or SetUserOperator to set the Jacobian.
Definition at line 1554 of file NOX_Epetra_LinearSystem_AztecOO.C.
References aztecSolverPtr, EpetraCrsMatrix, EpetraRowMatrix, EpetraVbrMatrix, jacPtr, and jacType.
Referenced by applyJacobianInverse(), createPreconditioner(), and setJacobianOperatorForSolve().
void NOX::Epetra::LinearSystemAztecOO::setAztecOOPreconditioner | ( | ) | const [protected, virtual] |
Sets the epetra Preconditioner operator in the AztecOO object.
Makes a call to SetUserOperator. This must be done AFTER the Jacobian matrix/operators is set by setAztecOOJacobian(), otherwise the aztec object may ignore this operation.
Definition at line 1567 of file NOX_Epetra_LinearSystem_AztecOO.C.
References aztecSolverPtr, and solvePrecOpPtr.
Referenced by applyJacobianInverse(), and setPrecOperatorForSolve().
void NOX::Epetra::LinearSystemAztecOO::precError | ( | int | error_code, | |
const std::string & | nox_function, | |||
const std::string & | prec_type, | |||
const std::string & | prec_function | |||
) | const [protected, virtual] |
Prints a warning for ifpack preconditioner failures (error_code != 0).
Definition at line 1575 of file NOX_Epetra_LinearSystem_AztecOO.C.
References NOX::Utils::out(), throwErrorOnPrecFailure, and utils.
Referenced by createIfpackPreconditioner(), createNewIfpackPreconditioner(), and recomputePreconditioner().
NOX::Utils NOX::Epetra::LinearSystemAztecOO::utils [protected] |
Printing Utilities object.
Definition at line 580 of file NOX_Epetra_LinearSystem_AztecOO.H.
Referenced by applyJacobianInverse(), applyRightPreconditioning(), createIfpackPreconditioner(), createNewIfpackPreconditioner(), createPreconditioner(), destroyPreconditioner(), getPreconditionerPolicy(), precError(), recomputePreconditioner(), and setAztecOptions().
Teuchos::RCP<NOX::Epetra::Interface::Jacobian> NOX::Epetra::LinearSystemAztecOO::jacInterfacePtr [protected] |
Reference to the user supplied Jacobian interface functions.
Definition at line 583 of file NOX_Epetra_LinearSystem_AztecOO.H.
Referenced by computeJacobian(), createJacobianOperator(), and getJacobianInterface().
Type of operator for the Jacobian.
Definition at line 586 of file NOX_Epetra_LinearSystem_AztecOO.H.
Referenced by createJacobianOperator(), createPrecOperator(), LinearSystemAztecOO(), setAztecOOJacobian(), and setJacobianOperatorForSolve().
Teuchos::RCP<Epetra_Operator> NOX::Epetra::LinearSystemAztecOO::jacPtr [mutable, protected] |
Pointer to the Jacobian operator.
Definition at line 589 of file NOX_Epetra_LinearSystem_AztecOO.H.
Referenced by applyJacobian(), applyJacobianInverse(), applyJacobianTranspose(), computeJacobian(), createIfpackPreconditioner(), createJacobianOperator(), createNewIfpackPreconditioner(), createPreconditioner(), getJacobianOperator(), LinearSystemAztecOO(), setAztecOOJacobian(), and setJacobianOperatorForSolve().
Teuchos::RCP<NOX::Epetra::Interface::Preconditioner> NOX::Epetra::LinearSystemAztecOO::precInterfacePtr [protected] |
Reference to the user supplied preconditioner interface functions.
Definition at line 592 of file NOX_Epetra_LinearSystem_AztecOO.H.
Referenced by createPreconditioner(), createPrecOperator(), getPrecInterface(), and recomputePreconditioner().
Type of operator for the preconditioner.
Definition at line 595 of file NOX_Epetra_LinearSystem_AztecOO.H.
Referenced by checkPreconditionerValidity(), createIfpackPreconditioner(), createNewIfpackPreconditioner(), createPrecOperator(), and LinearSystemAztecOO().
Teuchos::RCP<Epetra_Operator> NOX::Epetra::LinearSystemAztecOO::precPtr [mutable, protected] |
Pointer to the preconditioner operator.
Definition at line 598 of file NOX_Epetra_LinearSystem_AztecOO.H.
Referenced by applyRightPreconditioning(), checkPreconditionerValidity(), createIfpackPreconditioner(), createNewIfpackPreconditioner(), createPreconditioner(), createPrecOperator(), getPrecOperator(), LinearSystemAztecOO(), and recomputePreconditioner().
Teuchos::RCP<AztecOO> NOX::Epetra::LinearSystemAztecOO::aztecSolverPtr [mutable, protected] |
Aztec solver object.
Definition at line 609 of file NOX_Epetra_LinearSystem_AztecOO.H.
Referenced by applyJacobianInverse(), applyRightPreconditioning(), createPreconditioner(), destroyPreconditioner(), LinearSystemAztecOO(), reset(), setAztecOOJacobian(), and setAztecOOPreconditioner().
Teuchos::RCP<Ifpack_IlukGraph> NOX::Epetra::LinearSystemAztecOO::ifpackGraphPtr [mutable, protected] |
Stores the ifpack graph. Mutable since the applyRightPreconditioner() is a const method.
Definition at line 615 of file NOX_Epetra_LinearSystem_AztecOO.H.
Referenced by createIfpackPreconditioner(), and destroyPreconditioner().
Teuchos::RCP<Ifpack_CrsRiluk> NOX::Epetra::LinearSystemAztecOO::ifpackPreconditionerPtr [mutable, protected] |
Stores the ifpack preconditioner. Mutable since the applyRightPreconditioner() is a const method.
Definition at line 621 of file NOX_Epetra_LinearSystem_AztecOO.H.
Referenced by applyRightPreconditioning(), createIfpackPreconditioner(), createPreconditioner(), and destroyPreconditioner().
Teuchos::RCP<Ifpack_Preconditioner> NOX::Epetra::LinearSystemAztecOO::newIfpackPreconditionerPtr [mutable, protected] |
Stores the new ifpack preconditioner. Mutable since the applyRightPreconditioner() is a const method.
Definition at line 627 of file NOX_Epetra_LinearSystem_AztecOO.H.
Referenced by applyRightPreconditioning(), createNewIfpackPreconditioner(), createPreconditioner(), destroyPreconditioner(), and recomputePreconditioner().
Teuchos::RCP<NOX::Epetra::Scaling> NOX::Epetra::LinearSystemAztecOO::scaling [protected] |
Scaling object supplied by the user.
Definition at line 638 of file NOX_Epetra_LinearSystem_AztecOO.H.
Referenced by applyJacobianInverse(), createPreconditioner(), getScaling(), and resetScaling().
Teuchos::RCP<NOX::Epetra::Vector> NOX::Epetra::LinearSystemAztecOO::tmpVectorPtr [mutable, protected] |
An extra temporary vector, only allocated if needed.
Definition at line 641 of file NOX_Epetra_LinearSystem_AztecOO.H.
Referenced by applyRightPreconditioning(), createPreconditioner(), and LinearSystemAztecOO().
bool NOX::Epetra::LinearSystemAztecOO::isPrecConstructed [mutable, protected] |
True if the preconditioner has been computed.
Definition at line 646 of file NOX_Epetra_LinearSystem_AztecOO.H.
Referenced by applyJacobianInverse(), applyRightPreconditioning(), createPreconditioner(), destroyPreconditioner(), getPreconditionerPolicy(), and isPreconditionerConstructed().
bool NOX::Epetra::LinearSystemAztecOO::outputSolveDetails [protected] |
If set to true, solver information is printed to the "Output" sublist of the "Linear Solver" list.
Definition at line 649 of file NOX_Epetra_LinearSystem_AztecOO.H.
Referenced by applyJacobianInverse(), and reset().
bool NOX::Epetra::LinearSystemAztecOO::zeroInitialGuess [protected] |
Zero out the initial guess for linear solves performed through applyJacobianInverse calls (i.e. zero out the result vector before the linear solve).
Definition at line 652 of file NOX_Epetra_LinearSystem_AztecOO.H.
Referenced by applyJacobianInverse(), and reset().
bool NOX::Epetra::LinearSystemAztecOO::manualScaling [protected] |
Stores the parameter "Compute Scaling Manually".
Definition at line 655 of file NOX_Epetra_LinearSystem_AztecOO.H.
Referenced by applyJacobianInverse(), createPreconditioner(), and reset().
Policy for how to handle the preconditioner between nonlineaer iterations.
Definition at line 658 of file NOX_Epetra_LinearSystem_AztecOO.H.
Referenced by applyJacobianInverse(), getPreconditionerPolicy(), and reset().
int NOX::Epetra::LinearSystemAztecOO::precQueryCounter [protected] |
Counter for number of times called since reset or construction.
Definition at line 661 of file NOX_Epetra_LinearSystem_AztecOO.H.
Referenced by getPreconditionerPolicy(), and reset().
int NOX::Epetra::LinearSystemAztecOO::maxAgeOfPrec [protected] |
Parameter to determine whether or not to recompute Preconditioner.
Definition at line 664 of file NOX_Epetra_LinearSystem_AztecOO.H.
Referenced by getPreconditionerPolicy(), and reset().
Epetra_Time NOX::Epetra::LinearSystemAztecOO::timer [protected] |
Epetra_Time object.
Definition at line 667 of file NOX_Epetra_LinearSystem_AztecOO.H.
Referenced by applyJacobianInverse(), and createPreconditioner().
double NOX::Epetra::LinearSystemAztecOO::timeCreatePreconditioner [mutable, protected] |
Total time spent in createPreconditioner (sec.).
Definition at line 670 of file NOX_Epetra_LinearSystem_AztecOO.H.
Referenced by createPreconditioner(), and getTimeCreatePreconditioner().
double NOX::Epetra::LinearSystemAztecOO::timeApplyJacbianInverse [mutable, protected] |
Total time spent in applyJacobianInverse (sec.).
Definition at line 673 of file NOX_Epetra_LinearSystem_AztecOO.H.
Referenced by applyJacobianInverse(), and getTimeApplyJacobianInverse().
Teuchos::RCP<Epetra_Operator> NOX::Epetra::LinearSystemAztecOO::solvePrecOpPtr [mutable, protected] |
Preconditioner operator that will be used in solves.
Definition at line 676 of file NOX_Epetra_LinearSystem_AztecOO.H.
Referenced by createPreconditioner(), destroyPreconditioner(), getGeneratedPrecOperator(), setAztecOOPreconditioner(), and setPrecOperatorForSolve().
bool NOX::Epetra::LinearSystemAztecOO::throwErrorOnPrecFailure [protected] |
If true, any preconditioner error will cause a throw instead of a warning.
Definition at line 679 of file NOX_Epetra_LinearSystem_AztecOO.H.
Referenced by applyRightPreconditioning(), precError(), and reset().