Piro  Development
 All Classes Namespaces Functions Variables Groups
List of all members
Piro::MatrixFreeLinearOp< Scalar > Class Template Reference

This class implements a matrix-free Jacobian linear operator based on finite difference. More...

#include <Piro_MatrixFreeLinearOp.hpp>

Inheritance diagram for Piro::MatrixFreeLinearOp< Scalar >:
Inheritance graph
[legend]
Collaboration diagram for Piro::MatrixFreeLinearOp< Scalar >:
Collaboration graph
[legend]

Public Member Functions

Constructors/initializers
 MatrixFreeLinearOp (const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, const double lambda)
 Construct a partially initialized Jacobian operator for the specified model evaluator. More...
 
Underlying model evaluator
Teuchos::RCP< const
Thyra::ModelEvaluator< Scalar > > 
model () const
 Model evaluator whose Jacobian operator is implemented by this object.
 
Base point at which the Jacobian operator is computed
Thyra::ModelEvaluatorBase::InArgs
< Scalar > 
basePoint () const
 Input arguments defining the base point.
 
Teuchos::RCP< const
Thyra::VectorBase< Scalar > > 
f_base () const
 Residual evaluated at the base point. More...
 
void setBase (const Thyra::ModelEvaluatorBase::InArgs< Scalar > &basePoint, const Teuchos::RCP< const Thyra::VectorBase< Scalar > > &f_base)
 Set the base point. More...
 

Overridden from Thyra::LinearOpBase< Scalar >

Teuchos::RCP< const
Thyra::VectorSpaceBase< Scalar > > 
range () const
 
Teuchos::RCP< const
Thyra::VectorSpaceBase< Scalar > > 
domain () const
 
bool opSupportedImpl (Thyra::EOpTransp M_trans) const
 
void applyImpl (const Thyra::EOpTransp M_trans, const Thyra::MultiVectorBase< Scalar > &X, const Teuchos::Ptr< Thyra::MultiVectorBase< Scalar > > &Y, const Scalar alpha, const Scalar beta) const
 

Detailed Description

template<typename Scalar>
class Piro::MatrixFreeLinearOp< Scalar >

This class implements a matrix-free Jacobian linear operator based on finite difference.

This class wraps a model evaluator supporting residual calculation, and computes a finite difference approximation of the Jacobian directional derivative at the chosen base point. It is the Thyra-based functional equivalent of Piro::Epetra::MatrixFreeOperator, and implements the Thyra::LinerarOp interface instead of Epetra_Operator.

Time-dependent problems (characterized by x_dot != null) are supported. The class uses the input values of the alpha and beta coefficients that appear in the definition of the Jacobian operator: W = alpha * (Df/ Dx_dot) + beta * (Df / Dx)

Constructor & Destructor Documentation

template<typename Scalar >
Piro::MatrixFreeLinearOp< Scalar >::MatrixFreeLinearOp ( const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &  model,
const double  lambda 
)
explicit

Construct a partially initialized Jacobian operator for the specified model evaluator.

Precondition
model != null

Member Function Documentation

template<typename Scalar >
Teuchos::RCP<const Thyra::VectorBase<Scalar> > Piro::MatrixFreeLinearOp< Scalar >::f_base ( ) const

Residual evaluated at the base point.

The object is fully initialized if and only if f_base != null.

template<typename Scalar >
void Piro::MatrixFreeLinearOp< Scalar >::setBase ( const Thyra::ModelEvaluatorBase::InArgs< Scalar > &  basePoint,
const Teuchos::RCP< const Thyra::VectorBase< Scalar > > &  f_base 
)

Set the base point.

This function must be called after construction to fully initialize the object.

The object makes shallow copies of its arguments. The user is responsible for avoiding unwanted aliasing. Also, if the passed pointers do not have (possibly shared) ownership of the references objects, the user must ensure that they are kept alive until this function is called again, or the object is destroyed.


The documentation for this class was generated from the following file: