Rythmos_IntegratorBuilder_decl.hpp

00001 //@HEADER
00002 // ***********************************************************************
00003 //
00004 //                           Rythmos Package
00005 //                 Copyright (2006) Sandia Corporation
00006 //
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 //
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Todd S. Coffey (tscoffe@sandia.gov)
00025 //
00026 // ***********************************************************************
00027 //@HEADER
00028 
00029 
00030 #ifndef Rythmos_INTEGRATOR_BUILDER_DECL_H
00031 #define Rythmos_INTEGRATOR_BUILDER_DECL_H
00032 
00033 // Rythmos classes:
00034 #include "Rythmos_Types.hpp"
00035 #include "Rythmos_IntegratorBase.hpp"
00036 #include "Rythmos_IntegrationControlStrategyBase.hpp"
00037 #include "Rythmos_StepperBuilder.hpp"
00038 #include "Rythmos_StepControlStrategyBase.hpp"
00039 #include "Rythmos_InterpolationBufferBase.hpp"
00040 #include "Rythmos_InterpolationBufferAppenderBase.hpp"
00041 #include "Rythmos_ErrWtVecCalcBase.hpp"
00042 #include "Rythmos_InterpolatorBase.hpp"
00043 #include "Rythmos_RKButcherTableauBuilder.hpp"
00044 
00045 // Thyra classes:
00046 #include "Thyra_LinearOpWithSolveFactoryBase.hpp"
00047 #include "Thyra_NonlinearSolverBase.hpp"
00048 #include "Thyra_ModelEvaluator.hpp"
00049 
00050 // Teuchos:
00051 #include "Teuchos_ObjectBuilder.hpp"
00052 #include "Teuchos_ParameterListAcceptor.hpp"
00053 
00054 namespace Rythmos {
00055 
00056 
00062 template<class Scalar>
00063   class IntegratorBuilder : virtual public Teuchos::ParameterListAcceptor
00064 {
00065 public:
00066 
00068   IntegratorBuilder();
00069 
00071   virtual ~IntegratorBuilder();
00072 
00074   void setIntegratorFactory(
00075     const RCP<const AbstractFactory<IntegratorBase<Scalar> > > &integratorFactory,
00076     const std::string &integratorFactoryName
00077     );
00078 
00080   void setIntegrationControlFactory(
00081     const RCP<const AbstractFactory<IntegrationControlStrategyBase<Scalar> > > &integrationControlFactory,
00082     const std::string &integrationControlName
00083     );
00084 
00086   void setStepperBuilder(
00087     const RCP<StepperBuilder<Scalar> > &stepperBuilder
00088     );
00089 
00091   RCP<StepperBuilder<Scalar> > getStepperBuilder();
00092 
00094   void setRKButcherTableauBuilder(
00095       const RCP<RKButcherTableauBuilder<Scalar> > & rkbtBuilder
00096       );
00097 
00099   void setStepControlFactory(
00100     const RCP<const AbstractFactory<StepControlStrategyBase<Scalar> > > &stepControlStrategyFactory,
00101     const std::string &stepControlName
00102     );
00103 
00105   void setInterpolationBufferFactory(
00106     const RCP<const AbstractFactory<InterpolationBufferBase<Scalar> > > &interpolationBufferFactory,
00107     const std::string &interpolationBufferName
00108     );
00109 
00111   void setInterpolationBufferAppenderFactory(
00112     const RCP<const AbstractFactory<InterpolationBufferAppenderBase<Scalar> > > &interpolationBufferAppenderFactory,
00113     const std::string &interpolationBufferAppenderName
00114     );
00115 
00117   void setErrWtVecCalcFactory(
00118     const RCP<const AbstractFactory<ErrWtVecCalcBase<Scalar> > > &errWtVecCalcFactory,
00119     const std::string &errWtVecCalcFactoryName
00120     );
00121   
00123   void setInterpolatorFactory(
00124     const RCP<const AbstractFactory<InterpolatorBase<Scalar> > > &interpolatorFactory,
00125     const std::string &interpolatorFactoryName
00126     );
00127   
00129   void setWFactoryObject(
00130     const RCP<Thyra::LinearOpWithSolveFactoryBase<Scalar> > &wFactoryObject
00131     );
00132   
00147   RCP<IntegratorBase<Scalar> > create(
00148     const RCP<const Thyra::ModelEvaluator<Scalar> > model,
00149     const Thyra::ModelEvaluatorBase::InArgs<Scalar> &initialCondition,
00150     const RCP<Thyra::NonlinearSolverBase<Scalar> > nlSolver
00151     ) const;
00152   
00155 
00157   void setParameterList(const RCP<Teuchos::ParameterList> & paramList);
00158   
00160   RCP<const Teuchos::ParameterList> getValidParameters() const;
00161 
00163   RCP<ParameterList> getNonconstParameterList();
00164 
00166   RCP<ParameterList> unsetParameterList();
00167   
00169   RCP<const ParameterList> getParameterList() const;
00170  
00172 
00173 private:
00174 
00175   // //////////////////////////////////////
00176   // Private data members
00177 
00178   RCP<Teuchos::ObjectBuilder<IntegratorBase<Scalar> > > integratorBuilder_;
00179   RCP<Teuchos::ObjectBuilder<IntegrationControlStrategyBase<Scalar> > > integrationControlBuilder_;
00180   RCP<StepperBuilder<Scalar> > stepperBuilder_;
00181   RCP<RKButcherTableauBuilder<Scalar> > rkbtBuilder_;
00182   RCP<Teuchos::ObjectBuilder<StepControlStrategyBase<Scalar> > > stepControlBuilder_;
00183   RCP<Teuchos::ObjectBuilder<InterpolationBufferBase<Scalar> > > interpolationBufferBuilder_;
00184   RCP<Teuchos::ObjectBuilder<InterpolationBufferAppenderBase<Scalar> > > interpolationBufferAppenderBuilder_;
00185   RCP<Teuchos::ObjectBuilder<ErrWtVecCalcBase<Scalar> > > errWtVecCalcBuilder_;
00186   RCP<Teuchos::ObjectBuilder<InterpolatorBase<Scalar> > > interpolatorBuilder_;
00187 
00188   RCP<Thyra::LinearOpWithSolveFactoryBase<Scalar> > wFactoryObject_;
00189 
00190   RCP<ParameterList> paramList_;
00191   mutable RCP<ParameterList> validPL_;
00192 
00193   // //////////////////////////////////////
00194   // Private member functions
00195 
00196   void initializeDefaults_();
00197 
00198 };
00199 
00200 
00205 template<class Scalar>
00206 RCP<IntegratorBuilder<Scalar> > integratorBuilder();
00207 
00208 
00213 template<class Scalar>
00214 RCP<IntegratorBuilder<Scalar> >
00215 integratorBuilder(const RCP<ParameterList> &paramList);
00216 
00222 template<class Scalar>
00223 RCP<IntegratorBase<Scalar> > createForwardSensitivityIntegrator(
00224     const RCP<const Thyra::ModelEvaluator<Scalar> >& model,
00225     const int& p_index,
00226     const Thyra::ModelEvaluatorBase::InArgs<Scalar>& model_ic,
00227     const RCP<Thyra::NonlinearSolverBase<Scalar> >& nlSolver,
00228     const RCP<ParameterList>& integratorBuilderPL
00229     );
00230 
00231 } // namespace Rythmos
00232 
00233 #endif //Rythmos_INTEGRATOR_BUILDER_DECL_H
00234 

Generated on Wed May 12 21:25:43 2010 for Rythmos - Transient Integration for Differential Equations by  doxygen 1.4.7