Rythmos - Transient Integration for Differential Equations  Version of the Day
 All Classes Functions Variables Typedefs Pages
Rythmos_BasicDiscreteAdjointStepperTester_decl.hpp
1 //@HEADER
2 // ***********************************************************************
3 //
4 // Rythmos Package
5 // Copyright (2006) 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 // This library is free software; you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as
12 // published by the Free Software Foundation; either version 2.1 of the
13 // License, or (at your option) any later version.
14 //
15 // This library is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
23 // USA
24 // Questions? Contact Todd S. Coffey (tscoffe@sandia.gov)
25 //
26 // ***********************************************************************
27 //@HEADER
28 
29 #ifndef Rythmos_BASIC_DISCRETE_ADJOINT_STEPPER_TESTER_DECL_H
30 #define Rythmos_BASIC_DISCRETE_ADJOINT_STEPPER_TESTER_DECL_H
31 
32 
33 #include "Rythmos_AdjointModelEvaluator.hpp"
34 #include "Rythmos_IntegratorBase.hpp"
35 #include "Teuchos_VerboseObject.hpp"
36 #include "Teuchos_ParameterListAcceptorDefaultBase.hpp"
37 
38 
39 namespace Rythmos {
40 
41 
42 template<class Scalar> class BasicDiscreteAdjointStepperTester;
43 
44 
45 namespace BasicDiscreteAdjointStepperTesterUtils {
46 
47 const std::string ErrorTol_name = "Error Tol";
48 const double ErrorTol_default = 1e-6;
49 
50 } // namespace BasicDiscreteAdjointStepperTesterUtils
51 
52 
57 template<class Scalar>
58 RCP<BasicDiscreteAdjointStepperTester<Scalar> >
59 basicDiscreteAdjointStepperTester();
60 
61 
66 template<class Scalar>
67 RCP<BasicDiscreteAdjointStepperTester<Scalar> >
68 basicDiscreteAdjointStepperTester(const RCP<ParameterList> &paramList);
69 
70 
139 template<class Scalar>
141  : virtual public Teuchos::VerboseObject<BasicDiscreteAdjointStepperTester<Scalar> >,
142  virtual public Teuchos::ParameterListAcceptorDefaultBase
143 {
144 public:
145 
146  typedef typename ScalarTraits<Scalar>::magnitudeType ScalarMag;
147 
150 
152  void setParameterList(RCP<ParameterList> const& paramList);
154  RCP<const ParameterList> getValidParameters() const;
155 
157 
160 
178  bool testAdjointStepper(
179  Thyra::ModelEvaluator<Scalar>& adjointModel,
180  const Ptr<IntegratorBase<Scalar> >& forwardIntegrator
181  );
182 
184 
185 #ifndef TEMPLATE_FRIENDS_NOT_SUPPORTED
186 
189 
191  friend RCP< BasicDiscreteAdjointStepperTester<Scalar> >
192  basicDiscreteAdjointStepperTester<>();
193 
195 
196 #endif // TEMPLATE_FRIENDS_NOT_SUPPORTED
197 
198 
199 #ifndef TEMPLATE_FRIENDS_NOT_SUPPORTED
200 private:
201 #endif // TEMPLATE_FRIENDS_NOT_SUPPORTED
202 
203  BasicDiscreteAdjointStepperTester(); // Note defined and not to be called
204 
205 private:
206 
207  ScalarMag errorTol_;
208 
209 };
210 
211 
212 } // namespace Rythmos
213 
214 
215 #endif //Rythmos_BASIC_DISCRETE_ADJOINT_STEPPER_TESTER_DECL_H
Abstract interface for time integrators.
Concrete testing class for basic adjoint calculation.
bool testAdjointStepper(Thyra::ModelEvaluator< Scalar > &adjointModel, const Ptr< IntegratorBase< Scalar > > &forwardIntegrator)
Test the the AdjointStepper object for a given forward simulation.