#include <NOX_Belos_Group.H>
Public Member Functions | |
Group (const Teuchos::RCP< NOX::Abstract::Group > &g, NOX::Parameter::List &printParams) | |
Constructor. | |
Group (const Group &source, NOX::CopyType type=NOX::DeepCopy) | |
Copy constructor. | |
virtual | ~Group () |
Destructor. | |
virtual Group & | operator= (const Group &source) |
Assignment operator. | |
Implementation of NOX::Abstract::Group virtual methods | |
virtual NOX::Abstract::Group & | operator= (const NOX::Abstract::Group &source) |
Assignment operator. | |
virtual Teuchos::RCP < NOX::Abstract::Group > | clone (NOX::CopyType type=NOX::DeepCopy) const |
Cloning function. | |
virtual void | setX (const NOX::Abstract::Vector &y) |
Set the solution vector, x, to y. | |
virtual void | computeX (const NOX::Abstract::Group &g, const NOX::Abstract::Vector &d, double step) |
Compute this.x = grp.x + step * d. | |
virtual NOX::Abstract::Group::ReturnType | computeF () |
Compute F. | |
virtual NOX::Abstract::Group::ReturnType | computeJacobian () |
Compute Jacobian. | |
virtual NOX::Abstract::Group::ReturnType | computeGradient () |
Compute gradient. | |
virtual NOX::Abstract::Group::ReturnType | computeNewton (NOX::Parameter::List ¶ms) |
Compute Newton direction using applyJacobianInverse(). | |
virtual NOX::Abstract::Group::ReturnType | applyJacobian (const NOX::Abstract::Vector &input, NOX::Abstract::Vector &result) const |
Computes the Jacobian vector product. | |
virtual NOX::Abstract::Group::ReturnType | applyJacobianTranspose (const NOX::Abstract::Vector &input, NOX::Abstract::Vector &result) const |
Computes the Jacobian-transpose vector product. | |
virtual NOX::Abstract::Group::ReturnType | applyJacobianInverse (NOX::Parameter::List ¶ms, const NOX::Abstract::Vector &input, NOX::Abstract::Vector &result) const |
Applies the inverse of the Jacobian matrix using Belos. | |
virtual NOX::Abstract::Group::ReturnType | applyRightPreconditioning (bool useTranspose, NOX::Parameter::List ¶ms, const NOX::Abstract::Vector &input, NOX::Abstract::Vector &result) const |
Applies the right preconditioner. | |
virtual NOX::Abstract::Group::ReturnType | applyJacobianMultiVector (const NOX::Abstract::MultiVector &input, NOX::Abstract::MultiVector &result) const |
applyJacobian for multiple right-hand sides | |
virtual NOX::Abstract::Group::ReturnType | applyJacobianTransposeMultiVector (const NOX::Abstract::MultiVector &input, NOX::Abstract::MultiVector &result) const |
applyJacobianTranspose for multiple right-hand sides | |
virtual NOX::Abstract::Group::ReturnType | applyJacobianInverseMultiVector (NOX::Parameter::List ¶ms, const NOX::Abstract::MultiVector &input, NOX::Abstract::MultiVector &result) const |
applyJacobianInverse for multiple right-hand sides | |
virtual NOX::Abstract::Group::ReturnType | applyRightPreconditioningMultiVector (bool useTranspose, NOX::Parameter::List ¶ms, const NOX::Abstract::MultiVector &input, NOX::Abstract::MultiVector &result) const |
applyRightPreconditioning for multiple right-hand sides | |
virtual bool | isF () const |
Return true if the residual ![]() | |
virtual bool | isJacobian () const |
Return true if the Jacobian is valid. | |
virtual bool | isGradient () const |
Return true if the gradient is valid. | |
virtual bool | isNewton () const |
Return true if the Newton direction is valid. | |
virtual const NOX::Abstract::Vector & | getX () const |
Return solution vector ![]() | |
virtual const NOX::Abstract::Vector & | getF () const |
Return residual ![]() | |
virtual double | getNormF () const |
Return 2-norm of ![]() | |
virtual const NOX::Abstract::Vector & | getGradient () const |
Return gradient. | |
virtual const NOX::Abstract::Vector & | getNewton () const |
Return Newton direction. | |
virtual double | getNormNewtonSolveResidual () const |
Return the norm of the Newton solve residual. | |
Protected Member Functions | |
void | resetIsValid () |
Rest all is-valid flags. | |
Protected Attributes | |
Teuchos::RCP < NOX::Abstract::Group > | grpPtr |
Stores the underlying group. | |
Teuchos::RCP < NOX::Abstract::Vector > | newtonVecPtr |
Vector to store the Newton vector. | |
bool | isValidNewton |
Flag indicating whether Newton vector is valid. | |
NOX::Utils | utils |
Utils object | |
int | myPID |
ID of processor. |
This group is an implementation of the NOX::Abstract::Group to use Belos for Jacobian solves. Belos is a block, generic iterative linear solver package in Trilinos.
This group is designed to be a wrapper for another group tied to a specific application code. It forwards all group methods to this group except applyJacobianInverse, which it implements using Belos. The iterative solve is implemented using the supplied group's applyJacobian and applyRightPreconditioning methods.
Definition at line 66 of file NOX_Belos_Group.H.
NOX::Belos::Group::Group | ( | const Teuchos::RCP< NOX::Abstract::Group > & | g, | |
NOX::Parameter::List & | printParams | |||
) |
NOX::Belos::Group::Group | ( | const Group & | source, | |
NOX::CopyType | type = NOX::DeepCopy | |||
) |
Copy constructor.
Definition at line 68 of file NOX_Belos_Group.C.
References NOX::DeepCopy, and isValidNewton.
NOX::Belos::Group::~Group | ( | ) | [virtual] |
Destructor.
Reimplemented from NOX::Abstract::Group.
Definition at line 81 of file NOX_Belos_Group.C.
NOX::Belos::Group & NOX::Belos::Group::operator= | ( | const Group & | source | ) | [virtual] |
Assignment operator.
Definition at line 87 of file NOX_Belos_Group.C.
References grpPtr, isValidNewton, myPID, newtonVecPtr, and utils.
NOX::Abstract::Group & NOX::Belos::Group::operator= | ( | const NOX::Abstract::Group & | source | ) | [virtual] |
Assignment operator.
Implements NOX::Abstract::Group.
Definition at line 106 of file NOX_Belos_Group.C.
Teuchos::RCP< NOX::Abstract::Group > NOX::Belos::Group::clone | ( | NOX::CopyType | type = NOX::DeepCopy |
) | const [virtual] |
Cloning function.
Implements NOX::Abstract::Group.
Definition at line 113 of file NOX_Belos_Group.C.
void NOX::Belos::Group::setX | ( | const NOX::Abstract::Vector & | y | ) | [virtual] |
Set the solution vector, x, to y.
Implements NOX::Abstract::Group.
Definition at line 121 of file NOX_Belos_Group.C.
References grpPtr, and resetIsValid().
void NOX::Belos::Group::computeX | ( | const NOX::Abstract::Group & | g, | |
const NOX::Abstract::Vector & | d, | |||
double | step | |||
) | [virtual] |
Compute this.x = grp.x + step * d.
Implements NOX::Abstract::Group.
Definition at line 128 of file NOX_Belos_Group.C.
References grpPtr, and resetIsValid().
NOX::Abstract::Group::ReturnType NOX::Belos::Group::computeF | ( | ) | [virtual] |
Compute F.
Implements NOX::Abstract::Group.
Definition at line 138 of file NOX_Belos_Group.C.
References grpPtr.
NOX::Abstract::Group::ReturnType NOX::Belos::Group::computeJacobian | ( | ) | [virtual] |
Compute Jacobian.
Reimplemented from NOX::Abstract::Group.
Definition at line 144 of file NOX_Belos_Group.C.
References grpPtr.
NOX::Abstract::Group::ReturnType NOX::Belos::Group::computeGradient | ( | ) | [virtual] |
Compute gradient.
Reimplemented from NOX::Abstract::Group.
Definition at line 150 of file NOX_Belos_Group.C.
References grpPtr.
NOX::Abstract::Group::ReturnType NOX::Belos::Group::computeNewton | ( | NOX::Parameter::List & | params | ) | [virtual] |
Compute Newton direction using applyJacobianInverse().
Definition at line 156 of file NOX_Belos_Group.C.
References applyJacobianInverse(), getF(), isF(), isJacobian(), isValidNewton, newtonVecPtr, and NOX::Abstract::Group::Ok.
NOX::Abstract::Group::ReturnType NOX::Belos::Group::applyJacobian | ( | const NOX::Abstract::Vector & | input, | |
NOX::Abstract::Vector & | result | |||
) | const [virtual] |
Computes the Jacobian vector product.
Reimplemented from NOX::Abstract::Group.
Definition at line 189 of file NOX_Belos_Group.C.
References grpPtr.
Referenced by getNormNewtonSolveResidual().
NOX::Abstract::Group::ReturnType NOX::Belos::Group::applyJacobianTranspose | ( | const NOX::Abstract::Vector & | input, | |
NOX::Abstract::Vector & | result | |||
) | const [virtual] |
Computes the Jacobian-transpose vector product.
Reimplemented from NOX::Abstract::Group.
Definition at line 196 of file NOX_Belos_Group.C.
References grpPtr.
NOX::Abstract::Group::ReturnType NOX::Belos::Group::applyJacobianInverse | ( | NOX::Parameter::List & | params, | |
const NOX::Abstract::Vector & | input, | |||
NOX::Abstract::Vector & | result | |||
) | const [virtual] |
Applies the inverse of the Jacobian matrix using Belos.
Definition at line 204 of file NOX_Belos_Group.C.
References applyJacobianInverseMultiVector(), NOX::Abstract::Vector::createMultiVector(), and NOX::DeepCopy.
Referenced by computeNewton().
NOX::Abstract::Group::ReturnType NOX::Belos::Group::applyRightPreconditioning | ( | bool | useTranspose, | |
NOX::Parameter::List & | params, | |||
const NOX::Abstract::Vector & | input, | |||
NOX::Abstract::Vector & | result | |||
) | const [virtual] |
Applies the right preconditioner.
Definition at line 225 of file NOX_Belos_Group.C.
References grpPtr.
NOX::Abstract::Group::ReturnType NOX::Belos::Group::applyJacobianMultiVector | ( | const NOX::Abstract::MultiVector & | input, | |
NOX::Abstract::MultiVector & | result | |||
) | const [virtual] |
applyJacobian for multiple right-hand sides
Reimplemented from NOX::Abstract::Group.
Definition at line 236 of file NOX_Belos_Group.C.
References grpPtr.
NOX::Abstract::Group::ReturnType NOX::Belos::Group::applyJacobianTransposeMultiVector | ( | const NOX::Abstract::MultiVector & | input, | |
NOX::Abstract::MultiVector & | result | |||
) | const [virtual] |
applyJacobianTranspose for multiple right-hand sides
Reimplemented from NOX::Abstract::Group.
Definition at line 244 of file NOX_Belos_Group.C.
References grpPtr.
NOX::Abstract::Group::ReturnType NOX::Belos::Group::applyJacobianInverseMultiVector | ( | NOX::Parameter::List & | params, | |
const NOX::Abstract::MultiVector & | input, | |||
NOX::Abstract::MultiVector & | result | |||
) | const [virtual] |
applyJacobianInverse for multiple right-hand sides
Definition at line 252 of file NOX_Belos_Group.C.
References NOX::Abstract::Group::Failed, grpPtr, myPID, NOX::Abstract::Group::NotConverged, NOX::Abstract::MultiVector::numVectors(), and NOX::Abstract::Group::Ok.
Referenced by applyJacobianInverse().
NOX::Abstract::Group::ReturnType NOX::Belos::Group::applyRightPreconditioningMultiVector | ( | bool | useTranspose, | |
NOX::Parameter::List & | params, | |||
const NOX::Abstract::MultiVector & | input, | |||
NOX::Abstract::MultiVector & | result | |||
) | const [virtual] |
applyRightPreconditioning for multiple right-hand sides
Definition at line 333 of file NOX_Belos_Group.C.
References grpPtr.
bool NOX::Belos::Group::isF | ( | ) | const [virtual] |
Return true
if the residual is valid.
Implements NOX::Abstract::Group.
Definition at line 344 of file NOX_Belos_Group.C.
References grpPtr.
Referenced by computeNewton().
bool NOX::Belos::Group::isJacobian | ( | ) | const [virtual] |
Return true
if the Jacobian is valid.
Reimplemented from NOX::Abstract::Group.
Definition at line 350 of file NOX_Belos_Group.C.
References grpPtr.
Referenced by computeNewton().
bool NOX::Belos::Group::isGradient | ( | ) | const [virtual] |
Return true
if the gradient is valid.
Reimplemented from NOX::Abstract::Group.
Definition at line 356 of file NOX_Belos_Group.C.
References grpPtr.
bool NOX::Belos::Group::isNewton | ( | ) | const [virtual] |
Return true
if the Newton direction is valid.
Reimplemented from NOX::Abstract::Group.
Definition at line 362 of file NOX_Belos_Group.C.
References isValidNewton.
const NOX::Abstract::Vector & NOX::Belos::Group::getX | ( | ) | const [virtual] |
Return solution vector .
Implements NOX::Abstract::Group.
Definition at line 368 of file NOX_Belos_Group.C.
References grpPtr.
const NOX::Abstract::Vector & NOX::Belos::Group::getF | ( | ) | const [virtual] |
Return residual .
Implements NOX::Abstract::Group.
Definition at line 374 of file NOX_Belos_Group.C.
References grpPtr.
Referenced by computeNewton(), and getNormNewtonSolveResidual().
double NOX::Belos::Group::getNormF | ( | ) | const [virtual] |
Return 2-norm of .
Implements NOX::Abstract::Group.
Definition at line 380 of file NOX_Belos_Group.C.
References grpPtr.
const NOX::Abstract::Vector & NOX::Belos::Group::getGradient | ( | ) | const [virtual] |
Return gradient.
Implements NOX::Abstract::Group.
Definition at line 386 of file NOX_Belos_Group.C.
References grpPtr.
const NOX::Abstract::Vector & NOX::Belos::Group::getNewton | ( | ) | const [virtual] |
Return Newton direction.
Implements NOX::Abstract::Group.
Definition at line 392 of file NOX_Belos_Group.C.
References newtonVecPtr.
double NOX::Belos::Group::getNormNewtonSolveResidual | ( | ) | const [virtual] |
Return the norm of the Newton solve residual.
Definition at line 398 of file NOX_Belos_Group.C.
References applyJacobian(), NOX::Abstract::Vector::clone(), NOX::DeepCopy, getF(), newtonVecPtr, and NOX::Abstract::Group::Ok.
void NOX::Belos::Group::resetIsValid | ( | ) | [protected] |
Rest all is-valid flags.
Definition at line 417 of file NOX_Belos_Group.C.
References isValidNewton.
Referenced by computeX(), and setX().
Teuchos::RCP<NOX::Abstract::Group> NOX::Belos::Group::grpPtr [protected] |
Stores the underlying group.
Definition at line 206 of file NOX_Belos_Group.H.
Referenced by applyJacobian(), applyJacobianInverseMultiVector(), applyJacobianMultiVector(), applyJacobianTranspose(), applyJacobianTransposeMultiVector(), applyRightPreconditioning(), applyRightPreconditioningMultiVector(), computeF(), computeGradient(), computeJacobian(), computeX(), getF(), getGradient(), getNormF(), getX(), isF(), isGradient(), isJacobian(), operator=(), and setX().
Teuchos::RCP<NOX::Abstract::Vector> NOX::Belos::Group::newtonVecPtr [protected] |
Vector to store the Newton vector.
Definition at line 209 of file NOX_Belos_Group.H.
Referenced by computeNewton(), getNewton(), getNormNewtonSolveResidual(), and operator=().
bool NOX::Belos::Group::isValidNewton [protected] |
Flag indicating whether Newton vector is valid.
Definition at line 212 of file NOX_Belos_Group.H.
Referenced by computeNewton(), Group(), isNewton(), operator=(), and resetIsValid().
NOX::Utils NOX::Belos::Group::utils [protected] |
int NOX::Belos::Group::myPID [protected] |
ID of processor.
Definition at line 218 of file NOX_Belos_Group.H.
Referenced by applyJacobianInverseMultiVector(), and operator=().