#include <LOCA_Epetra_ModelEvaluatorInterface.H>


Public Member Functions | |
| ModelEvaluatorInterface (const Teuchos::RCP< LOCA::GlobalData > &global_data, const Teuchos::RefCountPtr< EpetraExt::ModelEvaluator > &m, double perturb=1.0e-6) | |
| Constructor. | |
| virtual | ~ModelEvaluatorInterface () |
| Destructor. | |
| const ParameterVector & | getLOCAParameterVector () const |
| Return LOCA parameter vector. | |
| virtual bool | computeF (const Epetra_Vector &x, Epetra_Vector &F, const FillType fillFlag) |
| Compute the function, F, given the specified input vector x. Returns true if computation was successful. | |
| virtual bool | computeJacobian (const Epetra_Vector &x, Epetra_Operator &Jac) |
| virtual bool | computePreconditioner (const Epetra_Vector &x, Epetra_Operator &M, Teuchos::ParameterList *precParams=0) |
| Computes a user defined preconditioner. | |
| virtual void | setParameters (const ParameterVector &p) |
| Set parameters in the user's application. | |
| virtual bool | computeShiftedMatrix (double alpha, double beta, const Epetra_Vector &x, Epetra_Operator &A) |
Call user routine for computing the shifted matrix where is the Jacobian matrix and is the mass matrix. | |
| ModelEvaluatorInterface (const ModelEvaluatorInterface &) | |
| Copy constructor. | |
| virtual Teuchos::RCP< DerivUtils > | clone (NOX::CopyType type=NOX::DeepCopy) const |
| Clone. | |
| virtual NOX::Abstract::Group::ReturnType | computeDfDp (LOCA::MultiContinuation::AbstractGroup &grp, const vector< int > ¶m_ids, NOX::Abstract::MultiVector &result, bool isValidF) const |
| Compute derivative of f with respect to parameter, identified by param_id. | |
Protected Attributes | |
| Epetra_Vector | param_vec |
| Parameter vector as an Epetra_Vector. | |
| LOCA::ParameterVector | loca_param_vec |
| LOCA parameter vector. | |
| Epetra_Vector * | x_dot |
| Epetra vector storing x_dot, filled with zeros. | |
If an application interfaces their code to solvers using the EpetraExt::ModelEvaluator, this class provides a wrapper so that the model evaluator can be used instead of having the user write concrete versions of the LOCA::Epetra::Interface objects.
Definition at line 63 of file LOCA_Epetra_ModelEvaluatorInterface.H.
| LOCA::Epetra::ModelEvaluatorInterface::ModelEvaluatorInterface | ( | const Teuchos::RCP< LOCA::GlobalData > & | global_data, | |
| const Teuchos::RefCountPtr< EpetraExt::ModelEvaluator > & | m, | |||
| double | perturb = 1.0e-6 | |||
| ) |
Constructor.
Definition at line 53 of file LOCA_Epetra_ModelEvaluatorInterface.C.
References LOCA::ParameterVector::addParameter(), loca_param_vec, and param_vec.
| LOCA::Epetra::ModelEvaluatorInterface::~ModelEvaluatorInterface | ( | ) | [virtual] |
Destructor.
Reimplemented from NOX::Epetra::ModelEvaluatorInterface.
Definition at line 72 of file LOCA_Epetra_ModelEvaluatorInterface.C.
References x_dot.
| LOCA::Epetra::ModelEvaluatorInterface::ModelEvaluatorInterface | ( | const ModelEvaluatorInterface & | m | ) |
Copy constructor.
Definition at line 225 of file LOCA_Epetra_ModelEvaluatorInterface.C.
References x_dot.
| const LOCA::ParameterVector & LOCA::Epetra::ModelEvaluatorInterface::getLOCAParameterVector | ( | ) | const |
Return LOCA parameter vector.
Definition at line 81 of file LOCA_Epetra_ModelEvaluatorInterface.C.
References loca_param_vec.
| bool LOCA::Epetra::ModelEvaluatorInterface::computeF | ( | const Epetra_Vector & | x, | |
| Epetra_Vector & | F, | |||
| const FillType | fillFlag | |||
| ) | [virtual] |
Compute the function, F, given the specified input vector x. Returns true if computation was successful.
Reimplemented from NOX::Epetra::ModelEvaluatorInterface.
Definition at line 89 of file LOCA_Epetra_ModelEvaluatorInterface.C.
References NOX::Epetra::Interface::Required::Jac, NOX::Epetra::ModelEvaluatorInterface::model_, param_vec, NOX::Epetra::Interface::Required::Residual, and x_dot.
| bool LOCA::Epetra::ModelEvaluatorInterface::computeJacobian | ( | const Epetra_Vector & | x, | |
| Epetra_Operator & | Jac | |||
| ) | [virtual] |
Compute Jacobian given the specified input vector x. Returns true if computation was successful.
Reimplemented from NOX::Epetra::ModelEvaluatorInterface.
Definition at line 122 of file LOCA_Epetra_ModelEvaluatorInterface.C.
References NOX::Epetra::ModelEvaluatorInterface::model_, param_vec, and x_dot.
| bool LOCA::Epetra::ModelEvaluatorInterface::computePreconditioner | ( | const Epetra_Vector & | x, | |
| Epetra_Operator & | M, | |||
| Teuchos::ParameterList * | precParams = 0 | |||
| ) | [virtual] |
Computes a user defined preconditioner.
Reimplemented from NOX::Epetra::ModelEvaluatorInterface.
Definition at line 153 of file LOCA_Epetra_ModelEvaluatorInterface.C.
References NOX::Epetra::ModelEvaluatorInterface::model_, param_vec, and x_dot.
| void LOCA::Epetra::ModelEvaluatorInterface::setParameters | ( | const ParameterVector & | p | ) | [virtual] |
Set parameters in the user's application.
Should be called prior to calling one of the compute functions.
Implements LOCA::Epetra::Interface::Required.
Definition at line 186 of file LOCA_Epetra_ModelEvaluatorInterface.C.
References LOCA::ParameterVector::length(), and param_vec.
| bool LOCA::Epetra::ModelEvaluatorInterface::computeShiftedMatrix | ( | double | alpha, | |
| double | beta, | |||
| const Epetra_Vector & | x, | |||
| Epetra_Operator & | A | |||
| ) | [virtual] |
Call user routine for computing the shifted matrix
where
is the Jacobian matrix and
is the mass matrix.
Implements LOCA::Epetra::Interface::TimeDependent.
Definition at line 195 of file LOCA_Epetra_ModelEvaluatorInterface.C.
References NOX::Epetra::ModelEvaluatorInterface::model_, param_vec, and x_dot.
| Teuchos::RCP< LOCA::DerivUtils > LOCA::Epetra::ModelEvaluatorInterface::clone | ( | NOX::CopyType | type = NOX::DeepCopy |
) | const [virtual] |
Clone.
Reimplemented from LOCA::DerivUtils.
Definition at line 239 of file LOCA_Epetra_ModelEvaluatorInterface.C.
| NOX::Abstract::Group::ReturnType LOCA::Epetra::ModelEvaluatorInterface::computeDfDp | ( | LOCA::MultiContinuation::AbstractGroup & | grp, | |
| const vector< int > & | param_ids, | |||
| NOX::Abstract::MultiVector & | result, | |||
| bool | isValidF | |||
| ) | const [virtual] |
Compute derivative of f with respect to parameter, identified by param_id.
Reimplemented from LOCA::DerivUtils.
Definition at line 246 of file LOCA_Epetra_ModelEvaluatorInterface.C.
References NOX::Epetra::Vector::getEpetraVector(), NOX::Abstract::Group::getX(), NOX::Epetra::ModelEvaluatorInterface::model_, NOX::Abstract::MultiVector::numVectors(), NOX::Abstract::Group::Ok, param_vec, NOX::Abstract::MultiVector::subView(), and x_dot.
Epetra_Vector LOCA::Epetra::ModelEvaluatorInterface::param_vec [protected] |
Parameter vector as an Epetra_Vector.
Definition at line 120 of file LOCA_Epetra_ModelEvaluatorInterface.H.
Referenced by computeDfDp(), computeF(), computeJacobian(), computePreconditioner(), computeShiftedMatrix(), ModelEvaluatorInterface(), and setParameters().
LOCA parameter vector.
Definition at line 123 of file LOCA_Epetra_ModelEvaluatorInterface.H.
Referenced by getLOCAParameterVector(), and ModelEvaluatorInterface().
Epetra_Vector* LOCA::Epetra::ModelEvaluatorInterface::x_dot [mutable, protected] |
Epetra vector storing x_dot, filled with zeros.
Definition at line 126 of file LOCA_Epetra_ModelEvaluatorInterface.H.
Referenced by computeDfDp(), computeF(), computeJacobian(), computePreconditioner(), computeShiftedMatrix(), ModelEvaluatorInterface(), and ~ModelEvaluatorInterface().
1.5.9