Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Thyra_ResponseOnlyModelEvaluatorBase.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 #ifndef THYRA_RESPONSE_ONLY_MODEL_EVALUATOR_BASE_HPP
43 #define THYRA_RESPONSE_ONLY_MODEL_EVALUATOR_BASE_HPP
44 
45 
46 #include "Thyra_ModelEvaluatorDefaultBase.hpp"
47 #include "Teuchos_Assert.hpp"
48 
49 
50 namespace Thyra {
51 
52 
63 template<class Scalar>
65 public:
66 
69 
93  void reportFinalPoint(
94  const ModelEvaluatorBase::InArgs<Scalar> &finalPoint,
95  const bool wasSolved
96  );
97 
99 
100 };
101 
102 
103 // /////////////////////////////////
104 // Implementations
105 
106 
107 // Public functions overridden from ModelEvaulator
108 
109 
110 template<class Scalar>
113 {
114  return Teuchos::null;
115 }
116 
117 
118 template<class Scalar>
121 {
122 #ifdef TEUCHOS_DEBUG
123  TEUCHOS_ASSERT_IN_RANGE_UPPER_EXCLUSIVE( l, 0, this->Np() );
124 #else
125  (void)l;
126 #endif
127  return Teuchos::null;
128 }
129 
130 
131 template<class Scalar>
134 {
135 #ifdef TEUCHOS_DEBUG
136  TEUCHOS_ASSERT_IN_RANGE_UPPER_EXCLUSIVE( j, 0, this->Ng() );
137 #else
138  (void)j;
139 #endif
140  return Teuchos::ArrayView<const std::string>(Teuchos::null);
141 }
142 
143 template<class Scalar>
146 {
147  return Teuchos::null;
148 }
149 
150 
151 template<class Scalar>
154 { return this->createInArgs(); }
155 
156 
157 template<class Scalar>
160 { return this->createInArgs(); }
161 
162 
163 template<class Scalar>
166 { return this->createInArgs(); }
167 
168 
169 template<class Scalar>
172 {
174  true, std::logic_error
175  ,"Error, if \'W\' is supported by the ModelEvaluator subclass then"
176  " this function create_W() may be overridden by the subclass to return"
177  " a non-null object!"
178  );
179  TEUCHOS_UNREACHABLE_RETURN(Teuchos::null);
180 }
181 
182 
183 template<class Scalar>
186 {
188  true, std::logic_error,
189  "Error, if \'W\' is supported by the ModelEvaluator subclass then"
190  " this function create_W_op() may be overridden by the subclass "
191  <<this->description()<<" to return a non-null object!"
192  );
193  TEUCHOS_UNREACHABLE_RETURN(Teuchos::null);
194 }
195 
196 
197 template<class Scalar>
200 {
202  true, std::logic_error,
203  "Error, if \'W\' is supported by the ModelEvaluator subclass then"
204  " this function create_W_prec() may be overridden by the subclass "
205  <<this->description()<<" to return a non-null object!"
206  );
207  TEUCHOS_UNREACHABLE_RETURN(Teuchos::null);
208 }
209 
210 
211 template<class Scalar>
214 {
216  true, std::logic_error
217  ,"Error, if \'W\' is supported by the ModelEvaluator subclass then"
218  " this function get_W_factory() may be overridden by the subclass "
219  <<this->description()<<" to return a non-null object!"
220  );
221  TEUCHOS_UNREACHABLE_RETURN(Teuchos::null);
222 }
223 
224 
225 template<class Scalar>
227  const ModelEvaluatorBase::InArgs<Scalar> &/* finalPoint */,
228  const bool /* wasSolved */
229  )
230 {
231  // This final point is just ignored by default!
232 }
233 
234 
235 } // namespace Thyra
236 
237 
238 #endif // THYRA_RESPONSE_ONLY_MODEL_EVALUATOR_BASE_HPP
ModelEvaluatorBase::InArgs< Scalar > getNominalValues() const
Returns this-&gt;createInArgs().
Default base class for concrete model evaluators.
ModelEvaluatorBase::InArgs< Scalar > getUpperBounds() const
Returns this-&gt;createInArgs().
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
RCP< LinearOpBase< Scalar > > create_W_op() const
Thorws exception.
void reportFinalPoint(const ModelEvaluatorBase::InArgs< Scalar > &finalPoint, const bool wasSolved)
Does nothing and ignores input.
RCP< const VectorSpaceBase< Scalar > > get_x_space() const
Throws exception.
#define TEUCHOS_ASSERT_IN_RANGE_UPPER_EXCLUSIVE(index, lower_inclusive, upper_exclusive)
Teuchos::ArrayView< const std::string > get_g_names(int j) const
Returns null.
This base class defines default function implementations appropritate for a response-only model evalu...
RCP< LinearOpWithSolveBase< Scalar > > create_W() const
Thorws exception.
RCP< const Teuchos::Array< std::string > > get_p_names(int l) const
Returns null.
RCP< const VectorSpaceBase< Scalar > > get_f_space() const
Throws exception.
RCP< PreconditionerBase< Scalar > > create_W_prec() const
Thorws exception.
#define TEUCHOS_UNREACHABLE_RETURN(dummyReturnVal)
ModelEvaluatorBase::InArgs< Scalar > getLowerBounds() const
Returns this-&gt;createInArgs().
RCP< const LinearOpWithSolveFactoryBase< Scalar > > get_W_factory() const
Thorws exception.
Concrete aggregate class for all input arguments computable by a ModelEvaluator subclass object...