NOX
Development
|
NOX pure abstract interface to a "group"; i.e., a solution vector and the corresponding F-vector, Jacobian matrix, gradient vector, and Newton vector. More...
#include <NOX_Multiphysics_Group.H>
Public Member Functions | |
Group (const Teuchos::RCP< std::vector< Teuchos::RCP< NOX::Solver::Generic > > > &solvers, const Teuchos::RCP< NOX::StatusTest::Generic > &t, const Teuchos::RCP< Teuchos::ParameterList > &p) | |
Constructor. More... | |
Group (const Group &grp, NOX::CopyType typ) | |
Constructor. | |
virtual | ~Group () |
Destructor. | |
virtual NOX::Abstract::Group & | operator= (const NOX::Abstract::Group &source) |
Copies the source group into this group. More... | |
virtual NOX::Abstract::Group & | operator= (const NOX::Multiphysics::Group &source) |
virtual void | setX (const NOX::Abstract::Vector &y) |
Set the solution vector x to y. More... | |
virtual void | computeX (const NOX::Abstract::Group &grp, const NOX::Abstract::Vector &d, double step) |
Compute x = grp.x + step * d. More... | |
virtual NOX::Abstract::Group::ReturnType | computeF () |
Compute and store F(x). More... | |
"Is" functions. | |
Checks to see if various objects have been computed. Returns true if the corresponding "compute" function has been called since the last change to the solution vector. | |
virtual bool | isF () const |
Return true if F is valid. | |
"Get" functions. | |
Note that these function do not check whether or not the vectors are valid. Must use the "Is" functions for that purpose. | |
virtual const NOX::Abstract::Vector & | getX () const |
Return solution vector. | |
virtual const NOX::Abstract::Vector & | getF () const |
Return F(x) | |
virtual double | getNormF () const |
Return 2-norm of F(x). More... | |
virtual const NOX::Abstract::Vector & | getGradient () const |
Return gradient. | |
virtual const NOX::Abstract::Vector & | getNewton () const |
Return Newton direction. | |
virtual Teuchos::RCP< const NOX::Abstract::Vector > | getXPtr () const |
Return RCP to solution vector. | |
virtual Teuchos::RCP< const NOX::Abstract::Vector > | getFPtr () const |
Return RCP to F(x) | |
virtual Teuchos::RCP< const NOX::Abstract::Vector > | getGradientPtr () const |
Return RCP to gradient. | |
virtual Teuchos::RCP< const NOX::Abstract::Vector > | getNewtonPtr () const |
Return RCP to Newton direction. | |
virtual Teuchos::RCP < NOX::Abstract::Group > | clone (NOX::CopyType type=NOX::DeepCopy) const |
Create a new Group of the same derived type as this one by cloning this one, and return a ref count pointer to the new group. More... | |
Public Member Functions inherited from NOX::Abstract::Group | |
Group () | |
Constructor. More... | |
virtual NOX::Abstract::Group::ReturnType | computeJacobian () |
Compute and store Jacobian. More... | |
virtual NOX::Abstract::Group::ReturnType | computeGradient () |
Compute and store gradient. More... | |
virtual NOX::Abstract::Group::ReturnType | computeNewton (Teuchos::ParameterList ¶ms) |
Compute the Newton direction, using parameters for the linear solve. More... | |
virtual NOX::Abstract::Group::ReturnType | applyJacobian (const NOX::Abstract::Vector &input, NOX::Abstract::Vector &result) const |
Applies Jacobian to the given input vector and puts the answer in the result. More... | |
virtual NOX::Abstract::Group::ReturnType | applyJacobianTranspose (const NOX::Abstract::Vector &input, NOX::Abstract::Vector &result) const |
Applies Jacobian-Transpose to the given input vector and puts the answer in the result. More... | |
virtual NOX::Abstract::Group::ReturnType | applyJacobianInverse (Teuchos::ParameterList ¶ms, const NOX::Abstract::Vector &input, NOX::Abstract::Vector &result) const |
Applies the inverse of the Jacobian matrix to the given input vector and puts the answer in result. More... | |
virtual NOX::Abstract::Group::ReturnType | applyRightPreconditioning (bool useTranspose, Teuchos::ParameterList ¶ms, const NOX::Abstract::Vector &input, NOX::Abstract::Vector &result) const |
Apply right preconditiong to the given input vector. More... | |
virtual NOX::Abstract::Group::ReturnType | applyJacobianMultiVector (const NOX::Abstract::MultiVector &input, NOX::Abstract::MultiVector &result) const |
applyJacobian for multiple right-hand sides More... | |
virtual NOX::Abstract::Group::ReturnType | applyJacobianTransposeMultiVector (const NOX::Abstract::MultiVector &input, NOX::Abstract::MultiVector &result) const |
applyJacobianTranspose for multiple right-hand sides More... | |
virtual NOX::Abstract::Group::ReturnType | applyJacobianInverseMultiVector (Teuchos::ParameterList ¶ms, const NOX::Abstract::MultiVector &input, NOX::Abstract::MultiVector &result) const |
applyJacobianInverse for multiple right-hand sides More... | |
virtual NOX::Abstract::Group::ReturnType | applyRightPreconditioningMultiVector (bool useTranspose, Teuchos::ParameterList ¶ms, const NOX::Abstract::MultiVector &input, NOX::Abstract::MultiVector &result) const |
applyRightPreconditioning for multiple right-hand sides More... | |
virtual bool | isJacobian () const |
Return true if the Jacobian is valid. More... | |
virtual bool | isGradient () const |
Return true if the gradient is valid. More... | |
virtual bool | isNewton () const |
Return true if the Newton direction is valid. More... | |
virtual const NOX::Abstract::Vector & | getScaledX () const |
virtual void | logLastLinearSolveStats (NOX::SolverStats &stats) const |
Adds statistics from last linear solve to the SovlerStats object. | |
virtual NOX::Abstract::Group::ReturnType | getNormLastLinearSolveResidual (double &residual) const |
Return the norm of the last linear solve residual as the result of either a call to computeNewton() or applyJacobianInverse(). More... | |
Protected Member Functions | |
virtual void | resetIsValid () |
resets the isValid flags to false | |
Protected Attributes | |
Teuchos::RCP< std::vector < Teuchos::RCP < NOX::Solver::Generic > > > | solversVecPtr |
Pointer to the container of solvers for each problem to be coupled. | |
IsValid flags | |
True if the current solution is up-to-date with respect to the currect xVector. | |
bool | isValidRHS |
double | normRHS |
2-Norm of RHS | |
Additional Inherited Members | |
Public Types inherited from NOX::Abstract::Group | |
enum | ReturnType { Ok, NotDefined, BadDependency, NotConverged, Failed } |
The computation of, say, the Newton direction in computeNewton() may fail in many different ways, so we have included a variety of return codes to describe the failures. Of course, we also have a code for success. More... | |
NOX pure abstract interface to a "group"; i.e., a solution vector and the corresponding F-vector, Jacobian matrix, gradient vector, and Newton vector.
This class is a member of the namespace NOX::Abstract.
The user should implement their own concrete implementation of this class or use one of the implementations provided by us. Typically the implementation is also tied to a particular NOX::Abstract::Vector implementation.
NOX::Multiphysics::Group::Group | ( | const Teuchos::RCP< std::vector< Teuchos::RCP< NOX::Solver::Generic > > > & | solvers, |
const Teuchos::RCP< NOX::StatusTest::Generic > & | t, | ||
const Teuchos::RCP< Teuchos::ParameterList > & | p | ||
) |
Constructor.
References getX(), and resetIsValid().
|
virtual |
Create a new Group of the same derived type as this one by cloning this one, and return a ref count pointer to the new group.
If type is NOX::DeepCopy, then we need to create an exact replica of "this". Otherwise, if type is NOX::ShapeCopy, we need only replicate the shape of "this" (only the memory is allocated, the values are not copied into the vectors and Jacobian). Returns NULL if clone is not supported.
Implements NOX::Abstract::Group.
References Teuchos::rcp().
|
virtual |
Compute and store F(x).
Implements NOX::Abstract::Group.
References NOX::Abstract::Group::getNormF(), and NOX::Abstract::Group::Ok.
|
virtual |
Compute x = grp.x + step * d.
Let denote this group's solution vector. Let denote the result of grp.getX(). Then set
Implements NOX::Abstract::Group.
|
virtual |
|
virtual |
Copies the source group into this group.
Implements NOX::Abstract::Group.
|
virtual |
Set the solution vector x to y.
Implements NOX::Abstract::Group.