Poster of Linux kernelThe best gift for a Linux geek
Transient

Transient

Section: C Library Functions (3) Updated: Thu Apr 7 2011
Local index Up
 

NAME

Transient -  

SYNOPSIS


#include <transient.h>  

Public Member Functions


Transient (EquationSystems &es)

Transient (EquationSystems &es, const std::string &name, const unsigned int number)

~Transient ()

virtual void solve ()

Real time () const

Real t_end () const

Real & t_end ()

Real dt () const

Real & dt ()

unsigned int time_step () const

unsigned int max_time_steps () const

unsigned int & max_time_steps ()
 

Protected Member Functions


Real & time ()

unsigned int & time_step ()
 

Private Attributes


Real _time

Real _t_end

Real _dt

unsigned int _time_step

unsigned int _max_time_steps
 

Detailed Description

 

template<class T = Linear<>> class Transient< T >

This is a generic class that defines a transient to be used in a simulation. A user can define a transient by deriving from this class and implementing certain functions.

Author:

Benjamin S. Kirk, 2003-2004.

Definition at line 44 of file transient.h.  

Constructor & Destructor Documentation

 

template<class T > Transient< T >::Transient (EquationSystems &es) [inline]Constructor. Requires a reference to a system to be solved.

Definition at line 160 of file transient.h.

                                           :
  T               (es),   // Call the base class constructor
  _time           (0.),   // Default solver attributes
  _t_end          (1.e20),
  _dt             (1.e-2),
  _time_step      (0),
  _max_time_steps (5)
{
}
 

template<class T > Transient< T >::Transient (EquationSystems &es, const std::string &name, const unsigned intnumber) [inline]Constructor. Requires a referece to the EquationSystems object.

Definition at line 174 of file transient.h.

                                                    :
  Transient (es),
  T         (es, name, number)
{
}
 

template<class T > Transient< T >::~Transient () [inline]Destructor.

Definition at line 186 of file transient.h.

{
}
 

Member Function Documentation

 

template<class T = Linear<>> Real Transient< T >::dt () const [inline]Returns:

the time step used to advance the solution.

Definition at line 88 of file transient.h.

References Transient< T >::_dt.

{ return _dt; }
 

template<class T = Linear<>> Real& Transient< T >::dt () [inline]Set the time step.

Definition at line 93 of file transient.h.

References Transient< T >::_dt.

{ return _dt; }
 

template<class T = Linear<>> unsigned int Transient< T >::max_time_steps () const [inline]Returns:

the maximum number of time steps to take.

Definition at line 103 of file transient.h.

References Transient< T >::_max_time_steps.

{ return _max_time_steps; }
 

template<class T = Linear<>> unsigned int& Transient< T >::max_time_steps () [inline]Sets the maximum number of time steps to take.

Definition at line 108 of file transient.h.

References Transient< T >::_max_time_steps.

{ return _max_time_steps; }
 

template<class T > void Transient< T >::solve () [inline, virtual]Re-implement the solve member to do solve a transient system.

Definition at line 194 of file transient.h.

{
  do
    {
      // Incriment the time step counter
      this->time_step()++;

      // Incriment the time counter
      this->time() += this->dt();
      
      std::cout << 'Solving time step '
                << this->time_step()
                << std::endl;

      // Call the base class solver
      T::solve ();      
    }
  while ((this->time_step() < this->max_time_steps()) &&
         (this->time()      < this->t_end()));
}
 

template<class T = Linear<>> Real& Transient< T >::t_end () [inline]Sets the target simulation time.

Definition at line 83 of file transient.h.

References Transient< T >::_t_end.

{ return _t_end; }
 

template<class T = Linear<>> Real Transient< T >::t_end () const [inline]Returns:

the target simulation time.

Definition at line 78 of file transient.h.

References Transient< T >::_t_end.

{ return _t_end; }
 

template<class T = Linear<>> Real Transient< T >::time () const [inline]Returns:

the current time.

Definition at line 73 of file transient.h.

References Transient< T >::_time.

{ return _time; }
 

