Rythmos - Transient Integration for Differential Equations  Version of the Day
 All Classes Functions Variables Typedefs Pages
Rythmos_IntegratorBuilder_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 
30 #ifndef Rythmos_INTEGRATOR_BUILDER_DECL_H
31 #define Rythmos_INTEGRATOR_BUILDER_DECL_H
32 
33 // Rythmos classes:
34 #include "Rythmos_Types.hpp"
35 #include "Rythmos_IntegratorBase.hpp"
36 #include "Rythmos_IntegrationControlStrategyBase.hpp"
37 #include "Rythmos_StepperBuilder.hpp"
38 #include "Rythmos_StepControlStrategyBase.hpp"
39 #include "Rythmos_InterpolationBufferBase.hpp"
40 #include "Rythmos_InterpolationBufferAppenderBase.hpp"
41 #include "Rythmos_ErrWtVecCalcBase.hpp"
42 #include "Rythmos_InterpolatorBase.hpp"
43 #include "Rythmos_RKButcherTableauBuilder.hpp"
44 
45 // Thyra classes:
46 #include "Thyra_LinearOpWithSolveFactoryBase.hpp"
47 #include "Thyra_NonlinearSolverBase.hpp"
48 #include "Thyra_ModelEvaluator.hpp"
49 
50 // Teuchos:
51 #include "Teuchos_ObjectBuilder.hpp"
52 #include "Teuchos_ParameterListAcceptor.hpp"
53 
54 namespace Rythmos {
55 
56 
62 template<class Scalar>
63  class IntegratorBuilder : virtual public Teuchos::ParameterListAcceptor
64 {
65 public:
66 
69 
71  virtual ~IntegratorBuilder();
72 
75  const RCP<const AbstractFactory<IntegratorBase<Scalar> > > &integratorFactory,
76  const std::string &integratorFactoryName
77  );
78 
81  const RCP<const AbstractFactory<IntegrationControlStrategyBase<Scalar> > > &integrationControlFactory,
82  const std::string &integrationControlName
83  );
84 
86  void setStepperBuilder(
87  const RCP<StepperBuilder<Scalar> > &stepperBuilder
88  );
89 
91  RCP<StepperBuilder<Scalar> > getStepperBuilder();
92 
95  const RCP<RKButcherTableauBuilder<Scalar> > & rkbtBuilder
96  );
97 
100  const RCP<const AbstractFactory<StepControlStrategyBase<Scalar> > > &stepControlStrategyFactory,
101  const std::string &stepControlName
102  );
103 
106  const RCP<const AbstractFactory<InterpolationBufferBase<Scalar> > > &interpolationBufferFactory,
107  const std::string &interpolationBufferName
108  );
109 
112  const RCP<const AbstractFactory<InterpolationBufferAppenderBase<Scalar> > > &interpolationBufferAppenderFactory,
113  const std::string &interpolationBufferAppenderName
114  );
115 
118  const RCP<const AbstractFactory<ErrWtVecCalcBase<Scalar> > > &errWtVecCalcFactory,
119  const std::string &errWtVecCalcFactoryName
120  );
121 
124  const RCP<const AbstractFactory<InterpolatorBase<Scalar> > > &interpolatorFactory,
125  const std::string &interpolatorFactoryName
126  );
127 
129  void setWFactoryObject(
130  const RCP<Thyra::LinearOpWithSolveFactoryBase<Scalar> > &wFactoryObject
131  );
132 
147  RCP<IntegratorBase<Scalar> > create(
148  const RCP<const Thyra::ModelEvaluator<Scalar> >& model,
149  const Thyra::ModelEvaluatorBase::InArgs<Scalar>& initialCondition,
150  const RCP<Thyra::NonlinearSolverBase<Scalar> >& nlSolver
151  ) const;
152 
155 
157  void setParameterList(const RCP<Teuchos::ParameterList> & paramList);
158 
160  RCP<const Teuchos::ParameterList> getValidParameters() const;
161 
163  RCP<ParameterList> getNonconstParameterList();
164 
166  RCP<ParameterList> unsetParameterList();
167 
169  RCP<const ParameterList> getParameterList() const;
170 
172 
173 private:
174 
175  // //////////////////////////////////////
176  // Private data members
177 
178  RCP<Teuchos::ObjectBuilder<IntegratorBase<Scalar> > > integratorBuilder_;
179  RCP<Teuchos::ObjectBuilder<IntegrationControlStrategyBase<Scalar> > > integrationControlBuilder_;
180  RCP<StepperBuilder<Scalar> > stepperBuilder_;
181  RCP<RKButcherTableauBuilder<Scalar> > rkbtBuilder_;
182  RCP<Teuchos::ObjectBuilder<StepControlStrategyBase<Scalar> > > stepControlBuilder_;
183  RCP<Teuchos::ObjectBuilder<InterpolationBufferBase<Scalar> > > interpolationBufferBuilder_;
184  RCP<Teuchos::ObjectBuilder<InterpolationBufferAppenderBase<Scalar> > > interpolationBufferAppenderBuilder_;
185  RCP<Teuchos::ObjectBuilder<ErrWtVecCalcBase<Scalar> > > errWtVecCalcBuilder_;
186  RCP<Teuchos::ObjectBuilder<InterpolatorBase<Scalar> > > interpolatorBuilder_;
187 
188  RCP<Thyra::LinearOpWithSolveFactoryBase<Scalar> > wFactoryObject_;
189 
190  RCP<ParameterList> paramList_;
191  mutable RCP<ParameterList> validPL_;
192 
193  // //////////////////////////////////////
194  // Private member functions
195 
196  void initializeDefaults_();
197 
198 };
199 
200 
205 template<class Scalar>
206 RCP<IntegratorBuilder<Scalar> > integratorBuilder();
207 
208 
213 template<class Scalar>
214 RCP<IntegratorBuilder<Scalar> >
215 integratorBuilder(const RCP<ParameterList> &paramList);
216 
222 template<class Scalar>
223 RCP<IntegratorBase<Scalar> > createForwardSensitivityIntegrator(
224  const RCP<const Thyra::ModelEvaluator<Scalar> >& model,
225  const int& p_index,
226  const Thyra::ModelEvaluatorBase::InArgs<Scalar>& model_ic,
227  const RCP<Thyra::NonlinearSolverBase<Scalar> >& nlSolver,
228  const RCP<ParameterList>& integratorBuilderPL
229  );
230 
231 } // namespace Rythmos
232 
233 #endif //Rythmos_INTEGRATOR_BUILDER_DECL_H
234 
void setRKButcherTableauBuilder(const RCP< RKButcherTableauBuilder< Scalar > > &rkbtBuilder)
Set the RK Butcher Tableau Builder object.
Concrete integrator builder class.
void setParameterList(const RCP< Teuchos::ParameterList > &paramList)
void setIntegrationControlFactory(const RCP< const AbstractFactory< IntegrationControlStrategyBase< Scalar > > > &integrationControlFactory, const std::string &integrationControlName)
Set a new Integration Control Strategy factory object.
Base strategy class for interpolation functionality.
Abstract interface for time integrators.
RCP< const ParameterList > getParameterList() const
RCP< IntegratorBase< Scalar > > create(const RCP< const Thyra::ModelEvaluator< Scalar > > &model, const Thyra::ModelEvaluatorBase::InArgs< Scalar > &initialCondition, const RCP< Thyra::NonlinearSolverBase< Scalar > > &nlSolver) const
Create an fully formed integrator ready to go.
RCP< const Teuchos::ParameterList > getValidParameters() const
RCP< StepperBuilder< Scalar > > getStepperBuilder()
Get the Stepper Builder object.
Base class for strategy objects that control integration by selecting step sizes for a stepper...
The member functions in the StepControlStrategyBase move you between these states in the following fa...
void setStepControlFactory(const RCP< const AbstractFactory< StepControlStrategyBase< Scalar > > > &stepControlStrategyFactory, const std::string &stepControlName)
Set a new Step Control Strategy factory object.
void setWFactoryObject(const RCP< Thyra::LinearOpWithSolveFactoryBase< Scalar > > &wFactoryObject)
Set a W factory object.
Base class for an interpolation buffer.
void setInterpolatorFactory(const RCP< const AbstractFactory< InterpolatorBase< Scalar > > > &interpolatorFactory, const std::string &interpolatorFactoryName)
Set an Interpolator factory object.
void setIntegratorFactory(const RCP< const AbstractFactory< IntegratorBase< Scalar > > > &integratorFactory, const std::string &integratorFactoryName)
Set a new Integrator factory object.
Base class for strategy objects that append data from one InterplationBufferBase object to another...
void setStepperBuilder(const RCP< StepperBuilder< Scalar > > &stepperBuilder)
Set the Stepper Builder object.
void setInterpolationBufferFactory(const RCP< const AbstractFactory< InterpolationBufferBase< Scalar > > > &interpolationBufferFactory, const std::string &interpolationBufferName)
Set an InterpolationBuffer factory object.
void setErrWtVecCalcFactory(const RCP< const AbstractFactory< ErrWtVecCalcBase< Scalar > > > &errWtVecCalcFactory, const std::string &errWtVecCalcFactoryName)
Set an ErrWtVecCalc factory object.
void setInterpolationBufferAppenderFactory(const RCP< const AbstractFactory< InterpolationBufferAppenderBase< Scalar > > > &interpolationBufferAppenderFactory, const std::string &interpolationBufferAppenderName)
Set an InterpolationBufferAppender factory object.