Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Tempus_StepperOptimizationInterface.hpp
Go to the documentation of this file.
1 // @HEADER
2 // ****************************************************************************
3 // Tempus: Copyright (2017) Sandia Corporation
4 //
5 // Distributed under BSD 3-clause license (See accompanying file Copyright.txt)
6 // ****************************************************************************
7 // @HEADER
8 
9 #ifndef Tempus_Stepper_Optimization_Interface_hpp
10 #define Tempus_Stepper_Optimization_Interface_hpp
11 
12 //Teuchos
13 #include "Teuchos_Array.hpp"
14 #include "Teuchos_RCP.hpp"
15 
16 // Thyra
17 #include "Thyra_VectorBase.hpp"
18 #include "Thyra_LinearOpBase.hpp"
19 #include "Thyra_LinearOpWithSolveBase.hpp"
20 
21 namespace Tempus {
22 
23 /** \brief Stepper interface to support full-space optimization */
24 /*!
25  * This is a potential interface to support transient full-space optimizations
26  * methods such as those implemented by ROL through its DynamicConstraint
27  * interface. This interface is subject to major revision!
28  *
29  * Design consideration: Take array of solution vectors as input, or
30  * solution history, or array of states?
31  *
32  * The length of x is determined by the time step stencil, e.g., in an m-step
33  * BDF method x would contain x_n,...,x_{n-m} at time step n in x[0],...,x[m]
34  * with time values stored in t similarly. p is the vector of design
35  * parameters and param_index determines which model parameter this
36  * corresponds to.
37  */
38 template<class Scalar>
40 {
41 public:
42 
44 
46 
47  //! Return the number of solution vectors in the time step stencil
48  virtual int stencilLength() const = 0;
49 
50  //! Compute time step residual
51  virtual void computeStepResidual(
52  Thyra::VectorBase<Scalar>& residual,
53  const Teuchos::Array< Teuchos::RCP<const Thyra::VectorBase<Scalar> > >& x,
54  const Teuchos::Array<Scalar>& t,
55  const Thyra::VectorBase<Scalar>& p,
56  const int param_index) const = 0;
57 
58  //! Compute time step Jacobian
59  /*!
60  * deriv_index determines which component of x the derivative should be
61  * computed with respect to.
62  */
63  virtual void computeStepJacobian(
64  Thyra::LinearOpBase<Scalar>& jacobian,
65  const Teuchos::Array< Teuchos::RCP<const Thyra::VectorBase<Scalar> > >& x,
66  const Teuchos::Array<Scalar>& t,
67  const Thyra::VectorBase<Scalar>& p,
68  const int param_index,
69  const int deriv_index) const = 0;
70 
71  //! Compute time step derivative w.r.t. model parameters
72  virtual void computeStepParamDeriv(
73  Thyra::LinearOpBase<Scalar>& deriv,
74  const Teuchos::Array< Teuchos::RCP<const Thyra::VectorBase<Scalar> > >& x,
75  const Teuchos::Array<Scalar>& t,
76  const Thyra::VectorBase<Scalar>& p,
77  const int param_index) const = 0;
78 
79  //! Compute time step Jacobian solver
80  /*!
81  * Derivative is always w.r.t. the most current solution vector
82  */
83  virtual void computeStepSolver(
84  Thyra::LinearOpWithSolveBase<Scalar>& jacobian_solver,
85  const Teuchos::Array< Teuchos::RCP<const Thyra::VectorBase<Scalar> > >& x,
86  const Teuchos::Array<Scalar>& t,
87  const Thyra::VectorBase<Scalar>& p,
88  const int param_index) const = 0;
89 };
90 
91 } // namespace Tempus
92 
93 #endif // Tempus_Stepper_hpp
virtual void computeStepResidual(Thyra::VectorBase< Scalar > &residual, const Teuchos::Array< Teuchos::RCP< const Thyra::VectorBase< Scalar > > > &x, const Teuchos::Array< Scalar > &t, const Thyra::VectorBase< Scalar > &p, const int param_index) const =0
Compute time step residual.
virtual void computeStepParamDeriv(Thyra::LinearOpBase< Scalar > &deriv, const Teuchos::Array< Teuchos::RCP< const Thyra::VectorBase< Scalar > > > &x, const Teuchos::Array< Scalar > &t, const Thyra::VectorBase< Scalar > &p, const int param_index) const =0
Compute time step derivative w.r.t. model parameters.
virtual int stencilLength() const =0
Return the number of solution vectors in the time step stencil.
virtual void computeStepSolver(Thyra::LinearOpWithSolveBase< Scalar > &jacobian_solver, const Teuchos::Array< Teuchos::RCP< const Thyra::VectorBase< Scalar > > > &x, const Teuchos::Array< Scalar > &t, const Thyra::VectorBase< Scalar > &p, const int param_index) const =0
Compute time step Jacobian solver.
virtual void computeStepJacobian(Thyra::LinearOpBase< Scalar > &jacobian, const Teuchos::Array< Teuchos::RCP< const Thyra::VectorBase< Scalar > > > &x, const Teuchos::Array< Scalar > &t, const Thyra::VectorBase< Scalar > &p, const int param_index, const int deriv_index) const =0
Compute time step Jacobian.
Stepper interface to support full-space optimization.