Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Thyra_DummyTestModelEvaluator_decl.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 DUMMY_TEST_MODEL_EVALUATOR_DECL_HPP
11 #define DUMMY_TEST_MODEL_EVALUATOR_DECL_HPP
12 
13 
14 #include "Thyra_ModelEvaluatorDefaultBase.hpp"
15 
16 
17 namespace Thyra {
18 
19 // Mock Extended InArgs and OutArgs Objects. In practice, these
20 // objects will be defined by a solver that needs to extend the
21 // InArgs/OutArgs for specialized data without cluttering the core
22 // model evaluator interface.
23 template<class Scalar>
24 struct MockExtendedInArgs
25 {
27 };
28 
29 template<class Scalar>
30 struct MockExtendedOutArgs
31 {
33 };
34 
35 
36 template<class Scalar> class DummyTestModelEvaluator;
37 
38 
43 template<class Scalar>
45 dummyTestModelEvaluator(
46  const Ordinal x_size = 2,
47  const ArrayView<const Ordinal> &p_sizes = Teuchos::null,
48  const ArrayView<const Ordinal> &g_sizes = Teuchos::null,
49  const bool supports_x_dot = false,
50  const bool supports_x_dot_dot = false,
51  const bool supports_extended_inargs = true,
52  const bool supports_extended_outargs = true,
53  const bool supports_derivatives = false
54  );
55 
56 
62 template<class Scalar>
64 {
65 public:
66 
69 
72  const Ordinal x_size,
73  const ArrayView<const Ordinal> &p_sizes,
74  const ArrayView<const Ordinal> &g_sizes,
75  const bool supports_x_dot = false,
76  const bool supports_x_dot_dot = false,
77  const bool supports_extended_inargs = true,
78  const bool supports_extended_outargs = true,
79  const bool supports_derivatives = false
80  );
81 
83 
86 
114  void reportFinalPoint(
115  const ModelEvaluatorBase::InArgs<Scalar> &finalPoint,
116  const bool wasSolved
117  );
118 
120 
121  // For unit testing
122  void change_p_size_incorrectly(const Ordinal new_size);
123  void change_p_size_correctly(const Ordinal new_size);
124 
125 private: // functions
126 
129 
131  ModelEvaluatorBase::OutArgs<Scalar> createOutArgsImpl() const;
133  void evalModelImpl(
136  ) const;
137 
139 
140 private: // data members
141 
146  Array<std::string> g_names_;
148  ModelEvaluatorBase::InArgs<Scalar> nominalValues_;
150  ModelEvaluatorBase::InArgs<Scalar> prototypeInArgs_;
151  ModelEvaluatorBase::OutArgs<Scalar> prototypeOutArgs_;
152 
153 };
154 
155 
156 } // namespace Thyra
157 
158 
159 #endif // DUMMY_TEST_MODEL_EVALUATOR_DECL_HPP
ModelEvaluatorBase::InArgs< Scalar > getNominalValues() const
Default base class for concrete model evaluators.
Concrete aggregate class for all output arguments computable by a ModelEvaluator subclass object...
void reportFinalPoint(const ModelEvaluatorBase::InArgs< Scalar > &finalPoint, const bool wasSolved)
RCP< const VectorSpaceBase< Scalar > > get_p_space(int l) const
RCP< const Teuchos::Array< std::string > > get_p_names(int l) const
ModelEvaluatorBase::InArgs< Scalar > createInArgs() const
RCP< LinearOpBase< Scalar > > create_W_op() const
ModelEvaluatorBase::InArgs< Scalar > getUpperBounds() const
Teuchos::Ordinal Ordinal
Type for the dimension of a vector space. `*.
RCP< const VectorSpaceBase< Scalar > > get_x_space() const
Teuchos::ArrayView< const std::string > get_g_names(int j) const
RCP< const VectorSpaceBase< Scalar > > get_f_space() const
ModelEvaluatorBase::InArgs< Scalar > getLowerBounds() const
RCP< const VectorSpaceBase< Scalar > > get_g_space(int j) const
DummyTestModelEvaluator(const Ordinal x_size, const ArrayView< const Ordinal > &p_sizes, const ArrayView< const Ordinal > &g_sizes, const bool supports_x_dot=false, const bool supports_x_dot_dot=false, const bool supports_extended_inargs=true, const bool supports_extended_outargs=true, const bool supports_derivatives=false)
RCP< const LinearOpWithSolveFactoryBase< Scalar > > get_W_factory() const
RCP< PreconditionerBase< Scalar > > create_W_prec() const
Concrete aggregate class for all input arguments computable by a ModelEvaluator subclass object...