template<class T = Linear<>> Real& Transient< T >::time () [inline, protected]Set the current time. Only to be used by this and derived classes.

Definition at line 117 of file transient.h.

References Transient< T >::_time.

{ return _time; }
 

template<class T = Linear<>> unsigned int& Transient< T >::time_step () [inline, protected]Set the current time step. Only to be used by this and derived classes.

Definition at line 123 of file transient.h.

References Transient< T >::_time_step.

{ return _time_step; }
 

template<class T = Linear<>> unsigned int Transient< T >::time_step () const [inline]Returns:

the current time step (0,1,2...)

Definition at line 98 of file transient.h.

References Transient< T >::_time_step.

{ return _time_step; }
 

Member Data Documentation

 

template<class T = Linear<>> Real Transient< T >::_dt [private]The time incriment used to advance the solution.

Definition at line 141 of file transient.h.

Referenced by Transient< T >::dt().  

template<class T = Linear<>> unsigned int Transient< T >::_max_time_steps [private]The maximum number of time steps to take.

Definition at line 151 of file transient.h.

Referenced by Transient< T >::max_time_steps().  

template<class T = Linear<>> Real Transient< T >::_t_end [private]The time at which the simulation will be terminated.

Definition at line 136 of file transient.h.

Referenced by Transient< T >::t_end().  

template<class T = Linear<>> Real Transient< T >::_time [private]The current time.

Definition at line 131 of file transient.h.

Referenced by Transient< T >::time().  

template<class T = Linear<>> unsigned int Transient< T >::_time_step [private]The current time step.

Definition at line 146 of file transient.h.

Referenced by Transient< T >::time_step().

 

Author

Generated automatically by Doxygen for libMesh from the source code.


 

Index

NAME
SYNOPSIS
Public Member Functions
Protected Member Functions
Private Attributes
Detailed Description
template<class T = Linear<>> class Transient< T >
Constructor & Destructor Documentation
template<class T > Transient< T >::Transient (EquationSystems &es) [inline]Constructor. Requires a reference to a system to be solved.
template<class T > Transient< T >::Transient (EquationSystems &es, const std::string &name, const unsigned intnumber) [inline]Constructor. Requires a referece to the EquationSystems object.
template<class T > Transient< T >::~Transient () [inline]Destructor.
Member Function Documentation
template<class T = Linear<>> Real Transient< T >::dt () const [inline]Returns:
template<class T = Linear<>> Real& Transient< T >::dt () [inline]Set the time step.
template<class T = Linear<>> unsigned int Transient< T >::max_time_steps () const [inline]Returns:
template<class T = Linear<>> unsigned int& Transient< T >::max_time_steps () [inline]Sets the maximum number of time steps to take.
template<class T > void Transient< T >::solve () [inline, virtual]Re-implement the solve member to do solve a transient system.
template<class T = Linear<>> Real& Transient< T >::t_end () [inline]Sets the target simulation time.
template<class T = Linear<>> Real Transient< T >::t_end () const [inline]Returns:
template<class T = Linear<>> Real Transient< T >::time () const [inline]Returns:
template<class T = Linear<>> Real& Transient< T >::time () [inline, protected]Set the current time. Only to be used by this and derived classes.
template<class T = Linear<>> unsigned int& Transient< T >::time_step () [inline, protected]Set the current time step. Only to be used by this and derived classes.
template<class T = Linear<>> unsigned int Transient< T >::time_step () const [inline]Returns:
Member Data Documentation
template<class T = Linear<>> Real Transient< T >::_dt [private]The time incriment used to advance the solution.
template<class T = Linear<>> unsigned int Transient< T >::_max_time_steps [private]The maximum number of time steps to take.
template<class T = Linear<>> Real Transient< T >::_t_end [private]The time at which the simulation will be terminated.
template<class T = Linear<>> Real Transient< T >::_time [private]The current time.
template<class T = Linear<>> unsigned int Transient< T >::_time_step [private]The current time step.
Author

This document was created by man2html, using the manual pages.
Time: 21:57:45 GMT, April 16, 2011