Public Member Functions | Private Attributes | List of all members
oomph::Time Class Reference

Class to keep track of discrete/continous time. It is essential to have a single Time object when using multiple time-stepping schemes; e.g., in fluid-structure interaction problems, it is common to use different schemes for the fluid and solid domains. Storage is allocated for the current value of the (continuous) time and a limited history of previous timesteps. The number of previous timesteps must be equal to the number required by the "highest order" scheme. More...

#include <timesteppers.h>

Public Member Functions

 Time ()
 Constructor: Do not allocate any storage for previous timesteps, but set the initial value of the time to zero. More...
 
 Time (const unsigned &ndt)
 Constructor: Pass the number of timesteps to be stored and set the initial value of time to zero. More...
 
 Time (const Time &)
 Broken copy constructor. More...
 
void operator= (const Time &)
 Broken assignment operator. More...
 
void resize (const unsigned &n_dt)
 Resize the vector holding the number of previous timesteps and initialise the new values to zero. More...
 
void initialise_dt (const double &dt_)
 Set all timesteps to the same value, dt. More...
 
void initialise_dt (const Vector< double > &dt_)
 Set the value of the timesteps to be equal to the values passed in a vector. More...
 
 ~Time ()
 Destructor: empty. More...
 
double & time ()
 Return the current value of the continuous time. More...
 
unsigned ndt () const
 Return the number of timesteps stored. More...
 
double & dt (const unsigned &t=0)
 
double dt (const unsigned &t=0) const
 
double time (const unsigned &t=0) const
 Return the value of the continuous time at the t-th previous time level (t=0: current; t>0 previous). More...
 
void shift_dt ()
 Update all stored values of dt by shifting each value along the array. This function must be called before starting to solve at a new time level. More...
 

Private Attributes

double Continuous_time
 Pointer to the value of the continuous time. More...
 
Vector< double > Dt
 Vector that stores the values of the current and previous timesteps. More...
 

Detailed Description

Class to keep track of discrete/continous time. It is essential to have a single Time object when using multiple time-stepping schemes; e.g., in fluid-structure interaction problems, it is common to use different schemes for the fluid and solid domains. Storage is allocated for the current value of the (continuous) time and a limited history of previous timesteps. The number of previous timesteps must be equal to the number required by the "highest order" scheme.

Definition at line 67 of file timesteppers.h.

Constructor & Destructor Documentation

oomph::Time::Time ( )
inline

Constructor: Do not allocate any storage for previous timesteps, but set the initial value of the time to zero.

Definition at line 81 of file timesteppers.h.

oomph::Time::Time ( const unsigned &  ndt)
inline

Constructor: Pass the number of timesteps to be stored and set the initial value of time to zero.

Definition at line 85 of file timesteppers.h.

References Dt.

oomph::Time::Time ( const Time )
inline

Broken copy constructor.

Definition at line 93 of file timesteppers.h.

References oomph::BrokenCopy::broken_copy().

oomph::Time::~Time ( )
inline

Destructor: empty.

Definition at line 127 of file timesteppers.h.

Member Function Documentation

double& oomph::Time::dt ( const unsigned &  t = 0)
inline
double oomph::Time::dt ( const unsigned &  t = 0) const
inline

Return the value of the t-th stored timestep (t=0: present; t>0: previous), const version.

Definition at line 141 of file timesteppers.h.

References Dt, and t.

void oomph::Time::initialise_dt ( const double &  dt_)
inline

Set all timesteps to the same value, dt.

Definition at line 109 of file timesteppers.h.

References Dt, and ndt().

Referenced by oomph::Problem::initialise_dt().

void oomph::Time::initialise_dt ( const Vector< double > &  dt_)
inline

Set the value of the timesteps to be equal to the values passed in a vector.

Definition at line 117 of file timesteppers.h.

References Dt, and i.

unsigned oomph::Time::ndt ( ) const
inline

Return the number of timesteps stored.

Definition at line 133 of file timesteppers.h.

References Dt.

Referenced by oomph::Problem::add_time_stepper_pt(), oomph::Problem::copy(), oomph::Problem::dump(), initialise_dt(), and time().

void oomph::Time::operator= ( const Time )
inline

Broken assignment operator.

Definition at line 99 of file timesteppers.h.

References oomph::BrokenCopy::broken_assign().

void oomph::Time::resize ( const unsigned &  n_dt)
inline

Resize the vector holding the number of previous timesteps and initialise the new values to zero.

Definition at line 106 of file timesteppers.h.

References Dt.

Referenced by oomph::Problem::add_time_stepper_pt(), oomph::Problem::copy(), and oomph::Problem::read().

void oomph::Time::shift_dt ( )
inline

