Transient (EquationSystems &es, const std::string &name, const unsigned int number)
~Transient ()
virtual void solve ()
Realtime () const
Realt_end () const
Real & t_end ()
Realdt () 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<>> RealTransient< 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<>> RealTransient< 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<>> RealTransient< 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<>> RealTransient< 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<>> RealTransient< 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<>> RealTransient< 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.