9 #ifndef Tempus_StaggeredForwardSensitivityModelEvaluator_decl_hpp
10 #define Tempus_StaggeredForwardSensitivityModelEvaluator_decl_hpp
13 #include "Thyra_StateFuncModelEvaluatorBase.hpp"
14 #include "Thyra_DefaultMultiVectorProductVectorSpace.hpp"
15 #include "NOX_Thyra.H"
17 #include "Tempus_SolutionHistory.hpp"
47 template <
typename Scalar>
49 public Thyra::StateFuncModelEvaluatorBase<Scalar>,
52 typedef Thyra::VectorBase<Scalar>
Vector;
80 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> > & model,
81 const Teuchos::RCP<const Teuchos::ParameterList>& pList = Teuchos::null,
82 const Teuchos::RCP<MultiVector>& dxdp_init = Teuchos::null,
83 const Teuchos::RCP<MultiVector>& dx_dotdp_init = Teuchos::null,
84 const Teuchos::RCP<MultiVector>& dx_dotdot_dp_init = Teuchos::null);
103 const Teuchos::RCP<Thyra::NonlinearSolverBase<Scalar> >& solver,
104 const bool force_W_update) {
105 Teuchos::RCP<Thyra::NOXNonlinearSolver> nox_solver =
106 Teuchos::rcp_dynamic_cast<Thyra::NOXNonlinearSolver>(solver,
true);
107 lo_ = nox_solver->get_nonconst_W_op(force_W_update);
108 po_ = nox_solver->get_nonconst_prec_op();
116 Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> >
get_p_space(
int p)
const;
118 Teuchos::RCP<const Teuchos::Array<std::string> >
get_p_names(
int p)
const;
120 Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> >
get_x_space()
const;
122 Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> >
get_f_space()
const;
124 Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> >
get_g_space(
int j)
const;
126 Teuchos::ArrayView<const std::string>
get_g_names(
int j)
const;
128 Teuchos::RCP<Thyra::LinearOpBase<Scalar> >
create_W_op()
const;
132 Teuchos::RCP<Thyra::LinearOpBase<Scalar> >
create_DgDx_op(
int j)
const;
134 Teuchos::RCP<Thyra::LinearOpBase<Scalar> >
create_DgDp_op(
int j,
int l)
const;
136 Teuchos::RCP<const Thyra::LinearOpWithSolveFactoryBase<Scalar> >
139 Thyra::ModelEvaluatorBase::InArgs<Scalar>
createInArgs()
const;
152 const Thyra::ModelEvaluatorBase::InArgs<Scalar> &inArgs,
153 const Thyra::ModelEvaluatorBase::OutArgs<Scalar> &outArgs)
const;
159 Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >
model_;
170 Teuchos::RCP<const Thyra::DefaultMultiVectorProductVectorSpace<Scalar> >
dxdp_space_;
171 Teuchos::RCP<const Thyra::DefaultMultiVectorProductVectorSpace<Scalar> >
dfdp_space_;
172 Teuchos::RCP<const Tempus::SolutionHistory<Scalar> >
sh_;
174 Teuchos::RCP<Thyra::LinearOpBase<Scalar> >
lo_;
175 Teuchos::RCP<Thyra::PreconditionerBase<Scalar> >
po_;
177 mutable Teuchos::RCP<Thyra::LinearOpBase<Scalar> >
my_dfdx_;
Thyra::ModelEvaluatorBase::InArgs< Scalar > createInArgs() const
void setForwardSolutionHistory(const Teuchos::RCP< const Tempus::SolutionHistory< Scalar > > &sh)
Set solution history from forward state evaluation (for interpolation)
virtual void setForwardSolutionState(const Teuchos::RCP< const Tempus::SolutionState< Scalar > > &s)
Set solution state from forward state evaluation (for frozen state)
Teuchos::RCP< const Tempus::SolutionHistory< Scalar > > sh_
Thyra::MultiVectorBase< Scalar > MultiVector
Teuchos::RCP< const Teuchos::Array< std::string > > get_p_names(int p) const
Teuchos::RCP< MultiVector > dx_dotdotdp_init_
Teuchos::RCP< const Thyra::DefaultMultiVectorProductVectorSpace< Scalar > > dxdp_space_
static Teuchos::RCP< const Teuchos::ParameterList > getValidParameters()
Teuchos::RCP< Thyra::PreconditionerBase< Scalar > > po_
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_p_space(int p) const
Thyra::VectorBase< Scalar > Vector
StaggeredForwardSensitivityModelEvaluator(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, const Teuchos::RCP< const Teuchos::ParameterList > &pList=Teuchos::null, const Teuchos::RCP< MultiVector > &dxdp_init=Teuchos::null, const Teuchos::RCP< MultiVector > &dx_dotdp_init=Teuchos::null, const Teuchos::RCP< MultiVector > &dx_dotdot_dp_init=Teuchos::null)
Constructor.
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > create_DgDx_dot_op(int j) const
Teuchos::RCP< const Thyra::DefaultMultiVectorProductVectorSpace< Scalar > > dfdp_space_
int xdotdot_tangent_index_
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > my_dfdxdotdot_
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > my_dfdxdot_
Teuchos::RCP< MultiVector > dx_dotdp_init_
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > getForwardModel() const
Get the underlying model 'f'.
Teuchos::RCP< Tempus::SolutionState< Scalar > > nc_forward_state_
Teuchos::RCP< MultiVector > dxdp_init_
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > create_DgDp_op(int j, int l) const
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_x_space() const
Teuchos::RCP< const Tempus::SolutionState< Scalar > > forward_state_
Thyra::ModelEvaluatorBase::InArgs< Scalar > prototypeInArgs_
virtual void setSolver(const Teuchos::RCP< Thyra::NonlinearSolverBase< Scalar > > &solver, const bool force_W_update)
Set the solver of the underlying model if you want to reuse it.
Transform a ModelEvaluator's sensitivity equations to its residual.
Teuchos::RCP< const Thyra::LinearOpWithSolveFactoryBase< Scalar > > get_W_factory() const
Teuchos::ArrayView< const std::string > get_g_names(int j) const
bool use_dfdp_as_tangent_
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > create_W_op() const
Thyra::ModelEvaluatorBase::InArgs< Scalar > getNominalValues() const
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > lo_
Thyra::ModelEvaluatorBase::OutArgs< Scalar > prototypeOutArgs_
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > create_DgDx_op(int j) const
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > my_dfdx_
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_f_space() const
A ModelEvaluator decorator for sensitivity analysis.
Solution state for integrators and steppers. SolutionState contains the metadata for solutions and th...
Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > model_
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_g_space(int j) const
void evalModelImpl(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs, const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const
Thyra::ModelEvaluatorBase::OutArgs< Scalar > createOutArgsImpl() const