include/deal.II/algorithms/theta_timestepping.h

00001 //---------------------------------------------------------------------------
00002 //    @f$Id: theta_timestepping.h 25345 2012-03-31 08:37:04Z bangerth @f$
00003 //
00004 //    Copyright (C) 2010, 2012 by the deal.II authors
00005 //
00006 //    This file is subject to QPL and may not be  distributed
00007 //    without copyright and license information. Please refer
00008 //    to the file deal.II/doc/license.html for the  text  and
00009 //    further information on this license.
00010 //
00011 //---------------------------------------------------------------------------
00012 
00013 #ifndef __deal2__theta_timestepping_h
00014 #define __deal2__theta_timestepping_h
00015 
00016 #include <deal.II/base/smartpointer.h>
00017 #include <deal.II/algorithms/operator.h>
00018 #include <deal.II/algorithms/timestep_control.h>
00019 
00020 DEAL_II_NAMESPACE_OPEN
00021 
00022 class ParameterHandler;
00023 
00024 namespace Algorithms
00025 {
00036   struct TimestepData
00037   {
00039       double time;
00041       double step;
00042   };
00043 
00167   template <class VECTOR>
00168   class ThetaTimestepping : public Operator<VECTOR>
00169   {
00170     public:
00178       ThetaTimestepping (Operator<VECTOR>& op_explicit,
00179                          Operator<VECTOR>& op_implicit);
00180 
00186       virtual void operator() (NamedData<VECTOR*>& out, const NamedData<VECTOR*>& in);
00187 
00192       virtual void notify(const Event&);
00193 
00201       void set_output(OutputOperator<VECTOR>& output);
00202 
00203       void declare_parameters (ParameterHandler& param);
00204       void initialize (ParameterHandler& param);
00209       const double& current_time() const;
00213       const double& step_size() const;
00218       const double& theta() const;
00219 
00231       const TimestepData& explicit_data() const;
00232 
00244       const TimestepData& implicit_data() const;
00245 
00249       TimestepControl& timestep_control();
00250 
00251     private:
00257       TimestepControl control;
00258 
00263       double vtheta;
00268       bool adaptive;
00269 
00274       TimestepData d_explicit;
00275 
00280       TimestepData d_implicit;
00281 
00282 
00303       SmartPointer<Operator<VECTOR>, ThetaTimestepping<VECTOR> > op_explicit;
00304 
00326       SmartPointer<Operator<VECTOR>, ThetaTimestepping<VECTOR> > op_implicit;
00327 
00332       SmartPointer<OutputOperator<VECTOR>, ThetaTimestepping<VECTOR> > output;
00333   };
00334 
00335 
00336   template <class VECTOR>
00337   inline
00338   const TimestepData&
00339   ThetaTimestepping<VECTOR>::explicit_data () const
00340   {
00341     return d_explicit;
00342   }
00343 
00344 
00345   template <class VECTOR>
00346   inline
00347   const TimestepData&
00348   ThetaTimestepping<VECTOR>::implicit_data () const
00349   {
00350     return d_implicit;
00351   }
00352 
00353   template <class VECTOR>
00354   inline
00355   void ThetaTimestepping<VECTOR>::set_output (OutputOperator<VECTOR>& out)
00356   {
00357     output = &out;
00358   }
00359 }
00360 
00361 DEAL_II_NAMESPACE_CLOSE
00362 
00363 #endif
00364 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

deal.II documentation generated on Thu May 17 2012 20:04:34 by doxygen 1.7.3