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 &)=delete
 Broken copy constructor. More...
 
void operator= (const Time &)=delete
 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)
 Return the value of the t-th stored timestep (t=0: present; t>0: previous). More...
 
double dt (const unsigned &t=0) const
 Return the value of the t-th stored timestep (t=0: present; t>0: previous), const version. More...
 
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 62 of file timesteppers.h.

Constructor & Destructor Documentation

◆ Time() [1/3]

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 74 of file timesteppers.h.

◆ Time() [2/3]

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 78 of file timesteppers.h.

References Dt, and ndt().

◆ Time() [3/3]

oomph::Time::Time ( const Time )
delete

Broken copy constructor.

◆ ~Time()

oomph::Time::~Time ( )
inline

Destructor: empty.

Definition at line 120 of file timesteppers.h.

Member Function Documentation

◆ dt() [1/2]

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

◆ dt() [2/2]

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 143 of file timesteppers.h.

References Dt, and t.

◆ initialise_dt() [1/2]

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

Set all timesteps to the same value, dt.

Definition at line 99 of file timesteppers.h.

References Dt, and ndt().

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

◆ initialise_dt() [2/2]

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 107 of file timesteppers.h.

References Dt, and i.

◆ ndt()

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

Return the number of timesteps stored.

Definition at line 129 of file timesteppers.h.

References Dt.

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

◆ operator=()

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

Broken assignment operator.

◆ resize()

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 93 of file timesteppers.h.

References Dt.

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

◆ shift_dt()

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 174 of file timesteppers.h.

References Dt, and i.

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

◆ time() [1/2]

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

Return the current value of the continuous time.

Definition at line 123 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::LinearElasticityEquationsBase< DIM >::body_force(), oomph::TimeHarmonicLinearElasticityEquationsBase< DIM >::body_force(), oomph::PVDEquationsBase< DIM >::body_force(), oomph::TimeStepper::check_predicted_values_up_to_date(), oomph::Problem::copy(), oomph::Problem::doubly_adaptive_unsteady_newton_solve_helper(), oomph::Problem::dump(), oomph::AxisymmetricLinearElasticityEquations::fill_in_generic_contribution_to_residuals_axisymmetric_linear_elasticity(), oomph::AxisymmetricPoroelasticityEquations::fill_in_generic_residual_contribution(), oomph::AxisymmetricNavierStokesEquations::fill_in_generic_residual_contribution_axi_nst(), oomph::RefineableAxisymmetricNavierStokesEquations::fill_in_generic_residual_contribution_axi_nst(), oomph::GeneralisedNewtonianAxisymmetricNavierStokesEquations::fill_in_generic_residual_contribution_axi_nst(), oomph::RefineableGeneralisedNewtonianAxisymmetricNavierStokesEquations::fill_in_generic_residual_contribution_axi_nst(), oomph::PeriodicOrbitEquations::fill_in_generic_residual_contribution_orbit(), oomph::RefineableSphericalNavierStokesEquations::fill_in_generic_residual_contribution_spherical_nst(), oomph::SphericalNavierStokesEquations::fill_in_generic_residual_contribution_spherical_nst(), oomph::AxisymmetricNavierStokesEquations::get_dresidual_dnodal_coordinates(), oomph::RefineableAxisymmetricNavierStokesEquations::get_dresidual_dnodal_coordinates(), oomph::GeneralisedNewtonianAxisymmetricNavierStokesEquations::get_dresidual_dnodal_coordinates(), oomph::RefineableGeneralisedNewtonianAxisymmetricNavierStokesEquations::get_dresidual_dnodal_coordinates(), oomph::AdvectionDiffusionReactionEquations< NREAGENT, DIM >::get_wind_adv_diff_react(), oomph::PeriodicOrbitEquations::orbit_output(), oomph::AxisymmetricLinearElasticityTractionElement< ELEMENT >::output(), oomph::AxisymmetricNavierStokesTractionElement< ELEMENT >::output(), oomph::AxisymmetricPoroelasticityTractionElement< 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::Problem::time(), oomph::TimeStepper::time(), oomph::PeriodicOrbitEquations::time(), oomph::Problem::unsteady_newton_solve(), oomph::SegregatableFSIProblem::unsteady_segregated_solve(), and oomph::PseudoBucklingRing::veloc().

◆ time() [2/2]

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 150 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

◆ Continuous_time

double oomph::Time::Continuous_time
private

Pointer to the value of the continuous time.

Definition at line 66 of file timesteppers.h.

Referenced by time().

◆ Dt

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

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

Definition at line 69 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: