Thyra
Version of the Day
|
Simple 2d simulation only ModelEvaluator for f(x) = 0. More...
#include <Thyra_Simple2DModelEvaluator_decl.hpp>
Related Functions | |
(Note that these are not member functions.) | |
template<class Scalar > | |
Teuchos::RCP < Simple2DModelEvaluator < Scalar > > | simple2DModelEvaluator () |
Nonmember constuctor. More... | |
Related Functions inherited from Thyra::ModelEvaluatorDefaultBase< Scalar > | |
template<class Scalar > | |
RCP < ModelEvaluatorBase::InArgs < Scalar > > | clone (const ModelEvaluatorBase::InArgs< Scalar > &inArgs) |
Create a clone of an InArgs object. More... | |
template<class Scalar > | |
ModelEvaluatorBase::Derivative < Scalar > | derivativeGradient (const RCP< MultiVectorBase< Scalar > > &grad) |
template<class Scalar > | |
ModelEvaluatorBase::DerivativeMultiVector < Scalar > | create_DfDp_mv (const ModelEvaluator< Scalar > &model, int l, ModelEvaluatorBase::EDerivativeMultiVectorOrientation orientation) |
template<class Scalar > | |
ModelEvaluatorBase::DerivativeMultiVector < Scalar > | create_DgDx_dot_mv (const ModelEvaluator< Scalar > &model, int j, ModelEvaluatorBase::EDerivativeMultiVectorOrientation orientation) |
template<class Scalar > | |
ModelEvaluatorBase::DerivativeMultiVector < Scalar > | create_DgDx_mv (const ModelEvaluator< Scalar > &model, int j, ModelEvaluatorBase::EDerivativeMultiVectorOrientation orientation) |
template<class Scalar > | |
ModelEvaluatorBase::DerivativeMultiVector < Scalar > | create_DgDp_mv (const ModelEvaluator< Scalar > &model, int j, int l, ModelEvaluatorBase::EDerivativeMultiVectorOrientation orientation) |
template<class Scalar > | |
ModelEvaluatorBase::DerivativeMultiVector < Scalar > | get_dmv (const ModelEvaluatorBase::Derivative< Scalar > &deriv, const std::string &derivName) |
template<class Scalar > | |
RCP< MultiVectorBase< Scalar > > | get_mv (const ModelEvaluatorBase::Derivative< Scalar > &deriv, const std::string &derivName, ModelEvaluatorBase::EDerivativeMultiVectorOrientation orientation) |
template<class Scalar > | |
void | assertDerivSpaces (const std::string &modelEvalDescription, const ModelEvaluatorBase::Derivative< Scalar > &deriv, const std::string &deriv_name, const VectorSpaceBase< Scalar > &fnc_space, const std::string &fnc_space_name, const VectorSpaceBase< Scalar > &var_space, const std::string &var_space_name) |
Assert that that Thyra objects imbedded in a Derivative object matches its function and variable spaces. More... | |
template<class Scalar > | |
void | assertInArgsOutArgsSetup (const std::string &modelEvalDescription, const ModelEvaluatorBase::InArgs< Scalar > &inArgs, const ModelEvaluatorBase::OutArgs< Scalar > &outArgs) |
Assert that an InArgs and OutArgs object are setup consistently. More... | |
template<class Scalar > | |
void | assertInArgsEvalObjects (const ModelEvaluator< Scalar > &model, const ModelEvaluatorBase::InArgs< Scalar > &inArgs) |
Assert that the objects in an InArgs object match a given model. More... | |
template<class Scalar > | |
void | assertOutArgsEvalObjects (const ModelEvaluator< Scalar > &model, const ModelEvaluatorBase::OutArgs< Scalar > &outArgs, const ModelEvaluatorBase::InArgs< Scalar > *inArgs=0) |
Assert that the objects in an OutArgs object match a given model. More... | |
Related Functions inherited from Thyra::ModelEvaluatorBase | |
std::string | toString (ModelEvaluatorBase::EInArgsMembers) |
std::string | toString (ModelEvaluatorBase::EOutArgsMembers) |
std::string | toString (ModelEvaluatorBase::EDerivativeMultiVectorOrientation orientation) |
ModelEvaluatorBase::EDerivativeMultiVectorOrientation | getOtherDerivativeMultiVectorOrientation (ModelEvaluatorBase::EDerivativeMultiVectorOrientation orientation) |
Initializers/Accessors | |
void | set_d (const Scalar &d) |
void | set_p (const Teuchos::ArrayView< const Scalar > &p) |
void | set_x0 (const Teuchos::ArrayView< const Scalar > &x0) |
void | setShowGetInvalidArgs (bool showGetInvalidArg) |
Public functions overridden from ModelEvaulator. | |
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > | get_x_space () const |
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > | get_f_space () const |
Thyra::ModelEvaluatorBase::InArgs < Scalar > | getNominalValues () const |
Teuchos::RCP < Thyra::LinearOpBase< Scalar > > | create_W_op () const |
Teuchos::RCP < Thyra::PreconditionerBase < Scalar > > | create_W_prec () const |
Teuchos::RCP< const Thyra::LinearOpWithSolveFactoryBase < Scalar > > | get_W_factory () const |
Thyra::ModelEvaluatorBase::InArgs < Scalar > | createInArgs () const |
Simple 2d simulation only ModelEvaluator for f(x) = 0.
The equations modeled are:
f[0] = x[0] + x[1]*x[1] - p[0]; f[1] = d * ( x[0]*x[0] - x[1] - p[1] );
The Matrix W = d(f)/d(x)
is implemented as a Thyra::MultiVectorBase
object and the class Thyra::DefaultSerialDenseLinearOpWithSolveFactory
is used to create the linear solver.
This class also supports an app-defined preconditioner W_prec
but it is not used by the linear solver object. The preconditioner operator is implemented as the inverse diagonal of the forward Jacobian W
.
This is really more of a mock test driver model for Thyra than an example of implementing a real simulation-constrained ModelEvaluator subclass. However, it is a very simple Thyra-only example and therefore is not a bad starting point.
Definition at line 20 of file Thyra_Simple2DModelEvaluator_decl.hpp.
void Thyra::Simple2DModelEvaluator< Scalar >::set_d | ( | const Scalar & | d | ) |
Definition at line 43 of file Thyra_Simple2DModelEvaluator_def.hpp.
void Thyra::Simple2DModelEvaluator< Scalar >::set_p | ( | const Teuchos::ArrayView< const Scalar > & | p | ) |
Definition at line 50 of file Thyra_Simple2DModelEvaluator_def.hpp.
void Thyra::Simple2DModelEvaluator< Scalar >::set_x0 | ( | const Teuchos::ArrayView< const Scalar > & | x0 | ) |
Definition at line 60 of file Thyra_Simple2DModelEvaluator_def.hpp.
void Thyra::Simple2DModelEvaluator< Scalar >::setShowGetInvalidArgs | ( | bool | showGetInvalidArg | ) |
Definition at line 71 of file Thyra_Simple2DModelEvaluator_def.hpp.
|
virtual |
Implements Thyra::ModelEvaluator< Scalar >.
Definition at line 82 of file Thyra_Simple2DModelEvaluator_def.hpp.
|
virtual |
Implements Thyra::ModelEvaluator< Scalar >.
Definition at line 90 of file Thyra_Simple2DModelEvaluator_def.hpp.
|
virtual |
Reimplemented from Thyra::StateFuncModelEvaluatorBase< Scalar >.
Definition at line 98 of file Thyra_Simple2DModelEvaluator_def.hpp.
|
virtual |
Reimplemented from Thyra::StateFuncModelEvaluatorBase< Scalar >.
Definition at line 106 of file Thyra_Simple2DModelEvaluator_def.hpp.
|
virtual |
Reimplemented from Thyra::StateFuncModelEvaluatorBase< Scalar >.
Definition at line 116 of file Thyra_Simple2DModelEvaluator_def.hpp.
|
virtual |
Reimplemented from Thyra::StateFuncModelEvaluatorBase< Scalar >.
Definition at line 128 of file Thyra_Simple2DModelEvaluator_def.hpp.
|
virtual |
Implements Thyra::ModelEvaluator< Scalar >.
Definition at line 136 of file Thyra_Simple2DModelEvaluator_def.hpp.
|
related |
Nonmember constuctor.
Definition at line 33 of file Thyra_Simple2DModelEvaluator_def.hpp.