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 //
4 // Thyra: Interfaces and Support for Abstract Numerical Algorithms
5 // Copyright (2004) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Roscoe A. Bartlett (bartlettra@ornl.gov)
38 //
39 // ***********************************************************************
40 // @HEADER
41 
42 
43 #ifndef THYRA_MODEL_EVALUATOR_HPP
44 #define THYRA_MODEL_EVALUATOR_HPP
45 
46 
47 #include "Thyra_ModelEvaluatorBase.hpp"
48 #include "Thyra_LinearOpWithSolveFactoryBase.hpp"
49 
50 
51 namespace Thyra {
52 
53 
773 template<class Scalar>
775 public:
776 
779 
782 
787  virtual int Np() const = 0;
788 
794  virtual int Ng() const = 0;
795 
797 
800 
802  virtual RCP<const VectorSpaceBase<Scalar> > get_x_space() const = 0;
803 
805  virtual RCP<const VectorSpaceBase<Scalar> > get_f_space() const = 0;
806 
809 
822  virtual RCP<const VectorSpaceBase<Scalar> > get_p_space(int l) const = 0;
823 
837  virtual RCP<const Teuchos::Array<std::string> > get_p_names(int l) const = 0;
838 
851  virtual RCP<const VectorSpaceBase<Scalar> > get_g_space(int j) const = 0;
852 
862 
876  virtual Teuchos::ArrayView<const std::string> get_g_names(int j) const = 0;
877 
879 
882 
903 
918 
933 
935 
938 
955  virtual RCP<LinearOpWithSolveBase<Scalar> > create_W() const = 0;
956 
981  virtual RCP<LinearOpBase<Scalar> > create_W_op() const = 0;
982 
1008  virtual RCP<PreconditionerBase<Scalar> > create_W_prec() const = 0;
1009 
1020  virtual RCP<LinearOpBase<Scalar> > create_DfDp_op(int l) const = 0;
1021 
1032  virtual RCP<LinearOpBase<Scalar> > create_DgDx_dot_op(int j) const = 0;
1033 
1044  virtual RCP<LinearOpBase<Scalar> > create_DgDx_op(int j) const = 0;
1045 
1058  virtual RCP<LinearOpBase<Scalar> > create_DgDp_op( int j, int l ) const = 0;
1059 
1067  virtual RCP<LinearOpBase<Scalar> > create_hess_f_xx() const = 0;
1068 
1078  virtual RCP<LinearOpBase<Scalar> > create_hess_f_xp(int l) const = 0;
1079 
1092  virtual RCP<LinearOpBase<Scalar> > create_hess_f_pp( int l1, int l2 ) const = 0;
1093 
1103  virtual RCP<LinearOpBase<Scalar> > create_hess_g_xx(int j) const = 0;
1104 
1116  virtual RCP<LinearOpBase<Scalar> > create_hess_g_xp( int j, int l ) const = 0;
1117 
1130  virtual RCP<LinearOpBase<Scalar> > create_hess_g_pp( int j, int l1, int l2 ) const = 0;
1131 
1133 
1136 
1158 
1160 
1163 
1176 
1189 
1251  virtual void evalModel(
1252  const ModelEvaluatorBase::InArgs<Scalar> &inArgs,
1254  ) const = 0;
1255 
1257 
1260 
1267  virtual void reportFinalPoint(
1268  const ModelEvaluatorBase::InArgs<Scalar> &finalPoint,
1269  const bool wasSolved
1270  ) = 0;
1271 
1273 
1274 private:
1275 
1276  // Not defined and not to be called
1278  operator=(const ModelEvaluator<Scalar>&);
1279 
1280 };
1281 
1282 } // namespace Thyra
1283 
1284 
1285 #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 RCP< LinearOpBase< Scalar > > create_hess_g_pp(int j, int l1, int l2) const =0
If supported, create a linear operator derivative object for .
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.
virtual RCP< LinearOpBase< Scalar > > create_hess_g_xx(int j) const =0
If supported, create a linear operator derivative object for .
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_hess_f_xx() const =0
If supported, create a linear operator derivative object for .
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< LinearOpBase< Scalar > > create_hess_f_xp(int l) const =0
If supported, create a linear operator derivative object for .
virtual RCP< LinearOpBase< Scalar > > create_hess_g_xp(int j, int l) const =0
If supported, create a linear operator derivative object for .
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 RCP< LinearOpBase< Scalar > > create_hess_f_pp(int l1, int l2) const =0
If supported, create a linear operator derivative object for .
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...