Update all stored values of dt by shifting each value along the array. This function must be called before starting to solve at a new time level.

Definition at line 166 of file timesteppers.h.

References Dt, and i.

Referenced by oomph::Problem::shift_time_values().

double& oomph::Time::time ( )
inline

Return the current value of the continuous time.

Definition at line 130 of file timesteppers.h.

References Continuous_time.

Referenced by oomph::PseudoBucklingRing::accel(), oomph::IMRByBDF::actions_after_timestep(), oomph::IMRByBDF::actions_before_timestep(), oomph::Problem::adaptive_unsteady_newton_solve(), oomph::PeriodicOrbitTimeDiscretisation::assign_initial_data_values(), oomph::TimeHarmonicLinearElasticityEquationsBase< DIM >::body_force(), oomph::LinearElasticityEquationsBase< DIM >::body_force(), oomph::PVDEquationsBase< DIM >::body_force(), oomph::TimeStepper::check_predicted_values_up_to_date(), oomph::Problem::copy(), oomph::Problem::dump(), oomph::AxisymmetricLinearElasticityEquations::fill_in_generic_contribution_to_residuals_axisymmetric_linear_elasticity(), oomph::AxisymmetricPoroelasticityEquations::fill_in_generic_residual_contribution(), oomph::RefineableAxisymmetricNavierStokesEquations::fill_in_generic_residual_contribution_axi_nst(), oomph::RefineableGeneralisedNewtonianAxisymmetricNavierStokesEquations::fill_in_generic_residual_contribution_axi_nst(), oomph::AxisymmetricNavierStokesEquations::fill_in_generic_residual_contribution_axi_nst(), oomph::GeneralisedNewtonianAxisymmetricNavierStokesEquations::fill_in_generic_residual_contribution_axi_nst(), oomph::PeriodicOrbitEquations::fill_in_generic_residual_contribution_orbit(), oomph::SphericalNavierStokesEquations::fill_in_generic_residual_contribution_spherical_nst(), oomph::RefineableSphericalNavierStokesEquations::fill_in_generic_residual_contribution_spherical_nst(), oomph::RefineableAxisymmetricNavierStokesEquations::get_dresidual_dnodal_coordinates(), oomph::RefineableGeneralisedNewtonianAxisymmetricNavierStokesEquations::get_dresidual_dnodal_coordinates(), oomph::AxisymmetricNavierStokesEquations::get_dresidual_dnodal_coordinates(), oomph::GeneralisedNewtonianAxisymmetricNavierStokesEquations::get_dresidual_dnodal_coordinates(), oomph::AdvectionDiffusionReactionEquations< NREAGENT, DIM >::get_wind_adv_diff_react(), oomph::PeriodicOrbitEquations::orbit_output(), oomph::AxisymmetricLinearElasticityTractionElement< ELEMENT >::output(), oomph::AxisymmetricPoroelasticityTractionElement< POROELASTICITY_BULK_ELEMENT >::output(), oomph::AxisymmetricNavierStokesTractionElement< ELEMENT >::output(), oomph::FSILinearisedAxisymPoroelasticTractionElement< POROELASTICITY_BULK_ELEMENT, NAVIER_STOKES_BULK_ELEMENT >::output(), oomph::PseudoBucklingRing::position(), oomph::Problem::read(), oomph::AxisymmetricNavierStokesTractionElement< ELEMENT >::scalar_value_paraview(), oomph::SolidICProblem::set_newmark_initial_condition_consistently(), oomph::SolidICProblem::set_newmark_initial_condition_directly(), oomph::SolidICProblem::set_static_initial_condition(), oomph::PeriodicOrbitEquations::time(), oomph::Problem::time(), oomph::Problem::unsteady_newton_solve(), oomph::SegregatableFSIProblem::unsteady_segregated_solve(), and oomph::PseudoBucklingRing::veloc().

double oomph::Time::time ( const unsigned &  t = 0) const
inline

Return the value of the continuous time at the t-th previous time level (t=0: current; t>0 previous).

Definition at line 145 of file timesteppers.h.

References Continuous_time, Dt, i, ndt(), oomph::Global_string_for_annotation::string(), t, and oomph::StringConversion::to_string().

Member Data Documentation

double oomph::Time::Continuous_time
private

Pointer to the value of the continuous time.

Definition at line 72 of file timesteppers.h.

Referenced by time().

Vector<double> oomph::Time::Dt
private

Vector that stores the values of the current and previous timesteps.

Definition at line 75 of file timesteppers.h.

Referenced by dt(), initialise_dt(), ndt(), resize(), shift_dt(), Time(), and time().


The documentation for this class was generated from the following file: