46 #include <Xyce_config.h>
57 #include <N_LAS_Vector.h>
58 #include <N_ERH_ErrorMgr.h>
61 #include <NOX_Abstract_Vector.H>
77 xVecPtr_(Teuchos::rcp(dynamic_cast<
Vector*>(s.cloneSolutionVector()))),
79 fVecPtr_(Teuchos::rcp_dynamic_cast<
Vector>(xVec_.clone(
NOX::ShapeCopy))),
82 haveSolverFactors_(false)
96 sharedSystemPtr_(source.sharedSystemPtr_),
97 xVecPtr_(Teuchos::rcp_dynamic_cast<
Vector>(source.getX().clone(type))),
99 fVecPtr_(Teuchos::rcp_dynamic_cast<
Vector>(xVec_.clone(
NOX::ShapeCopy))),
102 haveSolverFactors_(false)
161 const std::string message =
"N_NLS::NOX::Group::Group() - Invalid ConstructorType for group copy constructor";
162 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL, message);
188 return operator=(dynamic_cast<const Group&>(source));
260 setX(dynamic_cast<const Vector&>(input));
287 const NOX::Abstract::Vector& d,
290 computeX(dynamic_cast<const Group&>(grp), dynamic_cast<const Vector&>(d),
318 if(
isF() )
return Ok;
328 return (
isF()?Ok:Failed);
363 throwError(
"computeGradient",
"F is not Valid!");
366 throwError(
"computeGradient",
"Jacobian is not Valid!");
372 NOX::Abstract::Group::ReturnType status =
397 throwError(
"computeNewton",
"F is not Valid!");
400 throwError(
"computeNewton",
"Jacobian is not Valid!");
423 NOX::Abstract::Group::ReturnType
Group::applyJacobian(
const NOX::Abstract::Vector& input, NOX::Abstract::Vector& result)
const
425 return applyJacobian(dynamic_cast<const Vector&>(input), dynamic_cast<Vector&>(result));
439 throwError(
"applyJacobian",
"Jacobian is not Valid!");
459 NOX::Abstract::Vector& result)
const
462 dynamic_cast<Vector&>(result));
476 throwError(
"applyJacobianTranspose",
"Jacobian is not Valid!");
489 NOX::Abstract::Group::ReturnType
491 const NOX::Abstract::Vector& input,
492 NOX::Abstract::Vector& result)
const
495 dynamic_cast<Vector&>(result));
506 NOX::Abstract::Group::ReturnType
511 throwError(
"applyJacobianInverse",
"Jacobian is not Valid!");
517 return (status ? Ok : Failed);
528 NOX::Abstract::Group::ReturnType
530 Teuchos::ParameterList& params,
531 const NOX::Abstract::Vector& input,
532 NOX::Abstract::Vector& result)
const
535 dynamic_cast<const Vector&>(input),
536 dynamic_cast<Vector&> (result));
547 NOX::Abstract::Group::ReturnType
549 Teuchos::ParameterList& params,
564 return NOX::Abstract::Group::Ok;
644 "F is not current with respect to the solution vector!");
664 (
const_cast<Group*
>(
this))->computeF();
681 throwError(
"getGradient",
"gradVecPtr_ is 0!");
698 throwError(
"getNewton",
"newtonVecPtr_ is 0!");
711 Teuchos::RCP<NOX::Abstract::Group>
714 Teuchos::RCP<Group> ptr = Teuchos::rcp(
new Group(*
this, type));
746 const std::string leader =
"N_NLS::NOX::Group::";
747 const std::string fcn =
"() - ";
749 std::string
error = leader + method + fcn + message;
751 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL, error);
const NOX::Abstract::Vector & getGradient() const
Teuchos::RCP< NOX::Abstract::Vector > clone(NOX::CopyType type=NOX::DeepCopy) const
bool areStateVectors(const Group *grp) const
void setX(const Vector &input)
bool applyJacobian(const Vector &input, Vector &result) const
const NOX::Abstract::Vector & getX() const
bool computeNewton(const Vector &F, Vector &Newton, Teuchos::ParameterList ¶ms)
Pure virtual class to augment a linear system.
bool applyJacobianTranspose(const Vector &input, Vector &result) const
Teuchos::RCP< Vector > newtonVecPtr_
bool isValidPreconditioner_
NOX::Abstract::Group::ReturnType computeF()
void computeX(const Group &grp, const Vector &d, double step)
NOX::Abstract::Group::ReturnType applyJacobianInverse(Teuchos::ParameterList ¶ms, const Vector &input, Vector &result) const
bool computePreconditioner()
NOX::Abstract::Vector & scale(double gamma)
NOX::Abstract::Group::ReturnType computeGradient()
bool applyRightPreconditioning(bool useTranspose, Teuchos::ParameterList ¶ms, const Vector &input, Vector &result)
const NOX::Abstract::Vector & getF() const
NOX::Abstract::Group::ReturnType computeJacobian()
NOX::Abstract::Group::ReturnType computeNewton(Teuchos::ParameterList ¶ms)
NOX::Abstract::Group::ReturnType applyRightPreconditioning(bool useTranspose, Teuchos::ParameterList ¶ms, const Vector &input, Vector &result) const
NOX::Abstract::Group & operator=(const Group &source)
NOX::Abstract::Vector & update(double alpha, const Vector &a, double gamma=0.0)
Teuchos::RCP< Vector > gradVecPtr_
const Xyce::Linear::Matrix & getJacobian() const
double norm(NOX::Abstract::Vector::NormType type=NOX::Abstract::Vector::TwoNorm) const
NOX::Abstract::Group::ReturnType applyJacobian(const Vector &input, Vector &result) const
void error(const std::string &msg)
bool computeJacobian(Group *grp)
void throwError(std::string method, std::string message) const
void getStateVectors(const Group *grp)
bool isJacobianOwner(const Group *grp) const
bool computeF(const Vector &solution, Vector &F, const Group *grp)
SharedSystem * sharedSystemPtr_
Teuchos::RCP< NOX::Abstract::Group > clone(NOX::CopyType type=NOX::DeepCopy) const
const NOX::Abstract::Vector & getNewton() const
NOX::Abstract::Group::ReturnType applyJacobianTranspose(const Vector &input, Vector &result) const