Thyra Version of the Day
Loading...
Searching...
No Matches
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
50namespace Thyra {
51
52
63template<class Scalar>
101
102
103// /////////////////////////////////
104// Implementations
105
106
107// Public functions overridden from ModelEvaulator
108
109
110template<class Scalar>
116
117
118template<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
131template<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
141}
142
143template<class Scalar>
149
150
151template<class Scalar>
154{ return this->createInArgs(); }
155
156
157template<class Scalar>
160{ return this->createInArgs(); }
161
162
163template<class Scalar>
166{ return this->createInArgs(); }
167
168
169template<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 );
180}
181
182
183template<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 );
194}
195
196
197template<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 );
208}
209
210
211template<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 );
222}
223
224
225template<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
Concrete aggregate class for all input arguments computable by a ModelEvaluator subclass object.
Default base class for concrete model evaluators.
This base class defines default function implementations appropritate for a response-only model evalu...
ModelEvaluatorBase::InArgs< Scalar > getUpperBounds() const
Returns this->createInArgs().
RCP< const VectorSpaceBase< Scalar > > get_x_space() const
Throws exception.
void reportFinalPoint(const ModelEvaluatorBase::InArgs< Scalar > &finalPoint, const bool wasSolved)
Does nothing and ignores input.
RCP< LinearOpWithSolveBase< Scalar > > create_W() const
Thorws exception.
RCP< const LinearOpWithSolveFactoryBase< Scalar > > get_W_factory() const
Thorws exception.
RCP< LinearOpBase< Scalar > > create_W_op() 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.
ModelEvaluatorBase::InArgs< Scalar > getLowerBounds() const
Returns this->createInArgs().
RCP< PreconditionerBase< Scalar > > create_W_prec() const
Thorws exception.
Teuchos::ArrayView< const std::string > get_g_names(int j) const
Returns null.
ModelEvaluatorBase::InArgs< Scalar > getNominalValues() const
Returns this->createInArgs().
#define TEUCHOS_ASSERT_IN_RANGE_UPPER_EXCLUSIVE(index, lower_inclusive, upper_exclusive)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
#define TEUCHOS_UNREACHABLE_RETURN(dummyReturnVal)
T_To & dyn_cast(T_From &from)