Rythmos - Transient Integration for Differential Equations Version of the Day
Rythmos_StepperHelpers_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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
00023 // USA
00024 // Questions? Contact Todd S. Coffey (tscoffe@sandia.gov)
00025 //
00026 // ***********************************************************************
00027 //@HEADER
00028 
00029 #ifndef RYTHMOS_STEPPER_HELPERS_DECL_HPP
00030 #define RYTHMOS_STEPPER_HELPERS_DECL_HPP
00031 
00032 
00033 #include "Rythmos_Types.hpp"
00034 #include "Rythmos_StepperBase.hpp"
00035 #include "Thyra_ModelEvaluator.hpp"
00036 #include "Rythmos_InterpolatorBase.hpp"
00037 #include "Teuchos_ConstNonconstObjectContainer.hpp"
00038 
00039 namespace Rythmos {
00040 
00041 
00045 template<class Scalar>
00046 void assertValidModel(
00047   const StepperBase<Scalar>& stepper,
00048   const Thyra::ModelEvaluator<Scalar>& model
00049   );
00050 
00051 
00058 template<class Scalar>
00059 bool setDefaultInitialConditionFromNominalValues(
00060   const Thyra::ModelEvaluator<Scalar>& model,
00061   const Ptr<StepperBase<Scalar> >& stepper
00062   );
00063 
00071 template<class Scalar>
00072 void restart( StepperBase<Scalar> *stepper );
00073 
00074 template<class Scalar>
00075 void eval_model_explicit(
00076     const Thyra::ModelEvaluator<Scalar> &model,
00077     Thyra::ModelEvaluatorBase::InArgs<Scalar> &basePoint,
00078     const VectorBase<Scalar>& x_in,
00079     const typename Thyra::ModelEvaluatorBase::InArgs<Scalar>::ScalarMag &t_in,
00080     const Ptr<VectorBase<Scalar> >& f_out
00081     );
00082 
00083 
00084 #ifdef HAVE_THYRA_ME_POLYNOMIAL
00085 
00086 
00087 template<class Scalar>
00088 void eval_model_explicit_poly(
00089     const Thyra::ModelEvaluator<Scalar> &model,
00090     Thyra::ModelEvaluatorBase::InArgs<Scalar> &basePoint,
00091     const Teuchos::Polynomial< VectorBase<Scalar> > &x_poly,
00092     const typename Thyra::ModelEvaluatorBase::InArgs<Scalar>::ScalarMag &t,
00093     const Ptr<Teuchos::Polynomial<VectorBase<Scalar> > >& f_poly
00094     );
00095 
00096 
00097 #endif // HAVE_THYRA_ME_POLYNOMIAL
00098 
00099 
00100 // This function simply returns the boundary points if they're asked for.  Otherwise it throws.
00101 template<class Scalar>
00102 void defaultGetPoints(
00103     const Scalar& t_old, // required inArg
00104     const Ptr<const VectorBase<Scalar> >& x_old, // optional inArg
00105     const Ptr<const VectorBase<Scalar> >& xdot_old, // optional inArg
00106     const Scalar& t, // required inArg
00107     const Ptr<const VectorBase<Scalar> >& x, // optional inArg
00108     const Ptr<const VectorBase<Scalar> >& xdot, // optional inArg
00109     const Array<Scalar>& time_vec, // required inArg
00110     const Ptr<Array<Teuchos::RCP<const Thyra::VectorBase<Scalar> > > >& x_vec, // optional outArg
00111     const Ptr<Array<Teuchos::RCP<const Thyra::VectorBase<Scalar> > > >& xdot_vec, // optional outArg
00112     const Ptr<Array<typename Teuchos::ScalarTraits<Scalar>::magnitudeType> >& accuracy_vec, // optional outArg
00113     const Ptr<InterpolatorBase<Scalar> > interpolator // optional inArg (note:  not const)
00114     );
00115 
00116 // This function sets a model on a stepper by creating the appropriate
00117 // ConstNonconstObjectContainer object.
00118 template<class Scalar>
00119   void setStepperModel(
00120       const Ptr<StepperBase<Scalar> >& stepper,
00121       const RCP<const Thyra::ModelEvaluator<Scalar> >& model
00122       );
00123 
00124 template<class Scalar>
00125   void setStepperModel(
00126       const Ptr<StepperBase<Scalar> >& stepper,
00127       const RCP<Thyra::ModelEvaluator<Scalar> >& model
00128       );
00129 
00130 template<class Scalar>
00131   void setStepperModel(
00132       const Ptr<StepperBase<Scalar> >& stepper,
00133       Teuchos::ConstNonconstObjectContainer<Thyra::ModelEvaluator<Scalar> >& 
00134         model
00135       );
00136 
00137 
00138 } // namespace Rythmos
00139 
00140 
00141 #endif // RYTHMOS_STEPPER_HELPERS_DECL_HPP
 All Classes Functions Variables Typedefs Friends