Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Thyra_ModelEvaluator.hpp
1 // @HEADER
2 // *****************************************************************************
3 // Thyra: Interfaces and Support for Abstract Numerical Algorithms
4 //
5 // Copyright 2004 NTESS and the Thyra contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef THYRA_MODEL_EVALUATOR_HPP
11 #define THYRA_MODEL_EVALUATOR_HPP
12 
13 
14 #include "Thyra_ModelEvaluatorBase.hpp"
15 #include "Thyra_LinearOpWithSolveFactoryBase.hpp"
16 
17 
18 namespace Thyra {
19 
20 
740 template<class Scalar>
742 public:
743 
746 
749 
754  virtual int Np() const = 0;
755 
761  virtual int Ng() const = 0;
762 
764 
767 
769  virtual RCP<const VectorSpaceBase<Scalar> > get_x_space() const = 0;
770 
772  virtual RCP<const VectorSpaceBase<Scalar> > get_f_space() const = 0;
773 
776 
789  virtual RCP<const VectorSpaceBase<Scalar> > get_p_space(int l) const = 0;
790 
804  virtual RCP<const Teuchos::Array<std::string> > get_p_names(int l) const = 0;
805 
818  virtual RCP<const VectorSpaceBase<Scalar> > get_g_space(int j) const = 0;
819 
829 
843  virtual Teuchos::ArrayView<const std::string> get_g_names(int j) const = 0;
844 
846 
849 
870 
885 
900 
902 
905 
922  virtual RCP<LinearOpWithSolveBase<Scalar> > create_W() const = 0;
923 
948  virtual RCP<LinearOpBase<Scalar> > create_W_op() const = 0;
949 
975  virtual RCP<PreconditionerBase<Scalar> > create_W_prec() const = 0;
976 
987  virtual RCP<LinearOpBase<Scalar> > create_DfDp_op(int l) const = 0;
988 
999  virtual RCP<LinearOpBase<Scalar> > create_DgDx_dot_op(int j) const = 0;
1000 
1011  virtual RCP<LinearOpBase<Scalar> > create_DgDx_op(int j) const = 0;
1012 
1025  virtual RCP<LinearOpBase<Scalar> > create_DgDp_op( int j, int l ) const = 0;
1026 
1027 #ifdef Thyra_BUILD_HESSIAN_SUPPORT
1028 
1036  virtual RCP<LinearOpBase<Scalar> > create_hess_f_xx() const = 0;
1037 
1047  virtual RCP<LinearOpBase<Scalar> > create_hess_f_xp(int l) const = 0;
1048 
1061  virtual RCP<LinearOpBase<Scalar> > create_hess_f_pp( int l1, int l2 ) const = 0;
1062 
1072  virtual RCP<LinearOpBase<Scalar> > create_hess_g_xx(int j) const = 0;
1073 
1085  virtual RCP<LinearOpBase<Scalar> > create_hess_g_xp( int j, int l ) const = 0;
1086 
1099  virtual RCP<LinearOpBase<Scalar> > create_hess_g_pp( int j, int l1, int l2 ) const = 0;
1100 
1101 #endif // ifdef Thyra_BUILD_HESSIAN_SUPPORT
1102 
1104 
1107 
1129 
1131 
1134 
1147 
1160 
1222  virtual void evalModel(
1223  const ModelEvaluatorBase::InArgs<Scalar> &inArgs,
1225  ) const = 0;
1226 
1228 
1231 
1238  virtual void reportFinalPoint(
1239  const ModelEvaluatorBase::InArgs<Scalar> &finalPoint,
1240  const bool wasSolved
1241  ) = 0;
1242 
1244 
1245 private:
1246 
1247  // Not defined and not to be called
1249  operator=(const ModelEvaluator<Scalar>&);
1250 
1251 };
1252 
1253 } // namespace Thyra
1254 
1255 
1256 #endif // THYRA_MODEL_EVALUATOR_HPP
virtual RCP< LinearOpBase< Scalar > > create_DfDp_op(int l) const =0
If supported, create a linear operator derivative object for D(f)/D(p(l)).
virtual ModelEvaluatorBase::OutArgs< Scalar > createOutArgs() const =0
Create an empty output functions/derivatives object that can be set up and passed to evalModel()...
virtual RCP< const VectorSpaceBase< Scalar > > get_x_space() const =0
Return the vector space for the state variables x &lt;: RE^n_x.
Pure abstract base interface for evaluating a stateless &quot;model&quot; that can be mapped into a number of d...
virtual ModelEvaluatorBase::InArgs< Scalar > getLowerBounds() const =0
Return the set of lower bounds for the input arguments.
virtual Teuchos::ArrayView< const std::string > get_g_names(int j) const =0
Get the names of the response functions associated with subvector j if available. ...
virtual RCP< LinearOpWithSolveBase< Scalar > > create_W() const =0
If supported, create a LinearOpWithSolveBase object for W to be evaluated.
virtual void reportFinalPoint(const ModelEvaluatorBase::InArgs< Scalar > &finalPoint, const bool wasSolved)=0
Report the final point and whether the problem was considered solved or not.
Concrete aggregate class for all output arguments computable by a ModelEvaluator subclass object...
virtual RCP< LinearOpBase< Scalar > > create_DgDx_op(int j) const =0
If supported, create a linear operator derivative object for D(g(j))/D(x).
virtual RCP< const Teuchos::Array< std::string > > get_p_names(int l) const =0
Get the names of the parameters associated with parameter subvector l if available.
virtual RCP< LinearOpBase< Scalar > > create_DgDp_op(int j, int l) const =0
If supported, create a linear operator derivative object for D(g(j))/D(p(l)).
virtual RCP< PreconditionerBase< Scalar > > create_W_prec() const =0
If supported, create a PreconditionerBase object for W_prec to be evaluated.
virtual void evalModel(const ModelEvaluatorBase::InArgs< Scalar > &inArgs, const ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const =0
Compute all of the requested functions/derivatives at the given point.
virtual ModelEvaluatorBase::InArgs< Scalar > createInArgs() const =0
Create an empty input arguments object that can be set up and passed to evalModel().
virtual RCP< const LinearOpWithSolveFactoryBase< Scalar > > get_W_factory() const =0
If supported, return a LinearOpWithSolveFactoryBase object that can be used to initialize a LOWSB obj...
virtual int Ng() const =0
Return the number of sets of auxiliary response functions.
virtual RCP< LinearOpBase< Scalar > > create_W_op() const =0
If supported, create a LinearOpBase object for W to be evaluated.
virtual RCP< const VectorSpaceBase< Scalar > > get_f_multiplier_space() const =0
Return the dual vector space for the state function f(...) &lt;: RE^n_x.
virtual RCP< const VectorSpaceBase< Scalar > > get_p_space(int l) const =0
Return the vector space for the auxiliary parameters p(l) &lt;: RE^n_p_l.
virtual RCP< LinearOpBase< Scalar > > create_DgDx_dot_op(int j) const =0
If supported, create a linear operator derivative object for D(g(j))/D(x_dot).
virtual RCP< const VectorSpaceBase< Scalar > > get_g_multiplier_space(int j) const =0
Return the dual vector space for the auxiliary response functions g(j) &lt;: RE^n_g_j.
Base subclass for ModelEvaluator that defines some basic types.
virtual RCP< const VectorSpaceBase< Scalar > > get_f_space() const =0
Return the vector space for the state function f(...) &lt;: RE^n_x.
virtual RCP< const VectorSpaceBase< Scalar > > get_g_space(int j) const =0
Return the vector space for the auxiliary response functions g(j) &lt;: RE^n_g_j.
virtual ModelEvaluatorBase::InArgs< Scalar > getUpperBounds() const =0
Return the set of upper bounds for the input arguments.
virtual ModelEvaluatorBase::InArgs< Scalar > getNominalValues() const =0
Return the set of nominal values or initial guesses for the supported the input arguments.
virtual int Np() const =0
Return the number of sets of auxiliary parameters.
Teuchos::ScalarTraits< Scalar >::magnitudeType ScalarMag
Concrete aggregate class for all input arguments computable by a ModelEvaluator subclass object...