Rythmos_StepperBase_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 #ifndef Rythmos_STEPPER_BASE_DECL_H
00030 #define Rythmos_STEPPER_BASE_DECL_H
00031 
00032 
00033 #include "Rythmos_InterpolationBufferBase.hpp"
00034 #include "Rythmos_StepperSupportTypes.hpp"
00035 #include "Rythmos_Types.hpp"
00036 #include "Teuchos_Describable.hpp"
00037 #include "Thyra_ModelEvaluator.hpp"
00038 
00039 
00040 namespace Rythmos {
00041 
00042 namespace {
00043   const std::string RythmosStepControlSettings_name = "Step Control Settings";
00044 }
00045 
00077 template<class Scalar> 
00078 class StepperBase : virtual public InterpolationBufferBase<Scalar>
00079 {
00080 public:
00081 
00089   virtual bool supportsCloning() const;
00090 
00111   virtual RCP<StepperBase<Scalar> > cloneStepperAlgorithm() const;
00112 
00118   virtual bool isImplicit() const;
00119 
00130   virtual bool acceptsModel() const;
00131     
00166   virtual void setModel(
00167     const RCP<const Thyra::ModelEvaluator<Scalar> >& model
00168     ) = 0;
00169 
00170 
00181   virtual void setNonconstModel(
00182     const RCP<Thyra::ModelEvaluator<Scalar> >& model
00183     ) = 0;
00184 
00185 
00189   virtual bool modelIsConst() const  { return true; }
00190    
00191   // 2009/09/05: rabartl: ToDo: Make setModel(const model) and modelIsConst()
00192   // pure virtual and make all subclasses implement them.  All subclasses will
00193   // need to use the Teuchos::ConstNonconstObjectContainer class to make this
00194   // work.  See Rythmos::ForwardSensitivityStepper and Rythmos::BackwardEuler
00195   // to see how this works.
00196  
00204   virtual RCP<const Thyra::ModelEvaluator<Scalar> >
00205   getModel() const = 0;
00206 
00209   virtual RCP<Thyra::ModelEvaluator<Scalar> >
00210   getNonconstModel() = 0;
00211 
00230   virtual void setInitialCondition(
00231     const Thyra::ModelEvaluatorBase::InArgs<Scalar> &initialCondition
00232     ) = 0;
00233   
00240   virtual Thyra::ModelEvaluatorBase::InArgs<Scalar> 
00241     getInitialCondition() const = 0;
00242   
00271   virtual Scalar takeStep(Scalar dt, StepSizeType stepType) = 0;
00272 
00284   virtual const StepStatus<Scalar> getStepStatus() const = 0;
00285 
00299   virtual void setStepControlData(const StepperBase & stepper);
00300 
00301 };
00302 
00303 
00308 template<class Scalar>
00309 bool isInitialized( const StepperBase<Scalar>& stepper );
00310 
00311 
00312 } // namespace Rythmos
00313 
00314 #endif //Rythmos_STEPPER_BASE_DECL_H
 All Classes Functions Variables Typedefs Friends
Generated on Wed Apr 13 09:58:54 2011 for Rythmos - Transient Integration for Differential Equations by  doxygen 1.6.3