Rythmos_ExplicitRKStepper_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_ExplicitRK_STEPPER_DECL_H
00030 #define Rythmos_ExplicitRK_STEPPER_DECL_H
00031 
00032 #include "Rythmos_RKButcherTableauAcceptingStepperBase.hpp"
00033 #include "Rythmos_RKButcherTableauBase.hpp"
00034 #include "Rythmos_Types.hpp"
00035 #include "Thyra_ModelEvaluator.hpp"
00036 
00037 namespace Rythmos {
00038 
00040 template<class Scalar>
00041 class ExplicitRKStepper : virtual public RKButcherTableauAcceptingStepperBase<Scalar>
00042 {
00043   public:
00044     typedef Teuchos::ScalarTraits<Scalar> ST;
00045     typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType ScalarMag;
00046     
00048     ExplicitRKStepper();
00049 
00052     
00054     bool supportsCloning() const;
00055 
00057     RCP<StepperBase<Scalar> > cloneStepperAlgorithm() const;
00058     
00060 
00063 
00065     void setRKButcherTableau(const RCP<const RKButcherTableauBase<Scalar> > &rkbt);
00066 
00068     RCP<const RKButcherTableauBase<Scalar> > getRKButcherTableau() const;
00069 
00071 
00073     Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> > get_x_space() const;
00074 
00076     void setModel(const Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> > &model);
00077 
00079     Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >
00080     getModel() const;
00081     
00083     ~ExplicitRKStepper();
00084 
00086     void setInitialCondition(
00087       const Thyra::ModelEvaluatorBase::InArgs<Scalar> &initialCondition
00088       );
00089 
00091     Scalar takeStep(Scalar dt, StepSizeType flag);
00092 
00094     const StepStatus<Scalar> getStepStatus() const;
00095 
00097     void describe(
00098         Teuchos::FancyOStream &out,
00099         const Teuchos::EVerbosityLevel verbLevel
00100         ) const;
00101 
00104     void addPoints(
00105       const Array<Scalar>& time_vec
00106       ,const Array<Teuchos::RCP<const Thyra::VectorBase<Scalar> > >& x_vec
00107       ,const Array<Teuchos::RCP<const Thyra::VectorBase<Scalar> > >& xdot_vec
00108       );
00109 
00111     void getPoints(
00112       const Array<Scalar>& time_vec
00113       ,Array<RCP<const VectorBase<Scalar> > >* x_vec
00114       ,Array<RCP<const VectorBase<Scalar> > >* xdot_vec
00115       ,Array<ScalarMag>* accuracy_vec) const;
00116 
00118     TimeRange<Scalar> getTimeRange() const;
00119 
00121     void getNodes(Array<Scalar>* time_vec) const;
00122 
00124     void removeNodes(Array<Scalar>& time_vec);
00125 
00127     int getOrder() const;
00128 
00130 
00131     void setParameterList(Teuchos::RCP<Teuchos::ParameterList> const& paramList);
00132 
00134     Teuchos::RCP<Teuchos::ParameterList> getNonconstParameterList();
00135 
00137     Teuchos::RCP<Teuchos::ParameterList> unsetParameterList();
00138     
00140     RCP<const Teuchos::ParameterList> getValidParameters() const;
00141 
00142   private:
00143 
00144     Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> > model_;
00145     Teuchos::RCP<Thyra::VectorBase<Scalar> > solution_vector_;
00146     Teuchos::RCP<Thyra::VectorBase<Scalar> > solution_vector_old_;
00147     Array<Teuchos::RCP<Thyra::VectorBase<Scalar> > > k_vector_;
00148     Teuchos::RCP<Thyra::VectorBase<Scalar> > ktemp_vector_;
00149 
00150     Thyra::ModelEvaluatorBase::InArgs<Scalar> basePoint_;
00151 
00152     RCP<const RKButcherTableauBase<Scalar> > erkButcherTableau_;
00153 
00154     Scalar t_;
00155     Scalar t_old_;
00156     Scalar dt_;
00157     int numSteps_;
00158 
00159     Teuchos::RCP<Teuchos::ParameterList> parameterList_;
00160 
00161     bool isInitialized_;
00162 
00163     bool haveInitialCondition_;
00164 
00165     // Private member functions:
00166     void defaultInitializeAll_();
00167     void initialize_();
00168 
00169 };
00170 
00171 // Non-member constructors
00172 template<class Scalar>
00173 RCP<ExplicitRKStepper<Scalar> > explicitRKStepper();
00174 
00175 template<class Scalar>
00176 RCP<ExplicitRKStepper<Scalar> > explicitRKStepper(
00177     const Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> > &model 
00178     );
00179 
00180 template<class Scalar>
00181 RCP<ExplicitRKStepper<Scalar> > explicitRKStepper(
00182     const Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> > &model,
00183     const RCP<const RKButcherTableauBase<Scalar> > &rkbt 
00184     );
00185 
00186 } // namespace Rythmos
00187 
00188 #endif //Rythmos_ExplicitRK_STEPPER_DECL_H
00189 

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